tiro-notes 0.51.88 → 0.51.90
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.
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(this["webpackJsonptiro-notes-client"]=this["webpackJsonptiro-notes-client"]||[]).push([[10],{10:function(t,e,n){"use strict";n.d(e,"a",(function(){return w}));n(441),n(442),n(443),n(444);var o=n.p+"static/media/deco-bg-map.7ca9103b.png",i=n.p+"static/media/file-solid.6415173e.svg",c=n.p+"static/media/compact-disc-solid.55b6e50c.svg",a=n.p+"static/media/file-pdf-solid.0a9d75fe.svg",r=n.p+"static/media/file-word-solid.9228e1ff.svg",l=n.p+"static/media/file-code-solid.62b467ac.svg",s=n.p+"static/media/book-solid.87f5b737.svg",u=n.p+"static/media/file-excel-solid.217d73db.svg",d=n.p+"static/media/file-video-solid.312288cf.svg",p=n.p+"static/media/file-audio-solid.a76f99f0.svg",f=n.p+"static/media/file-zipper-solid.7db57917.svg",b=n.p+"static/media/file-powerpoint-solid.4d969453.svg",g=n.p+"static/media/link-solid.7b689dbd.svg",h=n.p+"static/media/globe-africa-solid.0ad34146.svg",m=n.p+"static/media/search-solid.cc51b702.svg",v={main:"#E86666",mainFont:"#FFFFFF",bgPopup:"#FFF",bgPopup2:"#f9f9f9",bgPopup3:"#f5efef",bgTabs:"#D8D8D8",bgTab:"#D0D0D0",fontTab:"#797979",bgTabActive:"#EFEFEF",bgInterface:"#efefef",fontInterface:"#323232",bgInterface2:"#e1e1e1",fontInterface2:"#585757",bgEditor:"#FFFFFF",bgPreview:"#F7F7F7",fontEditor:"#323232",dev:["#C3668B","#A766A7","#CE66E8","#E4E866"],compl:["#11abf8","#3fd7a4"],pal1:["#5c1a70","#ffa67c","#ffda77"],grey1:"#797979",grey2:"red",green:"green",l1:{bg:"#e1e1e1",font:"#615f5f"},l2:{bg:"#eeecec",title:"#797979",text:"#615f5f",date:"#b3b2b2"},editor:{bg:"#ffffff",font:"#525252",interfaceGrey:"#d4d1d1",mobileToolbar:{bg:"#e1e1e1",font:"#747474"}},bg:{l1:"#e1e1e1",dark:"rgb(39, 39, 39)",grey:"rgb(221, 221, 221)",light:"#FFFFFF",black:"#000000"},font:{light:"#FFFFFF",black:"#000000"}},w={els:function(){return{button:"\n\t\tbackground: none;\n border: none;\n ",images:"\n\t\tborder-radius: 7px;\n box-shadow: 0px 0px 10px rgb(0 0 0 / 10%);\n max-width: 100%;\n ",imageInfos:"\n ",redButton:"\n\t\t\tborder: none;\n\t\t\tbackground: ".concat(v.main,";\n\t\t\t&:hover {\n\t\t\t\t\topacity: 0.9;\n\t\t\t}\n\t\t\tcolor: white;\n\t\t\tborder-radius: 5px;\n\t\t\tmargin-right: 5px;\n\t\t\tcursor: pointer;\n\t\t\tfont-weight: 700;\n\t\t\ttext-transform: uppercase;\n\t\t\tletter-spacing: 1px;\n ")}},colors:v,font:{main:"Helvetica neue, Open sans, arial, sans-serif",editor:"Consolas, monaco, monospace"},sizes:{desktop:{l:37,l1:37,l2:63,r:63},search:{h:94,padding:10},gallery:{topH:100},block:15,scrollbar:17,l2:{fileLi:{height:77,padding:5,margin:5,img:67}},editor:{padding:45},mobile:{bottomBarHeight:50,editorBar:40,editorTopWrapper:100}},assets:{decoBgMap:o,linkIcon:g,worldIcon:h,fileIcon:i,diskIcon:c,pdfIcon:a,presIcon:b,audioIcon:p,videoIcon:d,excelIcon:u,wordIcon:r,codeIcon:l,bookIcon:s,archiveIcon:f,searchIcon:m},anim:{time:"100ms"}}},101:function(t,e,n){"use strict";n.d(e,"a",(function(){return o}));var o=function(t){var e="none",n=t.split(".");return"7z"===(e=n[n.length-1].split("?")[0])&&(e="d7z"),e.length>10&&(e="none"),e}},102:function(t,e,n){"use strict";n.d(e,"a",(function(){return r})),n.d(e,"f",(function(){return s})),n.d(e,"g",(function(){return u})),n.d(e,"d",(function(){return d})),n.d(e,"b",(function(){return p})),n.d(e,"c",(function(){return f})),n.d(e,"e",(function(){return b}));var o=n(31),i=n(10),c=n(45),a=n(25);const r={val:!1};let l=r;const s=(t,e)=>Object(c.a)({file:t,windowId:e,pattern:/\|/gim,classWrap:t=>"md-table-limiter"}),u=(t,e)=>Object(c.a)({file:t,windowId:e,pattern:/t1.+t2/gim,classWrap:t=>"ttt4"}),d=(t,e)=>Object(c.a)({file:t,windowId:e,pattern:o.a.mdTableCell,classWrap:t=>{let e=t[0].trim();return e&&"-"===e||e&&"-|"===e||e&&e.includes("[")||e.includes("]")||e&&!e.includes("|")?"":"md-table-cell"}}),p=(t,e)=>Object(c.a)({file:t,windowId:e,pattern:o.a.mdTitle,classWrap:t=>{let e=t[1].length;return"md-title-wrapper level-".concat(e)}}),f=(t,e)=>Object(c.a)({file:t,windowId:e,pattern:o.a.mdTableLine,classWrap:t=>{let e=t[0].trim();if(e&&e.includes("[")||e.includes("]"))return"";if(e&&e.startsWith("-"))return"";e.startsWith("|")&&(e=e.substring(1)),e.endsWith("|")&&(e=e.substring(0,e.length-1));let n=e.split("|").length;return l.val=!l.val,"md-table-line md-table-".concat(n," ").concat(l.val?"even":"")}}),b=()=>{let t="";for(var e=0;e<30;e++){let n=Math.floor(100/e);t+="\n\t\t\t\t&.md-table-".concat(e," span.md-table-cell{\n\t\t\t\t\t\twidth: calc(").concat(n,"% - 15px);\n\t\t\t\t}")}return"\n.md-title-wrapper {\n\tcolor: ".concat(i.a.colors.main,";\n\t\n\t&.level-1 {\n\t\tfont-size: ").concat(Object(a.a)(5),"px;\n\t\ttext-decoration: underline;\n\t\tfont-weight: bold;\n\t}\n\t&.level-2 {\n\t\tfont-size: ").concat(Object(a.a)(3),"px;\n\t\ttext-decoration: underline;\n\t\t// font-weight: bold;\n\t}\n\t&.level-3 {\n\t\tfont-size: ").concat(Object(a.a)(2),"px;\n\t}\n}\n.md-table-preview-enabled {\n\t\t.md-table-line {\n\t\t\t\t&.even {\n\t\t\t\t\t\tbackground: #e3e3e3;\n\t\t\t\t}\n\t\t\t\tdisplay: inline-flex;\n\n\t\t\t\tdisplay: block;\n\t\t\t\tbackground: #f4f4f4;\n\t\t\t\tpadding: 5px;\n\t\t\t\t").concat(t,"\n\t\t\t\tspan.md-table-cell {\n\t\t\t\t\t\tpadding-right:13px;\n\t\t\t\t\t\tposition: relative;\n\t\t\t\t\t\tdisplay: inline-block;\n\t\t\t\t\t\tvertical-align: top;\n\t\t\t\t}\n\t\t\t\tspan.md-table-cell:not(:has(> span)) {\n\t\t\t\t\t&:last-child{\n\t\t\t\t\t\tdisplay: none!important;\n\t\t\t\t\t}\n\t\t\t\t\t/* CSS rules */\n\t\t\t\t}\n\t\t\t\tspan.md-table-cell span.md-table-limiter {\n\t\t\t\t\t\tposition: absolute;\n\t\t\t\t\t\ttop: 0px;\n\t\t\t\t\t\tright:0px;\n\t\t\t\t\t\tcolor: #c8c3c3;\n\t\t\t\t\t\tdisplay: inline-block;\n\t\t\t\t}\n\t\t\t\tspan.md-table-cell>span:first-child {\n\t\t\t\t\t\twidth: 100%;\n\t\t\t\t\t\ttext-align: right;\n\t\t\t\t}\n\n }\n\t\t.cm-activeLine {\n\t\t\t\t.md-table-line {\n\t\t\t\t\t\tbackground: #d9d9d9;\n\t\t\t\t\t\tspan.md-table-cell span.md-table-limiter {\n\t\t\t\t\t\t\t\tcolor: black;\n\t\t\t\t\t\t}\n\t\t\t\t}\n\t\t}\n\t\t.cm-line .md-table-limiter {\n\t\t\t\tdisplay: inline;\n\t\t}\n\n}\n\t\t")}},106:function(t,e,n){"use strict";n.d(e,"b",(function(){return l})),n.d(e,"a",(function(){return p})),n.d(e,"e",(function(){return f})),n.d(e,"d",(function(){return b})),n.d(e,"c",(function(){return h}));var o=n(115),i=n(30),c=n(17),a=null,r=null,l=!1,s="[LATEX]",u=c.a.client.log.verbose,d=function(t,e){var n=document.createElement("script");n.src=t,n.crossorigin="anonymous",document.body.appendChild(n),n.onload=function(){e()}},p=function(){d("https://cdn.jsdelivr.net/npm/katex@0.15.2/dist/katex.min.js",(function(){d("https://cdn.jsdelivr.net/npm/katex@0.16.2/dist/contrib/auto-render.min.js",(function(){l=!0,a=window.katex,r=window.renderMathInElement}))})),function(t){var e=document.createElement("link");e.type="text/css",e.rel="stylesheet",e.href=t,document.body.appendChild(e)}("https://cdn.jsdelivr.net/npm/katex@0.15.2/dist/katex.css")},f=function(t){var e=t=t.replaceAll("$","");if(!a)return e;try{window.ka=a,e=a.renderToString(t)}catch(n){u&&console.log("LATEX ERR:",n)}return e},b=Object(o.a)((function(){u&&console.log(s,"REFRESH"),g(".render-latex")}),100),g=function(t){if(r){var e=document.querySelectorAll(t);if(!e)return console.warn(s,"no el found :",t);u&&console.log(s,e),Object(i.a)(e,(function(t){r(t,{delimiters:[{left:"$$",right:"$$",display:!0},{left:"$",right:"$",display:!1},{left:"\\(",right:"\\)",display:!0},{left:"[[l]]",right:"[[l]]",display:!0},{left:"[[latex]]",right:"[[latex]]",display:!0},{left:"\\[",right:"\\]",display:!0}],throwOnError:!1})}))}},h=function(){return"\n.katex-display {\n\t\tdisplay: inline;\n\t\t.katex {\n\t\t\t\tdisplay: inline;\n\t\t\t\t.katex-html {\n\t\t\t\t\t\tdisplay: inline;\n\t\t\t\t}\n\t\t}\n}\n"}},109:function(t,e,n){"use strict";n.d(e,"b",(function(){return x})),n.d(e,"a",(function(){return k})),n.d(e,"c",(function(){return y}));var o=n(3),i=n(0),c=n(62),a=n(21),r=n(54),l=n(60),s=n(6),u=n(53),d=n(39),p=n(65),f=n(10),b=n(57),g=n(18),h=n(22),m=n(28),v=n(12),w=n(25),O=n(193),j=n(1);const x=t=>{let e=localStorage.getItem("settings-".concat(t))||"";return Object(b.a)(e,[['"',""]])},_=t=>"<br/> <br/> Default value: ".concat(h.a[t].toString().replaceAll("\n","<br/>")),k=t=>{let e="<br/> Requires interface reload";const n=Object(c.a)("settings-backend-port",-1),f=Object(o.a)(n,2),b=f[0],v=f[1],w=Object(c.a)("settings-backend-protocol","same"),x=Object(o.a)(w,2),k=(x[0],x[1],Object(i.useContext)(s.a)),y=a.a.settingsPopup;let C=[];if(k){const n=k.userSettings,o="".concat(window.location.protocol,"//"),i="".concat(o).concat(k.status.ipsServer.getLocal()).concat(p.a.global.port);"https://api.qrserver.com/v1/create-qr-code/?size=400x400&margin=50&data=".concat(i);C=[{title:"Privacy",fields:[{type:"checkbox",title:"Disable notification popups",expl:"Force notification popups to not appear on the interface"+e,var:n.get("view_disable_notification_popups"),modifier:t=>{R(!0),n.set("view_disable_notification_popups",t)}},{type:"checkbox",title:"Work mode ",expl:"Only displays notifications and omnibar history items related to your work",var:n.get("privacy_work_mode_enable"),modifier:t=>{R(!0),n.set("privacy_work_mode_enable",t)}},{type:"text",title:"Work mode filter",expl:"Only shows notifications and omnibar history items that contain this string. <br> Separate multiple filters with a comma. ".concat(_("privacy_work_mode_filters")),var:n.get("privacy_work_mode_filters"),modifier:t=>{n.set("privacy_work_mode_filters",t)}},{type:"checkbox",title:"Activity Logging",expl:"Enable the activity logging for events like read/write files, you can then consult it using api.activity.getReport(). \n Requires an app restart to take effect.",var:n.get("server_activity_logging_enable"),modifier:t=>{n.set("server_activity_logging_enable",t)}}]},{title:"plugins",fields:[{type:"text",title:"Plugins Marketplace URL",expl:"Custom Plugins Marketplace URL, should redirect to a marketplace.json file <br> Goes to the official 'https://raw.githubusercontent.com/dotgreg/tiro-notes/master/docs/marketplace.json' by default/if empty.",var:n.get("plugins_marketplace_url"),modifier:t=>{n.set("plugins_marketplace_url",t)}},{type:"none",var:"",customHtml:"<button> Clean Plugins Cache </button>",title:"Clean Plugins Cache",readOnly:!0,expl:"Clean Plugins Cache",modifier:()=>{},onCustomHtmlClick:()=>{Object(m.b)("cache","clean_cache")}}]},{title:"layout",fields:[{type:"checkbox",title:"Enable Background Image",expl:"Enable Background Image"+e,var:n.get("ui_layout_background_image_enable"),modifier:t=>{n.set("ui_layout_background_image_enable",t),R(!0)}},{type:"checkbox",title:"Enable Background Video",expl:"Enable Background Video"+e,var:n.get("ui_layout_background_video_enable"),modifier:t=>{n.set("ui_layout_background_video_enable",t),R(!0)}},{type:"textarea",title:"Background image/video url",expl:'Background image/video url.<br>\n\t\t\t\t\t\t- it can start with http. <br> \n\t\t\t\t\t\t- You can also upload a picture in Tiro, then copy the uploaded image link here, in that case only keep the part without the hostname \n\t\t\t\t\t\t<br>(ex: \'static/_new/useful/.resources/wintersolstice.jpg\'). \n\t\t\t\t\t\t<br> - you can add a youtube video/webcam stream in background by using the embed url \n\t\t\t\t\t\tlike \'https://www.youtube-nocookie.com/embed/dQw4w9WgXcQ\' \n\t\t\t\t\t\tor \'https://www.skaping.com/batz-sur-mer/plage-valentin\' \n\t\t\t\t\t\tor even websites.\n\t\t\t\t\t\t<br>\n\t\t\t\t\t\t- if [[token]] exists, it will be replaced by current token so that a video from tiro can be called.\n\t\t\t\t\t\t<br>\n\t\t\t\t\t\t- raw html can also be insert like:\n\t\t\t\t\t\t<br>\n\t\t\t\t\t\t< iframe\n srcdoc=\'\n < style >\n video { position: fixed; top: -100px; left: -400px; width: 100%; height: 100%; object-fit: cover; background: #000; }\n < /style>\n < /head >\n < body>\n < video autoplay loop preload="auto" playsinline controls onloadstart="this.volume=.2" >\n < source src="/static/_files_NOBAK_/.resources/__ambiance1.webm?token=[[token]]" type="video/webm" >\n < /video >\n \'\n frameborder="0"\n allow="autoplay; fullscreen"\n style="width: 100%; height: 100%; border: none;"\n>< /iframe >\n\t\t\t\t\t\t',var:n.get("ui_layout_background_image"),modifier:t=>{n.set("ui_layout_background_image",t),R(!0)}},{type:"text",title:"Main color",expl:"A color string like 'orange' or 'blue' or an Hex string like '#E86666' (tiro red) or '#729fc4'",var:n.get("ui_layout_colors_main"),modifier:t=>{n.set("ui_layout_colors_main",t)}},{type:"text",title:"Font color for main color",expl:"Font color for items with main color as background",var:n.get("ui_layout_colors_main_font"),modifier:t=>{n.set("ui_layout_colors_main_font",t)}},{type:"number",title:"Font size (desktop)",expl:"General font size for desktop"+_("ui_layout_general_font_size")+e,var:n.get("ui_layout_general_font_size"),modifier:t=>{n.set("ui_layout_general_font_size",t),R(!0)}},{type:"text",title:"Font family for interface",expl:"Font family for interface"+_("ui_layout_font_family_interface")+e,var:n.get("ui_layout_font_family_interface"),modifier:t=>{n.set("ui_layout_font_family_interface",t),R(!0)}},{type:"text",title:"Font family for editor",expl:"Font family for editor"+_("ui_layout_font_family_editor")+e,var:n.get("ui_layout_font_family_editor"),modifier:t=>{n.set("ui_layout_font_family_editor",t),R(!0)}},{type:"number",title:"Windows opacity",expl:"If Background image, how opaque should the windows be (between 0 and 100)"+_("ui_layout_background_image_window_opacity")+e,var:n.get("ui_layout_background_image_window_opacity"),max:100,min:0,modifier:t=>{n.set("ui_layout_background_image_window_opacity",t),R(!0)}},{type:"number",title:"Active Windows opacity",expl:"If Background image, how opaque should the active windows be (between 0 and 100)"+_("ui_layout_background_image_window_opacity_active")+e,var:n.get("ui_layout_background_image_window_opacity_active"),max:100,min:0,modifier:t=>{n.set("ui_layout_background_image_window_opacity_active",t),R(!0)}},{type:"number",title:"Floating window padding",expl:"Padding for floating windows (between 0 and 100)"+_("ui_layout_floating_window_padding")+e,var:n.get("ui_layout_floating_window_padding"),max:100,min:0,modifier:t=>{n.set("ui_layout_floating_window_padding",t),R(!0)}},{type:"number",title:"background video width",expl:"background video width in percent (between 0 and 200)"+_("ui_layout_background_video_width")+e,var:n.get("ui_layout_background_video_width"),max:200,min:0,modifier:t=>{n.set("ui_layout_background_video_width",t),R(!0)}},{type:"number",title:"background video height",expl:"background video height percent (between 0 and 200)"+_("ui_layout_background_video_height")+e,var:n.get("ui_layout_background_video_height"),max:200,min:0,modifier:t=>{n.set("ui_layout_background_video_height",t),R(!0)}},{type:"checkbox",title:"Sidebar Shortcut Panel",expl:"Adds a shortcuts/scratchpad space in the sidebar. To edit it, create a note in '.tiro/shortcuts.md'",var:n.get("ui_layout_shortcuts_panel"),modifier:t=>{n.set("ui_layout_shortcuts_panel",t)}}]},{title:"text to speech",fields:[{type:"checkbox",title:"Custom Text to Speech engine",expl:"Uses a custom text to speech engine from an API instead of the browser's default. \n\t\t\t\t\t\t<br> It will send sentences to an API like <a target='_blank' href='https://replicate.com/jaaari/kokoro-82m'>the AI model kokoro-82m</a> \n\t\t\t\t\t\tand get back an audio file.\n\t\t\t\t\t\t<br>On Android, you need to disable battery optimization for the browser used to work properly",var:n.get("tts_custom_engine_enabled"),modifier:t=>{n.set("tts_custom_engine_enabled",t)}},{type:"textarea",title:"Custom Text to Speech command",expl:"\n\t\t\t\t\t\tCommand to run to get the mp3 file. \n\t\t\t\t\t\t<br>- The text to be spoken is replaced by {{input}} or {{input_simple}} for accents and complex char to be removed\n\t\t\t\t\t\t<br>- The speech speed is replaced by {{speed}}.\n\t\t\t\t\t\t<br> It should return a JSON including an absolute path of an audio file (mp3/wav).\n\t\t\t\t\t\t<br>\n\t\t\t\t\t\t<br> Example with Koroko-82m on replicate (make sure to have CURL installed + replace with your API key) <br>\n\t\t\t\t\t\t<br/><code>".concat(h.a.tts_custom_engine_command,"</code>\t\n\t\t\t\t\t\t<br/>\n\t\t\t\t\t\t"),var:n.get("tts_custom_engine_command"),modifier:t=>{n.set("tts_custom_engine_command",t)}},{type:"text",title:"FormId of TTS",expl:"FormId for the TTS popup. It will create a button to open a form popup. For the insert functionality (which auto submit the form based on the text to speech content just spoken) make sure to add a field 'text' and 'file', both text, to have the autoinsert work as expected. Default value:"+h.a.tts_formId,var:n.get("tts_formId"),modifier:t=>{n.set("tts_formId",t)}},{type:"number",title:"Text Extract length for TTS Form",expl:"The text length what will be inserted into the form for tts (insert button)",var:n.get("tts_form_extract_length"),modifier:t=>{n.set("tts_form_extract_length",t)}},{type:"number",title:"sentences in audio part",expl:"The text will be split into audio parts. How many sentences should be in one part",var:n.get("tts_sentences_per_part"),modifier:t=>{n.set("tts_sentences_per_part",t)}},{type:"number",title:"Max words per sentence",expl:"If the sentence exceeds this limit, it will be split into multiple parts, if audio cuts in a sentence, reduce that number",var:n.get("tts_max_words_per_sentence"),modifier:t=>{n.set("tts_max_words_per_sentence",t)}},{type:"number",title:"preload audio parts",expl:"How many audio parts should be asked and preloaded in advanced, if network is unstable, it is recommended to increase that number",var:n.get("tts_preload_parts"),modifier:t=>{n.set("tts_preload_parts",t)}},{type:"number",title:"API Price per word",expl:"Estimated price per word for the API you are using (if it is a paid one)",var:n.get("tts_price_per_word"),modifier:t=>{n.set("tts_price_per_word",t)}}]},{title:"editor",fields:[{type:"checkbox",title:"AI Suggest",expl:"Send the selected text as a question to an AI"+e,var:n.get("ui_editor_ai_text_selection"),modifier:t=>{R(!0),n.set("ui_editor_ai_text_selection",t)}},{type:"textarea",title:"AI Suggest command line",expl:"Custom command lines, great for AI, <br/> One custom command per line with the following format: \n\n\t\t\t\t\t\t<br><br> name | <a href='https://fontawesome.com/search?q=wand&o=r&m=free'> icon name </a> | 'new' or 'current' | command \n\t\t\t\t\t\t<br> - 'new' or 'current': answer inserted in a new window or current one \n\t\t\t\t\t\t<br> - command: {{input}} will be replaced by the selection. \n\n\t\t\t\t\t\t<br><br/> For ChatGPT, you need an <a href='https://platform.openai.com/account/api-keys' target='_blank'>api key</a> and enter the following command : \n\t\t\t\t\t\t<br/><code>".concat(h.a.ui_editor_ai_command,'</code>\t\n\n\t\t\t\t\t\t<br><br> System tested with the following command lines applications (they should be installed prior using them) :\n\t\t\t\t\t\t<br> - npx chatgpt\n\t\t\t\t\t\t<br> - <a href=\'https://github.com/sigoden/aichat\' target="_blank">aichat</a> : "mistral | m | new | echo "Instructions: if answer does not start by \'full>\', be concise in answer. if question about code, only give code \n\n{{input}}" | aichat -m mistral:open-mistral-7b"\n\t\t\t\t\t\t\n\t\t\t\t\t\t'),var:n.get("ui_editor_ai_command"),modifier:t=>{n.set("ui_editor_ai_command",t)}},{type:"text",title:"AI Suggest Command for fields",expl:"Fields can have ai suggestions (like in forms), which ai command to choose (give the name)",var:n.get("ui_editor_ai_suggest_form_command"),modifier:t=>{n.set("ui_editor_ai_suggest_form_command",t)}},{type:"checkbox",title:"Inline Suggestions",expl:"Will suggest words and lines according to the current note content. You can add more words suggested by creating a file at '.tiro/suggestions.md'. Can be heavy on performances on longer notes"+e,var:n.get("ui_editor_inline_suggestion"),modifier:t=>{R(!0),n.set("ui_editor_inline_suggestion",t)}},{type:"checkbox",title:"Search Selected Text Button",expl:"Send the selected text as a question to a search engine"+e,var:n.get("ui_editor_search_highlight_enable"),modifier:t=>{R(!0),n.set("ui_editor_search_highlight_enable",t)}},{type:"text",title:"Search Selected Text Button",expl:"Search engine url. Default value:"+h.a.ui_editor_search_highlight_url,var:n.get("ui_editor_search_highlight_url"),modifier:t=>{n.set("ui_editor_search_highlight_url",t)}},{type:"checkbox",title:"Synced Title scrolling",expl:"When scrolling to a title on the editor, will scroll to its preview counterpart"+e,var:n.get("ui_editor_synced_title_scrolling"),modifier:t=>{R(!0),n.set("ui_editor_synced_title_scrolling",t)}},{type:"checkbox",title:"Markdown Tags",expl:"Displays #tag as clickable tag you can interact with "+e,var:n.get("ui_editor_markdown_tags"),modifier:t=>{R(!0),n.set("ui_editor_markdown_tags",t)}},{type:"checkbox",title:"Markdown Preview",expl:"Markdown preview "+e,var:n.get("ui_editor_markdown_preview"),modifier:t=>{R(!0),n.set("ui_editor_markdown_preview",t)}},{type:"checkbox",title:"Enhanced Markdown Preview",expl:"Enhanced Markdown Preview for files, documents, date etc"+e,var:n.get("ui_editor_markdown_enhanced_preview"),modifier:t=>{R(!0),n.set("ui_editor_markdown_enhanced_preview",t)}},{type:"checkbox",title:"Enhanced Markdown Syntax",expl:"Enhance Markdown Syntax (**bold**, ~~text~~, and other)",var:n.get("ui_editor_markdown_syntax"),modifier:t=>{R(!0),n.set("ui_editor_markdown_syntax",t)}},{type:"checkbox",title:"Improved Markdown Table",expl:"Improves the display of markdown table. Add '--table' in the note to activate it."+e,var:n.get("ui_editor_markdown_table_preview"),modifier:t=>{R(!0),n.set("ui_editor_markdown_table_preview",t)}},{type:"checkbox",title:"Links button",expl:"Replace http links into buttons in the editor by adding a '/' at the end of it."+e,var:n.get("ui_editor_links_as_button"),modifier:t=>{R(!0),n.set("ui_editor_links_as_button",t)}},{type:"checkbox",title:"Latex preview",expl:"Add Latex preview. Add '--latex' in the note to activate it then use $_latex_expression_$"+e,var:n.get("ui_editor_markdown_latex_preview"),modifier:t=>{R(!0),n.set("ui_editor_markdown_latex_preview",t)}},{type:"checkbox",title:"Spellcheck",expl:"Enable/disable native browser spellcheck for all notes. <br> You can also activate it per note by adding '--spellcheck' inside the note content <br>"+e,var:n.get("ui_editor_spellcheck"),modifier:t=>{R(!0),n.set("ui_editor_spellcheck",t)}},{type:"checkbox",title:"Image title",expl:"Show image title on interface and exports"+e,var:n.get("ui_editor_show_image_title"),modifier:t=>{R(!0),n.set("ui_editor_show_image_title",t)}},{type:"checkbox",title:"Live Edition",expl:"If other clients edit the same note, update everybody on live. <br> That functionality is required for AI assistant and the inline calculator"+e,var:n.get("ui_editor_live_watch"),modifier:t=>{R(!0),n.set("ui_editor_live_watch",t)}}]},{title:"keyboard",fields:[{type:"textarea",title:"Custom Shortcuts",expl:"Define custom shortcuts. One shortcut per line with the following format: \n\t\t\t\t\t\t<br>shortcut | command_name | command_content \n\t\t\t\t\t\t<br>- shortcut: the key combination (ex: 'ctrl+shift > e') \n\t\t\t\t\t\t<br>- command_name: the command to execute (toggle_note | highlight_to_ai)\n\t\t\t\t\t\t<br>- command_content: the content of the command (ex: '/path/to/note.md' | 'ai_model_name')\n\t\t\t\t\t\t<br>\t\n\t\t\t\t\t\t<br>Commands available:\n\t\t\t\t\t\t<br>- toggle_note: Toggle a note in a floating window. The command content should be the relative note path like /path/to/note.md\n\t\t\t\t\t\t<br>- highlight_to_ai: Send the selected text to an AI, if nothing is selected, send the cursor line to the AI. The AI suggest function should be enabled. The command content can be the AI model name, but can also be left empty, it will select the first ai model (ref AI Suggest command line)\n\t\t\t\t\t\t<br>\n\t\t\t\t\t\t<br> Example:\n\t\t\t\t\t\t<br> shift + alt > 1 | toggle_note |/path/to/note.md \n\t\t\t\t\t\t<br> ctrl + shift > 2 | highlight_to_ai | ai_mode_name",var:n.get("keyboard_shortcuts_textarea"),modifier:t=>{n.set("keyboard_shortcuts_textarea",t)}}]},{title:"exports",fields:[{type:"textarea",title:"Options for Pandoc exporter",expl:"Modify how pandoc exports files. All options can be found at <a href='https://pandoc.org/MANUAL.html' target=\"_blank\">pandoc options manual</a>. One file extension options per line.<br/><br/>format: <br/> file extention | options ".concat(_("export_pandoc_cli_options")),var:n.get("export_pandoc_cli_options"),modifier:t=>{n.set("export_pandoc_cli_options",t)}},{type:"none",var:"",customHtml:" ",title:"Export Install",readOnly:!0,expl:'In order to export in many formats, Tiro notes needs to install Pandoc on your computer. (At least v2.9) <br/>\n\t\t\t\t\t\t<a href="https://pandoc.org/installing.html" target="_blank">Guide here </a>\n\t\t\t\t\t\t<br/><br/>\n\t\t\t\t\t\tFor Beamer presentation in PDF, make sure pdflatex is installed \n\t\t\t\t\t\t<br/> - if you are on Ubuntu: <a href="https://gist.github.com/rain1024/98dd5e2c6c8c28f9ea9d" target="_blank">Guide here </a>\n\t\t\t\t\t\t<br/> - if you are on Termux: <code>pkg install texlive-installer texlive-tlmgr; termux-install-tl</code>',modifier:()=>{},onCustomHtmlClick:()=>{}}]},{title:"Users and Rights",fields:[{type:"checkbox",title:"Enable read-only viewer",expl:'Create a "viewer" user that can read but not edit the content',var:n.get("users_viewer_user_enable"),modifier:t=>{n.set("users_viewer_user_enable",t,{writeInSetupJson:!0})}},{type:"text",title:"Viewer user password",expl:'Define the "viewer" user password',var:n.get("users_viewer_user_password"),modifier:t=>{n.set("users_viewer_user_password",t,{writeInSetupJson:!0})}},{type:"checkbox",title:"Demo Mode",expl:"Autofill the 'viewer' user and password on login popup for easier access during a demo mode",var:n.get("demo_mode_enable"),modifier:t=>{n.set("demo_mode_enable",t,{writeInSetupJson:!0})}},{type:"none",var:"",customHtml:"<button> Logout </button>",title:"Logout current User",readOnly:!0,expl:"Logout Current User",modifier:()=>{},onCustomHtmlClick:()=>{Object(g.a)(),t.onClose(),Object(s.d)((t=>{t.folders.get(["/"],(()=>{}))}))}},{type:"none",var:"",customHtml:"<button> open setup </button>",title:"Change Setup informations",readOnly:!0,expl:"Change Setup informations like User/Password/Data folder, it is located in ~/.tiro-config.json",modifier:()=>{},onCustomHtmlClick:()=>{t.onClose(),Object(s.d)((t=>{t.userSettings.triggerSetupPopup()}))}},{type:"text",var:()=>k.config.getCustomApiToken(),title:"Custom backend API Token",readOnly:!0,expl:"WARNING: that token gives full access to tiro notes system, do not share it and keep it secret, to renew it, change user/password. \n\n<br><br>\n\t\t\t\t\t\tAPI Token to access to the custom api backend and create you own api from simple markdown notes: \n\t\t\t\t\t\t/custom_backend_api?file=myApiEndpoint&token=MY_API_TOKEN. \n\n<br><br>\n\t\t\t\t\t\tThat token is generated according to the user and password and thus changes with it.",modifier:()=>{}}]},{title:"Advanced",fields:[{type:"text",var:b,title:y.backend.port,expl:y.backend.portExpl,modifier:v},{type:"textarea",title:"Options for Image compression",expl:"Modify default image compression settings ".concat(_("advanced_image_compression_settings")),var:n.get("advanced_image_compression_settings"),modifier:t=>{n.set("advanced_image_compression_settings",t)}}]},{title:"Beta",fields:[{type:"checkbox",title:"Plugins Marketplace",expl:"Enable the plugin marketplace system (not working yet)",var:n.get("beta_plugins_marketplace"),modifier:t=>{n.set("beta_plugins_marketplace",t)}}]},{title:"Documentation & Help",fields:[{type:"none",var:"",customHtml:"<button> open help page </button>",title:"Open Help Page",readOnly:!0,expl:'Open the help page for more information, it is also accessible on the main interface "?" button at the bottom right corner. or with the shortcut "ctrl + /"',modifier:()=>{},onCustomHtmlClick:()=>{t.onClose(),Object(O.a)()}}]}]}const S=Object(u.a)("config-panels-opened",[],{editIfNotLoaded:!0}),E=Object(o.a)(S,3),T=E[0],I=E[1],N=(E[2],Object(i.useState)(!1)),P=Object(o.a)(N,2),A=P[0],R=P[1];return Object(j.c)("div",{className:"settings-popup-wrapper"},Object(j.c)(r.a,{title:"".concat(y.title),onClose:()=>{t.onClose()}},C.map(((t,e)=>Object(j.c)("div",{className:"settings-panel"},Object(j.c)("h3",{onClick:()=>{(t=>{const e=Object(d.a)(T);e[t]=!e[t],I(e)})(e)}},Object(j.c)("div",{className:"arrow"},T[e]?"\u25bc":"\u25ba"),t.title),Object(j.c)("div",{className:"fields-wrapper ".concat(T[e]?"active":"")},t.fields.map((t=>Object(j.c)("div",{className:"field-wrapper"},Object(j.c)("div",{className:"input-and-html-wrapper"},"none"===t.type&&Object(j.c)("span",null,t.title),"none"!==t.type&&Object(j.c)(l.a,{value:t.var,shouldNotSelectOnClick:!0,label:t.title,type:t.type,max:t.max,min:t.min,step:t.step,readonly:t.readOnly,onChange:e=>{"checkbox"!==t.type&&t.modifier(e)},onCheckedChange:e=>{"checkbox"===t.type&&t.modifier(e)}}),t.customHtml&&Object(j.c)("div",{className:"custom-html-wrapper",onClick:e=>{t.onCustomHtmlClick&&t.onCustomHtmlClick()},dangerouslySetInnerHTML:{__html:t.customHtml}}),Object(j.c)("div",{className:"explanation",dangerouslySetInnerHTML:{__html:t.expl||"woop"}}))))))))),A&&Object(j.c)("button",{className:"submit-button reload-btn",onClick:t=>{window.location.reload()}},"Reload App")))},y=()=>"\n//\n// mobile version\n//\n\n.device-view-mobile {\n\t.settings-popup-wrapper .popup-wrapper .popupContent {\n\t\t\t\twidth: 80vw;\n\t\t\t\t.field-wrapper {\n\t\t\t\t\t\tdisplay: block;\n\t\t\t\t\t\t.explanation {\n\t\t\t\t\t\t\t\twidth: 100%;\n\t\t\t\t\t\t\t\tpadding: 5px 0px;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tinput {\n\t\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t}\n}\n\n.settings-popup-wrapper .popup-wrapper {\n\theight: 70%;\n}\n.settings-popup-wrapper .popup-wrapper .popupContent {\n padding: 0px 20px;\n\t\twidth: 70vw;\n\t\t// min-height: 50vh;\n\t\t// max-height: 70vh;\n\t\toverflow-y: scroll;\n\n}\n\n.reload-btn {\n\tposition: absolute;\n\tbottom: 10px;\n\tright: 10px;\n}\n\n\n.settings-panel {\n\t\t\n\t\t.input-and-html-wrapper {\n\t\t\t// width: 50%;\n\t\t\t.input-component-wrapper {\n\t\t\t\t.input-component {\n\t\t\t\t\t.input-wrapper {\n\t\t\t\t\t\ttextarea, input {\n\t\t\t\t\t\t\t".concat("desktop"===Object(v.a)()?" ":"width: calc(100% - 30px); margin: 5px 0px; ",'\n\t\t\t\t\t\t}\n\t\t\t\t\t\tinput[type=checkbox] {\n\t\t\t\t\t\t\twidth: 20px;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tinput[type="text"] {\n\t\t\t\t\t\t\t').concat("desktop"===Object(v.a)()?" ":"width: calc(100% - 40px);","\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\th3 {\n\t\t\t\tcursor: pointer;\n\t\t\t\ttext-transform: uppercase;\n\t\t\t\t.arrow {\n\t\t\t\t\t\tdisplay: inline-block;\n\t\t\t\t\t\tfont-size: 7px;\n\t\t\t\t\t\tposition: relative;\n\t\t\t\t\t\tbottom: 2px;\n\t\t\t\t\t\tmargin-right: 10px;\n\t\t\t\t}\n\t\t}\n\t\t.fields-wrapper {\n\t\t\t\tdisplay: none;\n\t\t\t\t&.active {\n\t\t\t\t\t\tdisplay: block;\n\t\t\t\t\t\tdisplay: block;\n\t\t\t\t\t\tpadding: 12px 12px 0px 12px;\n\t\t\t\t\t\tbackground: ").concat(f.a.colors.bgPopup2,";\n\t\t\t\t\t\tborder-radius: 5px;\n\t\t\t\t\t\tborder: 1px ").concat(f.a.colors.bgPopup3," solid;\n\t\t\t\t\t\tmargin-top: 10px;\n\t\t\t\t}\n\t\t\t\t.field-wrapper {\n\t\t\t\t\t\ttextarea {\n\t\t\t\t\t\t\twidth: 100%;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\tdisplay: flex;\n\t\t\t\t\t\tpadding-bottom: 11px;\n\t\t\t\t\t\talign-items: center;\n\t\t\t\t\t\t// 3 EXPLANATION\n\t\t\t\t\t\t\n\t\t\t\t\t\t@media (min-width: 1000px) {\n\t\t\t\t\t\t\t.input-and-html-wrapper{\n\t\t\t\t\t\t\t\tdisplay: flex;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t.explanation {\n\t\t\t\t\t\t\t\tpadding-left: 20px;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// else\n\t\t\t\t\t\t@media (max-width: 1000px) {\n\t\t\t\t\t\t\t.explanation {\n\t\t\t\t\t\t\t\tpadding-bottom: 20px;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t.input-and-html-wrapper {\n\t\t\t\t\t\t\t// display: ").concat("mobile"===Object(v.a)()?"block":"flex"," ;\n\t\t\t\t\t\t\t// display: flex;\n\t\t\t\t\t\t\t.input-component {\n\t\t\t\t\t\t\t\t// 1 TITLE\n\t\t\t\t\t\t\t\tspan {\n\t\t\t\t\t\t\t\t\twidth: 100px;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t// 2 INPUT\n\t\t\t\t\t\t\t\t.input-wrapper {\n\t\t\t\t\t\t\t\t\twidth: 300px;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tdisplay: flex;\n\t\t\t\t\t\t\t\tjustify-content: space-evenly;\n\t\t\t\t\t\t\t\tpadding: 0px;\n\t\t\t\t\t\t\t\tinput {\n\t\t\t\t\t\t\t\t\tfont-size: ").concat(Object(w.a)(),"px;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t.custom-html-wrapper {\n\t\t\t\t\t\t\t\t\tmargin-left: 20px;\n\t\t\t\t\t\t\t\t\t.qrcode-wrapper {\n\t\t\t\t\t\t\t\t\t\t\timg {\n\t\t\t\t\t\t\t\t\t\t\t\t\tmargin: 5px 25px 0px 0px;\n\t\t\t\t\t\t\t\t\t\t\t\t\tcursor: pointer;\n\t\t\t\t\t\t\t\t\t\t\t\t\twidth: 50px;\n\t\t\t\t\t\t\t\t\t\t\t\t\t&:hover {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//\twidth: 150px;\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t}\n\t\t}\n\n}\n\n\n\n\n.buttons {\n display: flex;\n padding: 20px 0px 0px 0px;\n button {\n width: 30%;\n padding: 10px;\n }\n}\n")},111:function(t,e,n){"use strict";n.d(e,"c",(function(){return r})),n.d(e,"a",(function(){return l})),n.d(e,"b",(function(){return u})),n.d(e,"d",(function(){return f}));var o=n(174),i=n.n(o),c=n(24),a=n(70),r=function(t,e){var n=i.a.generateRSAKey(e,1024),o=i.a.publicKeyString(n);return i.a.encrypt(t,o)},l=function(t,e){var n=i.a.generateRSAKey(e,1024);return i.a.decrypt(t,n)},s={encryptText:r,decryptText:l,encryptUrlParam:function(t,e){var n=r(t,e);return n.cipher&&(n.cipher=encodeURIComponent(n.cipher)),n},decryptUrlParam:function(t,e){return t=decodeURIComponent(t),l(t,e)},documentation:function(){return Object(c.a)(s,"api.encryption","client/src/managers/encryption.manager.ts")}},u=s,d=function(t,e){var n=e.replace(t,"").length,o=e.length;return Math.round(n/o*100)/100},p=function(t){return t>0&&t<=.9},f=function(t){var e=!1,n=Object(a.b)(t).content,o={nb:d(/[^0-9]/g,n),up:d(/[^A-Z]/g,n),low:d(/[^a-z]/g,n),spe:d(/[^\/\=\?\+]/g,n)},i=p(o.nb)&&p(o.up)&&p(o.low)&&o.spe>0,c=(n.trim().endsWith("==")||n.trim().endsWith("="),/^[a-zA-Z0-9\/\=\?\+]+$/.test(n)),r=n.length>100;return c&&i&&r&&(e=!0),e}},12:function(t,e,n){"use strict";n.d(e,"e",(function(){return o})),n.d(e,"c",(function(){return i})),n.d(e,"b",(function(){return c})),n.d(e,"d",(function(){return a})),n.d(e,"a",(function(){return r}));var o=function(){var t,e=!1;return t=navigator.userAgent||navigator.vendor||window.opera,(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i.test(t)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(t.substr(0,4)))&&(e=!0),e},i=function(t){return r()===t},c=function(){var t=navigator.platform.toLowerCase();return t.includes("mac")?"mac":t.includes("win")?"windows":t.includes("linux")?"linux":t.includes("android")?"android":"other"};function a(){return!!/iPad/.test(navigator.platform)||navigator.maxTouchPoints&&navigator.maxTouchPoints>2&&/MacIntel/.test(navigator.platform)}var r=function(){var t=window.innerWidth,e="desktop";return l()||t<1e3&&(e="tablet"),t<500&&(e="mobile"),e},l=function(){return!s()},s=function(){var t,e=!1;return t=navigator.userAgent||navigator.vendor||window.opera,(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(t)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(t.substr(0,4)))&&(e=!0),e}},122:function(t,e,n){"use strict";n.d(e,"c",(function(){return g})),n.d(e,"a",(function(){return m})),n.d(e,"b",(function(){return v}));var o=n(31),i=n(42),c=n(45),a=n(18),r=n(30),l=n(6),s=n(33),u=n(220),d=n(29),p=n(22),f=n(46),b=function(t){if(t){var e=t.dataset.filePath,n=t.dataset.src;Object(l.d)((function(t){t.file.getContent(e,(function(o){var i=Object(u.a)(o,Object(d.e)(e));if(!(i.length<1)){var c=[],a=0;Object(r.a)(i,(function(t,e){Object(f.b)(n).includes(Object(f.b)(t.url))&&(a=e),c.push(t.url)})),t.ui.lightbox.open(a,c)}}))}))}},g=function(t,e){return Object(c.a)({file:t,windowId:e,pattern:o.a.image2,replacement:function(e){var n=e.matchs,o=document.createElement("div");return o.innerHTML=h(n[0],n[2],n[1],n[5],t),o}})},h=function(t,e,n,o,c){"image"!==n&&(n='<div class="mdpreview-source">'.concat(n,"</div>")),p.d.curr.ui_editor_show_image_title||(n="");var r=e.startsWith("http")?e:"".concat(Object(i.a)(c.folder),"/").concat(e).concat(Object(a.c)());r=Object(f.b)(r),o||(o="");var l=o.trim().split("="),u="";if("width"===l[0]||"height"===l[0]){var d="width"===l[0]?"height:auto;max-height:none":"width:auto; max-width:none;";u='style="'.concat(l[0],":").concat(l[1],"; ").concat(d,'"')}return r=Object(f.b)(r),'<div class="cm-mdpreview-wrapper image-wrapper"><div class="cm-mdpreview-image" data-file-path="'.concat(c.path,'" data-src="').concat(r,'" onclick="').concat(Object(s.c)("image-open-lightbox",b),'"> <img ').concat(u,' src="').concat(r,'" /></div></div>').concat(n)},m=function(t,e,n){var o="",c=t.split("[")[1].split("]")[0];"image"!==c&&(o='<div class="mdpreview-source">'.concat(c,"</div>")),p.d.curr.ui_editor_show_image_title||(o="");var r=e.startsWith("http")?e:"".concat(Object(i.a)(n.folder),"/").concat(e).concat(Object(a.c)());return r=Object(f.b)(r),'<div class="cm-mdpreview-wrapper image-wrapper"><div class="cm-mdpreview-image" data-file-path="'.concat(n.path,'" data-src="').concat(r,'" onclick="').concat(Object(s.c)("image-open-lightbox",b),'"> <img src="').concat(r,'" /></div></div>').concat(o)},v=function(){return"\n.cm-mdpreview-wrapper.image-wrapper {\n\t\t// display: inline;\n\t\tmin-width: 10px;\n\t\tmin-height: 10px;\n\t\tdiv {\n\t\t\t// display: inline;\n\t\t}\n\t\timg {\n\t\t\t\n\t\t}\n\t\t.cm-mdpreview-image {\n\t\t\t// background: #ffe4e4;\n\t\t\tmin-width: 50px;\n\t\t\tmin-height: 30px;\n\t\t\tcursor:pointer;\n\t\t}\n\t\t.mdpreview-source {\n\t\t\t\tline-height: initial;\n\t\t}\n}\n\n"}},127:function(t,e,n){"use strict";n.d(e,"b",(function(){return f})),n.d(e,"a",(function(){return g})),n.d(e,"c",(function(){return v})),n.d(e,"d",(function(){return w}));var o=n(5),i=n(8),c=n(9),a=n(26),r=n(27),l=n(13),s=n(7),u=n(4),d=n(106),p=n(122),f={LatexMdEl:u.a.define()},b={resolve:"LatexMdEl"},g={defineNodes:["LatexMdEl"],parseInline:[{name:"MdCustomTagsParser",parse:function(t,e,n){return 36===e?t.addDelimiter(b,n,n+1,!0,!0):-1},after:"Emphasis"}],props:[Object(u.c)({LatexMdEl:f.LatexMdEl})]},h=function(t){Object(a.a)(n,t);var e=Object(r.a)(n);function n(t){var o;return Object(i.a)(this,n),(o=e.call(this)).str=t,o}return Object(c.a)(n,[{key:"ignoreEvent",value:function(){return!1}},{key:"toDOM",value:function(){var t=document.createElement("div");t.classList.add("cm-mdpreview-wrapper"),t.classList.add("latex-wrapper");var e=Object(d.e)(this.str);return t.innerHTML=' <div class="latex-height" >'.concat(e,"</div> "),t}}]),n}(l.g);function m(t,e){var n,i=[],c=Object(o.a)(t.visibleRanges);try{for(c.s();!(n=c.n()).done;){var a=n.value,r=a.from,u=a.to;Object(s.F)(t.state).iterate({from:r,to:u,enter:function(e){if("LatexMdEl"===e.name){var n=t.state.doc.sliceString(e.from,e.to),o=l.a.widget({widget:new h(n),side:1});i.push(o.range(e.from))}}})}}catch(d){c.e(d)}finally{c.f()}return l.a.set(i)}var v=function(t){return l.f.fromClass(function(){function e(n){Object(i.a)(this,e),this.decorations=void 0,this.decorations=m(n,t.file)}return Object(c.a)(e,[{key:"update",value:function(e){(e.docChanged||e.viewportChanged)&&(this.decorations=m(e.view,t.file))}}]),e}(),{decorations:function(t){return t.decorations},eventHandlers:{mousedown:function(e,n){var o=e.target,i=n.posAtCoords({x:e.clientX,y:e.clientY});if(i){var c=n.state.doc.lineAt(i).number;if(o.classList.contains("actionable-title")){var a=o.innerHTML.replace(/^#{1,6} /,"");t.onTitleClick(a,c)}}}}})},w=function(){return"\n.latex-height {\n\t\theight: 20px;\n\t\toverflow: auto;\n\t\tline-height: initial;\n\t\tbackground: rgb(247,247,247);\n\t\tpadding: 10px;\n\t\tborder-radius: 5px;\n\t\tcolor: rgba(0,0,0,0);\n\t\ttransition: all 0.2s;\n\t\t.katex, .katex span {\n\t\t\t\tcolor: black;\n\t\t}\n}\n\n.mdpreview-source {\n\t\tfont-weight: bold;\n\t\tcolor: #b4b4b4;\n\t\tfont-size: 9px;\n\t\tdisplay: block;\n}\n\n\n\n\n.cm-mdpreview-wrapper {\n\t\tline-height: 0px;\n\n\t\t&.latex-wrapper {\n\t\t\t\tposition: relative;\n\t\t\t\tleft: -10px;\n\t\t\t\tdisplay: inline-block;\n\t\t}\n\t\t&.image-wrapper {\n\t\t\t\t/* max-height: 160px; */\n\t\t}\n\n\t\t.cm-mdpreview-image {\n\t\t\t\tposition: relative;\n\t\t\t\tdisplay: inline-block;\n\n\t\t\t\timg {\n\t\t\t\t\t\tmargin: 5px 0px;\n\t\t\t\t\t\tborder-radius: 5px;\n\t\t\t\t\t\tbox-shadow: 0px 0px 5px rgba(0,0,0,.2);\n\t\t\t\t\t\tmax-width: calc(100% - 20px);\n\t\t\t\t\t\tborder-radius: 5px;\n\t\t\t\t\t\tmax-height: 220px;\n\t\t\t\t}\n\t\t\t\t.enlarge {\n\t\t\t\t\t\twidth: 10px;\n\t\t\t\t\t\topacity: 0;\n\t\t\t\t\t\ttransition: 0.2s all;\n\t\t\t\t\t\tposition: absolute;\n\t\t\t\t\t\ttop: 8px;\n\t\t\t\t\t\tright: 23px;\n\t\t\t\t\t\tz-index: 2;\n\t\t\t\t\t\tpadding: 6px;\n\t\t\t\t\t\tcursor: pointer;\n\t\t\t\t\t\tbackground: rgba(0,0,0,0.6);\n\t\t\t\t\t\tborder-radius: 19px;\n\t\t\t\t}\n\t\t\t\tsvg, span {\n\t\t\t\t\t\tpointer-events: none;\n\t\t\t\t}\n\t\t\t\tsvg {\n\t\t\t\t\t\tbox-shadow: 0 0 0 rgba(0,0,0,0.4);\n\t\t\t\t}\n\n\t\t}\n\t\t&:hover .enlarge {\n\t\t\t\topacity: 0.3;\n\t\t\t\t/* pointer-events: all; */\n\t\t}\n}\n\n ".concat(Object(p.b)(),"\n ")}},129:function(t,e,n){"use strict";n.d(e,"c",(function(){return j})),n.d(e,"a",(function(){return _})),n.d(e,"b",(function(){return k})),n.d(e,"d",(function(){return y}));var o=n(3),i=n(0),c=n.n(i),a=n(39),r=n(713),l=n(30),s=n(379),u=n.n(s),d=(n(581),n(582),n(225)),p=n(159),f=n(228),b=n(144),g=n(10),h=n(48),m=n(6),v=n(12),w=n(88),O=n(1),j={rows:2,cols:4},x={m:10,rows:j.rows,cols:j.cols,decalBottom:10},_=function(t){var e=Object(i.useState)([]),n=Object(o.a)(e,2),s=n[0],g=n[1],_=function(t){g(t),k.current=t},k=Object(i.useRef)([]),y=Object(i.useState)([]),C=Object(o.a)(y,2),S=C[0],E=C[1],T=Object(i.useRef)();Object(i.useEffect)((function(){t.grid&&t.grid.layout&&(E(t.grid.layout),_(t.grid.content))}),[t.refresh]),Object(i.useEffect)((function(){W(),L()}),[S]);var I=function(e,n){t.onGridUpdate({layout:e,content:n})},N=function(){var t=s[0].file;if(t){var e=function(t){for(var e=[],n=j,o=function(o){for(var i=[],c=function(e){var n=0;Object(l.a)(t,(function(t){for(var i=0;i<t.w;i++)for(var c=0;c<t.h;c++){var a=t.x+i,r=t.y+c;a===e&&r===o&&(n=1)}})),i.push(n)},a=0;a<n.cols;a++)c(a);e.push(i)},i=0;i<n.rows;i++)o(i);for(var c=[-1,-1],a=[-1,-1],r=0;r<n.rows;r++)for(var s=0;s<n.cols;s++)0===e[r][s]&&-1===c[0]&&-1===c[1]&&(c[0]=s,c[1]=r),0===e[r][s]&&(a[0]=s,a[1]=r);var u=a[0]-c[0]+1,d=a[1]-c[1]+1;return{x:c[0],y:c[1],w:u,h:d}}(S),n=Object(p.a)({file:t,w:e.w,h:e.h,x:e.x,y:e.y}),o=Object(a.a)(S);o.push(n.layout),V(o)&&(E(o),setTimeout((function(){var t=Object(a.a)(s);t.push(n.content);var e=U(n.content.i,t);_(e),I(o,e)})),I(o,s))}},P=Object(i.useState)(!1),A=Object(o.a)(P,2),R=A[0],F=A[1],L=function(){F(S.length>1)},D=Object(i.useState)(!1),M=Object(o.a)(D,2),z=M[0],B=M[1],W=function(){var t=0,e=x.cols*x.rows;Object(l.a)(S,(function(e){t+=e.w*e.h})),B(t!==e)},U=function(t,e){var n=Object(a.a)(e);return Object(l.a)(n,(function(e){e.active=e.i===t})),n},H=function(t,e){Object(m.d)((function(e){e.tabs.updateTab("activateTabWindow","activeTab",t)}))},q=function(t){T.current=Object(a.a)(t)},V=function(t){for(var e=!0,n=0;n<t.length;n++){var o=t[n];o.y>1&&(e=!1),o.h>1&&o.y>0&&(e=!1)}return e};Object(f.b)(),Object(i.useEffect)((function(){var t=G.current;if(t)return t.addEventListener("resize",(function(){})),function(){t.removeEventListener("resize",(function(){}))}}),[]);var G=Object(i.useRef)(null),J={width:300,height:300};G.current&&(J.width=G.current.clientWidth,J.height=G.current.clientHeight-x.decalBottom);Object(i.useContext)(m.a);var K=function(e,n){return function(o,i){if("windowActiveStatus"===o)e&&!e.active&&H(e.i,e.file);else if("windowViewChange"===o){var c;if(null===i||void 0===i||!i.view||!t.grid.content[n].file)return;!function(t,e){var n=Object(a.a)(s);n[e].view=t,_(n),I(S,n)}(null===i||void 0===i?void 0:i.view,n);var r=(null===(c=t.grid.content[n].file)||void 0===c?void 0:c.path)||"";Object(w.b)(r,null===i||void 0===i?void 0:i.view)}}};Object(i.useEffect)((function(){}),[]);var Y=function(t,e,n){var o=[{icon:"faGripVertical",title:"Move Window",class:"drag-handle",size:1.2,action:function(){},onHover:function(){}},{icon:"faPlus",title:"Add Window",class:"add-button",action:function(){N()}},{icon:"faPlus",title:"Delete Window",class:"delete-button",action:function(){!function(t){var e=Object(r.a)(Object(a.a)(S),(function(e){return e.i!==t}));setTimeout((function(){var n=Object(r.a)(Object(a.a)(s),(function(e){return e.i!==t}));_(n),I(e,n)})),I(e,s)}(t.i)}}];return Object(O.c)(c.a.Fragment,null,Object(O.c)("div",{className:"note-active-ribbon"}),Object(O.c)("div",{className:"window-buttons-bar ".concat(z?"can-add":""," ").concat(R?"can-remove":"")},Object(O.c)(h.a,{design:"horizontal",popup:!1,buttons:o,colors:["#d4d1d1","#615f5f"],size:.8})))};return Object(O.c)("div",{className:"draggable-grid-wrapper"},Object(O.c)("div",{className:"draggable-grid-wrapper-in",ref:G},"mobile"!==Object(v.a)()&&Object(O.c)(u.a,{className:"draggable-grid",autoSize:!1,layout:S,onLayoutChange:function(t){var e=Object(a.a)(t);if(V(e)){var n=e;q(n),E(n),I(n,s)}else{if(!T.current)return;var o=function(t){var e=t,n=j,o=null;console.log("0035",e),(2===e.length&&(e[0].w===n.cols-1&&e[0].h===n.rows&&e[1].w===n.cols/2&&e[1].h===n.rows||e[1].w===n.cols-1&&e[1].h===n.rows&&e[0].w===n.cols/2&&e[0].h===n.rows)||2===e.length&&(e[0].w===n.cols-1&&e[0].h===n.rows&&e[1].w===n.cols/2&&e[1].h===n.rows||e[1].w===n.cols-1&&e[1].h===n.rows&&e[0].w===n.cols/2&&e[0].h===n.rows))&&(console.log("[ALT LAYOUT] 0035 found i|iii to ii|ii"),o=Object(a.a)(t),Object(l.a)(o,(function(t,e){t.w=n.cols/2,t.y=0,1===e&&(t.x=n.cols/2)})));return o}(t);o&&q(o);var i=o||T.current,c=Object(a.a)(i);Object(l.a)(c,(function(t){t.refresh=Object(d.a)(t.refresh)})),E(c),I(c,s)}},cols:x.cols,compactType:"horizontal",useCSSTransforms:!1,rowHeight:J.height/x.rows-x.m*(x.rows+1),draggableHandle:".drag-handle",width:J.width,margin:[x.m,x.m]},S.map((function(e,n){return Object(O.c)("div",{key:e.i,className:" ".concat(s[n]&&s[n].active?"active":""," window-wrapper "),onClick:function(){s[n]&&!s[n].active&&H(s[n].i,s[n].file)},onMouseEnter:function(){}},Y(e,0,t.grid.content[n]),Object(O.c)("div",{className:"window-editor-wrapper-wrapper"},Object(O.c)(b.a,{noteParentType:"grid",content:t.grid.content[n]&&t.grid.content[n],onLayoutUpdate:K(e,n),mobileView:t.mobileView})))}))),"mobile"===Object(v.a)()&&Object(O.c)("div",{className:"mobile-grid-view"},Object(O.c)("div",{className:" window-wrapper"},Object(O.c)("div",{className:"window-editor-wrapper-wrapper"},t.grid.content[0]&&Object(O.c)(b.a,{noteParentType:"grid",content:t.grid.content[0],onLayoutUpdate:K(window,0),mobileView:t.mobileView}))))))},k=function(){return"\n.react-grid-placeholder {\n\topacity: 0.2;\n\tbackground: ".concat(g.a.colors.main,";\n}\n\n.draggable-grid-wrapper \n.draggable-grid-wrapper-in \n.mobile-grid-view {\n\t\t.window-wrapper {\n\n\t\t\t\t.window-buttons-bar {\n\t\t\t\t\t\tdisplay: none;\n\t\t\t\t}\n\n\t\t\t\t.window-editor-wrapper-wrapper {\n\t\t\t\t\t\t.dual-view-wrapper {\n\t\t\t\t\t\t\t\t.editor-area {\n\t\t\t\t\t\t\t\t\t\tmargin-top: 47px;\n\t\t\t\t\t\t\t\t\t\t.infos-editor-wrapper {\n\t\t\t\t\t\t\t\t\t\t\t\tmargin-top: 10px;\n\t\t\t\t\t\t\t\t\t\t\t\ttop: -43px;\n\t\t\t\t\t\t\t\t\t\t\t\t.title-input-wrapper {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tinput {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tcolor: ").concat(g.a.colors.main,";\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t.dropdown-icon {\n\t\t\t\t\t\t\t\t\t\t\t\ttop: -15px;\n\t\t\t\t\t\t\t\t\t\t\t\tright: 10px;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t.context-menu {\n\t\t\t\t\t\t\t\t\t\t\t\tright: 10px;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t.main-editor-wrapper {\n\t\t\t\t\t\t\t\t\t\t\t\t.textarea-editor {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\theight: calc(100% - 300px);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tpadding: 20px 20px 70px 20px;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\twidth: calc(100% - 40px);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tresize: none;\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t.preview-area-wrapper {\n\t\t\t\t\t\t\t\t\t\t// height: calc(100% - 165px);\n\t\t\t\t\t\t\t\t\t\theight: calc(100% - 85px);\n\t\t\t\t\t\t\t\t\t\t.preview-area {\n\t\t\t\t\t\t\t\t\t\t\t\ttop: 0px!important;\n\t\t\t\t\t\t\t\t\t\t\t\tbottom: 0px!important;\n\t\t\t\t\t\t\t\t\t\t\t\t.dates-wrapper {\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t.preview-content {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tpadding: 0px 0px 50px 0px;\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t.scrolling-bar-wrapper {\n\t\t\t\t\t\t\t\t\t\tdisplay:none;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t}\n\t\t}\n}\n")},y=function(t){return"\n\n.draggable-grid-wrapper {\n\t\t// remove transition\n\n\t\theight: calc(100% + ".concat(t.topTab?"0":"44","px);\n\t\ttop: ").concat(t.topTab&&"mobile"!==Object(v.a)()?"44":"0","px;\n\t\tposition: relative;\n\n\t\t.react-grid-item {\n\t\t\t\ttransition: all 0ms ease;\n\t\t\t\ttransition-property: left, top;\n\t\t\t\t.react-resizable-handle {\n\t\t\t\t\t\tbottom: 0px;\n\t\t\t\t\t\tright: 0px;\n\t\t\t\t\t\tcursor: se-resize;\n\t\t\t\t\t\topacity: 1;\n\t\t\t\t\t\twidth: 10px;\n\t\t\t\t\t\theight: 18px;\n\t\t\t\t\t\tbackground: rgb(247,247,247);\n\t\t\t\t}\n\t\t\t\t.react-resizable-handle:after {\n\t\t\t\t\t\ttop: 5px;\n\t\t\t\t\t\tleft: 1px;\n\t\t\t\t\t\topacity: 0.3;\n\t\t\t\t}\n\t\t}\n\n\t\t.draggable-grid-wrapper-in {\n\t\t\t\theight: 100%;\n\t\t\t\tposition: relative;\n\n\t\t\t\t.draggable-grid, .mobile-grid-view {\n\t\t\t\t\t\theight: 100%;\n\t\t\t\t\t\twidth: 100%;\n\t\t\t\t\t\t.window-wrapper {\n\t\t\t\t\t\t\t//overflow: hidden;\n\t\t\t\t\t\t\tborder-radius: 5px;\n\t\t\t\t\t\t\tcolor: ").concat(g.a.colors.fontEditor,";\n\t\t\t\t\t\t\tbackground: ").concat(g.a.colors.bgEditor,";\n\t\t\t\t\t\t\tbox-shadow: 0px 0px 5px rgba(0,0,0,.1);\n\t\t\t\t\t\t\toverflow-y: hidden;\n\t\t\t\t\t\t\toverflow-x: hidden;\n\t\t\t\t\t\t\theight:100%;\n\n\t\t\t\t\t\t\t.window-buttons-bar {\n\t\t\t\t\t\t\t\tposition: absolute;\n\t\t\t\t\t\t\t\tz-index:3;\n\t\t\t\t\t\t\t\tright: 30px;\n\t\t\t\t\t\t\t\ttop: 8px;\n\t\t\t\t\t\t\t\t.delete-button {display: none;}\n\t\t\t\t\t\t\t\t.add-button {display: none;}\n\t\t\t\t\t\t\t\t.drag-handle {\n\t\t\t\t\t\t\t\t\t\tcursor: grab;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t.delete-button span.icon-wrapper {\n\t\t\t\t\t\t\t\t\ttransform: rotate(45deg);\n\t\t\t\t\t\t\t\t\tdisplay: inline-block;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t&.can-add {\n\t\t\t\t\t\t\t\t\t\t.add-button {display: block;}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t&.can-remove {\n\t\t\t\t\t\t\t\t\t\t.delete-button {display: block;}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t&.active {\n\t\t\t\t\t\t\t\t.note-active-ribbon {\n\t\t\t\t\t\t\t\t\t\t//background:").concat(g.a.colors.main,";\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t.dual-view-wrapper\n\t\t\t\t\t\t\t\t.editor-area\n\t\t\t\t\t\t\t\t.infos-editor-wrapper\n\t\t\t\t\t\t\t\t.title-input-wrapper\n\t\t\t\t\t\t\t\t.big-title {\n\t\t\t\t\t\t\t\t\t\tcolor: ").concat(g.a.colors.main,";\n\t\t\t\t\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t}\n\n\t\t\n}\n")}},131:function(t,e,n){"use strict";n.d(e,"d",(function(){return O})),n.d(e,"c",(function(){return j})),n.d(e,"b",(function(){return _})),n.d(e,"a",(function(){return k}));var o=n(16),i=n(11),c=n(3),a=n(0),r=n.n(a),l=n(53),s=n(93),u=n(37),d=n(39),p=n(292),f=n(12),b=n(29),g=n(35),h=n(88),m=n(22),v=n(6),w=n(24),O=function(){return window.innerWidth},j=function(){return window.innerHeight-35},x=1e3,_=function(t){var e=Object(l.a)("floatingPanelsConfig3",[],{history:!1,onInitialRefresh:function(t){Object(u.a)(t)&&(C.current=t,"mobile"===Object(f.a)()&&(C.current=C.current.filter((function(t){return"mobile"!==t.device}))),S(C.current))},debouncedSave:5e3}),n=Object(c.a)(e,3),_=n[0],k=n[1],y=n[2],C=r.a.useRef([]),S=function(t){Object(u.a)(t)&&(C.current=t,k(t))};Object(a.useEffect)((function(){Object(u.a)(_)&&(C.current=_)}),[_]);var E=function(t,e){var n,o,i=Object(f.e)()?2:30,c=Object(f.e)()?2:15,a=window.innerWidth-c-4,r=window.innerHeight-4-i;switch(e){case"full-center":case"full":n=c,o=2;break;case"half-right":case"right":n=window.innerWidth/2+c/2,o=2,a/=2;break;case"half-left":case"left":n=c,o=2,a/=2;break;case"full-bottom":case"bottom":n=c,o=window.innerHeight/2-i/2,r/=2;break;case"full-top":case"top":n=c,o=2,r/=2;break;case"bottom-left":n=c,o=window.innerHeight/2-i/2,a/=2,r/=2;break;case"bottom-right":n=window.innerWidth/2+c/2,o=window.innerHeight/2-i/2,a/=2,r/=2;break;case"top-left":n=c,o=2,a/=2,r/=2;break;case"top-right":n=window.innerWidth/2+c/2,o=2,a/=2,r/=2}return t.position={x:n,y:o},t.size={width:a,height:r},t},T=function(t){var e=C.current.find((function(e){var n;return e.file.path===(null===t||void 0===t||null===(n=t.file)||void 0===n?void 0:n.path)&&"visible"!==e.status}));if(e)F(e.id);else{var n=C.current.filter((function(t){return!t.status.includes("hidden")})),o="mobile"===Object(f.a)()?5:100,c=window.innerWidth/2-o;"mobile"===Object(f.a)()&&(c=window.innerWidth-2*o);var a=window.innerHeight/1.2-o;c>800&&(c=800),t.id&&(t.id=Object(f.a)()+"-"+t.id);var r={x:o+20*n.length,y:o+20*n.length};"mobile"===Object(f.a)()&&(r={x:o,y:o}),console.log("Creating panel at position: ".concat(JSON.stringify(r)));var l=Object(i.a)({position:r,size:{width:c,height:a},status:"visible",file:Object(s.a)(),view:"editor",id:Math.random().toString(36).substring(7),zIndex:x,device:Object(f.a)(),orderPosition:n.length},t);if(t.layout){var u=E(l,t.layout);l.position=u.position,l.size=u.size}var d=function(t){console.log("".concat("[FLOATING PANELS]"," createPanel"),t);var e=C.current.find((function(e){return e.id===t.id}));e&&(t.position=e.position,t.size=e.size,N(t.id));var n=C.current.filter((function(e){return e.id!==t.id}));n.push(t),S(n),z(t.id,"first"),A(t.id)};t.file&&!t.view?Object(h.a)(t.file.path).then((function(t){t&&(l.view=t),d(l)})):d(l)}},I=function(t){var e=C.current.map((function(e){return e.id===t.id?t:e}));S(e)},N=function(t){var e=C.current.filter((function(e){return e.id!==t}));e=P(e),S(e)},P=function(t){var e=t.filter((function(t){return"visible"===t.status})),n=Math.max.apply(Math,Object(o.a)(e.map((function(t){return t.zIndex||0})))),i=e.find((function(t){return t.zIndex===n}));if(!i)return t;t.forEach((function(t){t.isTopWindow=!1})),t[t.findIndex((function(t){return t.id===i.id}))].isTopWindow=!0;t[t.findIndex((function(t){return t.id===i.id}))];return t},A=function(t){var e=Math.max.apply(Math,Object(o.a)(C.current.map((function(t){return t.zIndex||0})))),n=C.current.findIndex((function(e){return e.id===t}));if(-1!==n){var i=Object(d.a)(C.current)[n];i.zIndex=e+1;var c=Object(d.a)(C.current);if(c.forEach((function(t){t.isTopWindow=!1})),i.zIndex=e+1,i.isTopWindow=!0,c[n]=i,S(c),e>x+2*C.current.length){var a=Object(d.a)(C.current);a.forEach((function(t){t.zIndex=t.zIndex-C.current.length})),S(a)}}},R=function(t){S(Object(d.a)(t))},F=function(t){if(!t){var e=C.current.filter((function(t){return"visible"!==t.status})),n=e.find((function(t){return t.orderPosition===Math.min.apply(Math,Object(o.a)(e.map((function(t){return t.orderPosition||0}))))}));if(!n)return;t=n.id}var i=C.current.find((function(e){return e.id===t}));i&&(i.status="visible",I(i),A(i.id),z(i.id,"first"),W(i.id))},L=function(t){var e=Object(d.a)(C.current);e.find((function(e){return e.id===t})).status="minimized";e.find((function(e){return e.id===t}));e=P(e),S(e)},D=function(){var t=Object(d.a)(C.current),e=0;t.forEach((function(t){"visible"===t.status&&(t.zIndex=x+e,t.position={x:100+20*e,y:100+35*e},t.size={width:700,height:600},e++)})),R(t)},M=r.a.useRef("grid"),z=function(t,e){var n=Object(d.a)(C.current.find((function(e){return e.id===t})));if(n){if("last"===e){var i=Math.max.apply(Math,Object(o.a)(C.current.map((function(t){return t.orderPosition||0}))));e=i+1}if("first"===e){var c=Math.min.apply(Math,Object(o.a)(C.current.map((function(t){return t.orderPosition||0}))));e=c-1}n.orderPosition=e,I(n)}},B=function(t,e){var n=e||{},o=n.idpanel,i=n.layout,c=n.searchedString,a=n.replacementString;o||(o=Math.random().toString(36).substring(7)),o&&(o=Object(f.a)()+"-"+o);var r=Object(d.a)(C.current.find((function(t){return t.id===o})));if(r)null!==e&&void 0!==e&&e.noteView&&(r.view=e.noteView),null!==e&&void 0!==e&&e.view&&(r.view=e.view),"minimized"===r.status&&(r.status="visible"),"hidden"===r.status&&(r.status="visible"),r.file=Object(b.e)(t),c&&(r.searchedString=c),a&&(r.replacementString=a),I(r),A(null===r||void 0===r?void 0:r.id);else{var l={id:o,type:"file",file:Object(b.e)(t)};i&&(l.layout=i),c&&(l.searchedString=c),a&&(l.replacementString=a),null!==e&&void 0!==e&&e.noteView&&(l.view=e.noteView),null!==e&&void 0!==e&&e.view&&(l.view=e.view),T(l)}},W=function(t){var e=Object(d.a)(C.current.find((function(e){return e.id===t})));e&&(e.position.x+e.size.width>window.innerWidth&&(e.position.x=0,e.size.width>window.innerWidth&&(e.size.width=window.innerWidth-0)),e.position.y+e.size.height>window.innerHeight&&(e.position.y=0,e.size.height>window.innerHeight&&(e.size.height=window.innerHeight-0)),I(e))},U=function(){var t=C.current.filter((function(t){return"visible"===t.status})),e=t.find((function(e){return e.zIndex===Math.max.apply(Math,Object(o.a)(t.map((function(t){return t.zIndex||0}))))}));return e},H=function(t){var e=U();if(e){var n=e.opacity||1;e.opacity=n+t,e.opacity>1&&(e.opacity=1),e.opacity<0&&(e.opacity=0),I(e)}},q=function(t){var e=U();if(e){if(Object(p.a)(t))e.view=t;else{e.view=Object(h.c)(e.view);var n=e.file;Object(h.b)(null===n||void 0===n?void 0:n.path,e.view)}I(e)}},V=function(){H(.1)},G=function(){H(-.1)},J=function(){var t=U();if(t){var e=Object(d.a)(t.file),n=Object(d.a)(t.ctagConfig);t.file=Object(b.e)(""),t.ctagConfig=void 0,I(t),setTimeout((function(){t.file=e,t.ctagConfig=n,I(t)}),100)}};Object(a.useEffect)((function(){var t=["alt + o","alt + shift + o","alt + shift > v","alt + shift > r"];return Object(g.a)(t[0],V),Object(g.a)(t[1],G),Object(g.a)(t[2],q),Object(g.a)(t[3],J),function(){Object(g.c)(t[0],V),Object(g.c)(t[1],G),Object(g.c)(t[2],q),Object(g.c)(t[3],J)}}),[]);var K={create:T,openFile:B,update:I,openWebpage:function(t){Object(v.d)((function(e){e.ui.floatingPanel.create({type:"ctag",ctagConfig:{tagName:"web",content:t}})}))},toggleFile:function(t,e){var n=C.current.find((function(e){return e.file.path===t}));if(!n)return B(t,e);"visible"===n.status?L(n.id):F(n.id)},updateAll:R,delete:N,movePanel:function(t,e){I(Object(i.a)(Object(i.a)({},C.current.find((function(e){return e.id===t}))),{},{position:e}))},resizePanel:function(t,e){I(Object(i.a)(Object(i.a)({},C.current.find((function(e){return e.id===t}))),{},{size:e}))},updatePanelLayout:function(t,e){if("active"===t){var n=_.filter((function(t){return"visible"===t.status&&"mobile"!==t.device})),o=n.find((function(t){return t.isTopWindow}));if(!o)return;t=o.id}e||(e="full");var i=Object(d.a)(C.current.find((function(e){return e.id===t})));i&&(i=E(i,e),I(i))},minimizePanel:L,deminimizePanel:F,actionAll:function(t,e){if("organizeWindows"===t)return D();if("toggleWindowsLayout"===t)return function(t){var e=Object(d.a)(C.current),n=e.filter((function(t){return"visible"===t.status&&"mobile"!==t.device}));"current"===t&&(t=M.current);var o=["grid","horizontal","vertical","tiled"];M.current=t||o[(o.indexOf(M.current)+1)%o.length];var i=parseInt(m.d.curr.ui_layout_floating_window_padding);if("grid"===M.current){for(var c=Math.ceil(Math.sqrt(n.length)),a=Math.ceil(n.length/c),r=[],l=Object(f.e)()?2:15,s=(O()-l-c*i)/c,u=(j()-i*a)/a,p=0;p<a;p++)for(var b=0;b<c;b++)r.push({x:b*s+l+i*b,y:p*u+i+i*p});var g=0;e.forEach((function(t,e){"visible"===t.status&&"mobile"!==t.device&&(t.position=r[g],t.size={width:s,height:u},g++)})),R(e)}else if("horizontal"===M.current){var h=(O()-2*i-(n.length-1)*i)/n.length,v=0;e.forEach((function(t,e){"visible"===t.status&&"mobile"!==t.device&&(t.position={x:v*h+i*(v+1),y:i},t.size={width:h,height:j()-2*i},v++)})),R(e)}else if("vertical"===M.current){var w=j()/n.length,x=0;e.forEach((function(t,e){"visible"===t.status&&"mobile"!==t.device&&(t.position={x:i,y:x*w+i},t.size={width:O()-2*i,height:w-i},x++)})),R(e)}else"tiled"===M.current&&D()}(null===e||void 0===e?void 0:e.layout);if("minimizeActive"===t)return function(){var t=U();t&&L(t.id)}();if("closeActive"===t)return function(){var t=U();t&&N(t.id)}();if("deminimizeFirst"===t)return F();var n=Object(d.a)(C.current);n.forEach((function(e){e.status="hide"===t?"visible":"minimized"})),R(n)},panels:_,refreshFromBackend:y,pushWindowOnTop:A,movePositioninArray:function(t,e){var n=Object(d.a)(C.current),o=n.findIndex((function(e){return e.id===t}));if(-1!==o){var i=n.splice(o,1)[0];"up"===e?n.splice(o-1,0,i):"down"===e?n.splice(o+1,0,i):"first"===e?n.splice(0,0,i):"last"===e&&n.push(i),R(n)}},updateOrderPosition:z,resizeWindowIfOutOfWindow:W,documentation:function(){return Object(w.a)(K,"api.floatingPanel","client/src/hooks/api/floatingPanel.api.hook.tsx")}};return K},k=function(t){var e=!1,n=t.filter((function(t){return"visible"===t.status&&"mobile"!==t.device}));return n.forEach((function(t,o){e||n.forEach((function(n,i){if(!e&&o!==i){var c=t.position.x,a=t.position.y,r=n.position.x,l=n.position.y,s=t.size.width,u=t.size.height,d=n.size.width,p=n.size.height;c+20<r+d&&c+s>r+20&&(a+20<l+p&&a+u>l+20)&&(e=!0)}}))})),e}},138:function(t,e,n){"use strict";n.d(e,"c",(function(){return r})),n.d(e,"b",(function(){return l})),n.d(e,"a",(function(){return s}));var o=n(16),i=n(374),c=n(38),a=n(254),r=function(t,e){var n="render-react-wrapper-".concat(Object(c.a)()),o=function(){var e=l(t),o=setInterval((function(){var t=document.getElementById(n);t&&(t.innerHTML="",t.appendChild(e),clearInterval(o))}),10)};return e&&e.delay?setTimeout(o,e.delay):o(),n},l=function(t,e){return e||(e=document.createElement("div")),Object(i.createRoot)(e).render(t),e},s=function(t){return Object(a.a)((function(){return t.apply(void 0,arguments)}),(function(t){return JSON.stringify(Object(o.a)(t))}))}},14:function(t,e,n){"use strict";n.d(e,"a",(function(){return o})),n.d(e,"b",(function(){return h})),n.d(e,"c",(function(){return m})),n.d(e,"d",(function(){return v}));var o,i=n(11),c=n(16),a=n(712),r=n(109),l=n(65),s=n(290),u=n.n(s),d=n(6),p=n(29),f=n(17),b="[RIPGREP INSTALL]",g=function(t){var e="rg-".concat(t.os,"-").concat(t.arch);"win"===t.os&&(e+=".exe");var n=-1!==["rg-darwin-arm","rg-darwin-x64","rg-darwin-x64","rg-linux-x64","rg-win-x64.exe"].indexOf(e),o="Tiro Notes requires the tool Ripgrep, which does not seem to be installed on your computer",i="Install Ripgrep",c=function(){},a="rg-install-notif";n&&(o+="<br>Do you want Tiro to download and install it? <br><br> The following version will be downloaded and installed: <br><code>".concat(e,"</code>"),c=function(){var n="".concat("https://github.com/dotgreg/tiro-notes/raw/master/platforms/electron/not-packaged/ripgrep/").concat(e);Object(d.d)((function(o){o.config.get((function(i){var c=Object(p.b)("".concat(f.a.path.configFolder,"/bin/")),r=Object(p.b)("".concat(i.dataFolder,"/").concat(c,"/").concat(e));console.log(c,r),o.ui.notification.emit({id:a,content:"".concat(b," downloading ripgrep..."),options:{hideAfter:-1}}),o.ressource.download(n,c,(function(){var e,cb;o.ui.notification.emit({id:a,content:"".concat(b," updating config..."),options:{hideAfter:-1}}),e=r,cb=function(){o.userSettings.updateSetupJson("rg_path",r,(function(t){o.ui.notification.emit({id:a,content:"".concat(b," finished, restarting tiro notes..."),options:{hideAfter:10}})}),{requiresServerRestart:!0})},"win"!==t.os?Object(d.d)((function(t){var n="chmod 0755 ".concat(e);t.command.exec(n,(function(t){console.log("".concat(b," -> cmd: ").concat(n," : ").concat(t)),cb(t)}))})):cb()}),{fileName:e})}))}))}),n||(o+='\n <br><br>To install it, follow these instructions :<br> <a href="https://github.com/BurntSushi/ripgrep#installation">https://github.com/BurntSushi/ripgrep#installation</a> \n <br> then restart Tiro',i="ok"),Object(d.d)((function(t){t.popup.prompt({title:"Ripgrep install required",text:o,onAccept:c,onRefuse:function(){},acceptLabelButton:i})}))},h={on:function(){},off:function(){}},m=function(){var t=l.a.global.protocol,e=Object(r.b)("backend-port")?":".concat(Object(r.b)("backend-port")):"".concat(l.a.global.port),n="".concat(t).concat(l.a.global.url).concat(e);return Object(r.b)("backend-port").includes(".")&&(n="".concat(t).concat(Object(r.b)("backend-port"))),n},v=function(){return new Promise((function(t,e){if(!o){var n=s?u.a:function(){};o=n(m()),l.a.log.socket&&console.log("[SOCKET] try connecting to ".concat(m(),"...")),(h=O(o)).on("onServerError",(function(t){"NO_RIPGREP_COMMAND_AVAILABLE"===t.status&&Object(d.d)((function(e){g(t.platform)}))})),h.on("connectionSuccess",(function(e){l.a.log.socket&&console.log("[SOCKET] connection successful!, socket.connected :".concat(o.connected),e),e.isRgGood,t({socket:o,ipsServer:e.ipsServer,socketManager:h})}))}}))},w=function(t,e){return["%c [CLIENT SOCKET 2] ".concat(t),"background: #ccc; color: red",e||null]},O=function(t){var e={};return{on:function(n,o){var r=function(t,e){return function(n){var o;l.a.log.socket&&(o=console).log.apply(o,Object(c.a)(w("<== ON ".concat(t," "),Object(i.a)({},n)))),e(n)}}(n,o),s=Object(a.a)(1,1e8);return e[s]={endpoint:n,apiFn:r},t.on(n,r),s},off:function(n){e[n]&&(t.off(e[n].endpoint,e[n].apiFn),delete e[n])},emit:function(e,n){var o;l.a.log.socket&&(o=console).log.apply(o,Object(c.a)(w("==> EMIT ".concat(e," "),Object(i.a)({},n)))),t.emit(e,n)}}}},140:function(t,e,n){"use strict";n.d(e,"b",(function(){return p})),n.d(e,"a",(function(){return f}));var o=n(11),i=n(115),c=n(30),a=n(6),r=n(18),l=n(14),s=n(583),u={curr:[]},d=Object(i.a)((function(t){console.log("[UPLOAD] inserting ".concat(u.curr.length," files after debounce")),Object(a.d)((function(e){var n="";Object(c.a)(u.curr,(function(t,e){if(!t.inserted){var o=t.file.name.replace(/\[/g,"").replace(/\]/g,"");n+=".concat(t.file.path,")\n"),t.inserted=!0}})),e.ui.note.editorAction.dispatch({type:"insertText",insertPos:"currentLineStart",insertText:n,windowId:t})}))}),1e3),p=function(t){console.log("[UPLOAD] FILE TO EDITOR started",t.fileToUpload);var e=Object(o.a)({},t),n=e.fileToUpload,i=e.folder,c=e.windowId;Object(a.d)((function(t){t.upload.uploadFile({file:n,folderPath:i,onSuccess:function(t){u.curr.push({file:t,inserted:!1}),d(c)},onProgress:function(e){t.ui.note.editorAction.dispatch({type:"uploadProgress",uploadProgress:e,windowId:c})}})}))},f=function(t){var e=Object(o.a)({},t),n=e.file,i=e.path,c=e.idReq,a=e.onProgress,u=n.name,d=n.name.split(".").pop();if(d&&["jpg","png","gif","webp","jpeg","svg"].includes(d)){var p=new Date,f="".concat(p.getFullYear(),"-").concat(p.getMonth(),"-").concat(p.getDate(),"-").concat(p.getHours(),"h").concat(p.getMinutes(),"m-").concat(p.getSeconds(),"s"),b=n.name.split(".").pop();u=u.replace(".".concat(b),"-".concat(f,".").concat(b))}var g=new s(l.a);g.addEventListener("start",(function(t){t.file.meta.newManualName=u,t.file.meta.idReq=c,t.file.meta.path=i,t.file.meta.token=Object(r.b)()})),g.addEventListener("progress",(function(t){var e=Math.round(t.bytesLoaded/t.file.size*100);a(e)})),g.submitFiles([n])}},141:function(t,e,n){"use strict";n.d(e,"a",(function(){return l}));var o=n(99),i=n(28),c="[FRONT PERF]",a={value:!1};!function(){if("true"===Object(o.a)("tiroConsoleLogEnabled")){console.log("%c\n==============================================================================\nconsole.log is ENABLED, you can access frontend api by typing 'api'.\n- Each client api subdomain and related methods like 'api.ai.search' can be accessed directly. You can also:\n\t- Access to the overall documentation of the subapi. Example: 'console.log(api.ai.documentation().list)'\n\t- Access to each individual method documentation. Example: 'console.log(api.ai.documentation().methods.search)'\n==============================================================================\n\t\t","color: green")}else console.error("=============================================================================="),console.error("!!! console.log is disabled, to enable it again, tiroDevCli.log.toggle_enable() [you can acces frontend api by typing 'api']"),console.error("=============================================================================="),window.console={warn:function(){},error:function(){},info:function(){},log:function(){}}}(),Object(i.a)("log","toggle_enable",(function(){var t="true"===Object(o.a)("tiroConsoleLogEnabled");Object(o.b)("tiroConsoleLogEnabled",t?"false":"true",720),window.location.reload()})),Object(i.a)("performance","toggle_monitoring",(function(){a.value=!a.value,console.log(c,"toggled to ".concat(a.value))}));var r={},l=function(t){if(!a.value)return function(){};r[t]||(r[t]=[]),r[t][0]=performance.now();return function(){r[t][1]=performance.now();var e=r[t],n=e[1]-e[0];console.warn(c,"".concat(t," = ").concat(n," ms"),e)}}},142:function(t,e,n){"use strict";n.d(e,"c",(function(){return O})),n.d(e,"b",(function(){return k})),n.d(e,"a",(function(){return y}));var o=n(16),i=n(3),c=n(30),a=n(293),r=n(37),l=n(132),s=n(39),u=n(0),d=n(29),p=n(17),f=n(14),b=n(97),g=n(18),h=n(53),m=n(62),v=n(6),w=n(24),O=function(t){var e=Object(u.useState)([]),n=Object(i.a)(e,2),f=n[0],g=n[1],O=Object(u.useState)(-1),k=Object(i.a)(O,2),y=k[0],C=k[1],S=Object(m.a)("selected-folder",""),E=Object(i.a)(S,2),T=E[0],I=E[1],N=Object(u.useRef)("");Object(u.useEffect)((function(){N.current=T}),[T]);var P=Object(u.useRef)({}),A=Object(u.useState)(j),R=Object(i.a)(A,2),F=R[0],L=R[1],D=Object(u.useState)(""),M=Object(i.a)(D,2),z=M[0],B=M[1],W=Object(h.a)("folders-open",["/"]),U=Object(i.a)(W,3),H=U[0],q=U[1],V=U[2],G=Object(u.useRef)([]),J=function(t){t=Object(a.a)(t),q(t)},K=Object(u.useRef)(!1);Object(u.useEffect)((function(){K.current||(Y(H),H.length>1&&(K.current=!0))}),[H]);var Y=function(t,e){Object(c.a)(t,(function(e,n){""===t[n]&&(t[n]="/")})),t=Object(a.a)(t),e||(e={}),Object(l.a)(e.cache)||(e.cache=!0);var n=!!Object(l.a)(e.background)&&e.background,o=0;Object(v.d)((function(i){Object(c.a)(t,(function(c){i.folders.get([c],(function(i){var c;!n&&Z(i.pathBase,i.folders),++o>=t.length&&(null===(c=e)||void 0===c?void 0:c.cb)&&e.cb()}))}))}))},$=Object(u.useRef)([]),Z=function(t,e){var n=Object(s.a)($.current),o={current:n};Object(c.a)(e,(function(t){t&&(o.current=o.current.filter((function(e){return t.path!==e.path})))})),Object(c.a)(e,(function(t){t&&(o.current=_(t,o.current))})),n=o.current,$.current=n;var i=x("/",n);i&&L(i),B(t)},X={goTo:function(t,e,n){var o=function(t){Object(v.d)((function(o){o.status.searching.set(!1);var i=o.userSettings.get("ui_filesList_sortMode"),a=Object(b.d)(t,i),r=-1;if(e&&Object(c.a)(a,(function(t,n){t.name===e&&(r=n)})),C(r),g(a),n&&n.openIn){var l=a[r];if("active"===n.openIn||"activeWindow"===n.openIn){var s=o.tabs.active.get();null===s||void 0===s||s.grid.content[0].i;s?o.ui.windows.active.setContent(l):o.tabs.openInNewTab(l)}else o.ui.windows.updateWindows([n.openIn],l)}}))},i=function(){Object(v.d)((function(o){t=Object(d.b)("".concat(t,"/"));p.a.client.log.verbose&&console.log("".concat("[BROWSER GO TO] "," ").concat(t," ").concat(e," ").concat(JSON.stringify(n))),o.ui.search.term.set(""),o.status.searching.set(!0),I(t)}))};if(n&&n.ramCache&&P.current[t])i(),o(P.current[t]);else{if(""===t)return;Object(v.d)((function(e){i(),e.files.get(t,(function(e){o(e),P.current[t]=e}))}))}},files:{active:{get:f[y],getIndex:y,set:C},set:g,get:f},folders:{refreshFromBackend:function(){V((function(t){G.current=t}))},base:z,get:function(cb){return cb&&cb(F),F},clean:function(){L(j)},scan:Y,open:{get:function(){return G.current},add:function(t){console.log("ADD",t),G.current=Object(r.a)(G.current)?G.current:[],G.current=[].concat(Object(o.a)(G.current),[t]),G.current=Object(a.a)(G.current),J(G.current)},remove:function(t){console.log("REMOVE",t),Object(c.a)(t,(function(t){G.current=G.current.filter((function(e){return e!==t}))})),J(G.current)}},current:{get:function(){return N.current},set:I,getSync:T}},documentation:function(){return Object(w.a)(X,"api.ui.browser","client/src/hooks/api/browser.api.hook.tsx")}};return X.folders.documentation=function(){return Object(w.a)(X.folders,"api.ui.browser.folders","client/src/hooks/api/browser.api.hook.tsx")},X.files.documentation=function(){return Object(w.a)(X.files,"api.ui.browser.files","client/src/hooks/api/browser.api.hook.tsx")},X.folders.open.documentation=function(){return Object(w.a)(X.folders.open,"api.ui.browser.folders.open","client/src/hooks/api/browser.api.hook.tsx")},X},j={title:"",key:"",path:""},x=function t(e,n){for(var o,i=0;i<n.length;i++)if(Object(d.a)(n[i].path,e)){o=Object(s.a)(n[i]);var c=n[i].children;if(Object(r.a)(c))for(var a=0;a<c.length;a++){var l=t(c[a].path,n);l&&(o.children[a]=l)}}return o},_=function(t,e){for(var n="add",o=0;o<e.length;o++)Object(d.a)(t.path,e[o].path)&&(e[o]=t,n="update");return"add"===n&&e.push(t),e},k={title:".trash",key:"/.tiro/.trash",path:"/.tiro/.trash"},y=function(t,e){console.log("[askFolderDelete]",t,e),f.b.emit("askFolderDelete",{typeFolder:t,cacheFolderName:e,token:Object(g.b)()})}},144:function(t,e,n){"use strict";n.d(e,"a",(function(){return j})),n.d(e,"b",(function(){return x}));var o=n(3),i=n(11),c=n(39),a=n(132),r=n(0),l=n.n(r),s=n(6),u=n(32),d=n(187),p=n(88),f=n(230),b=n(10),g=n(229),h=n(140),m=n(22),v=n(70),w=n(1);const O=t=>{var e,n;const b=Object(i.a)({},t.content),O=b.file,j=b.view,x=b.active,_=b.i,k=Object(r.useState)(""),y=Object(o.a)(k,2),C=y[0],S=y[1],E=Object(r.useState)("editor"),T=Object(o.a)(E,2),I=T[0],N=T[1],P=_;Object(r.useEffect)((()=>{if(t.forceView)return N(t.forceView);N(j),Object(p.a)(null===O||void 0===O?void 0:O.path).then((t=>{N(t||"editor")}))}),[j,null===O||void 0===O?void 0:O.path,P,t.forceView,null===(e=t.content)||void 0===e||null===(n=e.file)||void 0===n?void 0:n.path]);const A=Object(r.useState)(!0),R=Object(o.a)(A,2),F=R[0],L=R[1],D=Object(r.useState)(O),M=Object(o.a)(D,2),z=M[0],B=M[1],W=Object(r.useState)(C),U=Object(o.a)(W,2),H=U[0],q=U[1];Object(r.useEffect)((()=>{const t=V(C);if(!t)return;const e=t.contentWithoutMeta,n=t.file;q(e),B(n)}),[C,O]);const V=t=>{const e=t,n=Object(v.b)(e),o=n.metas,i=n.content,a=Object(c.a)(O);if(a)return o.created&&(a.created=parseInt(o.created)),o.updated&&(a.modified=parseInt(o.updated)),{contentWithoutMeta:i,file:a}};let G=Object(r.useRef)((null===O||void 0===O?void 0:O.path)||"");Object(r.useEffect)((()=>{G.current=(null===O||void 0===O?void 0:O.path)||"",$(!1),O&&Object(s.d)((t=>{t.file.getContent(O.path,(t=>{S(t),$(!0)})),!0===m.d.curr.ui_editor_live_watch&&t.watch.file(O.path,(t=>{if(G.current===t.filePath)return!0===ot.current?nt.current=t.fileContent:void S(t.fileContent)}))}))}),[null===O||void 0===O?void 0:O.path,P,F]);const J=Object(r.useState)(!1),K=Object(o.a)(J,2),Y=K[0],$=K[1],Z=Object(u.a)((t=>{Object(d.a)(t,20)}),3e3),X=Object(r.useRef)(!1),Q=(Object(u.a)((()=>{X.current=!1,console.log("reenable watch file")}),1e4),Object(r.useRef)({})),tt=Object(r.useRef)(0);Object(r.useEffect)((()=>{Q.current;Object(s.d)((t=>{t.watch.appStatus((t=>{!1===t.isConnected&&(tt.current=tt.current+1,console.log("disabling watch update as disconnected"),X.current=!0)}))}))}),[null===O||void 0===O?void 0:O.path,C]);const et=Object(r.useRef)(C);Object(r.useEffect)((()=>{et.current=C}),[C]);const nt=Object(r.useRef)(!1),ot=Object(r.useRef)(!1),it=Object(u.a)((()=>{ot.current=!1,Object(a.a)(nt.current)||(nt.current=!1)}),2e3);Object(r.useEffect)((()=>{O&&x&&Object(s.d)((t=>{t.ui.browser.goTo(O.folder,O.name,{ramCache:!0})}))}),[x]);const ct=Object(u.a)((()=>{st(!1)}),100),at=Object(r.useState)(!1),rt=Object(o.a)(at,2),lt=rt[0],st=rt[1];return Object(w.c)(l.a.Fragment,null,F&&O&&Object(w.c)("div",{className:"window-editor-wrapper ".concat(t.content.active?"active":""),onPaste:t=>{null!==O&&void 0!==O&&O.path&&Object(g.b)(t,(t=>{Object(h.b)({fileToUpload:t,folder:O.folder,windowId:P})}))},onDragOver:t=>{t.preventDefault(),t.stopPropagation(),console.log("handle dragover",null===O||void 0===O?void 0:O.path),st(!0),ct()},onDragLeave:t=>{},onDrop:t=>{console.log("window drop"),t.preventDefault(),t.stopPropagation(),st(!1),console.log("handle drop",null===O||void 0===O?void 0:O.path),null!==O&&void 0!==O&&O.path&&function(t,e){if(console.log("handleFileDrop"),t.preventDefault(),t.dataTransfer&&t.dataTransfer.items){var n=t.dataTransfer.items;if(!n[0])return;for(var o=0;o<n.length;o++)e(n[o].getAsFile())}}(t,(t=>{Object(h.b)({fileToUpload:t,folder:O.folder,windowId:P})}))}},Object(w.c)(f.a,{noteParentType:t.noteParentType,windowId:P,file:z||O,fileContent:H,isActive:x,canEdit:Y,isDragging:lt,showViewToggler:t.showViewToggler,showToolbar:t.showToolbar,titleEditor:t.titleEditor,viewType:I,mobileView:t.mobileView,onLayoutUpdate:t.onLayoutUpdate,onReloadContent:()=>{L(!1),setTimeout((()=>{L(!0)}),100)},onFileEdited:(t,e)=>{((t,e)=>{Object(s.d)((n=>{n.file.saveContent(t,e,{history:!0,debounced:500,withMetas:z})})),ot.current=!0,it(),Q.current={content:e,path:null===O||void 0===O?void 0:O.path},Z({path:t,content:e,timestamp:Date.now()})})(t,e)}})))},j=l.a.memo(O,((t,e)=>{let n=!0;return JSON.stringify(t)!==JSON.stringify(e)&&(n=!1),n})),x=()=>"\n\t.content-different-preview {\n\t\tmax-height: 50vh;\n\t\twidth: 70vw;\n\t\toverflow-y: auto;\n\t\ttext-align: left;\n\t\t.content-different-preview-inner {\n\t\t\tbackground: #e7e7e7;\n\t\t\tpadding: 10px;\n\t\t\tborder-radius: 10px;\n\t\t}\n\t\t.diff-sign {\n\t\t\tfont-weight: bold;\n\t\t}\n\t\t.diff-sign.diff-modified {\n\t\t\tcolor: orange;\n\t\t}\n\t\t.diff-sign.diff-deleted {\n\t\t\tcolor: red;\n\t\t}\n\t\t.diff-sign.diff-added {\n\t\t\tcolor: green;\n\t\t}\n\t}\n\n\t// height 100% everywhere\n\t.window-editor-wrapper-wrapper,\n\t.window-editor-wrapper,\n\t.dual-view-wrapper,\n\t.editor-area,\n\t.preview-area-wrapper,\n\t.preview-area,\n\t.main-editor-wrapper{\n\t\t\theight: 100%;\n\t}\n\n\t.window-editor-wrapper {\n\t\n\t\t\n\n\t\t.content-wrapper {\n\t\t\t\theight:100%;\n\t\t}\n\t\t.note-active-ribbon {\n\t\t\t\theight: 2px;\n\t\t\t\twidth: 100%;\n\t\t}\n\t\t\n\n\t\t.editor-toolbar-dropdown {\n\t\t\tposition: absolute;\n\t\t\ttop: 10px;\n\t\t\tright: 0px;\n\t\t}\n\n\n\n\n\n\t\t\n\n\n\n\t\t// content css modification\n\t\t.dual-view-wrapper {\n\t\t\t\t.file-path-wrapper {\n\t\t\t\t\t\tdisplay:none;\n\t\t\t\t}\n\t\t\t\t\n\n\t\t\t\t//\n\t\t\t\t// ALL\n\t\t\t\t//\n\t\t\t\t&.device-desktop {\n\t\t\t\t\t\t.preview-area-wrapper {\n\t\t\t\t\t\t\t\tmargin-top: 33px;\n\t\t\t\t\t\t\t\t//padding: 5px 5px 5px 5px;\n\t\t\t\t\t\t\t\tbackground: ".concat(b.a.colors.bgPreview,";\n\t\t\t\t\t\t}\n\t\t\t\t\t\t.preview-area {\n\t\t\t\t\t\t\t\t//padding: 10px 10px 10px 10px;\n\t\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t//\n\t\t\t\t// FULL PREVIEW\n\t\t\t\t//\n\t\t\t\t&.device-desktop.view-preview {\n\t\t\t\t\t\t.editor-area {\n\t\t\t\t\t\t\t\twidth: 0%;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t.preview-area-wrapper {\n\t\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t//\n\t\t\t\t// FULL EDITOR\n\t\t\t\t//\n\t\t\t\t&.device-desktop.view-editor {\n\t\t\t\t\t\t.preview-area-wrapper {\n\t\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t.scrolling-bar-wrapper {\n\t\t\t\t\t\ttop: 33px;\n\t\t\t\t}\n\t\t}\n\t}\n")},145:function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));var o=n(6),i=n(12),c=n(30),a=n(28);var r=function(t,e){var n="Tiro";console.log("Updating page title to:",t,e),t||(t=n),e&&(document.title=t),e||(console.log("Checking for custom title..."),Object(o.d)((function(e){e.file.getContent("/.tiro/app-title.md",(function(o){"NO_FILE"===o?document.title=t||n:((t,e,cb)=>{const n=[],o=[];e.cb=cb,Object(c.a)(e,((t,e)=>{n.push(e),o.push(t)}));try{new Function(...n,t)(...o)}catch(i){let e="[ERR eval code] (): ".concat(i," <br> codeTxt: ").concat(t," (more infos in console)");console.log(e,i,{paramsNames:n,paramsValues:o}),console.trace(i),Object(a.d)("".concat(e))}})(o,{api:e,isMobile:i.e},(function(t){document.title=t||n}))}))})))}},157:function(t,e,n){"use strict";n.d(e,"a",(function(){return p})),n.d(e,"c",(function(){return f})),n.d(e,"b",(function(){return g}));var o=n(31),i=n(6),c=n(12),a=n(33),r=n(10),l=n(45),s=n(138),u=n(46),d=n(28);const p=Object(s.a)(((t,e)=>b(t,e))),f=(t,e)=>Object(l.a)({file:t,windowId:e,pattern:o.a.externalLink3,replacement:t=>{const e=t.matchs;let n=document.createElement("span");return n.innerHTML=p(e),n}}),b=(t,e)=>{let n=[];n=Array.isArray(t)?t:[...t.matchAll(o.a.externalLink3)][0];let r=document.createElement("span"),l=n[0].endsWith("/")?n[0].slice(0,-1):n[0];l.startsWith("http://")||l.startsWith("https://")||(l="https://"+l);let s=Object(u.c)(l);const p=function(t,cb){let e=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],n=t.dataset.link;Object(i.d)((t=>{Object(d.d)('fetching article "'.concat(n,'"...'),"fetchArticle",5),t.ressource.fetchUrlArticle(n,(n=>{let o=encodeURIComponent(n.html);e&&t.ui.floatingPanel.create({type:"ctag",ctagConfig:{tagName:"web",content:o}}),cb(n)}))}))};let f="";null!==e&&void 0!==e&&e.addLineJump&&(f="\n");let b=a.d,g='<span title="Open link in detached window" onclick="'.concat(Object(a.c)("open-win-link",(t=>{if(!t)return;let e=t.dataset.link;window.open(e,"popup-preview-link","width=800,height=1000")})),'"\nclass="link-action link-openwindow" data-link="').concat(l,'">').concat(b("up-right-from-square"),"</span>"),h='<span\nonclick="'.concat(Object(a.c)("fetch-link",(t=>{t&&p(t,(()=>{}))})),'"\ntitle="Display url content" class="link-fetcharticle link-action" data-link="').concat(l,'">').concat(b("file-lines"),"</span>"),m='<span\nonclick="'.concat(Object(a.c)("audio-link",(t=>{t&&p(t,(e=>{e.text&&Object(i.d)((n=>{n.ui.textToSpeechPopup.open(e.text,{id:t.dataset.link})}))}),!1)})),'"\ntitle="Text to speech url content" class="link-audio link-action" data-link="').concat(l,'">').concat(b("volume-high"),"</span>"),v='<span\n\tonclick="'.concat(Object(a.c)("detach-link",(t=>{if(!t)return;let e=t.dataset.link;Object(i.d)((t=>{t.ui.floatingPanel.create({type:"ctag",ctagConfig:{tagName:"web",content:e}})}))})),'"\n\t\t title="Detach link in floating panel" class="link-detach link-action" data-link="').concat(l,'">').concat(b("window-restore"),"</span>"),w='<a\n\t\thref="'.concat(l,'" target="_blank" rel="noreferrer"\n\t\ttitle="Go to link" class="link-goto link-action">').concat(b("link"),"</a>"),O='<span class="link-action-more"><span class="icon-more">'.concat(b("ellipsis"),'</span><span class="link-action-wrapper">').concat(h," ").concat(m," ").concat(v," ").concat(g," </span></span>"),j=('<span class="link-action-wrapper">'.concat(h," ").concat(m," ").concat(w," ").concat(v," ").concat(g," </span>"),'<span class="'.concat(Object(c.e)()?"mobile-version":"",' link-mdpreview-wrapper"><a href="').concat(l,'" class="link-mdpreview" title="').concat(l,'" target="_blank" rel="noreferrer">').concat(b("link")).concat(s,"</a>").concat(O).concat('<span class="cm-hover-popup cm-hover-popup"></span>',"</span>").concat(f));return r.innerHTML="".concat(j),r.outerHTML},g=t=>{let e=parseFloat(t.get("ui_editor_links_preview_zoom")),n=t.get("beta_floating_windows");return isNaN(e)&&(e=1),isNaN(n)&&(n=!1),"\n.link-fetch-preview-wrapper {\n\t\tbackground: grey;\n}\n// .preview-area-wrapper .link-mdpreview-wrapper,\n// .preview-area .link-mdpreview-wrapper {\n// \tdisplay: inline-block;\n// }\n\n".concat(n?"":".link-detach {display:none;}","\n\n.link-mdpreview-wrapper {\n\t\tposition: relative;\n}\n.link-mdpreview-wrapper .link-action {\n}\n.link-deco {\n\t\tpadding-right:2px;\n}\n.link-action-more {\n\t\tposition: relative;\n}\n.link-action-wrapper {\n\t\tdisplay:flex;\n\t\tposition: absolute;\n\t\tright: -30px;\n\t\ttop: -10px;\n\t\ttransition: 0.2s all;\n\t\tbackground: white;\n\t\tbox-shadow: 0px 0px 5px rgba(0,0,0,0.1);\n\t\tpadding: 7px;\n\t\tz-index: 10000;\n\n\t\topacity: 0;\n\t\tpointer-events: none;\n}\n.link-action-wrapper span {\n\tmargin: 0px 2px;\n}\n\n\n// mobile version\n.mobile-version .link-action-wrapper {\n\t\tbox-shadow: 0px 0px 10px rgba(0,0,0,0.3);\n\ttop: 50%;\n left: 50%;\n position: fixed;\n transform: translate(-50%,-50%);\n padding: 30px 50px;\n background: white;\n width: 170px;\n z-index:2;\n\n opacity: 0;\n\tpointer-events: none;\n\n}\n.mobile-version .link-action {\n\t\ttransform: scale(1.6);\n\t\tpadding: 20px; \n}\n.link-action-wrapper .link-action {\n\t\tpadding-left:4px;\n}\n\n.link-action-more {\n\t\tpadding: ").concat(Object(c.e)()?"10px":"2px",";\n\t\tmargin-right: 6px;\n\t\topacity: 0.3;\n}\n.link-action-more .icon-more {\n\t\tposition:relative;\n\t\ttop:1px;\n}\n.link-action-more .icon-more svg {\n\t\ttransform: scale(0.7);\n}\n.link-action-more:hover {\n\t\topacity: 1;\n}\n.link-action-more:hover .link-action-wrapper {\n\t\topacity: 1;\n\t\tpointer-events:all;\n}\n\n.link-action \t\tsvg,\n.link-action span,\n.link-action div {\n\t\tpointer-events:none;\n}\n\n.link-action {\n\t\topacity: 0.5;\n\t\tcursor: pointer;\n}\n.cm-hover-popup {\n}\n.cm-hover-popup .resource-link-ctag {\n\t\tborder-radius: 7px;\n\t\toverflow:hidden;\n\t\tbox-shadow: 0 0 4px rgba(0,0,0,0.3);\n}\n\n// height size iframe here\n.cm-hover-popup .resource-link-ctag .iframe-view-wrapper.not-fullscreen {\n\t\n\theight: 400px!important;\n}\n\n.cm-hover-popup .resource-link-ctag .iframe-view-wrapper iframe {\n\t\twidth: ").concat(100/e,"%!important;\n\t\theight: ").concat(100/e,"!important;\n\t\tmax-height: ").concat(100/e,"%!important;\n\t\ttransform-origin:top left;\n\t\ttransform: scale(").concat(e,");\n\t\tmargin-left: 15px;\n}\n\n.link-mdpreview-wrapper {\n\n}\n.link-mdpreview {\n\t\topacity: 0.6;\n\t\ttransition: 0.2s all;\n\t\t&:hover {\n\t\t\t\topacity: 1;\n\t\t}\n\t\tline-height: 20px;\n\t\ttext-decoration: none;\n\t\tcolor: ").concat(r.a.colors.main,";\n\t\t// border: solid 2px ").concat(r.a.colors.main,";\n\t\tpadding: 0px 2px 0px 0px;\n\t\tcursor: pointer;\n\t\tborder-radius: 5px;\n\t\tsvg {\n\t\t\t\tcolor: ").concat(r.a.colors.main,";\n\t\t}\n}\n")}},158:function(t,e,n){"use strict";n.d(e,"b",(function(){return i})),n.d(e,"a",(function(){return a}));var o=n(6),i={curr:-1},c=setInterval((function(){r(),-1!==i.curr&&clearInterval(c)}),1e3),a=function(cb){Object(o.d)((function(t){t.cache.get("cacheId",(function(e){var n=e||0;t.cache.set("cacheId",n+1,-1,(function(){i.curr=n+1,console.log("cacheId incremented to "+n+1),cb&&cb(i.curr)}))}))}))},r=function(cb){Object(o.d)((function(t){t.cache.get("cacheId",(function(t){var e=t||0;i.curr=e,cb&&cb(e)}))}))}},159:function(t,e,n){"use strict";n.d(e,"a",(function(){return w})),n.d(e,"b",(function(){return O}));var o=n(16),i=n(3),c=n(11),a=n(38),r=n(37),l=n(39),s=n(30),u=n(133),d=n(225),p=n(53),f=n(129),b=n(6),g=n(12),h=n(0),m=n(88),v=n(24),w=function(t){var e=Object(c.a)({},t),n=e.w,o=e.h,i=e.x,r=e.y,l=e.file;o||(o=f.c.rows),n||(n=f.c.cols),i||(i=0),r||(r=0);var s=Object(a.a)();return{layout:{i:s,x:i,y:r,w:n,h:o,minH:1,maxH:2,forceRender:0},content:{i:s,active:!1,file:l,view:"both"}}},O=function(){var t=Object(h.useState)([]),e=Object(i.a)(t,2),n=e[0],c=e[1],a=Object(p.a)("tabs",[],{history:!1,debouncedSave:5e3}),d=Object(i.a)(a,3),f=d[0],w=d[1],O=d[2],C=Object(p.a)("tabs-mobile",[],{history:!1,debouncedSave:5e3}),S=Object(i.a)(C,3),E=S[0],T=S[1],I=S[2],N=Object(h.useRef)([]),P=function(t,cb){N.current=t,c(N.current),"mobile"!==Object(g.a)()&&w(N.current),"mobile"===Object(g.a)()&&T(N.current)},A=function(){O(),I()};Object(h.useEffect)((function(){A()}),[]),Object(h.useEffect)((function(){N.current=n}),[n]),Object(h.useEffect)((function(){"mobile"!==Object(g.a)()&&c(f)}),[f]),Object(h.useEffect)((function(){"mobile"===Object(g.a)()&&c(E)}),[E]);var R=function(t){console.log("[TAB] open in new tab",t);var e=y({fullWindowFile:t});if(e){N.current=Object(r.a)(N.current)?N.current:[];var n=[].concat(Object(o.a)(N.current),[e]),i=k(e.id,n);P(i)}},F=function(t){var e=[],n=Object(l.a)(N.current);Object(s.a)(n,(function(n,o){n.id!==t&&e.push(n)})),P(e)},L=function(){var t=null;return Object(s.a)(N.current,(function(e){e.active&&(t=e)})),t},D=function(t,e,n){var o="activeTab"!==e&&e?e:L();if(o)if("add"===t)Object(b.e)().then((function(t){R(t.ui.browser.files.active.get)}));else if("close"===t){if(!o)return;F(o.id)}else if("rename"===t){if(!o)return;if(n.length>15)return;var i=Object(l.a)(N.current);Object(s.a)(i,(function(t){t.id===(null===o||void 0===o?void 0:o.id)&&(t.name=n,t.manualName=!0)})),P(i)}else if("activateTabWindow"===t){if(!o)return;var c=Object(l.a)(N.current);Object(s.a)(c,(function(t){t.id===(null===o||void 0===o?void 0:o.id)&&Object(s.a)(t.grid.content,(function(t){t.active=t.i===n}))}));var a=j(c);P(a)}else if("activate"===t){if(!o)return;var r=k(o.id,N.current),u=j(r);if(P(u),"desktop"!==Object(g.a)()){var d,p=null===(d=M(o))||void 0===d?void 0:d.content.file;if(!p)return;Object(b.d)((function(t){t.ui.browser.goTo(p.folder,p.name)}))}}},M=function(t){if(!t){var e=Object(l.a)(N.current),n=_(e);if(!Object(u.a)(n))return;t=e[n]}if(t.grid.layout[0]){var o=t.grid,i={layout:o.layout[0],content:o.content[0]};return Object(s.a)(o.content,(function(t,e){t.active&&(i={layout:o.layout[e],content:o.content[e]})})),i}},z={get:function(){return N.current},close:F,openInNewTab:R,reorder:function(t,e){var n=Object(l.a)(N.current),o=n[t];n.splice(t,1),n.splice(e,0,o),P(n)},active:{get:L},updateTab:D,documentation:function(){return Object(v.a)(z,"api.tabs","client/src/hooks/app/tabs.hook.tsx")}},B={close:function(t){var e=Object(l.a)(N.current);Object(s.a)(t,(function(t){Object(s.a)(e,(function(e,n){for(var o=0;o<e.grid.content.length;o++){var i=e.grid.content[o],c=e.grid.layout[o];i.i===t&&e.grid.content.splice(o,1),c.i===t&&e.grid.layout.splice(o,1)}}))}));var n=j(e);P(n)},active:{get:M,setContent:function(t){if(t){var e=Object(l.a)(N.current),n=_(e);if(Object(u.a)(n)){var o=e[n],i=M(o);if(i){i.content.file=Object(l.a)(t),o.manualName||(o.name=x(t.name));var c=j(e);P(c)}}}},toggleView:function(t){var e=Object(l.a)(N.current),n=_(e);if(Object(u.a)(n)){var o=e[n].grid.content;if(!(o.length<1)){var i=0;Object(s.a)(o,(function(t,e){!0===t.active&&(i=e)})),o[i].view=t||Object(m.c)(o[i].view);var c=o[i].file;c&&Object(m.b)(null===c||void 0===c?void 0:c.path,o[i].view),P(e)}}}},updateWindows:function(t,e){var n=Object(l.a)(N.current);Object(s.a)(t,(function(t){Object(s.a)(n,(function(n,o){Object(s.a)(n.grid.content,(function(n){n.i===t&&(n.file=e)}))}))}));var o=j(n);P(o)},getIdsFromFile:function(t){var e=[];return Object(s.a)(N.current,(function(n){Object(s.a)(n.grid.content,(function(n){n.file&&n.file.path===t&&e.push(n.i)}))})),e},documentation:function(){return Object(v.a)(B,"api.windows","client/src/hooks/app/tabs.hook.tsx")}};return{tabs:n,updateTab:D,refreshTabsFromBackend:A,updateActiveTabGrid:function(t,cb){var e=Object(l.a)(N.current),n=_(e);if(Object(u.a)(n)){e[n].grid=Object.assign(e[n].grid,t);var o=e[n].refresh;e[n].refresh=o?o+1:1,P(e)}},refreshWindowGrid:function(){var t=j(N.current);P(t)},tabsApi:z,windowsApi:B}},j=function(t){var e=Object(l.a)(t);return Object(s.a)(e,(function(t){t.refresh=Object(d.a)(t.refresh)})),e},x=function(t){return t.length>15?"".concat(t.substring(0,13),".."):t},_=function(t){var e=void 0;return Object(s.a)(t,(function(t,n){t.active&&(e=n)})),e},k=function(t,e){var n=Object(l.a)(e);return Object(s.a)(n,(function(e){e.refresh=Object(u.a)(e.refresh)?e.refresh++:1,e.id===t?e.active=!0:e.active=!1})),n},y=function(t){if(t.copiedTab){var e=Object(l.a)(t.copiedTab);return e.id=Object(a.a)(),e.name=C(t.copiedTab.name),e}if(t.fullWindowFile){var n=w({file:t.fullWindowFile});return{id:Object(a.a)(),name:x(t.fullWindowFile.name),active:!0,grid:{layout:[n.layout],content:[n.content]}}}},C=function(t){var e=t,n=e[e.length-1];return isNaN(parseInt(n))?e+=" 1":(e=e.slice(0,-1),e+="".concat(parseInt(n)+1)),e}},163:function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var o=function(t){return("0"+t).slice(-2)};String.prototype.replaceAll||(String.prototype.replaceAll=function(t,e){return"[object regexp]"===Object.prototype.toString.call(t).toLowerCase()?this.replace(t,e):this.replace(new RegExp(t,"g"),e)});var i=function(t){var e=function(t){var e=new Date;if(t&&""!==t&&"undefined"!==t)if("string"===typeof t){var n=t,i=t;if(t.startsWith("f")){var c=(n=t.replaceAll("f","").replaceAll("h",":").replaceAll("m",":00").replaceAll("-","/").replaceAll("_"," ")).split("/");n="".concat(c[1],"/").concat(c[0],"/").concat(c[2]),i="".concat(c[0],"/").concat(c[1],"/").concat(c[2])}else if(t.startsWith("d")){var a=t.replaceAll("d","").split("_")[0].split("-");n="".concat(a[1],"/").concat(a[0],"/").concat(a[2])}else if(t.startsWith("w")){var r=t.replaceAll("w","").split("-"),l=o(7*parseInt(r[0]));n="".concat(r[1],"/").concat(l,"/").concat(r[2])}else if(t.startsWith("h")){var s=(n=t.replace("h","").replaceAll("h",":00:00").replaceAll("-","/").replaceAll("_"," ")).split("/");n="".concat(s[1],"/").concat(s[0],"/").concat(s[2])}var u=Number.isNaN(new Date(n).getDate());e=new Date(n),u&&(e=new Date(i))}else e=new Date(t);else e=new Date;return e}(t),n=e.getFullYear(),i=e.getMonth()+1,c=e.getDate(),a=n.toString(),r=o(i),l=o(c),s=o(e.getHours()),u=o(e.getMinutes()),d="".concat(r,"/").concat(l,"/").concat(a," ").concat(s,":").concat(u),p="".concat(l,"/").concat(r,"/").concat(a," ").concat(s,":").concat(u),f="".concat(r,"-").concat(l,"-").concat(a,"_").concat(s,"h").concat(u,"m"),b="".concat(l,"-").concat(r,"-").concat(a,"_").concat(s,"h").concat(u,"m"),g="".concat(r,"/").concat(l,"/").concat(a),h="".concat(l,"/").concat(r,"/").concat(a),m={year:n,month:i,day:c,hour:e.getHours(),min:e.getMinutes(),timestamp:e.getTime()},v=function(){return Math.ceil(c/7)};return{year:a,month:r,day:l,hour:s,min:u,full:d,num:m,date:g,raw:e,full_file:f,full_file_fr:b,full_fr:p,date_fr:h,getWeekNb:v,getCustomFormat:function(t){var e="f".concat(b);return"day"===t&&(e="d".concat(l,"-").concat(r,"-").concat(n)),"week"===t&&(e="w".concat(v(),"-").concat(r,"-").concat(n)),"hour"===t&&(e="h".concat(l,"-").concat(r,"-").concat(n,"_").concat(s,"h")),"".concat(e)}}}},164:function(t,e,n){"use strict";n.d(e,"c",(function(){return et})),n.d(e,"a",(function(){return nt})),n.d(e,"b",(function(){return ot}));var o=n(23),i=n(16),c=n(3),a=n(0),r=n.n(a),l=n(12),s=n(250),u=n(58),d=n(63),p=function(t){var e=Object(a.useRef)(0),n=t.editorRef,o=t.editorRef,i=t.editorRef,c=function(){var c;if("codemirror"===t.editorType){var a=u.a.getCurrentLineInfos(n.current);if(!a)return null;c=a,e.current=a.currentPosition}else if("monaco-textarea"===t.editorType){var r;if("desktop"===t.deviceType)c=null===(r=o.current)||void 0===r?void 0:r.getCurrentLineInfos(),e.current=c&&c.monacoPosition?c.monacoPosition:0;else c=i.current?Object(d.c)(i.current):null,e.current=c&&c.currentPosition?c.currentPosition:0}return c},r=function(c){var a=e.current+c;if("codemirror"===t.editorType)u.a.updateCursor(n.current,a,!0);else if(Object(l.c)("desktop")){var r;null===(r=o.current)||void 0===r||r.editor.setPosition(a)}else{var s=i.current;if(!s)return;s.focus(),setTimeout((function(){s&&(s.selectionStart=a,s.selectionEnd=a)}))}};return{getLineTextInfos:c,resetCursorPosition:r,applyTextModifAction:function(t,e){var n=c();return n?Object(d.g)(t,n,(function(t){r(t)}),e):null}}},f=n(115),b=function(t,e){var n=p({editorType:"monaco-textarea",deviceType:"mobile",editorRef:e.mobileTextarea}),o=n.getLineTextInfos,i=n.resetCursorPosition,r=function(t){var e=Object(a.useState)(0),n=Object(c.a)(e,2),o=n[0],i=n[1];return{saveYTextarea:function(e){var n=t.current?t.current.scrollTop:0;i(e||n)},resetYTextarea:function(){t.current&&(console.log("resetYTextarea",o),t.current.scrollTop=o)}}}(e.mobileTextarea),l=r.saveYTextarea,s=r.resetYTextarea,u=Object(a.useState)(!1),b=Object(c.a)(u,2),g=b[0],h=b[1];Object(f.a)((function(){h(!1)}),500);return{onTextareaChange:function(n){console.log("onTextareaChange");var c=n.target.value,a=c[n.target.selectionStart-1]&&c[n.target.selectionStart-1].charCodeAt(0);if(c.length>t.length){var r=o();if(!r)return;c=Object(d.h)(r,a,(function(t){setTimeout((function(){i(t),s()}))}))}e.onMobileNoteEdition(c)},onTextareaScroll:function(t){if(!g){var e=t.target.scrollTop;l(e),console.log("onTextareaScroll")}}}},g="",h=n(224),m=n(111),v=n(70),w=n(1),O=n(14),j=n(72),x=n(10),_=n(21),k=n(241),y=n(48),C=n(240),S=n(233),E=n(191),T=n(234),I=n(247),N=n(6),P=n(229),A=n(98),R=n(30),F=n(82),L=function(t,e){var n=".window-id-".concat(t," .preview-area-wrapper"),o=document.querySelectorAll(n)[0]||null,i="print-wrapper";if(o){!function(){var t=document.querySelectorAll(".".concat(i));Object(R.a)(t,(function(t){t.classList.remove(i)}))}();var c=Object(j.a)(new Date(e.modified||0)),a=Object(j.a)(new Date(e.modified||0)),r="\n<head>\n\t<title>".concat(e.name,' </title>\n\t\n</head>\n<html>\n\t<body>\n\t\t\n\t\t<div class="simple-css-print-wrapper">\n\t\t\t<div class="hide-print">\n\t\t\t\t<bm> Export options </bm>\n\t\t\t\t<button onclick="window.print()">print</button>\n\t\t\t\t<button onclick="window.print()">export to pdf</button>\n\t\t\t\t<button onclick="window.alert(\'CTRL+ S then select *complete webpage* if available\')">export to html</button>\n\t\t\t</div>\n\t\t\t\t<div class="file-infos-wrapper">\n\t\t\t\t\tNote Name : ').concat(e.name,"<br>\n\t\t\t\t\tNote Path : ").concat(e.path,"<br>\n\t\t\t\t\tCreated : ").concat(c,"<br>\n\t\t\t\t\tEdited : ").concat(a,"<br>\n\t\t\t\t</div>\n\t\t\t\t").concat(o.innerHTML,"\n\t\t\t</div>\n\t\t\t<style>").concat(Object(F.c)(),"</style>\n\t\t\t<style>").concat(D(),'</style>\n\n<script>\n\tconsole.log("hello world")\n<\/script>\n\n\n\t</body>\n</html>\n\t\t\t\t'),l=window.open("","print-popup","width=800,height=1000");null===l||void 0===l||l.document.write(r)}},D=function(){return"\n@page {\nmargin: 0;\n}\n@media print {\n\t.hide-print {\n\t\tdisplay: none;\n\t}\n}\n\n* {\n\t-webkit-print-color-adjust: exact; \n\tprint-color-adjust: exact; \n}\n.file-path-wrapper {\n\tdisplay: none;\n}\nh1.title.big-title {\n\tdisplay: none;\n}\n.file-infos-wrapper {\n\tdisplay: none;\n\tbackground: #eeeeee;\n\tpadding: 10px;\n\tmargin: 10px;\n}\n\n.simple-css-print-wrapper {\n\tmargin: 20px;\n\twidth: 90%;\n}\n.simple-css-wrapper {\n\tfont-size: 12px;\n}\n\ntable {\n\tfont-size: 12px!important;\n}\nimg {\n\t// max-width: 300px!important;\n\t// max-height: 500px!important;\n\tmax-width: 100%;\n\tmax-height: 500px;\n}\n.block-tag {\n\t\tdisplay: none;\n}\n"},M=n(192),z=n(29),B=n(17),W=n(232),U=n(33),H="[EXPORT]",q=function(t){if(t){var e=t.dataset.format,n=t.dataset.path;if(e&&n){var o=Object(z.e)(n);Object(N.d)((function(t){Object(N.d)((function(t){t.ui.notification.emit({content:"[EXPORT] converting...",id:"export",options:{hideAfter:-1}})})),t.config.get((function(n){var i="/".concat(B.a.path.configFolder,"/").concat(B.a.path.cacheFolder,"/pandoc");t.folders.create(i,(function(c){var a="";"dzslides"===e&&(a="--self-contained"),"slideous"===e&&(a="--self-contained"),"revealjs"===e&&(a="--self-contained"),"beamer"===e&&(a="--self-contained");var r=e;"dzslides"===e&&(r="html"),"slideous"===e&&(r="html"),"revealjs"===e&&(r="html"),"latex"===e&&(r="tex"),"gfm"===e&&(r="md"),"latex-pdf"===e&&(r="pdf"),"beamer"===e&&(r="pdf");var l="".concat(o.name),s="".concat(l,".").concat(r),u="".concat(n.dataFolder,"/"),d=Object(z.b)("".concat(u,"/").concat(o.folder)),p=(Object(z.b)("./".concat(o.name)),Object(z.b)("".concat(u,"/").concat(i))),f=Object(z.b)("".concat(p,"/").concat(s)),b=Object(z.b)("/".concat(B.a.path.configFolder,"/").concat(B.a.path.cacheFolder,"/pandoc/").concat(s)),g=Object(z.b)("".concat(o.folder,"/.export_md_pandoc.txt")),h=Object(z.b)("./.export_md_pandoc.txt");t.file.getContent(o.path,(function(n){n=n.replace(/\]\(\/\./g,"](."),t.file.saveContent(g,n,{},(function(){console.log(H,"saved"),t.file.getContent(g,(function(n){var o='cd "'.concat(d,'" && pandoc --output="').concat(f,'" --verbose ').concat(function(t,e){var n=t.userSettings.get("export_pandoc_cli_options").split("\n")||[],o={};return Object(R.a)(n,(function(t){var e=t.split("|");2===e.length&&(o[e[0].trim()]=e[1].trim())})),console.log(o,n),o[e]||""}(t,e)," ").concat(a," --to=").concat(e,' "').concat(h,'" ');!1===o.includes("--from=")&&(o=o.replace("--to=","--from=markdown --to="));var i=o;"latex-pdf"===e&&(i='cd "'.concat(d,'" && pdflatex -halt-on-error -output-directory="').concat(p,'" -jobname="').concat(l,'" "').concat(h,'" '));var c=function(e){var n=""===e.stderr?e.stdout:e.stderr;console.error("[CONVERT ERROR]:",e),t.ui.notification.emit({content:'[EXPORT] Error <br/> "'.concat(n," <br/><br/> ").concat(e.shortMessage,'"'),id:"export",options:{hideAfter:-1}})};console.log(H,"pandocCmd",o),t.command.exec("pkill -9 pandoc",(function(e){t.command.exec(i,(function(t){var e={failed:!1,stderr:null,shortMessage:null};try{e=JSON.parse(t)||{failed:!1}}catch(o){c(e)}if(e.failed)c(e);else{var n=Object(W.a)(b);!function(t,e){var n=document.createElement("a");n.setAttribute("download",t),n.setAttribute("href",e),n.setAttribute("target","_blank"),Object(N.d)((function(t){t.ui.notification.emit({content:"[EXPORT] done",id:"export",options:{hideAfter:3}})})),n.click()}(s,n)}}))}))}))}))}),{removeMetaHeader:!0})}))}))}))}}},V=n(132),G=n(292),J=n(133),K=n(75),Y=n(22),$=n(25),Z=function(t){console.log("addTableCol");var e=t.cursorInfos.from,n=Object(d.d)(t.fileContent,e),o=n.activeLine;if(o.includes("|")){var i=o.split("|").length;console.log("tableColsNb",i);for(var c=[],a=n.lineIndex;a<n.lines.length;a++){if(n.lines[a].split("|").length!==i)break;c.push(a)}for(var r=n.activeLinePos,l=o.split("|"),s=0,u=0,p=0;p<l.length;p++){var f=l[p];if(r>=u&&r<=u+f.length){s=p;break}u+=f.length+1}return{linesOfTable:c,linesInfos:n,colIndex:s}}},X=n(68),Q=n(95),tt=function(t){var e=Object(a.useState)(""),n=Object(c.a)(e,2),o=n[0],f=n[1],x=Object(a.useRef)(null),F=!0;!1===t.canEdit&&(F=!1),!1===t.isConnected&&(F=!1);var D=!0;!1===t.showViewToggler&&(D=!1);var B=!0;!1===t.showToolbar&&(B=!1);var W=!Object(V.a)(t.titleEditor)&&!Object(G.a)(t.titleEditor)||t.titleEditor,H=Object(a.useRef)(t.file);Object(a.useEffect)((function(){H.current=t.file}),[t.file.path]);var $=function(t){var e=Object(a.useRef)(!1),n=Object(a.useRef)(!1);Object(a.useEffect)((function(){n.current=t.canEdit}),[t.canEdit]),Object(a.useEffect)((function(){return e.current=!1,t.onEditorDidMount&&t.onEditorDidMount(),function(){t.onEditorWillUnmount&&(o(),t.onEditorWillUnmount())}}),[t.file.path]),Object(a.useEffect)((function(){o()}),[t.file.path]),Object(a.useEffect)((function(){t.onNoteContentDidLoad&&t.onNoteContentDidLoad()}),[t.fileContent,t.file.path]);var o=function(){""!==g&&t.onNoteLeaving&&t.onNoteLeaving(e.current,g),g=t.file.path};return{triggerNoteEdition:function(n){e.current?t.onNoteEdition&&t.onNoteEdition(n,!1):t.onNoteEdition&&t.onNoteEdition(n,!0),e.current=!0}}}({file:t.file,fileContent:t.fileContent,canEdit:F,onEditorDidMount:function(){f(t.fileContent)},onEditorWillUnmount:function(){},onNoteContentDidLoad:function(){O.a&&f(t.fileContent)},onNoteEdition:function(e,n){var o=H.current;n&&Object(N.d)((function(e){e.history.save(o.path,t.fileContent,"enter")})),t.onFileEdited(o.path,e),f(e)},onNoteLeaving:function(t,e){}}).triggerNoteEdition,tt=Object(a.useRef)(null),et=b(o,{mobileTextarea:tt,onMobileNoteEdition:$}),nt=(et.onTextareaChange,et.onTextareaScroll,Object(a.useRef)(null)),ot="desktop"!==Object(l.a)()?tt:x;"codemirror"===t.editorType&&(ot=nt);var it=p({editorType:t.editorType,deviceType:Object(l.a)(),editorRef:ot}).applyTextModifAction,ct=function(t,e,n){var o=it("insertAt",{textToInsert:t,insertPosition:e,replaceText:n});o&&($(o),Pt())},at=function(t){var e=Object(a.useState)(null),n=Object(c.a)(e,2),o=n[0],i=n[1],r=Object(a.useState)(!1),l=Object(c.a)(r,2),s=l[0],u=l[1],d=Object(a.useState)(!1),p=Object(c.a)(d,2),f=p[0],b=p[1],g=Object(a.useState)(null),O=Object(c.a)(g,2),j=O[0],x=O[1],_=function(e){var n=Object(v.b)(t.fileContent),o=n.content,i=n.metas,c=Object(m.c)(o,e);if("failure"===c.status)x(null);else{console.log("encryption done",c),u(!1);var a=c.cipher;t.onTextEncrypted(Object(v.a)(a,i))}},k=function(e){var n=Object(v.b)(t.fileContent),o=n.content,i=n.metas,c=Object(m.a)(o,e);if("failure"===c.status)x(null),alert("wrong password");else{b(!0),u(!0),console.log("decryption done",c);var a=c.plaintext;t.onTextDecrypted(Object(v.a)(a,i))}};return{APasswordPopup:Object(w.c)(h.a,{onClose:function(){i(null)},onSubmit:function(t){var e=o;i(null),x(t),"toEncrypt"===e&&_(t),"toDecrypt"===e&&k(t)}}),askForPassword:o,decryptButtonConfig:{title:"decrypt text",icon:"faUnlock",action:function(){j?k(j):i("toDecrypt")}},encryptButtonConfig:{title:"encrypt text",icon:"faLock",action:function(){j?_(j):i("toEncrypt")}},ifEncryptOnLeave:function(cb){if(s&&j){console.log("[EVENTS EDITOR] shouldEncryptOnLeave");var e=Object(v.b)(t.fileContent),n=e.content,o=e.metas,i=Object(m.c)(n,j);i.cipher&&cb(Object(v.a)(i.cipher,o))}x(null),b(!1)},noHistoryBackupWhenDecrypted:f}}({fileContent:o,onTextEncrypted:function(e){$(e),Pt(),Object(N.d)((function(n){n.history.save(t.file.path,e,"int")}))},onTextDecrypted:function(t){$(t),Pt()}}),rt=at.APasswordPopup,lt=at.askForPassword,st=at.decryptButtonConfig,ut=at.encryptButtonConfig,dt=(at.ifEncryptOnLeave,at.noHistoryBackupWhenDecrypted,Object(a.useContext)(I.a)),pt=Object(a.useState)(-1),ft=Object(c.a)(pt,2),bt=ft[0],gt=ft[1],ht=function(e,n){return{title:"",class:"upload-button-wrapper",action:function(){},customHtml:Object(w.c)(E.a,{file:t.file,windowId:t.windowId,type:e,label:n})}},mt=[{title:"Reload content",icon:"faSync",action:function(){Ct.current=Ct.current+1,t.onReloadContent(Ct.current)}},{icon:"faWindowRestore",title:"Detach Window",action:function(){Object(N.d)((function(e){e.ui.floatingPanel.create({type:"file",file:t.file,view:t.viewType})}))}}].concat(Object(i.a)(function(){var t=[ht("all","Upload files")];return"desktop"!==Object(l.a)()&&(t.push(ht("image","Upload Gallery")),t.push(ht("camera","Capture")),t.push(ht("microphone","Record"))),t}()),[{title:"Search",icon:"faSearch",action:function(){Object(N.d)((function(e){e.ui.note.editorAction.dispatch({windowId:t.windowId,type:"searchWord",searchWordString:" "})}))}},Object(m.d)(o)?st:ut,{title:"Export",icon:"faFileDownload",action:function(){var e;e=t.file,Object(N.d)((function(t){t.popup.show('\n <div id="export-popup-wrapper">\n <div class="buttons-list"> \n <button onclick="'.concat(Object(U.c)("export-note-to",q),'" data-format="docx" data-path="').concat(e.path,'">docx</button>\n <button onclick="').concat(Object(U.c)("export-note-to",q),'" data-format="odt " data-path="').concat(e.path,'">odt</button>\n <button onclick="').concat(Object(U.c)("export-note-to",q),'" data-format="pdf" data-path="').concat(e.path,'">pdf</button>\n \n <button onclick="').concat(Object(U.c)("export-note-to",q),'" data-format="gfm" data-path="').concat(e.path,'">markdown</button>\n <button onclick="').concat(Object(U.c)("export-note-to",q),'" data-format="epub" data-path="').concat(e.path,'">epub</button>\n <button onclick="').concat(Object(U.c)("export-note-to",q),'" data-format="rtf" data-path="').concat(e.path,'">rtf</button>\n </div>\n <br/>\n <div class="buttons-list"> \n Latex:\n <br/>\n <button onclick="').concat(Object(U.c)("export-note-to",q),'" data-format="latex" data-path="').concat(e.path,'">latex (.tex)</button>\n <button onclick="').concat(Object(U.c)("export-note-to",q),'" data-format="latex-pdf" data-path="').concat(e.path,'">latex (.pdf)</button>\n \n </div>\n <br/>\n <div class="buttons-list"> \n Slides: \n <br/>\n <button onclick="').concat(Object(U.c)("export-note-to",q),'" data-format="pptx" data-path="').concat(e.path,'">pptx</button>\n <button onclick="').concat(Object(U.c)("export-note-to",q),'" data-format="beamer" data-path="').concat(e.path,'">beamer</button>\n <br/>\n <br/>\n HTML Slides: <br/>\n <button onclick="').concat(Object(U.c)("export-note-to",q),'" data-format="revealjs" data-path="').concat(e.path,'">revealjs</button>\n <button onclick="').concat(Object(U.c)("export-note-to",q),'" data-format="dzslides" data-path="').concat(e.path,'">dzslides</button>\n <button onclick="').concat(Object(U.c)("export-note-to",q),'" data-format="slideous" data-path="').concat(e.path,'">slideous</button>\n \n </div>\n <br/>\n <br/>\n <div class="advice"> \n Export requires extra install, please check settings > export.\n </div>\n </div>\n '),"Export Note to :",(function(t){console.log(t)}))}))}},{title:"Print",icon:"faPrint",action:function(){"editor"===(t.viewType||"editor")?(Wt("both"),setTimeout((function(){L(t.windowId,t.file),setTimeout((function(){Wt("editor")}),500)}),500)):L(t.windowId,t.file)}},{title:_.a.editorBar.explanation.history,icon:"faHistory",action:function(){jt(!Ot)}},{title:_.a.editorBar.tts,icon:"faCommentDots",action:function(){Object(N.d)((function(e){e.ui.textToSpeechPopup.open(o,{id:t.file.name})}))}},{title:"Delete note",class:"delete",icon:"faTrash",action:function(){dt.file.onFileDelete(t.file)}}]),vt=Object(a.useState)(!1),wt=Object(c.a)(vt,2),Ot=wt[0],jt=wt[1],xt=Object(a.useRef)(null),_t=xt.current,kt=700;_t&&(kt=_t.clientHeight/1.3),"mobile"===Object(l.a)()&&(kt=window.innerHeight);var yt=Object(a.useRef)(null);Object(a.useEffect)((function(){Pt()}),[t.fileContent,t.file.path,t.windowId]);var Ct=Object(a.useRef)(0),St=Object(a.useRef)(0),Et=Object(a.useState)(0),Tt=Object(c.a)(Et,2),It=Tt[0],Nt=Tt[1],Pt=function(){St.current=St.current+1,Nt(St.current)},At=Object(a.useState)(!1),Rt=Object(c.a)(At,2),Ft=Rt[0],Lt=Rt[1],Dt=Object(a.useState)(!1),Mt=Object(c.a)(Dt,2),zt=Mt[0],Bt=Mt[1];Object(a.useEffect)((function(){var t=o.length>3e10&&"desktop"!==Object(l.a)();Lt(t)}),[o,t.viewType]),Object(a.useEffect)((function(){var e=o.length>3e9&&"desktop"!==Object(l.a)();Lt(e),Pt();var n="desktop"===Object(l.a)()&&"preview"===t.viewType||"desktop"!==Object(l.a)()&&"preview"===t.mobileView;Bt(n);var i=t.file.path;setTimeout((function(){i===t.file.path&&Pt()}),100)}),[t.viewType,t.mobileView]);var Wt=function(e){t.onLayoutUpdate("windowViewChange",{view:e})},Ut=Object(a.useState)(-1),Ht=Object(c.a)(Ut,2),qt=Ht[0],Vt=Ht[1];Object(a.useEffect)((function(){Object(N.d)((function(e){t.editorAction&&function(e,n){if(e&&("active"!==e.windowId&&(e.noteParentType="any"),(e.windowId===t.windowId||"active"===e.windowId)&&("any"===e.noteParentType||e.noteParentType===t.noteParentType)&&("mobile"===Object(l.a)()||"active"!==e.windowId||t.isActive)&&("mobile"===Object(l.a)()||"active"===e.windowId||e.windowId===t.windowId)&&n.note.ui.editorAction.canExecuteAction(e))){if(console.log("[EDITOR ACTION] action ".concat(e.type," triggered on ").concat(e.windowId,' (which matched with "').concat(t.file.filenameWithoutExt,'"), with noteParentType ').concat(e.noteParentType," ").concat(t.windowId),e),"lineJump"===e.type){var i="both";e.lineJumpType&&(i=e.lineJumpType);var c="editor"===i||"both"===i,a="preview"===i||"both"===i,r=0;if(e.lineJumpNb&&(r=e.lineJumpNb),e.lineJumpString){var s=(null===e||void 0===e?void 0:e.lineJumpString)||"",d=t.fileContent.split("\n");Object(R.a)(d,(function(t,e){t.includes(s)&&(r=e+3)}))}if(c&&(Vt(r),setTimeout((function(){Vt(-1)}),100)),a){var p,f=Object(Q.a)(r,o);if(!f.mdPart)return;var b=null===(p=f.mdPart)||void 0===p?void 0:p.previewId;if(!b)return;var g=".dual-view-wrapper.window-id-".concat(t.windowId," .preview-area-wrapper #").concat(b);setTimeout((function(){var e=document.querySelector(g),n=".dual-view-wrapper.window-id-".concat(t.windowId," .preview-area"),o=document.querySelector(n);e&&(o.scrollTop=(null===e||void 0===e?void 0:e.offsetTop)-100)}),10)}}if("insertText"===e.type&&e.insertText&&e.insertPos&&ct(e.insertText,e.insertPos,!1),"replaceText"===e.type&&e.replaceText&&e.replacePos){ct(e.replaceText,e.replacePos,!0);var h=nt.current;if(!h)return;if(!Object(J.a)(e.replacePos))return;u.a.updateCursor(h,e.replacePos,!0)}if("searchWord"===e.type&&e.searchWordString){var v=nt.current;if(!v)return;u.a.searchWord(v,e.searchWordString,e.searchReplacementString,!0)}if("setSelection"===e.type&&e.selection){var w=nt.current;if(!w)return;u.a.setSelection(w,e.selection)}if("undo"===e.type){var O=nt.current;if(!O)return;u.a.undo(O.view)}if("redo"===e.type){var j=nt.current;if(console.log(j,j.view),!j)return;u.a.redo(j.view)}if("uploadProgress"===e.type&>(e.uploadProgress||-1),"highlightLine"===e.type){var x=nt.current;if(!x)return;!function(t){var e=t.state,n=e.selection.main,o=e.doc.lineAt(n.head).number,i=t.state.doc.line(o),c=i.from,a=i.to;t.dispatch({selection:{anchor:c,head:a}})}(x.view)}if("toggleEncryption"===e.type&&(Object(m.d)(o)?st.action():ut.action()),"triggerUpload"===e.type){var _=document.querySelector(".window-id-".concat(t.windowId," .upload-button-wrapper input"));if(!_)return;console.log("[EDITOR ACTION] TRIGGER UPLOAD2222",_),_.dispatchEvent(new MouseEvent("click",{view:window,bubbles:!0,cancelable:!0}))}if("toggleContextMenu"===e.type){var k=!0;void 0!==e.state&&(k=e.state),Yt(k),console.log("[EDITOR ACTION] OPEN CONTEXT MENU")}}}(t.editorAction,e)}))}),[t.editorAction,t.windowId]);var Gt=Object(a.useState)(!1),Jt=Object(c.a)(Gt,2),Kt=Jt[0],Yt=Jt[1],$t=function(){Object(N.d)((function(e){var n;null===(n=e.lastNotesApi)||void 0===n||n.addToHistory(t.file,!1)}))},Zt=Object(a.useState)({x:0,y:0,from:0,to:0,fromPx:0,toPx:0}),Xt=Object(c.a)(Zt,2),Qt=Xt[0],te=Xt[1],ee=o.substring(Qt.from,Qt.to),ne=".window-id-".concat(t.windowId),oe=0;try{var ie;oe=(null===(ie=document.querySelector(ne))||void 0===ie?void 0:ie.getBoundingClientRect().top)||0}catch(de){console.log("error",de)}Qt.y;var ce="desktop"===Object(l.a)()?40:60,ae="desktop"===Object(l.a)()?0:10,re=Object(a.useState)(0),le=Object(c.a)(re,2),se=le[0],ue=le[1];return Object(a.useEffect)((function(){var t,e;Object(l.e)()&&("visualViewport"in window&&(null===(t=window)||void 0===t||null===(e=t.visualViewport)||void 0===e||e.addEventListener("resize",(function(t){setTimeout((function(){var t,e=null===(t=window.visualViewport)||void 0===t?void 0:t.offsetTop;ue(e||0)}),200)}))))}),[]),Object(w.c)("div",{className:"editor-area ".concat(t.isActive?"active":""," note-parent-type-").concat(t.noteParentType),ref:xt,onWheel:function(e){X.a.scrollPreviewPx(t.windowId,e.deltaY)}},Object(w.c)("div",{className:"infos-editor-wrapper ".concat(W?"with-title-editor":"no-title-editor"," ").concat(t.isActive?"active":"")},(!0===W||"disabled"===W)&&Object(w.c)(r.a.Fragment,null,Object(w.c)("div",{className:"file-path-wrapper"},t.file.path.replace("/".concat(t.file.name),"")),Object(w.c)(s.a,{title:t.file.name.replace(".md",""),enabled:!0===W,onEdited:function(e,n){t.onTitleEditedHook&&t.onTitleEditedHook();var o="".concat(t.file.folder).concat(e,".md"),i="".concat(t.file.folder).concat(n,".md");dt.file.onTitleUpdate(o,i);Object(z.e)(i);Pt()}})),B&&Object(w.c)("div",{className:"toolbar-and-dates-wrapper"},Object(w.c)("div",{className:"editor-toolbar-dropdown"},Object(w.c)(S.a,{hover:!0,dir:"right",maxHeight:kt,forceShow:Kt,onMouseEnter:function(e){t.onLayoutUpdate("windowActiveStatus")}},Object(w.c)(r.a.Fragment,null,D&&Object(w.c)("div",{className:"view-toggler-wrapper"},"mobile"!==Object(l.a)()&&Object(w.c)(y.a,{class:"editor-view-toolbar",size:.8,buttons:[{title:"Editor",icon:"custom_icons/view-3.svg",action:function(){Wt("editor")}},{title:"Editor with minimap",icon:"custom_icons/view-4.svg",action:function(){Wt("editor-with-map")}},{title:"Dual view",icon:"custom_icons/view-1.svg",action:function(){Wt("both")}},{title:"Render view",icon:"custom_icons/view-2.svg",action:function(){Wt("preview")}}]})),Object(w.c)("div",{className:"toolbar-wrapper"},Object(w.c)(y.a,{class:"editor-main-toolbar",design:"vertical",size:1,buttons:mt})),Object(w.c)("div",{className:"separation-bar"}),Object(w.c)("div",{className:"note-id-wrapper"},Object(w.c)("h4",null,"Note Link"),Object(w.c)("div",{className:"note-id-form"},Object(w.c)("input",{type:"text",ref:yt,onClick:function(t){var e=t.target;e.setSelectionRange(0,e.value.length)},value:Object(M.a)(t.file),readOnly:!0}),Object(w.c)(y.a,{class:"note-id-toolbar",size:1,buttons:[{title:"Copy note ID",icon:"faClipboard",action:function(){var t=yt.current;t&&Object(P.a)(t)}}]}))),Object(w.c)("div",{className:"dates-wrapper"},Object(w.c)("div",{className:"date modified"},Object(w.c)("h4",null,"Modified"),Object(j.a)(new Date(t.file.modified||0))),Object(w.c)("div",{className:"date created"},Object(w.c)("h4",null,"Created"),Object(j.a)(new Date(t.file.created||0)))),Object(w.c)("div",{className:"path-wrapper"},Object(w.c)("div",{className:"path"},Object(w.c)("h4",null,"Path"),Object(w.c)("span",null," ",t.file.path," ")))))))),Object(w.c)(T.a,{progress:bt}),Object(w.c)("div",{className:"main-editor-wrapper ".concat(W?"with-title-editor":"no-title-editor"," ").concat(t.windowId)},!zt&&!Ft&&"codemirror"===t.editorType&&Object(w.c)(A.a,{windowId:t.windowId,ref:nt,file:t.file,pluginsConfig:t.pluginsConfig,value:o,posY:t.posY,jumpToLine:qt||0,forceRender:It,onChange:function(t){$t(),$(t)},onEvent:function(t){},onScroll:function(e){t.onScroll(e),te({x:-9999,y:-9999,from:0,to:0,fromPx:-9999,toPx:-9999})},onTitleClick:t.onTitleClick,onCursorMove:function(t){te(t)}}),!zt&&Ft&&Object(w.c)("div",{className:"codemirror-mobile-fallback"},Object(w.c)("p",null," Note is too long for mobile, the advanced edition features are disabled "),Object(w.c)("textarea",{defaultValue:o,onChange:function(t){$t(),$(t.target.value)}}))),Object(w.c)("div",{className:"mobile-text-manip-toolbar-wrapper",style:{top:ce+se,left:ae}},Object(w.c)(C.a,{cursorInfos:Qt,selection:ee,onButtonClicked:function(e,n){if("aiSearch"===e){if(!n.aiConfig)return;var i=n.aiConfig;Object(N.d)((function(e){var n=e.ai.setStatus("new");Object(K.a)({uuid:n,aiBtnConfig:i,typeAnswer:i.typeAnswer,aiCommand:i.command,selectionTxt:ee,file:t.file,windowIdFile:t.windowId,innerFileContent:o,cursorInfos:Qt})}))}else if("calc"===e)Object(d.f)({windowId:t.windowId,file:t.file,fileContent:o,selectionTxt:ee,insertPos:Qt.to});else if("addTableCol"===e)!function(t){var e=Z(t);if(e){for(var n=e.linesOfTable,o=e.linesInfos,i=e.colIndex,c=0;c<n.length;c++){var a=n[c],r=o.lines[a].split("|");r[i]=1==c?r[i]+" | - ":r[i]+" | ",o.lines[a]=r.join("|")}var l=o.lines.join("\n");Object(N.d)((function(e){e.file.saveContent(t.file.path,l,{history:!0})}))}}({windowId:t.windowId,file:t.file,fileContent:o,selectionTxt:ee,cursorInfos:Qt});else if("removeTableCol"===e)!function(t){var e=Z(t);if(e){for(var n=e.linesOfTable,o=e.linesInfos,i=e.colIndex,c=0;c<n.length;c++){var a=n[c],r=o.lines[a].split("|");r.splice(i,1),o.lines[a]=r.join("|")}var l=o.lines.join("\n");Object(N.d)((function(e){e.file.saveContent(t.file.path,l,{history:!0,withMetas:t.file})}))}}({windowId:t.windowId,file:t.file,fileContent:o,selectionTxt:ee,cursorInfos:Qt});else if("searchEngine"===e){var c=Y.d.curr.ui_editor_search_highlight_url;if(!c)return;var a=c+ee;window.open(a,"_blank")}else if("highlightLine"===e)Object(N.d)((function(e){e.ui.note.editorAction.dispatch({windowId:t.windowId,type:"highlightLine",cursorPos:Qt.from})}));else if("undo"===e)Object(N.d)((function(e){e.ui.note.editorAction.dispatch({windowId:t.windowId,type:"undo"})}));else if("redo"===e)Object(N.d)((function(e){e.ui.note.editorAction.dispatch({windowId:t.windowId,type:"redo"})}));else if("proofread"===e)Object(N.d)((function(e){e.ui.floatingPanel.create({type:"ctag",layout:"bottom",ctagConfig:{tagName:"proofread",content:ee,opts:{file:t.file}}})}));else if("copyLineLink"===e)Object(N.d)((function(e){var n=Object(M.a)(t.file,ee);e.popup.prompt({title:"Selection note link",text:'Link to the selected text <br/><br/> <input type="text" value="'.concat(n,'">')})}));else{var r=it(e);r&&($t(),$(r),Pt())}}})),lt&&rt,Ot&&Object(w.c)(k.a,{file:t.file,onClose:function(){jt(!1)}}))},et=function(t){return"\n\n// @EDGE CASE FIX : when mobile + floating + editor => show preview instead\n.floating-panel-wrapper .dual-view-wrapper.device-mobile.view-editor .editor-area {\n\t\tposition: relative!important;\n\t\ttop: 0px;\n}\n\n.editor-area {\n\t\twidth: ".concat(Object(l.c)("desktop")?"50%":"editor"===t?"100vw":"0vw",";\n\t\tdisplay: block;\n\n\t\tposition: ").concat(Object(l.c)("desktop")||"editor"===t?"relative":"absolute!important",";\n\t\ttop: ").concat("editor"!==t||Object(l.c)("desktop")?"-9999px":"0px",";\n\n\t\t.mobile-text-manip-toolbar {\n\t\t\t\tdisplay: ").concat("editor"!==t||Object(l.c)("desktop")?"none":"flex",";\n\t\t}\n\n\t\t.infos-editor-wrapper {\n\t\t\t\t").concat(Object(l.c)("desktop")?"":"height: ".concat(x.a.sizes.mobile.editorTopWrapper,"px;"),"\n\t\t\t\t").concat(Object(l.c)("desktop")?"width: calc(200% - ".concat(3*x.a.sizes.block*2,"px);"):"","\n\t\t\t\tpadding: 0px ").concat(Object(l.c)("desktop")?3*x.a.sizes.block:2*x.a.sizes.block,"px;\n\t\t\t\tposition: relative;\n\n\t\t\t\t").concat(ot(),"\n\n\t\t\t\t.title-input-wrapper {\n\t\t\t\t\t\tposition:relative;\n\t\t\t\t\t\tmargin-top: ").concat(Object(l.c)("desktop")?6:0,"px;\n\t\t\t\t\t\t.press-to-save {\n\t\t\t\t\t\t\t\tposition: absolute;\n\t\t\t\t\t\t\t\ttop: 39px;\n\t\t\t\t\t\t\t\tfont-size: 8px;\n\t\t\t\t\t\t\t\tcolor: ").concat(x.a.colors.main,";\n\t\t\t\t\t\t\t\tright: 0px;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tinput {\n\t\t\t\t\t\t\t\tpadding: 0px;\n\t\t\t\t\t\t\t\tborder: none;\n\t\t\t\t\t\t\t\tbackground: none;\n\t\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t\n\n\t\t\t\t.toolbar-and-dates-wrapper {\n\t\t\t\t\t\tdisplay: flex;\n\t\t\t\t}\n\n\t\t\t\t.dates-wrapper {\n\t\t\t\t\t\tdisplay: ").concat(Object(l.c)("desktop")?"block":"none",";\n\t\t\t\t\t\t.date {\n\t\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t").concat(E.b,"\n }\n}\n\n\n\n\n.main-editor-wrapper {\n ").concat(Object(l.c)("desktop")?"":"padding: 0px ".concat(2*x.a.sizes.block,"px 0px ").concat(2*x.a.sizes.block,"px;"),"\n ").concat(Object(l.c)("desktop")?"":"margin: 0px 0px ".concat(x.a.sizes.mobile.bottomBarHeight,"px 0px;"),"\n .monaco-editor {\n\t\t\t\tmargin: 0px;\n }\n .textarea-editor {\n\t\t\t\tborder: none;\n\t\t\t\twidth: 100%;\n\t\t\t\theight: calc(100vh - ").concat(x.a.sizes.mobile.editorTopWrapper+x.a.sizes.mobile.editorBar+2*x.a.sizes.mobile.bottomBarHeight,"px);\n\t\t\t\tmargin: 0px;\n\t\t\t\tpadding: 0px;\n\t\t\t\tbackground: rgba(255,255,255,0.7);\n }\n}\n\n\n.editor-area {\n\tposition:initial;\n\t.infos-editor-wrapper {\n\t\t\tz-index: 2;\n\t\t\tposition:absolute;\n\t\t\ttop: 0px;\n\t\t\tright: 7px;\n\t\t\twidth: 100%;\n\t\t\t&.with-title-editor {\n\t\t\t\tborder-bottom: 1px solid rgba(0 0 0 / 5%);\n\t\t\t}\n\t\t\t//box-shadow: 0px 0px 5px rgba(0,0,0,.2);\n\t\t\theight: 32px;\n\t\t\tpadding: 0px;\n\t}\n\t.main-editor-wrapper {\n\t\t\tpadding-left: 0px;\n\t\t\tpadding-right: 10px;\n\t\t\t").concat(Object(l.c)("desktop")?"margin-top: 33px;":"margin-top: 0px;","; \n\t\t\twidth: 100%;\n\t}\n\t.main-editor-wrapper.no-title-editor {\n\t\tmargin-top: 0px;\n\t}\n\t.infos-editor-wrapper {\n\t\t\tpadding-left: 3px;\n\t\t\tpadding-rigth: 10px;\n\t\t\twidth: calc(100% - 10px);\n\t\t\t&.no-title-editor {\n\t\t\t\twidth: 30px;\n\t\t\t}\n\t\t\t.title-input-wrapper {\n\t\t\t\t\tpadding-left: 10px;\n\t\t\t\t\t.press-to-save {\n\t\t\t\t\t\t\ttop: -6px;\n\t\t\t\t\t\t\tleft: 0px;\n\t\t\t\t\t\t\tright: initial;\n\t\t\t\t\t\t\topacity: 0.5;\n\t\t\t\t\t}\n\t\t\t\t\t.big-title {\n\t\t\t\t\t\t\twidth: calc(100% - 65px);\n\t\t\t\t\t\t\tfont-family: ").concat(x.a.font.editor,";\n\t\t\t\t\t\t\tcolor: grey;\n\t\t\t\t\t\t\tfont-size: ").concat(Object($.a)(5),"px;\n\t\t\t\t\t}\n\t\t\t}\n\t\t&.active {\n\t\t\t.title-input-wrapper {\n\t\t\t\t.big-title {\n\t\t\t\t\tcolor: ").concat(x.a.colors.main,";\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\t\n}\n\n")},nt=function(t){var e=Object(a.useContext)(N.a),n=(null===e||void 0===e?void 0:e.status.isConnected)||!1;return Object(a.useMemo)((function(){return Object(w.c)(tt,Object(o.a)({},t,{isConnected:n}))}),[t.noteParentType,t.viewType,t.mobileView,n,t.canEdit,t.editorType,t.windowId,t.file.created,t.file.name,t.file.path,t.file,t.fileContent,t.isActive,t.editorAction])},ot=function(){return"\n\n\n.file-path-wrapper {\n\t\tpadding-top: ".concat(Object(l.c)("desktop")?x.a.sizes.block:x.a.sizes.block/2,"px;\n\t\tfont-size: ").concat(Object($.a)(3),"px;\n\t\tfont-weight: 600;\n\t\tcolor: #b6b5b5;\n\t\tcursor: pointer;\n\t\ttext-transform: capitalize;\n}\n.big-title {\n\t\tcolor: ").concat(x.a.colors.main,";\n\t\tfont-size: ").concat(Object($.a)(5),"px;\n\t\tfont-weight: 600;\n\t\twidth: 100%;\n}\n\n.separation-bar {\n\t\twidth: 86%;\n height: 1px;\n background: #e6e6e6;\n margin: 10px 6%;\n}\n\n.dates-wrapper {\n\t\tposition: relative;\n\t\tmargin: 0px 0px 5px 0px;\n\t\tdisplay: block!important;\n .modified {\n\t\t\t\tcolor: grey;\n\t\t\t\ttext-align: left;\n }\n\t\t.created {\n\t\t\t\t// text-align: right;\n\t\t\t\t// position: absolute;\n\t\t\t\t// top: 0px;\n\t\t\t\t// right: 0px;\n\t\t\t\tmargin-top: 4px;\n\t\t\t\tcolor: ").concat(x.a.colors.editor.interfaceGrey,";\n\t\t}\n}\n\n.path-wrapper {\n\t\tcolor: grey;\n text-align: left;\n\t\tpadding: 0px 0px 5px 0px;\n .path-link {\n\t\t\t\tcolor: ").concat(x.a.colors.main,";\n\t\t\t\tfont-weight: bold;\n\t\t\t\tcursor: pointer;\n }\n}\n\n.note-id-wrapper {\n\t\tcolor: grey;\n text-align: left;\n\t\t.note-id-form {\n\t\t\t\tmargin-bottom: 5px;\n\t\t\t\tdisplay:flex;\n\t\t\t\tinput {\n\t\t\t\t\t\tborder: none;\n\t\t\t\t\t\tpadding: 5px;\n\t\t\t\t\t\tbackground: #ebebeb;\n\t\t\t\t\t\tborder-radius: 3px;\n\t\t\t\t\t\tfont-size: 9px;\n\t\t\t\t\t\tfont-weight: 400;\n\t\t\t\t}\n\t\t}\n}\n.toolbar-and-dates-wrapper {\n\t\th4 {\n\t\t\t\tmargin: 0px;\n\n\t\t}\n}\n")}},165:function(t,e,n){"use strict";n.d(e,"a",(function(){return W})),n.d(e,"b",(function(){return H}));var o=n(11),i=n(23),c=n(3),a=n(0),r=n.n(a),l=n(38),s=n(96),u=function(t){var e=t.headerLog,n={},o=function(t){n[t]&&delete n[t]};return{notify:function(t){for(var i in n){var c=n[i],a=!1;if(i.endsWith("-once")&&(i=i.replace("-once",""),a=!0),i===t.subId)try{c(t.data),a&&o("".concat(i,"-once"))}catch(r){e&&console.log("".concat(e," error with function"),r)}}},subscribe:function(t,cb){n[t]=cb},subscribeOnce:function(t,cb){var e="".concat(t,"-once");n[e]=cb},unsubscribe:o}},d=n(95),p=n(42),f=n(18),b=n(14),g=n(17),h=n(158);const m="[IFRAME PARENT] 00563",v=g.a.client.log.iframe,w=u({headerLog:m}),O=w.notify,j=w.subscribe,x=w.unsubscribe;window.addEventListener("message",(t=>{t.data.subId&&(v&&console.log(m,"parent <== iframe",t.data.data),O(t.data))}));const _={subscribe:j,unsubscribe:x,send:(t,e)=>{t&&t.contentWindow&&(v&&console.log(m,"parent ==> iframe",e),t.contentWindow.postMessage(e,"*"))}},k=t=>{const e="[IFRAME child js]",n={file:null,frameId:"",reloadCounter:0,windowId:"",innerTag:"",tagName:"",tagContent:"",loginToken:t.loginToken,backendUrl:t.backendUrl,ressCacheId:0},o=t=>{if(""===n.frameId)return console.warn(e,"NO FRAME ID, CANNOT SEND TO PARENT");const o={subId:n.frameId,data:t};window.parent.postMessage(o,"*")},i=t=>{const e={error:"CUSTOM TAG/SCRIPT ERROR: ".concat(t)};o({action:"iframeError",data:e})};let c={value:"100%"};const a=t=>{const e=document.getElementById("content-wrapper");let n=t;if(!n){if(!e||0===e.clientHeight)return;n=e.clientHeight+20}c.value="".concat(n);o({action:"resize",data:{height:n}})},r=()=>{const t=document.body;var e=t.requestFullScreen||t.webkitRequestFullScreen||t.mozRequestFullScreen||t.msRequestFullScreen;e&&e.call(t)},l=t.createEventBus({headerLog:"[FRAME API] 00567"}),s=l.subscribeOnce,u=l.notify,d=(t,e,n)=>{fetch(t,{method:"HEAD"}).then((t=>t.ok?e():n())).catch((t=>n(t)))},p=(t,n)=>{let o,i=t.url;i.includes(".js")?(o=document.createElement("script"),o.crossorigin="anonymous",o.rel="preload",o.src=i,t.type&&(o.type=t.type)):i.includes(".css")?(o=document.createElement("link"),o.href=i,o.rel="stylesheet",o.crossorigin="anonymous",o.type="text/css",t.type&&(o.type=t.type)):i.includes(".wasm")&&(o=document.createElement("link"),o.rel="preload",o.href=i,o.as="fetch",o.crossorigin="anonymous",o.type="application/wasm",t.type&&(o.type=t.type)),o.onload=()=>{n()};const c=document.getElementById("external-ressources-wrapper");if(!c)return console.trace(e,"could not load ".concat(i," because ressource wrapper was not detected"));c.appendChild(o)},f=(e,n)=>{const o="?token=".concat(t.loginToken),i=n||t.getRessourceIdFromUrl(e);return"".concat(t.backendUrl,"/static").concat("/.tiro/cache/ctag-ressources/").concat(i).concat(o)},b=(t,cb)=>{cb||(cb=()=>{});let o=0;const i=()=>{if(o++,o===t.length)try{cb&&cb()}catch(n){console.error(e,"ERROR LoadScript Callback : ".concat(n)),console.log(n),console.log("tried to load scripts:",t)}};for(let c=0;c<t.length;c++){let o,a=t[c];o=a.constructor===String?{url:a}:JSON.parse(JSON.stringify(a));const r=o.fileName,l=f(o.url,r),s=JSON.parse(JSON.stringify(o));s.url=l;const u=!0===window.disableCache;if(u){let t=Math.floor(1e6*Math.random());const e="&nocache=".concat(t,"-").concat(n.ressCacheId);s.url+=e}else{const t="&cacheId=".concat(n.ressCacheId);s.url+=t}const b=t=>{t||(t={}),t.frontendCache||(t.frontendCache=!1),g("ressource.download",[o.url,"/.tiro/cache/ctag-ressources/",{fileName:r}],(t=>{p(s,(()=>{i()}))}))};u?(console.log(e,"CACHE DISABLED (both frontend + backend fetch), DOWNLOADING RESSOURCES EVERYTIME and NOT CACHING THEM ON FRONTEND!",o.url),b({frontendCache:!1})):d(s.url,(()=>{p(s,(()=>{i()}))}),(()=>{b({frontendCache:!0})}))}},g=(e,n,cb)=>{if(!n||!e||n.constructor!==Array||"string"!==typeof e)return i("Call Api : ".concat(e," => wrong arguments type / number(").concat(JSON.stringify({apiName:e,apiArguments:n,cb:cb}),")"));const c="iframe-api-call-".concat(t.generateUUID()," ");s(c,(t=>{cb&&cb(t)}));o({action:"apiCall",data:{reqId:c,apiName:e,apiArguments:n}})},h={version:1.2,call:g,utils:{getInfos:()=>n,loadCachedRessources:b,getCachedRessourceUrl:f,getRessourceIdFromUrl:t.getRessourceIdFromUrl,loadScripts:(t,cb)=>{b(t,cb)},loadRessources:(t,cb)=>{b(t,cb)},loadRessourcesOneByOne:(t,cb)=>{cb||(cb=()=>{});let e=0;const n=()=>{if(e===t.length)return cb();const o=t[e];b([o],(()=>{e++,n()}))};n()},loadScriptsNoCache:(t,cb)=>{let n=0;for(let o=0;o<t.length;o++){const i=t[o],c=document.createElement("script");c.src=i,c.onload=()=>{if(n++,n===t.length)try{cb&&cb()}catch(o){console.error(e,"ERROR LoadScript Callback : ".concat(o),i),console.log(o)}};const a=document.getElementById("external-ressources-wrapper");a&&a.appendChild(c)}},resizeIframe:a,fullscreenIframe:r,canScrollIframe:t=>{o({action:"canScrollIframe",data:{status:t}})},loadCustomTag:(t,n,o)=>{const i=h.utils.createDiv(),c=i.div,a=i.updateContent;o||(o={}),o.base_url=t.split("/").slice(0,-1).join("/").replace("//","/"),o.plugins_root_url=o.base_url.split("/").slice(0,-1).join("/").replace("//","/");let r=!0;!1===o.padding&&(r=o.padding);const l=()=>{let t=window.initCustomTag("".concat(n),o);r&&(t='<div class="with-padding" style="padding: 0px 15px; height:100%;">'.concat(t,"</div>")),a(t)};return h.utils.loadScripts([t],(()=>{if(window.initCustomTag)l();else{console.error(e,"CUSTOM TAG ".concat(t," failed to load, disabling cache and trying 3 times..."));let n=0,o=setInterval((()=>{window.disableCache=!0,h.utils.loadScripts([t],(()=>{window.initCustomTag&&(clearInterval(o),l())})),n++,n>3&&(clearInterval(o),console.error(e,"CUSTOM TAG ".concat(t," NOT LOADED AFTER 3 TRIES")))}),3e3)}})),c},uuid:t.generateUUID,createDiv:()=>{const e="ctag-content-wrapper-".concat(t.generateUUID()," "),n=t=>{const o=document.getElementById(e);o?o.innerHTML=t:setTimeout((()=>{n(t)}),100)};return{div:'<div id="'.concat(e,'"></div>'),updateContent:n}}}};var m;return window.api=h,m={init:o=>{n.frameId=o.frameId,n.innerTag=o.innerTag,n.tagContent=o.tagContent,n.tagName=o.tagName,n.file=o.file,n.reloadCounter=o.reloadCounter,n.windowId=o.windowId,n.ressCacheId=o.ressCacheId;const c=document.getElementById("content-wrapper");if(c){const n=t.unescapeHtml(c.innerHTML),o=(r=n,t.replaceCustomMdTags(r,"[[script]]",(t=>{const n="".concat(t);try{return new Function(n)()}catch(o){console.warn(e,"[SCRIPT] error: ".concat(o),n),i("".concat(o,' in Code "').concat(n,'"'))}})));c.innerHTML=o,setTimeout((()=>{a()}),100),t.bindToElClass("title-search-link",(t=>{const e=t.dataset.file,n=t.dataset.folder,o=t.dataset.windowid;h.call("ui.browser.goTo",[n,e,{openIn:o}])}))}var r},askFullscreen:r,apiAnswer:t=>{const e={subId:t.reqId,data:t.data};u(e)}},window.onmessage=t=>{const e=t.data;if(e)for(const n in m)m&&m[n]&&n===e.action&&m[n](t.data.data)},h};var y=n(6),C=n(82),S=n(32),E=n(115),T=n(292),I=n(133),N=n(57);g.a.client.log.verbose;var P=["epub","pdf","iframe","web","smartlist","proofread","datatable","forms","timeline","files"],A=function(t,cb){Object(y.d)((function(e){e.file.getContent("/.tiro/tags/".concat(t,".md"),(function(t){cb(t)}),{onError:function(){P.includes(t)?function(t,cb){var e="https://raw.githubusercontent.com/dotgreg/tiro-notes/dev/plugins/".concat(t,"/").concat(t,".ctag.js"),n="";"epub"===t&&(n='open:true, size: "80%"'),"pdf"===t&&(n="open:true"),"web"===t&&(n='"search_engines": {\n "default":"https://search.bowlman.org/search?q=",\n "g":"https://www.google.com/search?q=",\n "m": "https://www.google.com/maps/search/"\n }');var o='\n [[script]]\n return api.utils.loadCustomTag("'.concat(e,'",`{{innerTag}}`,{').concat(n,"})\n [[script]]\n ");console.log("".concat("[CTAG MANAGER]",' : ctag "').concat(t,'" not present in tiro/tags but part of the base, return base config'),{baseCtagTxt:o}),cb(o)}(t,(function(t){cb(t)})):cb(null)}})}))},R=n(12),F=n(28),L=n(1),D=(g.a.client.log.verbose,{}),M={},z=["latex","l"],B=function(t){var e="tag"===t.block.type&&!z.includes(t.block.tagName||""),n=Object(a.useState)(null),o=Object(c.a)(n,2),r=o[0],l=o[1],u=Object(a.useState)(null),d=Object(c.a)(u,2),p=d[0],f=d[1],b=Object(a.useState)("null"),g=Object(c.a)(b,2),h=g[0],m=g[1];Object(a.useEffect)((function(){var n,cb;e&&(m("loading"),"script"===t.block.tagName?(l("\n[[script]]".concat(t.block.content,"[[script]]")),setTimeout((function(){m("loaded")}),100),t.block.content=""):t.block.tagName&&(n=t.block.tagName,cb=function(t){t?(l(t),setTimeout((function(){m("loaded")}),100)):l(null)},Object(y.d)((function(t){t.plugins.get(n,"tag",(function(t){t&&"tag"===t.type?cb(t.code):("iframe"===n&&(n="web"),A(n,(function(t){cb(t)})))}))}))))}),[t.windowId,t.block.content]);var v="l"===t.block.tagName||"latex"===t.block.tagName;return Object(a.useEffect)((function(){if(!e){var n=s.b.render({raw:t.block.content,file:t.file,windowId:t.windowId});v&&(n="[[l]]".concat(t.block.content,"[[l]]")),f(n)}}),[t.windowId,t.file,t.block]),Object(L.c)("span",{className:"content-block ".concat(e?"block-tag":"block-text"," ")},"loaded"===h&&e&&r&&Object(L.c)(U,Object(i.a)({},t,{noteTagContent:r})),!e&&p&&Object(L.c)("span",{className:"content-block-text",dangerouslySetInnerHTML:{__html:p}}))},W=r.a.memo(B,(function(t,e){var n=!0;return JSON.stringify(t.block)!==JSON.stringify(e.block)&&(n=!1),t.block.content!==e.block.content&&(n=!1),t.file.path!==e.file.path&&(n=!1),t.windowId!==e.windowId&&(n=!1),n})),U=function(t){var e=Object(o.a)({},t).noteTagContent,n=Object(a.useState)(""),i=Object(c.a)(n,2),g=i[0],m=i[1],v=Object(a.useRef)(null),w=Object(a.useState)(""),O=Object(c.a)(w,2),j=O[0],x=O[1],P=Object(a.useState)(!1),A=Object(c.a)(P,2),z=A[0],B=A[1],W=Object(a.useState)(null),U=Object(c.a)(W,2),H=U[0],q=U[1],V=Object(a.useState)(!1),G=Object(c.a)(V,2),J=G[0],K=G[1],Y=function(){var e,n,o=function(e){J&&t.onIframeMouseWheel(e)};return null===(e=v.current)||void 0===e||null===(n=e.contentDocument)||void 0===n||n.addEventListener("mousewheel",o),function(){var t,e;return null===(t=v.current)||void 0===t||null===(e=t.contentDocument)||void 0===e?void 0:e.removeEventListener("mousewheel",o)}};Object(a.useEffect)(Y,[t.yCnt,J]);var $=Object(a.useState)("relativeToParent"),Z=Object(c.a)($,2),X=Z[0],Q=Z[1],tt=Object(a.useRef)("relativeToParent"),et=function(t){tt.current=t,Q(t)},nt=Object(a.useState)(0),ot=Object(c.a)(nt,2),it=ot[0],ct=ot[1],at=Object(a.useState)("100%"),rt=Object(c.a)(at,2),lt=rt[0],st=rt[1],ut=function(e,n){var o=document.querySelector(".window-id-sizeref-".concat(t.windowId));o&&function(t,e){var n=Object(E.a)(e,200);new ResizeObserver((function(){return n()})).observe(t)}(o,(function(){var t=o.getBoundingClientRect();n(t)}))},dt=function(e,n){if("fixed"!==tt.current||"parent"!==n){var o=0,i=document.querySelector(".window-id-sizeref-".concat(t.windowId));if(i){var c=i.classList.contains("view-both"),a=i.getBoundingClientRect();if(Object(T.a)(e)&&e.endsWith("%")){var r=parseInt(e.replace("%",""))/100;o=a.height*r}else Object(T.a)(e)&&e.endsWith("px")?o=parseInt(e.replace("px","")):Object(I.a)(e)?o=e:(o=300,console.warn("".concat("[IFRAME COMPONENT]"," PARENT > resize height not recognized, putting ").concat(o," as default")));t.ctagHeightOffset&&(o+=t.ctagHeightOffset);var l=a.width-10;c&&"desktop"===Object(R.a)()&&(l/=2);var s="".concat(o-=35,"px"),u="".concat(l,"px");ct(s),st(u),B(!0)}}},pt=Object(S.a)((function(n){Y(),x(n),q(null),ut(0,(function(t){dt(t.height,"parent")})),_.subscribe(n,(function(t){if("resize"===t.action){var e=t.data;Object(T.a)(e.height)&&e.height.endsWith("%")?et("relativeToParent"):et("fixed"),dt(e.height,"iframe")}if("canScrollIframe"===t.action){var n=t.data;K(n.status)}if("apiCall"===t.action){var o=t.data;Object(y.b)(o,(function(e,n){if("nok"===e)return q(n.error);var o={reqId:t.data.reqId,data:n};_.send(v.current,{action:"apiAnswer",data:o})}))}if("iframeError"===t.action){var i=t.data.error;q(i),Object(F.d)("".concat(i))}})),setTimeout((function(){var o={file:t.file,innerTag:t.block.content,windowId:t.windowId,frameId:n,reloadCounter:ht,tagContent:e,tagName:t.block.tagName||"",loginToken:Object(f.b)(),backendUrl:Object(b.c)(),ressCacheId:h.b.curr};_.send(v.current,{action:"init",data:o})}),100)}),500),ft=function(){var n=s.b.render({raw:e,windowId:t.windowId,file:t.file}),o='\n<html>\n\t\t<div id="content-wrapper">\n\t\t\t\t'.concat(n,'\n\t\t</div>\n\t\t<div id="external-ressources-wrapper"></div>\n\t\t<script>\n\t\t\t\tconst IMPORTED_backend_url = "').concat(Object(b.c)(),'"\n\t\t\t\tconst IMPORTED_login_token = "').concat(Object(f.b)(),'"\n\t\t\t\tconst IMPORTED_replaceCustomMdTags = ').concat(d.c.toString(),"\n\t\t\t\tconst IMPORTED_unescapeHtml = ").concat(p.h.toString(),"\n\t\t\t\tconst IMPORTED_createEventBus = ").concat(u.toString(),"\n\t\t\t\tconst IMPORTED_generateUUID = ").concat(l.a.toString(),"\n\t\t\t\tconst IMPORTED_getRessourceIdFromUrl = ").concat(l.b.toString(),"\n\t\t\t\tconst IMPORTED_bindToElClass = ").concat(s.a.toString(),"\n\t\t\t\tconst IMPORTED_ressCacheId = ").concat(h.b.curr,"\n\t\t\t\tconst main = ").concat(k.toString(),";\n\t\t\t\tmain({\n\t\t\t\t\tbackendUrl: IMPORTED_backend_url,\n\t\t\t\t\tloginToken: IMPORTED_login_token,\n\t\t\t\t\treplaceCustomMdTags: IMPORTED_replaceCustomMdTags,\n\t\t\t\t\tunescapeHtml: IMPORTED_unescapeHtml,\n\t\t\t\t\tcreateEventBus: IMPORTED_createEventBus,\n\t\t\t\t\tgenerateUUID: IMPORTED_generateUUID,\n\t\t\t\t\tgetRessourceIdFromUrl: IMPORTED_getRessourceIdFromUrl,\n\t\t\t\t\tbindToElClass: IMPORTED_bindToElClass,\n\t\t\t\t\tressCacheIdSync: IMPORTED_ressCacheId\n\t\t\t\t})\n\t\t<\/script>\n<style>\n\t\tbody::backdrop {\n\t\t\tbackground: #F7F7F7;\n\t\t}\n</style>\n</html>\n"),i='\n\t\t\t<html>\n\t\t\t\t<head>\n\t\t\t\t\t<meta name="viewport" content="width=device-width, initial-scale=1.0">\n\t\t\t\t</head>\n\t\t\t\t<body>\n\t\t\t\t\t<div class="simple-css-wrapper">\n\t\t\t\t\t'.concat(o,"\n\t\t\t\t\t</div>\n\t\t\t\t\t<style>\n\t\t\t\t\t").concat(Object(C.c)(),"\n\t\t\t\t\t</style>\n\t\t\t\t</body>\n\t\t\t</html>\n\t\t\t\t");i=Object(N.a)(i,[["{{innerTag}}",t.block.content.trim()]]),m(i)},bt=Object(a.useState)(0),gt=Object(c.a)(bt,2),ht=gt[0],mt=(gt[1],Object(a.useState)(!1)),vt=Object(c.a)(mt,2),wt=vt[0];vt[1];Object(a.useEffect)((function(){B(!1),ft();var t="iframe-".concat(Object(l.a)());return pt(t),function(){_.unsubscribe(t)}}),[t.windowId,t.block.content,t.block.tagName,t.noteTagContent,ht]);var Ot=t.index||0,jt="".concat(t.windowId,"-").concat(Ot,"-").concat(t.block.tagName);Object(a.useEffect)((function(){D[jt]?yt(!0):D={},M[jt]?Tt(!0):D={}}),[]);var xt=Object(a.useState)(!1),_t=Object(c.a)(xt,2),kt=_t[0],yt=_t[1],Ct=Object(a.useState)(!1),St=Object(c.a)(Ct,2),Et=St[0],Tt=St[1],It=function(t){t||(t=!Et),M[jt]=t,Tt(t),yt(!1)};Object(a.useEffect)((function(){t.ctagFullscreen&&It(!0)}),[t.ctagFullscreen]);var Nt=Object(l.a)();return Object(L.c)(r.a.Fragment,null,Et&&Object(L.c)("div",{className:"fullscreen-pin-bg",onClick:function(e){It(!1),t.ctagOnFullscreenClose&&t.ctagOnFullscreenClose()}}),Object(L.c)("div",{className:"iframe-view-wrapper ".concat(z?"can-show":"hide"," iframe-tag-").concat(t.block.tagName," ").concat(kt?"pinned":"not-pinned"," ").concat(Et?"pinned fullscreen":"not-fullscreen"," ").concat(Object(R.e)()?"mobile":"")},!wt&&Object(L.c)("iframe",{onMouseLeave:function(t){!function(t,e){var n=document.getElementById(e);n&&n.focus({preventScroll:!0})}(0,Nt)},ref:v,id:j,"data-testid":"iframe",title:j,srcDoc:g,className:"tag-iframe resize-type-".concat(X),style:{height:it,width:lt},sandbox:t.ctagSandboxed?"allow-scripts allow-same-origin allow-popups":void 0}),H&&Object(L.c)("div",{className:"iframe-error"},Object(L.c)("code",null,Object(L.c)("pre",null,H))),Object(L.c)("input",{className:"refocus-input",id:Nt,type:"text"})))},H=function(){return"\n.refocus-input {\n\tposition: fixed;\n\tz-index: -10000;\n\twidth: 0px;\n\theight: 0px;\n\topacity: 0.00001;\n\ttop: -10000px;\n\tleft: -10000px;\n}\n.content-blocks-wrapper {\n\t\t// padding: 0px 15px;\n}\n.simple-css-wrapper {\n}\n\n.content-blocks-wrapper,\n.simple-css-wrapper,\n.simple-css-wrapper > div,\n.content-block,\n.iframe-view-wrapper\n{\n}\n\n.fullscreen-pin-bg {\n\t\tposition: fixed;\n\t\ttop:0px;\n\t\tright: 0px;\n\t\twidth: 100vw;\n\t\theight: 100vh;\n\t\tbackground: rgba(0,0,0,0.5);\n\t\tz-index:101;\n}\n.iframe-view-wrapper {\n\theight: 100%;\n\t\t&.pinned {\n\t\t\t\tposition: fixed;\n\t\t\t\ttransform: rotate(360deg);\n\t\t\t\ttop: 10px;\n\t\t\t\tright: 10px;\n\t\t\t\tz-index: 1000;\n\t\t\t\toverflow:hidden;\n\t\t\t\tborder: 2px;\n\t\t\t\tbackground: white;\n\t\t\t\tborder-radius: 12px;\n\t\t\t\tbox-shadow: 0px 0px 5px #0006;\n\t\t\t\tiframe {\n\t\t\t\t\t\tmax-height: 90vh;\n\t\t\t\t\t\toverflow-y: scroll;\n\t\t\t\t}\n\t\t}\n\t\t&.pinned.fullscreen.mobile {\n\t\t\theight: calc(100vh - 80px);\n\t\t\tright: 10px;\n\t\t\twidth: calc(100vw - 20px);\n\t\t}\n\t\t&.pinned.fullscreen {\n\t\t\t\ttop: 20px;\n\t\t\t\tright: 20px;\n\t\t\t\tz-index:102;\n\t\t\t\twidth: calc(100vw - 40px);\n\t\t\t\theight: calc(100vh - 40px);\n\t\t\t\tiframe {\n\t\t\t\t\t\theight: calc(100% - 1px)!important;\n\t\t\t\t\t\tmax-height: calc(100% - 1px)!important;\n\t\t\t\t}\n\t\t}\n\t\tposition: relative;\n\t\t.ctag-menu {\n\t\t\t\tposition: absolute;\n\t\t\t\ttop: 3px;\n\t\t\t\tz-index: 10;\n\t\t\t\tleft: 15px;\n\t\t\t\tcursor: pointer;\n\t\t\t\topacity: 0;\n\t\t\t\ttransition: 0.2s all; \n\t\t\t\tdisplay: flex;\n\t\t\t\tpadding: 3px;\n\t\t\t\tpadding-left: 8px;\n\n\t\t\t\tmargin-left: 8px;\n\t\t\t\tmargin-right: 8px;\n\n\t\t\t\t.ctag-ellipsis {\n\t\t\t\t\t\tmargin-right: 15px;\n\t\t\t\t}\n\t\t}\n\t\t.ctag-menu .ctag-menu-button {\n\t\t\t\tdisplay: none;\n\t\t}\n\t\t&:hover {\n\t\t\t\t.ctag-menu {\n\t\t\t\t\t\topacity:0.5;\n\t\t\t\t}\n\t\t\t\t.ctag-menu:hover {\n\t\t\t\t\t\topacity:1;\n\t\t\t\t\t\tbackground: white;\n\t\t\t\t\t\tbox-shadow: 0px 0px 3px rgba(0,0,0,.1);\n\t\t\t\t\t\tborder-radius: 5px;\n\t\t\t\t\t\t.ctag-menu-button {\n\t\t\t\t\t\t\t\tmargin-right: 15px;\n\t\t\t\t\t\t\t\tdisplay: block;\n\t\t\t\t\t\t}\n\t\t\t\t}\n\t\t}\n\n\t\t&.hide iframe {\n\t\t\t\topacity: 0;\n\t\t}\n\t\tiframe::backdrop {\n\t\t\t\tbackground-color: rgba(255,255,255,1);\n\t\t}\n\n\t\tiframe {\n\t\t\t\twidth: calc(100% );\n\t\t\t\tborder: none;\n\t\t\t\tborder-radius: 5px;\n\t\t}\n\t\t.iframe-error {\n\t\t\t\tbackground: #ffddba;\n\t\t\t\tfont-size: 8px;\n\t\t\t\tpadding: 14px;\n\t\t\t\tborder: 2px #ffc080 solid;\n\t\t\t\tborder-radius: 5px;\n\t\t\t\tline-height: 14px;\n\t\t}\n}\n\n.content-block.block-text {\n\t\tpadding-bottom: 0px;\n}\n\n/* .content-block-text > * { */\n/* \t\tpadding: 0px 15px; */\n/* } */\n\n.content-block.block-tag {\n\t\tpadding: 0px 0px 0px 0px;\n position: relative;\n left: -15px;\n top: 0;\n width: calc(100% + 20px);\n height: calc(100% );\n display: block;\n}\n\n"}},17:function(t,e,n){"use strict";n.d(e,"a",(function(){return o}));const o={version:"0.51.90",tokenRefreshInHours:96,path:{staticResources:"static",defaultDataFolder:"markdown-notes",configFolder:".tiro",backendStateFolder:".states",cacheFolder:"cache",historyFolder:".history",archiveFolder:".history_archive",uploadFolder:".resources",relativeUploadFolderName:".resources"},metas:{headerStart:"=== HEADER ===",headerEnd:"=== END HEADER ==="},strings:{folders:"Folders",files:"files",images:"images",trashNote:"Are you sure to trash that note?",clickHereDisconnected:"(click here if persist)",searchingLabel:"searching...",lastNotes:"Last Notes",newNote:"New Note",dateModified:"Modified :",dateCreated:"Created :",searchPlaceholder:"Search Note",hoursAgo:" hours ago",daysAgo:" days ago",minsAgo:" mins ago",months:["January","February","March","April","May","June","July","August","September","October","November","December"],createFolder:"Create folder",createFolderPrompt:"New Folder name to create in",renameFolder:"Rename folder",renameFolderPrompt:"Rename folder to :",deleteFolder:"Delete folder",deleteFolderPrompt:"Are you sure you want to empty the trash (no recovery possible) : ",deleteTabPrompt:"Are you sure you want to delete that tab? : ",moveToTrash:"Move to trash",moveToTrashPrompt:"Are you sure you want move folder in .tiro/.trash : ",loadingFolder:"loading...",moveFolderPrompt:"move folder",setupForm:{title:"Login to Tiro",saveToLs:"Autologin/Save for 30 days on that device",introText:"Welcome to Tiro, please fill these informations to get started",user:"user",password:"password",dataFolder:"folder path",userExplanation:"should have > 3 chars",passwordExplanation:"should have > 3 chars",folderExplanation:"relative from Tiro folder installation (../data for example)",successReload:"Configuration file successfully written, reloading application...",submit:"login",noFolder1:"folder path",noFolder2:"doesn't exists, please create it or choose another folder (no data will be deleted)."},appviews:{image:"Switch to Gallery View",text:"Switch to Files View"},loginForm:{wrongUserPassword:"Wrong login/password",wrongToken:"Authentication expired, please log again"},passwordForm:{explanation:"please enter your password",submit:"submit"},editorBar:{tts:"Text to speech",explanation:{history:"File history"},lightbox:"Show Images"},ttsPopup:{title:"Text to speech",voice:"Voice"},settingsPopup:{title:"Tiro Settings",backend:{title:"Server settings",explanation:"Only fill if server is on another port/protocol than the client (usually in development)",protocol:"Https",protocolExpl:"https or http",port:"Backend Port or URL",portExpl:'Port/Url used by backend (ex: "3023" or "backend.myurl.com" or "backend.url.com:3023")'}},historyPopup:{title:"Versions for ",thead:{date:"date",name:"version"}},rgNotWorking:"ERROR: Tiro requires Ripgrep to be working, it seems that ripgrep (rg command) is either not installed or not functionning correctly on you computer. To install it, follow these instructions : https://github.com/BurntSushi/ripgrep#installation",promptPopup:{defaultTitle:"User Prompt",confirmTitle:"Confirm",accept:"Ok",refuse:"Cancel"},tabs:{newTab:"New Tab"}},server:{log:{socket:!1,verbose:!1,fs:!1,ripgrep:!1}},client:{log:{verbose:!1,socket:!1,upload:!1,iframe:!1,eventManager:!1}},dev:{disableLogin:!1}}},171:function(t,e,n){"use strict";n.d(e,"a",(function(){return o}));var o=function(t){!function(){var t=document.getElementById("icon-page");t&&t.remove()}(),function(t){var e=document.createElement("link");e.rel="icon",e.href=t,e.id="icon-page",document.getElementsByTagName("head")[0].appendChild(e)}(t)}},173:function(t,e,n){"use strict";n.d(e,"a",(function(){return u})),n.d(e,"b",(function(){return p}));var o=n(11),i=n(72),c=n(6),a=n(133),r=n(24),l="tiro-analytics",s=function(cb){Object(c.d)((function(t){t.cache.get(l,(function(t){var e={};t&&(e=t),cb(e)}))}))},u=function(t){var e=Object(i.c)();s((function(n){var i,r=Object(o.a)({},n);r[e[0]]||(r[e[0]]={}),r[e[0]][e[1]]||(r[e[0]][e[1]]={}),r[e[0]][e[1]][e[2]]||(r[e[0]][e[1]][e[2]]={}),Object(a.a)(r[e[0]][e[1]][e[2]][t])?r[e[0]][e[1]][e[2]][t]++:r[e[0]][e[1]][e[2]][t]=1,i=r,Object(c.d)((function(t){t.cache.set(l,i,-1)}))}))},d=function(cb,t){t||(t={});t.start?t.start:Object(i.c)(Object(i.b)("lastMonth")),t.end?t.end:Object(i.c)();s((function(t){cb(t)}))},p=function(t){var e={log:u,report:d,documentation:function(){return Object(r.a)(e,"api.analytics","client/src/hooks/api/analytics.api.hook.tsx")}};return e}},18:function(t,e,n){"use strict";n.d(e,"b",(function(){return m})),n.d(e,"c",(function(){return v})),n.d(e,"a",(function(){return O})),n.d(e,"d",(function(){return j}));var o=n(3),i=n(39),c=n(0),a=n.n(c),r=n(17),l=n(60),s=n(54),u=n(99),d=n(14),p=n(21),f=n(46),b=n(6),g=n(62),h=n(1),m=function(){var t=Object(u.a)("tiro-login-token");return t||""},v=function(){return"?token=".concat(m())},w=function(t){Object(u.b)("tiro-login-token",t,r.a.tokenRefreshInHours)},O=function(){w("")},j=function(t){var e=Object(c.useState)(!1),n=Object(o.a)(e,2),r=n[0],u=n[1],v=Object(c.useState)(""),O=Object(o.a)(v,2),j=O[0],x=O[1],_=Object(c.useState)(""),k=Object(o.a)(_,2),y=k[0],C=k[1],S=Object(c.useState)(),E=Object(o.a)(S,2),T=E[0],I=E[1],N=Object(c.useRef)(0);Object(c.useEffect)((function(){return N.current=d.b.on("getLoginInfos",(function(e){switch(e.code){case"SUCCESS":if(!e.token)return;w(e.token),u(!1),t.onLoginSuccess();break;case"WRONG_TOKEN":u(!0),I(["error",p.a.loginForm.wrongToken]);var n=e.loginInfos;null!==n&&void 0!==n&&n.demo_mode&&(x("viewer"),C(n.viewer_password)),t.onLoginAsked();break;case"WRONG_USER_PASSWORD":I(["error",p.a.loginForm.wrongUserPassword]),u(!0)}})),function(){d.b.off(N.current)}}),[]);var P=Object(g.a)("user-password-cache-ls",{}),A=Object(o.a)(P,2),R=A[0],F=A[1];Object(c.useEffect)((function(){if(r){var t=Object(f.d)().dic,e="__HARDCODED_LOGIN_LS_PASSWORD_0129dsfaf1029__";t.l1&&t.l2&&t.l1.value&&t.l2.value&&Object(b.d)((function(n){var o,c,a=t.l1.value+t.l2.value;if(R[a])o=R[a].usr,c=R[a].pass;else if(o=n.encryption.decryptUrlParam(t.l1.value,e).plaintext,c=n.encryption.decryptUrlParam(t.l2.value,e).plaintext,o&&c){var r=Object(i.a)(R);r[a]={usr:o,pass:c},F(r)}o&&c&&(x(o),C(c),setTimeout((function(){console.log("success login url, submitting it"),d.b.emit("sendLoginInfos",{user:o,password:c,token:m()})}),1e3))}))}}),[r]);var L=function(){I(void 0),d.b.emit("sendLoginInfos",{user:j,password:y,token:m()})},D=Object(c.useState)(1),M=Object(o.a)(D,2),z=M[0],B=M[1],W=Object(g.a)("login-to-ls",!1),U=Object(o.a)(W,2);U[0],U[1];return{displayLoginPopup:r,LoginPopupComponent:function(t){return Object(h.c)(a.a.Fragment,null,r&&Object(h.c)("div",{className:"login-popup-component"},Object(h.c)(s.a,{title:p.a.setupForm.title,onClose:function(){}},Object(h.c)("div",null,Object(h.c)(l.a,{shouldFocus:1===z,value:j,onEnterPressed:function(){B(2)},label:p.a.setupForm.user,onChange:function(t){x(t)}}),Object(h.c)(l.a,{shouldFocus:2===z,value:y,label:p.a.setupForm.password,type:"password",onEnterPressed:function(){L()},onChange:function(t){C(t)}}),Object(h.c)("button",{value:"submit",className:"submit-button",onClick:function(t){L()}},p.a.setupForm.submit),T&&Object(h.c)("div",{className:T[0]},T[1])))))}}}},187:function(t,e,n){"use strict";n.d(e,"b",(function(){return b})),n.d(e,"a",(function(){return g}));var o=n(16),i=n(39),c=n(712),a=n(17),r=n(28),l="tiro-ls-id-",s=function(t,e){var n=JSON.stringify(e);localStorage.setItem(l+t,n)},u="local_node_history",d="[".concat(u.toUpperCase(),"]"),p=a.a.client.log.verbose,f="notes-history-ls",b=function(t){var e=[],n=Object(i.a)(function(t){var e,n=window.localStorage.getItem(l+t);return n&&(e=JSON.parse(n)),e||null}(f));n&&(e=t?n.filter((function(e){return e.path===t})):n);return e},g=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:6,n=arguments.length>2?arguments[2]:void 0;if(!t.content.includes("--disable-history--")){var i=t,c=b(),a=b(i.path);n&&console.log(d,"adding el to ls : ",{itAdd:i}),c=c.filter((function(t){return t.path!==i.path})),a.unshift(i),a.length>e&&(a=a.slice(0,e)),c=[].concat(Object(o.a)(a),Object(o.a)(c));var r=h(c,3);s(f,r)}},h=function t(e,n){var o=e,i=JSON.stringify(o);return m(i)>n&&o.length>1?(o.pop(),p&&console.log(d,"recursivelyReduceArrTillSmallerThan REDUCE ARR > new length=",o.length),t(o,n)):o},m=function(t){return new Blob([t]).size/1048576};Object(r.a)(u,"addLocalNoteHistory",(function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"/woopy/doopy",n={timestamp:Date.now(),path:e,content:"".concat(Object(c.a)(0,1e7)," helllo helllo helllohelllo helllo helllohelllo helllo helllohelllo helllo helllohelllo helllo helllohelllo helllo helllohelllo helllo helllohelllo helllo helllohelllo helllo helllohelllo helllo helllohelllo helllo helllohelllo helllo helllohelllo helllo helllohelllo helllo helllohelllo helllo helllohelllo helllo helllohelllo helllo helllohelllo helllo helllohelllo helllo helllohelllo helllo helllohelllo helllo helllohelllo helllo helllo")};g(n,10,t)})),Object(r.a)(u,"addLocalNoteHistorySeveral",(function(){for(var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:10,e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"/woopy/doopy",o=0;o<t;o++)Object(r.c)(u,"addLocalNoteHistory")(e,n)})),Object(r.a)(u,"getLocalNoteHistory",(function(t){console.log(b(t),"size: ".concat(m(JSON.stringify(b(t))),"MB"))})),Object(r.a)(u,"cleanLocalNoteHistory",(function(){s(f,[]),console.log(b(),"size: ".concat(m(JSON.stringify(b())),"MB"))}))},191:function(t,e,n){"use strict";n.d(e,"a",(function(){return u})),n.d(e,"b",(function(){return d}));var o=n(607),i=n(30),c=(n(0),n(10)),a=n(20),r=n(140),l=n(25),s=n(1),u=function(t){var e="faPaperclip";"image"===t.type&&(e="faImage"),"camera"===t.type&&(e="faCamera"),"microphone"===t.type&&(e="faMicrophone");var n="*";"image"===t.type&&(n="image/*"),"camera"===t.type&&(n="image/*"),"microphone"===t.type&&(n="audio/*");var c=Object(o.a)();return Object(s.c)("div",{className:"upload-button-component"},Object(s.c)("input",{className:"input-file-hidden",id:"file-".concat(c),multiple:!0,name:"file-".concat(c),type:"file",capture:"camera"===t.type||"microphone"===t.type,accept:n,onChange:function(e){var n=e.target.files;0!==n.length&&Object(i.a)(n,(function(e,n){Object(r.b)({fileToUpload:e,folder:t.file.folder,windowId:t.windowId})}))}}),Object(s.c)("label",{htmlFor:"file-".concat(c)},Object(s.c)(a.a,{name:e}),Object(s.c)("span",{className:"label-text"},t.label)))},d=function(){return"\n.upload-button-wrapper {\n\t\twidth: 100%;\n\t\tcursor: pointer;\n\t\t.inside-html-wrapper {\n\t\t\t\twidth: 100%;\n\t\t}\n\t\t&:hover {\n\t\t\t\t.label-text { color :".concat(c.a.colors.main,"; }\n\t\t}\n\t\t.upload-button-component {\n\t\t\t\tcursor: pointer;\n\t\t\t\tdisplay: flex;\n\t\t\t\tposition: relative;\n\t\t\t\twidth: 100%;\n\t\t\t\t.input-file-hidden {\n\t\t\t\t\t\twidth: 0.1px;\n\t\t\t\t\t\theight: 0.1px;\n\t\t\t\t\t\topacity: 0;\n\t\t\t\t\t\toverflow: hidden;\n\t\t\t\t\t\tposition: absolute;\n\t\t\t\t\t\tz-index: -1;\n\t\t\t\t}\n\t\t\t\t.label-text {\n\t\t\t\t\t\tcursor: pointer;\n\t\t\t\t\t\tmargin-left: 18px;\n\t\t\t\t\t\tfont-size:").concat(Object(l.a)(1),"px;\n\t\t\t\t\t\tfont-weight: 400;\n\t\t\t\t}\n\t\t}\n}\n")}},192:function(t,e,n){"use strict";n.d(e,"a",(function(){return o}));var o=function(t,e){var n=e?"|".concat(e):"";return"[link|".concat(t.realname," ").concat(t.folder).concat(n,"]\n")}},193:function(t,e,n){"use strict";n.d(e,"a",(function(){return c}));var o=n(17),i=n(6),c=function(){var t="\n<h3>Description</h3>\n<p>Tiro Notes version ".concat(o.a.version,'</p>\n\n<h3>Shortcuts</h3>\n<h4>Interface</h4>\n <ul>\n <li>Alt + , : Hide/Show Settings</li>\n <li>Alt + / : Open Help</li>\n </ul>\n<h4>Other</h4>\n <ul>\n <li>Alt + s : stop AI generation</li>\n </ul>\n<h4>OmniBar</h4>\n <ul>\n <li>Alt + p : Open Omnibar (or Ctrl + Alt + space)</li>\n <li>Alt + enter : Open Omnibar current selection in new floating window</li>\n </ul>\n<h4>Windows</h4>\n<ul>\n <li>Alt + n : New note</li>\n <li>Alt + v : Toggle view of active window</li>\n <li>Alt + d : Detach active window in floating window</li>\n <li>Ctrl + e : Toggle Encryption</li>\n <li>Ctrl + u : Upload a file</li>\n</ul>\n<h4>Floating Windows</h4>\n<ul>\n <li>Alt + Shift + f : New note in a floating window</li>\n <li>Alt + q : Hide/Show All Floating Windows</li>\n <li>Alt + w : Toggle Floating Windows layouts</li>\n <li>Ctrl + (Shift) + directional arrow : Change active floating window position </li>\n <li>Alt + shift + w : Re-organize Floating windows from current layout</li>\n <li>Alt + Shift + v : Toggle view of active floating window</li>\n <li>Alt + Shift + a : Minimize active floating window</li>\n <li>Alt + Shift + s : Unminimize first floating window in the bar</li>\n <li>Alt + Shift + r : Reload active floating window</li>\n <li>Alt + Shift/Ctrl + c : Close active floating window</li>\n <li>Alt + Ctrl + e : Toggle encryption</li>\n <li>Alt + Ctrl + u : Upload a file</li>\n <li>Alt + o / Alt + Shift + o : Increase/Decrease opacity of active floating window</li>\n</ul>\n\n<h3>Documentation</h3>\n<ul>\n <li><a href="https://tiro-notes.org" target="_blank"> tiro-notes.org </a></li>\n</ul>\n\n<h4> Note config</h4>\n<code><pre>\n- In a note, if you <br>: \n - add the string "--table", it will format markdown tables <br>\n - add the string "--latex", it will format latex equations <br>\n - add the string "--no-date-picker", it will disable the date picker <br>\n - add the string "--spellcheck", it will enable the native browser spellcheck <br>\n</pre></code>\n\n\n<h4> Plugins </h4>\n<p> - Find all available plugins \n<a target="_blank" href="https://github.com/dotgreg/tiro-notes/tree/dev/plugins">here</a></p>\n- Some ctags are already loaded by default, find them \n<a target="_blank" href="https://github.com/dotgreg/tiro-notes/blob/master/client/src/managers/ctag.manager.ts">here > baseCtag</a>\nor by simply typing "[["\n<p> - You can add plugins or create custom ones by creating a /.tiro/plugins/newplugins.md note \nand pasting the content of plugin register, which ends by ".plugin.js" inside it like \n<a target="_blank" href="https://github.com/dotgreg/tiro-notes/blob/dev/plugins/timer/timer.plugin.js">that timer plugin</a> </p>\n\n- there are several kinds of plugins: \n<code><pre>\n- ctag plugin: (custom tag) that can be inserted inside a note like \n - [[epub]]mybook[[epub]] \n - [[pdf]]mypdf[[pdf]] \n - [[feed]] myrss.rss | rssName [[feed]]\n - [[feed-yt]] myYoutubeChannel | youtubeChannel [[feed-yt]]\n - etc... (you can find them all installed by simply typing "[[" )\n- bar plugin: that can be called inside the omnibar (shift+alt+p) > : (for bar plugins menu)\n- background plugin : will run regularly on the client frontend, useful for timer/calendar plugins\n- backend function plugin : can be used with the custom backend api (see below)\n</pre></code>\n\n\n\n<h4>Left bar shortcuts</h4>\n<p> You can add shortcuts links on the left bar by creating a /.tiro/shortcuts.md note and enabling the functionality in the settings </p>\n\n<h4>Snippets</h4>\n<p> You can add editor shortcuts by typing "--". Add shortcuts in /.tiro/snippets.md (create a note if it does not exists) </p>\n\n</p>\n<code>\n\t<pre>\nCONTENT OF /.tiro/snippets.md\n===========\n sym_like_love| \ud83d\udc4d\n sym_book_red| \ud83d\udcd5 \n sym_.vecteur_arrow_right | \u2192\n sym_alpha | \u03b1\n sym_beta | \u03b2\n tdcal0 | - [ ] [ev|TODO|${new Date().toLocaleString("fr").split(" ")[0]} 14:00|]\n daysDiff | ${Math.floor( (new Date() - new Date("11/23/23") ) / (1000 * 60 * 60 * 24)) }\n cop_code_python | ```python \\n \\n \\n ```\n\n\t</pre>\n</code>\n\n<h4>Automatic spreadsheet-like table</h4>\n<p> by creating lines like #mytableid | col1 | col2 | col3 , you will create an automatic table with the specified columns.</p>\n<p> to access to that table, simply click on #mytableid </p>\n<br>\n\n<h4>Forms</h4>\n<p> \nYou can create forms by referencing them in /.tiro/forms.md (create a note if it does not exists), one form for each line<br>\n\n<code><pre>\n- {{_datetime}} and {{_date}} will automatically insert the date <br>\n- the line_format is used to format the line in the note<br>\n- you can insert tags in it like: {{NAME_FIELD|TYPE_FIELD (text, number, select, date) | COMMENT FIELD comment field. optional}}<br>\n- In the comment field,<br>: \n - adding "optional" will make the field optional<br>\n - adding "not_visible" will make the field value not inserted (useful for field used by ai_insert)<br>\n - adding "remember" will keep the last value inputed <br>\n - adding "history" will save answer inputed previously <br>\n - adding "ai_insert: summarize the field [long text]" or "ai_suggest: find from [fullname] the first name" will enable AI suggestions for the field, the [NAME_FIELD] refers to other forms field<br>\n - the AI suggest command for fields should be filled inside the settings <br>\nthe line parameter is where the content should be inserted, if negative it will be inserted counting starting the end of the note<br>\n</pre></code>\n\n</p>\n<code>\n\t<pre>\nCONTENT OF /.tiro/forms.md\n===========\n form | name=simple insert form, path=/noteToInsert.md, line_format= {{_datetime}} | name: {{name}} | age: {{age|number|comment field. optional remember ai_suggest: guess the age from [name]}}, line=2\n form | name=\ud83c\udfac add youtube chanel, path=/_new/_main/\ud83d\udcfaYUTB3.md, line_format= {{chanel_name}} | @{{chanel_name}} | {{tags|select:_\ud83c\udf7f docus,_\ud83d\uddff histoire, _\ud83e\udde0 psy, _\u2728 quali, _\u26f0\ufe0f trip, _\ud83d\uddf3\ufe0f polit, _\ud83d\uddf3\ufe0f polit, _\ud83c\udfdb\ufe0f architect, _\ud83d\udcb2econo, _\ud83d\ude04fun, _\ud83d\udee0\ufe0fdiy}} | {{number_import|number}}, line=3\n\t</pre>\n</code>\nthen simply call [[forms]] [[forms]] on a note to get access to all your forms\n\n<h4>Custom Backend Api</h4>\n<p>\nyou can create a custom backend api with custom endpoints in JSON really easily.<br>\n<br>\n\n- example of endpoint: https://mytiro:3023/custom_backend_api?file=first-endpoint& param1=hello& param2=world& token=custom_backend_api_token <br>\n<br>\n- accepts either "function" (will fetch the result of a backend function plugin) or "file" argument (will fetch file at /.tiro/custom_backend_api/first-endpoint.md in our case here).<br>\n- you can pass url parameters to the endpoint<br>\n- you need to pass the token parameter with the value set in the settings > "Custom backend API Token" <br>\n<br>\n\n<h5> A. Example of an file-based api endpoint</h5>\n- example of endpoint: https://mytiro:3023/custom_backend_api?file=first-endpoint& param1=hello& param2=world& token=custom_backend_api_token <br>\n- it should always ends with a callback function cb()<br>\n- you have access to the whole backendApi by "getBackendApi", find all the functions here\n- you also have access to the plugin backend functions with the api "getBackendApi().plugins.triggerBackendFunction"\n<a about="_blank" href="https://github.com/dotgreg/tiro-notes/blob/dev/server/src/managers/backendApi.manager.ts">here</a> <br/>\n\n<code>\n<pre>\nCONTENT OF /.tiro/custom_backend_api/first-endpoint.md\n========\n\n content = `\n HELLO WORLD\n\n - [ ] dflsakjdflkas\n - [ ] dflsakjdflkas\n - [ ] dflsakjdflkas\n\n ------------------\n METEO\n\n ------------------\n ${getBackendApi().test.fntest()}\n\n `\n\n getBackendApi().file.openFile("/_new/_main/feed podcast.md").then(contentExtract => {\n if (contentExtract === "function" ) {\n // you can also call plugin backend functions like that\n getBackendApi().plugins.triggerBackendFunction("timer_get_daily_stats", {params}).then(timerDaily => {\n cb(content + contentExtract+timerDaily.result.message)\n })\n } else if (contentExtract === "file") {\n // or event access to another endpoint\n getBackendApi().customBackendApi.triggerEndpoint({file:"second-endpoint"}, res => {\n cb(res.result)\n })\n } else if (contentExtract === "url") {\n // fetch an url and cache it for a month\n let n = new Date()\n let idReq = `${n.getYear()}${n.getMonth()}`\n let url = `https://github.com/historicbruno/duckduckgo-html-search?${idReq}`\n getBackendApi().ressource.fetchFile(url, {cache:true , cb})\n }\n })\n\n\n\n\n</pre>\n</code\n\n\n</p>\n\n<h5> B. Example of an function-based api endpoint</h5>\n- example of endpoint: https://mytiro:3023/custom_backend_api?function=timer_get_daily_stats¶m1=hello¶m2=world&token=custom_backend_api_token <br>\n- to register a new plugin backend Function, add the following inside your plugin declaration in /.tiro/plugins/myplugin.md\n\n<code>\n<pre>\nEXTRACT OF CONTENT OF /.tiro/plugins/MYPLUGIN.md\n===========\n...\n{\n name: "timer_backend",\n type: "backend",\n code: `\n getBackendApi().ressource.fetchEval("${baseUrl}timer/timer.backend.js")\n `,\n plugin_infos,\n \n }\n...\n</pre>\n</code>\n\n\nthen that js file should return a callback (cb) function that returns an array of declared backend functions like \n<a about="_blank" href="https://github.com/dotgreg/tiro-notes/blob/dev/plugins/timer/timer.backend.js">that file</a>\n\n<h5> Calling the API from tiro notes </h5>\n- you can call the custom backend api as follow in tiro client (and in custom tags etc.) <br>\n- the "{custom_api_token}" will be replaced with the actual token value (only work for the function api.ressource.fetch)\n<code>\n<pre>\n api.ressource.frontendFetch(\n "/custom_backend_api?file=first-endpoint&token={custom_api_token}", \n res => {\n console.log(JSON.parse(res)["result"])\n }, \n {disableCache:true}\n )\n</pre>\n</code>\n\n<h4> Page Title </h4>\n- you can customize the page title by adding javascript code to the note /.tiro/app-title.md<br>\n- you have access to "isMobile()" function if it is true, you can use it to customize the title for mobile devices\n- you can access here the whole frontend api <br>\n- it should call a callback function "cb" with a string in it <br>\n- The title is refreshed every five minute <br>\n\n<code>\n<pre>\nCONTENT OF /.tiro/app-title.md\n===========\n...\ncb("Tiro Notes")\n...\n</pre>\n</code>\n\n- more complex example using custom backend api :<br>\n\n<code>\n<pre>\nCONTENT OF /.tiro/app-title.md\n===========\n...\nlet simple = 0\nif(isMobile()) simple = 1\nif (simple == 1) {\n cb(`Tiro`)\n} else {\n api.ressource.frontendFetch("custom_backend_api?file=first-endpoint&token={custom_api_token}", res => {\n let finalRes = JSON.parse(res)["result"]["message"]\n cb(`hello world! ${finalRes} ${Math.random()}`)\n })\n )\n} \n...\n</pre>\n</code>\n\n');Object(i.d)((function(e){e.popup.show(t,"Tiro Notes Help",(function(){}),{cssStr:"\nh1 {\n color: #ff0000;\n}\n.popup-wrapper {\n height: 80%;\n}\n.popupContent {\n overflow-y: auto;\n}\n"})}))}},20:function(t,e,n){"use strict";n.d(e,"b",(function(){return r})),n.d(e,"c",(function(){return l})),n.d(e,"a",(function(){return s}));var o=n(0),i=n.n(o),c=n(33),a=n(1),r=function(t){var e=t.name,n=e.endsWith(".svg")||e.endsWith(".png")||e.endsWith(".jpg"),o=t.size?t.size:1;return o-=.2,e.startsWith("fa")&&(e=e.substr(2)),e[0]===e[0].toUpperCase()&&(e=e[0].toLowerCase()+e.substr(1)),e=e.replace(/[A-Z]/g,(function(t){return"-".concat(t.toLowerCase())})),Object(a.c)("span",{style:{transform:"scale(".concat(o,")"),display:"inline-block"}},!n&&Object(a.c)("span",{className:"icon-2-wrapper icon-wrapper",title:t.label,dangerouslySetInnerHTML:{__html:Object(c.d)(e)},style:{color:t.color||"#797979"}}),n&&Object(a.c)("span",{style:{transform:"scale(".concat(t.size,")"),display:"inline-block",width:"20px",height:"20px",background:"url('".concat(t.name,"')"),backgroundSize:"contain",backgroundRepeat:"no-repeat"}}))},l=function(){return"\n\n\n\t.icon-wrapper{\n\t\tcursor: pointer;\n\t\tdisplay: inline-block;\n\t}\n"},s=i.a.memo(r,(function(t,e){return JSON.stringify(t)===JSON.stringify(e)}))},21:function(t,e,n){"use strict";n.d(e,"a",(function(){return o}));var o=n(17).a.strings},22:function(t,e,n){"use strict";n.d(e,"d",(function(){return j})),n.d(e,"b",(function(){return x})),n.d(e,"a",(function(){return C})),n.d(e,"c",(function(){return I}));var o=n(3),i=n(30),c=n(710),a=n(711),r=n(39),l=n(0),s=n(38),u=n(17),d=n(14),p=n(10),f=n(6),b=n(18),g=n(32),h=n(53),m=n(132),v=function(){Object(f.d)((function(t){t.folders.get(["/"],(function(e){var n=e.folders[0].children;n&&n.length<2&&t.userSettings.triggerDemoDownload()}),{depth:-1})}))},w=function(t){t||(t={reload:!0}),Object(m.a)(t.reload)||(t.reload=!0);var e=".tiro/cache/downloads";Object(f.d)((function(n){n.popup.confirm('Do you want to proceed to the installation of demo files, it will replace the ".tiro/plugins" and "_demos" folders by new ones. It will backup in "_backup" any existing data',(function(){n.ressource.download("https://github.com/dotgreg/tiro-notes/raw/refs/heads/dev/demos_folder.zip",e,(function(o){if(n.ui.notification.notifLog("downloading demo files from github...","dl_demo_files"),console.log(o),"SUCCESS"===o.status){var i=o.message.split(e)[1],c="".concat(e).concat(i);n.ui.notification.notifLog("download demo files from github success","dl_demo_files"),console.log(c);var a=e+"/unzip",r=Math.round(1e4*Math.random());n.ressource.unzipFile(c,a,(function(e){var o;n.ui.notification.notifLog("unzip demo files successfully, reloading tiro...","dl_demo_files"),n.folders.move("/.tiro/plugins","/_backup/_backup_".concat(r,"/.tiro/plugins"),(function(t){console.log(t.result)})),n.folders.move("/_demos","/_backup/_backup_".concat(r,"/_demos"),(function(t){console.log(t.result)})),n.file.move("/.tiro/user_functions.md","/_backup/_backup_".concat(r,"/user_functions.md"),(function(t){console.log(t)})),n.file.move("/.tiro/forms.md","/_backup/_backup_".concat(r,"/forms.md"),(function(t){console.log(t)})),n.file.move(a+"/_demo_folder/forms.md","/.tiro/forms.md",(function(t){console.log(t)})),n.file.move(a+"/_demo_folder/user_functions.md","/.tiro/user_functions.md",(function(t){console.log(t)})),n.folders.move(a+"/_demo_folder/plugins","/.tiro/plugins",(function(t){console.log(t.result)})),n.folders.move(a+"/_demo_folder/_demos","/_demos",(function(t){console.log(t.result)})),n.ui.browser.folders.open.add("/"),(null===(o=t)||void 0===o?void 0:o.reload)&&setTimeout((function(){n.ui.browser.folders.open.add("/"),setTimeout((function(){window.location.reload()}),2e3)}),2e3)}),{overwriteWarn:!1})}}))}))}))},O=n(24),j={curr:{}},x=function(){return j.curr},_=function(t){var e={};return new URLSearchParams(t).forEach((function(t,n){e[n]=t})),e}(window.location.search),k={};for(var y in _)k[y]=_[y];var C={ui_sidebar:!0,ui_filesList_sortMode:2,ui_layout_colors_main:"#E86666",ui_layout_colors_main_font:"#FFFFFF",ui_editor_markdown_preview:!0,ui_editor_markdown_latex_preview:!0,ui_editor_markdown_enhanced_preview:!0,ui_editor_markdown_syntax:!1,ui_editor_inline_suggestion:!0,ui_editor_markdown_table_preview:!0,ui_editor_spellcheck:!0,ui_editor_live_watch:!0,ui_editor_synced_title_scrolling:!0,ui_editor_links_as_button:!0,ui_editor_search_highlight_url:"https://duckduckgo.com/?q=",ui_editor_search_highlight_enable:!0,ui_editor_markdown_tags:!0,ui_editor_links_preview_zoom:.8,ui_editor_show_image_title:!1,export_pandoc_cli_options:"\ndocx | --wrap=preserve --toc --number-sections \n revealjs | -V theme=moon \n beamer | --wrap=preserve --include-in-header=./include-tex.md ",advanced_image_compression_settings:JSON.stringify({quality:80,maxWidth:1500}),ui_editor_ai_text_selection:!0,ui_editor_ai_command:"AI assistant | wand-magic-sparkles | new | export OPENAI_API_KEY='YOUR_OPENAI_API_KEY'; npx chatgpt \" {{input}}\" --continue --model gpt-4 ",ui_editor_ai_suggest_form_command:"",ui_layout_floating_window_padding:0,tts_custom_engine_command:'curl -sS --request POST --header "Authorization: Bearer REPLACE_ME_BY_REPLICATE_OWN_API_TOKEN" --header "Content-Type: application/json" --header "Prefer: wait" --data \'{"version": "f559560eb822dc509045f3921a1921234918b91739db4bf3daab2169b71c7a13","input": {"text": "{{input}}", "speed": 1,"voice": "ff_siwis"}}\' https://api.replicate.com/v1/predictions',tts_sentences_per_part:1,tts_max_words_per_sentence:75,tts_formId:"",tts_form_extract_length:10,tts_preload_parts:1,tts_price_per_word:5e-6,server_activity_logging_enable:!1,view_disable_notification_popups:!1,privacy_work_mode_enable:!1,privacy_work_mode_filters:"work,meeting",beta_floating_windows:!0,beta_plugins_marketplace:!1,plugins_marketplace_url:"https://raw.githubusercontent.com/dotgreg/tiro-notes/master/docs/marketplace.json",ui_layout_general_font_size:10,ui_layout_background_image_enable:!1,ui_layout_background_video_enable:!1,ui_layout_background_image_window_opacity:70,ui_layout_background_image_window_opacity_active:90,ui_layout_background_video_width:100,ui_layout_background_video_height:100,ui_layout_font_family_interface:"Helvetica neue, Open sans, arial, sans-serif",ui_layout_font_family_editor:"Helvetica neue, Open sans, arial, sans-serif"},S=C,E="[USER SETTINGS] :",T=u.a.client.log.verbose,I=function(t){var e=Object(h.a)("user-settings",{},{history:!0}),n=Object(o.a)(e,3),u=n[0],m=n[1],x=n[2],_=Object(l.useState)(0),k=Object(o.a)(_,2),y=k[0],I=k[1],N=Object(l.useRef)([]),P=function(t,e,n){N.current[t]||(N.current[t]=e[n]);var o=u[t];Object(c.a)(o)||Object(a.a)(o)||(""===o&&N.current[t]&&(o=N.current[t]),e[n]=o)};Object(l.useEffect)((function(){A(),j.curr=u,Object(i.a)(S,(function(t,e){Object(a.a)(u[e])&&(u[e]=t)}))}),[u]);var A=Object(g.a)((function(){T&&console.log(E,"UPDATE!",u,y),P("ui_layout_colors_main",p.a.colors,"main"),P("ui_layout_colors_main_font",p.a.colors,"mainFont"),P("ui_layout_font_family_editor",p.a.font,"editor"),P("ui_layout_font_family_interface",p.a.font,"main"),I(y+1)}),1e3),R=function(e,n,cb,o){var i="updateSetupJson-".concat(Object(s.a)());t.eventBus.subscribe(i,(function(t){cb&&cb(t)})),d.b.emit("updateSetupJson",{paramName:e,paramValue:n,opts:o,token:Object(b.b)(),idReq:i})};Object(l.useEffect)((function(){d.b.on("onServerTaskFinished",(function(e){t.eventBus.notify(e.idReq,{data:e})}))}),[]);var F={refreshUserSettingsFromBackend:x,updateSetupJson:R,ifNoFolders_triggerDemoDownload:v,triggerDemoDownload:w,set:function(t,e,n){n||(n={}),n.writeInSetupJson||(n.writeInSetupJson=!1),n.writeInSetupJson&&R(t,"".concat(e)),T&&console.log(E,"updateUserSettings ".concat(t," to ").concat(e));var o=Object(r.a)(u);o[t]=e,m(o)},get:function(t,cb){var e=S[t],n=e;return t in u&&(n=u[t]),""===n&&(n=e),cb&&cb({currentValue:n,defaultValue:e}),n},list:function(){return function(t){var e=[];return Object(i.a)(t,(function(t,n){var o=n;e.push({key:o,val:t})})),Object(i.a)(C,(function(t,n){var o=n;e.find((function(t){return t.key===o}))||e.push({key:o,val:t})})),e}(u)},refresh:{css:{get:y}},triggerSetupPopup:function(){Object(f.d)((function(e){e.config.get((function(e){var n=e.dataFolder||"";console.log("dataFolder:",n),t.triggerSetupPopup&&t.triggerSetupPopup({dataFolder:n})}))}))},documentation:function(){return Object(O.a)(F,"api.userSettings","client/src/hooks/useUserSettings.hook.tsx")}};return{userSettingsApi:F}}},220:function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));var o=n(30),i=n(31),c=n(42),a=n(46),r=function(t,e){var n=t.match(i.a.image),r=[];return Object(o.a)(n,(function(t){var n=t.match(i.a.firstPartImg),o=n&&n[0]?n[0].replace("![","").replace("]","").replace("(",""):"",l=t.replace(i.a.firstPartImg,"").replace(")",""),s={url:Object(a.b)(Object(c.a)(e.folder)+"/"+l),title:o,file:e};r.push(s)})),r}},223:function(t,e,n){"use strict";n.d(e,"a",(function(){return l}));var o=n(378),i=n(4),c=n(10),a=n(127),r=n(22),l=function(){return Object(o.a)({theme:"light",settings:{background:"#ffffff",foreground:"#4D4D4C",caret:"#AEAFAD",selection:"#D6D6D6",selectionMatch:"#D6D6D6",gutterBackground:"#FFFFFF",gutterForeground:"#4D4D4C",gutterBorder:"#ddd",lineHighlight:"#fff"},styles:[{tag:i.e.comment,color:"#787b80"},{tag:i.e.definition(i.e.typeName),color:"#194a7b"},{tag:i.e.typeName,color:"#194a7b"},{tag:i.e.tagName,color:"#008a02"},{tag:i.e.variableName,color:"#1a00db"},{tag:i.e.heading,color:c.a.colors.main},{tag:u.Image,color:"red",class:"tiro-image"},{tag:a.b.LatexMdEl,class:"cm-mdpreview-latex-code mdpreview-source"},{tag:i.e.heading1,class:"actionable-title h1"},{tag:i.e.heading2,class:"actionable-title h2"},{tag:i.e.heading3,class:"actionable-title h3"},{tag:i.e.monospace,class:"code-wrapper"},{tag:i.e.content,fontSize:"".concat(r.d.curr.ui_layout_general_font_size,"px")}]})},s={ImageTwo:i.a.define()},u=(Object(i.c)({ImageTwo:s.ImageTwo,"Strikethrough/...":s.ImageTwo}),{ListItem:i.a.define(),headingMark:i.a.define(),LinkReference:i.a.define(),Image:i.a.define(),LinkTitle:i.a.define(),LinkLabel:i.a.define(),Link:i.a.define(),LinkMark:i.a.define(),BulletList:i.a.define()});Object(i.c)({LinkReference:u.LinkReference,ListItem:u.ListItem,Link:u.Link,Image:u.Image,LinkTitle:u.LinkTitle,LinkLabel:u.LinkLabel,LinkMark:u.LinkMark,BulletList:u.BulletList})},224:function(t,e,n){"use strict";n.d(e,"a",(function(){return u})),n.d(e,"b",(function(){return d}));var o=n(3),i=n(0),c=n(54),a=n(21),r=n(10),l=n(60),s=n(1),u=function(t){var e=Object(i.useState)(""),n=Object(o.a)(e,2),r=n[0],u=n[1],d=function(){t.onSubmit(r)};return Object(s.c)("div",{className:"password-popup-wrapper"},Object(s.c)(c.a,{title:a.a.passwordForm.explanation,onClose:function(){t.onClose()}},Object(s.c)("div",null,Object(s.c)(l.a,{value:r,label:a.a.setupForm.password,type:"password",shouldFocus:!0,onChange:function(t){u(t)},onEnterPressed:function(){d()}}),Object(s.c)("button",{className:"submit-button",onClick:function(t){d()}},a.a.passwordForm.submit))))},d=function(){return"\n .submit-button {\n margin-top: 10px;\n ".concat(r.a.els().redButton,";\n\t\tbackground: ").concat(r.a.colors.main,"!important;\n padding: 10px 20px;\n }\n ")}},225:function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var o=n(380),i=function(t){return t||(t=0),Object(o.isNumber)(t)?t+1:0}},228:function(t,e,n){"use strict";n.d(e,"b",(function(){return a})),n.d(e,"a",(function(){return r}));var o=n(3),i=n(115),c=n(0),a=function(){var t=Object(c.useState)(!1),e=Object(o.a)(t,2),n=e[0],a=e[1],r=Object(c.useRef)(0);return Object(c.useEffect)((function(){var t=Object(i.a)((function(){r.current=r.current+1,a(!0),setTimeout((function(){a(!1)}),200)}),200);return function(){window.removeEventListener("resize",(function(){t()}))}}),[]),{resizeState:n,resizeCount:r}},r=function(t){var e=Object(c.useState)(!1),n=Object(o.a)(e,2),a=n[0],r=n[1];return Object(c.useEffect)((function(){var e,n=Object(i.a)((function(){r(!0),setTimeout((function(){r(!1)}),200)}),200),o=0,c=setInterval((function(){var i=document.querySelector(t);i&&(!function(t){(e=new ResizeObserver((function(t){n()}))).observe(t)}(i),clearInterval(c)),(o+=1)>5&&clearInterval(c)}),200);return function(){e&&e.disconnect()}}),[]),{resizeState:a}}},229:function(t,e,n){"use strict";n.d(e,"b",(function(){return o})),n.d(e,"a",(function(){return i}));var o=function(t,e){c(t,(function(t){t&&e(t)}))},i=function(t){var e=t.value;navigator&&navigator.clipboard&&navigator.clipboard.writeText(e).then((function(){console.log("Text copied to clipboard...")})).catch((function(t){console.log("Something went wrong",t)}))},c=function(t,e){0==t.clipboardData&&"function"==typeof e&&e(void 0);var n=t.clipboardData.items;void 0==n&&"function"==typeof e&&e(void 0);for(var o=!1,i=0;i<n.length;i++){var c=n[i];if(-1===c.type.indexOf("text/html")&&-1===c.type.indexOf("text/plain")||(console.log("[PASTE] text/html or text/plain content found, disabling image upload",c.type),o=!0),!o&&-1!=n[i].type.indexOf("image")){console.log("[PASTE] informations on files pasted : ",t,n,n.length);var a=n[i].getAsFile();"function"==typeof e&&e(a)}}}},230:function(t,e,n){"use strict";n.d(e,"b",(function(){return m})),n.d(e,"a",(function(){return v}));var o=n(23),i=n(3),c=n(0),a=n(82),r=n(164),l=n(68),s=n(12),u=n(231),d=n(6),p=n(32),f=n(10),b=n(76),g=n(1),h=function(t){var e=Object(c.useState)(""),n=Object(i.a)(e,2),o=n[0],d=n[1],f=Object(c.useState)(0),h=Object(i.a)(f,2),m=(h[0],h[1]),v=Object(c.useRef)(0),w=function(t){t>v.current&&(v.current=t),m(v.current)};Object(c.useEffect)((function(){m(0)}),[t.fileContent,t.windowId]);Object(p.a)((function(t){d(t)}),Object(s.e)()?3e3:1e3),Object(p.b)((function(t){d(t)}),1e3);var O=function(t){d(t)};Object(c.useEffect)((function(){O(t.fileContent)}),[t.fileContent,t.file.path,t.windowId]),Object(c.useEffect)((function(){setTimeout((function(){l.a.onWindowLoad(t.windowId)}),500)}),[t.file.path,t.windowId]),Object(c.useEffect)((function(){Object(b.d)(!0)}),[t.file.path,t.windowId]);var j="desktop"===Object(s.a)()&&"editor"===t.viewType||"desktop"!==Object(s.a)()&&"editor"===t.mobileView,x=Object(c.useState)(!1),_=Object(i.a)(x,2),k=_[0],y=_[1];return Object(c.useEffect)((function(){y(!t.canEdit)}),[t.canEdit]),Object(g.c)("div",{className:"dual-view-wrapper view-".concat(t.viewType," device-").concat(Object(s.a)()," window-id-").concat(t.windowId," window-id-sizeref-").concat(t.windowId),onWheel:function(t){}},t.isDragging&&Object(g.c)("div",{className:"loading-overlay"},Object(g.c)("div",{className:"loading-text"}," drop to upload")),Object(g.c)(r.a,{noteParentType:t.noteParentType,viewType:t.viewType,mobileView:t.mobileView,windowId:t.windowId,editorType:"codemirror",showViewToggler:t.showViewToggler,showToolbar:t.showToolbar,titleEditor:t.titleEditor,onTitleEditedHook:function(){y(!0)},file:t.file,canEdit:t.canEdit,fileContent:t.fileContent,isActive:t.isActive,onReloadContent:t.onReloadContent,editorAction:t.editorAction,posY:0,onTitleClick:function(t){},onScroll:function(t){},onUpdateY:function(t){},onMaxYUpdate:w,onFileEdited:function(e,n){t.onFileEdited(e,n),O(n)},onScrollModeChange:function(t){},onLayoutUpdate:t.onLayoutUpdate,pluginsConfig:t.pluginsConfig}),k&&Object(g.c)("div",{className:"loading-overlay"},Object(g.c)("div",{className:"loading-text"},"loading...")),!j&&Object(g.c)(a.a,{noteParentType:t.noteParentType,windowId:t.windowId,file:t.file,posY:0,fileContent:o,onMaxYUpdate:w,yCnt:0,onIframeMouseWheel:function(t){}}),Object(g.c)(u.a,{windowId:t.windowId}))},m=function(t,e){return"\n.omnibar-popup-wrapper {\n\t.dual-view-wrapper {\n\t\t.loading-overlay {\n\t\t\ttop: -2px;\n\t\t}\n\t}\n}\n\n\n\n\n\t.dual-view-wrapper {\n\t\tposition: relative;\n\t\t.loading-overlay {\n\t\t\t.loading-text {\n\t\t\t\tcolor: ".concat(f.a.colors.main,";\n\t\t\t}\n\n\t\t\tdisplay: flex;\n\t\t\talign-content: center;\n\t\t\tjustify-content: center;\n\t\t\talign-items: center;\n\t\t\twidth: 100%;\n\t\t\theight: calc(120% - 32px);\n\t\t\tposition: absolute;\n\t\t\tbackground: rgba(0,0,0,0.1);\n\t\t\ttop: ").concat("desktop"===Object(s.a)()?"32px":"0px",";\n\t\t\tleft: 0px;\n\t\t\tfont-weight: bold;\n\t\t\tcolor: white;\n\t\t\tz-index: 2;\n\t\t}\n\t}\n\n .view-preview.device-mobile,\n\t.mobile-view-preview {\n\t\t.editor-area {\n\t\t\tdisplay: none;\n\t\t}\n\t\t.floating-panel-wrapper {\t\n\t\t\t.editor-area {\n\t\t\t\tdisplay: block;\n\t\t\t}\n\t\t}\n\t}\n\t\n\t.dual-view-wrapper.device-tablet, \n\t.dual-view-wrapper.device-mobile {\n\t\t\t// .editor-area,\n\t\t\t.preview-area-wrapper {\n\t\t\t\t\twidth: 100%;\n\t\t\t}\n\t}\n\t.dual-view-wrapper {\n\t\t\t&.view-both.device-desktop {\n\t\t\t\t\t.preview-area-wrapper {\n\t\t\t\t\t\t\twidth: 50%;\n\t\t\t\t\t}\n\t\t\t}\n\n\n\n\t\t\t.__EDITOR_DESIGN HERE__ {}\n\t\t\t&.view-editor.device-desktop {\n\t\t\t\t\t.editor-area {\n\t\t\t\t\t\t\twidth: 100%;\n\t\t\t\t\t}\n\n\t\t\t\t\t.preview-area-wrapper {\n\t\t\t\t\t\t\t/* display:none; */\n\t\t\t\t\t\t\tposition: absolute;\n\t\t\t\t\t\t\twidth: 10px;\n\t\t\t\t\t\t\tleft: -9999px;\n\t\t\t\t\t\t\ttop: -9999px;\n\n\t\t\t\t\t}\n\t\t\t}\n\n\t\t\t&.view-editor-with-map.device-desktop {\n\t\t\t\t\t.editor-area {\n\t\t\t\t\t\t\twidth: 80%;\n\t\t\t\t\t}\n\n\t\t\t\t\t.__MINIMAP_DESIGN HERE__ {}\n\n\t\t\t\t\t.preview-area-wrapper:hover {\n\t\t\t\t\t\t\theight: calc(100% - 30px);\n\t\t\t\t\t\t\ttransform: scale(1);\n\t\t\t\t\t\t\tright: -50%;\n\t\t\t\t\t\t\topacity: 1;\n\t\t\t\t\t\t\tbox-shadow: -4px 5px 10px rgba(0, 0, 0, 0.10);\n\t\t\t\t\t\t\t.preview-area-transitions {\n\t\t\t\t\t\t\t\t\twidth: 50%;\n\t\t\t\t\t\t\t\t\tpadding: 0px;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t.preview-area-wrapper {\n\t\t\t\t\t\t\ttransition-delay: ").concat(f.a.anim.time,";\n\t\t\t\t\t\t\t/* transition-delay: 0ms; */\n\t\t\t\t\t\t\t/* transition-property: bottom; */\n\t\t\t\t\t\t\tword-break: break-word;\n\t\t\t\t\t\t\ttransform: scale(0.2) translateZ(0);\n\t\t\t\t\t\t\ttransform-origin: 0px 0px;\n\t\t\t\t\t\t\tposition: absolute;\n\t\t\t\t\t\t\twidth: 100%;\n\t\t\t\t\t\t\tright: calc(-80%);\n\t\t\t\t\t\t\t// height: 500vh;\n\t\t\t\t\t\t\theight: calc(100% * 5);\n\t\t\t\t\t\t\t.preview-area-transitions {\n\n\t\t\t\t\t\t\t\t\t/* transition-delay: 0ms; */\n\t\t\t\t\t\t\t\t\t/* transition-property: bottom; */\n\n\t\t\t\t\t\t\t\t\t/* transition-delay:").concat(f.a.anim.time,"; */\n\t\t\t\t\t\t\t\t\t/* transition-property: padding; */\n\n\t\t\t\t\t\t\t\t\ttransition-delay:").concat(f.a.anim.time,"; \n\t\t\t\t\t\t\t\t\t/* transition-property: all; */\n\n\t\t\t\t\t\t\t\t\t/* transition-delay: 0ms; */\n\t\t\t\t\t\t\t\t\t/* transition-property: bottom; */\n\n\t\t\t\t\t\t\t\t\twidth: 73%;\n\t\t\t\t\t\t\t\t\tpadding: 80px;\n\t\t\t\t\t\t\t\t\tpadding-right: 140px;\n\t\t\t\t\t\t\t\t\tpadding-left: 40px;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t}\n\n\t\t\t&.view-preview.device-desktop {\n\t\t\t\t\t.editor-area {\n\t\t\t\t\t\t\twidth: 0%;\n\t\t\t\t\t\t\t.main-editor-wrapper {\n\t\t\t\t\t\t\t\t\tposition: absolute;\n\t\t\t\t\t\t\t\t\tleft: -9999px;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t.preview-area-wrapper {\n\t\t\t\t\t\t\twidth: 100%;\n\t\t\t\t\t\t\t.preview-area {\n\t\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t}\n\n\t\t\tposition:relative;\n\t\t\tdisplay: ").concat("desktop"===Object(s.a)()?"flex":"block",";\n\t}\n\t\n")},v=function(t){var e=Object(c.useContext)(d.a),n=(null===e||void 0===e?void 0:e.ui.note.editorAction.get)||null;return Object(g.c)(h,Object(o.a)({},t,{editorAction:n}))}},231:function(t,e,n){"use strict";n.d(e,"a",(function(){return u})),n.d(e,"b",(function(){return d}));var o=n(5),i=n(3),c=n(0),a=n(137),r=n.n(a),l=n(68),s=n(1),u=function(t){var e=Object(c.useState)(0),n=Object(i.a)(e,2),a=n[0],u=n[1],d=Object(c.useRef)(null),p=Object(c.useRef)(null),f=function(){var t={maxY:0,y:0,percent:0},e=p.current?p.current:null,n=d.current?d.current:null;if(!n||!e)return t;var o=n.getBoundingClientRect().height,i=e.getBoundingClientRect().y;return t.maxY=e.getBoundingClientRect().height-o,t.y=n.getBoundingClientRect().y-i,t.percent=t.y/t.maxY*100,t};Object(c.useEffect)((function(){var e=p.current?p.current:null;if(e){var n=new MutationObserver((function(e,n){var i,c=Object(o.a)(e);try{for(c.s();!(i=c.n()).done;){if("data-scroll-refresh"===i.value.attributeName){var a=l.a.getScrollObj(t.windowId),r=a.dims.scroller.viewport;r<20&&(r=20),m(r);var s=(a.dims.scroller.full-a.dims.scroller.viewport)/100,d=a.posPercent*s;u(d)}}}catch(p){c.e(p)}finally{c.f()}}));return n.observe(e,{attributes:!0}),function(){n.disconnect()}}}),[t.windowId]);var b=Object(c.useState)(0),g=Object(i.a)(b,2),h=g[0],m=g[1];return Object(s.c)("div",{className:"scrolling-bar-wrapper",ref:p},Object(s.c)(r.a,{onDrag:function(e){l.a.onScrollerScroll(t.windowId,f().percent)},onStop:function(){u(f().y)},position:{x:0,y:a},axis:"y",bounds:"parent"},Object(s.c)("div",{ref:d,style:{height:"".concat(h,"px")},className:"scrolling-bar"})))},d=function(){return"\n.view-editor .scrolling-bar-wrapper {\n}\n\n.scrolling-bar-wrapper {\n\t\toverflow: hidden;\n\t\tposition: absolute;\n\t\ttop: 33px;\n\t\theight: calc(100% - 53px);\n\t\tbackground: rgb(226,226,226);\n\t\twidth: 10px;\n\t\tright: 0px;\n\t\tposition: absolute;\n\n\t\t.scrolling-bar {\n\t\t\t\tcursor: ns-resize;\n\t\t\t\tbackground: #cdcccc;\n\t\t\t\theight: 20px;\n\n\t\t}\n}\n"}},232:function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));var o=n(29),i=n(17),c=n(18),a=n(14),r=function(t){return Object(o.b)("".concat(Object(a.c)(),"/").concat(i.a.path.staticResources,"/").concat(t,"?token=").concat(Object(c.b)()))}},233:function(t,e,n){"use strict";n.d(e,"a",(function(){return a})),n.d(e,"b",(function(){return r}));n(0);var o=n(10),i=n(20),c=n(1),a=function(t){var e=t.dir?t.dir:"left",n=t.maxHeight?t.maxHeight:50;return Object(c.c)("div",{className:"dropdown-wrapper ".concat(e," ").concat(t.hover?"hover-active":""," ").concat(t.forceShow?"force-show":"")},Object(c.c)("span",{onMouseEnter:function(){t.onMouseEnter&&t.onMouseEnter()},onMouseLeave:function(){t.onMouseLeave&&t.onMouseLeave()},onClick:function(){},className:"context-menu-wrapper"},Object(c.c)("div",{className:"dropdown-icon"},Object(c.c)(i.a,{name:"faEllipsisH"})),Object(c.c)("div",{className:"context-menu",style:{maxHeight:n}},t.children)))},r=function(){return"\n.dropdown-wrapper {\n\t\t\n\t\tposition: relative;\n\t\t&.hover-active:hover {\n\t\t\t\t.context-menu {\n\t\t\t\t\t\topacity: 1;\n\t\t\t\t\t\tpointer-events: all;\n\t\t\t\t}\n\t\t\t\t.dropdown-icon {\n\t\t\t\t\t\tsvg {\n\t\t\t\t\t\t\t\tcolor: ".concat(o.a.colors.main,";\n\t\t\t\t\t\t}\n\t\t\t\t}\n\t\t}\n\n\t\t.dropdown-icon {\n\t\t\t\tposition: absolute;\n\t\t\t\tpadding: 10px;\n\t\t\t\ttop: -10px;\n\t\t\t\tsvg {\n\t\t\t\t\t\tcolor: #d4d1d1;\n\t\t\t\t}\n\t\t}\n\n\t\t&.force-show {\n\t\t\t.context-menu {\n\t\t\t\topacity: 1;\n\t\t\t\tpointer-events: all;\n\t\t\t}\n\t\t}\n\t\t.context-menu {\n\t\t\t\toverflow-y: scroll;\n\t\t\t\tz-index: 1000;\n\t\t\t\tright: 10px;\n\t\t\t\ttop: 20px;\n\t\t\t\tpointer-events: none;\n\n\n\t\t\t\ttransition: 0.2s all;\n\t\t\t\ttransition-delay: 0.2s, 0s;\n\t\t\t\tposition: absolute;\n\t\t\t\topacity: 0;\n\n\t\t\t\tmin-width: 140px;\n\t\t\t\tpadding: 10px;\n\t\t\t\tborder-radius: 5px;\n\t\t\t\tbackground: white;\n\t\t\t\tbox-shadow: 0px 0px 5px rgba(0,0,0,.2);\n\t\t\t\toverflow: auto;\n\t\t}\t\n\n\t\t&.right {\n\t\t\t\t.dropdown-icon {\n\t\t\t\t\t\tright: 0px;\n\t\t\t\t}\n\t\t}\n}\n")}},234:function(t,e,n){"use strict";n.d(e,"a",(function(){return a})),n.d(e,"b",(function(){return r}));var o=n(0),i=n.n(o),c=n(1),a=function(t){var e=t.progress,n=e>=0&&e<100;return Object(c.c)(i.a.Fragment,null,n&&Object(c.c)("div",{className:"upload-progress-bar-wrapper"},Object(c.c)("div",{className:"bg-fill",style:{width:"".concat(e,"%")}}),Object(c.c)("div",{className:"label"},e,"% uploaded... ")))},r=function(){return"\n.device-mobile {\n\t\t.upload-progress-bar-wrapper {\n\t\t\t\tbottom: 176px;\n\t\t}\n}\n.upload-progress-bar-wrapper {\n\t\t.label {\n\t\t\t\tposition: relative;\n\t\t}\n\t\t.bg-fill {\n\t\t\t\ttransition: 0.1s all;\n\t\t\t\tposition:absolute;\n\t\t\t\tbackground: #077e00;\n\t\t\t\theight: 100%;\n\t\t\t\ttop: 0px;\n\t\t\t\tleft: 0px;\n\t\t}\n\t\tposition:absolute;\n\t\tbottom: 0px;\n\t\twidth: 100%;\n\t\tleft: 0px;\n\t\t/* background: green; */\n\t\tbackground: #a0a0a0;\n\t\tcolor: white;\n\t\ttext-align: center;\n\t\tz-index:3;\n\t\tfont-size: 9px;\n\t\tpadding: 5px;\n}\n"}},235:function(t,e,n){"use strict";n.d(e,"b",(function(){return s})),n.d(e,"a",(function(){return d}));var o=n(31),i=n(6),c=n(12),a=n(33),r=n(10),l=n(45),s=function(t,e){return Object(l.a)({file:t,windowId:e,pattern:o.a.hashtag,replacement:function(e){var n=e.matchs,o=document.createElement("span");return o.classList.add("cm-hashtag"),o.innerHTML='<span class="hash-inner" \n data-hashtag="'.concat(n[1],'"\n data-hashtag2="').concat(n[0],'"\n data-folder="').concat(t.folder,'"\n onclick="').concat(Object(a.c)("open-win-smartlist-hashtag",u),'" >').concat(n[0],"</a>"),o},options:{isAtomic:!1}})},u=function(t){if(t){var e=t.dataset.hashtag2,n=t.dataset.folder;Object(i.d)((function(t){var o=Object(c.e)()?"full-top":"full-bottom";t.ui.floatingPanel.create({type:"ctag",layout:o,ctagConfig:{tagName:"smartlist",content:"".concat(e," | ").concat(n)}})}))}},d=function(){return"\n .cm-hashtag {\n &:hover {\n opacity: 1;\n }\n opacity: 0.3;\n transition: opacity 0.2s;\n // color: var(--color-text);\n color: grey;\n background: ".concat(r.a.colors.main,";\n color: ").concat(r.a.colors.mainFont,";\n border-radius: 3px;\n padding: 2px 4px;\n margin: 0 2px;\n // display: inline-block;\n font-size: 0.9em;\n .hash-inner {\n cursor: pointer;\n }\n }\n")}},236:function(t,e,n){"use strict";n.d(e,"a",(function(){return s})),n.d(e,"b",(function(){return d}));var o=n(31),i=n(6),c=n(33),a=n(10),r=n(45),l=n(25),s=function(t,e){return Object(r.a)({file:t,windowId:e,pattern:o.a.dateFrFormat,replacement:function(t){var n=t.matchs,o=(t.view,t.pos),i=document.createElement("span"),a=n[0].split("/"),r="".concat(a[2],"-").concat(a[1],"-").concat(a[0]);return i.innerHTML='<span class="date-picker-cm-wrapper"><input type="date" id="date-picker-cm-input" lang="fr-FR" data-replacepos="'.concat(o,'" data-windowid="').concat(e,'" value="').concat(r,'" onchange="').concat(Object(c.c)("replace-date-text-datepicker",u),'"/></span>'),i},options:{cache:!1}})},u=function(t){if(console.log("el1"),t){var e=t.dataset.replacepos,n=t.dataset.windowid;console.log("el",t.value,e);var o=t.value.split("-"),c="".concat(o[2],"/").concat(o[1],"/").concat(o[0]);if(-1===(e=parseInt(e)||-1))return console.warn("no pos");Object(i.d)((function(t){console.log("replacedatetext",c,e),t.ui.note.editorAction.dispatch({windowId:n,type:"replaceText",replaceText:c,replacePos:e})}))}},d=function(){return"\n .date-picker-cm-wrapper {\n cursor: pointer;\n input {\n padding: 0px;\n border: none;\n font-size: ".concat(Object(l.a)(),"px;\n font-weight: 400;\n font-family: ").concat(a.a.font.editor,";\n margin-right: 0px;\n color: #4d4d4d;\n background: #e9e9e9;\n position: relative;\n border-radius: 3px;\n padding: 2px 6px;\n cursor: pointer;\n }\n }\n")}},237:function(t,e,n){"use strict";n.d(e,"a",(function(){return r})),n.d(e,"b",(function(){return s}));var o=n(31),i=n(6),c=n(33),a=n(45),r=function(t,e){return Object(a.a)({file:t,windowId:e,pattern:o.a.checkbox,replacement:function(t){var n=t.matchs,o=(t.view,t.pos),i=document.createElement("span"),a=n[0].toLocaleLowerCase().includes("x"),r=a?"checked='checked'":"";return i.innerHTML='<span class="checkbox-todo-cm-wrapper">'+'<input type="checkbox" id="checkbox-todo-cm-input" '.concat(r)+'data-replacepos="'.concat(o,'" data-ischecked="').concat(a,'" data-windowid="').concat(e,'" value="" ')+'onchange="'.concat(Object(c.c)("replace-checkbox-todo-text",l),'"/></span>'),i},options:{cache:!1}})},l=function(t){if(t){var e=t.dataset.replacepos,n=t.dataset.windowid,o=t.dataset.ischecked;if(-1===(e=parseInt(e)||-1))return console.warn("no pos");Object(i.d)((function(t){t.ui.note.editorAction.dispatch({windowId:n,type:"replaceText",replaceText:"true"===o?"[ ]":"[x]",replacePos:e})}))}},s=function(){return"\n .checkbox-todo-cm-wrapper {\n cursor: pointer;\n input {\n position: relative;\n top: 4px;\n transform: scale(.7);\n cursor: pointer;\n margin: 0px;\n }\n }\n"}},238:function(t,e,n){"use strict";n.d(e,"a",(function(){return u})),n.d(e,"b",(function(){return d}));var o=n(29),i=n(31),c=n(33),a=n(73),r=n(57),l=n(10),s=n(45),u=function(t,e){return Object(s.a)({file:t,windowId:e,pattern:i.a.userCustomTagFull2,replacement:function(n){var i=document.createElement("span");return i.innerHTML=function(t,e,n){var i=t[2].replaceAll("[[","").replaceAll("]]",""),l=t[0].replaceAll("[[".concat(i,"]]"),""),s=function(t,e,n){return"".concat(Object(r.b)(t,""),"-").concat(Object(r.b)(e,""),"-").concat(Object(r.b)(n,""))},u=s(i,l,e.path),d="ress-".concat(u);Object(c.a)(e,u,(function(){var t=document.querySelector(".".concat(d," .iframe-wrapper-cm-ctag"));if(t){var o=Object(a.b)(i,l,n,{file:e});Object(a.c)(t,o)}}));var p='\n\t<div class="button-ctag-cm-toggle" \n\t\tonclick="'.concat(Object(c.c)("toggle-ctag-link",(function(t){if(t){var e=t.dataset.filepath,n=decodeURIComponent(t.dataset.tagcontent),i=t.dataset.tagname,r=t.dataset.windowid,l=s(i,n,e),u=Object(o.e)(e),d=t.parentNode.parentNode.querySelector(".iframe-wrapper-cm-ctag"),p=d.querySelector("iframe")?"closed":"open";Object(c.b)(u,l,p);var f=Object(a.b)(i,n,r,{file:u});Object(a.c)(d,f)}})),'"\n\t\tdata-filepath="').concat(e.path,'"\n\t\tdata-windowid="').concat(n,'"\n\t\tdata-tagname="').concat(i,'"\n\t\tdata-tagcontent="').concat(encodeURIComponent(l),'"\n\t>').concat(Object(c.d)("eye"),"</div>"),f='<div class="cm-ctag-name">[[ '.concat(i," ]]</div>"),b='<div class="cm-ctag-overview">'.concat(f).concat(p,"</div>");return'<div class="cm-ctag-wrapper '.concat(d,'">').concat(b).concat('<div class="iframe-wrapper-cm-ctag"></div>',"</div>")}(n.matchs,t,e),i}})},d=function(){return"\n\t.cm-ctag-wrapper {\n\t\tposition:relative;\n\t\tbackground: #f2f2f2;\n\t\tpadding: 8px;\n\t\tborder-radius: 5px;\n\t\t.cm-ctag-overview {\n\t\t\tdisplay: flex;\n\t\t\t.cm-ctag-name {\n\t\t\t\tfont-weight: bold;\n\t\t\t\tcolor: ".concat(l.a.colors.main,";\n\t\t\t}\n\t\t\t.button-ctag-cm-toggle {\n\t\t\t\tposition: absolute;\n\t\t\t\tright: 0px;\n\t\t\t\ttop: -1px;\n\t\t\t\topacity: 0.5;\n\t\t\t\tcursor: pointer;\n\t\t\t\tpadding: 10px;\n\t\t\t\t&:hover {\n\t\t\t\t\topacity: 0.7;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t.iframe-wrapper-cm-ctag {\n\n\t\t}\n\t}\n\t\n\n\t")}},239:function(t,e,n){"use strict";n.d(e,"a",(function(){return c})),n.d(e,"b",(function(){return a}));var o=n(31),i=n(45),c=function(t,e){return Object(i.a)({file:t,windowId:e,pattern:o.a.boldOrStrike,replacement:function(t){var e=t.matchs,n=(t.view,t.pos,document.createElement("span"));n.classList.add("markdown-synthax-cm-wrapper");var o="";e[0].startsWith("***")?o="***":e[0].startsWith("**")?o="**":e[0].startsWith("~~")?o="~~":e[0].startsWith("__")?o="__":e[0].startsWith("*")&&(o="*"),"**"===o&&n.classList.add("bold"),"~~"===o&&n.classList.add("strike"),"__"===o&&n.classList.add("bold"),"*"===o&&n.classList.add("italic"),"***"===o&&n.classList.add("bold_and_italic");var i=e[0];return i=i.replaceAll(o,""),n.innerHTML="".concat(i),n},options:{cache:!1}})},a=function(){return"\n .markdown-synthax-cm-wrapper {\n &.bold {\n font-weight: bold;\n }\n &.strike {\n text-decoration: line-through;\n }\n &.italic {\n font-style: italic;\n }\n &.bold_and_italic {\n font-weight: bold;\n font-style: italic;\n }\n }\n"}},24:function(t,e,n){"use strict";n.d(e,"a",(function(){return o}));n(3),n(377);var o=function(t,e,n){var o={};return{list:JSON.stringify(t,(function(t,i){return"function"===typeof i?function(t,i){var c,a=i.toString(),r=a.replace(/^function\s*\(/,"(").replace(/\{[\s\S]*$/,"").trim(),l="".concat("https://github.com/dotgreg/tiro-notes/tree/master/").concat(n),s="".concat(e,".").concat(t),u=s.replaceAll("api.","api.call('")+"', [...])",d="".concat(s.split(".").slice(-2).join(".")),p="https://github.com/search?q=repo%3Adotgreg%2Ftiro-notes%20";c="+path%3A*.js+OR+path%3A*.tsx++OR+path%3A*.ts&type=code";var f="".concat(p).concat(d).concat(c),b=a.match(/emit\('([^']+)'\s*,\s*\{/);b&&(b=b[1]);var g="".concat(p).concat(b,"+path%3Aserver%2Fsrc%2Froutes.ts+").concat(c),h=b?"\n---\nRelated server command: ".concat(b,'\n- That frontend api method seems to be related to the server command "').concat(b,'". You can find more information about it by following the link below.\n').concat(g,"\n "):"",m="\nDOCUMENTATION FOR API METHOD: ".concat(s,"\n======\nSignature: ").concat(r,"\n- For more details on the structure/type of each parameter, please check the source code url below\n=======\nSource code url \n").concat(l).concat(h,"\n=======\nMethod usage and examples:\n").concat(f,"\n- USAGE:\n - for custom tag plugins (like [[test]]) or user_functions.md, you need to call it like this: ").concat(u,"\n - for bar/background/other custom code/plugins, you can directly call it ").concat(s,"(args)\n=======\nMethod code:\n").concat(a,"\n ");return o[t]=m,r}(t,i):i}),2),methods:o,m:o}}},240:function(t,e,n){"use strict";n.d(e,"a",(function(){return h})),n.d(e,"b",(function(){return m}));var o=n(11),i=n(16),c=n(3),a=n(0),r=n(63),l=n(10),s=n(48),u=n(12),d=n(22),p=n(25),f=n(75),b=n(30),g=n(1),h=function(t){var e=Object(a.useState)(!1),n=Object(c.a)(e,2),p=n[0],h=n[1],m=Object(a.useState)(!1),v=Object(c.a)(m,2),w=v[0],O=v[1];Object(a.useEffect)((function(){p&&O(!0)}),[t.cursorInfos.y]);var j=function(e){O(!1),t.onButtonClicked(e)},x=function(){return[{icon:"faTableCells",title:"Add Table Column",action:function(){t.onButtonClicked("addTableCol")}},{icon:"faTableList",title:"Remove Table Column",action:function(){t.onButtonClicked("removeTableCol")}}]},_=[{icon:"faCircle",action:function(){h(!1),O(!1)},class:"separator"},{icon:"faUndo",action:function(){return j("undo")}},{icon:"faRedo",action:function(){return j("redo")}},{icon:"faAngleLeft",action:function(){return j("<-")}},{icon:"faAngleRight",action:function(){return j("->")}},{icon:"faCheckSquare",action:function(){return j("[x]")}},{icon:"faAngleUp",action:function(){return j("^")}},{icon:"faAngleDown",action:function(){return j("v")}},{icon:"faEraser",action:function(){return j("X")}},{icon:"faClone",action:function(){return j("C")}},x()[0],x()[1]],k=[];if(k.push({icon:"faCircle",action:function(){return h(!0)}}),k.push({icon:"faHighlighter",action:function(){t.onButtonClicked("highlightLine")}}),k.push(x()[0]),k.push(x()[1]),t.selection.length>0){var y=Object(r.e)(t.selection),C={icon:"chart-line",action:function(){},customHtml:Object(g.c)("div",{className:"numbers-preview-wrapper"},Object(g.c)("i",{className:"fa fa-chart-line"}),Object(g.c)("span",{className:"numbers-preview"},Object(r.i)(t.selection)))};y&&(C={icon:"calculator",title:"Calculate selection",customHtml:Object(g.c)("div",{className:"numbers-preview-wrapper"},Object(g.c)("i",{className:"fa fa-calculator"}),Object(g.c)("span",{className:"numbers-preview"},Object(r.a)(t.selection))),action:function(){t.onButtonClicked("calc"),h(!1)}});var S=d.d.curr.ui_editor_ai_text_selection,E=function(){var e=[];if(d.d.curr.ui_editor_live_watch&&S){var n=Object(f.c)();Object(b.a)(n,(function(n){e.push({icon:n.icon,title:n.title,action:function(){t.onButtonClicked("aiSearch",{aiConfig:n}),h(!1)}})}))}return e},T={icon:"copy",title:"Copy line link",action:function(){t.onButtonClicked("copyLineLink"),h(!1)}},I={icon:"spell-check",title:"Proofread selection",action:function(){t.onButtonClicked("proofread"),h(!1)}};(k=[].concat(Object(i.a)(k),Object(i.a)(E()))).push(T),k.push(I),d.d.curr.ui_editor_live_watch&&k.push(C),d.d.curr.ui_editor_search_highlight_enable&&k.push({icon:"search",title:"Search selection",action:function(){t.onButtonClicked("searchEngine"),h(!1)}});var N=Object(o.a)({},C);N.class="separator-right",d.d.curr.ui_editor_live_watch&&_.push(N),d.d.curr.ui_editor_search_highlight_enable&&_.push({icon:"search",title:"Search selection",action:function(){t.onButtonClicked("searchEngine"),h(!1)}}),_.push(T),_.push(I),_=[].concat(Object(i.a)(_),Object(i.a)(E()))}return Object(g.c)("div",{className:"mobile-toolbar-wrapper device-".concat(Object(u.a)()," ").concat(p?"open":"closed"," ").concat(w?"popup-transparent":"")},!p&&Object(g.c)(s.a,{class:"mobile-text-manip-toolbar closed",size:"desktop"===Object(u.a)()?.8:1,colors:[l.a.colors.editor.mobileToolbar.font,l.a.colors.editor.mobileToolbar.font],buttons:k,popup:!1}),p&&Object(g.c)(s.a,{class:"mobile-text-manip-toolbar",size:"desktop"===Object(u.a)()?.8:1,colors:[l.a.colors.editor.mobileToolbar.font,l.a.colors.editor.mobileToolbar.font],buttons:_,popup:!1}))},m=function(){return"\n.view-preview .buttons-toolbar-component.mobile-text-manip-toolbar {\n display: none;\n}\n\n.mobile-text-manip-toolbar-wrapper {\n z-index:1;\n \n \n pointer-events: none;\n position: ".concat(Object(u.e)()?"fixed":"absolute",";\n width: 100%;\n // z-index: 100;\n display: flex;\n justify-content: flex-end;\n}\n.mobile-text-manip-toolbar {\n \n \n\t\t.toolbar-button {\n\t\t\t\tpadding: 13px 20px;\n\t\t}\n}\n\n.numbers-preview-wrapper {\n display: flex;\n font-size: ").concat(Object(p.a)(),"px;\n font-weight: 400;\n i {\n margin-top: 2px;\n }\n .numbers-preview {\n margin-left: 5px;\n }\n}\n\n .mobile-toolbar-wrapper {\n &.popup-transparent {\n opacity: 0.4;\n }\n\n\n .mobile-text-manip-toolbar {\n width: 10px;\n flex-direction: column;\n pointer-events: all;\n margin-right:20px;\n \n background: #fff;\n border-radius: 10px;\n display: flex;\n list-style: none;\n padding: 0px 10px;\n box-shadow: 0px 0px 5px 0px rgba(0,0,0,0.2);\n align-content: center;\n justify-content: center;\n align-items: center;\n // height: ").concat(l.a.sizes.mobile.editorBar,"px;\n &:hover {\n opacity: 1;\n }\n opacity: 0.4;\n left: 15px;\n \n transition: opacity 0.2s;\n \n .toolbar-button {\n padding: 3px 5px; \n }\n .separator {\n // margin-left: 8px;\n }\n .separator-right {\n // margin-right: 8px;\n }\n\n li {\n flex: 1 1 auto;\n justify-content: center;\n display: flex;\n }\n\n &.closed {\n opacity: 0.2;\n background: none;\n box-shadow: none;\n &:hover {\n background: #fff;\n box-shadow: 0px 0px 5px 0px rgba(0,0,0,0.2);\n opacity: 1;\n }\n }\n\n \n }\n\n &.device-mobile {\n .mobile-text-manip-toolbar {\n transform: scale(0.9);r\n opacity: 1;\n &.closed {\n opacity: 0.2;\n &:hover {\n opacity: 1;\n }\n } \n transform: scale(1);\n .toolbar-button {\n // padding: 12px; \n }\n }\n }\n \n }\n")}},241:function(t,e,n){"use strict";n.d(e,"a",(function(){return x})),n.d(e,"b",(function(){return _}));var o=n(16),i=n(3),c=n(30),a=n(608),r=n(0),l=n.n(r),s=n(163),u=n(6),d=n(18),p=n(93),f=n(72),b=n(187),g=n(14),h=n(21),m=n(10),v=n(20),w=n(54),O=n(25),j=n(1),x=function(t){var e=Object(r.useState)([]),n=Object(i.a)(e,2),m=n[0],O=n[1],x=Object(r.useState)(!1),_=Object(i.a)(x,2),k=_[0],y=_[1],C=function(){var e=S();O([].concat(e)),y(!0),g.b.emit("askFileHistory",{filepath:t.file.path,token:Object(d.b)()});var n=g.b.on("getFileHistory",(function(t){var i=[];Object(c.a)(t.files,(function(t){var e,n=null===(e=t.filenameWithoutExt)||void 0===e?void 0:e.split("___")[1];n&&(t.created=Object(s.a)(n).num.timestamp),t.created&&t.created<Date.now()&&i.push(t)}));var r=Object(a.a)(i,["created"],["desc"]);O([].concat(e,Object(o.a)(r))),y(!1),g.b.off(n)}))},S=function(){var e=[],n=Object(b.b)(t.file.path);return Object(c.a)(n,(function(t,n){var o=n+1,i=Object(p.a)();i.created=t.timestamp,i.path=t.path+o;var c="Temporary local save ".concat(o," from ").concat(Object(f.a)(new Date(i.created||0)));i.name=c,i.realname=c,i.localContent=t.content,i.isLocal=!0,e.push(i)})),console.log("getLSHistoryList",n,t.file.path),e};Object(r.useEffect)((function(){C()}),[]);var E=Object(r.useContext)(u.a),T=Object(r.useState)(""),I=Object(i.a)(T,2),N=I[0],P=I[1],A=Object(r.useState)(null),R=Object(i.a)(A,2),F=R[0],L=R[1];return Object(j.c)("div",{className:"history-popup-wrapper"},Object(j.c)(w.a,{title:"".concat(h.a.historyPopup.title,'"').concat(t.file.realname,'"'),onClose:function(){t.onClose()}},Object(j.c)("div",{className:"count"},m.length," backups found :"),k&&Object(j.c)("div",{className:"count"}," (Loading backend history files...)"),Object(j.c)("div",{className:"table-wrapper"},Object(j.c)("table",null,Object(j.c)("thead",null,Object(j.c)("tr",null,Object(j.c)("th",null,h.a.historyPopup.thead.name),Object(j.c)("th",null,h.a.historyPopup.thead.date))),Object(j.c)("tbody",null,m.map((function(t){return Object(j.c)("tr",{className:"".concat((null===F||void 0===F?void 0:F.path)===t.path?"active":""),onClick:function(){!function(t){t.isLocal&&t.localContent?(P(t.localContent),L(t)):E&&E.file.getContent(t.path,(function(e){P(e),L(t)}))}(t)}},Object(j.c)("td",null," ",t.realname," "),Object(j.c)("td",null," ",Object(f.a)(new Date(t.created||0))," "),Object(j.c)("td",null," ",!t.isLocal&&Object(j.c)("div",{className:"trash",onClick:function(){!function(t){Object(u.d)((function(e){e.file.delete(t,(function(t){C(),L(null),P("")}))}))}(t)}}," ",Object(j.c)(v.a,{name:"faTrash",color:"grey"})," ")))}))))),N&&Object(j.c)(l.a.Fragment,null,Object(j.c)("div",{className:"note-preview"},Object(j.c)("textarea",{className:"note-preview-textarea",value:N}),Object(j.c)("div",{className:"button-wrapper"},Object(j.c)("button",{className:"button",onClick:function(){Object(u.d)((function(e){e.file.saveContent(t.file.path,N)}))}},"Restore version")),Object(j.c)("div",{className:"advice"},' To disable history backup for a note, add "--disable-history--"in it')))))},_=function(){return"\n.history-popup-wrapper .popup-wrapper-component .popup-wrapper {\n\theight: 70%;\n}\n.history-popup-wrapper .popup-wrapper .count {\n\tposition: relative;\n top: -9px;\n font-weight: 600;\n}\n.filemain-wrapper .history-popup-wrapper .popup-wrapper-component .popup-wrapper {\n\twidth: 90%;\n}\n.history-popup-wrapper {\n\t.popup-wrapper .popupContent {\n\t\t// max-height: 70vh;\n\t\tpadding: 0px;\n\t}\n\t.table-wrapper {\n\t\t// max-height: 30vh;\n\t\theight: 50%;\n\t\toverflow-y: auto;\n\t\tpadding: 0px 0px 20px 0px;\n\t\t\n\t\ttable {\n\t\t\tborder-spacing: 0px;\n\t\t\tthead {\n\t\t\t\ttr {\n\t\t\t\t\tth {\n\t\t\t\t\t\tpadding: 8px;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\ttbody {\n\t\t\t\ttext-align: left;\n\t\t\t\ttr {\n\t\t\t\t\tcursor: pointer;\n\t\t\t\t\tbackground: #f1f0f0;\n\t\t\t\t\t&:nth-child(2n) {\n\t\t\t\t\t\tbackground: none;\n\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t&.active {\n\t\t\t\t\t\t\t\t\t\t\tfont-weight: bold;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t&: hover {\n\t\t\t\t\t\tbackground: r".concat(m.a.colors.main,";\n\t\t\t\t\t}\n\t\t\t\t\ttd {\n\t\t\t\t\t\tpadding: 8px;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\t.note-preview {\n\t\theight: 50%;\n\t\t.note-preview-textarea {\n\t\t\tpadding: 6px;\n\t\t\tmargin: 10px 0px 0px 0px;\n\t\t\twidth: calc(100% - 10px);\n\t\t\t// height: calc(100% - 90px);\n\t\t\theight: calc(100% - 89px);\n\t\t\tborder: none;\n\t\t\tbackground: gainsboro;\n\t\t}\n\t}\n\t.advice {\n\t\tcolor: #a4a4a4;\n\tfont-size: ").concat(Object(O.a)(),"px;\n\tpadding: 3px 3px;\n\t}\n\t.trash {\n\tmargin-right: 15px;\n\t}\n}\n")}},242:function(t,e,n){"use strict";n.d(e,"a",(function(){return s})),n.d(e,"b",(function(){return u}));var o=n(14),i=n(18),c=n(6),a=n(38),r=n(24),l="[NOTIFICATIONS]",s={},u=function(t){var e={emit:function(t,cb){var e,n=function(){var e;if(console.log(l,"emitNotification",t),null!==(e=t.options)&&void 0!==e&&e.onClick){var n,c="notif-onclick-fnid-".concat(t.id,"-").concat(Object(a.a)());s[c]=null===(n=t.options)||void 0===n?void 0:n.onClick,t.options.onClickId=c}cb&&cb(),o.b.emit("emitNotification",{notification:t,token:Object(i.b)()})};null!==(e=t.options)&&void 0!==e&&e.showOnceEvery&&t.id?Object(c.d)((function(e){var o="notif-showevery-".concat(t.id);e.cache.get(o,(function(i){var c;if(i&&!0===i.alreadyShown)return console.log(l,"showOnceEvery => already shown notif, dont reshow it",t);n(),e.cache.set(o,{alreadyShown:!0},null===(c=t.options)||void 0===c?void 0:c.showOnceEvery)}))})):n()},notifLog:function(t,e,n){console.log("[NOTIF LOG]: ",t),n||(n=60),t=t.replace(/\\/g,""),Object(c.d)((function(o){o.ui.notification.emit({content:t,id:e,options:{hideAfter:n,type:"warning",keepInHistory:!0}})}))},documentation:function(){return Object(r.a)(e,"api.notification","client/src/hooks/api/notification.api.hook.tsx")}};return e}},247:function(t,e,n){"use strict";n.d(e,"a",(function(){return g})),n.d(e,"b",(function(){return h}));var o=n(3),i=n(11),c=n(168),a=n(30),r=n(39),l=n(0),s=n.n(l),u=n(6),d=n(21),p=n(129),f=n(1);var b={upload:{uploadCounter:0,reinit:function(){}},file:{onTitleUpdate:function(t,e){},onFileDelete:function(t){}}},g=s.a.createContext(b),h=function(t){var e=Object(i.a)({},t).tab,n=Object(l.useContext)(u.a),c=Object(l.useState)(b),s=Object(o.a)(c,2),h=s[0],v=s[1],w=function(){var t=Object(l.useContext)(u.a),e=Object(l.useState)({name:"",data:{}}),n=Object(o.a)(e,2),i=n[0],c=n[1],a=Object(l.useRef)({});return Object(l.useEffect)((function(){if(t){var cb=a.current[i.name];cb&&cb(t,i.data)}}),[i]),{onNextStateTrigger:function(t){c(t)},addNextStateAction:function(t,cb){a.current[t]=cb}}}(),O=w.onNextStateTrigger,j=w.addNextStateAction;j("refreshFolderList",(function(t,e){var n=t.ui.browser.folders.current.get();n===e.folder&&(t.ui.browser.goTo(n,e.name,{openIn:"activeWindow"}),O({name:"checkIfNoWindows"}))})),j("checkIfNoWindows",(function(t){0===e.grid.content.length&&t.tabs.close(e.id)}));var x=Object(r.a)(h);x.file.onFileDelete=function(t){n&&n.popup.confirm("".concat(d.a.trashNote),(function(){var e;null===(e=n.lastNotesApi)||void 0===e||e.removeFile(t.path),n.file.delete(t,(function(e){n.ui.windows.getIdsFromFile(t.path),e[e.length-1];var o=e[0];Object(a.a)(e,(function(t){t.modified&&o.modified&&t.modified>o.modified&&(o=t)})),O({name:"refreshFolderList",data:o})}))}))},x.file.onTitleUpdate=function(t,e){n&&n.file.move(t,e,(function(o){var i,c=null;if(Object(a.a)(o,(function(t){t.path===e&&(c=t)})),c){var r=n.ui.windows.getIdsFromFile(t);n.ui.windows.updateWindows(r,c),null===(i=n.lastNotesApi)||void 0===i||i.removeFile(t),O({name:"refreshFolderList",data:c})}}))},x.upload.reinit=function(){var t=Object(r.a)(h);delete t.upload.file,v(t)};var _=Object(l.useState)(0),k=Object(o.a)(_,2),y=k[0],C=k[1];return Object(l.useEffect)((function(){C(y+1)}),[e.refresh,JSON.stringify(t.pinStatus),t.forceRefresh]),Object(f.c)(m,null,Object(f.c)("div",{className:"window-grid-wrapper"},Object(f.c)(g.Provider,{value:x},Object(f.c)(p.a,{refresh:y,grid:e.grid,onGridUpdate:t.onGridUpdate,mobileView:t.mobileView}))))},m=Object(c.a)("div",{target:"ejnwhwz0"})({name:"zk0z9r",styles:"height:100%;.window-grid-wrapper{height:100%;}"})},25:function(t,e,n){"use strict";n.d(e,"a",(function(){return c}));var o=n(22),i=n(12),c=function(t){return t||(t=0),"desktop"!==Object(i.a)()?10+t:(parseInt(Object(o.b)().ui_layout_general_font_size)||10)+t}},250:function(t,e,n){"use strict";n.d(e,"b",(function(){return p})),n.d(e,"a",(function(){return f}));var o=n(3),i=n(0),c=n.n(i),a=n(12),r=n(10),l=n(20),s=n(132),u=n(1),d=function(t){var e=Object(i.useState)(""),n=Object(o.a)(e,2),c=n[0],d=n[1],p=Object(i.useState)(!1),f=Object(o.a)(p,2),b=f[0],g=f[1],h=!Object(s.a)(t.enabled)||t.enabled;Object(i.useEffect)((function(){d(t.title),g(!1)}),[t.title]);return Object(u.c)("div",{className:"title-input-wrapper"},Object(u.c)("input",{className:"big-title",type:"text",value:c,disabled:!h,onChange:function(t){var e=function(t){var e=t;return e.replace(/[^A-Za-z0-9_\ \-\u00a9\u00ae\u2000-\u3300\ud83c\ud000-\udfff\ud83d\ud000-\udfff\ud83e\ud000-\udfff]/g,"")}(t.target.value);d(e),g(!0)},onKeyDown:function(e){if(!1!==h&&"Enter"===e.key){if(c.length<3)return;t.onEdited(t.title,c),g(!1)}}}),b&&Object(u.c)("div",{className:"press-to-save"},Object(u.c)(l.a,{name:"faCircle",color:r.a.colors.main,size:.7})),b&&"mobile"===Object(a.a)()&&Object(u.c)("button",{className:"buttonSaveTitleMobile",onClick:function(){0!==c.length&&(g(!1),t.onEdited(t.title,c))}}," Save "))},p=function(){return"\n.buttonSaveTitleMobile {\n\t\tposition: relative;\n\t\tright: 20px;\n\n\n}\n"},f=c.a.memo(d,(function(t,e){var n=!1;return t.title!==e.title&&(n=!1),n}))},28:function(t,e,n){"use strict";n.d(e,"a",(function(){return c})),n.d(e,"c",(function(){return a})),n.d(e,"b",(function(){return r})),n.d(e,"d",(function(){return l}));n(11);var o=n(6),i="tiroDevCli",c=function(t,e,n){window[i]||(window[i]={}),window[i][t]||(window[i][t]={}),window[i][t][e]=n},a=function(t,e){return window[i]&&window[i][t]&&window[i][t][e]?window[i][t][e]:function(){console.log("DEV FN",t,e,"does not exists")}},r=function(t,e){if(window[i]&&window[i][t]&&window[i][t][e])window[i][t][e]();else{var n="DEV FN ".concat(t," ").concat(e," does not exists");console.log(n),l(n)}},l=function(t,e,n){n||(n=5),console.log("[NOTIF LOG] ".concat(t)),Object(o.d)((function(o){o.ui.notification.notifLog(t,e,n)}))}},29:function(t,e,n){"use strict";n.d(e,"b",(function(){return o})),n.d(e,"e",(function(){return i})),n.d(e,"d",(function(){return c})),n.d(e,"a",(function(){return a})),n.d(e,"c",(function(){return r}));var o=function(t){return t=(t=(t=(t=(t=t.split("://").join("__HTTP__SEP")).split("//").join("/")).split("\\").join("/")).split("//").join("/")).split("__HTTP__SEP").join("://")},i=function(t){var e=function(t){var e=t.split("/"),n=t.split("\\"),o=e.length>n.length?e:n,i=o[o.length-1],c=i.split("."),a=t.replace(i,""),r="";c.length>1&&(r=c[c.length-1]);var l=i.replace(".".concat(r),"");return"/"!==t[0]&&(t="/"+t),"/"!==a[0]&&(a="/"+a),{filename:i,extension:r,path:t,folder:a,filenameWithoutExt:l}}(t),n=e.extension?"file":"folder";return{path:e.path,realname:e.filename,nature:n,name:e.filename,extension:e.extension,folder:e.folder,filenameWithoutExt:e.filenameWithoutExt}},c=function(t){var e=t.match(/(.*)[\/\\]/),n=e?e[1]+"/":"";return o(n)},a=function(t,e){return o(t+"/")===o(e+"/")},r=function(t){return t.replace(/[^a-zA-Z0-9]/g,"_")}},31:function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));var o=n(40),i=n.n(o),c=n(17);const a={img:i()().find(".").then("jpg").or("jpeg").or("png").or("gif").or("webm").or("svg").or("webp"),imgMdConfig:i()().anythingBut("[]|").maybe("|").beginCapture().anythingBut("[]|").endCapture().maybe("|").beginCapture().anythingBut("[]|").endCapture(),customTag:/\[\[[a-zA-Z0-9-\ _\/]*\]\]/},r={strings:{charWithAccents:"[a-zA-Z\xc0-\u024f\u1e00-\u1eff]{1}",tableLine:"([a-z\xc0-\xfaA-Z0-9@:%,-*._+~#= ]+|)"},checkbox:/\[ \]|\[x\]|\[X\]/gi,dateFrFormat:/([0-9]{1,2})\/([0-9]{1,2})\/([0-9]{4})/gi,boldOrStrike:/\*\*[^*]+\*\*|\~\~[^~]+\~\~|\*\*\*[^*]+\*\*\*|\_\_[^_]+\_\_|\*[^\ \*]+\*/gi,metas:i()().find(c.a.metas.headerStart).beginCapture().anythingBut("").endCapture().then(c.a.metas.headerEnd),metasAndSpace:i()().find(c.a.metas.headerStart).beginCapture().anythingBut("").endCapture().then(c.a.metas.headerEnd).then("\n"),titleHtml:/<(title)[^>]*>([^<]*)<\/\1>/gi,metasHtml:/<meta[^>]*(name|property)="([^"]*)"[^>]*content="([^"]*)"[^>]*>/gi,externalLink3:/(?:https?:\/\/)?((www\.)?[a-z\xc0-\xfaA-Z0-9@:%._\+~#=]{1,256})\b(\/[-a-zA-Z\xc0-\xfa0-9()\*\;\!@:%_\-\+.,~#?&\/=]*\/)?([-a-zA-Z\xc0-\xfa0-9()\\\*\;\!@:%_\-\+.,~#?&\/=]*)\/(\n| |$)/gim,externalLink3Int:/https?:\/\/((www\.)?[a-z\xc0-\xfaA-Z0-9@:%._\+~#=]{1,256})\b(\/[-a-zA-Z\xc0-\xfa0-9()\*\;\!@:%_\-\+.,~#?&\/=]*\/)?([-a-zA-Z\xc0-\xfa0-9()\*\;\!@:%_\-\+.,~#?&\/=]*)\//gim,mdTableLine:/\|?(([^\|]+\|)+([^\|]+))\|?/gim,mdTitle:/^([#]{1,9})\ (.+)/gi,mdTableCell:/(((([^|\n])+\|)|(([^|\n])+)))/gim,doesNotStartByDash:/^(?!\-)/,hashtag:/#([A-z\xc0-\xfa0-9_\-]+)/gi,matchingHtmlTags:/<([^>]*)>([^<]*)<\/\1>/,baliseHtml:i()().find("<").anythingBut("<>").then(">"),ressource:i()().find("![").beginCapture().anythingBut("[]").endCapture().then("](").beginCapture().anythingBut("()").endCapture().then(")"),ref:i()().find("[").anythingBut("[]").then("](").anythingBut("()").then(")"),extimage:i()().find("![").anythingBut("[]").then("](").beginCapture().then("http").anythingBut("()").then(a.img).anythingBut("()").endCapture().then(")"),image:i()().find("![").anythingBut("[]").then("](").beginCapture().anythingBut("()").then(a.img).anythingBut("()").endCapture().then(")"),image2:/!\[(.*?)\]\((.*?\.(jpg|png|gif|bmp|jpeg|webm|svg|webp"))\)(\{(.*)\})?/gim,fullImageMd:i()().beginCapture().find("![").anythingBut("[]").then("](").anythingBut("()").then(a.img).anythingBut("()").endCapture().then(")"),imageMdSrc:i()().find("![").anythingBut("[]").then("](").beginCapture().anythingBut("()").then(a.img).anythingBut("()").endCapture().then(")"),imageAndTitleCapture:i()().find("![").beginCapture().anythingBut("[]").endCapture().then("](").beginCapture().anythingBut("()").then(a.img).anythingBut("()").endCapture().then(")"),imageAndTitleCapture2:/\!\[([^\[\]]+)\]\(([^\(\)]+\.(jpg|jpeg|png|gif|webm|svg|webp))\)/gi,imageAndConfig:i()().find(".beginCapture().anythingBut("()").then(a.img).anythingBut("()").endCapture().then(")"),searchlink:i()().find("[search|").beginCapture().anythingBut("[]").endCapture().then("]"),linklink:i()().find("[link|").beginCapture().anythingBut("[]").endCapture().then(" ").beginCapture().then("/").anythingBut("[]").endCapture().then("]"),latexTag:i()().find("[[latex]]").beginCapture().anythingBut("").endCapture().then("[[latex]]"),scriptTag:i()().find("[[script]]").beginCapture().anythingBut("").endCapture().then("[[script]]"),userCustomTagFull:i()().find(a.customTag).beginCapture().anythingBut("").endCapture().then(a.customTag),userCustomTagFull2:i()().beginCapture().beginCapture().find(a.customTag).endCapture().anythingBut("").beginCapture().then(a.customTag).endCapture().endCapture(),userCustomTagFull3:i()().beginCapture().find(a.customTag).endCapture(),userCustomTag3:i()().beginCapture().then(a.customTag).endCapture(),userCustomTagManual:a.customTag,externalLink:i()().find("http").maybe("s").then("://").beginCapture().anythingBut("/ ").endCapture().beginCapture().anythingBut(" ").then("/").beginCapture().anythingBut("? ").endCapture().anythingBut(" \n").then("\\n").endCapture(),url2transform:i()().find("!").beginCapture().find("http").maybe("s").then("://").beginCapture().anything().endCapture().endCapture(),searchFolder:i()().find(" /").anything().endOfLine(),searchFolderNoSpace:i()().find("/").anything().endOfLine(),firstPartImg:i()().find("![").anythingBut("[]").then("]("),hashtag3:i()().find(/[-| |\n]{1}\#([A-z\xc0-\xfa1-9_\-]+)/gi),titleMd:i()().startOfLine().find("#").oneOrMore().then(" ").beginCapture().anythingBut("").endCapture(),scriptHtml:i()().find("<script>").beginCapture().anythingBut("").endCapture().then("<\/script>")}},311:function(t,e){function n(t){var e=new Error("Cannot find module '"+t+"'");throw e.code="MODULE_NOT_FOUND",e}n.keys=function(){return[]},n.resolve=n,t.exports=n,n.id=311},312:function(t,e){},32:function(t,e,n){"use strict";n.d(e,"b",(function(){return a})),n.d(e,"a",(function(){return r}));var o=n(390),i=n(115),c=n(0);function a(cb,t){var e=Object(c.useRef)(cb);return Object(c.useEffect)((function(){e.current=cb})),Object(c.useCallback)(Object(o.a)((function(){return e.current.apply(e,arguments)}),t,{leading:!0,trailing:!1}),[t])}function r(cb,t){var e=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n={leading:!1,trailing:!0};e&&(n.leading=e);var o=Object(c.useRef)(cb),a=function(){var t=Object(c.useRef)(!0);return Object(c.useEffect)((function(){return function(){t.current=!1}}),[]),function(){return t.current}}();return Object(c.useEffect)((function(){o.current={cb:cb,delay:t}})),Object(c.useCallback)(Object(i.a)((function(){var e;o.current.delay===t&&a()&&(e=o.current).cb.apply(e,arguments)}),t,n),[t,i.a])}},33:function(t,e,n){"use strict";n.d(e,"d",(function(){return i})),n.d(e,"c",(function(){return c})),n.d(e,"b",(function(){return r})),n.d(e,"a",(function(){return l}));n(440);var o=n(6),i=function(t){return'<i class="ssr-icon fa-solid fa-'.concat(t,'"></i>')};window.ssrActionsDic={};var c=function(t,e){var n="window.ssrActionsDic['".concat(t,"'](this)"),o=window.ssrActionsDic;return o[t]||(o[t]=function(t){e(t)}),n},a=function(t,e){var n="ressource-preview-status-".concat(t.path),o=e.indexOf("token=");return o>-1&&(e=e.substring(0,o)),{cacheId:n,idRess:"".concat(t.path,"-").concat(e)}},r=function(t,e,n){var i=a(t,e),c=i.cacheId,r=i.idRess;Object(o.d)((function(t){t.cache.get(c,(function(e){e||(e={}),e[r]=n,t.cache.set(c,e,-1)}))}))},l=function(t,e,n){!function(t,e,cb){var n=a(t,e),i=n.cacheId,c=n.idRess;Object(o.d)((function(t){t.cache.get(i,(function(t){if(t){var e=t[c]?t[c]:"closed";cb(e)}}))}))}(t,e,(function(t){"open"===t&&setTimeout((function(){n()}),500)}))}},35:function(t,e,n){"use strict";n.d(e,"a",(function(){return s})),n.d(e,"c",(function(){return u})),n.d(e,"d",(function(){return d})),n.d(e,"b",(function(){return p}));var o=n(3),i=n(103),c=n(6),a=n(57),r=n(98),l=n(28),s=function(t,e){i&&i.bind&&i.bind(t,e)},u=function(t,e){i&&i.bind&&i.unbind(t,e)},d=function(){i&&i.bind&&i.releaseAllKeys()},p=function(t){var e=t.split("\n");return(e=e.filter((function(t){return""!==t.trim()}))).map((function(t){var e,n,i=t.split("|").map((function(t){return t.trim()})),s=Object(o.a)(i,3),u=s[0],d=s[1],p=s[2],f=d,b=function(){};return"toggle_note"===f?(n=p,b=function(){Object(c.d)((function(t){var e=n,o=Object(a.c)(e),i="floating-panel-".concat(o);t.ui.floatingPanel.toggleFile(e,{idpanel:i})}))}):"highlight_to_ai"===f?(e=p,b=function(){console.log("CM",r.c,e);var t=r.c.lastCMSelection.selectionContent;if(""===t&&(t=r.c.lastCMSelection.lineContent),""===t)return console.warn("[highlight to ai] No text selected");Object(c.d)((function(n){n.ai.search(t,e)}))}):b=function(){Object(l.d)('[custom shortcuts] command not found: "'.concat(f,'"'),"error_shortcut_id")},{shortcut:u,func:b,command_name:f,command_content:p}}))}},38:function(t,e,n){"use strict";n.d(e,"a",(function(){return o})),n.d(e,"b",(function(){return i}));var o=function(){var t=(new Date).getTime(),e="undefined"!==typeof performance&&performance.now&&1e3*performance.now()||0;return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(n){var o=16*Math.random();return t>0?(o=(t+o)%16|0,t=Math.floor(t/16)):(o=(e+o)%16|0,e=Math.floor(e/16)),("x"===n?o:3&o|8).toString(16)}))},i=function(t){var e=t,n=e.split("?")[1]||"",o=e.split("?")[0],i=o.replace(/[^\w\s]/gi,"_"),c=n.replace(/[^\w\s]/gi,"_"),a=o.split(".").pop()||"";((a="."+a.replace(/[^\w\s]/gi,"_")).length>6||a.length<=1)&&(a="");var r="".concat(i,"_").concat(c);return r.length>200&&(r=r.slice(0,200)),"".concat(r).concat(a)}},382:function(module,__webpack_exports__,__webpack_require__){"use strict";__webpack_require__.d(__webpack_exports__,"a",(function(){return useRessourceApi}));var _home_u1_dev_tiro_notes_client_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__(11),react__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__(0),react__WEBPACK_IMPORTED_MODULE_1___default=__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__),_shared_helpers_id_helper__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__(38),_shared_shared_config__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__(17),_managers_sockets_socket_manager__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__(14),_app_loginToken_hook__WEBPACK_IMPORTED_MODULE_5__=__webpack_require__(18),_api_hook__WEBPACK_IMPORTED_MODULE_6__=__webpack_require__(6),_managers_url_manager__WEBPACK_IMPORTED_MODULE_7__=__webpack_require__(46),lodash_es__WEBPACK_IMPORTED_MODULE_8__=__webpack_require__(30),_managers_ressource_manager__WEBPACK_IMPORTED_MODULE_9__=__webpack_require__(232),_managers_devCli_manager__WEBPACK_IMPORTED_MODULE_10__=__webpack_require__(28),_managers_tryCatch_manager__WEBPACK_IMPORTED_MODULE_11__=__webpack_require__(383),_managers_apiDocumentation_manager__WEBPACK_IMPORTED_MODULE_12__=__webpack_require__(24);const h="[RESSOURCE API] ",useRessourceApi=p=>{const _p=Object(_home_u1_dev_tiro_notes_client_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0__.a)({},p),eventBus=_p.eventBus;Object(react__WEBPACK_IMPORTED_MODULE_1__.useEffect)((()=>{_managers_sockets_socket_manager__WEBPACK_IMPORTED_MODULE_4__.b.on("getRessourceApiAnswer",(t=>{eventBus.notify(t.idReq,t)})),_managers_sockets_socket_manager__WEBPACK_IMPORTED_MODULE_4__.b.on("getRessourceScan",(t=>{eventBus.notify(t.idReq,t)}))}),[]);const deleteRessource=(t,cb)=>{const e=Object(_api_hook__WEBPACK_IMPORTED_MODULE_6__.c)("delete-ressource");console.log("".concat(h," delete ressource ").concat(t)),p.eventBus.subscribe(e,cb),_managers_sockets_socket_manager__WEBPACK_IMPORTED_MODULE_4__.b.emit("askRessourceDelete",{path:t,idReq:e,token:Object(_app_loginToken_hook__WEBPACK_IMPORTED_MODULE_5__.b)()})},downloadRessource=(t,e,cb,n)=>{const o=Object(_api_hook__WEBPACK_IMPORTED_MODULE_6__.c)("download-ressource");p.eventBus.subscribe(o,cb),_managers_sockets_socket_manager__WEBPACK_IMPORTED_MODULE_4__.b.emit("askRessourceDownload",{url:t,folder:e,idReq:o,opts:n,token:Object(_app_loginToken_hook__WEBPACK_IMPORTED_MODULE_5__.b)()})},frontendFetch=(t,cb)=>{Object(_api_hook__WEBPACK_IMPORTED_MODULE_6__.d)((e=>{t.startsWith("/")&&(t="".concat(window.location.origin).concat(t),console.log(h,"FETCHING => updated URL to absolute path",{url:t})),t.includes("{custom_api_token}")&&(t=t.replace("{custom_api_token}",e.config.getCustomApiToken()+"&"||!1),console.log(h,"FETCHING => updated URL with custom backend token",{url:t}));let n="";fetch(t).then((t=>t.text())).then((t=>{n=t,cb(n)})).catch((e=>{console.error(h,"FRONTEND FETCHING => error",{url:t,err:e,respTxt:n}),Object(_managers_devCli_manager__WEBPACK_IMPORTED_MODULE_10__.d)("FRONTEND FETCHING => error (check console for more infos) ".concat(JSON.stringify({url:t,err:e,respTxt:n})))}))}))},fetchRessource=(t,cb,e)=>{Object(_api_hook__WEBPACK_IMPORTED_MODULE_6__.d)((n=>{e||(e={}),e.disableCache||(e.disableCache=!1),e.returnsPathOnly||(e.returnsPathOnly=!1),"false"===e.disableCache&&(e.disableCache=!1),"true"===e.disableCache&&(e.disableCache=!0),t.startsWith("/")&&(t="".concat(window.location.origin).concat(t),console.log(h,"FETCHING => updated URL to absolute path",{url:t,options:e})),t.includes("{custom_api_token}")&&(t=t.replace("{custom_api_token}",n.config.getCustomApiToken()+"&"||!1),console.log(h,"FETCHING => updated URL with custom backend token",{url:t,options:e})),!0===e.disableCache&&console.log(h,"FETCHING => disableCache is true",{url:t,options:e});const o=e.persistentCache?"/.tiro/cache/fetch-persistent/":"/.tiro/cache/fetch/";let i=Object(_managers_ressource_manager__WEBPACK_IMPORTED_MODULE_9__.a)("/".concat(o).concat(Object(_shared_helpers_id_helper__WEBPACK_IMPORTED_MODULE_2__.b)(t)));const c=()=>{fetch(i).then((function(t){return t.text()})).then((function(t){Object(_managers_tryCatch_manager__WEBPACK_IMPORTED_MODULE_11__.a)((()=>cb(t,i)))}))},a=()=>{cb(i)},r=()=>{downloadRessource(t,o,(t=>{var n;t.message&&(null!==(n=e)&&void 0!==n&&n.returnsPathOnly?a():c())}),e)};!0===e.disableCache?r():Object(_managers_url_manager__WEBPACK_IMPORTED_MODULE_7__.a)({url:i,onSuccess:()=>{var t;null!==(t=e)&&void 0!==t&&t.returnsPathOnly?a():c()},onFail:()=>{r()}})}))},fetchUrlArticle=(url,cb,options)=>{const readabilityUrl="https://cdn.jsdelivr.net/npm/moz-readability@0.2.1/Readability.js";fetchRessource(readabilityUrl,(readabilityTxt=>{const r1=eval(readabilityTxt);fetchRessource(url,(t=>{var e=document.implementation.createHTMLDocument("");e.open(),e.write(t),e.close();var n=new r1(e).parse();let o=(null===n||void 0===n?void 0:n.textContent.replaceAll(" ","\n"))||"";o=o.replaceAll(" ","\n"),o=o.replaceAll(" ","\n"),o=o.replaceAll(" ","\n"),o=o.replaceAll(" ","\n");let i=(null===n||void 0===n?void 0:n.content)||"",c=(null===n||void 0===n?void 0:n.title)||"";cb({title:c,text:o,html:i,raw:t})}))}))},ramFetchEvalCache={val:{}},fetchEval=(t,e,n,cb)=>{n||(n={}),n.disableCache||(n.disableCache=!1),"true"===n.disableCache&&(n.disableCache=!0),console.log(h,"fetchEval",t,e,n);const o=n=>{try{const t=[],o=[];Object(lodash_es__WEBPACK_IMPORTED_MODULE_8__.a)(e,((e,n)=>{t.push(n),o.push(e)}));let i=new Function(...t,n)(...o);cb&&cb(i)}catch(o){let e="[ERR remote code] (api.ress.fetchEval): ".concat(o," <br> url: ").concat(t," (more infos in console)");Object(_managers_devCli_manager__WEBPACK_IMPORTED_MODULE_10__.d)("".concat(e),"err_remote_".concat(t))}};!0===n.disableCache&&(ramFetchEvalCache.val[t]=null),ramFetchEvalCache.val[t]&&!0!==n.disableCache?o(ramFetchEvalCache.val[t]):fetchRessource(t,(e=>{o(e),ramFetchEvalCache.val[t]=e}),n)},cleanCache=()=>{ramFetchEvalCache.val={},Object(_api_hook__WEBPACK_IMPORTED_MODULE_6__.d)((t=>{t.folders.delete("cache","fetch")}))},scanFolder=(t,cb)=>{_shared_shared_config__WEBPACK_IMPORTED_MODULE_3__.a.client.log.socket&&console.log("[CLIENT API] get ressources files ".concat(t));const e=Object(_api_hook__WEBPACK_IMPORTED_MODULE_6__.c)("get-ressources-files-");p.eventBus.subscribe(e,cb),_managers_sockets_socket_manager__WEBPACK_IMPORTED_MODULE_4__.b.emit("askRessourceScan",{folderPath:t,token:Object(_app_loginToken_hook__WEBPACK_IMPORTED_MODULE_5__.b)(),idReq:e})},compressImage=(t,cb)=>{const e=Object(_api_hook__WEBPACK_IMPORTED_MODULE_6__.c)("compress-image");console.log("".concat(h," compress image ").concat(t.path)),p.eventBus.subscribe(e,cb||(()=>{})),_managers_sockets_socket_manager__WEBPACK_IMPORTED_MODULE_4__.b.emit("askRessourceImageCompress",{params:t,idReq:e,token:Object(_app_loginToken_hook__WEBPACK_IMPORTED_MODULE_5__.b)()})},unzipFile=(t,e,cb,n)=>{n||(n={overwriteWarn:!0});const o=Object(_api_hook__WEBPACK_IMPORTED_MODULE_6__.c)("unzip-file");console.log("".concat(h," unzip file ").concat(t," to ").concat(e));const i=()=>{p.eventBus.subscribe(o,cb||(()=>{})),_managers_sockets_socket_manager__WEBPACK_IMPORTED_MODULE_4__.b.emit("askRessourceUnzip",{path:t,folder:e,idReq:o,token:Object(_app_loginToken_hook__WEBPACK_IMPORTED_MODULE_5__.b)()})};Object(_api_hook__WEBPACK_IMPORTED_MODULE_6__.d)((o=>{var c;null!==(c=n)&&void 0!==c&&c.overwriteWarn?o.popup.confirm('\n\t\t\t\t\t\tAre you sure you want to unzip <br>\n\t\t\t\t\t\t"'.concat(t,'" to <br>\n\t\t\t\t\t\t"').concat(e,'"? <br>\n\t\t\t\t\t\tIt will overwrite any existing files.'),(()=>{i()})):i()}))},ressourceApi={documentation:()=>"",delete:deleteRessource,download:downloadRessource,compressImage:compressImage,scanFolder:scanFolder,fetch:fetchRessource,frontendFetch:frontendFetch,unzipFile:unzipFile,fetchEval:fetchEval,fetchUrlArticle:fetchUrlArticle,cleanCache:cleanCache};return ressourceApi.documentation=()=>Object(_managers_apiDocumentation_manager__WEBPACK_IMPORTED_MODULE_12__.a)(ressourceApi,"api.ressource","client/src/hooks/api/ressource.api.hook.tsx"),ressourceApi}},383:function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var o=n(28),i=function(t){try{t()}catch(e){Object(o.d)("".concat(e))}}},42:function(t,e,n){"use strict";n.d(e,"g",(function(){return b})),n.d(e,"f",(function(){return g})),n.d(e,"e",(function(){return h})),n.d(e,"a",(function(){return m})),n.d(e,"d",(function(){return v})),n.d(e,"c",(function(){return w})),n.d(e,"b",(function(){return O})),n.d(e,"h",(function(){return j}));n(0);var o=n(17),i=n(31),c=n(57),a=n(14),r=n(95),l=n(92),s=n(221),u=n(76),d=(n(30),n(157)),p=n(122),f=n(1),b=function(t){return Object(r.d)(t,i.a.externalLink3,(function(t){return Object(d.a)(t,{addLineJump:!0})}))},g=function(t,e){var n=Object(u.a)("$1","$2",null,t,!0);return e.replace(i.a.linklink,n)},h=function(t){var e=t.replace(i.a.searchlink,'<a class="search-link preview-link" href="javascript:window.tiroCli.triggerSearch.func(\'$1$2\');">$1</a>');return e=Object(c.a)(e,[[">[__id_",">["],[">[__tags_",">["],[">[__tag_",">["],[" ]</a>","]</a>"]])},m=function(t){var e=t.replace("".concat(Object(a.c)(),"/").concat(o.a.path.staticResources,"/"),"");e=t.replace("".concat(o.a.path.staticResources),"");var n="".concat(Object(a.c)(),"/").concat(o.a.path.staticResources,"/").concat(e);return t.startsWith("http")?t:n},v=function(t,e,n){var o=0,c=Object(r.d)(n,i.a.ressource,(function(n){o++;"".concat(n,"-").concat(o);var i="".concat(function(t,e,n){return Object(s.renderToString)(Object(f.c)(l.a,{markdownTag:t,file:e,windowId:n}))}(n,t,e)," ");return i}));return c},w=function(t,e){return Object(r.d)(e,i.a.image,(function(e){var n=e.split("](")[1].slice(0,-1);return Object(p.a)(e,n,t)}))},O=function(t){return t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")},j=function(t){return t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,'"').replace(/'/g,"'")}},428:function(t,e){},431:function(t,e){},432:function(t,e){},433:function(t,e){},434:function(t,e){},435:function(t,e){},436:function(t,e){},45:function(t,e,n){"use strict";n.d(e,"a",(function(){return f}));var o=n(8),i=n(9),c=n(26),a=n(27),r=n(13),l=n(28),s=function(t){Object(c.a)(n,t);var e=Object(a.a)(n);function n(t,i,c,a){var r;return Object(o.a)(this,n),(r=e.call(this)).match=t,r.view=i,r.pos=c,r.replacement=a,r}return Object(i.a)(n,[{key:"toDOM",value:function(){return this.replacement({matchs:this.match,view:this.view,pos:this.pos})}},{key:"estimatedHeight",get:function(){return 500}}]),n}(r.g),u={};Object(l.a)("code_mirror","cache_get",(function(){return u}));var d=function(t,e,n,o,i){return new r.e({regexp:t,decoration:function(t,c,a){var l,d=t.input+t.index,p=n.path+o;if(u[p]||(u[p]={}),u[p][d])l=u[p][d];else{var f=new s(t,c,a,e),b=r.a.replace({widget:f});u[p][d]=b,!1===i?(delete u[p][d],l=b):l=u[p][d]}return l}})},p=function(t,e){return new r.e({regexp:t,decoration:function(t,n,o){return r.a.mark({class:e(t)})}})},f=function(t){var e,n=t.replacement,c=!1!==(null===(e=t.options)||void 0===e?void 0:e.cache);return r.f.fromClass(function(){function e(i){Object(o.a)(this,e),this.decorations=void 0,this.decorations=n?d(t.pattern,n,t.file,t.windowId,c).createDeco(i):p(t.pattern,t.classWrap).createDeco(i)}return Object(i.a)(e,[{key:"update",value:function(e){try{n&&(e.docChanged||e.viewportChanged)?this.decorations=d(t.pattern,t.replacement,t.file,t.windowId,c).updateDeco(e,this.decorations):this.decorations=p(t.pattern,t.classWrap).updateDeco(e,this.decorations)}catch(o){console.warn("[ERROR VIEWPLUGIN CM]",o,e)}}}]),e}(),{decorations:function(t){return t.decorations},provide:function(e){return r.c.atomicRanges.of((function(n){var o,i,c=(null===(o=n.plugin(e))||void 0===o?void 0:o.decorations)||r.a.none;return null!==(i=t.options)&&void 0!==i&&i.isAtomic||(c=r.a.none),c}))}})}},46:function(t,e,n){"use strict";n.d(e,"b",(function(){return p})),n.d(e,"c",(function(){return f})),n.d(e,"f",(function(){return g})),n.d(e,"e",(function(){return h})),n.d(e,"d",(function(){return v})),n.d(e,"g",(function(){return w})),n.d(e,"a",(function(){return O}));var o=n(30),i=n(29),c=n(65),a=n(6),r=n(12),l=n(220),s=n(18),u=n(171),d=n(145);const p=t=>t=(t=t.replaceAll("//","/")).replace(/(http[s]?:)\/([^/])/,"$1//$2"),f=t=>{const e=new URL(t);let n=e.hostname.replace(/^www\./,"");const o=e.pathname.split("/").filter((t=>""!==t.trim()));let i="";return o.length>0&&(i=o[o.length-1],i=i.length>20?i.substring(0,20).replace(/[^A-Za-z0-9-_\ ]/g,""):i.replace(/[^A-Za-z0-9]/g,"")),n.length>15&&(n=n.substring(0,15)),i.length>0?"".concat(n,"/").concat(i):n};let b={value:!1};const g=(t,e)=>{var n,o,c,p,f,g;if(!b.value)return;console.log("<- updateAppUrlFromActiveWindow");const h=null===t||void 0===t?void 0:t.find((t=>t.active)),w=null!==(n=null===h||void 0===h||null===(o=h.grid)||void 0===o||null===(c=o.content)||void 0===c?void 0:c.find((t=>t.active)))&&void 0!==n?n:null===h||void 0===h||null===(p=h.grid)||void 0===p||null===(f=p.content)||void 0===f?void 0:f[0],O=null===w||void 0===w||null===(g=w.file)||void 0===g?void 0:g.path,j=null===w||void 0===w?void 0:w.view;let x=v().array;x=x.filter((t=>"filepath"!==t.name&&"view"!==t.name)),O&&j&&(x.unshift({name:"filepath",value:encodeURIComponent(O)}),Object(u.a)("/favicon.png"),Object(d.a)("Tiro"),"mobile"===Object(r.a)()?x.unshift({name:"view",value:e}):x.unshift({name:"view",value:j}),m(x),Object(a.d)((t=>{t.file.getContent(O,(t=>{let e=Object(l.a)(t,Object(i.e)(O));if(e.length<1)return;let n="".concat(e[0].url).concat(Object(s.c)());const o=Object(i.e)(O).filenameWithoutExt||Object(i.e)(O).name;Object(d.a)(o,!0),Object(u.a)(n),setTimeout((()=>{Object(d.a)(o,!0)}),300)}))})))},h=t=>{var e,n;Object(u.a)("/favicon.png"),Object(d.a)("Tiro"),setTimeout((()=>{b.value=!0}),5e3);let o=v().dic;const c=null!==(e=o.filepath)&&void 0!==e&&e.value?decodeURIComponent(o.filepath.value):void 0,l=null===(n=o.view)||void 0===n?void 0:n.value;if(c&&l&&"mobile"===Object(r.a)()){const e=Object(i.e)(c);Object(a.d)((n=>{n.ui.browser.goTo(e.folder,e.name,{openIn:"activeWindow"}),t(l)}))}},m=t=>{let e="".concat(c.a.global.protocol).concat(c.a.global.url).concat(c.a.global.port,"/?");Object(o.a)(t,((n,o)=>{let i=o<t.length-1?"&":"";e+="".concat(n.name,"=").concat(n.value).concat(i)})),window.history.pushState({},document.title,e)},v=()=>{let t=[],e={};const n=window.location.search;let o=new URLSearchParams(n).entries();for(const i of o)t.push({name:i[0],value:i[1]}),e[i[0]]={name:i[0],value:i[1]};return{array:t,dic:e}},w=t=>{let e="",n=0;for(const o in t)Object.prototype.hasOwnProperty.call(t,o)&&t[o]&&(e+="".concat(0===n?"":"&").concat(o.toLowerCase(),"=").concat(t[o]),n++);return e},O=t=>{try{var e=new XMLHttpRequest;return e.open("HEAD",t.url,!1),e.send(),404!==e.status?t.onSuccess():t.onFail()}catch(n){t.onFail(n)}}},48:function(t,e,n){"use strict";n.d(e,"a",(function(){return p})),n.d(e,"b",(function(){return b}));var o=n(11),i=n(0),c=n.n(i),a=n(108),r=n(10),l=n(20),s=n(25),u=n(1),d=function(t){var e=Object(o.a)({},t),n=e.design,c=e.colors,l=e.size;n||(n="horizontal");var s=void 0===t.popup||t.popup,d=Object(a.a)("button.toolbar-button{position:relative;&.active{svg,i,span.icon-wrapper{color:",c?c[1]:r.a.colors.main,";}}svg,i,span.icon-wrapper{transform:scale(",l||1.3,");color:",c?c[0]:r.a.colors.editor.interfaceGrey,";&:hover{color:",c?c[1]:r.a.colors.main,";}}}","");return Object(i.useMemo)((function(){return Object(u.c)("div",{className:d},Object(u.c)("ul",{className:"buttons-toolbar-component ".concat(t.class," ").concat(n," ").concat(!0===s?"with-popup":"no-popup")},t.buttons.map((function(t,e){var n;return t.action&&Object(u.c)("li",{className:"".concat(t.class," btn-").concat(null===(n=t.title)||void 0===n?void 0:n.toLowerCase()),title:t.title,key:e},Object(u.c)(f,t))}))))}),[t.buttons])},p=c.a.memo(d,(function(t,e){return!1})),f=function(t){var e=Object(u.c)(c.a.Fragment,null);t.title&&(e=Object(u.c)(c.a.Fragment,null,t.title));var n=t.size?t.size:1;t.icon&&(e=t.icon.startsWith("fa")||t.icon.includes(".")?Object(u.c)(l.a,{name:t.icon,size:n,color:t.color}):Object(u.c)(l.b,{name:t.icon,size:n,color:t.color})),t.customHtml&&(e=t.customHtml);var o="toolbar-button ".concat(t.class&&t.class," ").concat(t.active&&"active");return Object(u.c)("button",{className:o,onMouseEnter:function(e){t.onHover&&t.onHover()},onClick:function(e){t.action&&t.action(e)}},Object(u.c)("div",{className:"inside-html-wrapper"},e),t.title&&Object(u.c)("div",{className:"button-title-wrapper "},t.title))},b=function(){return"\n\t\n ul.buttons-toolbar-component {\n list-style: none;\n padding: 0px;\n margin: 0px;\n button.toolbar-button {\n ".concat(r.a.els().button,";\n cursor: pointer;\n }\n\t\t\t\t&.vertical {\n\t\t\t\t\t\t.toolbar-button {\n\t\t\t\t\t\t\t\tdisplay: flex;\n\t\t\t\t\t\t\t\t&:hover {\n\t\t\t\t\t\t\t\t\t\t.inside-html-wrapper {\n\t\t\t\t\t\t\t\t\t\t\t\tsvg {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tcolor:").concat(r.a.colors.main,";\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t.button-title-wrapper {\n\t\t\t\t\t\t\t\t\t\t\t\tcolor:").concat(r.a.colors.main,";\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t.inside-html-wrapper {\n\t\t\t\t\t\t\t\t\t\t// width: 15px;\n\t\t\t\t\t\t\t\t\t\tspan {\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t.button-title-wrapper {\n\t\t\t\t\t\t\t\t\t\tmargin-left: 15px;\n\t\t\t\t\t\t\t\t\t\tfont-weight: 400;\n\t\t\t\t\t\t\t\t\t\tfont-size:").concat(Object(s.a)(1),"px;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t&.horizontal.with-popup {\n\t\t\t\t\t\t\t\tli button:hover .button-title-wrapper {\n\t\t\t\t\t\t\t\t\t\tdisplay: block;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t&.horizontal {\n\t\t\t\t\t\tdisplay: flex;\n\t\t\t\t\t\tli {\n\t\t\t\t\t\tbutton {\n\t\t\t\t\t\t\t\t.button-title-wrapper {\n\t\t\t\t\t\t\t\t\t\tdisplay: none;\n\t\t\t\t\t\t\t\t\t\topacity: 0.2;\n\t\t\t\t\t\t\t\t\t\tposition: absolute;\n\t\t\t\t\t\t\t\t\t\tbottom: 22px;\n\t\t\t\t\t\t\t\t\t\tbackground: ").concat(r.a.colors.editor.interfaceGrey,";\n\t\t\t\t\t\t\t\t\t\tcolor: black;\n\t\t\t\t\t\t\t\t\t\tpadding: 5px;\n\t\t\t\t\t\t\t\t\t\tleft: 50%;\n\t\t\t\t\t\t\t\t\t\twidth: max-content;\n\t\t\t\t\t\t\t\t\t\tfont-size: 8px;\n\t\t\t\t\t\t\t\t\t\tborder-radius: 5px;\n\t\t\t\t\t\t\t\t\t\ttransform: translateX(-50%);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t}\n }\n}\n")}},482:function(t,e){},484:function(t,e){},516:function(t,e){},518:function(t,e){},519:function(t,e){},524:function(t,e){},527:function(t,e){},53:function(t,e,n){"use strict";n.d(e,"a",(function(){return s}));var o=n(3),i=n(0),c=n(17),a=n(6),r=n(39),l=n(32);function s(t,e,n){const s=Object(i.useRef)(!1),u=Object(i.useState)(e),d=Object(o.a)(u,2),p=d[0],f=d[1],b="/".concat(c.a.path.configFolder,"/").concat(c.a.path.backendStateFolder,"/").concat(t,".md");'[BACKEND STATE] "'.concat(t,'" clientApi not loaded! Persistance system will not work correctly');Object(i.useEffect)((()=>{const cb=null!==n&&void 0!==n&&n.onInitialRefresh?n.onInitialRefresh:void 0;h(cb)}),[]);const g=Object(l.a)((t=>{Object(a.d)((e=>{e.history.save(b,t,"int")}))}),6e4),h=cb=>{Object(a.d)((o=>{o.file.getContent(b,(o=>{let i;if("NO_FILE"===o)i=e;else try{i=JSON.parse(o)}catch(c){console.error("[BACKEND STATE] Error parsing JSON for ".concat(t),c)}void 0!==i&&(!0===(null===n||void 0===n?void 0:n.debug)&&console.log("[BACKEND STATE] refreshValFromBackend: ".concat(t," => "),i),f(i),s.current=!0,cb&&cb(i))}))}))};return[p,e=>{if(!s.current&&!0!==(null===n||void 0===n?void 0:n.editIfNotLoaded))return console.error("BACKEND VAR: var ".concat(t," not loaded yet"));const o=Object(r.a)(e);f(Object(r.a)(o)),!0===(null===n||void 0===n?void 0:n.debug)&&console.log("[BACKEND STATE] setValue: ".concat(t," => "),o);let i=JSON.stringify(o);const c=!(null===n||void 0===n||!n.debouncedSave)&&(null===n||void 0===n?void 0:n.debouncedSave),l=!0===(null===n||void 0===n?void 0:n.debouncedSaveWithThrottle);Object(a.d)((t=>{t.file.saveContent(b,i,{debounced:c,withThrottle:l})})),!0===(null===n||void 0===n?void 0:n.history)&&g(i)},h]}},54:function(t,e,n){"use strict";n.d(e,"a",(function(){return b})),n.d(e,"b",(function(){return g}));var o=n(8),i=n(9),c=n(26),a=n(27),r=n(0),l=n.n(r),s=n(10),u=n(12),d=n(108),p=n(20),f=n(1),b=function(t){Object(c.a)(n,t);var e=Object(a.a)(n);function n(){var t;Object(o.a)(this,n);for(var i=arguments.length,c=new Array(i),a=0;a<i;a++)c[a]=arguments[a];return(t=e.call.apply(e,[this].concat(c))).canBgClose=!0!==t.props.disableBgClose,t.cssStr=t.props.cssStr?t.props.cssStr:"",t.disableBg=!0===t.props.disableBg,t}return Object(i.a)(n,[{key:"render",value:function(){var t=this;return Object(f.c)("div",{className:"".concat(Object(d.a)(this.cssStr,";","")," popup-wrapper-component")},Object(f.c)("div",{className:"popup-wrapper ".concat(Object(u.d)()?"ipad":"")},Object(f.c)("div",{className:"popupTitle"}," ",this.props.title," "),Object(f.c)("div",{className:"popupContent"},this.props.children),this.disableBg&&Object(f.c)("div",{className:"close-popup",onClick:function(e){t.canBgClose&&t.props.onClose()}}," ",Object(f.c)(p.b,{name:"circle-xmark",color:"white"}))),!this.disableBg&&Object(f.c)("div",{className:"overlay-click-popup",onClick:function(e){t.canBgClose&&t.props.onClose()}}))}}]),n}(l.a.Component),g=function(){return"\n.popup-wrapper-component {\n\t\t\t\tposition: absolute;\n top: 0px;\n left: 0px;\n white-space: pre;\n\n .overlay-click-popup {\n position: fixed;\n z-index:10000;\n top: 0px;\n left: 0px;\n width: 100%;\n height: 100%;\n background: rgba(0,0,0,0.1);\n }\n .close-popup {\n position: absolute;\n top: -3px;\n right: 1px;\n cursor: pointer;\n padding: 10px;\n\n }\n .popup-wrapper {\n overflow-y: auto;\n position: fixed;\n z-index:10001;\n left: 50%;\n top:50%;\n &.ipad {\n top:20%;\n }\n max-height: 70%;\n \n width : auto;\n max-width: 90%;\n transform:translate(-50%,-50%);\n\t\t\t\tbackground: ".concat(s.a.colors.bgPopup,";\n border-radius:6px;\n box-shadow: 0px 0px 5px rgba(0,0,0,.2);\n .popupTitle {\n margin: 0px 0px 20px 0px;\n text-align: left;\n background: ").concat(s.a.colors.main,";\n color: white;\n font-weight: 700;\n text-transform: uppercase;\n font-size: 14px;\n padding: 5px 0px 5px 20px;\n border-radius:6px 6px 0px 0px;\n }\n .popupContent {\n padding: 0px 20px 20px 20px;\n // min-width : 350px;\n // height: calc(100% - 69px);\n height: calc(100% - 69px);\n \n }\n img{\n padding: 0px 5px 0px 0px;\n margin: 5px 5px 0px 0px;\n }\n }\n}\n")}},547:function(t,e){},563:function(t,e){},566:function(t,e){},57:function(t,e,n){"use strict";n.d(e,"c",(function(){return o})),n.d(e,"d",(function(){return i})),n.d(e,"b",(function(){return c})),n.d(e,"a",(function(){return a}));var o=function(t){var e=t;return e=(e=a(e,[["-",""],["_",""],[" ",""],["/",""],[".md",""],[":",""],["?",""]])).toLowerCase()},i=function(t,e){var n;return e||(e={accents:!0,specialChars:!0,escapeChars:!0}),e.accents||(e.accents=!0),e.specialChars||(e.specialChars=!0),e.escapeChars||(e.escapeChars=!0),e.specialChars||(t=function(t){var e=t.normalize("NFKD"),n={"\u0153":"oe","\u0152":"OE","\xe6":"ae","\xc6":"AE","\u2013":"-","\u2014":"-","\u2026":"...","\u2018":"'","\u2019":"'","\u201c":'"',"\u201d":'"',"\xab":'"',"\xbb":'"'," ":" "};return e.replace(/[\u0153\u0152\xe6\xc6\u2013\u2014\u2026\u2018\u2019\u201c\u201d\xab\xbb ]/g,(function(t){return n[t]||t})).normalize("NFC")}(t)),e.accents||(t=(n=t)?n.normalize("NFD"):""),t=t.replace(/[\u0300-\u036f]/g,"").replace(/[\u2019\u2018`]/g,"'").replace(/["\u201c\u201d]/g,"'").replace(/[\xab\xbb]/g,"'").replace(/[\u2013\u2014]/g,"-").replace(/'/g,"\u2019").replace(/"/g,"\u2019"),e.escapeChars&&(t=t.replace(/"/g,'\\"').replace(/'/g,"\\'")),t},c=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"_";return(t=a(t,[["-",e],["_",e],[" ",e],["/",e]])).replace(/[^\w\s]/gi,"")},a=function(t,e){for(var n=0;n<e.length;n++){var o=e[n];t=t.split(o[0]).join(o[1])}return t}},58:function(t,e,n){"use strict";n.d(e,"a",(function(){return O}));var o=n(16),i=n(13),c=n(2),a=n(17),r=n(223),l=n(30),s=n(7),u=n(114),d=n(84),p=n(31),f="[Code Mirror]",b=a.a.client.log.verbose,g=function(t,e){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];b&&console.log(f," update cursor",e,t);try{n&&t.view.dispatch({selection:{anchor:e,head:e},scrollIntoView:!0})}catch(o){console.warn(f,"update Cursor error",o)}},h=function(t){if(!(t&&t.view&&t.view.state))return null;var e=t.view.state.doc.lineAt(t.view.state.selection.main.head).number-1,n=function(t){return t.view.state.selection.ranges[0].from}(t),o=t.view.state.doc.toString().split("\n");return{lines:o,currentPosition:n,activeLine:o[e]||"",lineIndex:e,activeLinePos:-1}},m=function(t){if(!t.view)return-1;for(var e=t.view.state.doc.toString(),n=t.view.lineBlockAtHeight(t.view.scrollDOM.scrollTop),o=(t.view.lineBlockAtHeight(t.view.scrollDOM.scrollTop),n.from),i=e.split("\n"),c=0,a=0,r=0;r<i.length&&(c+=i[r].length+1)<=o;r++)a=r;return a},v=function(t){var e=null===t||void 0===t?void 0:t.view;if(!e)return[];for(var n=e.state.doc.toString().split("\n"),i=[],c=0,a=0;a<n.length;a++){var r=n[a],l=r.length+1,s=Object(o.a)(r.matchAll(p.a.mdTitle)),u=c,d=u+l;if(s.length>0){var f=s[0],b=f[1].length;i[i.length-1]&&i[i.length-1].level<b&&(i[i.length-1].lastChild=!1),i.push({raw:r,matches:f,line:a,title:f[2],from:u,to:d,level:b,lastChild:!0})}c+=l}return i},w={current:""},O={getEditorInfos:function(t){var e=t,n=Math.round(e.viewState.pixelViewport.top),o=e.contentHeight,i=function(){return e.viewState.editorHeight},c=function(){return(o-i())/100};return{viewportHeight:i,contentHeight:o,visibleFirstLine:function(){var t=e.lineBlockAtHeight(n);return e.state.doc.lineAt(t.from).number},percentPx:c,currentPercentScrolled:function(){return e.viewState.pixelViewport.top/c()}}},getCurrentLineInfos:h,getScrolledLine:function(t){var e=m(t),n=t.view.state.doc.toString().split("\n"),o=n[e];return{totLine:n.length,lineNb:e,lineText:o,lines:n}},updateCursor:g,updateText:function(t,e,n){var o=t.view.state.doc.toString().length,i=t.view.state.selection.ranges[0].from;t.view.dispatch(t.view.state.update({changes:{from:0,to:o,insert:e}})),g(t,i,!0)},scrollTo:function(t,e){if(!t.view)return-1;g(t,e,!0)},scrollToLine:function(t,e){var n=t.view.state.doc.line(e);g(t,n.from,!0)},getCustomTheme:r.a,getMarkdownStructure:v,foldAllChildren:function(t){var e=v(t),n=h(t);Object(l.a)(e,(function(o,i){if(null!==t&&void 0!==t&&t.view){var c=e[i+1]?e[i+1].from-1:t.view.state.doc.length,a=o.to-1;n&&n.currentPosition>a&&n.currentPosition;try{t.view.dispatch({effects:s.p.of({from:a,to:c})})}catch(r){console.warn("ERROR FOR ".concat(o.title),r)}}}))},unfoldAllChildren:function(t){null!==t&&void 0!==t&&t.view&&Object(s.G)(t.view)},searchWord:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,o=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];if(null!==t&&void 0!==t&&t.view)try{var c=t.view;Object(u.e)(c);var a={search:e};n&&Object.assign(a,{replace:n}),w.current=e;var r=function(t){if(console.log(o,"centerToNext"),o){"next"===t&&Object(u.b)(c),"prev"===t&&Object(u.c)(c);var e=c.state.selection.main,n=e.from;e.to;c.dispatch({effects:i.c.scrollIntoView(n,{y:"center"})})}};e==w.current&&(console.log("Enabling search box with config:",a),c.dispatch({effects:u.g.of(new u.a(a))})),r("next"),setTimeout((function(){r("prev"),setTimeout((function(){r("next")}),500)}),500)}catch(l){console.log("[CM utils > search word] error:",l)}},setSelection:function(t,e){if(null!==t&&void 0!==t&&t.view)try{var n=t.view,o=[0,0];e.range&&(o=e.range),n.dispatch({selection:c.e.create([c.e.range(o[0],o[1])])})}catch(i){console.log("[CM utils > set selection] error:",i)}},undo:d.f,redo:d.e}},6:function(t,e,n){"use strict";n.d(e,"e",(function(){return vt})),n.d(e,"d",(function(){return wt})),n.d(e,"a",(function(){return Ot})),n.d(e,"f",(function(){return jt})),n.d(e,"c",(function(){return xt})),n.d(e,"b",(function(){return _t}));var o=n(16),i=n(30),c=n(133),a=n(39),r=n(212),l=n(0),s=n.n(l),u=n(38),d=n(22),p=n(142),f=n(11),b=n(29),g=n(31),h=n(141),m=n(14),v=n(18),w=n(24),O=function(t){Object(l.useEffect)((function(){m.b.on("moveFolderAnswer",(function(e){t.eventBus.notify(e.idReq,e)}))}),[]);var e={file:function(e,n,cb){var o=xt("move-file-get-files");t.eventBus.subscribe(o,cb||function(){}),console.log("[MOVEFILE] ".concat(e," -> ").concat(n)),m.b.emit("moveFile",{initPath:e,endPath:n,idReq:o,token:Object(v.b)()})},folder:function(e,n,cb){var o=xt("move-folder-get-files");t.eventBus.subscribe(o,cb||function(){}),console.log("[MOVEFOLDER] ".concat(e," -> ").concat(n)),m.b.emit("moveFolder",{initPath:e,endPath:n,idReq:o,token:Object(v.b)()})},documentation:function(){return Object(w.a)(e,"api.move","client/src/hooks/api/move.api.hook.ts")}};return e},j=n(32),x=n(115),_=n(390),k=n(70);const y=t=>{const e="[FILE API] 005363 ";Object(l.useEffect)((()=>{m.b.on("onServerTaskFinished",(e=>{t.eventBus.notify(e.idReq,{data:e})})),m.b.on("getFileContent",(e=>{e.error?t.eventBus.notify(e.idReq,{error:e.error}):t.eventBus.notify(e.idReq,Object(f.a)({},e))}))}),[]);let n={};const o=(e,cb,o)=>{const i=Object(h.a)("getFileContent "+e),c=C(e),a=xt("get-file-content");t.eventBus.subscribe(a,(e=>{if(e.error&&o&&o.onError)o.onError(e.error);else if(!e.error||o&&o.onError){if(!e.error&&(n[a]=n[a]||[],n[a][e.chunkNb]=e.chunkContent,n[a].length===e.chunksLength)){let e=n[a].join("");if(o&&o.removeMetaHeader){e=Object(k.b)(e).content}delete n[a],t.eventBus.unsubscribe(a),cb(e)}}else cb(e.error);i()}),{persistent:!0}),m.b.emit("askForFileContent",{filePath:c,token:Object(v.b)(),idReq:a})},i=Object(l.useRef)(""),c=(e,n,o,cb)=>{const c=!(!o||!o.history)&&o.history;!(!o||!o.withMetas)&&o.withMetas;let a=[],r=9e5;if(n.length>r){let t=Math.ceil(n.length/r);for(let e=0;e<t;e++){let t=e*r,o=(e+1)*r;a.push(n.slice(t,o))}}else a=[n];const l=xt("save-file-content");cb&&t.eventBus.subscribe(l,(t=>{cb&&cb(t)}));const s=C(e);for(let t=0;t<a.length;t++){const e=a[t];m.b.emit("saveFileContent",{filePath:s,chunkContent:e,chunkNb:t,chunksLength:a.length,token:Object(v.b)(),idReq:l,withCb:!!cb})}c&&(e!==i.current&&vt().then((t=>{const n=t.ui.browser.folders.current.get();if(n===Object(b.d)(e)){let e="";const i=t.ui.windows.active.get();var o;if(i)e=(null===(o=i.content.file)||void 0===o?void 0:o.name)||"";t.ui.browser.goTo(n,e)}})),t.historyApi.intervalSave(e,n),i.current=e)},a=(Object(j.a)(((t,e,n,cb)=>{c(t,e,n,cb)}),500),Object(l.useRef)({})),r=Object(l.useRef)({}),s=(t,e,n,cb)=>{const o=!(!n||!n.debounced)&&n.debounced,i=!(!n||!n.withThrottle)&&n.withThrottle,l=t.includes("/.tiro/");if(null!==n&&void 0!==n&&n.withMetas&&!l){const t=null===n||void 0===n?void 0:n.withMetas;t.modified=Date.now();const o=Object(k.b)(e),i=o.metas,c=o.content,a=i.created||t.created||Date.now();e=Object(k.a)(c,{created:a,updated:t.modified})}o?((t,e,n,o,i,cb)=>{const l=((t,e)=>"".concat(t,"-").concat(e))(n,t);a.current[l]||(a.current[l]=Object(x.a)(((t,e,n,cb)=>{c(t,e,n,cb)}),t),!0===e&&(r.current[l]=Object(_.a)(((e,n,o,cb)=>{console.log("throttledFuncs",t,e),c(e,n,o,cb)}),t))),a.current[l](n,o,i,cb),!0===e&&r.current[l](n,o,i,cb)})(o,i,t,e,n,cb):c(t,e,n,cb)},u=O({eventBus:t.eventBus}),d={getContent:o,saveContent:s,searchReplace:(t,e,n,cb)=>{wt((o=>{o.file.getContent(t,(i=>{const c=i.replaceAll(e,n);o.file.saveContent(t,c,{},(t=>{cb&&cb(t)}))}))}))},insertContent:(t,e,n,cb)=>{let i=n&&n.insertLine?n.insertLine:0;const c=n=>{let o="";i=i<0?n.split("\n").length+i:i,i<0&&(i=n.split("\n").length),i>n.split("\n").length&&(i=n.split("\n").length),o=n.split("\n").slice(0,i).join("\n")+"\n"+e+"\n"+n.split("\n").slice(i).join("\n"),s(t,o,{},(t=>{cb&&cb(t)}))};o(t,(t=>{c(t)}),{onError:t=>{console.log("file does not exists, creating it"),c("")},removeMetaHeader:!0})},delete:(n,cb)=>{const o=xt("delete-file");console.log("".concat(e," delete file ").concat(n.path)),t.eventBus.subscribe(o,cb),m.b.emit("onFileDelete",{filepath:n.path,idReq:o,token:Object(v.b)()})},move:u.file,create:(n,cb)=>{const o=xt("create-file");console.log("".concat(e," create file in ").concat(n)),t.eventBus.subscribe(o,cb),m.b.emit("createNote",{folderPath:n,idReq:o,token:Object(v.b)()})},documentation:()=>Object(w.a)(d,"api.file","client/src/hooks/api/file.api.hook.tsx")};return d},C=t=>t.replace(g.a.linklink,"$2/$1");var S=n(17),E=n(3),T=n(34),I=n(47),N=n(293),P=function(){var t=Object(I.a)(Object(T.a)().mark((function t(e){return Object(T.a)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",new Promise((function(t,n){var o={},c=[];vt().then((function(n){n.search.word("#",e,(function(e){var n=[],r={};console.log(e),Object(i.a)(e,(function(t,e){var c={file:t.file,titleName:""};Object(i.a)(t.results,(function(t,e){var l=[],s=t.match(g.a.titleMd);if(s&&s[0]){var u=s[0].split("#").join("").trim();c.titleName=u}var d=t.match(g.a.hashtag3);Object(i.a)(d,(function(t){t=t.substring(1),o[t]||(o[t]={id:Object.keys(o).length+1,name:t,lines:[],noteParts:[]}),o[t].noteParts.push(Object(a.a)(c)),o[t].lines.push(e),o[t].lines=Object(N.a)(o[t].lines);var n=c.file.name+"-"+c.titleName;r[n]||(r[n]=[]),r[n].push(o[t].id),l.push(o[t])})),Object(i.a)(l,(function(t,e){Object(i.a)(l,(function(o,i){if(e!==i){var c=t.id,a=o.id,r="".concat(c,"-").concat(a),l="".concat(a,"-").concat(c);-1===n.indexOf(r)&&-1===n.indexOf(l)&&n.push(r)}}))}))}))})),Object(i.a)(o,(function(t){c.push(t)})),t({nodesObj:o,nodesArr:c,edges:n})}))}))})));case 1:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),A=function(t){var e="[SEARCH API] ",n=Object(l.useState)(""),o=Object(E.a)(n,2),i=o[0],c=o[1];Object(l.useEffect)((function(){m.b.on("getWordSearch",(function(e){t.eventBus.notify(e.idReq,e.result)}))}),[]);var a=function(n,cb){!function(n,cb,o){var i=xt("search-".concat(o,"-"));console.log("".concat(e," searching ").concat(n," with type ").concat(o)),t.statusApi.searching.set(!0),t.eventBus.subscribe(i,(function(e){t.statusApi.searching.set(!1),cb(e)})),m.b.emit("searchFor",{term:n,token:Object(v.b)(),type:o,idReq:i})}(n,cb,"text")},r={files:{search:a},word:function(n,o,cb,i){var c=xt("search-word-");n=n.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"),console.log("".concat(e," searching WORD ").concat(n," in ").concat(o),i),t.eventBus.subscribe(c,(function(t){cb(t)})),m.b.emit("searchWord",{word:n,folder:o,options:i,token:Object(v.b)(),idReq:c})},hashtags:function(t,cb){P(t).then((function(t){cb(t)}))},ui:{search:function(t){vt().then((function(e){e.ui.browser.files.set([]),c(t),a(t,(function(t){e.ui.browser.files.set(t)}))}))},term:{set:c,get:i}},documentation:function(){return Object(w.a)(r,"api.search","client/src/hooks/api/search.hook.api.tsx")}};return r},R=n(140),F=n(28),L=n(12);var D=/((\/\/.*$)|(\/\*[\s\S]*?\*\/))/gm,M=/([^\s,]+)/g,z=n(96),B=function(t){var e=Object(l.useState)(null),n=Object(E.a)(e,2),o=n[0],i=n[1],c=s.a.useRef(null),a=function(t){t.windowId&&"active"!==t.windowId&&(t.noteParentType="any"),t.windowId||(t.windowId="active"),t.noteParentType||(t.noteParentType="grid"),t.insertPos||(t.insertPos="currentPos"),c.current=Object(u.a)(),t.uuid=c.current,i(t)},r=Object(f.a)(Object(f.a)({},z.b),{},{ui:{lineJump:{jump:function(t,e){a({type:"lineJump",windowId:t,lineJumpNb:e})}},editorAction:{dispatch:a,get:o,canExecuteAction:function(t){return t.uuid===c.current&&(c.current=null,!0)}}}});return r.ui.documentation=function(){return Object(w.a)(r,"api.note","client/src/hooks/api/note.api.hook.tsx")},r},W=n(382),U=n(57),H=n(158);const q="/".concat(S.a.path.configFolder,"/").concat(S.a.path.cacheFolder,"/cache-api"),V="[CACHE API]";let G=S.a.client.log.verbose,J=S.a.client.log.verbose;const K=()=>(new Date).getTime(),Y=t=>{let e=t-K()<0;return G&&console.log(V,"isExpired? : ",e,(t-K())/6e4,"mins"),e},$=t=>{const e=t=>"".concat(q,"/cache-api-storage-").concat(Object(U.b)(t),".md"),n=Object(l.useRef)({}),o=(t,e,o)=>{var i;n.current[t]={content:e,until:(i=o,K()+60*i*1e3)}},i=8e5,c="__CHUNKED__CACHED__OBJ__SIZE:",a="[CACHE CHUNK]",r=function(t,n,o){const r=arguments.length>3&&void 0!==arguments[3]&&arguments[3]?JSON.stringify(n,null,"\t"):JSON.stringify(n),l=(t,n,cb)=>{J&&console.log(a,e(t),{str:n}),wt((o=>{o.file.saveContent(e(t),"".concat(n),{},(t=>{cb(t)}))}))};if(!(r.length>i))return l(t,r,(()=>{o&&o()}));{let e=(s=i,r.match(new RegExp(".{1,"+s+"}","g")));J&&console.log(a,"SAVE >> TOO LARGE, split in ".concat(e.length," parts"),{cacheId:t,contentArr:e});let n=0;const u=()=>{n++,n===e.length-1&&o&&o()};l(t,"".concat(c).concat(e.length),u);for(let o=0;o<e.length;o++)setTimeout((()=>{l("c".concat(o,"_").concat(t),e[o],u)}),1e3*o)}var s},s=(t,cb,n)=>{const o=(t,n,o)=>{wt((i=>{i.file.getContent(e(t),n,{onError:o})}))},i="___ERROR___CHUNK___LOADING___FAILURE";o(t,(e=>{try{if(e.startsWith(c)){let r=parseInt(e.replaceAll(c,""));J&&console.log(V,"GET >> remerging a ".concat(r," part"),{cacheId:t}),((e,n,c,r)=>{const l=Object(h.a)("".concat(V," getAllChunksAndMerge"));let s=[],u=0;const d=e=>{if(e===n){let e=s.join(""),o=e.includes(i);J&&console.log("GET >> RESULT remerging",{hasFailed:o,cacheId:t,nbChunks:n,resMerge:e}),l(),o?r():c(e)}};for(let p=0;p<n;p++)o("c".concat(p,"_").concat(t),(e=>{s[p]=e,J&&console.log(a,"c".concat(p,"_").concat(t),{loadingCounter:u,nbChunks:n}),u++,d(u)}),(t=>{u++,s[p]=i,d(u)}))})(0,r,(t=>{cb(t)}),(t=>{n()}))}else cb(e)}catch(r){n(r)}}),(t=>{n(t)}))},u=()=>{n.current={}};let d={get:(t,cb,e)=>{if(!0===(null===e||void 0===e?void 0:e.disableRamCache)&&u(),t in n.current){let e=n.current[t],o=Y(e.until);o&&(e.content=void 0),G&&console.log(V,"FROM RAM",t," expired:",o),cb(e.content)}else s(t,(e=>{try{const o=JSON.parse(e);n.current[t]=Object(f.a)({},o);let i=n.current[t],c=Y(i.until);c&&(i.content=void 0),G&&console.log(V,"FROM FILE",t," expired:",c),cb(i.content)}catch(i){G&&console.log(V,"error getting cache",i,t),o(t,void 0,60),cb(n.current[t].content)}}),(e=>"NO_FILE"===e?(G&&console.log(V,"FROM FILE: NO_FILE",t),o(t,void 0,60),cb(n.current[t].content)):cb(void 0)))},cleanCache:()=>{Object(F.d)("Cache clean started...","clean_cache"),wt((t=>{t.folders.delete("cache","ctag-ressources"),t.ressource.cleanCache(),t.cache.cleanRamCache(),Object(H.a)((t=>{Object(F.d)("Cache cleaned successfully (".concat(t,")"),"clean_cache")}))}))},set:(t,e,i,cb,c)=>{i||(i=60),-1===i&&(i=1e32),o(t,e,i);const a=n.current[t];G&&console.log(V,"SETTING",t," with cachedTime in min",i),r(t,a,(t=>{cb&&cb(t)}),null===c||void 0===c?void 0:c.uncompressed)},cleanRamCache:u,getCachePath:(t,cb)=>(cb&&cb(e(t)),e(t)),documentation:()=>Object(w.a)(d,"api.cache","client/src/hooks/api/cache.api.hook.tsx")};return d};Object(F.a)("cache","clean_cache",(()=>{wt((t=>{t.cache.cleanCache()}))}));var Z=function(t,e){var n,o,i=t.split("\n").filter((function(t){return""!==t.trim()&&t.includes("#")&&t.includes("|")&&!t.includes("# ")})),c=i.map((function(t){return t.split("|").map((function(t){return t.trim()}))})),a="";if(e)a=e;else{if(!c[0][0].startsWith("#"))return console.error("Invalid table format: no # id found"),{id:"",rows:[],config:{},cols:{},infos:{}};a=c[0][0].substring(1)}var r=c.some((function(t){return t.some((function(t){return t.includes("__header_")}))})),l=r?c.find((function(t){return t.some((function(t){return t.includes("__header_")}))})):[],s=(null===l||void 0===l?void 0:l.map((function(t){return t.replace(/^__header_/,"")})))||[];null===(n=s)||void 0===n||n.shift();var u={},d=c.filter((function(t){return t[0]==="#".concat(a)&&!t.some((function(t){return t.includes("__header_")||t.includes("__config_")}))})),p=d.reduce((function(t,e){return t.length>e.length?t:e}),[]),f=p?p.length-1:0,b=s.length;if(s&&s.length<f&&p)for(var g=s.length+1;g<p.length;g++)s.push("col".concat(g));var h=[];s.forEach((function(t,e){var n=d.some((function(t){return void 0!==t[e]&&""!==t[e]}));h.push(n)}));var m=h.lastIndexOf(!0);m>=b&&(s=s.slice(0,m+1)),null===(o=s)||void 0===o||o.forEach((function(t,e){u[t]=e}));for(var v={id:a,rows:[],config:{},cols:u,infos:{}},w=0,O=0;O<c.length;O++){var j=c[O],x=i[O];if(j[0]==="#".concat(a))if(j.some((function(t){return t.includes("__config_")})))j.map((function(t){if(t.startsWith("__config_view_")){var e=t.split("__config_view_")[1];v.config.view=e?e.trim().replace(/^"|"$/g,""):""}else if(t.startsWith("__config_add_form=")){var n=t.split("=")[1];v.config.form=n?n.trim().replace(/^"|"$/g,""):""}else if(t.startsWith("__config_hidecol_")){var o=t.split("=")[0].replace("__config_","");v.config[o]=!0}else if(t.startsWith("__config_")){var i=t.split("=")[0].replace("__config_","");v.config[i]=!0}}));else{var _={cells:{},row_id:w,line:x};if(!j.some((function(t){return t.includes("__header_")}))){if(s)for(var k=0;k<s.length;k++)_.cells[s[k]]=j[k+1];w++,v.rows.push(_),v.infos={lastColWithContentIndex:m,cleanedHeadersHasContent:h}}}}return v},X={smartTable:{getObj:Z,updateString:function(t,e){var n=Z(t),o=[];o="row_id"===e.cellId?n.rows.filter((function(t){return t.row_id===e.cellIdValue})):n.rows.filter((function(t){return t.cells[e.cellId]===e.cellIdValue}));var i=[];o.forEach((function(t){t.cells[e.updatedCell]=e.updatedCellValue;for(var o=t.line,c="#".concat(n.id," | "),a=0;a<Object.keys(n.cols).length;a++){var r=Object.keys(n.cols)[a];a<=n.infos.lastColWithContentIndex&&(c+="".concat(t.cells[r]||""," | "))}i.push({old:o,new:c})}));for(var c=t,a=0;a<i.length;a++)c=c.replace(i[a].old,i[a].new);return{stringUpdated:c,tableObj:n}}}},Q=n(173),tt=n(292),et=n(111),nt=n(256),ot=n(37),it="[PLUGINS]",ct=n(242);const at={obj:null};let rt={play:(t,e)=>{wt((n=>{var o,i,c;let a=null===(o=null===e||void 0===e?void 0:e.cache)||void 0===o||o;i=null===e||void 0===e?void 0:e.start,c=null===e||void 0===e?void 0:e.time;n.ressource.fetch(t,((t,e)=>{const n=e||t;at.obj=new Audio(n),at.obj.load(),at.obj.play(),at.obj.onprogress=()=>{},console.log("[AUDIO] Playing:",n,"audio object in window.__tiro_audio_obj_curr__"),window.__tiro_audio_obj_curr__=at}),{returnsPathOnly:!0,disableCache:!a})}))},stop:()=>{at.obj.pause(),at.obj.currentTime=0},documentation:()=>Object(w.a)(rt,"api.audio","client/src/managers/audio.manager.ts")};const lt=rt;var st=n(131),ut=n(75),dt=function(t){var e=Object(ut.c)();return t||(t=e[0].title),e.find((function(e){return e.title===t}))},pt=function(t,e,cb){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"single",o=dt(e);if(o){var i=o.command;t=Object(ut.b)(t),i=i.replace("{{input}}",t),wt((function(t){"stream"===n?t.command.stream(i,(function(t){cb&&cb(t)})):t.command.exec(i,(function(t){cb&&cb(t)}))}))}else Object(F.d)('Model "'.concat(e,'" not found in config'))},ft=function(t,e){var n=dt(e);if(n){var o=ht("new");n.typeAnswer="newWindow",Object(ut.a)({uuid:o,typeAnswer:n.typeAnswer,aiCommand:n.command,aiBtnConfig:n,selectionTxt:t})}else Object(F.d)('Model "'.concat(e,'" not found in config'))},bt={},gt=function(t){return bt[t]||!1},ht=function(t,e){return"new"===t&&(e=Object(u.a)(),bt[e]=!0),"stop"===t&&(e?bt[e]=!1:Object(i.a)(bt,(function(t,e){bt[e]=!1})),wt((function(t){t.ui.notification.emit({content:"[AI] AI generation stop requested",options:{hideAfter:3},id:"ai-status"})}))),console.log("setStatus",{status:t,uuid:e,aiStatusManagerDic:bt}),e||(e=""),e},mt=null,vt=function(){return new Promise((function(t,e){if(mt)return t(mt);var n=setInterval((function(){if(mt)return clearInterval(n),t(mt)}),200)}))},wt=function(cb){vt().then((function(t){cb(t)}))},Ot=s.a.createContext(null),jt=function(t){var e=Object(l.useRef)({}),n=function(t){delete e.current[t]},o={subscribe:function(t,cb,n){n||(n={}),e.current[t]||(e.current[t]=[]),e.current[t].push({cb:cb,options:n})},unsubscribe:n,notify:function(t,o){Object(i.a)(e.current,(function(e,c){c===t&&Object(i.a)(e,(function(e){try{e.cb(o)}catch(i){console.warn("[CLIENT API] error with function",i)}e.options.persistent||n(t)}))}))}};Object(l.useEffect)((function(){S.a.client.log.verbose&&console.log("[CLIENT API ]INIT ")}),[]);var c=function(t){Object(l.useEffect)((function(){m.b.on("reconnect",(function(){t.eventBus.notify(e,{isConnected:!0})})),m.b.on("reconnect",(function(){t.eventBus.notify(e,{isConnected:!0})})),m.b.on("disconnect",(function(){t.eventBus.notify(e,{isConnected:!1})}))}),[]);var e="watch-api-unique-id-request";Object(l.useEffect)((function(){m.b.on("onNoteWatchUpdate",(function(n){t.eventBus.notify(e,n)}))}),[]);var n={file:function(n,cb){t.eventBus.subscribe(e,(function(t){n===t.filePath&&cb(t)}),{persistent:!0})},appStatus:function(cb){t.eventBus.subscribe(e,(function(t){cb(t)}),{persistent:!0})},dev:{toggleIsConnected:function(n){t.eventBus.notify(e,{isConnected:n})}},documentation:function(){return Object(w.a)(n,"api.watch","client/src/hooks/api/watch.api.hook.tsx")}};return n}({eventBus:o}),a=A({eventBus:o,statusApi:t.statusApi}),r=y({eventBus:o,historyApi:t.historyApi}),s=function(t){Object(l.useEffect)((function(){m.b.on("getFiles",(function(e){t.eventBus.notify(e.idReq,e.files)})),m.b.on("getFilesPreview",(function(e){t.eventBus.notify(e.idReq,e.filesPreview)}))}),[]);var e={get:function(e,cb){S.a.client.log.socket&&console.log("[CLIENT API] get files ".concat(e));var n=xt("get-files-");t.statusApi.searching.set(!0),t.eventBus.subscribe(n,(function(n){t.statusApi.searching.set(!1),n=n.filter((function(t){return"md"===t.extension})),cb(n,e)})),m.b.emit("askForFiles",{folderPath:e,token:Object(v.b)(),idReq:n})},getPreviews:function(e,cb){var n=xt("get-files-");t.eventBus.subscribe(n,cb),m.b.emit("askFilesPreview",{filesPath:e,idReq:n,token:Object(v.b)()})},search:t.searchApi.files.search,documentation:function(){return Object(w.a)(e,"api.files","client/src/hooks/api/files.api.hook.tsx")}};return e}({eventBus:o,searchApi:a,statusApi:t.statusApi}),u=(t=>{const e=Object(f.a)({},t).eventBus;Object(l.useEffect)((()=>{m.b.on("getUploadedFile",(t=>{e.notify(t.idReq,t)}))}),[]);const n=(t,cb)=>{try{const n=xt("upload-file");e.subscribe(n,(e=>{delete e.idReq,t.onSuccess&&t.onSuccess(e),cb&&cb({message:"success",succesObj:e})})),Object(R.a)({file:t.file,path:t.folderPath,idReq:n,onProgress:e=>{t.onProgress&&t.onProgress(e)}})}catch(n){console.warn(n)}},o=Object(l.useRef)([]),c=Object(j.a)((async()=>{if(o.current.length<1)return;let t=o.current.length,e=0;if(Object(F.d)("Files Uploaded: \n ".concat(e,"/").concat(t),"upload-info"),"mobile"===Object(L.a)()){for(let i=0;i<o.current.length;i++)await new Promise(((c,a)=>{const r=o.current[i];if(console.log("uploadObj",r),!r)return a(void 0);console.log("[UPLOAD] starting upload item ".concat(r.uploadInfos.file.name)),n(r.uploadInfos,(n=>{e++;let o=e===t?5:60;Object(F.d)("Files Uploaded: \n ".concat(e,"/").concat(t),"upload-info",o),r&&r.cb&&r.cb(n),c(void 0)}))}));o.current=[]}else Object(i.a)(o.current,((o,i)=>{setTimeout((()=>{console.log("[UPLOAD] starting upload item ".concat(o.uploadInfos.file.name)),n(o.uploadInfos,(n=>{e++;let i=e===t?5:60;Object(F.d)("Files Uploaded: \n ".concat(e,"/").concat(t),"upload-info",i),o.cb&&o.cb(n)}))}),500*i)})),o.current=[]}),500),a={uploadFile:(t,cb)=>{o.current.length,Object(F.d)("Starting Uploading Files...","upload-info"),o.current.push({uploadInfos:t,cb:cb}),c()},documentation:()=>Object(w.a)(a,"api.upload","client/src/hooks/api/upload.api.hook.tsx")};return a})({eventBus:o}),g=Object(W.a)({eventBus:o}),h=function(t){Object(l.useEffect)((function(){m.b.on("getFoldersScan",(function(e){t.eventBus.notify(e.idReq,{folders:e.folders,pathBase:e.pathBase})})),m.b.on("onServerTaskFinished",(function(e){t.eventBus.notify(e.idReq,e.status)}))}),[]);var e={get:function(e,cb,n){S.a.client.log.socket&&console.log("[FOLDERS API] get folders ",e,n);var o=xt("get-folders-");t.eventBus.subscribe(o,(function(t){var n=Object(f.a)({},t);n.folderPaths=e,cb(n)})),m.b.emit("askFoldersScan",{foldersPaths:e,depth:(null===n||void 0===n?void 0:n.depth)||0,token:Object(v.b)(),idReq:o})},move:O({eventBus:t.eventBus}).folder,create:function(e,cb){console.log("[askFolderCreate]",e);var n=xt("create-folder-");e=Object(b.b)(e),cb&&t.eventBus.subscribe(n,(function(t){cb(t)})),m.b.emit("askFolderCreate",{newFolderPath:e,token:Object(v.b)(),idReq:n})},delete:p.a,documentation:function(){return Object(w.a)(e,"api.folders","client/src/hooks/api/folders.api.hook.tsx")}};return e}({eventBus:o}),x=function(t){var e="[COMMAND API]";Object(l.useEffect)((function(){m.b.on("getCommandExec",(function(e){t.eventBus.notify(e.idReq,e.resultCommand)})),m.b.on("getCommandExecStream",(function(e){t.eventBus.notify(e.idReq,e.streamChunk)}))}),[]);var n={exec:function(n,cb){console.log(e,"exec",{commandString:n});var o=xt("command-exec-");t.eventBus.subscribe(o,(function(t){Object(tt.a)(t)||(t=JSON.stringify(t)),cb(t)}),{persistent:!0}),m.b.emit("askCommandExec",{commandString:n,token:Object(v.b)(),idReq:o})},stream:function(n,cb){console.log(e,"stream",{commandString:n});var o=xt("command-stream-");t.eventBus.subscribe(o,(function(e){cb(e),e.isLast&&t.eventBus.unsubscribe(o)}),{persistent:!0}),m.b.emit("askCommandExecStream",{commandString:n,token:Object(v.b)(),idReq:o})},documentation:function(){return Object(w.a)(n,"api.command","client/src/hooks/api/command.api.hook.tsx")}};return n}({eventBus:o}),_=function(t){Object(l.useEffect)((function(){m.b.on("getBackendConfig",(function(e){t.eventBus.notify(e.idReq,e.config)}))}),[]);var e=function(cb){var e=xt("get-config-");t.eventBus.subscribe(e,(function(t){n.current=t,cb(t)})),m.b.emit("askBackendConfig",{token:Object(v.b)(),idReq:e})},n=Object(l.useRef)(void 0);Object(l.useEffect)((function(){e((function(){}))}),[]);var o={get:e,getPlatform:function t(){return t()},getCustomApiToken:function(){var t,e;return null===(t=n.current)||void 0===t||null===(e=t.jsonConfig)||void 0===e?void 0:e.customBackendApiToken},getSync:function(){return n.current},documentation:function(){return Object(w.a)(o,"api.config","client/src/hooks/api/config.api.hook.tsx")}};return o}({eventBus:o}),k=function(t){Object(l.useEffect)((function(){m.b.on("getPluginsList",(function(e){t.eventBus.notify(e.idReq,e)}))}),[]);var e=function(cb,e){e||(e={}),e.noCache||(e.noCache=!1),S.a.client.log.socket&&console.log("".concat(it," get plugins"));var n=xt("get-plugins-");t.eventBus.subscribe(n,(function(t){t.scanLog.length>0&&wt((function(e){return e.ui.notification.emit({content:"PLUGIN SCAN LOG:<br/>".concat(JSON.stringify(t.scanLog)),options:{hideAfter:60}})}));var e=Object(nt.a)(t.plugins,(function(t){return t.name}));cb(e,t.scanLog)})),m.b.emit("askPluginsList",{noCache:e.noCache,token:Object(v.b)(),idReq:n})},n={list:e,get:function(t,n,cb){e((function(e,o){var i=e.filter((function(e){return e.name===t&&e.type===n}))[0]||null;cb(i)}),{noCache:!0})},cronCache:{set:function(t,e){var n="plugins-cron-infos";wt((function(o){o.cache.get(n,(function(i){i||(i={}),i[t]||(i[t]={vars:{}}),i[t].vars=e,o.cache.set(n,i,-1)}))}))}},marketplace:{fetchList:function(cb){wt((function(t){var e=t.userSettings.get("plugins_marketplace_url"),n="".concat(it," api.plugins.marketplace.fetchList error for url: ").concat(e," :");t.ressource.fetch(e,(function(t){try{var o=JSON.parse(t),c=[];Object(ot.a)(o)?(Object(i.a)(o,(function(t){var e={name:"",description:"",versions:[],configuration:[]};t.name&&(e.name=t.name),t.description&&(e.description=t.description),t.versions&&(e.versions=t.versions),t.images&&(e.images=t.images),t.icon&&(e.icon=t.icon),t.configuration&&(e.configuration=t.configuration),""!==e.name&&c.push(e)})),cb(c)):Object(F.d)("".concat(n,": did not find a plugin list"))}catch(a){Object(F.d)("".concat(n," ").concat(JSON.stringify(a),", url: ").concat(e))}}),{disableCache:!0})}))}},documentation:function(){return Object(w.a)(n,"api.plugins","client/src/hooks/api/plugin.api.hook.tsx")}};return n}({eventBus:o}),C=$(),E=Object(ct.b)({}),T=function(){var t={get:function(cb){var t=setInterval((function(){m.b&&(cb(m.b),clearInterval(t))}),10)},documentation:function(){return Object(w.a)(t,"api.socket","client/src/hooks/api/socket.api.hook.ts")}};return t}(),I=Object(d.c)({eventBus:o,triggerSetupPopup:t.triggerSetupPopup}).userSettingsApi,N=Object(p.c)({searchUiApi:a.ui,statusApi:t.statusApi,filesApi:s,foldersApi:h,windowApi:t.windowsApi,tabsApi:t.tabsApi,userSettingsApi:I}),P=B(),D=Object(Q.b)({}),M=function(t){Object(l.useEffect)((function(){m.b.on("getPerformanceReport",(function(e){t.eventBus.notify(e.idReq,e)}))}),[]);var e={getReport:function(cb){var e=xt("get-perf-report");t.eventBus.subscribe(e,(function(t){cb?cb(t):(console.log("[PERF API]","report"),console.log(t.report))})),m.b.emit("askPerformanceReport",{token:Object(v.b)(),idReq:e})},documentation:function(){return Object(w.a)(e,"api.performance","client/src/hooks/api/performance.api.hook.tsx")}};return e}({eventBus:o}),z=function(t){var e="[ACTIVITY API]";Object(l.useEffect)((function(){m.b.on("getActivityReport",(function(e){t.eventBus.notify(e.idReq,e)}))}),[]);var n={getReport:function(n,cb){console.log(e,"asked for report (if no cb provided, will be outputed to console.log)",n);var o=xt("get-perf-report");t.eventBus.subscribe(o,(function(t){cb?cb(t):(console.log(e,"report"),console.log(t.report))})),m.b.emit("askActivityReport",{params:n,token:Object(v.b)(),idReq:o})},documentation:function(){return""}};return n.documentation=function(){return Object(w.a)(n,"api.activity","client/src/hooks/api/activity.api.hook.tsx")},n}({eventBus:o}),U=Object(st.b)({}),H=function(t){var e={search:ft,setStatus:ht,getStatus:gt,exec:pt,documentation:function(){return Object(w.a)(e,"api.ai","client/src/hooks/api/ai.api.hook.tsx")}};return e}(),q={cache:C,file:r,audio:lt,encryption:et.b,files:s,socket:T,popup:t.popupApi,upload:u,ressource:g,tabs:t.tabsApi,folders:h,config:_,userSettings:I,history:t.historyApi,status:t.statusApi,note:P,analytics:D,search:a,command:x,plugins:k,watch:c,performance:M,shared:{functions:X},activity:z,ai:H,ui:{browser:N,floatingPanel:U,notification:E,windows:t.windowsApi,lightbox:t.lightboxApi,textToSpeechPopup:t.ttsApi,search:a.ui,note:P.ui,notePreviewPopup:t.notePreviewPopupApi}};return mt=q,q},xt=function(t){return"client-api-".concat(t,"-req-").concat(Object(u.a)())},_t=function(t,cb){vt().then((function(e){var n=t.apiName.split("."),r=e;if(Object(i.a)(n,(function(t){r=r[t]?r[t]:null})),null===r)return cb("nok",{error:'"'.concat(t.apiName,'" does not exists in current api \n\nAvailable Api properties :\n\n').concat(yt("",e))});try{var l=kt(r);if(!Object(c.a)(l)){var s=r.apply(void 0,Object(o.a)(t.apiArguments));return cb("ok",s)}var u=Object(a.a)(t.apiArguments);u.splice(l,0,(function(t){cb("ok",t)})),r.apply(void 0,Object(o.a)(u))}catch(d){return cb("nok",{error:'error "'.concat(JSON.stringify(d),'" when executing "').concat(t.apiName,'" with props ').concat(t.apiArguments)})}}))},kt=function(t){var e=function(t){var e=t.toString().replace(D,""),n=null;return null===(n=e.startsWith("cb =>")?["cb"]:e.slice(e.indexOf("(")+1,e.indexOf(")")).match(M))&&(n=[]),n}(t),n=e.indexOf("cb");return-1===n?null:n},yt=function t(e,n){var o="";for(var c in n)if("object"===typeof n[c]&&n[c].constructor!==Array){if(c.length>1&&"get"!==c){var a=""!==e?"".concat(e,"."):"";o+=t("".concat(a).concat(c),n[c])}}else o="".concat(o).concat(e,".").concat(c,"\n");var l=o.split("\n"),s=[];return vt().then((function(t){Object(i.a)(l,(function(e){var n=e.split("."),o=t;Object(i.a)(n,(function(t,e){o[t]&&(o=o[t])}));var c="var",a="";Object(r.a)(o)&&(c="Function",a=o.toString()),s.push({name:e,type:c,description:a})}))})),o}},60:function(t,e,n){"use strict";n.d(e,"a",(function(){return w})),n.d(e,"b",(function(){return O}));var o=n(16),i=n(3),c=n(108),a=n(132),r=n(0),l=n.n(r),s=n(25),u=n(53),d=n(20),p=n(6),f=n(22),b=n(99),g=n(32),m=n(28),v=n(1),w=function(t){var e,n=Object(r.useRef)(),s=function(){t.shouldFocus&&n.current.focus()};Object(r.useEffect)((function(){s()}),[t.shouldFocus]),Object(r.useEffect)((function(){s()}),[]);var w="checkbox"===t.type&&(!0===t.value||"true"===t.value),O=t.value,j=Object(r.useState)(O),x=Object(i.a)(j,2),_=(x[0],x[1]);Object(a.a)(O)&&(O="");var k=t.type,y=function(e){var n=e;return"date"!==t.type||e||(n=(new Date).toISOString().split("T")[0]),"datetime"===t.type&&(k="datetime-local",n=(n=(new Date).toISOString().substring(0,16)).substring(0,n.length-5)+"12:00"),n}(O),C="input-lastvalue-id-".concat(t.id),S=Object(u.a)(C,""),E=Object(i.a)(S,3),T=E[0],I=E[1],N=E[2];Object(r.useEffect)((function(){t.id&&t.rememberLastValue&&N()}),[t.value]),!t.id&&t.rememberLastValue&&console.error("!!!!! Input component: rememberLastValue is true but no id is provided, cannot remember last value without id !!!!!");var P=function(){return t.id&&t.rememberLastValue};Object(r.useEffect)((function(){P()&&""!==T&&void 0!==T&&(D(T),t.onLoad&&t.onLoad(T))}),[T]);var A=Object(r.useState)(O),R=Object(i.a)(A,2),F=R[0],L=R[1],D=function(e){if(L(e),P()){if(e.length<1)return;I(e)}t.onChange&&t.onChange(e)},M=Object(r.useState)("..."),z=Object(i.a)(M,2),B=z[0],W=z[1],U=Object(r.useState)(0),H=Object(i.a)(U,2),q=H[0],V=H[1],G=Object(r.useState)(!1),J=Object(i.a)(G,2),K=J[0],Y=J[1],$=function(e){console.log("AI INSERT VAL",{val:e,fieldId:t.id}),"select"!==t.type?(t.onChange&&t.onChange(e,{changeType:"ai"}),D(e)):_(e)},Z=f.d.curr.ui_editor_ai_suggest_form_command,X=Object(r.useRef)(void 0);Object(r.useEffect)((function(){if(W(""),void 0!==t.aiSuggest&&t.aiSuggest.length>0){if(void 0===X.current)return console.log({1:t.aiSuggest,2:X.current},"AI SUGGEST INITIALIZED"),void(X.current=t.aiSuggest);console.log(t.aiSuggest,"AI SUGGEST RUNNING...");var e=t.aiSuggest;W("..."),Y(!1);var n,o="you will be outputed into a ".concat(k," field in a form.");if("date"===k&&(o+=" The date format to output is YYYY-MM-DD."),"select"===k)o+=" The options to output are either: ".concat(null===(n=t.list)||void 0===n?void 0:n.map((function(t){return t.label})).join(", "),".");e="PROMPT INSTRUCTIONS: "+o+"\nProvide only the raw value to input, without any additional explanations.\n"+e,Object(p.d)((function(n){n.ai.exec(e,Z,(function(e){W(e),t.aiSuggestAutoInsert&&$(e),Y(!0)}))}))}}),[t.aiSuggest,q]);var Q=Object(r.useState)(!1),tt=Object(i.a)(Q,2),et=tt[0],nt=tt[1],ot=Object(r.useState)([]),it=Object(i.a)(ot,2),ct=it[0],at=it[1],rt=function(e){var n=[].concat(Object(o.a)(t.autoSuggestDefaultValues||[]),Object(o.a)(e));n=n.filter((function(t,e){return n.indexOf(t)===e})),at(n)},lt=Object(r.useState)([]),st=Object(i.a)(lt,2),ut=st[0],dt=st[1],pt="auto-suggest-list-".concat(t.id,"-").concat(t.autoSuggestSource),ft=Object(g.a)((function(t){Object(m.d)('Adding "'.concat(t,'" to auto suggestion list of that input'),"autosuggestid_notif"),bt(t)}),3e3),bt=function(t){gt((function(e){console.log("GETLIST before add",e),e.some((function(e){return e.startsWith(t)}))||(e.push(t),console.log("ADD TO AUTOSUGGEST LIST",t,e,pt),ht(e))}))},gt=function(cb){try{"cookie"===t.autoSuggestSource&&cb(JSON.parse(Object(b.a)(pt)||"[]")),"ls"===t.autoSuggestSource&&cb(JSON.parse(localStorage.getItem(pt)||"[]")),"backend"===t.autoSuggestSource&&Object(p.d)((function(t){t.cache.get(pt,(function(t){return console.log("GET AUTOSUGGEST BACKEND",t),cb(t?JSON.parse(t):[])}))})),"customFunction"===t.autoSuggestSource&&t.autoSuggestFunction&&t.autoSuggestFunction().then(cb).catch((function(t){console.log(t)}))}catch(e){console.log("Error getting auto suggest list",e)}},ht=function(e){console.log("save autosuggest list",e);var n=JSON.stringify(e);"cookie"===t.autoSuggestSource&&Object(b.b)(pt,n,-1),"ls"===t.autoSuggestSource&&localStorage.setItem(pt,n),"backend"===t.autoSuggestSource&&Object(p.d)((function(t){t.cache.set(pt,n,-1)})),rt(e),console.log("SAVE autosuggest",e)};return Object(r.useEffect)((function(){if(t.autoSuggest)return t.id?void gt((function(t){rt(t)})):console.warn(h,"No id provided for autosuggest, system disabled")}),[t.autoSuggest,t.autoSuggestSource]),Object(r.useEffect)((function(){et&&(0==="".concat(F).length&&dt(ct),dt(ct.filter((function(t){return t.includes("".concat(F))&&t!=="".concat(F)}))))}),[ct,F,et]),Object(v.c)("div",{className:"input-component-wrapper ".concat(t.style?Object(c.a)(t.style,";",""):"")},Object(v.c)("div",{className:"input-component ".concat(t.id?t.id:""," ").concat(t.type)},t.label&&Object(v.c)("span",{className:"label ".concat(t.labelStyle),onClick:function(e){"checkbox"===t.type&&(n.current.checked=!n.current.checked,t.onChange&&t.onChange(n.current.checked))}},t.label," "),Object(v.c)("div",{className:"input-wrapper"},"select"!==t.type&&"textarea"!==t.type&&Object(v.c)("input",{ref:n,type:k||"text",defaultValue:y,value:F,checked:w,readOnly:t.readonly,max:t.max,min:t.min,step:t.step,onFocus:function(e){t.onFocus&&t.onFocus(),t.highlightTextOnFocus&&n.current.select(),nt(!0)},onBlur:function(e){setTimeout((function(){nt(!1),dt([]),t.onBlur&&t.onBlur()}),500)},onClick:function(){!t.shouldNotSelectOnClick&&n.current.select()},onKeyPress:function(e){"Enter"==(e.code||e.key)&&t.onEnterPressed&&t.onEnterPressed()},onChange:function(e){t.onCheckedChange&&t.onCheckedChange(e.target.checked),function(e){var n=e;"number"===t.type&&(t.max&&n>t.max&&(n=t.max),t.min&&n<t.min&&(n=t.min),n=n.toString()),t.autoSuggest&&ft(n),D(n)}(e.target.value)}}),""!=F&&void 0!=F&&Object(v.c)("div",{className:"input-clear-btn",onClick:function(){return D("")}}," ",Object(v.c)(d.b,{name:"circle-xmark"})),"select"===t.type&&Object(v.c)("select",{value:O,multiple:!0,onChange:function(e){var n=Array.from(e.target.selectedOptions,(function(t){return t.label})).join(",");t.onSelectChange&&t.onSelectChange(n)}},null===(e=t.list)||void 0===e?void 0:e.map((function(t,e){return Object(v.c)("option",{value:t.key},t.label," ")}))),"textarea"===t.type&&Object(v.c)("textarea",{defaultValue:F,onChange:function(e){t.onChange&&t.onChange(e.target.value)}}),t.aiSuggest&&Object(v.c)("div",{className:"ai-suggestion"},Object(v.c)("span",{className:"result"},t.aiSuggestAutoInsert&&K?"Ai suggestion inserted ":"Ai suggestion ".concat(B)),K&&Object(v.c)(l.a.Fragment,null,Object(v.c)("span",{onClick:function(){V(q+1)}},Object(v.c)(d.b,{name:"refresh"})),Object(v.c)("span",{onClick:function(){$(B)}},Object(v.c)(d.b,{name:"file-import"})))),t.explanation&&Object(v.c)("div",{className:"explanation"}," ",t.explanation," "),t.autoSuggest&&ut.length>0&&Object(v.c)("div",{className:"auto-suggest-list"},ut.map((function(t,e){return Object(v.c)("div",{key:e,className:"auto-suggest-item",onClick:function(e){D(t),dt([])}},t,Object(v.c)("span",{className:"remove-item",onClick:function(e){var n;e.stopPropagation(),n=t,gt((function(t){var e=t.filter((function(t){return t!==n}));console.log("REMOVE FROM AUTOSUGGEST LIST",n),ht(e)}))}},Object(v.c)(d.b,{name:"circle-xmark"})))}))))))},O=function(){return"\n .input-component {\n\t\t.auto-suggest-list {\n\t\t\tposition: absolute;\n\t\t\tz-index: 1000;\n\t\t\tbackground: white;\n\t\t\tborder: 1px solid #ccc;\n\t\t\tborder-radius: 5px;\n\t\t\tbox-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);\n\t\t\tmax-height: 200px;\n\t\t\toverflow-y: auto;\n\t\t\t.auto-suggest-item {\n\t\t\t\tpadding: 8px 12px;\n\t\t\t\tborder-bottom: 1px solid #eee;\n\t\t\t\tcursor: pointer;\n\t\t\t\t&:hover {\n\t\t\t\t\tbackground: #f5f5f5;\n\t\t\t\t}\n\t\t\t\t.remove-item {\n\t\t\t\t\tmargin-left: 8px;\n\t\t\t\t\tcursor: pointer;\n\t\t\t\t\t&:hover {\n\t\t\t\t\t\tcolor: red;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n display: flex;\n align-items: center;\n\t\tjustify-content: space-between;\n padding-bottom: 5px;\n input, select {\n max-width: 100%;\n }\n &.select {\n span {\n width: 20%;\n }\n }\n\t\t.input-clear-btn {\n\t\t\tposition: absolute;\n\t\t\ttop: 4px;\n\t\t\tright: -3px;\n\t\t\topacity: 0.3;\n\t\t\tpadding:3px;\n\n\t\t}\n span.label {\n // width: 30%;\n font-weight: 700;\n\t\t\tmargin-right: 10px;\n text-transform: uppercase;\n\t\t\t&.normal {\n\t\t\t\tfont-weight: 400;\n\t\t\t\ttext-transform: none;\n\t\t\t}\n }\n .input-wrapper {\n width: 70%;\n\t\t\tselect {\n padding: 7px;\n border: none;\n\t\t\t\tfont-size:".concat(Object(s.a)(1),"px;\n background: #ececec;\n border-radius: 5px;\n\t\t\t}\n input {\n padding: 7px;\n border: none;\n\t\t\t\tfont-size:").concat(Object(s.a)(1),"px;\n background: #ececec;\n border-radius: 5px;\n }\n\t\t\ttextarea {\n\t\t\t\twidth: calc(100% - 40px);\n\t\t\t\theight:180px;\n\t\t\t\tfont-size: ").concat(Object(s.a)(),"px;\n\t\t\t\tborder: none;\n\t\t\t\tbackground: #ececec;\n border-radius: 5px;\n\t\t\t\tpadding: 2px;\n\t\t\t}\n .explanation {\n font-size:").concat(Object(s.a)(1),"px;\n color: grey;\n\t\t\t\tmargin-bottom: 5px;\n }\n .ai-suggestion {\n font-size:").concat(Object(s.a)(1),"px;\n color: grey;\n\t\t\t\tmargin-right: 20px;\n\t\t\t\tspan {\n\t\t\t\t\twidth: auto;\n\t\t\t\t}\n\t\t\t\t.icon-wrapper {\n\t\t\t\t\tmargin-left: 5px;\n\t\t\t\t\tcursor: pointer;\n\t\t\t\t\topacity: 0.3;\n\t\t\t\t\t&:hover {\n\t\t\t\t\t\topacity: 1;\n\t\t\t\t\t}\n\t\t\t\t}\n }\n }\n }\n")}},606:function(t,e,n){"use strict";n.r(e);var o=n(0),i=n.n(o),c=n(3),a=n(1),r=n(12),l=n(14),s=n(11),u=n(108),d=n(10),p=n(164),f=n(82),b=n(48),g=n(712),h=n(62),m={};window.tiroCli=m;var v=function(t,e){var n,r,l=Object(h.a)("showRenderId",!1),s=Object(c.a)(l,2),u=s[0],d=s[1];n="toggleRenderId",(r={description:"toggle display of renderId for each block",func:function(){console.log("[toggleRenderId]"),d(!u),setTimeout((function(){window.location.reload()}),1e3)}}).f=r.func,m[n]=r;var p=Object(g.a)(0,1e3);return Object(o.useMemo)((function(){var e=(new Date).getTime(),n=(new Error).stack,o=(null===n||void 0===n||n.split("\n")[6].replace("at ","").replace(/\(.*\)/gi,"").trim(),Object(a.c)(i.a.Fragment,null,u&&Object(a.c)("p",{style:{position:"absolute",fontSize:"10px",color:"rgba(255,0,0,0.8)"}},p),t));(new Date).getTime();return o}),e)},w=function(){var t=Object(o.useState)("navigator"),e=Object(c.a)(t,2),n=e[0],l=e[1];return{mobileView:n,setMobileView:l,MobileToolbarComponent:function(t){return v(Object(a.c)(i.a.Fragment,null,"desktop"!==Object(r.a)()&&Object(a.c)(b.a,{class:"mobile-view-toggler",colors:["white","white"],buttons:[{icon:"faStream",class:"".concat("navigator"===n?"active":""),action:function(){l("navigator")}},{icon:"faPenNib",class:"".concat("editor"===n?"active":""),action:function(){l("editor")}},{icon:"faEye",class:"".concat("preview"===n?"active":""),action:function(){l("preview")}},{icon:"faSearch",class:"",action:function(){t.onButtons[0]&&t.onButtons[0]()}}]})),[n,t.forceRerender])}}},O=n(17),j=n(6),x=function(t,e){var n=Object(o.useRef)();Object(o.useEffect)((function(){n.current=t}),[t]),Object(o.useEffect)((function(){if(null!==e){var t=setInterval((function(){n.current()}),e);return function(){return clearInterval(t)}}}),[e])},_=function(){return"Tiro","Tiro"},k=function(){Object(o.useRef)([]);var t=Object(o.useState)(!1),e=Object(c.a)(t,2),n=e[0],i=e[1],l=Object(o.useState)(!1),s=Object(c.a)(l,2),u=s[0],d=s[1],p="(DISCONNECTED)",f=Object(o.useRef)(p);x((function(){f.current=f.current===p?"(/!\\ DISCONNECTED /!\\)":p;n?"".concat(_()):"".concat(_()," ").concat(f.current);Object(r.a)()}),1e3),Object(o.useEffect)((function(){Object(j.d)((function(t){t.watch.appStatus((function(t){!1===t.isConnected?b(!1):!0===t.isConnected&&(b(!0),d(!0),setTimeout((function(){d(!1)}),1e3))}))}))}),[]);var b=function(t){O.a.client.log.verbose&&console.log("[SOCKET CONNECTION TOGGLE] to ".concat(t)),i(t)};return{isConnected:n,connectionStatusComponent:function(){var t=["connected","connected"];return u&&(t=["back-online","back online"]),n||(t=["disconnected","disconnected"]),Object(a.c)("div",{className:"connection-status"},Object(a.c)("div",{className:t[0]},t[1]))},toggleSocketConnection:b}},y=n(20),C=n(21),S=function(t){return Object(a.c)("button",{className:"new-file-button",onClick:function(e){t.onNewFile()}},Object(a.c)(y.a,{name:"faPlusCircle",color:"white"}),Object(a.c)("span",null,C.a.newNote))},E=i.a.memo(S,(function(t,e){return!0})),T=n(8),I=n(9),N=n(26),P=n(27),A=n(115),R=n(39),F=n(72),L=n(42),D=n(388),M=n(385),z=n(18),B=n(710),W={ctrl:!1,shift:!1,alt:!1,opt:!1,Meta:!1},U={38:"up",40:"down",17:"ctrl",16:"shift",18:"alt",93:"opt",13:"enter"},H=function(t){return t=t||window.event,U[t.keyCode]?U[t.keyCode]:t.key},q={},V=n(97),G=n(25),J=n(46),K=function(t){Object(N.a)(n,t);var e=Object(P.a)(n);function n(t){var o;return Object(T.a)(this,n),(o=e.call(this,t)).oldFiles=[],o.liRefs=[],o.scrollerWrapperRef=i.a.createRef(),o.scrollerListRef=i.a.createRef(),o.canAutoScroll=!1,o.getVisibleItemsDebounced=Object(A.a)((function(){var t=o.scrollerWrapperRef.current;if(t){for(var e=t.getBoundingClientRect().height,n=-1,i=[],c=0;c<o.liRefs.length;c++){var a=o.liRefs[c].current;if(a){var r,l=a.getBoundingClientRect().top;if(l>-50&&l<e+100)-1===n&&(n=c),o.props.files[c]&&i.push(null===(r=o.props.files[c])||void 0===r?void 0:r.path)}}o.props.onVisibleItemsChange(i)}}),500),o.onListScroll=function(){o.canAutoScroll=!1,o.getVisibleItemsDebounced()},o.isMultiSelected=function(t){var e=!1;return o.state.selectionEdges[0]<=t&&o.state.selectionEdges[1]>=t&&(e=!0),e},o.itemToScroll=0,o.autoScrollToItem=function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];o.itemToScroll=e?t:o.itemToScroll+t,o.itemToScroll<0&&(o.itemToScroll=0),o.itemToScroll>o.props.files.length&&(o.itemToScroll=o.props.files.length),o.scrollerListRef.current.scrollToItem(o.itemToScroll)},o.getUrlLoginToken=function(){return"?token=".concat(Object(z.b)())},o.state={hoverMode:!1,selectionEdges:[-1,-1]},o}return Object(I.a)(n,[{key:"shouldComponentUpdate",value:function(t,e){if(JSON.stringify(t.files)!==JSON.stringify(this.oldFiles)){this.oldFiles=Object(R.a)(t.files),this.liRefs=[];for(var n=0;n<t.files.length;n++)this.liRefs.push(i.a.createRef());this.getVisibleItemsDebounced(),this.setState({selectionEdges:[-1,-1]}),this.canAutoScroll=!0}return this.props.activeFileIndex>0&&this.canAutoScroll&&(this.canAutoScroll=!1,this.autoScrollToItem(this.props.activeFileIndex)),!0}},{key:"render",value:function(){var t=this,e=V.a[this.props.sortMode],n=d.a.sizes.l2.fileLi.height+2*d.a.sizes.l2.fileLi.padding+d.a.sizes.l2.fileLi.margin,o=window.innerHeight-(d.a.sizes.search.h+d.a.sizes.search.padding),c=Object(r.c)("desktop")?o:o-d.a.sizes.mobile.bottomBarHeight;return Object(a.c)(i.a.Fragment,null,Object(a.c)("div",{className:"list-wrapper-scroller",style:{height:c},onScroll:this.onListScroll,ref:this.scrollerWrapperRef},Object(a.c)(M.a,null,(function(o){o.height;var r=o.width;return Object(a.c)(D.a,{itemData:t.props.files,className:"List",ref:t.scrollerListRef,height:c,itemCount:t.props.files.length,itemSize:n,width:r||0,onScroll:t.onListScroll},(function(n){var o=n.index,c=n.style,l=t.props.files[o],s=t.props.filesPreview[l.path];return Object(a.c)("div",{style:c},Object(a.c)("li",{ref:t.liRefs[o],style:{width:r||0-2*X.l2.fileLi.padding-2*X.l2.fileLi.margin-35},className:["file-element-list","element-".concat(o),"".concat(t.isMultiSelected(o)?"active":""),"".concat(o===t.props.activeFileIndex?"active":""),"".concat(s&&s.picture?"with-image":"")].join(" "),key:o,draggable:!0,onDragStart:function(){var e=[],n=t.state.selectionEdges;e=-1!==n[0]||-1!==n[1]?t.props.files.slice(n[0],n[1]+1):[l],t.props.onFileDragStart(e)},onDragEnd:function(){t.props.onFileDragEnd()},onClick:function(e){if(W["shift"]){var n=[t.props.activeFileIndex,o];n.sort(),t.setState({selectionEdges:n})}else t.props.onFileClicked(o),t.setState({selectionEdges:[-1,-1]});t.props.onFileClicked(o)}},Object(a.c)("div",{className:"background-item"}),Object(a.c)("div",{className:"background-item-border"}),Object(a.c)("div",{className:"left"},Object(a.c)("h3",{className:"label ".concat(l.name.length<=35?"oneliner":"more"),onMouseEnter:function(e){t.props.hoverMode&&t.props.onFileClicked(o)}},l.name),Object(a.c)("div",{className:"content"},s&&s.content&&Object(a.c)(i.a.Fragment,null,s.content)),Object(a.c)("div",{className:"date ".concat(e)},Object(F.a)(new Date(("modified"===e?l.modified:l.created)||0)))),Object(a.c)("div",{className:"right"},s&&s.picture&&Object(a.c)("div",{className:"picture",style:{backgroundColor:"white",backgroundImage:"url('".concat(s.picture.startsWith("http")?Object(J.b)(s.picture+t.getUrlLoginToken()):Object(J.b)("".concat(Object(L.a)(t.props.files[0].folder),"/").concat(s.picture).concat(t.getUrlLoginToken())),"')")}}))))}))}))))}}]),n}(i.a.Component),Y=i.a.memo(K,(function(t,e){return!1})),$=Object(s.a)({},d.a),Z=($.els,$.colors),X=($.font,$.sizes),Q=n(240),tt=n(29),et=n(37),nt=function(t){return Object(a.c)("div",{className:"folder-tree-view-component"},Object(a.c)("h3",{className:"subtitle"},C.a.folders),Object(a.c)(ot,{openFolders:t.openFolders,folder:t.folder,current:t.current,onFolderClicked:t.onFolderClicked,onFolderMenuAction:t.onFolderMenuAction,onFolderOpen:function(e){Object(j.d)((function(n){n.ui.browser.folders.open.add(e),t.onFolderOpen(e)}))},onFolderClose:function(e){Object(j.d)((function(n){console.log("ONFOLDERCLOSE",e),n.ui.browser.folders.open.remove([e]),t.onFolderClose(e)}))},onFolderDragStart:t.onFolderDragStart,onFolderDragEnd:t.onFolderDragEnd,onFolderDrop:t.onFolderDrop}))},ot=function t(e){var n=Object(et.a)(e.openFolders)?e.openFolders:[],i=n.includes(e.folder.path)&&e.folder.hasFolderChildren,r=Object(o.useState)(!1),l=Object(c.a)(r,2),s=l[0],u=l[1],p=Object(o.useState)(!1),f=Object(c.a)(p,2),b=f[0],g=f[1],h=Object(o.useState)(""),m=Object(c.a)(h,2),v=m[0],w=m[1];Object(o.useEffect)((function(){i&&!e.folder.children||i&&e.folder.children&&0===e.folder.children.length?g(!0):g(!1)}),[e.folder.children,i]);var O=Object(tt.a)(e.current,e.folder.key);return Object(a.c)("li",{className:"folder-wrapper ".concat(O?"current":""," "),draggable:!0,onDrop:function(t){console.log("DROP",t),e.folder.key&&(e.onFolderDrop(e.folder),t.stopPropagation())},onDragStart:function(t){e.folder.key&&(e.onFolderDragStart(e.folder),t.stopPropagation())},onDragOver:function(t){w("drag"),t.preventDefault(),t.stopPropagation()},onDragEnd:function(){e.folder.key&&e.onFolderDragEnd()},onMouseLeave:function(){s&&u(!1)}},Object(a.c)("div",{className:"folder-title ".concat(v),onDragEnter:function(t){},onDrop:function(t){console.log("DROP2",t),w("")},onDragLeave:function(t){w("")}},Object(a.c)("span",{className:"icon",onClick:function(t){i?e.onFolderClose(e.folder.key):e.onFolderOpen(e.folder.key)}},e.folder.hasFolderChildren&&Object(a.c)(y.a,{name:i?"faCaretDown":"faCaretRight",color:d.a.colors.main})),Object(a.c)("span",{className:"title",onClick:function(t){e.onFolderClicked(e.folder.key)}},Object(a.c)("div",{className:"title-drag-bg"}),Object(a.c)("div",{className:"title-label"}," ",e.folder.title)),Object(a.c)("span",{onClick:function(){u(!s)},className:"context-menu-wrapper"},Object(a.c)(y.a,{name:"faEllipsisH",color:d.a.colors.l1.font}),s&&Object(a.c)("div",{className:"context-menu context-menu-folders"},Object(a.c)("ul",null,Object(a.c)("li",{onClick:function(){if(""===e.folder.path)return u(!1);var t=prompt("".concat(C.a.renameFolderPrompt," "),e.folder.title);t&&""!==t&&t!==e.folder.title&&e.onFolderMenuAction("rename",e.folder,t),u(!1)}},C.a.renameFolder),Object(a.c)("li",{onClick:function(){if(""===e.folder.path)return u(!1);Object(j.e)().then((function(t){t.popup.prompt({text:"".concat(C.a.createFolderPrompt,' "').concat(e.folder.path,'"?'),userInput:!0,onAccept:function(t){t&&""!==t&&e.onFolderMenuAction("create",e.folder,t)},onRefuse:function(){}})})),u(!1)}},C.a.createFolder),-1===e.folder.path.indexOf(".tiro/.trash")&&Object(a.c)("li",{onClick:function(){if(""===e.folder.path)return u(!1);u(!1),e.onFolderMenuAction("moveToTrash",e.folder)}},C.a.moveToTrash),-1!==e.folder.path.indexOf(".tiro/.trash")&&Object(a.c)("li",{onClick:function(){if(""===e.folder.path)return u(!1);u(!1),Object(j.e)().then((function(t){t.popup.confirm("".concat(C.a.deleteFolderPrompt,' "').concat(e.folder.path,'"?'),(function(){e.onFolderMenuAction("delete",e.folder)}))}))}},C.a.deleteFolder))))),b&&Object(a.c)("div",{className:"loading"},"..."),i&&Object(a.c)("ul",{className:"folder-children"},e.folder.children&&e.folder.children.map((function(o,i){return Object(a.c)(t,{openFolders:n,key:i,folder:o,current:e.current,onFolderOpen:e.onFolderOpen,onFolderMenuAction:e.onFolderMenuAction,onFolderClose:e.onFolderClose,onFolderClicked:e.onFolderClicked,onFolderDragStart:e.onFolderDragStart,onFolderDragEnd:e.onFolderDragEnd,onFolderDrop:e.onFolderDrop})}))))},it=function(t){var e=Object(s.a)({},t).files,n=Object(et.a)(e)?e.slice(0,20):[];return Object(a.c)(i.a.Fragment,null,n.length>0&&Object(a.c)("div",{className:"last-notes-component"},Object(a.c)("h3",{className:"subtitle"},C.a.lastNotes),Object(a.c)("ul",null,n.map((function(e,n){var o=e.name.replace(".md","");return o=o.length>20?"".concat(o.substr(0,20)):o,Object(a.c)("li",{key:n,title:o,onClick:function(n){t.onClick(e)},className:"note"},Object(a.c)(y.a,{name:"faFile"}),o)})))))},ct=i.a.memo(it,(function(t,e){return t.files===e.files})),at=n(60),rt=n(54),lt=function(t){var e=Object(o.useContext)(j.a),n=!!e&&e.status.searching.get;return Object(a.c)(i.a.Fragment,null,Object(a.c)("div",{className:"search-bar-component"},Object(a.c)("input",{type:"text",placeholder:C.a.searchPlaceholder,value:t.term,onKeyDown:function(n){if("Enter"===n.key){if(t.term.length<3)return;e&&e.ui.search.search(t.term)}},onChange:function(n){!function(n,o){if(e){var i=e.ui.browser.folders.current.get();""===t.term&&""!==i&&(n=n+" "+i,o&&setTimeout((function(){var t=(o.selectionStart||0)-i.length-1;o.selectionStart=t,o.selectionEnd=t}),10)),e.ui.search.term.set(n)}}(n.target.value,n.target)}}),Object(a.c)("div",{className:"search-status"},n&&C.a.searchingLabel)))},st=n(65),ut=function(t){var e={title:t.realname,folder:t.folder,mobileview:"editor"},n="".concat(st.a.global.protocol).concat(st.a.global.url).concat(st.a.global.port,"?").concat(Object(J.g)(e));window.open(n,"popupDetached","width=600,height=600")};var dt=n(32),pt=n(35);const ft=t=>{const e=Object(o.useState)(0),n=Object(c.a)(e,2),i=n[0],l=n[1],s=Object(o.useRef)(0);Object(o.useEffect)((()=>{u(t.startingIndex)}),[t.startingIndex]);const u=t=>{d(),l(t),s.current=t},d=()=>{j(!1),m(10)},p=e=>{j(!1),m(10),-1===e&&0===s.current?s.current=t.images.length-1:1===e&&s.current===t.images.length-1?s.current=0:s.current=s.current+e,u(s.current)},f=Object(o.useState)(10),g=Object(c.a)(f,2),h=g[0],m=g[1],v=Object(o.useState)(!1),w=Object(c.a)(v,2),O=w[0],j=w[1],x=t=>{let e=t+h;e<0&&(e=0),e>20&&(e=20),m(e)},_=Object(o.useRef)(null);(()=>{let t="0px";if(_.current){let e=_.current.clientHeight;t="".concat(e-5,"px")}})();const k=Object(dt.b)((t=>{let e=t.deltaY>0?1:-1;x(e)}),150),y=Object(o.useRef)(0),C=(Object(dt.b)((t=>{if(2===t.touches.length){let e=t.touches[0].clientY>y.current?1:-1;y.current=t.touches[0].clientY,x(e)}}),150),()=>{const e="mobile"===Object(r.a)()?"mobile":"desktop";let n=[{class:"left ".concat(e),title:"left",icon:"faChevronLeft",action:()=>{p(-1)}},{class:"close",title:"close",icon:"faTimes",action:()=>{t.onClose()}},{class:"right ".concat(e),title:"right",icon:"faChevronRight",action:()=>{p(1)}}];return O&&(n.unshift({class:"zoom",title:"zoom",icon:"faPlus",action:()=>{x(1)}}),n.unshift({class:"dezoom",title:"dezoom",icon:"faMinus",action:()=>{x(-1)}})),n.push({class:"zoomToggle",title:"zoomToggle",icon:"magnifying-glass-".concat(O?"minus":"plus"),action:()=>{j(!O)}}),n});Object(o.useEffect)((()=>{const t=()=>{p(1)},e=()=>{p(-1)};return Object(pt.a)("right",t),Object(pt.a)("left",e),()=>{console.log("destroying lightbox"),Object(pt.c)("right",t),Object(pt.c)("left",e)}}),[]);return Object(a.c)("div",{className:"lightbox-component"},Object(a.c)("div",{className:"lightbox-bg",onClick:()=>{t.onClose()}}),Object(a.c)("div",{className:"lightbox-content images-nb-".concat(t.images.length),onWheel:k,ref:_},Object(a.c)("div",{className:"lightbox-main-image-wrapper"},t.images.map(((e,n)=>Object(a.c)("div",{key:n,className:"lightbox-image",style:{display:n===i?"flex":"none"}},Object(a.c)("figure",{className:"zoom2 ".concat(O?"zoomed":"not-zoomed"),style:{backgroundImage:"url(".concat(Object(L.a)(e.url)+Object(z.c)(),")"),backgroundSize:"".concat(h/10*100,"%")},onMouseMove:t=>{(t=>{let e,n,o,i;var c=t.currentTarget;e=t.clientX,n=t.clientY,o=e/c.offsetWidth*100,i=n/c.offsetHeight*100;const a=t=>(t-50)/("mobile"===Object(r.a)()?1:3);o+=a(o),i+=a(i);let l=o+"% "+i+"%";c.style.backgroundPosition=l})(t)}},Object(a.c)("img",{src:Object(L.a)(e.url)+Object(z.c)(),alt:"",onClick:t=>{(t=>{let e=t.target.src;t.target.parentElement.style.backgroundImage="url(".concat(e,")"),j(!0)})(t)}})),Object(a.c)("div",{className:"counter"},i+1,"/",t.images.length,!0===O&&" - [".concat(20*h,"%]")),Object(a.c)("div",{className:"image-infos"},e.file.name&&e.title&&Object(a.c)("div",{className:"image-name",onClick:t=>ut(e.file)},e.file.name," - ",e.title),Object(a.c)(b.a,{popup:!1,buttons:C()})))))),Object(a.c)("div",{className:"lightbox-images-thumbnail"},Object(a.c)("div",{className:"lightbox-images-thumbnail-scroll",style:{width:"".concat(140*t.images.length,"px")}},t.images.map(((t,e)=>Object(a.c)("div",{key:e,className:"thumbnail"+(e===i?" selected":""),style:{backgroundImage:"url(".concat(Object(L.a)(t.url)+Object(z.c)(),")")},onClick:()=>{u(e)}})))))))};var bt=n(384),gt=n(714),ht=n(133),mt=n(30),vt=n(163),wt=n(24),Ot={onAccept:function(){},onRefuse:function(){}},jt=function(t){var e=Object(o.useState)(!1),n=Object(c.a)(e,2),l=n[0],u=n[1],d=Object(o.useState)(""),p=Object(c.a)(d,2),f=p[0],b=p[1],g=Object(o.useState)(null),h=Object(c.a)(g,2),m=h[0],v=h[1],w=Object(o.useState)(C.a.promptPopup.defaultTitle),O=Object(c.a)(w,2),x=O[0],_=O[1],k=Object(o.useState)(!1),y=Object(c.a)(k,2),S=y[0],E=y[1],T=Object(o.useState)(!1),I=Object(c.a)(T,2),N=I[0],P=I[1],A=Object(o.useState)(C.a.promptPopup.accept),F=Object(c.a)(A,2),L=F[0],D=F[1],M=Object(o.useState)(C.a.promptPopup.refuse),z=Object(c.a)(M,2),B=z[0],W=z[1],U=Object(o.useState)(""),H=Object(c.a)(U,2),q=H[0],V=H[1],G=function(t){var e;u(!0),b(t.text),t.acceptLabelButton&&D(t.acceptLabelButton),t.refuseLabelButton&&W(t.refuseLabelButton),null!==(e=t.options)&&void 0!==e&&e.cssStr&&V(t.options.cssStr),t.title&&_(t.title),t.userInput&&v(""),t.onAccept&&(Ot.onAccept=t.onAccept),t.onRefuse?(Ot.onRefuse=t.onRefuse,P(!0)):P(!1)},J=function(){u(!1),Z(!1),v(null),_(""),b(""),P(!1)},K=Object(o.useState)(!1),Y=Object(c.a)(K,2),$=Y[0],Z=Y[1],X=Object(o.useState)([]),Q=Object(c.a)(X,2),tt=Q[0],et=Q[1],nt=Object(o.useState)([]),ot=Object(c.a)(nt,2),it=(ot[0],ot[1],Object(o.useRef)({})),ct={title:"Popup Form",insertFilePath:"/popup_form_results.md",insertLine:0,insertStringFormat:"{{name}} | {{age|number}}\n"},lt=Object(o.useState)(ct),st=Object(c.a)(lt,2),ut=st[0],pt=st[1],ft=Object(o.useRef)(),jt=function(t,cb){Object(j.d)((function(e){e.file.getContent(t,(function(t){var e=t.split("\n"),n=[];e.forEach((function(t){if(t.trim().startsWith("form|")||t.startsWith("form |")){var e=t.split("|");e.shift();var o=e.join("|").split(/,(?=\s*\w+=)/),i={title:"",fields:[]};o.forEach((function(t){var e=t.split("="),n=Object(bt.a)(e),o=n[0],c=n.slice(1),a=o.trim(),r=c.join("=").trim();switch(a){case"name":i.title=r;break;case"path":i.insertFilePath=r;break;case"line":i.insertLine=parseInt(r,10);break;case"line_format":i.insertStringFormat=r}})),n.push(i)}})),cb(n)}),{removeMetaHeader:!0})}))},xt=function(cb){jt("/.tiro/forms.md",cb)},_t=function(t,cb,e,n){var o;n||(n={autosubmit:!1}),n.autosubmit||(n.autosubmit=!1);var i=Object(s.a)(Object(s.a)({},ct),t);if(null!==(o=t.options)&&void 0!==o&&o.cssStr)V(t.options.cssStr);else{var a="";Object(r.e)()&&(a=".popup-wrapper {transform:translate(-50%,0%)!important; top:20px!important;}"),V(a)}var l=[],u=(i.insertStringFormat||"").match(/{{(.*?)}}/g);if(null===u||void 0===u||u.forEach((function(t){var n=t.replace("{{","").replace("}}","").split("|"),o=Object(c.a)(n,3),i=o[0],a=o[1],r=o[2];if(!i.startsWith("_")){var s,u,d,p,f,b,g,h,m=[];null!==(s=a)&&void 0!==s&&s.startsWith("select")&&(m=a.split(":")[1].split(",").map((function(t,e){return{key:e,label:t,obj:t}})),a="select");var v=!1;null!==(u=r)&&void 0!==u&&u.includes("optional")&&(v=!0);var w=!1;null!==(d=r)&&void 0!==d&&d.includes("remember")&&(w=!0);var O="",j=!1;null!==(p=r)&&void 0!==p&&p.includes("ai_suggest:")&&(O=r.split("ai_suggest:")[1].trim(),r=r.split("ai_suggest:")[0].trim()),null!==(f=r)&&void 0!==f&&f.includes("ai_insert:")&&(O=r.split("ai_insert:")[1].trim(),j=!0,r=r.split("ai_insert:")[0].trim());var x=!1;null!==(b=r)&&void 0!==b&&b.includes("not_visible")&&(x=!0);var _=!1;null!==(g=r)&&void 0!==g&&g.includes("history")&&(_=!0);var k=[];null!==(h=r)&&void 0!==h&&h.includes("history:")&&(k=r.split("history:")[1].trim().split(",").map((function(t){return t.trim()}))),l.find((function(t){return t.id===i}))||l.push({name:i,initValue:e&&Object(gt.a)(e,i)?e[i]:"",type:a||"text",description:r||i,selectOptions:m,optional:v,rememberLastValue:w,id:i,aiSuggestString:O,aiSuggestAutoInsert:j,notVisible:x,historySuggest:_,historySuggestDefault:k})}})),e){var d=Object.keys(e).filter((function(t){return!l.find((function(e){return e.id===t}))}));d.length>0&&Object(j.d)((function(t){t.ui.notification.emit({id:"form-unmatched-fields",content:"FORM: fields <b>".concat(d.join(", "),"</b> do not match any form fields.")})}))}i.fields=l,_(i.title),et(l),pt(i),Z(!0),ft.current=cb,E(n.autosubmit||!1)};Object(o.useEffect)((function(){Object(ht.a)(S)&&setTimeout((function(){console.log("[POPUP > FORM] auto submitting form:",ut),yt()}),S||1e3)}),[S,ut]);var kt=function(){return tt.forEach((function(t){var e;("date"===t.type&&it.current[t.id]&&(it.current[t.id]=new Date(it.current[t.id]).toLocaleDateString("fr-FR")),"datetime"===t.type)&&(it.current[t.id]&&(it.current[t.id]=new Date(it.current[t.id]).toLocaleString("fr-FR")),it.current[t.id]=null===(e=it.current[t.id])||void 0===e?void 0:e.substring(0,it.current[t.id].length-3))})),it.current},yt=function(){var t,e;kt();var n=[];if(tt.forEach((function(t){t.optional||it.current[t.id]||"html"===t.type||t.notVisible||n.push(t.name)})),n.length>0)Object(j.d)((function(t){t.ui.notification.emit({id:"insert-form-error",content:"FORM: fields <b>".concat(n.join(", "),"</b> are mandatory.")})}));else{Et||Z(!1);var o=ut.insertStringFormat;o=o||ct.insertStringFormat,it.current=it.current||{},tt.forEach((function(t){it.current[t.id]||(it.current[t.id]="")})),tt.forEach((function(t){t.notVisible&&(it.current[t.id]="")})),Object(mt.a)(it.current,(function(t,e){var n,i,c=new RegExp("{{".concat(e,"\\|.*?}}"),"g");o=null===(n=o)||void 0===n?void 0:n.replace(c,t);var a=new RegExp("{{".concat(e,"}}"),"g");o=null===(i=o)||void 0===i?void 0:i.replace(a,t)}));var i=Object(vt.a)(),c=new RegExp("{{_datetime}}","g");o=o.replace(c,i.full_fr);var a=new RegExp("{{_date}}","g");o=o.replace(a,i.date_fr);var r=ut.insertFilePath||ct.insertFilePath,l=ut.insertLine||ct.insertLine;o=null===(e=o=null===(t=o)||void 0===t?void 0:t.replaceAll("\n","\n"))||void 0===e?void 0:e.replaceAll("\\n","\n"),Object(j.d)((function(t){t.file.insertContent(r,o||"",{insertLine:l},(function(e){ft.current&&ft.current(),ft.current=void 0,t.ui.notification.emit({id:"insert-form-success",content:"<b>FORM: line ".concat(l,' insert success</b>: <br><br> "').concat(o,'" <br><br> to <b>').concat(r,"</b>"),options:{onClick:function(){console.log("open file"),Object(j.d)((function(t){t.ui.floatingPanel.openFile(r,{searchedString:o})}))}}})}))})),Et||J()}},Ct=Object(o.useState)(!1),St=Object(c.a)(Ct,2),Et=St[0],Tt=St[1],It={confirm:function(t,cb,e,n){G({title:"",text:t,onAccept:cb,onRefuse:function(t){function e(){return t.apply(this,arguments)}return e.toString=function(){return t.toString()},e}((function(){e&&e()})),options:n})},show:function(t,e,cb,n){G({title:e,text:t,onAccept:cb,onRefuse:function(){},options:n})},prompt:G,form:{create:_t,readConfigFromNote:jt,getAll:xt,open:function(t,cb,e,n){xt((function(o){var i=o.find((function(e){return e.title===t}));i?_t(i,cb,e,n):(console.warn("Form not found",t),Object(j.d)((function(e){e.ui.notification.emit({id:"form-not-found",content:"Form <b>".concat(t,"</b> not found.")})})))}))}},documentation:function(){return Object(wt.a)(It,"api.popup","client/src/hooks/app/usePromptPopup.hook.tsx")}};return{popupApi:It,PromptPopupComponent:function(){var t=Object(o.useRef)({}),e=Object(o.useState)(""),n=Object(c.a)(e,2),r=n[0],s=n[1],u=Object(dt.a)((function(e,n){var o=function(){var t={};return tt.forEach((function(e){e.aiSuggestString&&(t[e.id]=e.aiSuggestString)})),t}(),i=!1;Object(mt.a)(o,(function(t,c){t.includes("[".concat(e,"]"))&&(i=!0,o[c]=t.replace("[".concat(e,"]"),n))})),i&&(t.current=o,s(" "===r?" ":" "))}),1e3),d=function(e){if(void 0!==t.current[e])return"".concat(t.current[e]).concat(r)},p=function(t,e){u(t,e),O(t,e)},b=Object(o.useState)(0),g=Object(c.a)(b,2),h=g[0],w=g[1],O=Object(dt.a)((function(t,e){w(h+1)}),1e3),j=Object(o.useState)({}),_=Object(c.a)(j,2),k=_[0],y=_[1];return Object(o.useEffect)((function(){var t={};tt.forEach((function(e){if("html"===e.type){t[e.id]=Object(R.a)(e);var n=kt();t[e.id].description=t[e.id].description.replace(/\[([^\]]+)\]/g,(function(t,e){return n[e]||t}))}})),y(t)}),[tt,h]),Object(a.c)(i.a.Fragment,null,$&&Object(a.c)("div",{className:"form-popup-component"},Object(a.c)(rt.a,{title:x,onClose:J,cssStr:q},tt.map((function(t,e){var n;return Object(a.c)("div",{key:e,className:"form-input-wrapper"},"html"!==t.type&&Object(a.c)(at.a,{label:t.name,explanation:t.description,shouldNotSelectOnClick:!0,value:t.initValue,type:t.type,list:t.selectOptions,onLoad:function(e){it.current[t.id]=e},onChange:function(e,n){it.current[t.id]=e,p(t.id,e)},onSelectChange:function(e){it.current[t.id]=e,p(t.id,e)},rememberLastValue:t.rememberLastValue,id:"PromptPopupComponent-".concat(x,"-").concat(t.name,"-").concat(t.type),aiSuggest:d(t.id),aiSuggestAutoInsert:t.aiSuggestAutoInsert,highlightTextOnFocus:t.rememberLastValue&&t.historySuggest,autoSuggest:!!t.historySuggest||void 0,autoSuggestSource:t.historySuggest?"backend":void 0,autoSuggestDefaultValues:t.historySuggestDefault}),!t.optional&&"html"!==t.type&&Object(a.c)("div",{className:"mandatory"},"*"),"html"===t.type&&Object(a.c)("div",{className:"popup-form-html-field",dangerouslySetInnerHTML:{__html:(null===(n=k[t.id])||void 0===n?void 0:n.description)||""}}))})),Object(a.c)("br",null),Object(a.c)("div",{className:"form-input-wrapper"},Object(a.c)(at.a,{label:"Keep form open",labelStyle:"normal",type:"checkbox",value:Et,onCheckedChange:function(t){return Tt(t)}})),Object(a.c)("button",{value:"submit",className:"accept submit-button",onClick:function(t){yt()}},L),Object(a.c)("div",{className:"details"},"Form result will be ",ut.insertLine," to ",ut.insertFilePath," with format: ",ut.insertStringFormat))),l&&Object(a.c)("div",{className:"prompt-popup-component"},Object(a.c)(rt.a,{title:x,onClose:J,cssStr:q},Object(a.c)("div",null,Object(a.c)("div",{className:"content",dangerouslySetInnerHTML:{__html:f}}),Object(a.c)("br",null),null!==m&&Object(a.c)("div",null,Object(a.c)("input",{type:"text",value:m,onChange:function(t){v(t.target.value)}}),Object(a.c)("br",null)),Object(a.c)("button",{value:"submit",className:"accept submit-button",onClick:function(t){Ot.onAccept(m),J()}},L),N&&Object(a.c)("button",{value:"submit",className:"refuse submit-button",onClick:function(t){Ot.onRefuse(m),J()}},B)))))}}},xt=n(231),_t=n(129),kt=function(t){var e=Object(o.useContext)(j.a),n=Object(o.useState)(-1),i=Object(c.a)(n,2),r=i[0],l=i[1],s=Object(et.a)(t.tabs)?t.tabs:[];return Object(a.c)("div",{className:"tab-list-wrapper-hover ".concat(t.pinStatus?"pinned":"unpinned")},Object(a.c)("div",{className:"top-hover-bar"}," "),Object(a.c)("div",{className:"tab-list-scroll-wrapper",style:{top:"".concat(t.pinStatus?0:-44,"px")}},Object(a.c)("div",{className:"tab-list-invisible-scroll"},Object(a.c)("div",{className:"tab-list-wrapper"},s.map((function(n,o){return Object(a.c)(Ct,{key:o,tab:n,onDrop:function(t){l(t)},onDragEnter:function(t){l(t)},onDragEnd:function(t){e&&e.tabs.reorder(t,r),l(-1)},dragIndic:r,pos:o,onUpdate:t.onUpdate})})),(null===e||void 0===e?void 0:e.ui.browser.files.active.get)&&Object(a.c)("div",{className:"tab-wrapper tab-more",onClick:function(e){t.onUpdate("add")}},"+"),Object(a.c)("div",{className:"tab-wrapper tab-more",onClick:function(e){t.onPinToggle()}},Object(a.c)(y.b,{name:"thumbtack",size:.8}))))))},yt=function(t){var e=Object(s.a)({},t),n=e.tab,o=e.pos,c="Six",l=n.grid.layout.length;return 2===l&&(c="Two"),3===l&&(c="Three"),4===l&&(c="Four"),5===l&&(c="Five"),c="faDice".concat(c),Object(a.c)("div",{className:"tab-and-drag-wrapper"},t.dragIndic===o&&Object(a.c)("div",{className:"drag-indic"},"\u25bc"),Object(a.c)("div",{className:"tab-wrapper ".concat(n.active?"active":""),draggable:!0,onDragEnter:function(){t.onDragEnter(o)},onDrop:function(){t.onDrop(o)},onDragEnd:function(){t.onDragEnd(o)}},Object(a.c)("div",{className:"active-ribbon"}),Object(a.c)("div",{className:"tab-name",onClick:function(){t.onUpdate("activate",n)}},"mobile"!==Object(r.a)()&&Object(a.c)("input",{type:"text",className:"tab-input-text",value:n.name,style:{width:10*n.name.length+"px"},onChange:function(e){t.onUpdate("rename",n,e.target.value)}}),"mobile"===Object(r.a)()&&Object(a.c)(i.a.Fragment,null,n.name)),n.grid.layout.length>1&&Object(a.c)("div",{className:"tab-nb-windows",onClick:function(){t.onUpdate("activate",n)}},Object(a.c)(y.a,{name:c,color:"#b2b2b2"})),Object(a.c)("div",{className:"tab-close",onClick:function(){Object(j.d)((function(e){e.popup.confirm("".concat(C.a.deleteTabPrompt,' "').concat(n.name,'"?'),(function(){t.onUpdate("close",n)}))}))}},Object(a.c)(y.a,{name:"faPlus",color:"#b2b2b2"}))))},Ct=i.a.memo(yt,(function(t,e){var n=!0,o=Object(R.a)({n:t.tab,p:e.tab});return o.n.grid=o.p.grid={},o.n.refresh=o.p.refresh="",JSON.stringify(o.p)!==JSON.stringify(o.n)&&(n=!1),e.pos!==t.pos&&(n=!1),e.dragIndic!==t.dragIndic&&(n=!1),e.tab.active!==t.tab.active&&(n=!1),e.onUpdate!==t.onUpdate&&(n=!1),n})),St=n(233),Et=n(191),Tt=n(234),It=n(165),Nt=n(109),Pt=n(98),At=n(106),Rt=n(386),Ft=n(608),Lt=n(38),Dt=n(144),Mt=function(t){var e=Object(o.useState)(""),n=Object(c.a)(e,2),i=(n[0],n[1]),r=Object(o.useState)(t.view),l=Object(c.a)(r,2),s=l[0],u=(l[1],Object(dt.a)((function(){Object(j.d)((function(e){e.file.getContent(t.file.path,(function(e){i(e),t.searchedString&&Object(j.d)((function(e){setTimeout((function(){console.log("searchword",t.searchedString,t.replacementString,t.windowId),e.ui.note.editorAction.dispatch({type:"searchWord",searchWordString:t.searchedString,searchReplacementString:t.replacementString,windowId:t.windowId});var n=document.querySelector(".select-wrapper input");n&&(n.focus(),setTimeout((function(){n.focus(),setTimeout((function(){n.focus()}),100)}),50))}),300)}))}))}))}),200));Object(o.useEffect)((function(){u()}),[t.file.path,t.searchedString,s]);var d=t.height?t.height+"px":"100%",p=Object(o.useState)(t.windowId||Object(Lt.a)()),f=Object(c.a)(p,2),b=f[0],g=f[1];return Object(o.useEffect)((function(){g(t.windowId||Object(Lt.a)())}),[t.windowId]),Object(a.c)("div",{className:"note-preview-wrapper "+s,style:{height:d}},Object(a.c)(Dt.a,{noteParentType:t.noteParentType,content:{i:b,file:t.file,active:t.isActive||!1,view:t.view||"editor"},forceView:t.view,canEdit:!0,showViewToggler:t.showViewToggler,showToolbar:t.showToolbar,titleEditor:t.titleEditor,onLayoutUpdate:t.onLayoutUpdate||function(){}}))},zt=i.a.memo(Mt,(function(t,e){return JSON.stringify(t)===JSON.stringify(e)})),Bt=n(173),Wt=n(192),Ut=n(53),Ht=n(711),qt=n(28);const Vt="[PLUGIN CRON]";Object(qt.a)("cron","trigger",(()=>{Kt()}));let Gt="plugins-cron-infos";const Jt=(t,e)=>{const n=[],o=[];Object(mt.a)(e,((t,e)=>{n.push(e),o.push(t)}));try{new Function(...n,t.code)(...o)}catch(i){let e="[ERR in ".concat(t.type.toLocaleUpperCase()," plugin ").concat(t.name.toLocaleUpperCase(),"]: ").concat(i);console.log(e,i,{paramsNames:n,paramsValues:o,plugin:t}),console.trace(i),Object(qt.d)("".concat(e))}},Kt=()=>{let t=(new Date).toJSON().replace("T","").replace("Z","");Object(j.d)((e=>{e.plugins.list((n=>{e.cache.get(Gt,(o=>{o||(o={}),Object(mt.a)(n,(n=>{var i,c,a;let r=!0;if(!1===(null===(i=n.options)||void 0===i?void 0:i.disabled)&&(r=!1),"background"!==n.type||!r)return;o[n.name]||(o[n.name]={vars:{}});let l=60*((null===(c=n.options)||void 0===c?void 0:c.background_exec_interval_in_min)||60)*1e3,s=(new Date).getTime(),u=(null===(a=o[n.name])||void 0===a?void 0:a.lastRunTime)||0;if(u+l>s)return console.log(Vt,"".concat(t," => \ud83d\udd51\u23f3 bg plugin ").concat(n.name,", wait for ").concat(Math.round((u+l-s)/1e3)," seconds"));{let i=u+l>s;console.log(Vt,"".concat(t," => \ud83d\udd51\u25b6\ufe0f exec the bg plugin ").concat(n.name,", last exec was ").concat(new Date(u).toJSON()),{p:n,lastRun:u,intervalRun:l,now:s,status:i});const c=o[n.name];Jt(n,{tiroApi:e,bgState:c}),o[n.name]&&!Object(Ht.a)(o[n.name])||(o[n.name]={vars:{}}),o[n.name].lastRunTime=s}})),e.cache.set(Gt,o,-1)}),{disableRamCache:!0})}))}))};var Yt=n(16),$t=n(22),Zt=function(){var t=$t.d.curr.privacy_work_mode_enable,e=$t.d.curr.privacy_work_mode_filters,n=e.split(",");return n.forEach((function(t,e){n[e]=t.trim().toLowerCase()})),{workModeEnabled:t,workModeFilters:e,workModeFiltersArr:n}},Xt=n(389),Qt=n(137),te=n(131),ee=n(73),ne=n(256),oe=15,ie=!1,ce=function(){if(ie)return oe;var t=document.createElement("div");t.style.visibility="hidden",t.style.overflow="scroll",t.style.msOverflowStyle="scrollbar",document.body.appendChild(t);var e=document.createElement("div");return t.appendChild(e),oe=t.offsetWidth-e.offsetWidth,t.parentNode.removeChild(t),ie=!0,oe},ae=function(t){if(!t)return"";if("file"===t.type)return t.file.name.replace(".md","");if("ctag"===t.type){var e;if("iframe"===(null===(e=t.ctagConfig)||void 0===e?void 0:e.tagName)){var n,o=null===(n=t.ctagConfig)||void 0===n?void 0:n.content;return Object(J.c)(o)}var i,c,a=null===(i=t.ctagConfig)||void 0===i?void 0:i.tagName.substring(0,3),r=(null===(c=t.ctagConfig)||void 0===c?void 0:c.content)||"";return r=r.replace(/[^a-zA-Z0-9 ]/g,""),"".concat(a," | ").concat(r)}return""},re=function(t){var e,n,i,l,u,d=Object(o.useRef)(t.panel);Object(o.useEffect)((function(){d.current=t.panel}),[t.panel]);var p=Object(dt.a)((function(e){t.onPanelUpdate&&Object(j.d)((function(t){t.ui.floatingPanel.update(e)}))}),100),f=Object(o.useState)(!1),g=Object(c.a)(f,2),h=g[0],m=g[1],v=function(t){m(t)},w=Object(o.useState)(!1),O=Object(c.a)(w,2),x=O[0],_=O[1],k=function(){K(),E(!0),_(!0),t.onPanelDragStart()},C=Object(o.useState)(!1),S=Object(c.a)(C,2),E=(S[0],S[1]),T=function(){_(!1),E(!1),t.onPanelDragEnd()},I=Object(o.useRef)({x:0,y:0}),N=Object(o.useState)({x:-9999,y:-9999}),P=Object(c.a)(N,2),A=P[0],R=P[1];Object(o.useEffect)((function(){t.panel.position&&R({x:t.panel.position.x,y:t.panel.position.y})}),[null===(e=t.panel)||void 0===e||null===(n=e.position)||void 0===n?void 0:n.x,null===(i=t.panel)||void 0===i||null===(l=i.position)||void 0===l?void 0:l.y]);var F=function(t,e){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];t.touches&&(t=t.touches[0]);var o={x:t.clientX,y:t.clientY};return n&&(I.current={x:o.x-A.x,y:o.y-A.y}),o={x:o.x-I.current.x,y:o.y-I.current.y},R(o),o},L=Object(o.useRef)({x:-1,y:-1}),D=Object(o.useRef)(-1);Object(o.useEffect)((function(){var t=function(t){L.current={x:-1,y:-1}};return document.addEventListener("mouseup",t),function(){document.removeEventListener("mouseup",t)}}),[]);var M=Object(o.useState)(t.panel),z=Object(c.a)(M,2),B=(z[0],z[1],function(e){return function(){Object(j.d)((function(n){n.ui.floatingPanel.updatePanelLayout(t.panel.id,e)}))}}),W=Object(dt.a)((function(){T()}),500),U=function(){Object(j.d)((function(e){e.ui.floatingPanel.minimizePanel(t.panel.id)}))},H=t.panel.size.height;t.panel.ctagConfig&&(t.panel.ctagConfig.opts||(t.panel.ctagConfig.opts={}),t.panel.ctagConfig.opts.wrapperHeight="100%",t.panel.ctagConfig.opts.sandboxed=!1);var q=Object(o.useState)(!0),V=Object(c.a)(q,2),G=V[0],J=V[1],K=function(){t.highestVisibleZIndex!==t.panel.zIndex&&Object(j.d)((function(e){e.ui.floatingPanel.pushWindowOnTop(t.panel.id)}))},Y=!0===t.areWindowsOverlapping&&h&&t.panelsVisibleNumber>1&&t.highestVisibleZIndex!==t.panel.zIndex;Object(o.useEffect)((function(){var t=document.querySelector(".handle_invisible");if(t)return t.addEventListener("mousedown",(function(){Y=!0,v(!0)})),t.addEventListener("mouseup",(function(){v(!1)})),function(){t.removeEventListener("mousedown",(function(){Y=!0,v(!0)})),t.removeEventListener("mouseup",(function(){v(!1)}))}}));var $=Object(o.useState)(Object(Lt.a)()),Z=Object(c.a)($,2),X=Z[0];Z[1];t.panel.ctagConfig&&(t.panel.ctagConfig.opts||(t.panel.ctagConfig.opts={}),t.panel.ctagConfig.opts.windowId=X);var Q="type-".concat(t.panel.type," ").concat(null!==(u=t.panel.ctagConfig)&&void 0!==u&&u.tagName?"ctag-".concat(t.panel.ctagConfig.tagName):"");return Object(a.c)("div",{className:"floating-panel-wrapper ".concat(Q," ").concat(t.panel.status),style:{zIndex:t.panel.zIndex,position:"absolute",top:A.y,left:A.x,opacity:t.panel.opacity},key:t.panel.id,onMouseDown:function(){K()}},Object(a.c)(Qt.DraggableCore,{cancel:"body",handle:".handle",onStart:function(e,n){Object(r.e)()||(p(Object(s.a)(Object(s.a)({},t.panel),{},{position:F(e,n,!0)})),k())},onDrag:function(e,n){Object(r.e)()||p(Object(s.a)(Object(s.a)({},t.panel),{},{position:F(e,n)}))},onStop:function(e,n){Object(r.e)()||(T(),p(Object(s.a)(Object(s.a)({},t.panel),{},{position:F(e,n)})))}},Object(a.c)(Xt.a,{boundsByDirection:!0,className:"floating-panel",size:t.panel.size,onResize:function(e,n,o,i){Object(r.e)()||(-1===L.current.x&&(L.current={x:A.x,y:A.y}),D.current=-D.current,p("top"===n||"left"===n?Object(s.a)(Object(s.a)({},t.panel),{},{position:{x:L.current.x-i.width,y:L.current.y-i.height},size:{width:o.offsetWidth+D.current,height:o.offsetHeight}}):Object(s.a)(Object(s.a)({},t.panel),{},{size:{width:o.offsetWidth+D.current,height:o.offsetHeight}})),k(),W())}},Object(a.c)("div",{className:"floating-panel__wrapper"},Object(a.c)("div",{className:"handle_invisible handle"}),Object(a.c)("div",{className:"floating-panel__actions"},t.areWindowsOverlapping,Object(a.c)(b.a,{class:"floating-bar-toolbar",size:1,buttons:["desktop"===Object(r.a)()?{title:"Minimize",icon:"window-minimize",action:U}:{},{title:"Maximize",icon:"expand",customHtml:Object(a.c)("div",{className:"list-layout-floating-wrapper"},Object(a.c)("div",{className:"icon-wrapper",onClick:B("full")},Object(a.c)(y.b,{name:"expand"})),Object(a.c)("ul",null,Object(a.c)("span",{onClick:B("top")}," ",Object(a.c)(y.a,{name:"custom_icons/top.png"})," "),Object(a.c)("span",{onClick:B("bottom")}," ",Object(a.c)(y.a,{name:"custom_icons/bottom.png"})),Object(a.c)("span",{onClick:B("left")}," ",Object(a.c)(y.a,{name:"custom_icons/left.png"})),Object(a.c)("span",{onClick:B("right")}," ",Object(a.c)(y.a,{name:"custom_icons/right.png"})),Object(a.c)("br",null),Object(a.c)("span",{onClick:B("top-right")}," ",Object(a.c)(y.a,{name:"custom_icons/top-right.png"})),Object(a.c)("span",{onClick:B("bottom-right")}," ",Object(a.c)(y.a,{name:"custom_icons/bottom-right.png"})),Object(a.c)("span",{onClick:B("top-left")}," ",Object(a.c)(y.a,{name:"custom_icons/top-left.png"})),Object(a.c)("span",{onClick:B("bottom-left")}," ",Object(a.c)(y.a,{name:"custom_icons/bottom-left.png"})))),action:function(){}},"ctag"===t.panel.type?{title:"Reload content",icon:"rotate-right",action:function(){J(!1),setTimeout((function(){J(!0)}),100)}}:{},{title:"Close window",icon:"xmark",action:function(){Object(j.d)((function(e){e.ui.floatingPanel.delete(t.panel.id)}))}}]})),Object(a.c)("div",{className:"floating-panel__content content-type-".concat(t.panel.type),style:{height:"ctag"===t.panel.type?H-30:H,top:"ctag"===t.panel.type?30:0},onMouseDown:function(t){K()},onMouseEnter:function(){v(!0)},onMouseLeave:function(){v(!1)}},Object(a.c)("div",{className:"floating-panel__drag-overlay ".concat(x?"":"hide"," ").concat(Y?"hover-mode":""),onMouseDown:function(){K(),v(!1)}}),"file"===t.panel.type&&t.panel.file&&Object(a.c)("div",{className:"floating-panel__inner-content"},Object(a.c)(zt,{noteParentType:"floating",windowId:t.panel.id||Object(Lt.a)(),file:t.panel.file,height:t.panel.size.height,view:t.panel.view||"editor",searchedString:t.panel.searchedString,replacementString:t.panel.replacementString,titleEditor:"disabled",isActive:t.panel.isTopWindow,onLayoutUpdate:function(t,e){"windowViewChange"===t&&null!==e&&void 0!==e&&e.view&&p(Object(s.a)(Object(s.a)({},d.current),{},{view:e.view}))}})),"ctag"===t.panel.type&&t.panel.ctagConfig&&G&&Object(a.c)("div",{className:"floating-panel__inner-content ctag window-id-sizeref-".concat(X),style:{height:H}},Object(ee.a)(t.panel.ctagConfig)))))))},le=function(t){var e=Object(et.a)(t.panels)?t.panels:[],n=Object(o.useRef)([]);Object(o.useEffect)((function(){n.current=e}),[e]);var i=function(t){Object(j.d)((function(e){e.ui.floatingPanel.update(t)}))},l=function(t,e){Object(j.d)((function(n){n.ui.floatingPanel.actionAll(t,e)}))},s=Object(o.useState)(!1),u=Object(c.a)(s,2),d=u[0],p=u[1],f=Object(o.useRef)(d),b=function(t){f.current=t,p(t)},g=function(){b(!f.current)},h=Object(o.useRef)(0),m=Object(o.useRef)(0);Object(o.useEffect)((function(){!0===d&&e.length>h.current&&b(!1),0===e.length&&b(!1);var t=e.filter((function(t){return"visible"===t.status}));t.length>m.current&&b(!1),m.current=t.length,h.current=e.length}),[e]);var v=function(t){Object(j.d)((function(e){e.ui.floatingPanel.updatePanelLayout("active",t)}))},w=[["alt+q",function(){g()}],["alt+w",function(){l("toggleWindowsLayout")}],["alt+shift > m",function(){l("minimizeActive")}],["alt+shift > c",function(){l("closeActive")}],["alt+ctrl > c",function(){l("closeActive")}],["alt+shift > w",function(){l("toggleWindowsLayout",{layout:"current"})}],["ctrl + up",function(){v("top")}],["ctrl + down",function(){v("bottom")}],["ctrl + left",function(){v("left")}],["ctrl + right",function(){v("right")}],["shift + ctrl + up",function(){v("top-left")}],["shift + ctrl + right",function(){v("top-right")}],["shift + ctrl + left",function(){v("bottom-left")}],["shift + ctrl + down",function(){v("bottom-right")}],["alt+shift > s",function(){l("toggleWindowsLayout",{layout:"current"})}]];Object(o.useEffect)((function(){return w.forEach((function(t){Object(pt.a)(t[0],t[1])})),function(){w.forEach((function(t){Object(pt.c)(t[0],t[1])}))}}),[e]);var O=Object(o.useState)(!1),x=Object(c.a)(O,2),_=x[0],k=x[1],C=function(t){return function(){k("start"===t)}},S=Object(o.useState)(!1),E=Object(c.a)(S,2),T=E[0],I=E[1],N=Object(o.useRef)(!1);Object(o.useEffect)((function(){if(!T&&!N.current&&0!==n.current.length){var t=Object(R.a)(n.current);Object(et.a)(t)||(t=[]),I(!0),N.current=!0,t.forEach((function(t){"minimized"===t.status&&(t.status="hidden")})),Object(j.d)((function(e){e.ui.floatingPanel.updateAll(t)}))}}),[T,e]);var P=Object(o.useState)([]),A=Object(c.a)(P,2),F=A[0],L=A[1],D=Object(o.useState)(0),M=Object(c.a)(D,2),z=M[0],B=M[1],W=Object(o.useState)(0),U=Object(c.a)(W,2),H=U[0],q=U[1],V=Object(dt.a)((function(){var t=0;e.forEach((function(e){void 0!==e.zIndex&&e.zIndex>t&&(t=e.zIndex)})),B(t),q(e.filter((function(t){return"visible"===t.status})).length);var o=Object(R.a)(n.current),i=o.filter((function(t){return"minimized"===t.status})),c=o.filter((function(t){return"hidden"===t.status})),a=o.filter((function(t){return"visible"===t.status})),r=i.concat(c).concat(a);r=Object(ne.a)(r,(function(t){return t.orderPosition})),L(r)}),100);Object(o.useEffect)((function(){V()}),[e]);var G=Object(o.useState)(!1),J=Object(c.a)(G,2),K=J[0],Y=J[1],$=Object(dt.a)((function(t){Y(Object(te.a)(t))}),100);return Object(o.useEffect)((function(){$(e)}),[e]),Object(a.c)("div",{className:"floating-panels-wrapper",style:{pointerEvents:_?"all":"none"}},Object(et.a)(e)&&e.map((function(t){return"hidden"!==t.status&&t.device===Object(r.a)()&&Object(a.c)("div",{key:t.id,className:"".concat(d?"forceHide":"")},Object(a.c)(re,{panel:t,onPanelUpdate:i,onPanelDragStart:C("start"),onPanelDragEnd:C("end"),areWindowsOverlapping:K,panelsVisibleNumber:H,highestVisibleZIndex:z}))})),"desktop"===Object(r.a)()&&Object(a.c)("div",{className:"panels-minimized-bottom-bar-wrapper",style:{height:"".concat(35+ce(),"px"),bottom:"-".concat(ce(),"px")}},Object(a.c)("div",{className:"panels-minimized-bottom-bar-background ".concat(t.pinStatus?"pinned":"")}," "),Object(a.c)("div",{className:"bottom-hover-bar"}," "),Object(a.c)("div",{className:"panels-minimized-bottom-bar ".concat(t.pinStatus?"pinned":""),style:{width:"".concat(e.length>8?15*e.length:100,"%")}},Object(a.c)("div",{className:"floating-panels-bottom-toolbar"},Object(a.c)("div",{className:"btn-action reinit-position-and-size",onClick:function(t){l("toggleWindowsLayout")}},Object(a.c)(y.b,{name:"layer-group"})," "),Object(a.c)("div",{className:"btn-action toggle-visibility",onClick:g}," ",!0===d?Object(a.c)(y.b,{name:"eye-slash"}):Object(a.c)(y.b,{name:"eye"})," "),Object(a.c)("div",{className:"btn-action pin-bar",onClick:function(){return t.onPinChange(!t.pinStatus)}}," ",Object(a.c)(y.b,{name:"thumbtack"})," ")),F.map((function(t){return"visible"!==t.status&&Object(a.c)("div",{key:t.id,className:"panel-minimized ".concat("minimized"===t.status?"active-tab":""),onClick:function(e){!function(t){t.status="visible",i(t),Object(j.d)((function(e){e.ui.floatingPanel.pushWindowOnTop(t.id),e.ui.floatingPanel.updateOrderPosition(t.id,"first"),e.ui.floatingPanel.resizeWindowIfOutOfWindow(t.id)}))}(t)}},Object(a.c)("div",{className:"label-wrapper"},Object(a.c)("div",{className:"label",title:ae(t)},ae(t))),Object(a.c)("div",{className:"close-btn",onClick:function(e){e.stopPropagation(),"minimized"===t.status?function(t){t.status="hidden",i(t)}(t):function(t){Object(j.d)((function(e){e.ui.floatingPanel.delete(t.id)}))}(t)}},Object(a.c)(y.b,{name:"xmark"})))})))))};const se={charsStart:2},ue=[{label:"loading...",value:""}],de="[\ud83d\udd0e Search Mode]",pe="[\ud83d\udcc1 Explorer Mode]",fe="[\u2728 History Mode]",be="[\ud83d\udd0c Plugin Mode]",ge="[\ud83d\udda5\ufe0f Floating Windows]",he="[\ud83d\udd0d File Search Mode]",me={dict:{},config:{enabled:!0}},ve=()=>{me.config.enabled=!1,me.dict={}},we={hasBeenLoaded:!1},Oe=t=>{const e=Object(o.useState)("editable"),n=Object(c.a)(e,2),i=n[0],l=n[1];Object(o.useEffect)((()=>{L.current.focus()}),[i]);const u=Object(o.useState)([]),p=Object(c.a)(u,2),f=p[0],b=p[1],g=Object(o.useRef)([]),h=t=>{Object(et.a)(t)&&(b(t),g.current=t)},m=Object(o.useState)([]),v=Object(c.a)(m,2),w=v[0],O=v[1],x=t=>{oe(t),O(t)},_=Object(o.useState)("No Options"),k=Object(c.a)(_,2),C=k[0],S=(k[1],e=>{Object(j.d)((n=>{n.ui.note.editorAction.dispatch({type:"insertText",insertText:Object(Wt.a)(e)}),t.onClose()}))}),E=e=>{Object(j.d)((n=>{n.ui.floatingPanel.create({type:"file",file:e}),t.onClose()}))},T=t=>{const e=Object(o.useState)(!1),n=Object(c.a)(e,2),i=n[0],l=n[1];return Object(o.useMemo)((()=>Object(a.c)("div",{className:"path-option-wrapper device-".concat(Object(r.a)()),onMouseEnter:t=>{l(!0)},onMouseLeave:t=>{l(!1)}},Object(a.c)("div",{className:"file"},t.file.name),Object(a.c)("div",{className:"folder"},t.file.folder),i&&Object(a.c)("div",{className:"actions"},Object(a.c)("div",{className:"action",onClick:e=>{e.stopPropagation(),S(t.file)}},Object(a.c)(y.b,{name:"link",label:"insert note link in the current note"})),Object(a.c)("div",{className:"action",onClick:e=>{e.stopPropagation(),E(t.file)}},Object(a.c)(y.b,{name:"window-restore",label:"Open note in a floating window"}))))),[t.file,i])},I=t=>Object(a.c)(T,{file:t}),N=window.innerHeight-160-200,P=(Object(o.useRef)(!1),Object(o.useState)({indicatorsContainer:(t,e)=>Object(s.a)(Object(s.a)({},t),{},{display:"none"}),menuList:(t,e)=>{let n="mobile"===Object(r.a)()?{}:{maxHeight:N};return Object(s.a)(Object(s.a)({},t),n)},menu:(t,e)=>{let n="mobile"===Object(r.a)()?"all":"none";return Object(s.a)(Object(s.a)({},t),{},{position:"relative",pointerEvents:n})},control:(t,e)=>Object(s.a)(Object(s.a)({},t),{},{outline:"none",boxShadow:"none",border:0}),multiValue:(t,e)=>e.data.editable?t:Object(s.a)(Object(s.a)({},t),{},{backgroundColor:d.a.colors.main}),multiValueLabel:(t,e)=>{let n=Object(s.a)(Object(s.a)({},t),{},{color:"#919090!important"});return Object(s.a)({},n)},multiValueRemove:(t,e)=>{let n="mobile"===Object(r.a)()?"block":"none";return e.data.editable?t:Object(s.a)(Object(s.a)({},t),{},{display:n,opacity:"0.2",position:"relative",top:"3px"})}})),A=Object(c.a)(P,2),R=A[0],F=A[1];Object(o.useEffect)((()=>{setTimeout((()=>{R.menu=(t,e)=>{let n=(Object(r.a)(),"all");return Object(s.a)(Object(s.a)({},t),{},{position:"relative",pointerEvents:n})},F(R)}),500)}),[]);const L=Object(o.useRef)();let D=w[0]||{label:"",value:""};const M=e=>{let n=Object(tt.e)(e);z.current?(console.log("jumpToFileModifier",z.current),t.onClose(),E(n)):Object(j.d)((e=>{e.ui.browser.goTo(n.folder,n.name,{openIn:"activeWindow"}),t.onClose()}))},z=Object(o.useRef)(!1),B=["alt"],W=[()=>{z.current=!0}];Object(o.useEffect)((()=>(B.forEach(((t,e)=>{Object(pt.a)(t,W[e])})),()=>{B.forEach(((t,e)=>{Object(pt.c)(t,W[e])}))})),[]);const U=Object(o.useState)(""),H=Object(c.a)(U,2),q=H[0],V=H[1],G=Object(o.useRef)(null);Object(o.useEffect)((()=>{G.current=q}),[q]);const J=Object(o.useRef)(""),K=Object(Ut.a)("omni-history",[],{history:!0}),Y=Object(c.a)(K,3),$=Y[0],Z=Y[1],X=Y[2];Object(o.useEffect)((()=>{(()=>{let e=g.current,n=q.trim();if(xe("editor"),0===e.length)"/"===n&&(Object(Bt.a)("omnibar_explorer"),Object(j.d)((t=>{V("");let e=t.ui.browser.folders.current.get();gt(e)}))),""===n&&kt(),";"===n&&(V(""),_e()),"?"===n&&(Object(Bt.a)("omnibar_search"),ht()),":"===n&&yt(),","===n&&rt(),"."===n&&(Object(Bt.a)("omnibar_file_search"),V(""),xt());else if(e[0].label===de)wt(e,n);else if(e[0].label===pe){var o;const n=()=>{let t=[...e];t.shift();let n="";return Object(mt.a)(t,(t=>{n+="/"+t.value})),n};let i=n();if("createNewFile"===(null===(o=e[e.length-1].payload)||void 0===o?void 0:o.action))console.log("create new file in folder"+i),t.onNoteCreate(i),t.onClose();else if(i.endsWith(".md")){const t=[...e];t.pop(),""===q&&t.push({label:q,value:q}),lt(t),i=i.replace(e[0].label,""),M(i)}else J.current!==i&&(J.current=i,gt(i))}else e[0].label===be?Ct(n,e):e[0].label===fe?st(n,e):e[0].label===ge?ke(n,e):e[0].label===he&&_t(e,n)})(),St.current&&St.current()}),[f,q]);const Q=t=>t.replaceAll("[","").replaceAll("]",""),nt='[OMNIBAR "ctrl+alt+space"] type "?" for '.concat(Q(de),', "/" for ').concat(Q(pe),', "." for ').concat(Q(he),', ":" for ').concat(Q(be),', "," for ').concat(Q(fe),', ";" for ').concat(Q(ge)),ot=Object(o.useState)(nt),it=Object(c.a)(ot,2),ct=it[0],at=it[1],rt=()=>{h([{value:fe,label:fe}])};Object(o.useEffect)((()=>{we.hasBeenLoaded||(X(),bt.current=window.__Tiro_omniCacheFoldersRam,we.hasBeenLoaded=!0)}),[]);const lt=t=>{console.log("1/2 [HIST mode]: addToOmniHistory",[...t]);let e=[];Object(mt.a)(t,(t=>{e.push(t.label)}));const n=e.join(" "),o={options:t,id:n},i=[o,...(Array.isArray($)?$:[]).filter((t=>t.id!==n))];i.length>100&&i.splice(0,100),console.log("2/2 [HIST mode] add to omnihist ",{nItem:o,nItems:i}),Z(i)},st=(t,e)=>{if(Mt(null),e[1]){if(e[1]){var n;console.log("HIST selected",e[1]);let t=null===(n=e[1].payload)||void 0===n?void 0:n.options;if(!t)return;let o=t.pop();o&&V(o.label),h(t)}}else at("loading history mode..."),X((t=>{let e=[];Object(mt.a)(t,(t=>{e.push({label:t.id,value:t.id,payload:t})})),at("history mode"),x(e)})),","===t&&V("")},ut=Object(o.useRef)(0),ft=Object(o.useRef)(""),bt=Object(o.useRef)(window.__Tiro_omniCacheFoldersRam||{}),gt=t=>{let e=Object(tt.b)(t),n='Explorer mode for "'.concat(e,'"'),o='Loading explorer mode for "'.concat(e,'"...');if(at(n),""===t)return;if(t.endsWith("/")||(t+="/"),t===ft.current)return;ft.current=t,console.log("== EXPLORER",t),x(ue),l("locked"),ut.current++;let i=ut.current;if(bt.current[t]){console.log("[OMNI > EXPLORER] using cache for ".concat(t));let e=bt.current[t];for(let t=0;t<e.length;t++){var c;let n=e[t];n.label.props&&(e[t].label=I(null===n||void 0===n||null===(c=n.payload)||void 0===c?void 0:c.file))}x(e)}let r=t.split("/"),s=[];s.push({value:pe,label:pe}),s.push({value:"/",label:"/"}),Object(mt.a)(r,(t=>{""!==t&&s.push({value:t,label:t+"/"})})),h(s),Object(j.d)((e=>{at(o);let c=[t];e.folders.get(c,(o=>{if(i!==ut.current)return;if(o.folderPaths.join("")!==c.join(""))return;if(!o.folders[0])return;let r=o.folders[0].children;e.files.get(t,((e,o)=>{if(o!==t)return;let i=[];Object(a.c)("div",{style:{},className:"barimage"});i.push({value:"",label:"\u2795 create file",payload:{action:"createNewFile"}}),Object(mt.a)(r,(t=>{let e=t.path.split("/"),n=e[e.length-1]+"/";i.push({value:n,label:"\ud83d\udcc1 "+n})})),e=Object(Ft.a)(e,["modified"],["desc"]),Object(mt.a)(e,(t=>{let e=t.path.split("/"),n=e[e.length-1],o={file:t},c=I(t);i.push({value:n,label:c,payload:o})})),x(i),l("editable"),bt.current[t]=i,window.__Tiro_omniCacheFoldersRam=bt.current,at(n)}))}))}))},ht=()=>{h([{value:de,label:de}])},vt=Object(o.useRef)(""),wt=(t,e)=>{if(t[1]){if(2===t.length)xe("editor"),jt(e,t[1].label,t);else if(3===t.length&&Ot.current===t[2].value)xe("preview"),console.log("STEP 3-1 (optional) : filter found results",Ot.current);else if(3===t.length||4===t.length){var n;console.log("STEP 3-2 : jump to page",{w:Ot.current,stags:t});let e=t.length-1;if(null===(n=t[e].payload)||void 0===n||!n.file)return;let o=t[e].payload.file;M(o.path)}}else"?"===e&&Object(j.d)((t=>{let e=t.ui.browser.folders.current.get;V(e)})),""===e?V(vt.current):vt.current=e.slice(0,-1),at('Path to search (ex:"/path/to/folder") + ENTER'),x([{label:e,value:e}])},Ot=Object(o.useRef)(null),jt=Object(dt.a)(((t,e,n)=>{let o=e,i=t;if(i&&o&&i.length>=se.charsStart&&o.length>0){at('Searching "'.concat(i,'" in "').concat(o,'" ...')),x(ue);let t=i.includes("*"),e=[];x(e),Ot.current=i,lt([...n,{label:i,value:i}]),Object(j.d)((n=>{n.search.word(i,o,(n=>{Object(mt.a)(n,(n=>{Object(mt.a)(n.results,(o=>{let c=t?"(".concat(i,")"):"",r="".concat(n.file.path," ").concat(c),l=o.indexOf(i),s=100,u=o,d=l>50?l-50:0,p=l+50<u.length?l+50:u.length;u.length>s&&(u=u.substring(d,p));let f=u,b=u.replaceAll(i,"<b>".concat(i,"</b>")),g=Object(a.c)("div",{className:"path-option-wrapper"},Object(a.c)("div",{className:"search-location"},r),Object(a.c)("div",{className:"occur-wrapper",dangerouslySetInnerHTML:{__html:b}}));e.push({label:g,value:Ot.current+n.file+f+r,payload:{file:n.file,line:f,raw:o}})}))})),0===e.length&&Mt(null),e.unshift({label:"\ud83d\udd0e Filter the ".concat(e.length,' results for "').concat(Ot.current,'"'),value:Ot.current}),at("".concat(e.length-1,' results found for "').concat(i,'" in "').concat(o,'" ')),x(e)}))}))}else at("Type the searched word"),x([]),setTimeout((()=>{L.current.focus()}),100),Mt(null),Ot.current=""}),500),xt=()=>{h([{value:he,label:he}])},_t=(e,n)=>{e[1]||(at('Searching "'.concat(n,'" in active file...')),x([{label:n,value:n}]),n&&n.trim().length>=se.charsStart&&(Object(j.d)((t=>{t.ui.note.editorAction.dispatch({windowId:"active",type:"searchWord",searchWordString:n.trim()})})),t.onClose()))},kt=()=>{var e;at(nt);let n=(t=>{let e=[];return Object(mt.a)(t,(t=>{let n={value:t.path,label:I(t),payload:{file:t}};e.push(n)})),e})(function(t){var e=Zt(),n=e.workModeEnabled,o=e.workModeFilters,i=e.workModeFiltersArr;if(!n)return t;var c=[];return Object(mt.a)(i,(function(e){var n=t.filter((function(t){return t.name.toLowerCase().includes(e)||t.path.toLowerCase().includes(e)}));c.push.apply(c,Object(Yt.a)(n))})),console.log("".concat("[WORK MODE]"," filtered ").concat(t.length," files to ").concat(c.length," files with work mode filters ").concat(o)),c}(t.lastNotes));if(n.length>=2){let t=n.shift(),e=n.shift();n.unshift(t),n.unshift(e)}let o=n[0]?null===(e=n[0].payload)||void 0===e?void 0:e.file:null;o&&Mt(o),x(n)},yt=()=>{h([{value:be,label:be}])},Ct=(e,n)=>{Mt(null),Object(j.d)((o=>{if(1===n.length){let t=[];o.plugins.list((n=>{Object(mt.a)(n,(e=>{"bar"===e.type&&t.push({label:e.name,value:e})})),x(t),":"===e&&V(""),t=Object(Ft.a)(t,["label"]),at("".concat(t.length," bar plugins found"))}))}else if(n.length>=2){let o={input:e,setInputTxt:V,inputTxt:q,inputTxtRef:G,options:w,setOptions:x,onChange:St,onClose:t.onClose,onHide:t.onHide,close:t.onClose,hide:t.onHide,selectedOptionRef:g,setSelectedOption:h,addToOmniHistory:lt,selectedTags:n,setNotePreview:Mt,notePreview:At,setHtmlPreview:Gt,htmlPreview:Vt,disableCache:ve},i=n[1].value;x(ue),Object(j.d)((t=>{Jt(i,{barApi:o,tiroApi:t})}))}}))},St=Object(o.useRef)(null),Et=Object(o.useState)(Object(Lt.a)()),Tt=Object(c.a)(Et,2),It=Tt[0],Nt=(Tt[1],Object(o.useState)(null)),Pt=Object(c.a)(Nt,2),At=Pt[0],Dt=Pt[1],Mt=t=>{Dt(t)},Ht=Object(o.useState)(null),qt=Object(c.a)(Ht,2),Vt=qt[0],Gt=qt[1],Kt=Object(o.useState)(void 0),$t=Object(c.a)(Kt,2),Xt=$t[0],Qt=$t[1],te=(t,e)=>{let n=g.current;n[0]&&n[0].label===pe?Mt(t):n[0]&&n[0].label===de?(Mt(t),setTimeout((()=>{Qt(e)}),300)):n[0]?Mt(null):Mt(t)};let ee=Object(o.useRef)([]);const ne=Object(dt.a)((()=>{const t=document.querySelectorAll("div[id*='-option']");if(0===t.length)return Mt(null);Object(mt.a)(t,(t=>{if("rgb(222, 235, 255)"===getComputedStyle(t)["background-color"]){let e=parseInt(t.id.split("-").pop()),n=w[e].payload;if(!n)return;let o=n.file,i=n.line||void 0;te(o,i)}}))}),400),oe=Object(dt.a)((t=>{(t=>{Object(mt.a)(ee.current,(t=>{t.disconnect()})),ee.current=[];const e=document.querySelectorAll("div[id*='-option']");Object(mt.a)(e,((t,e)=>{const n=new MutationObserver((e=>{let n=parseInt(t.id.split("-").pop());if("rgba(0, 0, 0, 0)"!==getComputedStyle(t)["background-color"]&&w[n]&&w[n].payload){let t=w[n].payload;if(!t)return;let e=t.file,o=t.line||void 0;document.querySelectorAll("div[id*='-option']"),te(e,o)}}));n.observe(t,{childList:!0,attributes:!0,subtree:!1}),ee.current.push(n)}))})()}),100);Object(o.useEffect)((()=>{oe(w)}),[w,q,$]);const ie=Object(o.useState)(300),ce=Object(c.a)(ie,2),re=ce[0],le=ce[1],me=Object(o.useRef)(null);Object(dt.a)((()=>{if(me&&me.current){let t=me.current.clientHeight+30,e=window.innerHeight-t-50;re!==e&&le(e)}}),10)();const Oe=Object(o.useState)("editor"),je=Object(c.a)(Oe,2),xe=(je[0],je[1]),_e=()=>{h([{value:ge,label:ge}]),Object(j.d)((t=>{let e=[];x(e),Object(mt.a)(t.ui.floatingPanel.panels,(t=>{"visible"!=t.status&&e.push({label:ae(t),value:t,payload:{floatingPanel:t}})})),x(e),at("".concat(e.length," floating windows found"))}))},ke=(e,n)=>{if(Mt(null),2===n.length){var o;let e=null===(o=n[1].payload)||void 0===o?void 0:o.floatingPanel;if(!e)return;Object(j.d)((t=>{t.ui.floatingPanel.deminimizePanel(e.id)})),t.onClose()}};return Object(a.c)("div",{className:"omnibar-popup-bg ".concat(t.show?"":"hide"),onClick:e=>{t.onClose()}},Object(a.c)("div",{className:"omnibar-popup-wrapper device-".concat(Object(r.a)()," ").concat(i)},Object(a.c)("div",{className:"flex-wrapper",onClick:t=>{t.stopPropagation()}},Object(a.c)("div",{className:"select-wrapper",ref:me},Object(a.c)("div",{className:"help"},ct),Object(a.c)("div",{className:"help-right",onClick:e=>{t.onHide()}},Object(a.c)(y.a,{name:"faEyeSlash",color:"#b2b2b2"})),Object(a.c)(Rt.a,{isMulti:!0,ref:L,menuIsOpen:!0,defaultValue:D,value:f,autoFocus:!0,isDisabled:"locked"===i,onChange:(t,e)=>{let n=t[0];if(n&&n.payload&&n.payload.file){let e=n.payload.file;M(e.path),t=[]}h(t)},openMenuOnClick:!1,inputValue:q,onInputChange:(t,e)=>{ne(),"input-blur"===e.action||"menu-close"===e.action||V(t)},onFocus:t=>{},options:w,styles:R,noOptionsMessage:()=>C})),At&&"mobile"!==Object(r.a)()&&Object(a.c)("div",{className:"preview-wrapper ".concat(At?"note-preview":"html-preview-wrapper"),style:{height:re}},At&&"mobile"!==Object(r.a)()&&Object(a.c)(zt,{noteParentType:"omnibar",file:At,showToolbar:!0,titleEditor:!1,searchedString:Xt,height:re,windowId:It}),Vt&&Object(a.c)("div",{className:"html-preview",dangerouslySetInnerHTML:{__html:Vt},style:{height:re}})))))};var je=function(t){var e=Object(o.useState)(""),n=Object(c.a)(e,2),r=n[0],l=n[1];return Object(o.useEffect)((function(){Object(j.d)((function(e){e.file.getContent(t.filePath,(function(n){var o=Object(tt.e)(t.filePath),i=e.note.render({raw:n,file:o});l(i)}))}))}),[t.filePath]),Object(a.c)(i.a.Fragment,null,Object(a.c)("div",{className:"rendered-note-component"},Object(a.c)("span",{className:"rendered-note-content-wrapper",dangerouslySetInnerHTML:{__html:r}})))},xe=function(t){return Object(a.c)(i.a.Fragment,null,Object(a.c)("div",{className:"shortcut-component"},Object(a.c)("h3",{className:"subtitle"},"shortcuts"),Object(a.c)(je,{filePath:t.filePath})))},_e=n(157),ke=n(250),ye=n(238),Ce=n(242),Se="[NOTIFICATIONS]";Object(qt.a)("notification","emit",(function(t,e){var n=t||"";Object(j.d)((function(o){console.log(t,e),o.ui.notification.emit({content:(new Date).toJSON()+" \n\n <br/> test notif => \n"+n,options:Object(s.a)({},e)})}))}));var Ee=function(t){var e=Object(o.useState)([]),n=Object(c.a)(e,2),i=n[0],r=n[1],l=Object(o.useRef)([]);Object(o.useEffect)((function(){Object(j.d)((function(t){t.socket.get((function(t){t.on("getNotification",(function(t){var cb;cb=function(e){return!0===!e?console.log("[NOTIFS] notifications disabled, not displaying it"):function(t){var e=Zt(),n=e.workModeEnabled,o=(e.workModeFilters,e.workModeFiltersArr);if(!n)return!0;var i=!1;return Object(mt.a)(o,(function(e){t.toLowerCase().includes(e)&&(i=!0)})),i}(t.notification.content)?(t.notification.id||(t.notification.id=Object(Lt.a)()),d(t.notification),void u(t.notification)):console.log("[NOTIFS] workMode not ok, not displaying it")},Object(j.d)((function(t){cb(!t.userSettings.get("view_disable_notification_popups"))}))}))}))}))}),[]);var s=Object(o.useRef)({}),u=function(t){var e,n=1e3*((null===(e=t.options)||void 0===e?void 0:e.hideAfter)||10);n<0||t.id&&(s.current[t.id]=setTimeout((function(){f(t.id)}),n))},d=function(t){l.current=l.current.filter((function(e){return e.id!==t.id})),t.id&&s.current[t.id]&&clearTimeout(s.current[t.id]),l.current.unshift(t),r(Object(Yt.a)(l.current))},p=function(t){var e,n;null!==(e=t.options)&&void 0!==e&&e.onClickId&&function(t){console.log(Se,"triggerNotifOnClick => ",t);var e=Ce.a[t];e?e():console.log(Se,"no fn found for idFn",t)}(null===(n=t.options)||void 0===n?void 0:n.onClickId)},f=function(t){t&&(l.current=l.current.filter((function(e){return e.id!==t})),r(Object(Yt.a)(l.current)))},b=function(t){var e,n,o="normal";return null!==(e=t.options)&&void 0!==e&&e.type&&(o=null===(n=t.options)||void 0===n?void 0:n.type),o};return Object(a.c)("div",{className:"notifications-center-wrapper"},Object(a.c)("div",{className:"notifications-list"},i.map((function(t){return Object(a.c)("div",{key:t.id,className:"notif-wrapper notif-type-".concat(b(t)),onClick:function(e){p(t),f(t.id)}},Object(a.c)("div",{className:"notif-close",onClick:function(e){f(t.id)}},Object(a.c)(y.b,{name:"close"})),Object(a.c)("div",{className:"notif-content",dangerouslySetInnerHTML:{__html:t.content}}))}))))},Te=n(230),Ie=n(76),Ne=function(t){var e,n,i=Object(tt.e)(t.notePreview.filepath);Object(o.useEffect)((function(){u("note-preview-popup-wid-".concat(Object(Lt.a)()))}),[]);var r=Object(o.useState)(""),l=Object(c.a)(r,2),s=l[0],u=l[1];return Object(a.c)("div",{className:"page-link-preview-popup-ext",onMouseLeave:function(t){Object(j.d)((function(t){t.ui.notePreviewPopup.close()}))},style:{left:t.notePreview.position[0],top:t.notePreview.position[1]}},Object(a.c)("div",{className:"click-throught",onClick:function(e){var n,o=Object(tt.e)(t.notePreview.filepath);o&&null!==(n=t.notePreview.opts)&&void 0!==n&&n.windowIdToOpenIn&&(Object(Ie.d)(!0),Object(j.d)((function(e){var n;e.ui.browser.goTo(o.folder,o.name,{openIn:null===(n=t.notePreview.opts)||void 0===n?void 0:n.windowIdToOpenIn})})))}}),Object(a.c)("div",{className:"page-link-preview-popup-int"},Object(a.c)(zt,{noteParentType:"popup",file:i,searchedString:null===(e=t.notePreview.opts)||void 0===e?void 0:e.searchedString,replacementString:null===(n=t.notePreview.opts)||void 0===n?void 0:n.replacementString,windowId:s,showToolbar:!0,titleEditor:!1,view:"editor",linkPreview:!1})))},Pe=400,Ae=300,Re=n(127),Fe=n(92),Le=n(102),De=window._tiro_generatePluginsMarketplaceHtml?window._tiro_generatePluginsMarketplaceHtml:function(){},Me=function(t){var e=Object(o.useState)([]),n=Object(c.a)(e,2),i=n[0],r=n[1],l=Object(o.useState)(""),s=Object(c.a)(l,2),u=s[0],d=s[1];return Object(o.useEffect)((function(){Object(j.d)((function(t){t.plugins.marketplace.fetchList((function(t){r(t);var e=De({pluginsDescriptions:t,fullDisplayMode:!0,onPluginClick:function(t){console.log("pluginClick",t)},onSettingChange:function(t){console.log("onSettingChange",t)}});d(e)}))}))}),[]),Object(a.c)("div",{className:"plugins-marketplace-popup-wrapper"},Object(a.c)(rt.a,{title:"Plugins Marketplace",onClose:function(){t.onClose()}},i.length>0&&Object(a.c)("div",{id:"plugin-marketplace-placeholder",dangerouslySetInnerHTML:{__html:u}}),0===i.length&&Object(a.c)("div",{className:"plugins-list-loading"},"Contacting Marketplace...")))},ze=n(141),Be=n(254),We=n(224),Ue=n(235),He=n(236),qe=n(241);const Ve=t=>{let e=t.url;e=e.trim(),e.includes("[[token]]")&&(e=e.replace("[[token]]",Object(z.b)()));let n=!1;e.includes("<")||e.includes(">")?n=!0:e.includes("?")?e+="&autoplay=1&mute=1":e+="?autoplay=1&mute=1";const l=Object(o.useState)(!1),s=Object(c.a)(l,2),u=s[0],d=s[1];return Object(o.useEffect)((()=>{setTimeout((()=>{d(!0)}),3e3)}),[]),Object(a.c)(i.a.Fragment,null,!Object(r.e)()&&Object(a.c)("div",{id:"background-video",className:"background-video ".concat(n?"html":"iframe"),style:{width:"".concat(t.width,"%"),height:"".concat(t.height,"%")}},u&&!n&&Object(a.c)("iframe",{title:"background video",src:"".concat(e),allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share"}),u&&n&&Object(a.c)("div",{className:"html-wrapper-raw",dangerouslySetInnerHTML:{__html:e}})))};var Ge=n(237),Je=n(239),Ke=(Object(r.a)(),Object(s.a)({},d.a)),Ye=Ke.els,$e=Ke.colors,Ze=(Ke.font,Ke.sizes),Xe=Object(Be.a)((function(t,e,n,o){return en(t,e,n,o)}),(function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return JSON.stringify(e)})),Qe=Object(Be.a)((function(t){return tn(t)}),(function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return JSON.stringify(e)})),tn=function(t){var e=Object(ze.a)("CssAppDynamic"),n=$t.d.curr.ui_layout_background_image_enable,o=$t.d.curr.ui_layout_background_image,i=100,c=$t.d.curr.ui_layout_background_video_enable;if(!0===n&&!1===c&&o){if(o.length>0){var a=o.indexOf("?token=");a>0&&(o=o.substring(0,a)),o+="?token=".concat(Object(z.b)())}o.startsWith("http")||(o="".concat(Object(L.a)(o)))}!0!==c&&!0!==n||(parseInt($t.d.curr.ui_layout_background_image_window_opacity)/100,i=parseInt($t.d.curr.ui_layout_background_image_window_opacity_active)/100);var l="\n\t\t// IMPORTANT for all height app\n\t\theight:100%;\n\t\t\n\t\t//\n\t\t// Background image\n\t\t//\n\t\t".concat(n?"background-image: url('".concat(o,"');"):"","\n\t\t\n\t\tbackground-size: cover;\n\t\t.react-grid-item {\n\t\t\topacity: ").concat("mobile"===Object(r.a)()?1:i,";\n\t\t}\n\t\t.react-grid-item.active {\n\t\t\topacity: ").concat("mobile"===Object(r.a)()?1:i,";\n\t\t}\n\t\t.floating-panel-wrapper {\n\t\t\topacity: ").concat("mobile"===Object(r.a)()?1:i,";\n\t\t}\n\n\t\t\n\n\t\t").concat("\n.html-wrapper-raw {\n width: 100%;\n height: 100%;\n}\n.background-video {\n position: fixed;\n}\n.background-video.iframe {\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n iframe {\n width: 100%;\n height: 100%;\n }\n}\n","\n\n\n\t\t// for preview css\n\t\t").concat(Object(Re.d)(),"\n\t\t// FILE RESSOURCE PREVIEW\n\t\t").concat(Object(Fe.b)(),"\n\t\t// PREVIEW LINK\n\t\t").concat(Object(Ie.b)(),"\n\t\t").concat(Object(Le.e)(),"\n\n\t\t").concat(Object(qe.b)(),"\n\n\t\t").concat(Object(y.c)(),"\n\t\t").concat(Object(Ue.a)(),"\n\t\t").concat("\n .mobile-view-preview {\n .page-link-preview-popup-int {\n .editor-area {\n display:block;\n }\n .preview-area-wrapper {\n display:none;\n }\n }\n }\n .page-link-preview-popup-ext {\n // pointer-events: none;\n position: absolute;\n z-index: 10001;\n .click-throught {\n cursor:pointer;\n position: absolute;\n top: 0px;\n left: 0px;\n width: 100%;\n height: 30px;\n }\n .page-link-preview-popup-int {\n cursor:default;\n margin-top: 20px;\n background: white;\n width: ".concat(Pe,"px;\n height: ").concat(Ae,"px;\n border-radius: 10px;\n box-shadow: 0px 0px 3px 1px rgba(0,0,0,0.1);\n overflow-y:hidden;\n overflow-x:hidden;\n .cm-scroller {\n width: calc(100% - 40px)!important;\n }\n\n // disable links inside\n .title-search-link {\n pointer-events: none;\n }\n }\n .\n }\n"),"\n\t\t").concat("\n .main-wrapper.view-image {\n .mobile-view-toggler {\n display: none;\n }\n \n .left-wrapper {\n width: ".concat("desktop"===Object(r.a)()?15:40,"vw ;\n .left-wrapper-1 {\n width: 100%\n }\n .left-wrapper-2 {\n display: none;\n }\n }\n\n\n .right-wrapper.draggable-grid-editors-view {\n display: none;\n }\n .right-wrapper {\n height: 100vh;\n }\n .right-wrapper.image-gallery-view {\n width: ").concat(100-("desktop"===Object(r.a)()?15:40),"vw;\n }\n }\n \n .main-wrapper.view-text {\n .right-wrapper.draggable-grid-editors-view {\n \n }\n .right-wrapper.image-gallery-view {\n display: none;\n }\n }\n"),"\n\t\t").concat("\n.notifications-center-wrapper {\n\t\tposition: fixed;\n\t\ttop: 0px;\n\t\tright: 0px;\n\t\tz-index: 20000;\n\n\t\t.notifications-list {\n\t\t\t\t// .notif-wrapper:hover {\n\t\t\t\t// \topacity: 0;\n\t\t\t\t// \tpointer-events: none;\n\t\t\t\t// }\n\t\t\t\t.notif-wrapper {\n\t\t\t\t\t\t// background: ".concat(d.a.colors.main,"; \n\t\t\t\t\t\tbackground: white;\n\t\t\t\t\t\tposition: relative;\n\t\t\t\t\t\tmargin: 5px;\n\t\t\t\t\t\tcursor: pointer;\n\n\n\t\t\t\t\t\tpadding: 5px;\n\t\t\t\t\t\tborder-radius: 5px;\n\t\t\t\t\t\tbox-shadow: 0px 0px 5px #0006;\n\t\t\t\t\t\t.notif-close {\n\t\t\t\t\t\t\t\tcursor: pointer;\n\t\t\t\t\t\t\t\tposition: absolute;\n\t\t\t\t\t\t\t\ttop: 3px;\n\t\t\t\t\t\t\t\tright: 5px;\n\t\t\t\t\t\t\t\tpadding: 5px;\n\t\t\t\t\t\t\t\tbackground: white;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t.notif-content {\n\t\t\t\t\t\t\t\tpadding: 5px 29px 5px 5px;\n\t\t\t\t\t\t\t\tmax-width: 200px;\n\t\t\t\t\t\t\t\tmax-height: 180px;\n\t\t\t\t\t\t\t\toverflow-y: auto;\n\t\t\t\t\t\t\t\tword-break: break-word;\n\t\t\t\t\t\t}\n\t\t\t\t}\n\t\t}\n}\n"),"\n\t\t").concat(Object(At.c)(),"\n\t\t").concat("\n.lightbox-component {\n\t.lightbox-main-image-wrapper {\n\t\theight: 100%;\n\t}\n\t.lightbox-images-thumbnail:hover {\n\t\tbottom: -17px;\n\t}\n\t.lightbox-images-thumbnail {\n\t\ttransition: all 0.3s;\n\t\t\n\t\tposition: absolute;\n\t\twidth: 100%;\n\t\theight: 100px;\n\t\tbottom: -117px;\n\t\tz-index: 10000;\n\t\t\n\t\t\n\t\tpadding-top: 50px;\n\t\toverflow-x: scroll;\n\t\toverflow-y: hidden;\n\t\t\n\t\t.lightbox-images-thumbnail-scroll {\n\t\t\tdisplay: flex;\n\t\t\tjustify-content: center;\n\t\t\talign-items: center;\n\t\t\theight: 70px;\n\t\t\t\n\t\t}\n\t\t\n\t\t.thumbnail {\n\t\t\t&.selected {\n\t\t\t\tborder: 2px solid white;\n\t\t\t}\n\t\t\tbackground-size: contain;\n\t\t\tbackground-repeat: no-repeat;\n\t\t\tbackground-position: center center;\n\t\t\tbackground-color: black;\n\t\t\tmargin: 0px 10px;\n\t\t\tborder-radius: 8px;\n\t\t\tmin-width: 120px;\n\t\t\tcursor: pointer;\n\t\t\twidth: 100%;\n\t\t\theight: 100%;\n\t\t\n\t\t}\n\t\n\t}\n\tfigure.zoom2 {\n\t\tdisplay: flex;\n\t\tjustify-content: center;\n\t\tposition: relative;\n\t\t\n\t\tbackground-repeat: no-repeat;\n\t\tmargin: 0px;\n\t\twidth: 100%;\n\t\theight: 100%;\n\t\toverflow: hidden;\n\t\t\n\t\tz-index: 10;\n\t\t\n\t}\n\t.counter {\n\t\tposition: absolute;\n\t\tbottom: 5px;\n\t\tleft: 10px;\n\t\tcolor: rgba(255,255,255,0.2);\n\t\tz-index: 15;\n\t}\n\tfigure.zoom2.not-zoomed {\n\t\tbackground-size: 0%!important;\n\t\tcursor: zoom-in;\n\t}\n\tfigure.zoom2.zoomed {\n\t\tbackground-position: 50% 50%;\n\n\t\timg {\n\t\t\topacity: 0;\n\t\t}\n\t}\n\tfigure.zoom2 img {\n\t\t// width: 100%;\n\t\t// height: 100%;\n\t\t// object-fit: contain;\n\t\t// max-width: 10000px;\n\t\t// max-height: 100000px;\n\t\t// width: auto;\n\t\t// height: auto;\n\t\t// object-fit: contain !important;\n\t\ttransition: opacity .5s;\n\t\tdisplay: block;\n\t\tobject-fit: contain !important;\n\t\tmax-width: 100%;\n\t\tmax-height: 100%;\n\t\ttext-align: center;\n\t}\n\t \n\n position: fixed;\n\tz-index: 2000;\n top: 0px;\n left: 0px;\n width: 100vw;\n height: 100vh;\n \n .lightbox-bg {\n top: 0px;\n left: 0px;\n width: 100vw;\n height: 100vh;\n position: absolute;\n\t\t\t\tbackground: rgb(0 0 0 / 82%);\n }\n\n .lightbox-content {\n\t\t&.images-nb-1 {\n\t\t\t\t.left, .right {\n\t\t\t\t\t\tdisplay: none!important;\n\t\t\t\t}\n\t\t}\n\n\t\tborder-radius: 9px;\n\t\toverflow: hidden;\n position: absolute;\n width: 95vw;\n height: 85vh;\n background: black;\n left: 50%;\n top: 50%;\n transform: translate(-50%, -50%); \n\t\t.zoomToggle {\n\t\t\tposition: absolute;\n\t\t\ttop: 9px;\n\t\t\tleft: 11px;\n\t\t\tz-index: 13;\n\t\t}\n\t\t.zoom {\n\t\t\ttop: 3px;\n\t\t\tleft: 28px;\n\t\t}\n\t\t.dezoom {\n\t\t\ttop: 3px;\n\t\t\tleft: 45px;\n\t\t}\n\t\t.zoom, .dezoom {\n\t\t\t\tposition: absolute;\n\t\t\t\t\n\t\t\t\tz-index: 100;\n\t\t\t\theight: 43px;\n\t\t\t\tmargin-right: 5px;\n\t\t\t\tsvg path {\n\t\t\t\t\t\tbox-shadow: 0px 0px 5px #0006;\n\t\t\t\t}\n\t\t}\n\t\tsvg {\n\t\t\tpadding: 3px;\n\t\t\tborder-radius: 22px;\n\t\t\twidth: 13px;\n\t\t\tbox-shadow: 0px 0px 5px #00000040;\n\t\t\ttransition: all 0.2s ease-in-out;\n\t\t\t&:hover {\n\t\t\t\tbackground: white;\n\t\t\t}\n\t\t}\n\n\t\t\n .lightbox-image {\n position: relative;\n justify-content: space-around;\n align-items: center;\n width: 100%;\n height: 100%;\n\n &:hover {\n .image-infos {\n display: block;\n }\n }\n .image-infos {\n\t\t\t\t\t\t\t\tposition: absolute;\n\t\t\t\t\t\t\t\ttop: 0px;\n\t\t\t\t\t\t\t\theight: 55px;\n\t\t\t\t\t\t\t\tleft: 0px;\n\t\t\t\t\t\t\t\twidth: 100%;\n\t\t\t\t\t\t\t\tbackground: linear-gradient(180deg, rgba(0,0,0,0.3) 0%, rgba(0,0,0,0) 100%);\n\t\t\t\t\t\t\t\tul {\n\t\t\t\t\t\t\t\t\t\tmargin-top: 5px;\n\t\t\t\t\t\t\t\t\t\tjustify-content: flex-end;\n\t\t\t\t\t\t\t\t\t\theight: 95vh;\n\t\t\t\t\t\t\t\t\t\tposition: relative;\n\t\t\t\t\t\t\t\t\t\tmargin: 0px;\n\t\t\t\t\t\t\t\t\t\tli {\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t&.left,\n\t\t\t\t\t\t\t\t\t\t\t\t&.right {\n\t\t\t\t\t\t\t\t\t\t\t\t\ttop: calc(50% - 20px);\n\t\t\t\t\t\t\t\t\t\t\t\t\theight: 40px;\n\t\t\t\t\t\t\t\t\t\t\t\t\twidth: 40px;\n\t\t\t\t\t\t\t\t\t\t\t\t\tz-index: 15;\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tposition: absolute;\n\t\t\t\t\t\t\t\t\t\t\t\t\tdisplay: flex;\n\t\t\t\t\t\t\t\t\t\t\t\t\tjustify-content: space-evenly;\n\t\t\t\t\t\t\t\t\t\t\t\t\tbutton {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// display: none;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\twidth: 100%;\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t&.mobile {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tbutton {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// display: block;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tsvg {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tbackground: white;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t&.desktop:hover {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tbutton {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// display: block;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t&.left {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tleft: 0px;\n\t\t\t\t\t\t\t\t\t\t\t\t}\t\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t&.right {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tright: 0px;\n\t\t\t\t\t\t\t\t\t\t\t\t}\t\n\t\t\t\t\t\t\t\t\t\t\t\t&.close {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tpadding: 10px;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tposition:relative;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tz-index:14;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\n // position: relative;\n &:hover {\n .image-name {\n display: block;\n }\n }\n .image-name {\n display: none;\n cursor: pointer;\n color: grey;\n padding: 5px;\n font-size: ".concat(Object(G.a)(),"px;\n position: absolute;\n top: 5px;\n left: 5px;\n }\n }\n\t\t\t.image-zoom-wrapper {\n\t\t\t\tdisplay: flex;\n\t\t\t\tjustify-content: center;\n\t\t\t\talign-items: center;\n\t\t\t\twidth: 100%;\n\t\t\t\theight: 100%;\n\t\t\t\ttext-align: center;\n\t\t\t\toverflow: auto;\n\t\t\t\tposition: relative;\n\t\t\t\tz-index: 2;\n\t\t\t\t\timg {\n\t\t\t\t\t\tvertical-align: middle;\n\t\t\t\t\t\tz-index:2;\n\t\t\t\t\t}\n\t\t\t}\n }\n }\n\n}\n"),"\n\t\t").concat('\n.mobile-view-container {\n\t.form-popup-component {\n\t\n\t\t.popup-wrapper {\n\t\t\t.popupContent {\n\t\t\t\twidth: 80vw;\n\t\t\t}\n\t\t}\n\t}\n}\n\t.form-popup-component {\n\t\tposition: absolute;\n\t\tz-index: 10002;\n\t\t.popup-wrapper {\n\t\t\tinput, select {\n\t\t\t\twidth: 90%;\n\t\t\t}\n\t\t\tinput[type="checkbox"] {\n\t\t\t\twidth: auto;\n\t\t\t}\n\t\t\t.form-input-wrapper {\n\t\t\t\tposition: relative;\n\t\t\t\t.mandatory {\n\t\t\t\t\tposition: absolute;\n\t\t\t\t\ttop: 0;\n\t\t\t\t\tright: 0;\t\n\t\t\t\t\tcolor: red;\n\t\t\t\t\tfont-size: 10px;\n\t\t\t\t}\n\t\t\t}\n\t\t\t.details {\n\t\t\t\tcolor:#afafaf;\n\t\t\t\tpadding-top: 10px;\n\t\t\t\tfont-size: 10px;\n\t\t\t}\n\t\t}\n\t}\n .prompt-popup-component {\n\t\t\t\t.popup-wrapper {\n\t\t\t\t\t\tmin-width: 200px;\n\t\t\t\t\t\tmin-height: 100px;\n\t\t\t\t}\n }\n',"\n\t\t").concat("\n\t\t\t\t\t\t&.device-view-mobile {\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t.omnibar-popup-bg.hide {\n\t\t\t\t\t\t\t\tdisplay:none;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t.omnibar-popup-bg {\n\t\t\t\t\t\t\t\tbackground: rgba(0,0,0,0.5);\n\t\t\t\t\t\t\t\ttop: 0px;\n\t\t\t\t\t\t\t\tleft: 0px;\n\t\t\t\t\t\t\t\twidth: 100vw;\n\t\t\t\t\t\t\t\theight: 100vh;\n\t\t\t\t\t\t\t\tz-index: 10000;\n\t\t\t\t\t\t\t\tposition: absolute;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t.omnibar-popup-wrapper {\n\t\t\t\t\t\t\t.dual-view-wrapper.view-editor.device-desktop {\n\t\t\t\t\t\t\t\t.editor-area {\n\t\t\t\t\t\t\t\t\twidth: calc(100% - 20px);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t.omnibar-popup-wrapper {\n\t\t\t\t\t\t\t\t&.locked {\n\t\t\t\t\t\t\t\t\tpointer-events:none;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\twidth: 88%;\n\t\t\t\t\t\t\t\tmargin: 0 auto;\n\t\t\t\t\t\t\t\tz-index: 100;\n\t\t\t\t\t\t\t\tposition: absolute;\n\t\t\t\t\t\t\t\tleft: 50%;\n\t\t\t\t\t\t\t\ttransform: translate(-50%);\n\t\t\t\t\t\t\t\ttop: 22px;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t.help-right {\n\t\t\t\t\t\t\t\tcursor:pointer;\n\t\t\t\t\t\t\t\tposition: absolute;\n\t\t\t\t\t\t\t\tright: 3px;\n\t\t\t\t\t\t\t\ttop: 3px;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t.help {\n\t\t\t\t\t\t\t\tcolor:white;\n\t\t\t\t\t\t\t\tmargin-bottom: 10px;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t.preview-wrapper {\n\t\t\t\t\t\t\t\toverflow-y: scroll;\n\t\t\t\t\t\t\t\tbackground: white;\n\t\t\t\t\t\t\t\tborder-radius: 5px;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t.barimage {\n\t\t\t\t\t\t\t\theight: 60px; \n\t\t\t\t\t\t\t\twidth: 100px;\n\n\t\t\t\t\t\t}\n\n\n\t\t\t\t\t\tdiv[class$='-menu']>div {\n\t\t\t\t\t\t\t\tdisplay: flex;\n\t\t\t\t\t\t\t\tflex-wrap: wrap;\n\t\t\t\t\t\t\t\tjustify-content: flex-start;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tdiv[class$='-option'] {\n\t\t\t\t\t\t\t\twidth: ".concat("mobile"===Object(r.a)()?"100":"20","%;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t.path-option-wrapper {\n\t\t\t\t\t\t\tposition: relative;\n\t\t\t\t\t\t\tword-break: break-word;\n\t\t\t\t\t\t\t.search-location {\n\t\t\t\t\t\t\t\t\tcolor: #b3b1b1;\n\t\t\t\t\t\t\t\t\tfont-size: 9px;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t.folder {\n\t\t\t\t\t\t\t\t\tcolor: grey;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t.file {\n\t\t\t\t\t\t\t\t\tfont-weight: bold;\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t&.device-desktop .actions {\n\t\t\t\t\t\t\t\ttransition: all 0.2s;\n\t\t\t\t\t\t\t\topacity: 0;\n\t\t\t\t\t\t\t\t.action {\n\t\t\t\t\t\t\t\t\tmargin-left: 8px;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t&.device-desktop:hover .actions {\n\t\t\t\t\t\t\t\topacity: 1;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t.actions {\n\t\t\t\t\t\t\t\tdisplay:flex;\n\t\t\t\t\t\t\t\tposition: absolute;\n\t\t\t\t\t\t\t\tright: 0px;\n\t\t\t\t\t\t\t\ttop: 0px;\n\t\t\t\t\t\t\t\talign-items: center;\n\t\t\t\t\t\t\t\theight: 100%;\n\t\t\t\t\t\t\t\t.action {\n\t\t\t\t\t\t\t\t\ttransition: all 0.2s;\n\t\t\t\t\t\t\t\t\topacity: 0.3;\n\t\t\t\t\t\t\t\t\tcursor: pointer;\n\t\t\t\t\t\t\t\t\tcolor: grey;\n\t\t\t\t\t\t\t\t\t&:hover {\n\t\t\t\t\t\t\t\t\t\topacity: 1;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t.html-preview-wrapper {\n\t\t\t\t\t\t\t\toverflow: hidden;\n\t\t\t\t\t\t\t\t.html-preview {\n\t\t\t\t\t\t\t\t\t\tiframe {\n\t\t\t\t\t\t\t\t\t\t\t\t// transform: scale(0.65);\n\t\t\t\t\t\t\t\t\t\t\t\ttransform: scale(0.8);\n\t\t\t\t\t\t\t\t\t\t\t\ttransform-origin:top left;\n\t\t\t\t\t\t\t\t\t\t\t\tborder:none;\n\t\t\t\t\t\t\t\t\t\t\t\twidth: 125%;\n\t\t\t\t\t\t\t\t\t\t\t\theight: 125%;\n\t\t\t\t\t\t\t\t\t\t\t\t// width: 155%;\n\t\t\t\t\t\t\t\t\t\t\t\t// height: 155%;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\n\t\t\t\t\t\t"),"\n\n\t\t").concat("\n .app-view-switcher-component {\n margin: 0px 10px 10px 10px;\n ul.buttons-toolbar-component {\n li {\n margin-left: 5px;\n margin-right: 5px;\n }\n }\n }\n","\n\t\t").concat(Object(b.b)(),"\n\n\n\t\t").concat("\n .image-gallery-component-wrapper {\n margin: 0px 17px;\n overflow-y: scroll;\n // height: calc(100vh - ".concat(d.a.sizes.search.padding+d.a.sizes.gallery.topH+("desktop"===Object(r.a)()?0:190),"px);\n height: calc(100vh - ").concat(d.a.sizes.search.padding+d.a.sizes.gallery.topH,"px);\n // height: 100%;\n width: 100%;\n\n .masonry-gallery {\n display: flex;\n list-style: none;\n flex-direction: row;\n flex-wrap: wrap;\n\n .masonry-col {\n width: ").concat("desktop"===Object(r.a)()?32:90,"%;\n margin-right: 1%;\n\n .masonry-col-item {\n position: relative;\n &:hover {\n .image-infos {\n display: block;\n }\n }\n .image-infos {\n display: none;\n ").concat(d.a.els().imageInfos,"\n }\n img {\n ").concat(d.a.els().images,"\n }\n margin-bottom: 10px;\n }\n }\n }\n }\n"),"\n\n\t\t").concat(Object(St.b)(),"\n\n\t\t").concat("\n.search-bar-component {\n input {\n\t\t\t\tborder-radius: 5px;\n width: calc(100% - ".concat(2*d.a.sizes.block+20,"px);\n border: none;\n background: white;\n\t\t\t\tpadding: 18px 9px;\n\t\t\t\tmargin: 0px 15px 15px 15px;\n\t\t\t\tbox-shadow: 0px 0px 6px rgb(0 0 0 / 5%);\n\t\t\t\tfont-size:").concat(Object(G.a)(1),"px;\n margin: 0px ").concat(d.a.sizes.block,"px ").concat(d.a.sizes.block,"px ").concat(d.a.sizes.block,"px; \n &::placeholder {\n color: #afadad;\n }\n }\n .search-status {\n text-align: center;\n font-size: 8px;\n\t\t\t\tposition: relative;\n\t\t\t\tbottom:9px;\n\t\t\t\tcolor: grey;\n }\n}\n"),"\n\n\t\t").concat("\n.mobile-view-toggler {\n position: fixed;\n bottom: 0px;\n left: 0px;\n z-index: 10;\n display:flex;\n width: 100%;\n list-style: none;\n margin: 0px;\n padding: 0px;\n background: ".concat(d.a.colors.main,";\n li {\n flex: 1 1 auto;\n button {\n ").concat(d.a.els().button,";\n padding: 8px;\n width: 100%;\n span.icon-wrapper {\n transform: scale(1.1);\n background: rgba(255,255,255,0);\n padding: 10px 27px;\n border-radius: 6px;\n }\n &:hover {\n span.icon-wrapper {\n }\n }\n &.active {\n span.icon-wrapper {\n background: rgba(255,255,255,0.2);\n }\n }\n }\n }\n}\n"),"\n\n\t\t").concat("\n.connection-status {\n font-size: 9px;\n z-index: 20000;\n a {\n margin-left: 10px;\n color: white;\n }\n .back-online, .disconnected {\n position: absolute;\n text-align:center;\n color:white;\n top: 0px;\n left: 0px;\n width: 100vw;\n padding: 1px;\n }\n .back-online{\n background: green;\n }\n .disconnected{\n background: ".concat(d.a.colors.main,";\n }\n .connected {\n display:none;\n position: absolute;\n bottom: 5px;\n right: 5px;\n color: ").concat(d.a.colors.green,";\n }\n}\n"),"\n\n\t\t").concat("\n .setup-popup-component {\n .submit-button {\n margin-top: 10px;\n ".concat(d.a.els().redButton,";\n padding: 10px 20px;\n }\n\t\t.popup-wrapper-component .popup-wrapper .popupContent {\n\t\t\tpadding-right: 50px;\n\t\t}\n\t\t.input-wrapper input {\n\t\t\twidth: 40vw;\n\t\t}\n .error {\n color: ").concat(d.a.colors.main,";\n }\n .success {\n color: ").concat(d.a.colors.green,";\n }\n }\n"),"\n\n\t\t").concat(Object(at.b)(),"\n\n\t\t").concat(Object(It.b)(),"\n\n\t\t").concat(Object(Nt.c)(),"\n\t\t").concat("\n.device-view-mobile {\n\t\n\t.plugins-marketplace-popup-wrapper .popup-wrapper .popupContent {\n\t\twidth: 80vw;\n\t}\n}\n\n.plugins-list-loading {\n\tpadding: 60px;\n}\n.plugins-marketplace-popup-wrapper .popup-wrapper {\n\theight: 70%;\n}\n.plugins-marketplace-popup-wrapper .popup-wrapper .popupContent {\n padding: 0px 20px;\n\twidth: 50vw;\n\t// min-height: 50vh;\n\t// max-height: 70vh;\n\toverflow-y: scroll;\n}\n\n\n","\n\n\t\t").concat("\n.last-notes-component {\n padding: 0px ".concat(d.a.sizes.block,"px;\n \n h3 {\n\n }\n ul {\n height: ").concat(110,"px;\n overflow: hidden;\n &:hover {\n min-height: ").concat(110,"px;\n height: auto;\n }\n\n padding: 0px;\n margin: 0px;\n li {\n cursor: pointer;\n // margin-bottom: ").concat(Object(G.a)(-3),"px;\n margin-bottom: 4px;\n overflow: hidden;\n height: ").concat(15,"px;\n list-style: none;\n font-size:").concat(Object(G.a)(1),"px;\n font-weight: 400;\n svg, i {\n color: ").concat(d.a.colors.main,";\n margin-right: 10px;\n }\n }\n }\n}\n"),"\n\t\t").concat("\n.shortcut-component {\n\t\tmargin: 0px ".concat(d.a.sizes.block,"px;\n\t\tmargin-bottom: 10px;\n\t\toverflow: hidden;\n\t\t.rendered-note-component {\n\t\t\t\twidth: 800px;\n\t\t\t\t.preview-link {\n\t\t\t\t\t\tcolor: #585757!important;\n\t\t\t\t}\n\t\t\t\t.preview-link {\n\t\t\t\t\t\tfont-weight: 400!important;\n\t\t\t\t}\n\t\t\t\t\n\t\t}\n}\n"),"\n\t\t").concat("\n.rendered-note-component {\n\t\th3 {\n\n\t\t}\n\t\t.rendered-note-content-wrapper {\n\t\t\t".concat(Object(f.c)(),"\n\t\t\t\t&>p {\n\t\t\t\t\t\tmargin: 0px;\n\t\t\t\t\t\tpadding:0px;\n\t\t\t\t}\n\n\t\t}\n\n}\n"),"\n\n\t\t").concat("\n\n.note-preview-wrapper {\n\t&.preview {\n\t\tpadding: 15px ;\n\t}\n\t \n\n\t\t".concat(Object(f.b)(),"\n\t\t").concat(Object(Pt.b)({searchBottom:0}),"\n\n\t\t.preview-area-wrapper {\n\t\t\theight: calc(100% - 0px);\n\t\t\tmargin-top: 0px;\n\t\t}\n\n\t\t.preview-area {\n\t\t\twidth: calc(100% + ").concat("mac"===Object(r.b)()&&"0px",");\n\t\t\t \n\t\t}\n \n\t\t//\n\t\t// PREVIEW\n\t\t//\n\t\t\n\t\t\n\t\t\t\t.simple-css-wrapper {\n\n\t\t\t\t.resource-link-content-wrapper ul {\n\t\t\t\t\t\topacity:1!important;\n\t\t\t\t\t\tpointer-events:all!important;\n\t\t\t\t}\n\t\t\t\tiframe {\n\t\t\t\t\t\t// height: 100%!important;\n\t\t\t\t}\n\t\t\t\t.resource-link-iframe-wrapper {\n\t\t\t\t\t\tmargin-bottom: 5px;\n\t\t\t\t}\n\t\t}\n\n\t\t.found-word {\n\t\t\t\tfont-weight: bold;\n\t\t\t\tbackground: #fff876;\n\t\t\t\tpadding: 2px;\n\t\t}\n\n\t\t\n\n\t\t//\n\t\t// EDITOR VIEW\n\t\t//\n\n\t\t&.editor,\n\t\t.window-editor-wrapper,\n\t\t.dual-view-wrapper,\n\t\t.editor-area,\n\t\t.codemirror-editor-wrapper {height: 100%}\n\n\n\n}\n\n//\n// FLOATING PANEL SPECIFIC\n//\n.floating-panel-wrapper .main-editor-wrapper {height: calc(100% - 33px)}\n\n//\n// SIMPLE NOTE POPUP SPECIFIC\n//\n.page-link-preview-popup-ext .main-editor-wrapper {height: calc(100%)}\n\n\n\n"),"\n\t\t").concat(Object(ke.b)(),"\n\n\t\t").concat(Object(rt.b)(),"\n\t\t").concat(Object(_e.b)(t),"\n\t\t").concat(Object(ye.b)(),"\n\t\t").concat(Object(We.b)(),"\n\t\t").concat(Object(He.b)(),"\n\t\t").concat(Object(Je.b)(),"\n\t\t").concat(Object(Ge.b)(),"\n\n\t\t").concat("\n\n\n.list-layout-floating-wrapper {\n // padding: 10px;\n position: relative;\n position: relative;\n width: 10px;\n height: 10px;\n .icon-wrapper {\n position: absolute;\n top: -12px;\n left: -4px;\n padding: 5px;\n }\n ul {\n transition: 0.5s all;\n display: none; \n position: absolute;\n right: -19px;\n top: 20px;\n width: 20px;\n background: white;\n border-radius: 10px;\n box-shadow: 0px 0px 3px rgba(0,0,0,.3);\n text-align: left;\n list-style: none;\n margin: 0px;\n padding: 15px;\n }\n &:hover {\n ul {\n display: block;\n }\n }\n}\n\n//\n// PANEL\n//\n// resizing handles\n.floating-panel__wrapper + div > div { z-index: 100000;}\n\n// to force iframe to take 100% height resizing \n.floating-panel__inner-content.ctag iframe {\n height: 100%!important;\n}\n// otherwise lineJump Preview will make the window jump \n.floating-panel__inner-content {\n // overflow: clip;\n // position: fixed;\n // top: 0px;\n // left: 0px;\n // position: absolute;\n // top:0px;\n // left: 0px;\n}\n\n// .floating-panel__wrapper {\n// position: absolute;\n// top: 7px;\n// left: 0px;\n// width: 100%;\n// }\n\n\n\n.floating-panel-wrapper.type-ctag {\n .handle_invisible {\n background: rgb(247, 247, 247);\n width: 100% ;\n }\n}\n.floating-panel__wrapper {\n .handle_invisible {\n position: absolute;\n top: 0px;\n left: 0px;\n width: calc(100% - 100px);\n height: 33px;\n z-index: 1000;\n cursor: grab;\n }\n}\n.forceHide {\n display: none;\n\n}\n\n.floating-panel {\n .btn-maximize, .btn-minimize {\n position: relative;\n top:-3px;\n }\n}\n\n\n// @EDGE CASE : mobile + smartlist in preview mode + floating > if editor, should show editor\n.floating-panels-wrapper {\n\t.dual-view-wrapper {\n\t\t&.view-editor {\n\t\t\t.preview-area-wrapper {\n\t\t\t\t display: none\n\t\t\t}\n\t\t}\n\t\t&.view-preview {\n\t\t\t.editor-area {\n // rien car pour show le\n\t\t\t}\n\t\t}\n }\n}\n\n.device-view-mobile {\n .floating-panel {\n .editor-area {\n .main-editor-wrapper {\n padding-top: 40px;\n }\n }\n .mobile-text-manip-toolbar-wrapper {\n top: 40px!important;\n }\n .title-input-wrapper {\n padding-top: 5px;\n }\n }\n}\n\n.floating-panels-wrapper {\n position: absolute;\n top: 0;\n left: 0;\n width: 100vw;\n height: 100vh;\n pointer-events: none;\n .floating-panel-wrapper {\n -webkit-font-smoothing: subpixel-antialiased;\n -webkit-transform: translateZ(0) scale(1.0, 1.0);\n font-smoothing: subpixel-antialiased;\n transform: translateZ(0) scale(1.0, 1.0);\n &.ctag-pdf {\n .floating-panel {\n .floating-panel__actions {\n top: 30px;\n \n right: 5px;\n }\n }\n }\n &.minimized {\n display:none;\n }\n position: absolute;\n top: 0px;\n left: 0px;\n \n .floating-panel {\n overflow: hidden;\n background: #fff;\n border: 1px solid #000;\n border-radius: 4px;\n box-shadow: 0 0 4px rgba(0,0,0,0.3);\n z-index: 1000;\n pointer-events: all;\n .floating-panel__drag-overlay {\n position: absolute;\n top: 0px;\n left: 0px;\n width: 100%;\n height: 100%;\n background: rgba(255,255,255,0.5);\n z-index: 100;\n opacity: 0.5;\n transition: 0.1s opacity;\n &.hide {\n opacity: 0;\n pointer-events: none;\n }\n &.hover-mode {\n opacity: 0.5;\n pointer-events: all;\n }\n }\n .floating-panel__actions {\n position: absolute;\n background: rgba(255,255,255,0.1);\n top: 4px;\n transition: 0.5s all;\n right: 40px;\n z-index:1000;\n padding: 4px;\n &:hover {\n background: white;\n padding: 4px;\n box-shadow: 0px 0px 4px rgba(0,0,0,0.3);\n border-radius: 4px;\n }\n }\n .floating-panel__content {\n // overflow-y: auto;\n // overflow: hidden;\n position: absolute;\n top:0px;\n left: 0px;\n width: 100%;\n overflow: hidden;\n &.content-type-file {\n }\n }\n }\n }\n \n \n}\n\n\n//\n// BAR\n//\n.panels-minimized-bottom-bar-wrapper {\n position: absolute;\n width: 100vw;\n overflow: hidden;\n overflow-x: scroll;\n pointer-events: none;\n\n .panels-minimized-bottom-bar-background {\n &.pinned {\n bottom: 0px;\n }\n transition: all 0.3s ease-in-out 0.5s;\n position: fixed;\n left: 0px;\n width: 100%;\n height: 30px;\n background: #fff;\n z-index: 11;\n pointer-events: all;\n bottom: -30px;\n }\n\n .bottom-hover-bar {\n pointer-events: all;\n cursor: pointer;\n position: absolute;\n width: 150vw;\n height: 15px;\n bottom: 0px;\n box-shadow: 0 0 0px rgba(0,0,0,0.3);\n z-index: 10;\n transition: 0.5s all;\n opacity: 0;\n }\n \n &:hover {\n .panels-minimized-bottom-bar-background {\n box-shadow: 0px 0px 5px rgba(0,0,0,.2);\n bottom: 0px;\n }\n .panels-minimized-bottom-bar {\n bottom: 0px;\n \n }\n .bottom-hover-bar {\n box-shadow: 0px 0px 5px rgba(0,0,0,.2);\n background: ".concat(d.a.colors.main,";\n opacity: 0.5;\n }\n }\n\n .panels-minimized-bottom-bar{\n z-index: 11;\n pointer-events: all;\n left: 18px;\n\n // transition: all 0.3s ease-in-out 0.5s, box-shadow 0.5s ease-in-out 0s;\n transition: all 0.3s ease-in-out 0.5s;\n \n position: absolute;\n width: 100%;\n bottom: -30px;\n &.pinned {\n bottom: 0px;\n }\n height: 30px;\n background: #fff;\n display: flex;\n flex-direction: row;\n justify-content: flex-start;\n align-items: center;\n .floating-panels-bottom-toolbar {\n \n display: flex;\n flex-direction: row;\n justify-content: flex-start;\n align-items: center;\n margin-left: 10px;\n .floating-bar-toolbar {\n }\n .btn-action {\n padding: 5px;\n margin: 0px 5px;\n cursor: pointer;\n transition: 0.3s all;\n &:hover {\n background: #f0f0f0;\n }\n }\n }\n }\n}\n\n\n.panel-minimized {\n background: #c9c9c9;\n margin: 0px 0px 0px 4px;\n border-radius: 7px;\n height: 24px;\n width: 80px;\n font-size:10px;\n overflow: hidden;\n padding: 0 10px;\n cursor: pointer;\n transition: 0.5s all;\n position: relative;\n :hover {\n background: #f0f0f0;\n }\n .label-wrapper {\n width: calc(100% - 10px);\n overflow: hidden;\n .label {\n margin-top: 5px;\n height: 14px;\n text-wrap: nowrap;\n }\n }\n .active-icon {\n color: rgb(121, 121, 121);\n margin: 6px 6px 0px 6px;\n\n }\n &.active-tab {\n background: #f0f0f0;\n }\n .close-btn {\n &:hover {\n background: ").concat(d.a.colors.main,";\n i {\n color: white!important;\n }\n }\n i {\n line-height: 8px;\n }\n \n // background: rgba(121, 121, 121,0.5);\n position: absolute;\n top: -2px;\n transition: 0.3s all;\n border-radius: 20px;\n padding: 5px;\n margin-top: 6px;\n line-height: 1px;\n cursor: pointer;\n right: 6px;\n }\n}\n\n//\n// Modifying style of the note preview\n//\n.floating-panel__wrapper .note-preview-wrapper .cm-mdpreview-wrapper .cm-mdpreview-image img {\n\tmax-height: none;\n}\n.floating-panel__wrapper .note-preview-wrapper.preview {\n padding: 0px\n}\n\n\n.content-block.block-tag {\n left: 0px;\n width: calc(100%)\n}\n\n"),"\n\n\t\t").concat(Object(Dt.b)(),"\n\t\t").concat(Object(f.b)(),"\n\t\t").concat(Object(Pt.b)(),"\n\t\t").concat(Object(Et.b)(),"\n\t\t").concat(Object(Tt.b)(),"\n\n\t\t").concat(Object(Q.b)(),"\n\n\t\t\n\t\t.config-buttons-bar {\n\t\t\tposition: fixed;\n\t\t\tz-index: 300;\n\t\t\tbackground: ").concat("mobile"===Object(r.a)()?"none":"white",";\n\t\t\tright: ").concat("mobile"===Object(r.a)()?"3px":"0px",";\n\t\t\tbottom: ").concat("mobile"===Object(r.a)()?"55px":"0px",";\n\t\t\tdisplay: ").concat("mobile"===Object(r.a)()?"block":"flex",";\n\t\t\tpadding: 2px 9px;\n\t\t\tfont-size: 10px;\n\n\t\t\t.config-button {\n\t\t\t\tfont-size: 10px;\n\t\t\t\t// margin-top: 10px;\n\t\t\t\topacity: 0.6;\n\t\t\t\ttransition: 0.2s all; \n\t\t\t\tpadding: 6px;\n\t\t\t\tcursor: pointer;\n\t\t\t\t&:hover {\n\t\t\t\t\topacity: 1;\n\t\t\t\t}\n\t\t\t}\n\t\t\t.plugins-marketplace-button {\n\n\t\t\t}\n\t\t\t.settings-button {\n\t\t\t\t\n\t\t\t}\t\n\t\t}\n\t\t\t\n\t\t\n\n\t\t\n\t\t.main-wrapper,\n\t\t.mobile-view-container {\n\t\t\theight:100%;\n\t\t}\n\n\t\t.content-image {\n\t\t\t\twidth: 90%; \n\t\t}\n\t\t.full {\n\t\t\t\t.content-image {\n\t\t\t\t}\n\t\t}\n\n\t\t.main-wrapper {\n\t\t\t").concat("\n&.device-view-mobile {\n\t\t.folder-tree-view-component {\n\t\t\t\tli.folder-wrapper {\n\t\t\t\t\t\t.context-menu-wrapper {\n\t\t\t\t\t\t\t\tright: -10px;\n\t\t\t\t\t\t\t\t.context-menu {\n\t\t\t\t\t\t\t\t\t\tright: 5px;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t}\n\t\t}\n}\n\n.folder-tree-view-component {\n\t\tpadding: ".concat(d.a.sizes.block,"px;\n\t\tpadding-right: 0px;\n\t\tmargin: 0px 0px 100px 0px;\n\t\twidth: calc(100% - ").concat(d.a.sizes.block*(Object(r.c)("desktop")&&!Object(r.d)()?1:2),"px);\n\n\t\tul.folder-children {\n\t\t\t\tmargin: 0px 0px 0px 0px;\n\t\t\t\tpadding: 0px 0px 0px 10px;\n\t\t}\n\n\t\t.loading {\n\t\t\tmargin-left: 30px;\n\t\t\tfont-size: 12px;\n\t\t\tfont-weight: 400;\n\t\t}\n\t\tli.folder-wrapper {\n\n\t\t\t\tposition: relative;\n\t\t\t\tlist-style: none;\n\t\t\t\tfont-size: ").concat(Object(G.a)(3),"px;\n\t\t\t\tfont-weight: 600;\n\t\t\t\tcursor: pointer;\n\n\t\t\t\t.context-menu-wrapper {\n\t\t\t\t\t\tposition: absolute;\n\t\t\t\t\t\tright: -13px;\n\t\t\t\t\t\ttop: -10px;\n\t\t\t\t\t\tpadding: 10px;\n\t\t\t\t\t\tdisplay:none;\n\t\t\t\t\t\t.context-menu {\n\t\t\t\t\t\t\t\tposition: absolute;\n\t\t\t\t\t\t\t\tright: 0px;\n\t\t\t\t\t\t\t\ttop: 15px;\n\t\t\t\t\t\t\t\tbackground: white;\n\t\t\t\t\t\t\t\tbox-shadow: 0px 0px 4px rgb(0 0 0 / 10%);\n\t\t\t\t\t\t\t\tcolor: black;\n\t\t\t\t\t\t\t\tpadding: 0px 0px;\n\t\t\t\t\t\t\t\twidth: 100px;\n\t\t\t\t\t\t\t\tz-index: 100;\n\t\t\t\t\t\t\t\tborder-radius: 4px;\n\t\t\t\t\t\t\t\tfont-size: ").concat(Object(G.a)(),"px;\n\t\t\t\t\t\t\t\tul {\n\t\t\t\t\t\t\t\t\t\tlist-style: none;\n\t\t\t\t\t\t\t\t\t\tpadding: 0px;\n\t\t\t\t\t\t\t\t\t\tmargin: 0px;\n\t\t\t\t\t\t\t\t\t\tli {\n\t\t\t\t\t\t\t\t\t\t\t\tpadding: 4px 11px;\n\t\t\t\t\t\t\t\t\t\t\t\t&:hover {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tbackground: ").concat(d.a.colors.main,";\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t.folder-title:hover > .context-menu-wrapper {\n\t\t\t\t\t\tcursor:pointer;\n\t\t\t\t\t\tdisplay:block;\n\t\t\t\t}\n\t\t\t\t&.current > .folder-title {\n\t\t\t\t\t\tcolor: ").concat(d.a.colors.main,";\n\t\t\t\t\t\ttext-decoration: underline;\n\t\t\t\t}\n\t\t\t\t.folder-title {\n\t\t\t\t\t\tposition: relative;\n\n\t\t\t\t\t\t.title-label {\n\t\t\t\t\t\t\t\tposition: relative;\n\t\t\t\t\t\t\t\tz-index: 0;\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t.title-drag-bg {\n\t\t\t\t\t\t\t\tborder-radius: 5px;\n\t\t\t\t\t\t\t\tpadding: 5px;\n\t\t\t\t\t\t\t\tposition: absolute;\n\t\t\t\t\t\t\t\twidth: calc(100% - 8px);\n\t\t\t\t\t\t\t\theight: 100%;\n\t\t\t\t\t\t\t\ttop: -4px;\n\t\t\t\t\t\t\t\tz-index: -1;\n\t\t\t\t\t\t\t\tleft: -5px;\n\t\t\t\t\t\t\t\ttransition: 50ms;\n\t\t\t\t\t\t\t\tbackground: rgba(255,255,255,0);\n\t\t\t\t\t\t\t\tz-index:0;\n\t\t\t\t\t\t\t\tpointer-events: none;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t&.drag .title-drag-bg {\n\t\t\t\t\t\t\t\tbackground: rgba(255,255,255,0.6);\n\t\t\t\t\t\t\t\tpointer-events: all;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tpadding: 1px;\n\t\t\t\t\t\tposition:relative;\n\t\t\t\t\t\tpadding-left: 20px;\n\t\t\t\t\t\t.icon {\n\t\t\t\t\t\t\t\tposition: absolute;\n\t\t\t\t\t\t\t\tleft: 2px;\n\t\t\t\t\t\t\t\tcursor: pointer;\n\t\t\t\t\t\t\t\tpadding: 1px;\n\t\t\t\t\t\t\t\ttop: 0px;\n\t\t\t\t\t\t\t\tsvg {\n\t\t\t\t\t\t\t\t\t\tcolor: ").concat(d.a.colors.main,";\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t}\n\t\t}\n\t\t\n}\n"),"\n\t\t\tdisplay: flex;\n\t\t\t.no-file {\n\t\t\t\t\ttext-align: center;\n\t\t\t\t\tmargin-top: 49vh;\n\t\t\t}\n\n\t\t\t////////////////////////////////////////////v \n\t\t\t// LEFT 1\n\t\t\t////////////////////////////////////////////v\n\t\t\t\n\t\t\t").concat("\n .new-file-button {\n ".concat(d.a.els().redButton,"\n ").concat(d.a.font.main,";\n padding: ").concat(Object(r.c)("desktop")?"14px 5px":"13px 7px",";\n margin: 13px 15px 15px 15px;\n\t\t\t\twidth: calc(100% - 30px); \n font-size: ").concat((Object(r.c)("desktop"),11),"px;\n .icon-wrapper {\n margin-right: ").concat(Object(r.c)("desktop")?"10px":"5px",";\n }\n\t\t\n \n }\n"),"\n\n\t\t\t\n\t\t\t \n\n\n\t\t\t&.without-sidebar.device-view-desktop {\n\t\t\t\t\t.left-sidebar-indicator {\n\t\t\t\t\t\t\ttransition: 0.5s all;\t\n\t\t\t\t\t\t\t&:hover {\n\t\t\t\t\t\t\t\tbackground: ").concat(d.a.colors.main,";\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tdisplay: block;\n\t\t\t\t\t\t\tposition: absolute;\n\t\t\t\t\t\t\ttop: 0%;\n\t\t\t\t\t\t\tz-index:10000;\n\t\t\t\t\t\t\twidth: 12px;\n\t\t\t\t\t\t\theight: 100vh;\n\t\t\t\t\t\t\tbackground: rgb(236, 236, 236);\n\t\t\t\t\t\t\tbox-shadow: 0px 0px 5px rgba(0,0,0,.2);\n\t\t\t\t\t\t\tmargin: 0% 0px;\n\t\t\t\t\t\t\t.left-wrapper {\n\t\t\t\t\t\t\t\t\tbox-shadow: 0px 0px 5px rgba(0,0,0,.2);\n\t\t\t\t\t\t\t\t\ttransition: 0.2s all;\n\t\t\t\t\t\t\t\t\ttransition-delay: 500ms, 0ms;\n\t\t\t\t\t\t\t\t\tposition: absolute;\n\t\t\t\t\t\t\t\t\tleft: calc(-37vw - 400px);\n\t\t\t\t\t\t\t\t\ttop: 0px;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t.left-sidebar-indicator:hover {\n\t\t\t\t\t\t\t.left-wrapper {\n\t\t\t\t\t\t\t\t\tleft: 0vw;\n\t\t\t\t\t\t\t\t\ttop: 0px;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t}\n\n\t\t\t.invisible-scrollbars {\n\t\t\t\t\twidth: 100%;\n\t\t\t\t\tpadding-right: 18px;\n\t\t\t\t\toverflow-y: scroll;\n\t\t\t\t\theight: ").concat("desktop"===Object(r.a)()?"100vh":"calc(100vh - 48px)","; \n\t\t\t}\n\n\t\t\t.left-wrapper {\n\t\t\t\tbackground: ").concat($e.l2.bg,"; \n\t\t\t\t.left-wrapper-1 {\n\t\t\t\t\toverflow: hidden;\n\t\t\t\t\tbackground-image: url('").concat(d.a.assets.decoBgMap,"');\n\t\t\t\t\tbackground-color: ").concat(d.a.colors.bgInterface2,";\n\t\t\t\t\tbackground-blend-mode: color-burn;\n\t\t\t\t\tcolor: ").concat(d.a.colors.fontInterface2,';\n\t\t\t\t\twidth: 37%;\n\t\t\t\t\theight:100vh;\n\t\t\t\t\tposition: relative;\n\n\n\t\t\t\t\th3.subtitle {\n\t\t\t\t\t\tmargin: 0px 0px 15px;\n\t\t\t\t\t\tfont-family: "Open sans", sans-serif;\n\t\t\t\t\t\ttext-transform: uppercase;\n\t\t\t\t\t\tfont-size: 14px;\n\t\t\t\t\t\tfont-weight: 800;\n\t\t\t\t\t\tfont-style: italic;\n\t\t\t\t\t\tcolor: ').concat($e.main,";\n\t\t\t\t\t}\n\t\t\t\t}\n\n\n\t\t\t\t////////////////////////////////////////////v \n\t\t\t\t// TEXT VIEW : LEFT 2\n\t\t\t\t////////////////////////////////////////////v2\n\t\t\t\t.left-wrapper-2 {\n\t\t\t\t\t\twidth: 63%;\n\t\t\t\t\t\theight:100vh;\n\t\t\t\t\t\toverflow: hidden;\n\t\t\t\t\t\tbackground: ").concat(d.a.colors.bgInterface,";\n\t\t\t\t\t\tz-index:1;\n\n\n\n\t\t\t\t\t\t\n\t\t\t\t\t\t.top-files-list-wrapper {\n\t\t\t\t\t\t\t\tpadding-top: ").concat(Ze.search.padding,"px;\n\t\t\t\t\t\t\t\theight: ").concat(Ze.search.h,"px;\n\t\t\t\t\t\t\t\t.subtitle-wrapper {\n\t\t\t\t\t\t\t\t\t\tposition: relative;\n\t\t\t\t\t\t\t\t\t\tdisplay: flex;\n\t\t\t\t\t\t\t\t\t\t.folder-wrapper {\n\t\t\t\t\t\t\t\t\t\t\t\tpadding: 2px 16px 10px 20px;\n\t\t\t\t\t\t\t\t\t\t\t\t/* margin-top: 4px; */\n\t\t\t\t\t\t\t\t\t\t\t\tfont-weight: bold;\n\t\t\t\t\t\t\t\t\t\t\t\tcolor: #aeadad;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t.toggle-sidebar-btn {\n\t\t\t\t\t\t\t\t\t\t\t\tposition: absolute;\n\t\t\t\t\t\t\t\t\t\t\t\tright: 10px;\n\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\th3.subtitle {\n\t\t\t\t\t\t\t\t\t\t\t\tmargin: 0px ").concat(Ze.block,"px ").concat(Ze.block,"px ").concat(Ze.block,"px; \n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t.counter {\n\t\t\t\t\t\t\t\t\t\t\t\tmargin: 0px;\n\t\t\t\t\t\t\t\t\t\t\t\tmargin-top: 2px;\n\t\t\t\t\t\t\t\t\t\t\t\tcolor: ").concat($e.l2.text,";\n\t\t\t\t\t\t\t\t\t\t\t\tfont-size: ").concat(Object(G.a)(),"px;\n\t\t\t\t\t\t\t\t\t\t\t\tfont-weight: 800;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\n\t\t\t\t}\n\n\t\t\t\t\n\n\t\t\t\t\n\t\t\t\t\n\n\t\t\t\t.files-list-component {\n\t\t\t\t\t\tposition: relative\n\t\t\t\t}\n\n\t\t\t\t.list-toolbar {\n\t\t\t\t\t\tposition: absolute;\n\t\t\t\t\t\ttop: -93px;\n\t\t\t\t\t\tright: 23px;\n\t\t\t\t\t\tcolor: ").concat($e.l2.text,";\n\t\t\t\t\t\tbutton {\n\t\t\t\t\t\t\t\tcolor: ").concat($e.l2.text,";\n\t\t\t\t\t\t\t\t").concat(Ye().button,"\n\t\t\t\t\t\t\t\tpadding: 0px;\n\t\t\t\t\t\t\t\tmargin-right: ").concat(Ze.block,"px; \n\t\t\t\t\t\t\t\tfont-size: ").concat(Object(G.a)(),"px;\n\t\t\t\t\t\t\t\tcursor: pointer;\n\t\t\t\t\t\t\t\tspan {\n\t\t\t\t\t\t\t\t\t\tmargin-right: 5px;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t.items-list-count {\n\t\t\t\t\t\t\t\tposition: absolute;\n\t\t\t\t\t\t\t\tcolor: grey;\n\t\t\t\t\t\t\t\tfont-size: ").concat(Object(G.a)(),"px;\n\t\t\t\t\t\t\t\tright: 10px;\n\t\t\t\t\t\t\t\ttop: 5px;\n\t\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t").concat("\n.list-wrapper {\n .list-wrapper-scroller{\n height: 100%;\n width: calc(100% + 20px);\n overflow-y:scroll;\n overflow: hidden;\n }\n\n .mobile-buttons-up-down {\n position: fixed;\n right: 0px;\n z-index: 10;\n top: 50%;\n div {\n background: #d6d6d6;\n padding: 10px;\n color:white;\n cursor: pointer;\n }\n }\n\n div.List {\n list-style: none;\n margin-right:20px;\n padding: 0px 0px 0px 0px;\n &.multiselect-mode {\n\t\t\t\t\t\tli .label {\n\t\t\t\t\t\t\t\tmargin-left: 4px;\n\t\t\t\t\t\t}\n }\n\n // NORMAL\n li {\n\t\t\tmax-width:calc(100% - 47px);\n padding: ".concat(X.l2.fileLi.padding,"px ").concat(X.block-X.l2.fileLi.margin,"px;\n margin: ").concat(X.l2.fileLi.margin,"px ").concat(X.l2.fileLi.margin+5,"px ").concat(X.l2.fileLi.margin,"px ").concat(X.l2.fileLi.margin,"px ;\n display: block;\n cursor: pointer;\n position: relative;\n height: ").concat(X.l2.fileLi.height,"px;\n overflow: hidden;\n border: 2px rgba(0,0,0,0) solid;\n \n // ACTIVE\n &:hover,\n &.multiselected,\n &.active {\n }\n\n display: flex;\n justify-content: center;\n\t\t\t\t\t\t&.active .background-item-border,\n\t\t\t\t\t\t&.active .background-item {\n\t\t\t\t\t\t\t\twidth: 100%;\n\t\t\t\t\t\t\t\theight: 100%;\n\t\t\t\t\t\t\t\tposition: absolute;\n\t\t\t\t\t\t\t\ttop: 0px;\n\t\t\t\t\t\t\t\tleft: 0px;\n\t\t\t\t\t\t\t\tbackground: ").concat(d.a.colors.main,";\n\t\t\t\t\t\t\t\tborder-radius: 5px;\n\t\t\t\t\t\t\t\tz-index: -1;\n\t\t\t\t\t\t\t\topacity: 0.2;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t&.active .background-item-border {\n\t\t\t\t\t\t\t\twidth: calc(100% - 4px);\n\t\t\t\t\t\t\t\theight: calc(100% - 4px);\n\t\t\t\t\t\t\t\tbackground: none;\n\t\t\t\t\t\t\t\tborder: 2px ").concat(d.a.colors.main," solid;\n\t\t\t\t\t\t\t\topacity: 0.3;\n\t\t\t\t\t\t}\n \n\t\t\t\t\t\th3 {\n\t\t\t\t\t\t\t\tfont-size: 12px;\n\t\t\t\t\t\t}\n .left {\n\t\t\t\t\t\t\t\t// width: calc(100% - ").concat(X.l2.fileLi.img,"px - 10px);\n\t\t\t\t\t\t\t\twidth: 100%;\n\t\t\t\t\t\t\t\tpadding-right: 10px;\n\n\t\t\t\t\t\t\t\tdisplay:flex;\n\t\t\t\t\t\t\t\tflex-direction:column;\n\n\t\t\t\t\t\t\t\t.label {\n\t\t\t\t\t\t\t\t\t\tmargin: 0px;\n\t\t\t\t\t\t\t\t\t\tmax-height: 35px;\n\t\t\t\t\t\t\t\t\t\t//height: 46px;\n\t\t\t\t\t\t\t\t\t\t// display: flex;\n\t\t\t\t\t\t\t\t\t\t// align-items: center;\n\t\t\t\t\t\t\t\t\t\tmargin-bottom: 2px;\n\t\t\t\t\t\t\t\t\t\toverflow: hidden;\n\t\t\t\t\t\t\t\t\t\ttext-overflow: ellipsis;\n\t\t\t\t\t\t\t\t\t\tcolor: ").concat(Z.l2.title,";\n\t\t\t\t\t\t\t\t\t\tline-break: anywhere;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t.content {\n\t\t\t\t\t\t\t\t\t\tcolor: grey;\n\t\t\t\t\t\t\t\t\t\tmargin-bottom: 3px;\n\t\t\t\t\t\t\t\t\t\theight: 25px;\n\t\t\t\t\t\t\t\t\t\tfont-size: 9px;\n\t\t\t\t\t\t\t\t\t\toverflow: hidden;\n\t\t\t\t\t\t\t\t\t\tline-break: anywhere;\n\t\t\t\t\t\t\t\t\t\tword-break: break-word;\n\t\t\t\t\t\t\t\t\t\t").concat(Object(r.c)("desktop")?"":"max-height: 25px;","\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t.date {\n\t\t\t\t\t\t\t\t\t\tcolor: ").concat(Z.l2.date,";\n\t\t\t\t\t\t\t\t\t\tfont-size: ").concat(Object(G.a)(),"px;\n\t\t\t\t\t\t\t\t\t\tfont-weight: 700;\n\t\t\t\t\t\t\t\t}\n }\n\n .right {\n\t\t\t\t\t\t\t\t.picture {\n\t\t\t\t\t\t\t\t\t\twidth: ").concat(X.l2.fileLi.img,"px;\n\t\t\t\t\t\t\t\t\t\theight: ").concat(X.l2.fileLi.img,"px;\n\t\t\t\t\t\t\t\t\t\tbackground-size: cover;\n\t\t\t\t\t\t\t\t\t\tz-index: 1;\n\t\t\t\t\t\t\t\t\t\tmargin-top: 3px;\n\t\t\t\t\t\t\t\t\t\tborder-radius: 5px;\n\t\t\t\t\t\t\t\t\t\tborder: 2px white solid;\n\t\t\t\t\t\t\t\t}\n }\n }\n }\n}\n"),"\n\t\t\t}\n\t\t\t////////////////////////////////////////////v \n\t\t\t// IMAGE GALLERY VIEW\n\t\t\t////////////////////////////////////////////v\n\t\t\t.right-wrapper.image-gallery-view {\n\t\t\t\t\tbackground: ").concat($e.l2.bg,"; \n\t\t\t\t\t.image-gallery-header {\n\t\t\t\t\t\t\tpadding-top: ").concat(Ze.search.padding,"px;\n\t\t\t\t\t\t\theight: ").concat(Ze.gallery.topH,"px;\n\n\t\t\t\t\t\t\t.search-bar-component {\n\t\t\t\t\t\t\t\t\t// padding: 10px 0px;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t.image-gallery-component-wrapper {\n\t\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t}\n\t\t\t////////////////////////////////////////////v \n\t\t\t// TEXT VIEW : RIGHT\n\t\t\t////////////////////////////////////////////v \n\t\t\t").concat("\n\n.tab-list-wrapper-hover {\n\t.top-hover-bar {\n\t\tcursor: pointer;\n\t\theight: 14px;\n\t\twidth: 100%;\n\t\tposition: absolute;\n\t\topacity: 0;\n\t\ttransition: 0.5s all;\n\t}\n\t&:hover {\n\t\t.top-hover-bar {\n\t\t\tbackground: ".concat(d.a.colors.main,";\n\t\t\topacity: 0.5;\n\t\t}\n\t}\n\ttransition: 0.5s all;\n\tposition: absolute;\n z-index: 22;\n\twidth: 100%;\n\t&.pinned {\n\t\tposition: initial;\n\t\t.top-hover-bar { display:none}\n\t}\n\t&.unpinned {\n\t\t.tab-list-scroll-wrapper {\n\t\t\tbox-shadow: 0px 0px 5px rgba(0,0,0,0.3);\n\t\t}\n\t}\n\t&:hover {\n\t\t.tab-list-scroll-wrapper {\n\t\t\ttop: 0px!important;\n\t\t}\n\t}\n}\n\n.tab-list-scroll-wrapper {\n\t\n\tposition: absolute;\n\theight: 44px;\n\twidth: 100%;\n\ttransition: all 0.3s ease-in-out;\n\ttransition-delay: 500ms, 0ms;\n\tbackground: ").concat(d.a.colors.bgTabs,";\n border-radius: 0px 0px 0px 5px;\n\t\toverflow: hidden;\n\t\t.tab-list-invisible-scroll {\n\t\t\t\twidth: 100%;\n\t\t\t\toverflow-x: scroll;\n\t\t\t\tpadding-bottom: 18px;\n\t\t\t\t.tab-list-wrapper {\n\t\t\t\t\t\tpadding: 7px 0px 0px 13px;\n\t\t\t\t\t\tdisplay: flex;\n\t\t\t\t\t\tbackground: ").concat(d.a.colors.bgTabs,";\n\t\t\t\t\t\tborder-radius: 0px 0px 0px 5px;\n\t\t\t\t\t\tposition: relative;\n\t\t\t\t\t\t&>div:last-child {\n\t\t\t\t\t\t\t\tmargin-right: 30px;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t.tab-and-drag-wrapper {\n\t\t\t\t\t\t\t\tposition:relative;\n\t\t\t\t\t\t\t\t.drag-indic {\n\t\t\t\t\t\t\t\t\t\tz-index: 2;\n\t\t\t\t\t\t\t\t\t\tposition: absolute;\n\t\t\t\t\t\t\t\t\t\ttop: -8px;\n\t\t\t\t\t\t\t\t\t\tleft: -6px;\n\t\t\t\t\t\t\t\t\t\twidth: 20px;\n\t\t\t\t\t\t\t\t\t\theight: 20px;\n\t\t\t\t\t\t\t\t\t\tcolor: #aaaaaa;\n\t\t\t\t\t\t\t\t\t\tfont-size: 8px;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t.tab-wrapper {\n\t\t\t\t\t\t\t\tposition: relative;\n\t\t\t\t\t\t\t\talign-items:center;\n\t\t\t\t\t\t\t\tdisplay:flex;\n\t\t\t\t\t\t\t\tmargin-right: 5px;\n\t\t\t\t\t\t\t\tpadding: 5px;\n\t\t\t\t\t\t\t\tbackground: ").concat(d.a.colors.bgTab,";\n\t\t\t\t\t\t\t\tdisplay: flex;\n\t\t\t\t\t\t\t\tcolor: ").concat(d.a.colors.fontTab,";\n\t\t\t\t\t\t\t\tfont-family: ").concat(d.a.font.editor,";\n\t\t\t\t\t\t\t\theight: 35px;\n\t\t\t\t\t\t\t\tbox-shadow:rgb(0 0 0 / 20%) 0px -1px 2px ;\n\t\t\t\t\t\t\t\tborder-radius: 5px 5px 0px 0px;\n\t\t\t\t\t\t\t\tjustify-content: space-between;\n\t\t\t\t\t\t\t\tmax-height: 27px;\n\t\t\t\t\t\t\t\toverflow: hidden;\n\t\t\t\t\t\t\t\ttext-align: center;\n\t\t\t\t\t\t\t\t.tab-nb-windows {\n\t\t\t\t\t\t\t\t\t\tmargin-left: 10px;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t.active-ribbon {\n\t\t\t\t\t\t\t\t\t\tposition: absolute;\n\t\t\t\t\t\t\t\t\t\ttop: 0px;\n\t\t\t\t\t\t\t\t\t\tleft: 0px;\n\t\t\t\t\t\t\t\t\t\twidth: 100%;\n\t\t\t\t\t\t\t\t\t\theight: 2px;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t&.active {\n\t\t\t\t\t\t\t\t\t\t.active-ribbon {\n\t\t\t\t\t\t\t\t\t\t\t\tbackground: ").concat(d.a.colors.main,";\n\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\tbackground: ").concat(d.a.colors.bgTabActive,";\n\t\t\t\t\t\t\t\t\t\tfont-weight: bold\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t&.tab-more {\n\t\t\t\t\t\t\t\t\t\tmin-width: 30px;\n\t\t\t\t\t\t\t\t\t\twidth: 30px;\n\t\t\t\t\t\t\t\t\t\tmax-width: 30px;\n\t\t\t\t\t\t\t\t\t\tcursor: pointer;\n\t\t\t\t\t\t\t\t\t\tfont-weight: bold;\n\t\t\t\t\t\t\t\t\t\tfont-family: ").concat(d.a.font.main,";\n\t\t\t\t\t\t\t\t\t\tdisplay:flex;\n\t\t\t\t\t\t\t\t\t\twidth: 100%;\n\t\t\t\t\t\t\t\t\t\tfont-size:14px;\n\t\t\t\t\t\t\t\t\t\tjustify-content: center;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t.tab-name {\n\t\t\t\t\t\t\t\t\t\tpadding: 10px 0px 10px 10px;\n\n\t\t\t\t\t\t\t\t\t\tinput {\n\t\t\t\t\t\t\t\t\t\t\t\tcolor:").concat(d.a.colors.fontTab," ;\n\t\t\t\t\t\t\t\t\t\t\t\tfont-size:").concat(Object(G.a)(1),"px;\n\t\t\t\t\t\t\t\t\t\t\t\tbackground: none;\n\t\t\t\t\t\t\t\t\t\t\t\tborder: none;\n\t\t\t\t\t\t\t\t\t\t\t\tmin-width: 30px;\n\t\t\t\t\t\t\t\t\t\t\t\tmax-width: 100px;\n\t\t\t\t\t\t\t\t\t\t\t\tfont-weight: 400;\n\t\t\t\t\t\t\t\t\t\t\t\tfont-family: ").concat(d.a.font.editor,";\n\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t.tab-nb-windows {\n\t\t\t\t\t\t\t\t\t\tpadding: 10px 0px 10px 0px;\n\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t.tab-close {\n\t\t\t\t\t\t\t\t\t\tcursor: pointer;\n\t\t\t\t\t\t\t\t\t\tmargin-left: 5px;\n\t\t\t\t\t\t\t\t\t\ttransform: rotate(45deg);\n\t\t\t\t\t\t\t\t\t\tcursor: pointer;\n\t\t\t\t\t\t\t\t\t\tmargin-left: 5px;\n\t\t\t\t\t\t\t\t\t\tpadding: 5px;\n\t\t\t\t\t\t\t\t\t\tfont-weight: bold;\n\t\t\t\t\t\t\t\t\t\tfont-family: ").concat(d.a.font.main,";\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t}\n\t\t}\n}\n"),"\n\t\t\t").concat(Object(_t.b)(),"\n\n\t\t\t\n\t\t\t").concat(Object(xt.b)(),'\n\n\t\t\t&.without-sidebar.device-view-desktop {\n\t\t\t\t\t.right-wrapper.draggable-grid-editors-view {\n\t\t\t\t\t\t\twidth: calc(100vw - 18px);\n\t\t\t\t\t\t\tmargin-left: 18px;\n\t\t\t\t\t}\n\t\t\t}\n\t\t}// end main-wrapper\n\t\t.preview-content {\n\t\t\t\tcounter-reset: h2counter;\n\t\t\th1 {\n\t\t\t\tcounter-reset: h2counter;\n\t\t\t}\n\t\t\th2:before {\n\t\t\t\tcontent: counter(h2counter) ".\\0000a0\\0000a0";\n\t\t\t\tcounter-increment: h2counter;\n\t\t\t\tcounter-reset: h3counter;\n\t\t\t}\n\t\t\th3:before {\n\t\t\t\tcontent: counter(h2counter) "." counter(h3counter) ".\\0000a0\\0000a0";\n\t\t\t\tcounter-increment: h3counter;\n\t\t\t}\n\t\t}\n\t\n\t');return e(),Object(u.a)(l,";","")},en=function(t,e,n,o){var i=Object(ze.a)("CssAppDynamic"+t+e),c="\n\t\t// IMPORTANT for all height app\n\t\theight:100%;\n\t\t".concat(Object(p.c)(t),"\n\t\t").concat(Object(Te.b)(t,o),"\n\t\t.draggable-grid-editors-view {\n\t\t\twidth: ").concat("desktop"===Object(r.a)()?d.a.sizes.desktop.r:"navigator"!==t?100:0,"vw;\n\t\t\theight: ").concat("desktop"===Object(r.a)()?"calc(100vh - ".concat(o.bottomBar?"30":"10","px)"):"100%",";\n\t\t\tdisplay: ").concat("desktop"===Object(r.a)()||"navigator"!==t?"block":"none",";\n\t\t\tpadding-top: 0px;\n\t\t\th3 {\n\t\t\t\tmargin-bottom: 0px;\n\t\t\t}\n\t\t\tpre {\n\t\t\t\t\twhite-space: -moz-pre-wrap; /* Mozilla, supported since 1999 */\n\t\t\t\t\twhite-space: -pre-wrap; /* Opera */\n\t\t\t\t\twhite-space: -o-pre-wrap; /* Opera */\n\t\t\t\t\twhite-space: pre-wrap; /* CSS3 - Text module (Candidate Recommendation) http://www.w3.org/TR/css3-text/#white-space */\n\t\t\t\t\tword-wrap: break-word; /* IE 5.5+ */\n\t\t\t}\n\t\t}\n\t\t.main-wrapper {\n\t\t\t////////////////////////////////////////////v \n\t\t\t// TEXT VIEW : RIGHT\n\t\t\t////////////////////////////////////////////v \n\t\t\t").concat(Object(_t.d)(o),"\n\t\t\t.left-wrapper {\n\t\t\t\twidth: ").concat("desktop"===Object(r.a)()?37:"navigator"!==t?0:100,"vw;\n\t\t\t\tdisplay: ").concat("desktop"===Object(r.a)()?"flex":"navigator"!==t?"none":"flex",";\n\t\t\t\tmin-width: 400px;\n\t\t\t\tmax-width: 900px;\n\t\t\t}\n\t\t} // end main-wrapper\n");return i(),Object(u.a)(c,";","")},nn=function(t){return t.path.substr(0,t.path.length-(t.title.length+1))},on=function(t){var e=t.split("/");(e=e.filter((function(t){return""!==t}))).pop();var n="/"+e.join("/")+"/";return n=n.replaceAll("//","/")},cn="\n<style>\n.popupContent p {\n\t\tbackground: #dadada;\n padding: 3px 5px;\n\t\tmargin: 0px 4px;\n\t\tdisplay: inline-block;\n}\n</style>\n",an=function(t,e,n,o){var i=function(t,e){console.log("[MOVEFILE] ".concat(t," -> ").concat(e)),Object(j.e)().then((function(n){n.file.move(t,e,(function(){n&&n.ui.browser.goTo(n.ui.browser.folders.current.get())}))}))};return{askForMoveFile:i,promptAndBatchMoveFiles:function(e){var n=e.files,o=e.folderToDropInto,c="Move <p>".concat(null===n||void 0===n?void 0:n.length,'</p> file(s) to <p>"').concat(o.key,'"</p>?\n<br>\n<br>\nRessources links will be automatically updated<br>\n').concat(cn,"\n");Object(j.d)((function(e){e.popup.confirm(c,(function(){!function(){for(var e=0;e<n.length;e++){var c=n[e],a="".concat(c.path),r="".concat(o.key,"/").concat(c.name);i(a,r),t()}}()}))}))},promptAndMoveFolder:function(n){var o=Object(s.a)({},n),i=o.folder,c=o.folderToDropInto,a=o.folderBasePath,r=o.newTitle,l=o.renameOnly,u=[i.path,"".concat(l?nn(c):c.path,"/").concat(r||i.title)],d="".concat(a,"/").concat(u[0]),p="".concat(a,"/").concat(u[1]),f="\n".concat(C.a.moveFolderPrompt," <p>").concat(u[0],"</p> to <p>").concat(u[1],"</p>?\n").concat(cn,"\n"),b=function(){!function(t,e,cb){console.log("[MOVEFOLDER] ".concat(t," -> ").concat(e)),Object(j.d)((function(n){n.folders.move(t,e,(function(){n&&n.ui.browser.goTo(n.ui.browser.folders.current.get()),cb&&cb()}))}))}(d,p,(function(){t(),e(),n.onMoveFn&&n.onMoveFn()}))};n.disablePrompt?b():Object(j.e)().then((function(t){t.popup.confirm(f,(function(){b()}))}))}}},rn="[LAST FILE]",ln=O.a.client.log.verbose,sn=[".tiro/answers/"],un=function(t){var e=Object(Ut.a)("files-history",[],{history:!1,debouncedSave:5e3}),n=Object(c.a)(e,3),a=n[0],r=n[1],l=n[2],s=i.a.useRef(a);Object(o.useEffect)((function(){s.current=a}),[a]),Object(o.useEffect)((function(){ln&&console.log(rn," activeFile changed!",t),t&&u(t)}),[t]);var u=function(t){if(!function(t){for(var e=0,n=sn;e<n.length;e++){var o=n[e];if(t.includes(o))return!0}return!1}(t.path)){ln&&console.log(rn,"Add to last notes",t.name);var e=s.current;if(!(e.length>0&&e[0].name===t.name)){var n=!0,o=-1,i=e;!1===Object(et.a)(e)&&(i=[]);for(var c=0;c<e.length;c++)e[c].name===t.name&&(n=!1,o=c);n||i.splice(o,1),(i=i.slice(0,400)).unshift(t),0!==i.length&&r(i)}}},d=Object(dt.a)(u,300),p={getAll:function(){return a},removeFile:function(t){console.log("".concat(rn," removing ").concat(t," from last notes"));var e=Object(R.a)(a);e=e.filter((function(e){return e.path!==t})),r(e)},addToHistory:function(t){!(arguments.length>1&&void 0!==arguments[1])||arguments[1]?d(t):u(t)},documentation:function(){return Object(wt.a)(p,"api.lastFilesHistory","client/src/hooks/app/lastFilesHistory.hook.tsx")}};return{filesHistory:a,filesHistoryRef:s,cleanLastFilesHistory:function(){r([])},refreshFilesHistoryFromBackend:l,lastFilesHistoryApi:p}},dn=function(){var t=Object(o.useState)(!1),e=Object(c.a)(t,2),n=e[0],i=e[1],a=Object(o.useState)(0),r=Object(c.a)(a,2),l=r[0],s=r[1],u=Object(o.useRef)(0);return Object(o.useEffect)((function(){var t=Object(A.a)((function(){u.current=u.current+1,s(l+1),i(!0),setTimeout((function(){i(!1)}),200)}),200);return window.addEventListener("resize",(function(){t()})),function(){window.removeEventListener("resize",(function(){t()}))}}),[]),{forceResponsiveRender:n,frr:u,responsiveRefreshCounter:l,setResponsiveRefresh:s}},pn=n(159),fn=n(247),bn=n(93),gn=function(t){var e=Object(o.useState)({}),n=Object(c.a)(e,2),i=n[0],r=n[1];Object(o.useEffect)((function(){}),[t.files]);var l=Object(o.useReducer)((function(t){return t+1}),0),s=Object(c.a)(l,2)[1],u=Object(o.useState)(2),p=Object(c.a)(u,2),f=p[0],b=p[1];Object(o.useEffect)((function(){Object(j.d)((function(t){b(t.userSettings.get("ui_filesList_sortMode"))}))}),[]);return Object(a.c)("div",{className:"files-list-component"},Object(a.c)("div",{className:"list-toolbar"},Object(a.c)("button",{type:"button",title:"sort",onClick:function(){var e=f+1>=V.a.length?0:f+1;Object(j.d)((function(n){n.userSettings.set("ui_filesList_sortMode",e),b(e),t.onSortFiles(Object(V.d)(t.files,e))}))}},Object(a.c)("span",null,t.files.length>0&&Object(a.c)("span",{className:"list-count"},"(",t.files.length,")"),V.b[f]),Object(a.c)(y.a,{name:"faSort",color:d.a.colors.l2.text}))),Object(a.c)("div",{className:"list-wrapper"},Object(a.c)(Y,{files:t.files,filesPreview:i,hoverMode:!1,activeFileIndex:t.activeFileIndex,sortMode:f,onFileClicked:function(e){t.onFileClicked(e)},onFileDragStart:t.onFileDragStart,onFileDragEnd:t.onFileDragEnd,onVisibleItemsChange:function(t){!function(t){for(var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=[],o=0;o<t.length;o++){var c=t[o];i[c]&&!e||n.push(c)}n.length>1&&Object(j.d)((function(t){t.files.getPreviews(n,(function(t){Object(mt.a)(t,(function(t){i[t.path]=t})),r(i),s()}))}))}(t,!0)}})))},hn=function(){var t="[NOTE HISTORY] ",e=O.a.client.log.verbose,n=Object(o.useRef)({}),i=function(){return(new Date).getTime()},c=function(n,o,i){e&&console.log("".concat(t," saveNoteHistory ").concat(n)),l.b.emit("createHistoryFile",{filePath:n,content:o,historyFileType:i,token:Object(z.b)()})},a={save:c,intervalSave:function(o,a){var r=n.current[o];(!r||r&&r+6e4<i())&&(e&&console.log("".concat(t," ").concat(o,", time ").concat(1," expired/inexistand, PROCEED BACKUP")),c(o,a,"int"),n.current[o]=i())},documentation:function(){return Object(wt.a)(a,"api.history","client/src/hooks/api/history.api.hook.tsx")}};return a},mn=function(t){var e=Object(o.useState)(!1),n=Object(c.a)(e,2),i=n[0],a=n[1],r=Object(o.useState)([]),l=Object(c.a)(r,2),u=l[0],d=l[1],p={isConnected:t.isConnected,searching:{get:i,set:a},ipsServer:{get:u,set:d,getLocal:function(){var t=u[0];return Object(mt.a)(u,(function(e){e.startsWith("192.168")&&(t=e)})),t}},refresh:Object(s.a)(Object(s.a)({},t.refresh),{},{increment:function(){t.refresh.set(t.refresh.get+1)}}),documentation:function(){return Object(wt.a)(p,"api.status","client/src/hooks/api/status.api.hook.tsx")}};return p},vn=n(142),wn="[PWA]",On=O.a.client.log.verbose,jn=function(){On&&console.log(wn," init"),"serviceWorker"in navigator&&navigator.serviceWorker.register("/service-worker.js"),window.addEventListener("beforeinstallprompt",(function(t){t.preventDefault(),On&&console.log(wn," beforeinstallprompt WORKING=>",t),window.deferredPrompt=t}))},xn=n(168),_n=n(31),kn=function(t){var e=t;return e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=e.replace(_n.a.ressource,"")).replace(_n.a.ref,"")).replace(_n.a.baliseHtml,"")).replace(/<[^>]*>?/gm," ")).replace(/((<!--).+?(-->))/gm," ")).replace(/(<!--).+?(-->)/gm," ")).replace(/(\r\n|\n|\r|\t)/gm," ")).replace(/(\r\n|\n|\r|\t)/gm," ")).replace(/\\./gm," ")).replace(/ +/g," ")).trim()).replace(/[^a-zA-Z0-9\u2019\-\_\\u2014\\\/"\xe0\xe2\xe4\xe8\xe9\xea\xeb\xee\xef\xf4\u0153\xf9\xfb\xfc\xff\xe7\xc0\xc2\xc4\xc8\xc9\xca\xcb\xce\xcf\xd4\u0152\xd9\xdb\xdc\u0178\xc7"'\xab\xbb\s\.,;:!?]/g," ")).replace(/\u2019|"|'/g,"\u2019")},yn=function(t){return t.replace(/(\r\n\r\n|\n\n|\r\r|\n)/gm,".")},Cn=function(){var t=[];return window.speechSynthesis.getVoices().forEach((function(e,n){var o=e.lang?" (".concat(e.lang,")"):"",i="".concat(e.name).concat(o);t.push({key:n,label:i,obj:e})})),t},Sn=function(t){return t=(t=(t=(t=t.replace(/\u2019/g,"'")).replace(/\u201c/g,'"')).replace(/[^a-zA-Z0-9]/g,"")).trim()},En=function(t,e,n){var o=$t.d.curr.tts_sentences_per_part,i=Tn(t,o).map((function(t){return t.length<50?"-_PLACEHOLDER_SEARCH_FOR_KEEPING_INDEX_LAKJFDSKJDLKSA_-":t}));0===i.length&&(i=[t]);var c=i.join(" ").substring(0,150);console.log("trying finding extracts:",c,e.length);var a=-1;return Object(mt.a)(e,(function(t,e){Object(mt.a)(i,(function(n,o){if(-1==a&&-1!==Sn(t).indexOf(Sn(n)))return a=e-o+1,!1}))})),a},Tn=function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:70;n=parseInt(n.toString());for(var o=(t=yn(t)).match(/[^.!?:]+[.!?:]+/g)||[],i=0;i<o.length;i++)o[i].split(" ").length<3&&(o[i]+=o[i+1],o.splice(i+1,1));var c=o;c=c.filter((function(t){return t.length>0}));for(var a="",r=[],l=0;l<c.length;l++){l%e===0&&(r.push(a),a=""),(a+=c[l]).split(" ").length>n&&(r.push(a),a="")}for(var s=0;s<r.length;s++)for(;r[s].split(" ").length>n;){var u=r[s].split(" ").slice(0,n).join(" ");r[s]=r[s].split(" ").slice(n).join(" "),r.splice(s,0,u)}for(var d=[],p=0;p<r.length;p++){var f=r[p].split(" ").length;d.push(f)}return r=r.filter((function(t){return t.length>1}))},In=function(t,e){for(var n=(t=yn(t)).split(/[.!?]+/),o=[],i=0;i<n.length;i++){var c=n[i];if(c.length>e)for(var a=c.split(" "),r="",l=0;l<a.length;l++)((r+=a[l]+" ").length>e||l===a.length-1)&&(o.push(r),r="");else o.push(c)}return o},Nn=Object(I.a)((function t(e){var n=this;Object(T.a)(this,t),this.rawText=void 0,this.voice=void 0,this.text2read=void 0,this.chunkedText=void 0,this.chunkLength=1e3,this.currChunkId=0,this.currSpeechObj=void 0,this.speed=1,this.isLoaded=!1,this.shouldStop=!1,this.chunkText=In,this.loadVoice=function(t){console.log("[TTS] LOAD VOICE",t),n.voice=t,n.pause(),n.play()},this.updateSpeed=function(t){n.speed=t,n.pause(),n.play()},this.play=function(){if(n.isLoaded)window.speechSynthesis.resume();else{if(n.currChunkId>n.chunkedText.length-1)return console.log("[TTS] finished played");n.isLoaded=!0,n.currSpeechObj=new SpeechSynthesisUtterance,n.currSpeechObj.text=n.chunkedText[n.currChunkId],n.currSpeechObj.rate=n.speed,n.voice&&(n.currSpeechObj.voice=n.voice),setTimeout((function(){window.speechSynthesis.speak(n.currSpeechObj)}),0),n.currSpeechObj.addEventListener("end",(function(){n.isLoaded=!1,n.shouldStop?n.shouldStop=!1:(n.currChunkId+=1,n.play())}))}},this.isPlaying=function(){var t=window.speechSynthesis.speaking;return t&&(t=!window.speechSynthesis.paused),t},this.pause=function(){n.stop()},this.stop=function(){n.shouldStop=!0,n.isLoaded=!1,n.debounceReinitStop(),window.speechSynthesis.cancel()},this.debounceReinitStop=Object(A.a)((function(){n.shouldStop=!1}),1e3),this.goToChunk=function(t){t<=0||t>n.chunkedText.length-1||(n.currChunkId=t,n.isPlaying()&&n.debounceRestart())},this.extractToChunkPos=En,this.getCurrentChunkText=function(){return n.chunkedText[n.currChunkId]},this.debounceRestart=Object(A.a)((function(){n.stop(),n.play()}),500),this.goBack=function(){n.goToChunk(n.currChunkId-1)},this.goForward=function(){n.goToChunk(n.currChunkId+1)},this.rawText=e.text,this.text2read=kn(e.text),this.chunkedText=this.chunkText(this.text2read,this.chunkLength),console.log("[TTS] init new manager ",{p:e,text:this.chunkedText,length:this.chunkedText.length})})),Pn=n(34),An=n(47),Rn="[SCREEN WAKE LOCK]",Fn=null,Ln=function(){var t=Object(An.a)(Object(Pn.a)().mark((function t(){return Object(Pn.a)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,navigator.wakeLock.request("screen");case 3:Fn=t.sent,console.log(Rn,"ACTIVE"),t.next=10;break;case 7:t.prev=7,t.t0=t.catch(0),console.log(Rn,"Error : ".concat(t.t0.name,", ").concat(t.t0.message));case 10:case"end":return t.stop()}}),t,null,[[0,7]])})));return function(){return t.apply(this,arguments)}}(),Dn=function(){Fn&&Fn.release().then((function(){Fn=null,console.log(Rn,"DISABLED")}))};var Mn=function(t){var e=Object(o.useState)(!1),n=Object(c.a)(e,2),i=n[0],l=n[1],s=Object(h.a)("tts-selected-voice",0),u=Object(c.a)(s,2),d=u[0],p=u[1],f=Object(o.useState)(!1),b=Object(c.a)(f,2),g=b[0],m=b[1],v=function(t){!0===t?Ln():Dn(),m(t)},w=Object(h.a)("tts-pos-".concat(t.id),0),O=Object(c.a)(w,2),j=O[0],_=O[1],k=Object(h.a)("tts-rate",1),S=Object(c.a)(k,2),E=S[0],T=S[1],I=Object(o.useState)(0),N=Object(c.a)(I,2),P=N[0],A=N[1],R=Object(o.useState)(""),F=Object(c.a)(R,2),L=F[0],D=F[1];Object(o.useEffect)((function(){var t=function(t){var e=0,n="".concat(Math.ceil(t),"m");if(t>60){e=Math.floor(t/60);Math.ceil(t%60);n="".concat(e,"h")}return n},e=t(6*(P-j)/(60*E)),n=t(6*P/(60*E)),o=" ".concat(e," left of ").concat(n);D(o)}),[P,E,j]);var M=Object(o.useRef)();window.tts=M,Object(o.useEffect)((function(){M.current=new Nn({text:t.fileContent}),M.current.goToChunk(j)}),[]),Object(o.useEffect)((function(){M.current.updateSpeed(E)}),[E]);var z=Object(o.useRef)(!1);return x((function(){l(M.current.isPlaying());var e=-1;(e=0!==M.current.currChunkId?M.current.currChunkId:M.current.currChunkId=1,t.startString&&!z.current)&&(e=M.current.extractToChunkPos(t.startString,M.current.chunkedText,M.current.chunkLength),M.current.goToChunk(e),z.current=!0);-1!==e&&_(e),A(M.current.chunkedText.length)}),500),Object(o.useEffect)((function(){var e=M.current.getCurrentChunkText();t.onUpdate({totalChunks:P,currentChunk:j,isPlaying:i,currentText:e})}),[P,j,i]),Object(a.c)(zn,null,Object(a.c)(rt.a,{title:"".concat(C.a.ttsPopup.title),onClose:function(){M.current.stop(),t.onUpdate({totalChunks:P,currentChunk:j,isPlaying:!1}),t.onClose()}},Object(a.c)(at.a,{value:d,type:"select",list:Cn(),label:C.a.ttsPopup.voice,onSelectChange:function(t){!function(t){p(t);var e=Cn();e[d]&&M.current.loadVoice(e[d].obj)}(parseInt(t))}}),Object(a.c)("span",null," SPEED : "),Object(a.c)("input",{className:"speed-range",type:"range",value:E,min:"0.5",max:"2",step:"0.1",onChange:function(t){var e=t.target.value;T(e)}})," (",E,")",Object(a.c)("br",null),Object(a.c)("br",null),Object(a.c)("b",null," SENTENCES : "),Object(a.c)("input",{type:"number",className:"text-pos",value:j,min:"0",max:P,onChange:function(t){var e=parseInt(t.target.value);M.current.goToChunk(e),_(e)}})," / ",P,Object(a.c)("br",null),Object(a.c)("input",{type:"range",value:j,className:"range-pos",min:"0",max:P,onChange:function(t){var e=parseInt(t.target.value);M.current.goToChunk(e),_(e)}}),Object(a.c)("div",{className:"estimated-time"},Object(a.c)("b",null,"Reading Time")," :",L),Object(a.c)("div",{className:"buttons"},Object(a.c)("button",{onClick:function(t){M.current.goBack()}},Object(a.c)(y.a,{name:"faFastBackward",color:"black"})),Object(a.c)("button",{onClick:function(t){i||M.current.goToChunk(j),i?M.current.stop():M.current.play()}},Object(a.c)(y.a,{name:i?"faPause":"faPlay",color:"black"})),Object(a.c)("button",{onClick:function(t){M.current.goForward()}},Object(a.c)(y.a,{name:"faFastForward",color:"black"})),"desktop"!==Object(r.a)()&&Object(a.c)("button",{onClick:function(t){v(!0)}},Object(a.c)(y.a,{name:"faLock",color:"black"})))),g&&Object(a.c)("div",{className:"bg-lock"},Object(a.c)("button",{onContextMenu:function(t){v(!1)}},Object(a.c)(y.a,{name:"faUnlock",color:"black"}))))},zn=Object(xn.a)("div",{target:"e1kwupat0"})({name:"1zwjan",styles:".bg-lock{position:fixed;top:0px;left:0px;width:100vw;height:100vh;z-index:100005;background:rgba(0,0,0,0.3);display:flex;justify-content:center;align-items:center;button{}}.popup-wrapper .popupContent{padding:20px;.input-component span,span{display:inline-block;width:30%;font-size:12px;font-weight:bold;}.speed-range{position:relative;top:8px;width:90%;}.range-pos{width:100%;margin-bottom:10px;}.text-pos{width:50px;margin-bottom:10px;}}.buttons{display:flex;padding:20px 0px 0px 0px;button{width:30%;padding:10px;}}"}),Bn=function(){var t=Object(o.useState)(!1),e=Object(c.a)(t,2),n=e[0],i=e[1],a=Object(o.useState)(null),r=Object(c.a)(a,2),l=r[0],s=r[1],u=Object(o.useState)(null),d=Object(c.a)(u,2),p=d[0],f=d[1],b=Object(o.useState)(""),g=Object(c.a)(b,2),h=g[0],m=g[1],v=Object(o.useRef)(null);return{ttsApi:{open:function(t,e){var n=(e=e||{}).id?e.id:null,o=e.startString?e.startString:null,c=t.length<1500?t:t.substring(0,1500)+"..., total size chars = "+t.length;console.log("[TTS API]","open",{id:n,contentSub:c,startString:o}),s(n),o&&f(o),m(t),i(!0)},close:function(){i(!1)},getStatus:function(cb){v.current&&cb(v.current)}},ttsPopupContent:h,ttsPopupId:l,ttsPos:p,setTtsPopup:i,ttsPopup:n,syncTtsStatus:function(t){v.current=t}}},Wn=function(){var t=Object(o.useState)(null),e=Object(c.a)(t,2),n=e[0],i=e[1],a={open:function(t,e,n){var o=e[0],c=e[1];Pe+o>window.innerWidth&&(o-=Math.abs(window.innerWidth-Pe-o-10)),Ae+c>window.innerHeight&&(c-=Math.abs(window.innerHeight-Ae-c-10)),"50%"===o&&(o="calc(50% - ".concat(Pe/2,"px)")),"50%"===c&&(c="calc(50% - ".concat(Pe/2,"px)")),i({isOpen:!0,filepath:t,position:e=[o,c],opts:n})},close:function(){i(null)},documentation:function(){return Object(wt.a)(a,"api.notePreviewPopup","client/src/hooks/api/notePreviewPopup.api.hook.tsx")}};return{notePreviewPopupApi:a,notePreviewPopup:n,setNotePreviewPopup:i}},Un=n(43),Hn=n(132),qn=n(171),Vn=n(193),Gn=function(t){console.log("createNewNote",t),Object(j.d)((function(e){var n=t.folderPath||e.ui.browser.folders.current.get();e.file.create(n,(function(o){var i=Object(V.c)(o);i&&("floatingWindow"===t.openIn?e.ui.floatingPanel.create({type:"file",file:i,view:"editor"}):i&&e.ui.browser.goTo(n,i.name,{openIn:"activeWindow"}))}))}))},Jn=n(57);const Kn="[TtsCustomPopup]";let Yn=function(t){return t.IDLE="IDLE",t.LOADING="LOADING",t.PLAYING="PLAYING",t.PAUSED="PAUSED",t.ENDED="ENDED",t.ERROR="ERROR",t}({});const $n="[TtsCustomPopup]";function Zn(t){const e=t.log,n=t.onChunkEnd,i=t.downloadChunk,a=t.totalChunks,r=t.currentChunk,l=t.playbackRate,s=t.ttsHeaders,u=t.preloadCount,d=t.setIsPlaying,p=t.downloadInProgress,f=void 0===p?{current:new Set}:p,b=t.audioUrls,g=void 0===b?{current:[]}:b,h=Object(o.useRef)(Yn.IDLE),m=Object(o.useRef)(!1),v=Object(o.useRef)(null),w=Object(o.useRef)(!1),O=Object(o.useRef)(null),j=Object(o.useRef)(new Map),x=(Object(o.useRef)([]),()=>{if(j.current.size<=3)return;const t=j.current.size-3;let n=0;for(const e of j.current){var o=Object(c.a)(e,2);const i=o[0];o[1];if(n>=t)break;i.startsWith("blob:")&&URL.revokeObjectURL(i),j.current.delete(i),n++}e("".concat($n,": \ud83d\uddd1\ufe0f evicted ").concat(n," blob(s), cache size now ").concat(j.current.size))}),_=t=>{h.current=t},k=function(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if("undefined"===typeof window)return;void 0===window.tiro_tts_allAudiosRef&&(window.tiro_tts_allAudiosRef=[]);const e=window.tiro_tts_allAudiosRef;for(let o=0;o<e.length;o++)try{e[o].pause()}catch(n){}t&&(window.tiro_tts_allAudiosRef=[])},y=async(t,o)=>{if(m.current||w.current)return;let c=await(async t=>{const n=s;if(0===Object.keys(n).length)return t;const o=j.current.get(t);if(o){const t=URL.createObjectURL(o);return e("".concat($n,": \ud83d\udce6 audio from cache (").concat(o.size," bytes)")),t}e("".concat($n,": \ud83c\udf10 fetching audio with headers: ").concat(t));try{const o=await fetch(t,{headers:n});if(!o.ok)throw new Error("HTTP ".concat(o.status));const i=await o.blob(),c=URL.createObjectURL(i);return e("".concat($n,": \ud83d\udce6 audio fetched as blob (").concat(i.size," bytes)")),c}catch(i){return e("".concat($n,": \u274c fetch audio ERROR: ").concat(i.message,", fallback to direct URL")),t}})(t);const r=new Audio(c);v.current=r,r.preload="auto",e("".concat($n,": \ud83c\udfb5 starting audio load for chunk ").concat(o)),(t=>{"undefined"!==typeof window&&(void 0===window.tiro_tts_allAudiosRef&&(window.tiro_tts_allAudiosRef=[]),window.tiro_tts_allAudiosRef.push(t))})(r);let p=!1;const f=()=>{if(m.current)return;if(w.current)return;if(p)return;p=!0,O.current&&(clearTimeout(O.current),O.current=null),e("".concat($n,": \u2705 mp3 ready for chunk ").concat(o,", starting playback")),_(Yn.PLAYING),r.play().catch((t=>{m.current||e("".concat($n,": \u274c play() rejected: ").concat(t.message))})),v.current&&(v.current.playbackRate=l);const t=u||1;for(let n=1;n<=t;n++){const t=o+n;t<a&&i(t,(o=>{1===n&&o&&!o.includes("ERROR")&&Object.keys(s).length>0&&fetch(o,{headers:s}).then((t=>t.ok?t.blob():Promise.reject(new Error("not ok")))).then((n=>{j.current.set(o,n),x(),e("".concat($n,": \ud83d\udce6 preloaded blob chunk ").concat(t," (").concat(n.size," bytes)"))})).catch((()=>{}))}))}};r.oncanplay=f,O.current=setTimeout(f,3e3),r.onerror=()=>{m.current||(e("".concat($n,": \u274c audio LOAD ERROR for ").concat(t)),_(Yn.ERROR),d(!1))},r.onended=()=>{h.current===Yn.PLAYING&&(m.current||(e("".concat($n,": audio ENDED")),c.startsWith("blob:")&&URL.revokeObjectURL(c),j.current.delete(t),x(),(t=>{if("undefined"===typeof window)return;if(void 0===window.tiro_tts_allAudiosRef)return;const e=window.tiro_tts_allAudiosRef,n=e.indexOf(t);-1!==n&&e.splice(n,1)})(r),v.current=null,r.remove(),_(Yn.ENDED),d(!1),n()))}},C=Object(o.useCallback)((function(t){var n;if((arguments.length>1&&void 0!==arguments[1]&&arguments[1]||t!==r||null!==(n=v.current)&&void 0!==n&&n.src)&&(m.current=!0,v.current&&(v.current.pause(),v.current.oncanplay=null,v.current.onerror=null,v.current.onended=null),O.current&&(clearTimeout(O.current),O.current=null),k(!1),m.current=!1),g.current[t]){const e=g.current[t];return _(Yn.LOADING),d(!0),void y(e,t)}if(f.current.has(t))return e("".concat($n,": \u23f3 chunk ").concat(t," preloading (skip duplicate download)")),void i(t,(n=>{m.current||w.current||n&&!n.includes("ERROR")&&(e("".concat($n,": \u25b6\ufe0f playing chunk ").concat(t," (from preload)")),_(Yn.LOADING),d(!0),y(n,t))}));i(t,(n=>{m.current||w.current||n&&!n.includes("ERROR")&&(e("".concat($n,": \u25b6\ufe0f playing chunk ").concat(t)),_(Yn.LOADING),d(!0),y(n,t))}))}),[r,e]),S=Object(o.useCallback)((()=>{m.current=!0,v.current&&(v.current.pause(),v.current.remove(),v.current=null),k(!1),O.current&&(clearTimeout(O.current),O.current=null),_(Yn.PAUSED),d(!1)}),[e]),E=Object(o.useCallback)((()=>{m.current=!1,v.current&&v.current.src?(v.current.play().catch((t=>{e("".concat($n,": \u274c resume play ERROR: ").concat(t.message)),m.current=!1,C(r,!1)})),_(Yn.PLAYING),d(!0),e("".concat($n,": \u25b6\ufe0f resumed"))):(m.current=!1,C(r,!1))}),[r,e,C]),T=Object(o.useCallback)((()=>{k(!0),m.current=!1,O.current&&(clearTimeout(O.current),O.current=null),v.current&&(v.current.pause(),v.current.remove(),v.current=null),j.current.forEach(((t,e)=>{e.startsWith("blob:")&&URL.revokeObjectURL(e)})),j.current.clear(),w.current=!1,_(Yn.IDLE),d(!1),e("".concat($n,": audio DESTROYED"))}),[e]);return{get state(){return h.current},get cancelledRef(){return m},get audioRef(){return v},get isPopupClosedRef(){return w},playChunk:C,pause:S,resume:E,destroy:T}}const Xn="[TtsCustomPopup] ",Qn=t=>{const e=Object(o.useState)(!1),n=Object(c.a)(e,2),l=n[0],s=n[1],u=Object(o.useRef)(!1),d=t=>{s(t),u.current=t},p=Object(h.a)("tts-selected-voice",0),f=Object(c.a)(p,2),b=(f[0],f[1],Object(h.a)("tts-rate",1)),g=Object(c.a)(b,2),m=g[0],v=g[1],w=Object(o.useRef)(m),O=Object(Ut.a)("tts-word-stats",0,{debug:!1}),_=Object(c.a)(O,3),k=_[0],S=_[1],E=_[2],T=Object(o.useRef)(0);Object(o.useEffect)((()=>{E((t=>{"number"===typeof t&&(T.current=t)}))}),[]);const I=Object(o.useState)(!1),N=Object(c.a)(I,2),P=N[0],A=N[1],R=t=>{!0===t?Ln():Dn(),A(t)},F=Object(h.a)("tts-pos-".concat(t.id),0),L=Object(c.a)(F,2),D=L[0],M=L[1],z=Object(o.useState)(""),B=Object(c.a)(z,2),W=(B[0],B[1],Object(o.useState)("")),U=Object(c.a)(W,2),H=U[0],q=U[1],V=Object(o.useState)(""),G=Object(c.a)(V,2),J=G[0],K=G[1],Y=Object(o.useRef)(""),$=Object(o.useRef)(""),Z=Object(o.useState)(!0),X=Object(c.a)(Z,2),Q=X[0],tt=X[1],et=Object(o.useState)("processus"),nt=Object(c.a)(et,2),ot=nt[0],it=nt[1],ct=Object(o.useRef)(ot);let at="processus"===ct.current?H:J;const lt=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"processus";if(e!==ct.current)return;let n=t.replaceAll("".concat(Xn,":"),"");n=n.replaceAll(Xn,"");const o=(new Date).toLocaleTimeString("en-GB",{hour:"2-digit",minute:"2-digit"});n="".concat(o," ").concat(bt.current," ").concat(n);const i=t=>{if(t.split("<br>").length>200){let n=t.split("<br>");"text"!==e?(t=n.slice(0,200).join("<br>"),t+="<br>~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"):t=n.slice(n.length-200,n.length).join("<br>")}return t};"processus"===e?(Y.current=n+"<br>"+Y.current,Y.current=i(Y.current),q(Y.current)):($.current=$.current+"<br>"+n,$.current=i($.current),K($.current))},st=Object(o.useState)([]),ut=Object(c.a)(st,2),pt=ut[0],ft=ut[1];Object(o.useEffect)((()=>{let e=pt[D];e&&(e=e.split(/[.?!:]/)[0]),t.onUpdate({totalChunks:pt.length,currentChunk:D,isPlaying:l,currentText:e})}),[pt,D,l]),Object(o.useEffect)((()=>{let e=kn(t.fileContent),n=$t.d.curr.tts_sentences_per_part,o=$t.d.curr.tts_max_words_per_sentence,i=Tn(e,n,o);ft(i),console.log("".concat(Xn,": loading and chunking text in ").concat(i.length," parts"))}),[t.fileContent]);const bt=Object(o.useRef)(D),gt=t=>{M(t),bt.current=t},mt=Object(o.useRef)({});Object(o.useEffect)((()=>{const t=$t.d.curr.tts_custom_engine_command||"";mt.current=(t=>{const e={},n=/-H\s+["']([^"']+)["']/g;let o;for(;null!==(o=n.exec(t));){const t=o[1].split(":");if(t.length>=2){const n=t[0].trim(),o=t.slice(1).join(":").trim();e[n]=o}}return e})(t),Object.keys(mt.current).length>0&<("".concat(Xn,": \ud83d\udd11 extracted TTS headers: ").concat(Object.keys(mt.current).join(", ")))}),[]);const vt=function(t){const e=t.textChunks,n=t.log,i=t.setWordStat,c=Object(o.useRef)(new Set),a=Object(o.useRef)(new Map),r=Object(o.useRef)([]),l=Object(o.useRef)(0),s=Object(o.useCallback)(((t,cb)=>{const o=$t.d.curr.tts_custom_engine_command,s=e[t];if(!s||0===s.length)return void n("".concat(Kn,": \u26a0\ufe0f chunk ").concat(t," is empty, do not download"));n("".concat(Kn,": \ud83d\udce5 starting download for chunk ").concat(t));const u=(null===s||void 0===s?void 0:s.split(" ").length)||0;"number"===typeof u&&"number"===typeof l.current&&(l.current=l.current+u,i(l.current));const d="[".concat(u," words]"),p=Object(Jn.d)(s,{accents:!0,specialChars:!1,escapeChars:!0});let f=o.replace("{{input}}",s);f=f.replace("{{input_simple}}",p);let b=!1;const g=t=>{b||(cb(t),b=!0)};if(r.current[t])return void g(r.current[t]);if(c.current.has(t))return n("".concat(Kn,": \u23f3 chunk ").concat(t," already downloading, queuing callback")),a.current.has(t)||a.current.set(t,[]),void a.current.get(t).push(cb);const h=Date.now();c.current.add(t),n("".concat(Kn,": \ud83d\ude80 requesting chunk ").concat(t," ").concat(d)),Object(j.d)((e=>{e.command.exec(f,(e=>{if(n("".concat(Kn,": \ud83d\udce8 API response received for chunk ").concat(t," [").concat(e.substring(0,80)).concat(e.length>80?"...":"","]")),b)return;c.current.delete(t);let o="";const i=e.match(/https?:\/\/[\S]+\.(mp3|wav|ogg|m4a)/i);if(i)o=i[0];else try{const t=JSON.parse(e);o=t.output||t.url||t.audio_url||t.data||""}catch(s){}const l=a.current.get(t);if(l){for(const t of l)t(o||"ERROR: API");a.current.delete(t)}if(o&&o.length>0){const e=Date.now()-h,i="[".concat(e,"ms]");n("".concat(Kn,": \ud83d\udce5 [ok] API done for chunk ").concat(t," ").concat(d," ").concat(i)),n("".concat(Kn,": \u2705 chunk ").concat(t," download FINISHED ").concat(i)),r.current[t]=o,g(o)}else{let o=e;try{const i=JSON.parse(e);o="".concat(i.stderr," - ").concat(i.shortMessage),n("".concat(Kn,": \ud83d\udce5\u274c [!! error] chunk ").concat(t,": API answer error: ").concat(o," ").concat(d))}catch(u){n("".concat(Kn,": \u274c [!! error] chunk ").concat(t,": API answer error: ").concat(JSON.stringify(u)," ").concat(d))}g("ERROR: API")}}))}))}),[e,n,i]),u=Object(o.useCallback)((()=>{c.current.clear(),a.current.clear(),r.current=[]}),[]);return{downloadChunk:s,downloadInProgress:c,audioUrls:r,cleanup:u}}({textChunks:pt,log:lt,setWordStat:S}),wt=Zn({log:lt,onChunkEnd:()=>_t(),downloadChunk:vt.downloadChunk,totalChunks:pt.length,currentChunk:D,playbackRate:w.current,ttsHeaders:mt.current,preloadCount:$t.d.curr.tts_preload_parts||1,setIsPlaying:d,downloadInProgress:vt.downloadInProgress,audioUrls:vt.audioUrls}),Ot=(wt.audioRef,vt.downloadInProgress),jt=Object(dt.a)((t=>{gt(t),wt.playChunk(t,!0)}),300),xt=Object(o.useRef)(0),_t=Object(o.useCallback)((()=>{if(bt.current<pt.length-1){let t=bt.current+1;lt("".concat(Xn,": \ufe0f\u23ed next chunk ").concat(t)),gt(t),wt.playChunk(t,!1)}}),[pt.length,lt,wt]),kt=Object(o.useCallback)((()=>{if(0!==bt.current){let t=bt.current-1;lt("".concat(Xn,":\ufe0f\u23ee prev chunk ").concat(t)),gt(t),wt.playChunk(t,!0)}}),[lt,wt]),yt=Object(o.useCallback)((()=>{l?(d(!1),wt.pause(),lt("".concat(Xn,": \u23f8\ufe0f paused"))):(wt.resume(),lt("".concat(Xn,": \u25b6\ufe0f resumed")))}),[l,wt,lt]),Ct=Object(o.useCallback)((t=>{var e;(null===(e=wt.audioRef.current)||void 0===e?void 0:e.playbackRate)&&(wt.audioRef.current.playbackRate=t)}),[wt]);Object(o.useRef)(pt).current=pt,Object(o.useEffect)((()=>{pt.length>0&&!l&&!Ot.current.has(D)&&wt.playChunk(D,!1)}),[pt]),Object(o.useEffect)((()=>{lt("=====================================================================")}),[]);const St=Object(o.useRef)(!1);x((()=>{if(t.startString&&!St.current&&!l&&0===Ot.current.size){let e=-1,n=En(t.startString,pt);e=n,St.current=!0;let o=t.startString.substring(0,100),i="".concat(Xn,' \ud83d\udd0e found startString "').concat(o,'" at chunk ').concat(n);-1===n&&(i="".concat(Xn,' \ud83d\udd0e NOT FOUND startString "').concat(o,'" at chunk ').concat(n)),lt(i),-1!=e&&(gt(e),wt.playChunk(e,!1))}}),500),x((()=>{if(!0===u.current){if(!wt.audioRef.current)return;if(!wt.audioRef.current.src)return;wt.audioRef.current.paused&&wt.audioRef.current.readyState>=2&&!Ot.current.has(bt.current)&&wt.audioRef.current.play().catch((()=>{}))}}),5e3),x((()=>{let t=wt.audioRef.current;if(!t)return;let e=Math.round(t.currentTime),n=t.duration,o=t.paused,i=Math.round(n),c=!Object(ht.a)(n)||isNaN(i)?"loading":"".concat(i,"s");lt("".concat(Xn,": audio status: ").concat(e,"s/").concat(c," ").concat(o?"paused":"playing"," ").concat(u.current?"isPlaying":"isNotPlaying"," readyState=").concat(t.readyState)),t.readyState<2||Ot.current.has(bt.current)?xt.current=0:!Object(ht.a)(n)||isNaN(i)||"NaN"==="".concat(i)?(lt("".concat(Xn,": \u274c audio ERROR detected ").concat(xt.current," times (timeAudio: ").concat(n,", roundTimeAudio: ").concat(i,")")),xt.current>=5&&(lt("".concat(Xn,": \u274c>> audio ERROR, stopping and restarting")),xt.current=0,wt.pause(),wt.playChunk(bt.current,!0)),xt.current=xt.current+1):xt.current=0}),5e3);const Et=Object(o.useState)(""),Tt=Object(c.a)(Et,2),It=Tt[0],Nt=Tt[1];Object(o.useEffect)((()=>{let t=t=>{let e=0,n="".concat(Math.ceil(t),"m");if(t>60){e=Math.floor(t/60);Math.ceil(t%60);n="".concat(e,"h")}return n},e=($t.d.curr.tts_max_words_per_sentence,$t.d.curr.tts_sentences_per_part),n=pt.length*e,o=t(6*(n-D)/(60*m)),i=t(6*n/(60*m)),c=" ".concat(o," left of ").concat(i);Nt(c)}),[pt,m,D]);let Pt=$t.d.curr.tts_formId,At=$t.d.curr.tts_form_extract_length||10;return Object(a.c)(to,null,Object(a.c)(rt.a,{title:"".concat(C.a.ttsPopup.title),disableBg:!0,onClose:()=>{wt.destroy();let e=pt[D];e&&(e=e.split(/[.?!:]/)[0]),t.onUpdate({totalChunks:pt.length,currentChunk:D,isPlaying:!1,currentText:e}),t.onClose()}},Object(a.c)("span",null," SPEED : "),Object(a.c)("input",{className:"speed-range",type:"range",value:m,min:"0.5",max:"3",step:"0.1",onChange:t=>{const e=parseFloat(t.target.value);var n;v(n=e),w.current=n,Ct(e)}})," (",m,")",Object(a.c)("br",null),Object(a.c)("br",null),Object(a.c)("b",null," PARTS : "),Object(a.c)("input",{type:"number",className:"text-pos",value:D,min:"0",max:pt.length,onChange:t=>{let e=parseInt(t.target.value);jt(e)}})," / ",pt.length,Object(a.c)("br",null),Object(a.c)("input",{type:"range",value:D,className:"range-pos",min:"0",max:pt.length,onChange:t=>{let e=parseInt(t.target.value);jt(e)}}),Object(a.c)("div",{className:"estimated-time"},Object(a.c)("b",null,"Reading Time")," :",It),Object(a.c)("div",{className:"buttons"},Object(a.c)("button",{onClick:t=>{kt()}},Object(a.c)(y.a,{name:"faFastBackward",color:"black"})),Object(a.c)("button",{onClick:t=>{yt()}},Object(a.c)(y.a,{name:l?"faPause":"faPlay",color:"black"})),Object(a.c)("button",{onClick:t=>{_t()}},Object(a.c)(y.a,{name:"faFastForward",color:"black"})),"desktop"!==Object(r.a)()&&Object(a.c)("button",{onClick:t=>{R(!0)}},Object(a.c)(y.a,{name:"faLock",color:"black"}))),Object(a.c)("div",{onClick:t=>tt(!Q),className:"log-button"}," details "),Q&&"number"===typeof k&&Object(a.c)("div",{className:"stats"},"API Words sent: ",k,Object(a.c)("br",null),"Estimated time spoken: ",k/10/60/2<60?"".concat(Math.round(k/10/60/2)," minutes"):"".concat(Math.round(k/10/60/2/60*10)/10," hours (").concat(Math.round(k/10/60/2)," mins)"),Object(a.c)("br",null),"Estimated price : ",Math.round(k*$t.d.curr.tts_price_per_word*1e5)/1e5,Object(a.c)("br",null)),Q&&Object(a.c)("label",{className:"log-toggler"},"Toggle log: ",Object(a.c)("input",{type:"checkbox",checked:"text"===ot,onChange:t=>{return e=t.target.checked?"text":"processus",ct.current=e,void it(e);var e}}),":","text"===ot?"Text Log":"Processus Log"),""!==Pt&&Object(a.c)(i.a.Fragment,null,"| form: ",Object(a.c)("button",{onClick:()=>{Object(j.d)((t=>{t.popup.form.open(Pt,(()=>{}))}))}},"Open"),Object(a.c)("button",{onClick:()=>{Object(j.d)((e=>{let n=$.current.split("<br>"),o=At;n.length>o&&(n=n.slice(-o)),n=n.join(".")+" ",e.popup.form.open(Pt,(()=>{}),{text:n,file:"tts insert from ".concat(t.id)},{autosubmit:1e3})}))}},"Insert")),Q&&Object(a.c)("div",{className:"log-wrapper"},Object(a.c)("div",{dangerouslySetInnerHTML:{__html:at}}))),P&&Object(a.c)("div",{className:"bg-lock"},Object(a.c)("button",{onContextMenu:t=>{R(!1)}},Object(a.c)(y.a,{name:"faUnlock",color:"black"}))))},to=Object(xn.a)("div",{target:"e1bujtpy0"})({name:"1enhzg0",styles:".log-toggler{font-size:10px;margin-right:10px;}.stats{font-size:10px;padding:10px;}.log-button{cursor:pointer;color:#0000ff;margin-top:10px;text-align:center;font-size:12px;}.log-wrapper{min-width:300px;height:200px;overflow:scroll;background:#ececec;padding:10px;margin-top:10px;font-size:10px;}.bg-lock{position:fixed;top:0px;left:0px;width:100vw;height:100vh;z-index:100005;background:rgba(0,0,0,0.3);display:flex;justify-content:center;align-items:center;button{}}.popup-wrapper .popupContent{padding:20px;.input-component span,span{display:inline-block;width:30%;font-size:12px;font-weight:bold;}.speed-range{position:relative;top:8px;width:90%;}.range-pos{width:100%;margin-bottom:10px;}.text-pos{width:50px;margin-bottom:10px;}}.buttons{display:flex;padding:20px 0px 0px 0px;button{width:30%;padding:10px;}}"});var eo=n(145),no=n(138);window.location.pathname.startsWith("/public_site")?Object(no.b)(Object(a.c)((function(){Object(o.useEffect)((function(){jn(),console.log("========= [APP PUBLIC] MOUNTED on a ".concat(Object(r.a)())),Object(l.d)().then((function(t){Object(j.d)((function(e){e.status.ipsServer.set(t.ipsServer),e.ui.browser.folders.refreshFromBackend()}))}))}),[]);var t=k(),e=t.isConnected,n=(t.connectionStatusComponent,t.toggleSocketConnection,dn()),i=(n.forceResponsiveRender,n.responsiveRefreshCounter),c=n.setResponsiveRefresh,s=mn({isConnected:e,refresh:{get:i,set:c}}),u=Object(pn.b)(),d=(u.tabs,u.updateTab,u.refreshTabsFromBackend,u.updateActiveTabGrid,u.refreshWindowGrid,u.tabsApi),p=u.windowsApi,f=Object(bn.b)(),b=f.lightboxApi,g=(f.lightboxImages,f.lightboxIndex,jt()),h=(g.PromptPopupComponent,g.popupApi),m=hn(),v=Bn(),O=v.ttsApi,x=(v.ttsPos,v.ttsPopup,v.setTtsPopup,v.ttsPopupContent,v.ttsPopupId,v.syncTtsStatus,Wn()),_=x.notePreviewPopupApi,y=(x.notePreviewPopup,Object(j.f)({popupApi:h,tabsApi:d,windowsApi:p,statusApi:s,historyApi:m,notePreviewPopupApi:_,lightboxApi:b,ttsApi:O})),C=y,S=C.ui.browser.files,E=C.ui.browser.folders,T=(E.scan,E.clean,E.base,un(S.active.get)),I=(T.filesHistory,T.filesHistoryRef,T.cleanLastFilesHistory,T.refreshFilesHistoryFromBackend,T.lastFilesHistoryApi);C.lastNotesApi=I;var N=an((function(){S.active.set(-1)}),(function(){y.ui.browser.files.set([])})),P=(N.askForMoveFile,N.promptAndMoveFolder,N.promptAndBatchMoveFiles,w());return P.mobileView,P.setMobileView,P.MobileToolbarComponent,window.api=C,Object(a.c)("div",null,"hello world public app",window.location.pathname)}),null),document.getElementById("root")):Object(no.b)(Object(a.c)((function(){Object(o.useEffect)((function(){return setTimeout((function(){console.log(Vt,"starting frontendBackgroundPlugins Cron"),setInterval((()=>{Kt()}),6e4)}),Object(g.a)(1e3,1e4)),jn(),console.log("========= [APP] MOUNTED on a ".concat(Object(r.a)())),Object(l.d)().then((function(t){Z(!0),Dt&&Dt.status.ipsServer.set(t.ipsServer),Object(j.d)((function(t){t.ui.browser.folders.refreshFromBackend()}))})),t(),console.log("========= [APP] MOUNTED on a ".concat(Object(r.a)())),window.onkeydown=function(t){var e=H(t);Object(B.a)(W[e])||(W[e]=!0);var n="".concat(e,"-down");q[n]&&q[n]()},window.onkeyup=function(t){var e=H(t);Object(B.a)(W[e])||(W[e]=!1);var n="".concat(e,"-up");q[n]&&q[n]()},Object(qt.a)("init","init",(function(){})),Object(j.d)((function(t){t.shared.functions.smartTable.getObj("\n#invest| __header_support| __header_name | __header_buy_date | __header_buy_rate | __header_buy_price | __header_url | __header_auto_update_date | __header_auto_gain_net | __header_auto_perf_per_year | __header_auto_update_date\n#invest |livret | livret_ldd| 24/05/1999 | | 1111 | livret_ldd | \nhello world\n#invest|cto | MSCI World ETF ETORO | 25/05/2008 | 74 | 983 | https://www.boursorama.com/bourse/trackers/cours/1rAIWDA/ \nhello | world woop\n#invest |livret | livret_ldd| 24/05/1999 | | 2345 | livret_ldd | \n#invest2 |livret | livret_ldd| 24/05/1999 | | 12033 | livret_ldd | \n|#invest |livret | livret_ldd| 24/05/1999 | | 12033 | livret_ldd | \n||#invest2 |livret | livret_ldd| 24/05/1999 | | 12033 | livret_ldd | ")})),function(){console.log("app will unmount")}}),[]);var t=function(){setTimeout((function(){Object(J.e)(ie)}),300)},e=function(){Mt.active.set(-1)},n=function(){Lt.ui.browser.files.set([])},u=function(t){var e=Object(o.useState)(!1),n=Object(c.a)(e,2),r=n[0],s=n[1],u=Object(o.useState)(""),d=Object(c.a)(u,2),p=d[0],f=d[1],b=Object(o.useState)(""),g=Object(c.a)(b,2),h=g[0],m=g[1],v=Object(o.useState)(""),w=Object(c.a)(v,2),j=w[0],x=w[1],_=Object(o.useState)(),k=Object(c.a)(_,2),y=k[0],S=k[1],E="[SETUP CONFIG]",T=O.a.client.log.verbose,I=Object(o.useRef)(0);return Object(o.useEffect)((function(){return T&&console.log(E," init socket listener"),I.current=l.b.on("getSetupInfos",(function(e){"SUCCESS_CONFIG_CREATION"===e.code?(S(["success","".concat(C.a.setupForm.successReload)]),setTimeout((function(){window.location.reload()}),3e3)):"ASK_SETUP"===e.code?(t.cleanAllApp(),s(!0),e.defaultFolder&&x(e.defaultFolder)):S(["error","".concat(e.code,": ").concat(e.message)])})),function(){T&&console.log(E," clean socket listener"),l.b.off(I.current)}}),[]),{displayWelcomePopup:r,triggerSetupPopup:function(t){t&&(t.user&&f(t.user),t.password&&m(t.password),t.dataFolder&&x(t.dataFolder)),s(!0)},SetupPopupComponent:function(t){return Object(a.c)(i.a.Fragment,null,r&&Object(a.c)("div",{className:"setup-popup-component"},Object(a.c)(rt.a,{title:"Welcome to Tiro",onClose:function(){}},Object(a.c)("p",null,C.a.setupForm.introText)," ",Object(a.c)("br",null),Object(a.c)("div",null,Object(a.c)(at.a,{value:p,label:C.a.setupForm.user,explanation:C.a.setupForm.userExplanation,onChange:function(t){f(t)},shouldNotSelectOnClick:!0}),Object(a.c)(at.a,{value:h,label:C.a.setupForm.password,type:"password",explanation:C.a.setupForm.passwordExplanation,onChange:function(t){m(t)},shouldNotSelectOnClick:!0}),Object(a.c)(at.a,{value:j,label:C.a.setupForm.dataFolder,explanation:C.a.setupForm.folderExplanation,onChange:function(t){x(t)},shouldNotSelectOnClick:!0}),Object(a.c)("input",{type:"button",value:"submit",className:"submit-button",onClick:function(t){S(void 0),l.b.emit("sendSetupInfos",{form:{user:p,password:h,dataFolder:j},token:Object(z.b)()})}}),y&&Object(a.c)("div",{className:y[0]},y[1])))))}}}({cleanAllApp:function(){console.log("[cleanAllApp]"),Yt(),Wt(),e(),n()}}),p=u.SetupPopupComponent,f=u.triggerSetupPopup,h=Object(z.d)({onLoginAsked:function(){e(),n()},onLoginSuccess:function(){_(),Se(),Zt(),Object(j.d)((function(t){t.userSettings.refreshUserSettingsFromBackend(),t.ui.floatingPanel.refreshFromBackend(),t.config.get((function(){}))})),Object(j.d)((function(t){t.ui.browser.folders.refreshFromBackend()})),Bt(["/"]),t(),Object(j.d)((function(t){t.userSettings.ifNoFolders_triggerDemoDownload()}))}}).LoginPopupComponent,m=Object(pn.b)(),v=m.tabs,x=m.updateTab,_=m.refreshTabsFromBackend,S=m.updateActiveTabGrid,T=m.refreshWindowGrid,I=m.tabsApi,N=m.windowsApi,P=Object(o.useState)(0),A=Object(c.a)(P,2),F=A[0],L=A[1],D=I.active.get(),M=jt(),U=M.PromptPopupComponent,V=M.popupApi,K=k(),Y=K.isConnected,$=K.connectionStatusComponent,Z=K.toggleSocketConnection,X=dn(),Q=X.forceResponsiveRender,tt=X.responsiveRefreshCounter,et=X.setResponsiveRefresh,ot=Object(o.useRef)([]),it=Object(o.useState)(null),st=Object(c.a)(it,2),ut=st[0],dt=st[1];Object(o.useEffect)((function(){setTimeout((function(){}),2e3)}),[]);var bt=Object(bn.b)(),gt=bt.lightboxApi,ht=bt.lightboxImages,wt=bt.lightboxIndex,Ot=Bn(),xt=Ot.ttsApi,_t=Ot.ttsPos,yt=Ot.ttsPopup,Ct=Ot.setTtsPopup,St=Ot.ttsPopupContent,Et=Ot.ttsPopupId,Tt=Ot.syncTtsStatus,It=mn({isConnected:Y,refresh:{get:tt,set:et}}),Pt=hn(),At=Wn(),Rt=At.notePreviewPopupApi,Ft=At.notePreviewPopup,Lt=Object(j.f)({popupApi:V,tabsApi:I,windowsApi:N,statusApi:It,historyApi:Pt,notePreviewPopupApi:Rt,lightboxApi:gt,ttsApi:xt,triggerSetupPopup:f}),Dt=Lt,Mt=Dt.ui.browser.files,zt=Dt.ui.browser.folders,Bt=zt.scan,Wt=zt.clean,Ht=zt.base,Gt=un(Mt.active.get),Jt=Gt.filesHistory,Yt=(Gt.filesHistoryRef,Gt.cleanLastFilesHistory),Zt=Gt.refreshFilesHistoryFromBackend,Xt=Gt.lastFilesHistoryApi;Dt.lastNotesApi=Xt;var Qt=an(e,n),te=(Qt.askForMoveFile,Qt.promptAndMoveFolder),ee=Qt.promptAndBatchMoveFiles,ne=w(),oe=ne.mobileView,ie=ne.setMobileView,ce=ne.MobileToolbarComponent;window.api=Dt;var ae=Object(o.useState)(!1),re=Object(c.a)(ae,2),se=re[0],ue=re[1],de=Object(o.useState)(!1),pe=Object(c.a)(de,2),fe=pe[0],be=pe[1];Object(o.useEffect)((function(){var t=function(){ue(!0),be(!0)};return Object(pt.a)("alt + spacebar",t),Object(pt.a)("alt + p",t),Object(pt.a)("alt + ,",(function(){dt("settings")})),Object(pt.a)("alt + /",(function(){Object(Vn.a)()})),Object(pt.a)("ctrl + e",(function(){Dt.note.ui.editorAction.dispatch({type:"toggleEncryption",noteParentType:"grid"})})),Object(pt.a)("ctrl + alt + e",(function(){Dt.note.ui.editorAction.dispatch({type:"toggleEncryption",noteParentType:"floating"})})),Object(pt.a)("ctrl + alt + u",(function(){Dt.note.ui.editorAction.dispatch({type:"triggerUpload",noteParentType:"floating"})})),Object(pt.a)("ctrl + u",(function(){Dt.note.ui.editorAction.dispatch({type:"triggerUpload",noteParentType:"grid"})})),Object(pt.a)("alt + s",(function(){Dt.ai.setStatus("stop")})),Object(pt.a)("esc",(function(){ue(!1),dt(null)})),function(){Object(pt.d)()}}),[Jt]);var ge=function(){Gn({openIn:"activeWindow"})},he=function(){Object(j.d)((function(t){t.ui.windows.active.toggleView()}))},me=function(){Object(j.d)((function(t){var e=t.ui.browser.files.active.get;e&&t.ui.floatingPanel.create({type:"file",file:e})}))};Object(o.useEffect)((function(){return Object(pt.a)("alt > n",ge),Object(pt.a)("alt > v",he),Object(pt.a)("alt > d",me),function(){Object(pt.c)("alt > n",ge),Object(pt.c)("alt > v",he),Object(pt.c)("alt > d",me)}})),Object(o.useEffect)((function(){if("mobile"!==Object(r.a)())return Object(qn.a)("/favicon.png");Object(J.f)(v,oe)}),[v,oe]),Object(o.useEffect)((function(){var t=setInterval((function(){Object(eo.a)()}),3e5);return function(){return clearInterval(t)}}),[]);var ve=Q?0:1,we=Dt.userSettings.refresh.css.get+ve,je=Dt.userSettings,_e=function(){var t=Object(Ut.a)("interface-pin-element-status",{topTab:!0,bottomBar:!0}),e=Object(c.a)(t,3),n=e[0],i=e[1],a=e[2];return Object(o.useEffect)((function(){a()}),[]),{pinStatus:Object(Hn.a)(n.topTab)||Object(Hn.a)(n.bottomBar)?Object(R.a)(n):{topTab:!0,bottomBar:!0},updatePinStatus:function(t){return function(e){i(Object(s.a)(Object(s.a)({},n),{},Object(Un.a)({},t,e)))}},togglePinStatus:function(t){return function(){i(Object(s.a)(Object(s.a)({},n),{},Object(Un.a)({},t,!n[t])))}},refreshPinStatus:a}}(),ke=_e.pinStatus,ye=_e.updatePinStatus,Ce=_e.togglePinStatus,Se=_e.refreshPinStatus,Te=Object(o.useState)(void 0),Ie=Object(c.a)(Te,2),Pe=Ie[0],Ae=Ie[1],Re=$t.d.curr.ui_layout_background_video_width,Fe=$t.d.curr.ui_layout_background_video_height;return Object(o.useEffect)((function(){var t=$t.d.curr.ui_layout_background_video_enable,e=$t.d.curr.ui_layout_background_image;t&&e&&Ae(e),t||Ae(void 0)}),[we,je]),Object(o.useEffect)((function(){var t=$t.d.curr.keyboard_shortcuts_textarea;if(t){var e=Object(pt.b)(t);return Object(mt.a)(e,(function(t){Object(pt.a)(t.shortcut,t.func)})),function(){Object(mt.a)(e,(function(t){Object(pt.c)(t.shortcut,t.func)}))}}}),[we,je]),Object(a.c)("div",{className:Qe(je)},Object(a.c)("div",{className:Xe(oe,we,je,ke)},Pe&&Object(a.c)(Ve,{url:Pe,width:Re,height:Fe}),Object(a.c)("div",{className:" ".concat("mobile"===Object(r.a)()?"mobile-view-container mobile-view-".concat(oe):"")},Object(a.c)(j.a.Provider,{value:Lt},Object(a.c)("div",{className:"config-buttons-bar"},Object(a.c)("div",{className:"config-button infos-button",onClick:function(){Object(Vn.a)()}},Object(a.c)(y.b,{name:"question"})),Dt.userSettings.get("beta_plugins_marketplace")&&Object(a.c)("div",{className:"config-button plugins-marketplace-button",onClick:function(){dt("plugins-marketplace")}},Object(a.c)(y.b,{name:"puzzle-piece"})),"mobile"!==Object(r.a)()&&Object(a.c)("div",{className:"config-button search-button",onClick:function(){be(!0),ue(!0)}},Object(a.c)(y.b,{name:"search"})),Object(a.c)("div",{className:"config-button settings-button",onClick:function(){dt("settings")}},Object(a.c)(y.b,{name:"cog"}))),(null===Ft||void 0===Ft?void 0:Ft.isOpen)&&Object(a.c)(Ne,{notePreview:Ft}),se&&Object(a.c)(Oe,{show:fe,lastNotes:Jt,onClose:function(t){ue(!1)},onHide:function(t){be(!1)},onNoteCreate:function(t){Gn({folderPath:t,openIn:"activeWindow"})}}),Object(a.c)(a.a,{styles:Object(a.b)("*{-webkit-print-color-adjust:exact!important;color-adjust:exact!important;}*:focus{outline:none;}body{margin:0;padding:0px;background:",d.a.colors.bg.light,";font-size:",Object(G.a)(1),"px;font-family:",d.a.font.main,";}html,body{height:100vh;overflow:hidden;background:",d.a.colors.bgInterface,";}#root{height:100%;}button,input{font-family:",d.a.font.main,";font-weight:700;color:",d.a.colors.l2.title,";}","\n@page {\n margin: 0;\n padding: 0;\n}\n\n.main-wrapper,\n#root,\n.print-body {\n\t// position: absolute;\n// top: 22px;\n\t\t// height: 1000vh;\n\t\t// overflow: auto;\n}\n\n.print-wrapper {\n\t\tz-index: 10000000000000;\n\t\tbackground-color: white;\n\t\toverflow: hidden;\n width: 100%!important;\n\t\theight: 1000vh!important;\n position: fixed;\n top: 0;\n left: 0;\n margin: 0;\n padding: 15px;\n font-size: 14px;\n line-height: 18px;\n\t\tmargin-top: 0px!important;\n\t\tdisplay: block!important;\n}\n/* .print-wrapper { */\n/* \t\tz-index: 10000000000000; */\n/* \t\ttop: 0px; */\n/* \t\tleft: 0px; */\n/* \t\tposition: fixed; */\n/* \t\twidth: 100%!important; */\n/* \t\t/* height: 100vh; */ */\n/* } */\n\n"," body{position:relative;}","")}),Object(a.c)("div",{role:"dialog",className:"main-wrapper ".concat(Dt.userSettings.get("ui_sidebar")?"with-sidebar":"without-sidebar"," device-view-").concat(Object(r.a)())},U(),h({}),p({}),$(),ce({forceRerender:Q,onButtons:[function(){be(!0),ue(!0)}]}),Object(a.c)("div",{className:"left-sidebar-indicator"},Object(a.c)("div",{className:"left-wrapper"},Object(a.c)("div",{className:"left-wrapper-1"},Object(a.c)("div",{className:"invisible-scrollbars"},Object(a.c)(E,{onNewFile:function(){Gn({openIn:"activeWindow"})}}),Dt.userSettings.get("ui_layout_shortcuts_panel")&&Object(a.c)(xe,{filePath:".tiro/shortcuts.md",onClick:function(){}}),Object(a.c)(ct,{files:Jt,onClick:function(t){Lt.ui.browser.goTo(t.folder,t.name,{openIn:"active"})}}),Object(a.c)(nt,{openFolders:zt.open.get(),folder:zt.get(),current:zt.current.get(),onFolderClicked:function(t){Lt.ui.browser.goTo(t,null)},onFolderMenuAction:function(t,e,n){"rename"===t&&n?te({folder:e,folderToDropInto:e,folderBasePath:Ht,newTitle:n,renameOnly:!0,disablePrompt:!0,onMoveFn:function(){Bt([on(e.path)],{cache:!1,cb:function(){}})}}):"create"===t&&n?Object(j.d)((function(t){t.folders.create("".concat(e.path,"/").concat(n),(function(t){Bt([e.path],{cache:!1})}))})):"moveToTrash"===t?te({folder:e,folderToDropInto:vn.b,folderBasePath:Ht,newTitle:"".concat(e.title,"_").concat(Object(vt.a)().full_file),onMoveFn:function(){Bt([on(e.path),e.path],{cache:!1,cb:function(){zt.open.add(e.path)}})}}):"delete"===t&&(Object(vn.a)("trash"),setTimeout((function(){Bt([e.path],{cache:!1})})))},onFolderOpen:function(t){Bt([t],{cache:!1})},onFolderClose:function(t){},onFolderDragStart:function(t){console.log("[DRAG MOVE] onFolderDragStart",t),ot.current=[{type:"folder",folder:t}]},onFolderDragEnd:function(){console.log("[DRAG MOVE] onFolderDragEnd"),ot.current=[]},onFolderDrop:function(t){!function(t){console.log("[DRAG MOVE] processDragDropAction ->",ot.current,t);var e=ot.current[0];"file"===e.type&&e.files?ee({files:e.files,folderToDropInto:t}):"folder"===e.type&&e.folder&&te({folder:e.folder,folderToDropInto:t,folderBasePath:Ht,disablePrompt:!0,onMoveFn:function(){if(e.folder){var n=e.folder.path,o=t.path;Bt([on(n),on(o),o,n],{cache:!1,cb:function(){zt.open.add(n),zt.open.add(o),zt.open.add(on(n)),zt.open.add(on(o))}})}}})}(t)}}))),Object(a.c)("div",{className:"left-wrapper-2"},Object(a.c)("div",{className:"top-files-list-wrapper"},Object(a.c)("div",{className:"subtitle-wrapper"},Object(a.c)("div",{className:"folder-wrapper"},Dt&&Dt.ui.browser.folders.current.get(),!Dt.ui.browser.folders.current.get()&&"/"),"mobile"!==Object(r.a)()&&Object(a.c)("div",{className:"toggle-sidebar-btn"},Object(a.c)(b.a,{popup:!1,buttons:[{title:"Toggle Sidebar",icon:"faThumbtack",action:function(t){Object(j.d)((function(t){t.userSettings.set("ui_sidebar",!t.userSettings.get("ui_sidebar"))})),T()},active:!0===Lt.userSettings.get("ui_sidebar")}],size:.8}))),Object(a.c)(lt,{term:Lt.ui.search.term.get})),Object(a.c)("div",{className:"files-list-wrapper"},Object(a.c)(gn,{files:Mt.get,activeFileIndex:Mt.active.getIndex,onSortFiles:function(t){Lt.ui.browser.files.set(t)},onFileClicked:function(t){Mt.active.set(t);var e=Mt.get[t];Dt.tabs.active.get()?N.active.setContent(e):Dt.tabs.openInNewTab(e)},onFileDragStart:function(t){console.log("[DRAG MOVE] onFileDragStart",t),ot.current=[{type:"file",files:t}]},onFileDragEnd:function(){console.log("[DRAG MOVE] onFileDragEnd"),ot.current=[]}}))))),Object(a.c)("div",{className:"right-wrapper draggable-grid-editors-view"},"mobile"!==Object(r.a)()&&Object(a.c)(kt,{tabs:v,onUpdate:x,onPinToggle:Ce("topTab"),pinStatus:ke.topTab}),D&&Object(a.c)(fn.b,{tab:D,forceRefresh:F,onGridUpdate:function(t){S(t),L(F+1)},mobileView:oe,pinStatus:ke})),Object(a.c)(le,{panels:Dt.ui.floatingPanel.panels,pinStatus:ke.bottomBar,onPinChange:ye("bottomBar")}),"plugins-marketplace"===ut&&Object(a.c)(Me,{onClose:function(){dt(null)}}),"settings"===ut&&Object(a.c)(Nt.a,{onClose:function(){dt(null)}})))),Object(a.c)(Ee,null),ht.length>0&&Object(a.c)(ft,{images:ht,startingIndex:wt,onClose:Lt.ui.lightbox.close}),yt&&!$t.d.curr.tts_custom_engine_enabled&&Object(a.c)(Mn,{id:Et,fileContent:St,startString:_t,onUpdate:function(t){Tt(t)},onClose:function(){Ct(!1)}}),yt&&$t.d.curr.tts_custom_engine_enabled&&Object(a.c)(Qn,{id:Et,fileContent:St,startString:_t,onUpdate:function(t){Tt(t)},onClose:function(){Ct(!1)}})))}),null),document.getElementById("root"))},62:function(t,e,n){"use strict";n.d(e,"a",(function(){return c}));var o=n(3),i=n(0);function c(t,e){var n=Object(i.useState)((function(){try{var n=window.localStorage.getItem(t);return n?JSON.parse(n):e}catch(o){return console.log(o),e}})),c=Object(o.a)(n,2),a=c[0],r=c[1];return[a,function(e){try{var n=e instanceof Function?e(a):e;r(n),window.localStorage.setItem(t,JSON.stringify(n))}catch(o){console.log(o)}}]}},63:function(t,e,n){"use strict";n.d(e,"c",(function(){return d})),n.d(e,"d",(function(){return p})),n.d(e,"h",(function(){return b})),n.d(e,"g",(function(){return g})),n.d(e,"i",(function(){return h})),n.d(e,"e",(function(){return m})),n.d(e,"a",(function(){return v})),n.d(e,"f",(function(){return w})),n.d(e,"b",(function(){return O}));var o=n(11),i=n(133),c=n(292),a=n(30),r=n(132),l=n(390),s=n(6),u=n(28);const d=t=>{let e=t.value,n=t.selectionStart;return p(e,n)},p=(t,e)=>{var n=t.split("\n");let o=0,i=0;for(;o<e+1;){o+=n[i].length+1,i++}i--;const c=e-o+n[i].length-1;return{currentPosition:e,lines:n,activeLine:n[i],activeLinePos:c,lineIndex:i}},f=t=>{let e=!0;for(let n=0;n<t.length;n++)32!==t[n].charCodeAt(0)&&45!==t[n].charCodeAt(0)&&91!==t[n].charCodeAt(0)&&93!==t[n].charCodeAt(0)&&(e=!1);return e},b=(t,e,cb)=>{if(10===e){console.log("updateTextFromLetterInput => ENTER PRESSED");let e=t.lines[t.lineIndex-1],n=e.indexOf("- ["),o=e.indexOf("-"),i="";-1!==n&&"- [ ] "!==e?(i=e.substr(0,n+3)+" ] ",f(i)&&(t.lines[t.lineIndex]=i+t.activeLine,cb(i.length))):-1!==o&&"- "!==e&&"- [ ] "!==e&&(i=e.substr(0,o+1)+" ",f(i)&&(t.lines[t.lineIndex]=i+t.activeLine,cb(i.length)))}return t.lines.join("\n")},g=(t,e,cb,n)=>{let o=e.lines;if("^"===t){let t=o[e.lineIndex-1],n=o[e.lineIndex];o[e.lineIndex]=t,o[e.lineIndex-1]=n,cb(-t.length-1)}if("v"===t){let t=o[e.lineIndex+1],n=o[e.lineIndex];o[e.lineIndex]=t,o[e.lineIndex+1]=n,cb(+t.length+1)}if("X"===t){o[e.lineIndex].length;let t=[...o].splice(0,e.lineIndex).join("\n").length+1-e.currentPosition;o[e.lineIndex]="",cb(t)}if("C"===t){let t=o[e.lineIndex].length,n=o[e.lineIndex];o.splice(e.lineIndex,0,n),cb(t+1)}"->"===t&&(o[e.lineIndex]=" "+o[e.lineIndex],cb(2)),"<-"===t&&(e.activeLine.startsWith(" ")?(o[e.lineIndex]=o[e.lineIndex].substr(2,o[e.lineIndex].length),cb(-2)):cb(0));let a=e.activeLine.trim();if("[x]"===t&&(a.startsWith("- [ ]")||a.startsWith("- [x]")?a.startsWith("- [ ]")?(o[e.lineIndex]=o[e.lineIndex].replace("[ ]","[x]"),cb(0)):a.startsWith("- [x]")?(o[e.lineIndex]=o[e.lineIndex].replace("[x]","[ ]"),cb(0)):cb(0):(o[e.lineIndex]=o[e.lineIndex].replace(a,"- [ ] "+a.replace("-","")),cb(6))),"insertAt"===t&&n&&n.textToInsert&&(Object(i.a)(n.insertPosition)||Object(c.a)(n.insertPosition))){let t=0;Object(i.a)(n.insertPosition)&&(t=n.insertPosition),"currentPos"===n.insertPosition&&(t=e.currentPosition+1),"currentLineStart"===n.insertPosition&&(t=[...o].splice(0,e.lineIndex).join("\n").length);let c=o.join("\n");const a=n.textToInsert.length;o=[c.slice(0,t),n.textToInsert,n.replaceText?c.slice(t+a,c.length):c.slice(t,c.length)].join("").split("\n")}return o.join("\n")},h=t=>{let e=t.split("\n"),n=0;return Array.isArray(e)?(Object(a.a)(e,(t=>{let e=t.split(" ").filter((t=>""!==t));n+=e.length})),n):n},m=t=>{let e=!1;return(t="".concat(t)).toLowerCase().startsWith("math.")&&(e=!0),t.startsWith("(")&&(e=!0),isNaN(parseInt(t))||(e=!0),t.includes("\n")&&(e=!1),t.length>400&&(e=!1),e},v=t=>{let e=null;if(!m(t))return e;try{e=new Function("return ".concat(t))()}catch(n){}return e},w=t=>{const e=t.windowId,n=t.file,i=t.fileContent,c=t.selectionTxt,a=t.insertPos;try{let t=new Function("return ".concat(c))(),r=Object(o.a)(Object(o.a)({},{wrapSyntax:!1,title:"",currentContent:i,insertPos:a,windowId:e,selection:c,file:n,linejump:!1,isLast:!1}),{},{textUpdate:" = ".concat(t),isLast:!0});O(r)}catch(r){Object(u.d)('[CALC] Error <br/> "'.concat(r,'"'))}},O=t=>{t.question||(t.question=""),t.title||(t.title=""),Object(r.a)(t.linejump)||(t.linejump=!0),Object(r.a)(t.viewFollow)||(t.viewFollow=!0),Object(r.a)(t.wrapSyntax)||(t.wrapSyntax=!0);let e=t.linejump?"\n\n":" ",n="###",o="---",i="".concat(e," ").concat(n," [").concat(t.title,"] (generating ...) ").concat(e),c="".concat(e," ").concat(o," [").concat(t.title,"] (done) ").concat(e),a="".concat(e).concat(t.textUpdate);t.wrapSyntax||(i=c=o=n=""),a="".concat(i).concat(t.textUpdate).concat(e).concat(n," \n"),t.isLast&&(a="".concat(c).concat(t.textUpdate).concat(e).concat(o," \n"));const l=t.currentContent.substring(0,t.insertPos),u=t.currentContent.substring(t.insertPos),d=l+a+u;Object(s.d)((e=>{if(e.file.saveContent(t.file.path,d),t.viewFollow){let e=("".concat(l).concat(a).split("\n").length||0)-2;e<0&&(e=0),j(t.windowId,e)}}))},j=Object(l.a)(((t,e)=>{Object(s.d)((n=>{n.ui.note.editorAction.dispatch({windowId:t,type:"lineJump",lineJumpNb:e})}))}),1e3)},65:function(t,e,n){"use strict";n.d(e,"a",(function(){return a}));var o=n(11),i=n(17),c="80"===window.location.port?"":":".concat(window.location.port);"3000"===window.location.port&&(c=":3023");var a=Object(o.a)(Object(o.a)({},i.a.client),{},{shared:i.a,global:{protocol:"".concat(window.location.protocol,"//"),url:"".concat(window.location.hostname),port:c}})},68:function(t,e,n){"use strict";n.d(e,"a",(function(){return g}));var o=n(17),i=n(75),c=n(28),a={};window.dbscroll=a,Object(c.a)("syncscroll","get_db",(function(){return a}));o.a.client.log.verbose;var r=function(t){var e=document.querySelector(".window-id-".concat(t," .preview-area")),n=document.querySelector(".window-id-".concat(t," .cm-scroller")),o=document.querySelector(".window-id-".concat(t," .scrolling-bar-wrapper"));return a[t]||(a[t]={els:{preview:e,editor:n,scroller:o},dims:{editor:{viewport:0,full:0},preview:{viewport:0,full:0},scroller:{viewport:0,full:0}},posPercent:0,previewOffsetY:0}),a[t].els.preview=e,a[t].els.editor=n,a[t].els.scroller=o,a[t]},l=function(t){var e,n,o=r(t),i=o.dims.editor.viewport/o.dims.editor.full||1e7,c=o.dims.preview.viewport/o.dims.preview.full||1e7,a=i<c?i:c,l=(null===(e=o.els.scroller)||void 0===e?void 0:e.clientHeight)||0,s=a*l,u={viewport:s=s>l?l:s,full:l};o.dims.scroller=u;var d=null===(n=o.els.scroller)||void 0===n?void 0:n.dataset;d&&(d.scrollRefresh||(d.scrollRefresh=1),d.scrollRefresh=parseInt(d.scrollRefresh)+1)},s=function(t,e){var n;i.d[t]=!1;var o=r(t);o.posPercent=e||0;var c=null===(n=o.els.scroller)||void 0===n?void 0:n.dataset;c||(c={scrollRefresh:1}),c.scrollRefresh||(c.scrollRefresh=1),c.scrollRefresh=parseInt(c.scrollRefresh)+1},u=function(t,e){i.d[t]=!1;var n=r(t);if(n.els.editor){n.dims.editor;n.els.editor.scrollTop+=e}},d=function(t,e){i.d[t]=!1;var n=r(t);if(n.els.preview){n.dims.preview;n.els.preview.scrollTop+=e}},p=function(t,e){i.d[t]=!1;var n=r(t);if(n.els.editor){var o=n.dims.editor;e||(e=n.posPercent);var c=o.full/100;n.els.editor.scrollTop=c*e}},f=function(t,e){i.d[t]=!1;var n=r(t);if(n.els.preview){var o=n.dims.preview;e||(e=n.posPercent);var c=o.full/100,a=Math.round(c*e);n.els.preview.scrollTop=a+n.previewOffsetY}},b=function(t,e){var n=r(t),o=n.dims.preview.full/100,i=e-Math.round(o*n.posPercent);n.previewOffsetY=i},g={getScrollObj:r,updateEditorDims:function(t,e){var n=r(t);n.els.editor&&(n.dims.editor=e)},updatePreviewDims:function(t){var e=r(t);if(e.els.preview){var n=e.els.preview.querySelector(".preview-area-full-height-content"),o=n.clientHeight-n.parentNode.clientHeight,i=e.els.preview.clientHeight;e.dims.preview={viewport:i,full:o},e.dims.preview={viewport:i,full:o}}},updateScrollerDims:l,updatePreviewOffset:b,onEditorScroll:function(t,e){var n=r(t);n.els.editor&&(n.posPercent=e,s(t,e),f(t,e))},onScrollerScroll:function(t,e){r(t).posPercent=e,p(t,e),f(t,e)},onPreviewScroll:function(t){var e=r(t),n=e.els.preview.scrollTop;b(t,n),e.posPercent=n/e.dims.preview.full*100,p(t,e.posPercent),s(t,e.posPercent)},onWindowLoad:function(t){if(a[t]){var e=r(t).posPercent;l(t),s(t,e),p(t,e),f(t,e)}},scrollEditor:p,scrollPreview:f,scrollScroller:s,scrollAllPx:function(t,e){u(t,e),d(t,e)},scrollEditorPx:u,scrollPreviewPx:d}},70:function(t,e,n){"use strict";n.d(e,"b",(function(){return l})),n.d(e,"a",(function(){return s}));var o=n(30),i=n(31),c=n(17),a=!1,r=function(t){if(!t)return null;if(t.startsWith(c.a.metas.headerStart)&&(a=!0),t.startsWith(c.a.metas.headerEnd)&&(a=!1),""===t)return null;if(!a)return null;var e=t.split(": ");if(2!==e.length)return null;var n=e.shift();if(!n)return null;var o=e.join(":").trim();if("created"===n||"modified"===n){var i=new Date(o).getTime();isNaN(i)||(o=i)}return{name:n,value:o}},l=function(t){var e=t.match(i.a.metas),n={};if(e&&e[0])for(var o=e[0].split("\n"),c=0;c<o.length;c++){var a=r(o[c]);a&&(n[a.name]=a.value)}10==="".concat(n.created).length&&(n.created=1e3*parseInt("".concat(n.created))),10==="".concat(n.updated).length&&(n.updated=1e3*parseInt("".concat(n.updated)));var l=t;return{metas:n,content:l=(l=l.replace(i.a.metasAndSpace,"")).replace(i.a.metas,"")}},s=function(t,e){var n=function(t){var e="".concat(c.a.metas.headerStart,"\n");return Object(o.a)(t,(function(t,n){e+="".concat(n,": ").concat(t,"\n")})),e+="".concat(c.a.metas.headerEnd,"\n")}(e);return n+=t}},72:function(t,e,n){"use strict";n.d(e,"a",(function(){return i})),n.d(e,"c",(function(){return c})),n.d(e,"b",(function(){return a}));var o=n(21),i=function(t){var e=((new Date).getTime()-t.getTime())/1e3,n=604800,i="";if(e<=3600)i="".concat(Math.ceil(e/60)," ").concat(o.a.minsAgo);else if(e>3600&&e<=86400)i="".concat(Math.ceil(e/3600)," ").concat(o.a.hoursAgo);else if(e>86400&&e<=n)i="".concat(Math.ceil(e/86400)," ").concat(o.a.daysAgo);else if(e>n){var c=("0"+t.getDate()).slice(-2),a=o.a.months[t.getMonth()],r=t.getFullYear().toString();i="".concat(c," ").concat(a," ").concat(r)}return i},c=function(t){t||(t=(new Date).getTime());var e=new Date(t);return[e.getFullYear(),e.getMonth()+1,e.getDate()]},a=function(t){var e=(new Date).getTime();return"lastMonth"===t&&(e=e-432e5),e}},73:function(t,e,n){"use strict";n.d(e,"c",(function(){return r})),n.d(e,"a",(function(){return l})),n.d(e,"b",(function(){return s}));n(0);var o=n(165),i=n(93),c=n(138),a=n(1),r=function(t,e,n){if(!t)return"";var o=t.querySelector("iframe"),i=Object(c.c)(e,{delay:100}),a='<div id="'.concat(i,'" class="resource-link-ctag"><div class="loading-string">loading...</div></div>'),r=!o||!0===n;t.innerHTML=r?a:""},l=function(t){var e;return s(t.tagName,t.content,(null===(e=t.opts)||void 0===e?void 0:e.windowId)||"null",t.opts)},s=function(t,e,n,c){var r;c||(c={}),c.file||(c.file=Object(i.a)());var l=(null===(r=c)||void 0===r?void 0:r.ctagHeightOffset)||0;return Object(a.c)(o.a,{file:c.file,block:{type:"tag",tagName:t,content:e,start:0,end:0},windowId:n,ctagHeightOffset:l,yCnt:0,onIframeMouseWheel:function(){},ctagSandboxed:c.sandboxed,ctagFullscreen:c.fullscreen,ctagOnFullscreenClose:c.onFullscreenClose})}},75:function(t,e,n){"use strict";n.d(e,"d",(function(){return p})),n.d(e,"c",(function(){return f})),n.d(e,"a",(function(){return b})),n.d(e,"b",(function(){return g}));var o=n(11),i=n(5),c=n(115),a=n(6),r=n(63),l=n(29),s=n(22),u=n(12),d="[AI]",p={},f=function(){var t,e=[],n=s.d.curr.ui_editor_ai_command.split("\n"),o=1,c=Object(i.a)(n);try{for(c.s();!(t=c.n()).done;){var a=t.value,r=a.split("|");if(r.length>=4){var l=r[2].trim();l=l.startsWith("new")?"newWindow":l.startsWith("current")?"currentWindow":"newWindow";var u=r.slice(3).join("|");e.push({title:r[0].trim(),icon:r[1].trim(),typeAnswer:l,command:u})}else{if(""===a.trim())continue;e.push({icon:"wand-magic-sparkles",title:"AI assistant ".concat(o),command:a.trim(),typeAnswer:"newWindow"})}o++}}catch(d){c.e(d)}finally{c.f()}return e},b=function(t){var e=t.typeAnswer,n=t.aiCommand,o=t.selectionTxt,i=t.file,c=t.windowIdFile,r=t.innerFileContent,s=t.cursorInfos;if(console.log(d,"AiAnswer",{typeAnswer:e,aiCommand:n,selectionTxt:o,file:i,windowIdFile:c,innerFileContent:r,cursorInfos:s}),"currentWindow"===e){if(!i||!c||!r||!s)return;h({uuid:t.uuid,command:n,aiBtnConfig:t.aiBtnConfig,windowId:c,file:i,fileContent:r,selectionTxt:o,insertPos:s.to})}else"newWindow"===e?Object(a.d)((function(e){var i=(new Date).toISOString().replace(":","h").replace(":","m").replace(/T/g,"-").substring(0,17),c=Math.round(1e4*Math.random()),a=Object(l.c)(o).substring(0,40),r=(new Date).toISOString().substring(5,7),s=(new Date).toISOString().substring(0,4),d=".tiro/answers/".concat(s,"/").concat(r,"/").concat(t.aiBtnConfig.title,"_").concat(i,"__").concat(a,"__").concat(c,".md"),p='# Answer for "'.concat(a,'" \n ## Answer \n\n '),f=p+"\n ## Question: \n \n ".concat(o," \n"),b=Object(l.e)(d),g=Object(l.c)(d),m=p.length;e.file.saveContent(d,f,{},(function(){e.ui.floatingPanel.create({type:"file",file:b,view:"preview",id:g,layout:"mobile"===Object(u.a)()?"bottom":"right"}),h({uuid:t.uuid,command:n,windowId:g,aiBtnConfig:t.aiBtnConfig,file:b,fileContent:f,selectionTxt:o,insertPos:m,wrapSyntax:!1})}))})):console.error(d,"AiAnswer: typeAnswer not recognized",e)},g=function(t){return t.replaceAll('"','\\"').replaceAll("'","\\'").replaceAll("`","\\`").replaceAll("$","\\$")},h=function(t){console.log("trigger AI search",t.windowId,t.file.path,t.selectionTxt,t.insertPos);var e=t.selectionTxt,n=t.fileContent,i=t.insertPos,l=n,s=!1,u=e=g(e),f=function(){return{title:"Ai Answer",currentContent:l,textUpdate:"\u23f3 waiting for answer...",question:u,insertPos:i,windowId:t.windowId,file:t.file,isLast:!1,wrapSyntax:t.wrapSyntax}};p[t.windowId]=!0;var b={curr:""},h=Object(c.a)((function(){Object(a.d)((function(t){t.ui.notification.emit({content:"[AI] Error while executing command <br/> at ".concat((new Date).toLocaleString()," <br/><br/> COMMAND ANSWER => <br/> <code>").concat(b.curr,"</code> </br>"),options:{hideAfter:600},id:"ai-status"})}))}),500),m=function(){Object(a.d)((function(e){e.ui.notification.emit({content:"[AI] \ud83d\udcac generating text... <br/><br/> \u274c (click popup to stop generation)",options:{hideAfter:5,onClick:function(){e.ai.setStatus("stop",t.uuid)}},id:"ai-status"})}))};Object(a.d)((function(n){var i=Date.now(),c=t.command;c=c.replace("{{input}}",e),Object(r.b)(f());var a=!0,l=!0;m(),n.command.stream(c,(function(e){if(a=n.ai.getStatus(t.uuid),e.isError&&(s=!0),s){if(console.log(d,"ERROR",e),""===e.text||"[object Object]"===e.text)return;b.curr+=e.text+"\n\n",h(),Object(r.b)(Object(o.a)(Object(o.a)({},f()),{},{textUpdate:"",isLast:!0,viewFollow:p[t.windowId]}))}else{if(!a)return;m(),e.isLast&&(e.textTot+="\n\n \u23f1\ufe0f generated in ".concat((Date.now()-i)/1e3,"s by ").concat(t.aiBtnConfig.title)),Object(r.b)(Object(o.a)(Object(o.a)({},f()),{},{textUpdate:e.textTot,isLast:e.isLast,viewFollow:p[t.windowId]}))}a!==l&&(l=a,e.textTot+="\n GENERATION STOPPED \n\n \u23f1\ufe0f generated in ".concat((Date.now()-i)/1e3,"s by ").concat(t.aiBtnConfig.title),Object(r.b)(Object(o.a)(Object(o.a)({},f()),{},{textUpdate:e.textTot,isLast:e.isLast,viewFollow:p[t.windowId]})))}))}))}},76:function(t,e,n){"use strict";n.d(e,"c",(function(){return u})),n.d(e,"d",(function(){return h})),n.d(e,"a",(function(){return m})),n.d(e,"b",(function(){return v}));var o=n(31),i=n(6),c=n(12),a=n(33),r=n(10),l=n(45),s=n(57),u=function(t,e,n){return Object(l.a)({file:t,windowId:e,pattern:o.a.linklink,replacement:function(t){var o=n||!1,i=t.matchs,c=document.createElement("span");c.classList.add("note-link-mdpreview-wrapper"),c.classList.add("note-link-wrapper");var a=i[2],r=i[1],l=null;if(a.includes("|")){var s=a.split("|");a=s[0],l=s[1]}var u=m(r,a,l,e,o);return c.innerHTML="".concat(u),c}})},d=function(t){if(t){h(),g++;var e=t.dataset.file,n=t.dataset.folder,o=(t.dataset.searchedstring,t.dataset.windowid||"active");e&&n&&o&&Object(i.d)((function(t){t.ui.browser.goTo(n,e,{openIn:o})}))}},p=function(t){if(t){var e=t.getBoundingClientRect(),n=[e.left+window.scrollX,e.top+window.scrollY],o=t.dataset.file,i=t.dataset.folder,c=t.dataset.searchedstring,a=t.dataset.windowid,r="".concat(i).concat(o);if("preview-popup"!==a){"".concat(i,"/").concat(o);f(r,n,c,a)}}},f=function(t,e,n,o){var c=++g;b&&clearTimeout(b),b=setTimeout((function(){g===c&&(""===n&&(n=null),Object(i.d)((function(o){o.ui.floatingPanel.openFile(t,{idpanel:"preview-popup-"+Object(s.c)(t),searchedString:n}),setTimeout((function(){o.ui.floatingPanel.movePanel("preview-popup",{x:e[0],y:e[1]+20})}),10)})))}),700)},b=null,g=0,h=function(t){b&&clearTimeout(b),g++,t&&setTimeout((function(){g++}),700)},m=function(t,e,n,o,i){var r=t;if(n){var l=n.length>20?n.substring(0,20)+"...":n;r="".concat(t," > ").concat(l)}var s='"'.concat(Object(a.c)("open-link-page",Object(c.e)()?d:p),'"');return"<a\nonclick=".concat(s,'\nclass="title-search-link preview-link" \ndata-file="').concat(t,'" \ndata-folder="').concat(e,'" \ndata-searchedstring="').concat(n||"",'"\ndata-windowid="').concat(o,'">').concat(r,"</a>")},v=function(t){return t||(t=""),"\n\t\t\t.preview-link {\t\t\t\t\t\t\t\n\t\t\t\tfont-weight: 800;\n\t\t\t\tbackground-repeat: no-repeat;\n\t\t\t\tbackground-position: 4px 2px;\n\t\t\t\tpadding-left: 20px;\n\t\t\t\tbackground-size: 10px;\n\t\t}\n\n\t\t".concat(t,".external-link {\n\t\t\t\tbackground-image: url(").concat(r.a.assets.worldIcon,");\n\t\t}\n\t\t").concat(t,".search-link {\n\t\t\t\tcolor: ").concat(r.a.colors.main,";\n\t\t\t\tbackground-image: url(").concat(r.a.assets.searchIcon,");\n\t\t}\n\t\t").concat(t,".title-search-link {\n\t\t\t\tbackground-color: rgba(0,0,0,0);\n\t\t\t\t&:hover {\n\t\t\t\t\tcolor: white;\n\t\t\t\t\tbackground-color: ").concat(r.a.colors.main,";\n\t\t\t\t}\n\t\t\t\t&.popup-link {\n\t\t\t\t\tposition: relative;\n\t\t\t\t\tz-index: 99;\n\t\t\t\t}\n\t\t\t\tcolor: ").concat(r.a.colors.main,";\n\t\t\t\tbackground-image: url(").concat(r.a.assets.linkIcon,");\n\t\t\t\tcursor: pointer;\n\t\t}\n\t\t").concat(t,".resource-link {\n\t\t\t\tcolor: ").concat(r.a.colors.main,";\n\t\t} ")}},82:function(t,e,n){"use strict";n.d(e,"a",(function(){return m})),n.d(e,"c",(function(){return v})),n.d(e,"b",(function(){return w}));var o=n(3),i=n(609),c=n(0),a=n(12),r=n(96),l=n(10),s=n(164),u=n(165),d=n(68),p=n(92),f=n(76),b=n(25),g=n(70),h=n(1),m=function(t){var e={wrapper:Object(c.useRef)(null),main:Object(c.useRef)(null)},n=Object(c.useState)(""),a=Object(o.a)(n,2),l=a[0],s=a[1];Object(c.useEffect)((function(){Object(g.b)(t.fileContent).content;s(t.fileContent)}),[t.fileContent]);var p=t.file.path.split("/");p.pop();p.join("/");Object(c.useEffect)((function(){setTimeout((function(){t.onMaxYUpdate(f())}),1e3)}),[l]);var f=function(){var t=e.main.current;return 2*((null===t||void 0===t?void 0:t.clientHeight)||3e3)},b=Object(c.useState)([]),m=Object(o.a)(b,2),v=m[0],w=m[1];return Object(c.useEffect)((function(){var e=r.b.chunks.chunk(l);w(e),setTimeout((function(){r.b.injectLogic({fileContent:l,file:t.file})}),100),setTimeout((function(){d.a.updatePreviewDims(t.windowId),d.a.updateScrollerDims(t.windowId),setTimeout((function(){d.a.updatePreviewDims(t.windowId),d.a.updateScrollerDims(t.windowId)}),100)}),100)}),[l,t.file.path,t.windowId]),Object(h.c)("div",{className:"preview-area-wrapper render-latex",onWheelCapture:function(e){d.a.scrollPreviewPx(t.windowId,e.deltaY)}},Object(h.c)("div",{className:"preview-area",ref:e.wrapper,style:{bottom:function(){var e=f(),n=t.posY+0;return Object(i.a)(n,0,e)}()}},Object(h.c)("div",{className:"preview-area-transitions"},Object(h.c)("div",{className:"infos-preview-wrapper"},Object(h.c)("div",{className:"file-path-wrapper"},t.file.path.replace("/".concat(t.file.name),"")),Object(h.c)("h1",{className:"title big-title"},t.file.name.replace(".md",""))),Object(h.c)("div",{className:"content-blocks-wrapper"},Object(h.c)("div",{className:"simple-css-wrapper"},Object(h.c)("div",{className:"preview-area-full-height-content"},v.map((function(e,n){return Object(h.c)(u.a,{key:n,index:n,block:e,windowId:t.windowId,file:t.file,reactOnHeightResize:t.reactOnHeightResize,yCnt:t.yCnt,onIframeMouseWheel:t.onIframeMouseWheel})}))))))))},v=function(t){return t||(t={w:".simple-css-wrapper",pl:".preview-link",r:".resource-link-icon",separatorTitle:". "}),"\n\n\t\thtml, body {\n\t\t\t\tmargin: 0px;\n\t\t\t\tpadding: 0px;\n\t\t}\n\n\t\t".concat(t.w," {\n\t\t\t\tcolor: ").concat(l.a.colors.editor.font,";\n\t\t\t\tline-height: 19px;\n\t\t\t\tfont-size:").concat(Object(b.a)(1),"px;\n\t\t\t\tfont-family:").concat(l.a.font.main,";\n\t\t}\n\n\t\tbutton,\n\t\tinput {\n\t\t\t\tfont-family:").concat(l.a.font.main,";\n\t\t\t\tfont-weight: 700;\n\t\t\t\tcolor: ").concat(l.a.colors.l2.title,";\n\t\t}\n\n\t\t/**********************************************************\n\n\t\t// COUNTER TITLES\n\n*********************************************************/\n\n\t\t").concat(t.w,' {\n\t\t\t\toverflow-wrap: break-word;\n\t\t\t\tcounter-reset: sh1 ;\n\t\t}\n\n\n\t\th1:before {\n\t\t\t\tcontent: ""counter(sh1)"').concat(t.separatorTitle,'";\n\t\t\t\tcounter-increment: sh1;\n\t\t}\n\t\th1 {\n\t\t\t\tcounter-reset: sh2;\n\t\t}\n\n\t\th2:before {\n\t\t\t\tcontent: ""counter(sh1)"." counter(sh2)"').concat(t.separatorTitle,'";\n\t\t\t\tcounter-increment: sh2;\n\t\t}\n\t\th2 {\n\t\t\t\tcounter-reset: sh3;\n\t\t}\n\n\t\th3:before {\n\t\t\t\tcontent: ""counter(sh1)"." counter(sh2)"."counter(sh3)"').concat(t.separatorTitle,'";\n\t\t\t\tcounter-increment: sh3;\n\t\t}\n\t\th3 {\n\t\t}\n\n\n\n\t\t/**********************************************************\n\n\t\t// BASIC STYLE\n\n**********************************************************/\n\n\t\ta {\n\t\t\t\tcolor: ').concat(l.a.colors.main,";\n\t\t}\n\n\t\t.main-color, .main-color:before, .main-color:after {\n\t\t\t\tcolor: ").concat(l.a.colors.main,";\n\t\t}\n\t\t.title {\n\t\t\t\tmargin: 0px 0px;\n\t\t}\n\n\t\th1:before, h2:before, h3:before, h4:before, h5:before, h6:before {\n\t\t\t\tcolor: ").concat(l.a.colors.main,";\n\t\t}\n\t\th1, h2, h3, h4, h5, h6 {\n\t\t\t\tposition:relative;\n\t\t\t\tcolor: ").concat(l.a.colors.main,';\n\t\t\t\tmargin-top: 0px;\n\t\t\t\tline-height: normal;\n\t\t\t\tmargin-right: 10px;\n\t\t}\n\t\th1:after,\n\t\th2:after {\n\t\t\t\t// LONG LINE STYLE\n\t\t\t\t// content: "-";\n\t\t\t\t// background: ').concat(l.a.colors.main,";\n\t\t\t\t// width: 100%;\n\t\t\t\t// height: 2px;\n\t\t\t\t// position: absolute;\n\t\t\t\t// bottom: 0px;\n\t\t\t\t// left: 0px;\n\t\t\t\t// font-size: 0px;\n\t\t\t\t/* opacity: 0.4; */\n\t\t}\n\t\th2:after {\n\t\t\t\t/* width: 70%; */\n\t\t\t\theight: 1px;\n\t\t}\n\t\th1 {\n\t\t\t\tpadding: 0px;\n\t\t\t\t/* border-bottom: 2px solid; */\n\t\t\t\tmargin-top: 0px;\n\t\t\t\tmargin-bottom: 0px;\n\t\t\t\ttext-decoration: underline;\n\t\t\t\tfont-size: ").concat(Object(b.a)(6),"px;\n\t\t}\n\t\th2 {\n\t\t\t/* border-bottom: 1px solid; */\n\t\t\ttext-decoration: underline;\n\t\t}\n\t\th1, h2, h3, h4, h5, h6 {\n\t\t\tmargin-top: 3px;\n\t\t\tmargin-bottom: 0px;\n\t\t}\n\t\th2, h3, h4, h5, h6 {\n\t\t\t\tfont-size: ").concat(Object(b.a)(4),"px;\n\t\t\t\tmargin-bottom: 0px;\n\t\t\t\tmargin-top: 0px;\n\t\t}\n\n img,\n .content-image {\n\t\t\t\tcursor: pointer;\n }\n\t\t\t.content-image-img {\n\t\t\t\t\t").concat(l.a.els().images,"\n\t\t\t\t\tcursor: pointer;\n\t\t\t}\n\n p {\n\t\t\t\t//display: inline;\n }\n\n\n\t\t/**********************************************************\n\n\t\t// LIST\n\n**********************************************************/\n\t\t.no-css ul li {\n\t\t\t\tbackground: none!important;\n\t\t\t\tpadding: 0px;\n\t\t}\n\n\t\tul {\n\t\t\t\tpadding: 0px;\n\t\t\t\t// list-style-image: \"./custom_icons/view-1.svg\"; \n\t\t\t\t// list-style: none; \n\t\t\t\tmargin-left: 20px;\n\t\t\t\tlist-style: '- ';\n\t\t}\n\n\t\tul li {\n\t\t\t\tpadding-left: 12px;\n\t\t}\n\t\tul li:before {\n\t\t\t\t// content: '-';\n\t\t\t\t// color: ").concat(l.a.colors.main,";\n\t\t\t\t// width: 10px;\n\t\t\t\t// display: inline-block;\n\t\t\t\t// font-size: ").concat(Object(b.a)(5),"px;\n\n\t\t\t\t/* background-image: url(./custom_icons/line.svg); */\n\t\t\t\t/* background-repeat: no-repeat; */\n\t\t\t\t/* background-position: -3px 4px; */\n\t\t\t\t/* background-size: 11px; */\n\n\t\t\t\t/* background-image: url(./custom_icons/line.svg); */\n\t\t\t\t/* background-repeat: no-repeat; */\n\t\t\t\t/* background-color: ").concat(l.a.colors.main,'; */\n\t\t\t\t/* -webkit-mask-position: -3px 4px; */\n\t\t\t\t/* -webkit-mask-size: 11px; */\n\t\t\t\t/* -webkit-mask-image: url(./custom_icons/line.svg); */\n\t\t\t\t/* -webkit-mask-repeat: no-repeat; */\n\t\t}\n\t\tul li p {\n\t\t\t\tmargin: 0px;\n\t\t}\n\n\t\tul input[type=checkbox] {\n\t\t\t\tposition: relative;\n\t\t\t\twidth: 0px;\n\t\t\t\theight: 10px;\n\t\t\t\tmargin-right: 9px\n\t\t}\n\t\tul input[type=checkbox]:before {\n\t\t\t\tcontent: "";\n\t\t\t\tdisplay: block;\n\t\t\t\tposition: absolute;\n\t\t\t\twidth: 15px;\n\t\t\t\theight: 15px;\n\t\t\t\ttop: 0px;\n\t\t\t\tleft: -4px;\n\n\t\t\t\tbackground-color: ').concat(l.a.colors.main,";\n\t\t\t\t/* background-image: url(./custom_icons/check.svg); */\n\t\t\t\t/* background-repeat: no-repeat; */\n\t\t\t\t/* background-size: contain; */\n\t\t\t\tmask-position: -2px -1px;\n\t\t\t\tmask-image: url(./custom_icons/check.svg);\n\t\t\t\tmask-size: contain;\n\t\t\t\tmask-repeat: no-repeat;\n\n\t\t\t\t-webkit-mask-position: -2px -1px;\n\t\t\t\t-webkit-mask-image: url(./custom_icons/check.svg);\n\t\t\t\t-webkit-mask-size: contain;\n\t\t\t\t-webkit-mask-repeat: no-repeat;\n\t\t}\n\t\tul input[type=checkbox]:checked:before {\n\t\t\t\t/* background-color: red; */\n\t\t\t\t/* -webkit-mask-image: url(./custom_icons/uncheck.svg); */\n\t\t\t\t/* mask-image: url(./custom_icons/uncheck.svg); */\n\t\t\t\t/* background-image: url(./custom_icons/uncheck.svg); */\n\n\t\t\t\t/* background-color: red; */\n\t\t\t\t/* -webkit-mask-image: url(./custom_icons/uncheck.svg); */\n\t\t\t\t/* mask-image: url(./custom_icons/uncheck.svg); */\n\t\t\t\tmask-image: url(./custom_icons/uncheck.svg);\n\t\t\t\t-webkit-mask-image: url(./custom_icons/uncheck.svg);\n\n\t\t}\n\n\t\t/**********************************************************\n\n\t\t PREVIEW LINK\n\n**********************************************************/\n\n\n\t\t").concat(Object(f.b)(t.pl),"\n\n\t\t/**********************************************************\n\n\t\t// TABLE\n\n**********************************************************/\n\n\t\ttable {\n\t\t\t\tmargin: 10px 0px;\n\t\t\t\tpadding 15px;\n\t\t\t\tborder-spacing: 0;\n\t\t\t\tborder-collapse: collapse;\n\t\t}\n\n\n\t\tth {\n\t\t\t\ttext-align: left;\n\t\t\t\tpadding: 10px 10px;\n\t\t}\n\t\ttd {\n\t\t\t\tpadding: 5px 10px;\n\t\t}\n\t\tthead tr {\n\t\t\t\tbackground: #e4e3e3;\n\t\t}\n\t\tth, td {\n\t\t\t\tborder: 1px solid #ccc;\n\t\t}\n\t\ttbody {\n\t\t}\n\t\t// tbody tr:nth-child(even) {background: #CCC}\n\t\t// tbody tr:nth-child(odd) {background: #EEE}\n\n\t\t/**********************************************************\n\n\t\t// RESSOURCE LINK\n\n**********************************************************/\n\t\t").concat(Object(p.b)(),"\n\n\t\tpre {\n\t\t}\n\n\t\tpre code {\n\t\t\t\tdisplay: block;\n\t\t\t\tborder-radius: 8px;\n\t\t\t\tbackground: #d2d2d2;\n\t\t\t\tpadding: 11px 23px;F\n\t\t}\n\t\t")},w=function(){return"\n\n\n.preview-area {\n\t\tmargin-top: 0px;\n \t.infos-preview-wrapper {\n\t\t\t\tborder-bottom: 1px solid rgba(0 0 0 / 5%);\n \t\tdisplay: ".concat(Object(a.c)("desktop")?"none":"block",";\n\t\t\t\tpadding: 14px 0px 14px 0px;\n\t\t}\n}\n.preview-area {\n position: relative;\n display: block;\n\toverflow: auto; \n\twidth: ").concat("desktop"===Object(a.a)()?"calc(100% + 0px)":"calc(100%)"," ; \n padding-right: 30px;\n\n\t//@TODO padding preview area\n\t.content-block.block-text {\n\t\tpadding-left: 10px;\n\t\tpadding-right: 20px;\n\t\tdisplay: block;\n\t}\n\n ").concat(Object(s.b)(),"\n\n\t.infos-preview-wrapper h1.big-title {\n\t\t\twidth: calc(100% - 65px);\n\t\t\tfont-family: ").concat(l.a.font.editor,";\n\t\t\tcolor: grey;\n\t\t\tfont-size: ").concat(Object(b.a)(5),"px;\n\t\t\tmargin: 0px;\n\t\t\tpadding: 0px 14px;\n\t}\n}\n.content-blocks-wrapper {\n\t\t").concat(v(),"\n}\n.view-both .preview-area {\n\t\t// margin-top: 20px;\n\t\tmargin-top: 0px;\n}\n\n.preview-area-wrapper {\n\theight: calc(100% - 35px);\n margin-top: ").concat(Object(a.c)("desktop")?"140":"0","px;\n}\n\n.preview-area, .preview-area-transitions, .content-blocks-wrapper, .simple-css-wrapper { height: 100%; }\n\n")}},88:function(t,e,n){"use strict";n.d(e,"c",(function(){return i})),n.d(e,"a",(function(){return a})),n.d(e,"b",(function(){return r}));n(30);var o=n(6),i=function(t){return t="editor"===t?"preview":"preview"===t?"both":"editor"},c="notes-view-type",a=function(t){return new Promise((function(e,n){Object(o.d)((function(n){n.cache.get(c,(function(n){if(n){var o=n[t];e(o||!1)}}))}))}))},r=function(t,e){Object(o.d)((function(n){n.cache.get(c,(function(o){o||(o={}),o[t]=e,n.cache.set(c,o,-1)}))}))}},92:function(t,e,n){"use strict";n.d(e,"a",(function(){return h})),n.d(e,"b",(function(){return v}));n(30),n(0);var o=n(29),i=n(18),c=n(12),a=n(101),r=n(33),l=n(73),s=n(57),u=n(10),d=n(42),p=n(6),f=n(25),b=n(1),g=400,h=function(t){var e=t.markdownTag.split("](")[1].slice(0,-1),n=t.markdownTag.split("](")[0].replace("![",""),u="".concat(Object(d.a)(t.file.folder),"/").concat(e).concat(Object(i.c)()),f="".concat(n,".").concat(Object(a.a)(e)),g=Object(o.b)(u),h="ress-".concat(Object(s.b)(g));Object(r.a)(t.file,g,(function(){var e=document.querySelector(".".concat(h," .iframe-wrapper"));e&&v(g,e,t.file.path)}));var m=r.d,v=function(e,n,i,s){var u=(null===s||void 0===s?void 0:s.fullscreen)||!1;null===s||void 0===s||s.fullscreen;if(n){var d=Object(o.e)(i);if(null!==s&&void 0!==s&&s.persist){var p=n.querySelector("iframe")?"closed":"open";Object(r.b)(d,e,p)}var f=function(){n.innerHTML=""},b="mobile"===Object(c.a)()?-300:-100,g=Object(a.a)(e).toLocaleLowerCase();"epub"===g?Object(l.c)(n,Object(l.b)("epub",e,t.windowId,{file:d,fullscreen:u,onFullscreenClose:f,ctagHeightOffset:b}),null===s||void 0===s?void 0:s.openOnly):"pdf"===g?Object(l.c)(n,Object(l.b)("pdf",e,t.windowId,{file:d,fullscreen:u,onFullscreenClose:f,ctagHeightOffset:b}),null===s||void 0===s?void 0:s.openOnly):"csv"===g||"arrow"===g?Object(l.c)(n,Object(l.b)("datatable",e,t.windowId,{file:d,fullscreen:u,onFullscreenClose:f,ctagHeightOffset:b}),null===s||void 0===s?void 0:s.openOnly):Object(l.c)(n,Object(l.b)("iframe",e,t.windowId,{fullscreen:u,onFullscreenClose:f,ctagHeightOffset:b}))}},O='<li title="Open link in detached window"\n\t\tonclick="'.concat(Object(r.c)("open-win-ress",(function(t){if(t){var e=t.dataset.link;window.open(e,"popup-preview-link","width=800,height=1000")}})),'"\n\t\tdata-link="').concat(g,'">').concat(m("up-right-from-square"),"</li>"),j=function(t,e){var n="iframe";if(e)n=e;else{var o=Object(a.a)(t).toLocaleLowerCase();"epub"===o&&(n="epub"),"pdf"===o&&(n="pdf"),"csv"!==o&&"arrow"!==o||(n="datatable")}var i=void 0;"mobile"===Object(c.a)()&&(i="full-center"),window.innerWidth<1200&&(i="full-center"),Object(p.d)((function(e){e.ui.floatingPanel.create({type:"ctag",layout:i,ctagConfig:{tagName:n,content:t}})}))},x='<li\n\t\tonclick="'.concat(Object(r.c)("preview-link-ress",(function(t){return function(t,e){if(t){var n=t.dataset.link,o=t.dataset.filepath,i=function(t){return t.parentNode.parentNode.parentNode.parentNode.parentNode.querySelector(".iframe-wrapper")}(t);v(n,i,o,e)}}(t,{persist:!0})})),'"\n\t\ttitle="Toggle a pinned preview" \n\t\tdata-filepath="').concat(t.file.path,'" \n\t\tdata-link="').concat(g,'">').concat(m("eye"),"</li>"),_='<li\n\t\tonclick="'.concat(Object(r.c)("download-link-ress",(function(t){if(t){var e=t.dataset.link,n=t.dataset.filename;console.log(u,f),w(n,e)}})),'"\n\t\ttitle="Download link" data-filename="').concat(f,'" data-link="').concat(g,'">').concat(m("download"),"</li>"),k='<li\n\t\tonclick="'.concat(Object(r.c)("open-file-ctag-link-ress",(function(t){if(t){var e=t.dataset.filepath;console.log("open file ctag",e),j(e,"files")}})),'"\n\t\ttitle="Explore files here" data-filepath="').concat(t.file.folder,'" >').concat(m("folder"),"</li>"),y="<ul>".concat(x," ").concat(O," ").concat(k," ").concat(_," </ul>"),C='<div \n\t\tclass="ressource-link-label" \n\t\tdata-filepath="'.concat(t.file.path,'" \n\t\tdata-link="').concat(g,'" \n\t\tonclick="').concat(Object(r.c)("click-ress-main-action",(function(t){if(t){var e=t.dataset.link;j(e)}})),'">\n\t\t\t').concat(n," (").concat(Object(a.a)(g),")\n\t\t</div>").split("\n").join("");return Object(b.c)("div",{className:"".concat(h," resource-link-iframe-wrapper")},Object(b.c)("div",{className:" resource-link-wrapper device-".concat(Object(c.a)())},Object(b.c)("div",{className:"resource-link-icon ".concat(Object(a.a)(g))}),Object(b.c)("div",{className:"resource-link-content-wrapper"},Object(b.c)("div",{dangerouslySetInnerHTML:{__html:C}}),Object(b.c)("div",{dangerouslySetInnerHTML:{__html:y},className:"buttons-wrapper"}))),Object(b.c)("div",{className:"iframe-wrapper"}))},m=".resource-link-icon",v=function(){return"\n.loading-string {\n text-align: center;\n padding: 50px;\n}\n.ressource-link-label {\n\t\tfont-weight: bold;\n\t\tcursor: pointer;\n}\n.resource-link-ctag {\n\t\t// height: ".concat(g-21,"px;\n\t\tmin-height: 120px;\n\t\toverflow:hidden;\n\t\twidth: 100%;\n\t\tborder:none;\n}\n.resource-link-iframe {\n\t\tborder: none;\n\t\twidth: 100%;\n}\n\n.resource-link-wrapper,\n.resource-link-wrapper a {\n\t\tcolor: ").concat(u.a.colors.main,";\n}\n.resource-link-iframe-wrapper {\n\t\tbackground: #f7f6f6;\n\t\tborder-radius: 5px;\n\t\toverflow:hidden;\n}\n.preview-area-wrapper .resource-link-iframe-wrapper {\n\t\tmargin-top: 3px;\n\t\tbackground:#eee!important;\n}\n\n.resource-link-wrapper {\n\t\tpadding: 7px;\n\t\tborder-radius: 10px;\n\t\tposition: relative;\n\t\tmargin: 5px 0px;\n}\n\n.buttons-wrapper {\n\t\tposition: relative;\n\t\ttop: -10px;\n\t\theight: 10px;\n}\n.resource-link-content-wrapper .ssr-icon {\n\t\tpadding: 3px;\n\t\tfont-size: ").concat(Object(f.a)(3),"px;\n\t\tmargin: 0px 5px 0px 0px;\n\t\tcolor: #b9b9b9;\n\t\tcursor: pointer;\n}\n.resource-link-content-wrapper .ssr-icon:hover {\n\t\tcolor:grey;\n}\n\n.mdpreview-source {\n\t\t// display:none!important;\n}\n\n.resource-link-icon {\n\t\ttop: 10px;\n\t\tleft: 19px;\n\t\twidth: 12px;\n\t\theight: 27px;\n\t\tdisplay: inline-block;\n\t\tbackground-image: url(/static/media/file-solid.6415173e.svg);\n\t\topacity: 0.08;\n\t\tposition: absolute;\n\t\tbackground-repeat: no-repeat;\n\t\ttransform: scale(1.5);\n\t\tbackground-image: url(").concat(u.a.assets.fileIcon,");\n}\n\n").concat(m,".epub, ").concat(m,".cbr, ").concat(m,".cbz,").concat(m,".mobi, ").concat(m,".azw, ").concat(m,".azw3, ").concat(m,".iba {background-image: url(").concat(u.a.assets.bookIcon,"); }\n").concat(m,".pdf\n{background-image: url(").concat(u.a.assets.pdfIcon,"); }\n\n").concat(m,".xls, ").concat(m,".xlsm, ").concat(m,".xlsx, ").concat(m,".ods\n{background-image: url(").concat(u.a.assets.excelIcon,"); }\n\n").concat(m,".avi, ").concat(m,".flv, ").concat(m,".h264, ").concat(m,".m4v, ").concat(m,".mov, ").concat(m,".mp4, ").concat(m,".mpg, ").concat(m,".mpeg, ").concat(m,".rm, ").concat(m,".swf, ").concat(m,".vob, ").concat(m,".wmv, ").concat(m,".mkv\n{background-image: url(").concat(u.a.assets.videoIcon,"); }\n\n").concat(m,".d7z, ").concat(m,".arj, ").concat(m,".deb, ").concat(m,".rar, ").concat(m,".gz, ").concat(m,".zip, ").concat(m,".rpm, ").concat(m,".pkg\n{background-image: url(").concat(u.a.assets.archiveIcon,");}\n\n").concat(m,".aif, ").concat(m,".mp3, ").concat(m,".cda, ").concat(m,".mid, ").concat(m,".mpa, ").concat(m,".ogg, ").concat(m,".wav, ").concat(m,".wpl, ").concat(m,".wma, ").concat(m,".midi\n{background-image: url(").concat(u.a.assets.audioIcon,"); }\n\n").concat(m,".doc, ").concat(m,".docx, ").concat(m,".odt, ").concat(m,".txt\n{background-image: url(").concat(u.a.assets.wordIcon,"); }\n\n").concat(m,".html, ").concat(m,".css, ").concat(m,".js, ").concat(m,".json, ").concat(m,".ts, ").concat(m,".jsx, ").concat(m,".tsx\n{background-image: url(").concat(u.a.assets.codeIcon,"); }\n\n").concat(m,".bin, ").concat(m,".dmg, ").concat(m,".iso, ").concat(m,".toast, ").concat(m,".vcd\n{\n\t\ttop: 19px;\n\t\ttransform: scale(1.8);\n\t\tbackground-image: url(").concat(u.a.assets.diskIcon,");\n}\n\n").concat(m,".ppt, ").concat(m,".pptx, ").concat(m,".odp, ").concat(m,".key, ").concat(m,".pps\n{background-image: url(").concat(u.a.assets.presIcon,"); }\n\n\n.resource-link-content-wrapper {\n\t\tdisplay: flex;\n\t\tjustify-content: space-between;\n}\n\n.resource-link-content-wrapper {\n}\n\n.resource-link-content-wrapper ul {\n\t\tpadding-left: 7px;\n\t\tdisplay: flex;\n}\n.resource-link-content-wrapper ul li {\n\t\tlist-style: none;\n\t\tpadding-left: 0px;\n}\n.resource-link-content-wrapper ul li:before {\n\t\tdisplay: none;\n}\n\n\n// HIDING IT ON DESKTOP \n// .device-desktop .resource-link-wrapper:hover .resource-link-content-wrapper ul {\n// \t\topacity:1;\n// \t\twidth: 110px;\n// \t\t// margin-top: 15px;\n// \t\tpointer-events: all;\n// }\n// .device-desktop .resource-link-content-wrapper ul {\n// \t\topacity: 0;\n// \t\twidth: 0px;\n// \t\ttransition: 0.2s all;\n// \t\ttransition-delay: 0.2s, 0s;\n// \t\tpointer-events: none;\n// }\n.device-desktop .resource-link-wrapper .resource-link-content-wrapper ul {\n\t\topacity:1;\n\t\twidth: 110px;\n\t\tpointer-events: all;\n}\n\n")},w=function(t,e){var n=document.createElement("a");n.style.display="none",document.body.appendChild(n),n.href=e,n.target="_blank",n.setAttribute("download",t),n.click(),window.URL.revokeObjectURL(n.href),document.body.removeChild(n)}},93:function(t,e,n){"use strict";n.d(e,"b",(function(){return r})),n.d(e,"a",(function(){return l}));var o=n(3),i=n(30),c=n(292),a=n(0),r=function(){var t=Object(a.useState)([]),e=Object(o.a)(t,2),n=e[0],r=e[1],s=Object(a.useState)(0),u=Object(o.a)(s,2),d=u[0],p=u[1];return{lightboxApi:{open:function(t,e){var n=[];Object(i.a)(e,(function(t){if(Object(c.a)(t)){var e={file:l(),title:"",url:t};n.push(e)}else n.push(t)})),r(n),p(t)},close:function(){r([]),p(0)}},lightboxImages:n,lightboxIndex:d}},l=function(t,e){return{nature:"file",name:t||"",realname:"",path:e||"",folder:""}}},95:function(t,e,n){"use strict";n.d(e,"b",(function(){return a})),n.d(e,"d",(function(){return r})),n.d(e,"c",(function(){return l})),n.d(e,"a",(function(){return u}));var o=n(16),i=n(30),c=n(439);c.setOptions({gfm:!0,breaks:!0,headerPrefix:"t-"});var a=function(t){var e=t;try{e=c.parse(e)}catch(n){console.error("MD2HTML > error",n)}return e},r=function(t,e,n){var o=t,c=o.match(e)||"";return Object(i.a)(c,(function(t){o=o.replace(t,n(t))})),o},l=function(t,e,n){var o=t,i=e.replace("[[","").replace("]]",""),c="(?:\\[\\[".concat(i,"\\]\\])((?:[^]*))(?:\\[\\[").concat(i,"\\]\\])"),a=new RegExp(c,"gm"),r=o.match(a)||"";if(r[0]){for(var l=r[0].split(e),s=[],u=0;u<l.length;u++){var d=l[u];""!==d&&s.push(d)}for(var p=0;p<s.length;p++){s[p];if(p%2===0)try{s[p]=n(s[p])}catch(b){console.warn("[REPLACE CUSTOM MD TAGS] error: ".concat(b),s[p])}}var f=s.join("");o=o.replace(a,f)}return o},s=function t(e,n){var o=!1;if(Object(i.a)(e,(function(t){t.id===n&&(o=!0)})),o){var c=!1,a=[n[n.length-2],n[n.length-1]],r=n.slice(0,-2),l=parseInt(a[1]);return"-"!==a[0]||isNaN(l)||(c=!0),c?n="".concat(r,"-").concat(l+1):n+="-1",t(e,n)}return n},u=function(t,e){var n=e.split("\n"),i=-1;if("string"===typeof t){console.log("[GET STRING INFO FROM MD STRUCTURE] looking for stringSearchee: ".concat(t));for(var c=0;c<n.length;c++){if(n[c].includes(t)){i=c;break}}}else i=t;for(var a=function(t){for(var e=[],n=t.split("\n"),i=[],c=0;c<n.length;c++){var a=n[c],r=Object(o.a)(a.matchAll(/([#]{1,9})\ (.+)/gi));if(r.length>0){var l=r[0],u=l[2].toLowerCase(),d=c,p=u.trim().split(" ").join("-").replace(/[^a-zA-Z0-9-_\xc0-\xfa]/gi,""),f="t-"+p;l[1].length,p=s(i,p),i.push({raw:a,matches:l,id:p,line:d,title:u,ranking:l[1].length,previewId:f}),e.push({id:p,title:u,line:d,ranking:l[1].length,previewId:f})}}return e}(e),r=null,l=0;l<a.length;l++){var u=a[l];if(u.line>i)break;r=u}return{line:i,mdPart:r}}},96:function(t,e,n){"use strict";n.d(e,"a",(function(){return u})),n.d(e,"b",(function(){return f}));var o=n(11),i=n(30),c=n(31),a=n(106),r=n(95),l=n(42),s=function(t){var e=Object(o.a)({},t),n=e.raw,i=e.file,c=e.windowId;c||(c="");var s=Object(r.b)(Object(l.d)(i,c,Object(l.c)(i,Object(l.e)(Object(l.f)(c,Object(l.g)(n))))));return Object(a.d)(),s},u=function(t,cb){for(var e=document.getElementsByClassName(t),n=function(){var t=e[o];t.onclick=function(){cb(t)}},o=0;o<e.length;o++)n()},d=function(t){var e=t.split(c.a.userCustomTagManual),n=[],o=[],a=c.a.userCustomTag3,r=t.match(a)||"",l=[];Object(i.a)(r,(function(t){l.push(t)}));var s=null,u=-1,d=[],p=[],f={};if(Object(i.a)(l,(function(t){f[t]?f[t]=f[t]+1:f[t]=1})),Object(i.a)(f,(function(t,e){t>=2&&p.push(e)})),Object(i.a)(l,(function(t,n){if(p.includes(t))if(s){if(s===t){var i=[u+1,n+1];d.push.apply(d,i);for(var c=e.slice(i[0],i[1]),a=l.slice(u+1,n+1),r="",f=0;f<c.length;f++){var b=f===c.length-1?"":a[f];r+="".concat(c[f]).concat(b)}o.push({type:"tag",tagName:s.replace("[[","").replace("]]",""),content:r,start:u,end:n}),u=-1,s=null}}else s=t,u=n})),0===d.length)n.push({type:"text",content:t,start:0,end:1});else{d.unshift(0);for(var b=0;b<d.length;b+=2){var g=d[b];e[g]&&n.push({type:"text",content:e[g],start:g,end:g+1})}}for(var h=0===t.indexOf(l[0]),m=[],v=o.length>n.length?o.length:n.length,w=0;w<v;w++)h?(o[w]&&m.push(o[w]),n[w]&&m.push(n[w])):(n[w]&&m.push(n[w]),o[w]&&m.push(o[w]));return m},p=function(t){var e="";return Object(i.a)(t,(function(t){"text"===t.type?e+=t.content:"tag"===t.type&&(e+="[[".concat(t.tagName,"]]").concat(t.content,"[[").concat(t.tagName,"]]"))})),e},f={render:function(t){var e=Object(o.a)({},t),n=e.raw,c=e.file,a=e.windowId;a||(a="");var r=d(n);return Object(i.a)(r,(function(t){"text"===t.type&&(t.content=s({raw:t.content,file:c,windowId:a})),"tag"===t.type&&(t.content=Object(l.b)(t.content))})),p(r)},injectLogic:function(t){},chunks:{chunk:d,merge:p}}},97:function(t,e,n){"use strict";n.d(e,"b",(function(){return c})),n.d(e,"a",(function(){return a})),n.d(e,"d",(function(){return r})),n.d(e,"c",(function(){return l}));var o=n(256),i=n(30),c=["Az","Crea","Modif"],a=["alphabetical","created","modified"],r=function(t,e){var n;switch(a[e]){case"alphabetical":default:n=Object(o.a)(t,[function(t){return t.realname.toLocaleLowerCase()}]);break;case"created":n=Object(o.a)(t,["created"]).reverse();break;case"modified":n=Object(o.a)(t,["modified"]).reverse()}return n},l=function(t){var e=t[0];return e?(Object(i.a)(t,(function(t){t.created&&e.created&&t.created>e.created&&(e=t)})),e):null}},98:function(t,e,n){"use strict";n.d(e,"c",(function(){return lt})),n.d(e,"a",(function(){return pt})),n.d(e,"b",(function(){return ft}));var o=n(3),i=n(0),c=n.n(i),a=n(253),r=n(255),l=n(55),s=n(13),u=n(387),d=n(10),p=n(68),f=n(12),b=n(228),g=n(58),h=n(223),m=n(30),v=n(17),w=n(6),O=n(28);v.a.client.log.verbose;const j=(t,e,n,o,i)=>({label:t,apply:e||t,info:n,detail:i,type:"tag",boost:o||0}),x=(t,e)=>{const n=k(t,e);return[y(e),n,_(e)]},_=t=>e=>{let n=e.matchBefore(/\-/);if(!e.explicit&&!n)return null;const o="".concat(v.a.path.configFolder,"/snippets.md");return new Promise(((i,c)=>{Object(w.d)((c=>{c.file.getContent(o,(o=>{const c=[],a=o.split("\n");Object(m.a)(a,(t=>{var e;let n=(t=t.split("\\n").join("\n")).split("|"),o=null===(e=n.shift())||void 0===e?void 0:e.trim(),i=n.join("|").trim();if(!i||!o)return;if(o="--"+o,i.includes("${")){let t=i;try{i=new Function("return `"+t+"`")()}catch(r){let e="".concat("[Code Mirror]"," snippets error: ").concat(JSON.stringify({e:r,oto:t}));Object(O.d)(e)}}let a=i.length>20?"".concat(i.substring(0,20),"..."):i;c.push(j(o,i,void 0,void 0,a))}));let r={from:n?n.from:e.pos,options:c,validFor:/.*/};t("snippets"),i(r)}))}))}))},k=(t,e)=>n=>{let o=n.matchBefore(/\#/);return n.explicit||o?new Promise(((i,c)=>{Object(w.d)((c=>{let a=t.folder;console.log("searching for folder",a),c.search.word("#",a,(t=>{const c=[];Object(m.a)(t,(t=>{Object(m.a)(t.results,(t=>{let e=t.split(" ");Object(m.a)(e,(t=>{(t=t.trim())&&t.startsWith("#")&&(t.length<=1||"#"!==t[1]&&c.push(j(t,t)))}))}))}));let a={from:o?o.from:n.pos,options:c,validFor:/.*/};e("hashtag"),i(a)}))}))})):null},y=t=>e=>{let n=e.matchBefore(/\[\[/);return e.explicit||n?new Promise(((o,i)=>{const c=new Promise(((t,e)=>{Object(w.d)((e=>{e.files.get("/.tiro/tags",(n=>{let o=0,i=[];Object(m.a)(n,(c=>{e.file.getContent(c.path,(e=>{o++,i.push({name:c.name,content:e}),o===n.length&&t(i)}))}))}))}))})),a=new Promise(((t,e)=>{Object(w.d)((e=>{let n=[];e.plugins.list((e=>{Object(m.a)(e,(t=>{"tag"===t.type&&n.push({name:t.name,content:t.code})})),t(n)}))}))}));Promise.all([a,c]).then((t=>{let e=(t=>{const e=[];return Object(m.a)(t,(t=>{const n=t.name.replace(".md",""),o="[[".concat(n,"]]");let i="".concat(o," ").concat(o),c="Insert installed custom tag ".concat(o),a=0;const r=t.content.split("\n");let l="// --insert:",s="// --comment:",u="// --boost:";Object(m.a)(r,(t=>{(t=t.split("\\n").join("\n")).startsWith(l)&&(i=t.replace(l,"")),t.startsWith(s)&&(c=t.replace(s,"")),t.startsWith(u)&&(a=parseInt(t.replace(u,"")))})),e.push(j(o,i,c,a))})),e})([...t[0],...t[1]]);r(e)})).catch((()=>{console.warn("ERROR HERE")}));const r=i=>{let c={from:n?n.from:e.pos,options:i,validFor:/.*/};t("ctag"),o(c)}})):null};var C=n(127),S=n(22),E=n(92),T=n(157),I=n(76),N=n(122),P=n(221),A=n(31),R=n(101),F=n(45),L=n(1),D=function(t,e){return Object(F.a)({file:t,windowId:e,pattern:A.a.ressource,replacement:function(n){var o=n.matchs,i=document.createElement("span"),c=o[2];return"none"===Object(R.a)(c)?i.innerHTML=Object(N.a)(o[0],o[2],t,!0):i.innerHTML=function(t,e,n){var o=t[0],i='<div class="mdpreview-source">'.concat(o,"</div>"),c=Object(P.renderToString)(Object(L.c)(E.a,{markdownTag:o,file:e,windowId:n}));return"".concat(c," ").concat(i)}(o,t,e),i}})},M=n(102),z=n(238),B=n(20),W=n(132),U=n(133),H=n(39),q=n(32),V=n(235),G=n(236),J=n(106),K=n(25),Y=n(237),$=n(239),Z=n(7),X=n(34),Q=n(5),tt=n(47),et=n(291),nt=n(390),ot={lines:[],words:[],sentences:[],userDicStr:[]},it={lastLinePos:-1},ct=Object(nt.a)((function(){Object(w.d)((function(t){t.file.getContent(".tiro/suggestions.md",(function(t){"NO_FILE"!==t&&(ot.userDicStr=["\n"+t])}))}))}),6e4),at=Object(nt.a)((function(t,e,n){ct();var o=t;n>0&&(o=t.slice(0,-n));var i=o+e+ot.userDicStr[0],c=i.split("\n");c=Array.from(new Set(c));var a=i.split("\n").join("<END_SENTENCE>"),r=(a=a.split(".").join("<END_SENTENCE>").split("?").join("<END_SENTENCE>").split("!").join("<END_SENTENCE>")).split("<END_SENTENCE>"),l=(c=c.filter((function(t){return""!==t.trim()}))).join(" ").split(" ");l=Array.from(new Set(l)),ot.lines=c,ot.words=l,ot.sentences=r}),6e3),rt=Object(et.b)(function(){var t=Object(tt.a)(Object(X.a)().mark((function t(e,n){var o,i,c,a,r,l,s,u,d,p,f,b,g,h,m,v,O,j,x,_,k,y,C,S,E,T,I,N,P,A,R,F,L,D,M,z,B,W,U,H,q,V;return Object(X.a)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(new Promise((function(t,e){Object(w.d)((function(t){}))})),o=e.split("\n").slice(-1)[0],i=o.split(".").slice(-1)[0].split("?").slice(-1)[0].split("!").slice(-1)[0],c=e.split("\n").length-1,(a=i).startsWith(" ")&&(a=a.slice(1)),r=o.split(" ").slice(-1)[0],l=o.split(" ").slice(-2,-1)[0],s=o.slice(-1),u=e+n,(r.startsWith("d'")||r.startsWith("l'"))&&(r=r.slice(2)),d=i.length,p="",at(e,n,d),f=!0,!0,b="",g="",h="",m=!1,v=r.length>1," "===s&&l&&l.length>0&&(v=!0,m=!0),!v){t.next=56;break}O=[],j=[],x=Object(Q.a)(ot.words);try{for(x.s();!(_=x.n()).done;)if((k=_.value).startsWith(r)&&(O.push(k),l&&l.length>0))for(y=l+" "+k,C=u.indexOf(y);-1!==C&&""!==k;)j.push(k),C=u.indexOf(y,C+1)}catch(G){x.e(G)}finally{x.f()}if(!(j.length>0)){t.next=47;break}S="",E=0,T=Object(Q.a)(j),t.prev=31,N=Object(X.a)().mark((function t(){var e,n;return Object(X.a)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:e=I.value,(n=j.filter((function(t){return t===e})).length)>E&&(S=e,E=n);case 3:case"end":return t.stop()}}),t)})),T.s();case 34:if((I=T.n()).done){t.next=38;break}return t.delegateYield(N(),"t0",36);case 36:t.next=34;break;case 38:t.next=43;break;case 40:t.prev=40,t.t1=t.catch(31),T.e(t.t1);case 43:return t.prev=43,T.f(),t.finish(43);case 46:j=[S];case 47:P=j.length>0?j:O,m&&(P=j),A="",P.length>0&&(R=P.sort((function(t,e){return e.length-t.length})),F=R.slice(0,10),L=Math.floor(Math.random()*F.length),A=(A=F[L]).replace(r,"")),D=[".",",","!","?","|"].includes(A.slice(-1)),M=" "===A.slice(-2,-1),D&&M&&(A=A.slice(0,-2)),D&&(A=A.slice(0,-1)),j.length>0?g=A:b=A;case 56:if(a.length>4&&""===g){h="",((z=a.trim()).endsWith("[ ]")||z.endsWith("[x]"))&&(f=!1),a.endsWith(" ")&&(f=!1),B=[],W=Object(Q.a)(ot.sentences);try{for(W.s();!(U=W.n()).done;)(H=U.value).toLocaleLowerCase().startsWith(a.toLocaleLowerCase())&&B.push(H)}catch(G){W.e(G)}finally{W.f()}B.length>0&&(h=B.sort((function(t,e){return e.length-t.length}))[0],q=a.length,h=h.slice(q)),f&&(p=h)}return V=!0,it.lastLinePos!==c&&(V=!1),it.lastLinePos=c,Object(et.a)(),p=g||b||p,V||(p=""),t.abrupt("return",p);case 64:case"end":return t.stop()}}),t,null,[[31,40,43,46]])})));return function(e,n){return t.apply(this,arguments)}}(),100),lt={lastCMSelection:{from:-1,to:-1,line:-1,selectionContent:"",lineContent:""},lastCMId:""},st="[Code Mirror]",ut=v.a.client.log.verbose,dt=Object(i.forwardRef)((function(t,e){var n=function(){var t=e.current;return t&&t.state?t:null},d=Object(i.useRef)(null);Object(i.useEffect)((function(){!function(){var e,o=n();if(!o)return!1;if(t.value===d.current)return!1;if("loading..."===t.value)return!1;if((null===(e=o.view)||void 0===e?void 0:e.state.doc.toString())===t.value)return!1;var i=g.a.getCurrentLineInfos(o);if(!i)return!1;var c=i.currentPosition;g.a.updateText(o,t.value,c),d.current=t.value}()}),[t.value,t.forceRender,t.file.path]);var v=Object(i.useState)(!1),O=Object(o.a)(v,2),j=O[0],_=O[1];Object(i.useEffect)((function(){_(!1)}),[t.file.path]),Object(i.useEffect)((function(){!0===j&&k()}),[t.value]);var k=Object(q.a)((function(){var t=n();g.a.foldAllChildren(t)}),500),y=Object(i.useRef)(t.value);Object(i.useEffect)((function(){y.current=t.value}),[t.value]);var E=function(e,n){e!==t.value&&(d.current=e,y.current=e,t.onChange(e),Jt(!1),M.a.val=!1,A(),tt(e))};Object(i.useEffect)((function(){if(ut&&console.log(st,"JUMP to line :",t.jumpToLine),-1!==t.jumpToLine){var e=n();if(e&&!(t.posY<=-10))try{g.a.scrollToLine(e,t.jumpToLine)}catch(o){console.log(o)}}}),[t.jumpToLine]);Object(i.useEffect)((function(){A()}),[t.value]),Object(i.useEffect)((function(){A()}),[]);var P=Object(b.a)(".window-id-".concat(t.windowId," .cm-content")).resizeState;Object(i.useEffect)((function(){A()}),[P,t.windowId]);var A=function(){var o=n();if(o){var i=g.a.getEditorInfos(o.view);e.current;p.a.updateEditorDims(t.windowId,{viewport:i.viewportHeight(),full:i.contentHeight}),p.a.updateScrollerDims(t.windowId)}},R=Object(i.useState)(null),F=Object(o.a)(R,2),K=F[0],X=F[1];Object(i.useEffect)((function(){var t=null;Object(m.a)(r.a,(function(e){"Javascript"===e.name&&(t=e)})),X(t)}),[]),Object(m.a)(r.a);var Q={base:a.markdownLanguage,codeLanguages:r.a,extensions:[]};K&&(Q.defaultCodeLanguage=K);var tt=Object(q.a)((function(t){t.includes("--table")&&!ot&&(it(!0),yt()),t.includes("--no-date-picker")&&!dt&&(pt(!0),yt()),t.includes("--latex")&&!gt&&(ht(!0),yt()),t.includes("--spellcheck")&&!wt&&(Ot(!0),yt()),!t.includes("--table")&&ot&&(it(!1),yt()),!t.includes("--no-date-picker")&&dt&&(pt(!1),yt()),!t.includes("--latex")&>&&(ht(!1),yt()),!t.includes("--spellcheck")&&wt&&(Ot(!1),yt())}),500),et=Object(i.useState)(!1),nt=Object(o.a)(et,2),ot=nt[0],it=nt[1],ct=Object(i.useState)(!1),at=Object(o.a)(ct,2),dt=at[0],pt=at[1],ft=Object(i.useState)(!1),bt=Object(o.a)(ft,2),gt=bt[0],ht=bt[1],mt=Object(i.useState)(!1),vt=Object(o.a)(mt,2),wt=vt[0],Ot=vt[1],jt=Object(i.useState)(0),xt=Object(o.a)(jt,2),_t=xt[0],kt=xt[1],yt=function(){kt(_t+1)};Object(i.useEffect)((function(){tt(t.value)}),[t.value]);var Ct=Object(i.useState)([]),St=Object(o.a)(Ct,2),Et=St[0],Tt=St[1],It=Object(i.useState)(""),Nt=Object(o.a)(It,2),Pt=Nt[0],At=Nt[1],Rt=function(){var t=document.querySelector(".cm-tooltip");if(t){var e="translate(".concat(-Math.round(Ft.current[0]),"px, ").concat(-Math.round(Ft.current[1]-20),"px)");t.style.transform=e}},Ft=Object(i.useRef)([0,0]),Lt=function(){var n,o=(null===e||void 0===e||null===(n=e.current)||void 0===n?void 0:n.editor)||null,i=(o.parentNode,"window-id-sizeref-".concat(t.windowId)),c=document.querySelector(".".concat(i));document.querySelector(".".concat(i));if(o){var a=null===c||void 0===c?void 0:c.getBoundingClientRect();setTimeout((function(){a&&(Ft.current=[a.left,a.top],Rt())}),100)}},Dt=Object(q.a)((function(){Mt.current&&Object(w.d)((function(e){var n;e.note.ui.editorAction.dispatch({type:"lineJump",windowId:t.windowId,lineJumpString:null===Mt||void 0===Mt||null===(n=Mt.current)||void 0===n?void 0:n.lineText,lineJumpType:"preview"})}))}),400),Mt=Object(i.useRef)(null);Object(i.useEffect)((function(){Object(w.d)((function(n){var o=[Object(l.a)({override:x(t.file,Lt)}),s.c.updateListener.of((function(t){t.docChanged&&Rt()})),s.c.domEventHandlers({scroll:function(t,n){if(S.d.curr.ui_editor_synced_title_scrolling){var o=e.current;if(o){var i=g.a.getScrolledLine(o);i.lineText.startsWith("#")&&(Mt.current=i,Dt())}}},wheel:function(e,n){var o=g.a.getEditorInfos(n);p.a.scrollScroller(t.windowId,o.currentPercentScrolled()),t.onScroll()}})];(n.userSettings.get("ui_editor_spellcheck")||wt)&&o.push(s.c.contentAttributes.of({spellcheck:"true"}));var i=t.pluginsConfig;i||(i={}),Object(W.a)(i.markdown)||(i.markdown=!0),Object(W.a)(i.linkPreview)||(i.linkPreview=!0);var c=n.userSettings;Object(f.a)();if(c.get("ui_editor_markdown_tags")&&o.push(Object(V.b)(t.file,t.windowId)),c.get("ui_editor_links_as_button")&&(o.push(Object(T.c)(t.file,t.windowId)),o.push(Object(I.c)(t.file,t.windowId,i.linkPreview))),c.get("ui_editor_markdown_table_preview")&&ot&&(o.push(Object(M.f)(t.file,t.windowId)),o.push(Object(M.g)(t.file,t.windowId)),o.push(Object(M.d)(t.file,t.windowId)),o.push(Object(M.c)(t.file,t.windowId))),c.get("ui_editor_markdown_latex_preview")&>&&Q.extensions.push(C.a),c.get("ui_editor_markdown_preview")){J.b||Object(J.a)();var r=Object(C.c)({file:t.file,onTitleClick:function(e,n){Object(w.d)((function(e){e.note.ui.editorAction.dispatch({type:"lineJump",windowId:t.windowId,lineJumpNb:n,lineJumpType:"preview"})}))}});o.push(r),c.get("ui_editor_markdown_enhanced_preview")&&(dt||o.push(Object(G.a)(t.file,t.windowId)),o.push(Object(Y.a)(t.file,t.windowId)),o.push(Object(N.c)(t.file,t.windowId)),o.push(D(t.file,t.windowId)),o.push(Object(z.a)(t.file,t.windowId))),c.get("ui_editor_markdown_syntax")&&o.push(Object($.a)(t.file,t.windowId))}i.markdown?o.push(Object(a.markdown)(Q)):o.push(Object(M.b)(t.file,t.windowId));var u="device-".concat(Object(f.a)()," ");c.get("ui_editor_markdown_table_preview")&&(u+="md-table-preview-enabled"),o.push(zt),o.push(Z.A.of(" ")),c.get("ui_editor_inline_suggestion")&&o.push(rt),Tt(o),At(u)}))}),[t.pluginsConfig,t.windowId,t.file.path,t.value,gt,ot,wt,_t]);var zt=s.c.domEventHandlers({blur:function(e,n){t.onEvent("blur")},focus:function(e,n){t.onEvent("focus")}}),Bt=Object(i.useRef)(""),Wt=Object(i.useRef)([-9999,-9999]),Ut=Object(i.useState)([-9999,-9999]),Ht=Object(o.a)(Ut,2),qt=(Ht[0],Ht[1]),Vt=Object(i.useState)(!1),Gt=Object(o.a)(Vt,2),Jt=(Gt[0],Gt[1]),Kt=Object(i.useRef)({from:-1,to:-1}),Yt=Object(i.useRef)({from:-1,to:-1}),$t=[30,10],Zt=Object(i.useState)({x:0,y:0}),Xt=Object(o.a)(Zt,2),Qt=(Xt[0],Xt[1],Object(q.a)((function(e){var o,i=null===(o=n())||void 0===o?void 0:o.view;if(i){var c=i.coordsAtPos(i.state.selection.main.head),a=i.coordsAtPos(i.state.selection.ranges[0].from);if(!c)return;t.onCursorMove({x:c.left,y:c.top,from:e.from,to:e.to,fromPx:(null===a||void 0===a?void 0:a.top)||0,toPx:(null===a||void 0===a?void 0:a.bottom)||0})}e.from!==e.to&&Object(U.a)(e.from)&&Object(U.a)(e.to)&&(e.from<0||e.to<0||JSON.stringify(Yt.current)!==JSON.stringify(e)&&(Yt.current=Object(H.a)(e),ee()))}),200)),te=function(t,e){"up"===t?Bt.current=t:"down"===t?Jt(!1):"move"===t&&(Wt.current=[e.clientX,e.clientY])},ee=function(){Object(w.d)((function(t){if(t.userSettings.get("ui_editor_ai_text_selection")){Jt(!0);var e=Wt.current;qt([e[0]+$t[0],e[1]+$t[1]])}}))},ne=Object(i.useMemo)((function(){return Object(L.c)(c.a.Fragment,null,Object(L.c)(u.a,{value:"",ref:e,theme:Object(h.a)(),onChange:E,onUpdate:function(e){!function(e){var n=e.state.selection.ranges[0];Kt.current=n;var o=e.state.doc.sliceString(n.from,n.to),i=e.state.doc.lineAt(n.from),c=i.text;lt.lastCMSelection={from:n.from,to:n.to,line:i.number,selectionContent:o,lineContent:c},lt.lastCMId=t.windowId,Qt(n)}(e)},basicSetup:{foldGutter:!0,dropCursor:!1,allowMultipleSelections:!1,indentOnInput:!1,closeBrackets:!1,history:!0,bracketMatching:!1,lineNumbers:!1},extensions:Et}))}),[t.value,Et]);return Object(L.c)(c.a.Fragment,null,Object(L.c)("div",{className:"codemirror-editor-wrapper ".concat(Pt," "),onClick:function(t){te("up",t)},onMouseDown:function(t){te("down",t)},onMouseMove:function(t){return te("move",t)}},Object(L.c)("div",{className:"foldall-wrapper ".concat(Object(f.a)()),onClick:function(t){!function(){var t=n();j?g.a.unfoldAllChildren(t):g.a.foldAllChildren(t,!1),_(!j)}()}},Object(L.c)(B.b,{name:"".concat(j?"up-right-and-down-left-from-center":"down-left-and-up-right-to-center"),label:"".concat(j?"Unfold all text":"Fold all text")})),ne))})),pt=c.a.memo(dt,(function(t,e){var n=!0;return t.forceRender!==e.forceRender&&(n=!1),t.jumpToLine!==e.jumpToLine&&(n=!1),t.file.path!==e.file.path&&(n=!1),n})),ft=function(t){t||(t={});var e=t.searchBottom;return e||(e=0),Object(f.c)("mobile")&&(e=40),"\n\n\t.view-both.device-desktop .actionable-title {\n\t\tcursor: pointer;\n\t}\n\n\n\t.draggable-grid-wrapper .cm-tooltip {\n\t\ttransform: inherit!important;\n\t}\n\t\n\t.codemirror-popup-cursor {\n\t\tposition: fixed;\n\t\tz-index: 2;\n\t\tbackground: white;\n\t\tpadding: 5px;\n\t\tbox-shadow: 0px 0px 5px rgba(0,0,0,0.3);\n\t\tborder-radius: 3px;\n\t}\n\t.cm-hover-popup.cm-selection-popup {\n\t\tdisplay: flex;\n\t\tposition: fixed;\n\t\tz-index: 2;\n\t\tbackground: white;\n\t\tpadding: 5px;\n\t\tbox-shadow: 0px 0px 5px rgba(0,0,0,0.3);\n\t\tborder-radius: 3px;\n\t\topacity:0.4;\n\t\ttransition: all 0.2s;\n\t\t.link-action {\n\t\t\tpadding: 0px 3px;\n\t\t\tdisplay: flex;\n\t\t\t.result-calc {\n\t\t\t\tpadding: 0px 3px;\n\t\t\t}\n\t\t}\n\t\t&:hover {\n\t\t\topacity:1;\n\t\t}\n\t\n\t}\n\t.cm-selectionLayer {\n\t\tpointer-events: none;\n\t\t\tz-index:0!important;\n\t}\n\t.cm-selectionBackground {\n\t\t\tbackground: rgba(0,0,0,0.1)!important;\n\t}\n\t\n\t\n\t.note-preview-wrapper {}\n\t.cm-search {\n\t\tz-index: 10;\n\t\tposition:absolute;\n\t\tbottom: ".concat(e,"px;\n\t\tbackground: #ececec;\n\t\tpadding: 6px 10px 11px;\n\t}\n\t\n\t.cm-gutters {\n\t\t\tborder: none;\n\t\t\topacity: 0;\n\t\t\tz-index: 0;\n\t\t\t&:hover {\n\t\t\t\t\topacity: 1;\n\t\t\t}\n\t\t\t.cm-gutter {\n\t\t\t\t\t.cm-gutterElement span {\n\t\t\t\t\t\t\tcolor: #cccaca;\n\t\t\t\t\t}\n\t\t\t}\n\t}\n\t.device-mobile {\n\t\t\t.cm-gutters {\n\t\t\t\t\topacity:1!important;\n\t\t\t\t\t// background:red!important;\n\t\t\t}\n\t}\n\t\n\t.foldall-wrapper {\n\t\t\t&.desktop {\n\t\t\t\t\topacity: 0;\n\t\t\t}\n\t\t\t&.desktop:hover {\t\n\t\t\t\t\topacity: 1;\n\t\t\t}\n\t\t\t&::selection {\n\t\t\t\t\tbackground: none;\n\t\t\t}\n\t\t\t\n\t\t\topacity:0.6;\n\t\t\tposition: absolute;\n\t\t\tz-index: 1;\n\t\t\ttop: 2px;\n\t\t\tcolor: #d7d7d7;\n\t\t\tcursor: pointer;\n\t\t\tpadding: 5px 4px;\n\t\t\tleft: 0px;\n\t\t\tbackground: white;\n\t}\n\t\n\t\n\t.actionable-title {\n\t\t\tcolor: ").concat(d.a.colors.main,";\n\t\t\tdisplay: inline-block;\n\t\t\tposition: relative;\n\n\t\t\t&:hover {\n\t\t\t\t\t&:before {\n\t\t\t\t\t\t\topacity: 1\n\t\t\t\t\t}\n\t\t\t}\n\t\t\t&.h1 {\n\t\t\t\t\tfont-size: ").concat(Object(K.a)(4),"px;\n\t\t\t\t\tfont-weight: bold;\n\t\t\t\t\tborder-bottom: ").concat(d.a.colors.main," 2px solid;\n\t\t\t\t\tmargin-bottom: 3px;\n\t\t\t}\n\t\t\t&.h2 {\n\t\t\t\t\tfont-size: ").concat(Object(K.a)(3),"px;\n\t\t\t\t\t// text-decoration: underline;\n\t\t\t\t\tborder-bottom: ").concat(d.a.colors.main," 1px solid;\n\t\t\t\t\tpadding-bottom: 1px;\n\t\n\t\t\t}\n\t\t\t&.h3 {\n\t\t\t\t\tfont-size: ").concat(Object(K.a)(2),"px;\n\t\t\t}\n\t\t\t&.h4 {\n\t\t\t\t\tfont-size: ").concat(Object(K.a)(1),"px;\n\t\t\t}\n\t\n\t}\n\t\n\t\n\t.cm-matchingBracket {\n\t\t\tbackground-color: rgba(0,0,0,0)!important;\n\t}\n\t\n\t\n\t.cm-content {\n\t\t\t// font-family: 'Open sans', sans-serif;\n\t\t\tfont-family: ").concat(d.a.font.editor,";\n\t\t\tfont-size:").concat(Object(K.a)(1),"px;\n\t}\n\t\n\t.cm-foldPlaceholder {\n\t\t\tmargin-left: 8px;\n\t\t\topacity: 0.5;\n\t\t\tpadding: 2px 5px;\n\t\t\tborder: none;\n\t}\n\t.cm-foldGutter {\n\t\t\t&::before {\n\t\n\t\t\t}\n\t}\n\t\n\t.cm-focused {\n\t\t\toutline: none!important;\n\t}\n\t.main-editor-wrapper {\n\t\t\tpadding: 0px;\n\t\t\twidth:100%;\n\t\t\theight: ").concat(Object(f.c)("desktop")?"calc(100% - 32px);":"calc(100% - 210px);",'; \n\t}\n\t\n\t.codemirror-editor-wrapper {\n\t\t\t// margin-right: 18px;\n\t\t\t// width: calc(100% - 10px);\n\t\t\tposition: relative;\n\t\t\t// left: -10px;\n\t}\n\t.codemirror-editor-wrapper, .cm-editor, .cm-theme {\n\t\t\t// height: calc(100% - 30px);\n\t}\n\t.codemirror-editor-wrapper, \t.cm-editor, .cm-theme {\n\t\t\theight: 100% ;\n\t\t\toverflow:hidden;\n\t\t\tpadding: 0px;\n\t}\n\t.cm-editor {\n\t\t\tword-break: break-word;\n\t}\n\t \n\t.cm-scroller {\n\t\t\tz-index: auto!important;\n\t\t\twidth: calc(100% - 30px);\n\t\t\twidth: calc(100% - 23px); // reduce width overall CM\n\t\t\tpadding-right: 35px; // make scrollbar disappear\n\t\t\tpadding-left: 5px; // some space for the gutter\n\t\t\t.cm-content {\n\t\t\twidth: calc(100% - 10px); // needed otherwise x scroll\n\t\t\toverflow:hidden;\n\t\t\twhite-space: pre-wrap;\n\t\t}\xa0\n\t}\n\t.cm-line {\n\t}\n\t.cm-cursor {\n\t}\n\t\n\t.cm-tooltip-autocomplete {\n\t\t\t// transform: translate(-50%,-50%);\n\t\t\tpadding: 10px 5px;\n\t\t\tbackground: white;\n\t\t\tborder-radius: 5px;\n\t\t\tborder: none;\n\t\t\tbox-shadow: 0px 0px 5px rgba(0,0,0,0.3);\n\t\t\t[aria-selected="true"]{\n\t\t\t\t\tbackground: ').concat(d.a.colors.main,";\n\t\t\t\t\tborder-radius: 2px;\n\t\t\t}\n\t\n\t}\n\t\n\t.codemirror-mobile-fallback {\n\t\t\tmargin: 10px;\n\t\t\tp {\n\t\t\t\t\tcolor:grey;\n\t\t\t\t\tfont-size: ").concat(Object(K.a)(),'px;\n\t\t\t}\n\t\t\ttextarea {\n\t\t\t\t\twidth: calc(100% - 20px);\n\t\t\t\t\theight: calc(100vh - 230px);\n\t\t\t\t\tborder: 0px;\n\t\t\t}\n\t}\n\t\n\t.test-success {\n\t\t\t// background: orange;\n\t\t\tcolor: red;\n\t\t\tdisplay: block;\n\t\t\tpadding-top: 50px;\n\t}\n\t.tiro-image {\n\t\t\tcolor: red;\n\t\t\tdisplay: block;\n\t\t\tpadding: 20px;\n\t}\n\t.tiro-image-wrapper{\n\t\t\tposition: relative;\n\t\n\t\t\t&:before {\n\t\t\t\t\tposition: absolute;\n\t\t\t\t\ttop: 0px;\n\t\t\t\t\tleft: 50%;\n\t\t\t\t\tcontent: "x";\n\t\t\t\t\twidth: 50%;\n\t\t\t\t\theight: 100px;\n\t\t\t\t\tdisplay:block;\n\t\t\t\t\t// background: orange;\n\t\n\t\t\t}\n\t}\n\t\n\t// ').concat(Object(C.d)(),"\n\t\n\t// // FILE RESSOURCE PREVIEW\n\t// ").concat(Object(E.b)(),"\n\t\n\t// // PREVIEW LINK\n\t// ").concat(Object(I.b)(),"\n\t\n\t\n\t// ").concat(Object(M.e)(),"\n\t")}},99:function(t,e,n){"use strict";n.d(e,"a",(function(){return o})),n.d(e,"b",(function(){return i}));var o=function(t){var e,n="; ".concat(document.cookie).split("; ".concat(t,"="));return 2===n.length?null===(e=n.pop())||void 0===e?void 0:e.split(";").shift():void 0},i=function(t,e,n){var o=new Date;-1===n&&(n=864e3),o.setTime(o.getTime()+60*n*60*1e3);var i="expires="+o.toUTCString();document.cookie=t+"="+e+";"+i+";path=/"}}},[[606,11,12]]]);
|