tiro-notes 0.43.41 → 0.43.44
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
(this["webpackJsonptiro-notes-client"]=this["webpackJsonptiro-notes-client"]||[]).push([[10],{10:function(t,n,e){"use strict";e.d(n,"a",(function(){return w}));e(429),e(430),e(431),e(432);var o=e.p+"static/media/deco-bg-map.7ca9103b.png",i=e.p+"static/media/file-solid.6415173e.svg",c=e.p+"static/media/compact-disc-solid.55b6e50c.svg",a=e.p+"static/media/file-pdf-solid.0a9d75fe.svg",r=e.p+"static/media/file-word-solid.9228e1ff.svg",l=e.p+"static/media/file-code-solid.62b467ac.svg",s=e.p+"static/media/book-solid.87f5b737.svg",u=e.p+"static/media/file-excel-solid.217d73db.svg",d=e.p+"static/media/file-video-solid.312288cf.svg",p=e.p+"static/media/file-audio-solid.a76f99f0.svg",f=e.p+"static/media/file-zipper-solid.7db57917.svg",b=e.p+"static/media/file-powerpoint-solid.4d969453.svg",g=e.p+"static/media/link-solid.7b689dbd.svg",h=e.p+"static/media/globe-africa-solid.0ad34146.svg",m=e.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"}}},103:function(t,n,e){"use strict";e.d(n,"b",(function(){return l})),e.d(n,"a",(function(){return p})),e.d(n,"e",(function(){return f})),e.d(n,"d",(function(){return b})),e.d(n,"c",(function(){return h}));var o=e(111),i=e(26),c=e(17),a=null,r=null,l=!1,s="[LATEX]",u=c.a.client.log.verbose,d=function(t,n){var e=document.createElement("script");e.src=t,e.crossorigin="anonymous",document.body.appendChild(e),e.onload=function(){n()}},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 n=document.createElement("link");n.type="text/css",n.rel="stylesheet",n.href=t,document.body.appendChild(n)}("https://cdn.jsdelivr.net/npm/katex@0.15.2/dist/katex.css")},f=function(t){var n=t=t.replaceAll("$","");if(!a)return n;try{window.ka=a,n=a.renderToString(t)}catch(e){u&&console.log("LATEX ERR:",e)}return n},b=Object(o.a)((function(){u&&console.log(s,"REFRESH"),g(".render-latex")}),100),g=function(t){if(r){var n=document.querySelectorAll(t);if(!n)return console.warn(s,"no el found :",t);u&&console.log(s,n),Object(i.a)(n,(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"}},106:function(t,n,e){"use strict";e.d(n,"b",(function(){return j})),e.d(n,"a",(function(){return y})),e.d(n,"c",(function(){return k}));var o=e(4),i=e(0),c=e(61),a=e(20),r=e(53),l=e(67),s=e(9),u=e(59),d=e(38),p=e(64),f=e(10),b=e(56),g=e(18),h=e(28),m=e(30),v=e(12),w=e(25),O=e(1),j=function(t){var n=localStorage.getItem("settings-".concat(t))||"";return Object(b.a)(n,[['"',""]])},x=function(t){return"<br/> <br/> Default value: ".concat(h.a[t].toString().replaceAll("\n","<br/>"))},y=function(t){var n="<br/> Requires interface reload",e=Object(c.a)("settings-backend-port",-1),f=Object(o.a)(e,2),b=f[0],v=f[1],w=Object(c.a)("settings-backend-protocol","same"),j=Object(o.a)(w,2),y=(j[0],j[1],Object(i.useContext)(s.a)),k=a.a.settingsPopup,_=[];if(y){var C=y.userSettings,E="".concat(window.location.protocol,"//"),S="".concat(E).concat(y.status.ipsServer.getLocal()).concat(p.a.global.port);"https://api.qrserver.com/v1/create-qr-code/?size=400x400&margin=50&data=".concat(S);_=[{title:"Privacy",fields:[{type:"checkbox",title:"Disable notification popups",expl:"Force notification popups to not appear on the interface"+n,var:C.get("view_disable_notification_popups"),modifier:function(t){L(!0),C.set("view_disable_notification_popups",t)}},{type:"checkbox",title:"Work mode ",expl:"Only displays notifications and omnibar history items related to your work",var:C.get("privacy_work_mode_enable"),modifier:function(t){L(!0),C.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(x("privacy_work_mode_filters")),var:C.get("privacy_work_mode_filters"),modifier:function(t){C.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:C.get("server_activity_logging_enable"),modifier:function(t){C.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:C.get("plugins_marketplace_url"),modifier:function(t){C.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:function(){},onCustomHtmlClick:function(){Object(m.b)("cache","clean_cache")}}]},{title:"layout",fields:[{type:"text",title:"Main color",expl:"A color string like 'orange' or 'blue' or an Hex string like '#E86666' (tiro red) or '#729fc4'",var:C.get("ui_layout_colors_main"),modifier:function(t){C.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:C.get("ui_layout_colors_main_font"),modifier:function(t){C.set("ui_layout_colors_main_font",t)}},{type:"number",title:"Font size (desktop)",expl:"General font size for desktop"+x("ui_layout_general_font_size")+n,var:C.get("ui_layout_general_font_size"),modifier:function(t){C.set("ui_layout_general_font_size",t),L(!0)}},{type:"text",title:"Font family for interface",expl:"Font family for interface"+x("ui_layout_font_family_interface")+n,var:C.get("ui_layout_font_family_interface"),modifier:function(t){C.set("ui_layout_font_family_interface",t),L(!0)}},{type:"text",title:"Font family for editor",expl:"Font family for editor"+x("ui_layout_font_family_editor")+n,var:C.get("ui_layout_font_family_editor"),modifier:function(t){C.set("ui_layout_font_family_editor",t),L(!0)}},{type:"checkbox",title:"Enable Background Image",expl:"Enable Background Image"+n,var:C.get("ui_layout_background_image_enable"),modifier:function(t){C.set("ui_layout_background_image_enable",t),L(!0)}},{type:"checkbox",title:"Enable Background Video",expl:"Enable Background Video"+n,var:C.get("ui_layout_background_video_enable"),modifier:function(t){C.set("ui_layout_background_video_enable",t),L(!0)}},{type:"text",title:"Background image/video url",expl:"Background image/video url.<br>- it can start with http. <br> - 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 <br>(ex: 'static/_new/useful/.resources/wintersolstice.jpg'). <br> - you can add a youtube video/webcam stream in background by using the embed url like 'https://www.youtube-nocookie.com/embed/dQw4w9WgXcQ' or 'https://www.skaping.com/batz-sur-mer/plage-valentin' or even websites",var:C.get("ui_layout_background_image"),modifier:function(t){C.set("ui_layout_background_image",t),L(!0)}},{type:"number",title:"Windows opacity",expl:"If Background image, how opaque should the windows be (between 0 and 100)"+x("ui_layout_background_image_window_opacity")+n,var:C.get("ui_layout_background_image_window_opacity"),max:100,min:0,modifier:function(t){C.set("ui_layout_background_image_window_opacity",t),L(!0)}},{type:"number",title:"Active Windows opacity",expl:"If Background image, how opaque should the active windows be (between 0 and 100)"+x("ui_layout_background_image_window_opacity_active")+n,var:C.get("ui_layout_background_image_window_opacity_active"),max:100,min:0,modifier:function(t){C.set("ui_layout_background_image_window_opacity_active",t),L(!0)}},{type:"number",title:"background video width",expl:"background video width in percent (between 0 and 200)"+x("ui_layout_background_video_width")+n,var:C.get("ui_layout_background_video_width"),max:200,min:0,modifier:function(t){C.set("ui_layout_background_video_width",t),L(!0)}},{type:"number",title:"background video height",expl:"background video height percent (between 0 and 200)"+x("ui_layout_background_video_height")+n,var:C.get("ui_layout_background_video_height"),max:200,min:0,modifier:function(t){C.set("ui_layout_background_video_height",t),L(!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:C.get("ui_layout_shortcuts_panel"),modifier:function(t){C.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:C.get("tts_custom_engine_enabled"),modifier:function(t){C.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}}.\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:C.get("tts_custom_engine_command"),modifier:function(t){C.set("tts_custom_engine_command",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:C.get("tts_sentences_per_part"),modifier:function(t){C.set("tts_sentences_per_part",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:C.get("tts_preload_parts"),modifier:function(t){C.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:C.get("tts_price_per_word"),modifier:function(t){C.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"+n,var:C.get("ui_editor_ai_text_selection"),modifier:function(t){L(!0),C.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:C.get("ui_editor_ai_command"),modifier:function(t){C.set("ui_editor_ai_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"+n,var:C.get("ui_editor_inline_suggestion"),modifier:function(t){L(!0),C.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"+n,var:C.get("ui_editor_search_highlight_enable"),modifier:function(t){L(!0),C.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:C.get("ui_editor_search_highlight_url"),modifier:function(t){C.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"+n,var:C.get("ui_editor_synced_title_scrolling"),modifier:function(t){L(!0),C.set("ui_editor_synced_title_scrolling",t)}},{type:"checkbox",title:"Markdown Tags",expl:"Displays #tag as clickable tag you can interact with "+n,var:C.get("ui_editor_markdown_tags"),modifier:function(t){L(!0),C.set("ui_editor_markdown_tags",t)}},{type:"checkbox",title:"Markdown Preview",expl:"Markdown preview "+n,var:C.get("ui_editor_markdown_preview"),modifier:function(t){L(!0),C.set("ui_editor_markdown_preview",t)}},{type:"checkbox",title:"Enhanced Markdown Preview",expl:"Enhanced Markdown Preview for files, documents, date etc"+n,var:C.get("ui_editor_markdown_enhanced_preview"),modifier:function(t){L(!0),C.set("ui_editor_markdown_enhanced_preview",t)}},{type:"checkbox",title:"Enhanced Markdown Syntax",expl:"Enhance Markdown Syntax (**bold**, ~~text~~, and other)",var:C.get("ui_editor_markdown_syntax"),modifier:function(t){L(!0),C.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."+n,var:C.get("ui_editor_markdown_table_preview"),modifier:function(t){L(!0),C.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."+n,var:C.get("ui_editor_links_as_button"),modifier:function(t){L(!0),C.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_$"+n,var:C.get("ui_editor_markdown_latex_preview"),modifier:function(t){L(!0),C.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>"+n,var:C.get("ui_editor_spellcheck"),modifier:function(t){L(!0),C.set("ui_editor_spellcheck",t)}},{type:"checkbox",title:"Image title",expl:"Show image title on interface and exports"+n,var:C.get("ui_editor_show_image_title"),modifier:function(t){L(!0),C.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"+n,var:C.get("ui_editor_live_watch"),modifier:function(t){L(!0),C.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:C.get("keyboard_shortcuts_textarea"),modifier:function(t){C.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(x("export_pandoc_cli_options")),var:C.get("export_pandoc_cli_options"),modifier:function(t){C.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:function(){},onCustomHtmlClick:function(){}}]},{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:C.get("users_viewer_user_enable"),modifier:function(t){C.set("users_viewer_user_enable",t,{writeInSetupJson:!0})}},{type:"text",title:"Viewer user password",expl:'Define the "viewer" user password',var:C.get("users_viewer_user_password"),modifier:function(t){C.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:C.get("demo_mode_enable"),modifier:function(t){C.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:function(){},onCustomHtmlClick:function(){Object(g.a)(),t.onClose(),Object(s.d)((function(t){t.folders.get(["/"],(function(){}))}))}}]},{title:"Advanced",fields:[{type:"text",var:b,title:k.backend.port,expl:k.backend.portExpl,modifier:v},{type:"textarea",title:"Options for Image compression",expl:"Modify default image compression settings ".concat(x("advanced_image_compression_settings")),var:C.get("advanced_image_compression_settings"),modifier:function(t){C.set("advanced_image_compression_settings",t)}}]},{title:"Beta",fields:[{type:"checkbox",title:"Plugins Marketplace",expl:"Enable the plugin marketplace system",var:C.get("beta_plugins_marketplace"),modifier:function(t){C.set("beta_plugins_marketplace",t)}}]}]}var T=Object(u.a)("config-panels-opened",[],{editIfNotLoaded:!0}),I=Object(o.a)(T,3),P=I[0],N=I[1],A=(I[2],Object(i.useState)(!1)),R=Object(o.a)(A,2),F=R[0],L=R[1];return Object(O.c)("div",{className:"settings-popup-wrapper"},Object(O.c)(r.a,{title:"".concat(k.title),onClose:function(){t.onClose()}},_.map((function(t,n){return Object(O.c)("div",{className:"settings-panel"},Object(O.c)("h3",{onClick:function(){!function(t){var n=Object(d.a)(P);n[t]=!n[t],N(n)}(n)}},Object(O.c)("div",{className:"arrow"},P[n]?"\u25bc":"\u25ba"),t.title),Object(O.c)("div",{className:"fields-wrapper ".concat(P[n]?"active":"")},t.fields.map((function(t){return Object(O.c)("div",{className:"field-wrapper"},Object(O.c)("div",{className:"input-and-html-wrapper"},"none"===t.type&&Object(O.c)("span",null,t.title),"none"!==t.type&&Object(O.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:function(n){"checkbox"!==t.type&&t.modifier(n)},onCheckedChange:function(n){"checkbox"===t.type&&t.modifier(n)}}),t.customHtml&&Object(O.c)("div",{className:"custom-html-wrapper",onClick:function(n){t.onCustomHtmlClick&&t.onCustomHtmlClick()},dangerouslySetInnerHTML:{__html:t.customHtml}}),Object(O.c)("div",{className:"explanation",dangerouslySetInnerHTML:{__html:t.expl||"woop"}})))}))))})),F&&Object(O.c)("button",{className:"submit-button reload-btn",onClick:function(t){window.location.reload()}},"Reload App")))},k=function(){return"\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")}},108:function(t,n,e){"use strict";e.d(n,"c",(function(){return c})),e.d(n,"a",(function(){return a})),e.d(n,"b",(function(){return r})),e.d(n,"d",(function(){return u}));var o=e(175),i=e.n(o),c=function(t,n){var e=i.a.generateRSAKey(n,1024),o=i.a.publicKeyString(e);return i.a.encrypt(t,o)},a=function(t,n){var e=i.a.generateRSAKey(n,1024);return i.a.decrypt(t,e)},r={encryptText:c,decryptText:a,encryptUrlParam:function(t,n){var e=c(t,n);return e.cipher&&(e.cipher=encodeURIComponent(e.cipher)),e},decryptUrlParam:function(t,n){return t=decodeURIComponent(t),a(t,n)}},l=function(t,n){var e=n.replace(t,"").length,o=n.length;return Math.round(e/o*100)/100},s=function(t){return t>0&&t<=.9},u=function(t){var n=!1,e={nb:l(/[^0-9]/g,t),up:l(/[^A-Z]/g,t),low:l(/[^a-z]/g,t),spe:l(/[^\/\=\?\+]/g,t)},o=s(e.nb)&&s(e.up)&&s(e.low)&&e.spe>0,i=(t.trim().endsWith("==")||t.trim().endsWith("="),/^[a-zA-Z0-9\/\=\?\+]+$/.test(t)),c=t.length>100;return i&&o&&c&&(n=!0),n}},117:function(t,n,e){"use strict";e.d(n,"c",(function(){return g})),e.d(n,"a",(function(){return m})),e.d(n,"b",(function(){return v}));var o=e(29),i=e(43),c=e(45),a=e(18),r=e(26),l=e(9),s=e(33),u=e(212),d=e(27),p=e(28),f=e(46),b=function(t){if(t){var n=t.dataset.filePath,e=t.dataset.src;Object(l.d)((function(t){t.file.getContent(n,(function(o){var i=Object(u.a)(o,Object(d.e)(n));if(!(i.length<1)){var c=[],a=0;Object(r.a)(i,(function(t,n){Object(f.b)(e).includes(Object(f.b)(t.url))&&(a=n),c.push(t.url)})),t.ui.lightbox.open(a,c)}}))}))}},g=function(t,n){return Object(c.a)({file:t,windowId:n,pattern:o.a.image2,replacement:function(n){var e=n.matchs,o=document.createElement("div");return o.innerHTML=h(e[0],e[2],e[1],e[5],t),o}})},h=function(t,n,e,o,c){"image"!==e&&(e='<div class="mdpreview-source">'.concat(e,"</div>")),p.d.curr.ui_editor_show_image_title||(e="");var r=n.startsWith("http")?n:"".concat(Object(i.a)(c.folder),"/").concat(n).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(e)},m=function(t,n,e){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=n.startsWith("http")?n:"".concat(Object(i.a)(e.folder),"/").concat(n).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(e.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"}},12:function(t,n,e){"use strict";e.d(n,"e",(function(){return o})),e.d(n,"c",(function(){return i})),e.d(n,"b",(function(){return c})),e.d(n,"d",(function(){return a})),e.d(n,"a",(function(){return r}));var o=function(){var t,n=!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)))&&(n=!0),n},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,n="desktop";return l()||t<1e3&&(n="tablet"),t<500&&(n="mobile"),n},l=function(){return!s()},s=function(){var t,n=!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)))&&(n=!0),n}},122:function(t,n,e){"use strict";e.d(n,"b",(function(){return f})),e.d(n,"a",(function(){return g})),e.d(n,"c",(function(){return v})),e.d(n,"d",(function(){return w}));var o=e(3),i=e(6),c=e(7),a=e(21),r=e(22),l=e(13),s=e(8),u=e(5),d=e(103),p=e(117),f={LatexMdEl:u.a.define()},b={resolve:"LatexMdEl"},g={defineNodes:["LatexMdEl"],parseInline:[{name:"MdCustomTagsParser",parse:function(t,n,e){return 36===n?t.addDelimiter(b,e,e+1,!0,!0):-1},after:"Emphasis"}],props:[Object(u.c)({LatexMdEl:f.LatexMdEl})]},h=function(t){Object(a.a)(e,t);var n=Object(r.a)(e);function e(t){var o;return Object(i.a)(this,e),(o=n.call(this)).str=t,o}return Object(c.a)(e,[{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 n=Object(d.e)(this.str);return t.innerHTML=' <div class="latex-height" >'.concat(n,"</div> "),t}}]),e}(l.g);function m(t,n){var e,i=[],c=Object(o.a)(t.visibleRanges);try{for(c.s();!(e=c.n()).done;){var a=e.value,r=a.from,u=a.to;Object(s.F)(t.state).iterate({from:r,to:u,enter:function(n){if("LatexMdEl"===n.name){var e=t.state.doc.sliceString(n.from,n.to),o=l.a.widget({widget:new h(e),side:1});i.push(o.range(n.from))}}})}}catch(d){c.e(d)}finally{c.f()}return l.a.set(i)}var v=function(t){return l.f.fromClass(function(){function n(e){Object(i.a)(this,n),this.decorations=void 0,this.decorations=m(e,t.file)}return Object(c.a)(n,[{key:"update",value:function(n){(n.docChanged||n.viewportChanged)&&(this.decorations=m(n.view,t.file))}}]),n}(),{decorations:function(t){return t.decorations},eventHandlers:{mousedown:function(n,e){var o=n.target,i=e.posAtCoords({x:n.clientX,y:n.clientY});if(i){var c=e.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 ")}},124:function(t,n,e){"use strict";e.d(n,"c",(function(){return j})),e.d(n,"a",(function(){return y})),e.d(n,"b",(function(){return k})),e.d(n,"d",(function(){return _}));var o=e(4),i=e(0),c=e.n(i),a=e(38),r=e(673),l=e(26),s=e(373),u=e.n(s),d=(e(543),e(544),e(217)),p=e(161),f=e(219),b=e(140),g=e(10),h=e(47),m=e(9),v=e(12),w=e(86),O=e(1),j={rows:2,cols:4},x={m:10,rows:j.rows,cols:j.cols,decalBottom:10},y=function(t){var n=Object(i.useState)([]),e=Object(o.a)(n,2),s=e[0],g=e[1],y=function(t){g(t),k.current=t},k=Object(i.useRef)([]),_=Object(i.useState)([]),C=Object(o.a)(_,2),E=C[0],S=C[1],T=Object(i.useRef)();Object(i.useEffect)((function(){t.grid&&t.grid.layout&&(S(t.grid.layout),y(t.grid.content))}),[t.refresh]),Object(i.useEffect)((function(){W(),L()}),[E]);var I=function(n,e){t.onGridUpdate({layout:n,content:e})},P=function(){var t=s[0].file;if(t){var n=function(t){for(var n=[],e=j,o=function(o){for(var i=[],c=function(n){var e=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===n&&r===o&&(e=1)}})),i.push(e)},a=0;a<e.cols;a++)c(a);n.push(i)},i=0;i<e.rows;i++)o(i);for(var c=[-1,-1],a=[-1,-1],r=0;r<e.rows;r++)for(var s=0;s<e.cols;s++)0===n[r][s]&&-1===c[0]&&-1===c[1]&&(c[0]=s,c[1]=r),0===n[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}}(E),e=Object(p.a)({file:t,w:n.w,h:n.h,x:n.x,y:n.y}),o=Object(a.a)(E);o.push(e.layout),V(o)&&(S(o),setTimeout((function(){var t=Object(a.a)(s);t.push(e.content);var n=U(e.content.i,t);y(n),I(o,n)})),I(o,s))}},N=Object(i.useState)(!1),A=Object(o.a)(N,2),R=A[0],F=A[1],L=function(){F(E.length>1)},M=Object(i.useState)(!1),D=Object(o.a)(M,2),z=D[0],B=D[1],W=function(){var t=0,n=x.cols*x.rows;Object(l.a)(E,(function(n){t+=n.w*n.h})),B(t!==n)},U=function(t,n){var e=Object(a.a)(n);return Object(l.a)(e,(function(n){n.active=n.i===t})),e},H=function(t,n){Object(m.d)((function(n){n.tabs.updateTab("activateTabWindow","activeTab",t)}))},q=function(t){T.current=Object(a.a)(t)},V=function(t){for(var n=!0,e=0;e<t.length;e++){var o=t[e];o.y>1&&(n=!1),o.h>1&&o.y>0&&(n=!1)}return n};Object(f.b)(),Object(i.useEffect)((function(){var t=J.current;if(t)return t.addEventListener("resize",(function(){})),function(){t.removeEventListener("resize",(function(){}))}}),[]);var J=Object(i.useRef)(null),G={width:300,height:300};J.current&&(G.width=J.current.clientWidth,G.height=J.current.clientHeight-x.decalBottom);Object(i.useContext)(m.a);var K=function(n,e){return function(o,i){if("windowActiveStatus"===o)n&&!n.active&&H(n.i,n.file);else if("windowViewChange"===o){var c;if(null===i||void 0===i||!i.view||!t.grid.content[e].file)return;!function(t,n){var e=Object(a.a)(s);e[n].view=t,y(e),I(E,e)}(null===i||void 0===i?void 0:i.view,e);var r=(null===(c=t.grid.content[e].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,n,e){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(){P()}},{icon:"faPlus",title:"Delete Window",class:"delete-button",action:function(){!function(t){var n=Object(r.a)(Object(a.a)(E),(function(n){return n.i!==t}));setTimeout((function(){var e=Object(r.a)(Object(a.a)(s),(function(n){return n.i!==t}));y(e),I(n,e)})),I(n,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:J},"mobile"!==Object(v.a)()&&Object(O.c)(u.a,{className:"draggable-grid",autoSize:!1,layout:E,onLayoutChange:function(t){var n=Object(a.a)(t);if(V(n)){var e=n;q(e),S(e),I(e,s)}else{if(!T.current)return;var o=function(t){var n=t,e=j,o=null;console.log("0035",n),(2===n.length&&(n[0].w===e.cols-1&&n[0].h===e.rows&&n[1].w===e.cols/2&&n[1].h===e.rows||n[1].w===e.cols-1&&n[1].h===e.rows&&n[0].w===e.cols/2&&n[0].h===e.rows)||2===n.length&&(n[0].w===e.cols-1&&n[0].h===e.rows&&n[1].w===e.cols/2&&n[1].h===e.rows||n[1].w===e.cols-1&&n[1].h===e.rows&&n[0].w===e.cols/2&&n[0].h===e.rows))&&(console.log("[ALT LAYOUT] 0035 found i|iii to ii|ii"),o=Object(a.a)(t),Object(l.a)(o,(function(t,n){t.w=e.cols/2,t.y=0,1===n&&(t.x=e.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)})),S(c),I(c,s)}},cols:x.cols,compactType:"horizontal",useCSSTransforms:!1,rowHeight:G.height/x.rows-x.m*(x.rows+1),draggableHandle:".drag-handle",width:G.width,margin:[x.m,x.m]},E.map((function(n,e){return Object(O.c)("div",{key:n.i,className:" ".concat(s[e]&&s[e].active?"active":""," window-wrapper "),onClick:function(){s[e]&&!s[e].active&&H(s[e].i,s[e].file)},onMouseEnter:function(){}},Y(n,0,t.grid.content[e]),Object(O.c)("div",{className:"window-editor-wrapper-wrapper"},Object(O.c)(b.a,{noteParentType:"grid",content:t.grid.content[e]&&t.grid.content[e],onLayoutUpdate:K(n,e),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")},_=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")}},127:function(t,n,e){"use strict";e.d(n,"d",(function(){return h})),e.d(n,"c",(function(){return m})),e.d(n,"b",(function(){return w})),e.d(n,"a",(function(){return O}));var o=e(15),i=e(11),c=e(4),a=e(0),r=e.n(a),l=e(59),s=e(91),u=e(38),d=e(286),p=e(12),f=e(27),b=e(35),g=e(86),h=function(){return window.innerWidth},m=function(){return window.innerHeight-35},v=1e3,w=function(t){var n=Object(l.a)("floatingPanelsConfig3",[],{history:!1,onInitialRefresh:function(t){x.current=t,"mobile"===Object(p.a)()&&(x.current=x.current.filter((function(t){return"mobile"!==t.device}))),y(x.current)},debouncedSave:5e3}),e=Object(c.a)(n,3),w=e[0],O=e[1],j=e[2],x=r.a.useRef([]),y=function(t){x.current=t,O(t)};Object(a.useEffect)((function(){x.current=w}),[w]);var k=function(t,n){var e,o,i=Object(p.e)()?2:30,c=Object(p.e)()?2:15,a=window.innerWidth-c-4,r=window.innerHeight-4-i;switch(n){case"full-center":case"full":e=c,o=2;break;case"half-right":case"right":e=window.innerWidth/2+c/2,o=2,a/=2;break;case"half-left":case"left":e=c,o=2,a/=2;break;case"full-bottom":case"bottom":e=c,o=window.innerHeight/2-i/2,r/=2;break;case"full-top":case"top":e=c,o=2,r/=2;break;case"bottom-left":e=c,o=window.innerHeight/2-i/2,a/=2,r/=2;break;case"bottom-right":e=window.innerWidth/2+c/2,o=window.innerHeight/2-i/2,a/=2,r/=2;break;case"top-left":e=c,o=2,a/=2,r/=2;break;case"top-right":e=window.innerWidth/2+c/2,o=2,a/=2,r/=2}return t.position={x:e,y:o},t.size={width:a,height:r},t},_=function(t){var n=x.current.find((function(n){var e;return n.file.path===(null===t||void 0===t||null===(e=t.file)||void 0===e?void 0:e.path)&&"visible"!==n.status}));if(n)P(n.id);else{var e=x.current.filter((function(t){return!t.status.includes("hidden")})),o="mobile"===Object(p.a)()?10:100,c=window.innerWidth/2-o;"mobile"===Object(p.a)()&&(c=window.innerWidth-2*o);var a=window.innerHeight/1.2-o;t.id&&(t.id=Object(p.a)()+"-"+t.id);var r=Object(i.a)({position:{x:o+20*e.length,y:o+20*e.length},size:{width:c,height:a},status:"visible",file:Object(s.a)(),view:"editor",id:Math.random().toString(36).substring(7),zIndex:v,device:Object(p.a)(),orderPosition:e.length},t);if(t.layout){var l=k(r,t.layout);r.position=l.position,r.size=l.size}var u=function(t){console.log("".concat("[FLOATING PANELS]"," createPanel"),t);var n=x.current.find((function(n){return n.id===t.id}));n&&(t.position=n.position,t.size=n.size,E(t.id));var e=x.current.filter((function(n){return n.id!==t.id}));e.push(t),y(e),F(t.id,"first"),T(t.id)};t.file&&!t.view?Object(g.a)(t.file.path).then((function(t){t&&(r.view=t),u(r)})):u(r)}},C=function(t){var n=x.current.map((function(n){return n.id===t.id?t:n}));y(n)},E=function(t){var n=x.current.filter((function(n){return n.id!==t}));n=S(n),y(n)},S=function(t){var n=t.filter((function(t){return"visible"===t.status})),e=Math.max.apply(Math,Object(o.a)(n.map((function(t){return t.zIndex||0})))),i=n.find((function(t){return t.zIndex===e}));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},T=function(t){var n=Math.max.apply(Math,Object(o.a)(x.current.map((function(t){return t.zIndex||0})))),e=x.current.findIndex((function(n){return n.id===t}));if(-1!==e){var i=Object(u.a)(x.current)[e];i.zIndex=n+1;var c=Object(u.a)(x.current);if(c.forEach((function(t){t.isTopWindow=!1})),i.zIndex=n+1,i.isTopWindow=!0,c[e]=i,y(c),n>v+2*x.current.length){var a=Object(u.a)(x.current);a.forEach((function(t){t.zIndex=t.zIndex-x.current.length})),y(a)}}},I=function(t){y(Object(u.a)(t))},P=function(t){if(!t){var n=x.current.filter((function(t){return"visible"!==t.status})),e=n.find((function(t){return t.orderPosition===Math.min.apply(Math,Object(o.a)(n.map((function(t){return t.orderPosition||0}))))}));if(!e)return;t=e.id}var i=x.current.find((function(n){return n.id===t}));i&&(i.status="visible",C(i),T(i.id),F(i.id,"first"),M(i.id))},N=function(t){var n=Object(u.a)(x.current);n.find((function(n){return n.id===t})).status="minimized";n.find((function(n){return n.id===t}));n=S(n),y(n)},A=function(){var t=Object(u.a)(x.current),n=0;t.forEach((function(t){"visible"===t.status&&(t.zIndex=v+n,t.position={x:100+20*n,y:100+20*n},t.size={width:320,height:200},n++)})),I(t)},R=r.a.useRef("grid"),F=function(t,n){var e=Object(u.a)(x.current.find((function(n){return n.id===t})));if(e){if("last"===n){var i=Math.max.apply(Math,Object(o.a)(x.current.map((function(t){return t.orderPosition||0}))));n=i+1}if("first"===n){var c=Math.min.apply(Math,Object(o.a)(x.current.map((function(t){return t.orderPosition||0}))));n=c-1}e.orderPosition=n,C(e)}},L=function(t,n){var e=n||{},o=e.idpanel,i=e.layout,c=e.searchedString,a=e.replacementString;o||(o=Math.random().toString(36).substring(7)),o&&(o=Object(p.a)()+"-"+o);var r=Object(u.a)(x.current.find((function(t){return t.id===o})));if(r)null!==n&&void 0!==n&&n.noteView&&(r.view=n.noteView),null!==n&&void 0!==n&&n.view&&(r.view=n.view),"minimized"===r.status&&(r.status="visible"),"hidden"===r.status&&(r.status="visible"),r.file=Object(f.e)(t),c&&(r.searchedString=c),a&&(r.replacementString=a),C(r),T(null===r||void 0===r?void 0:r.id);else{var l={id:o,type:"file",file:Object(f.e)(t)};i&&(l.layout=i),c&&(l.searchedString=c),a&&(l.replacementString=a),null!==n&&void 0!==n&&n.noteView&&(l.view=n.noteView),null!==n&&void 0!==n&&n.view&&(l.view=n.view),_(l)}},M=function(t){var n=Object(u.a)(x.current.find((function(n){return n.id===t})));n&&(n.position.x+n.size.width>window.innerWidth&&(n.position.x=0,n.size.width>window.innerWidth&&(n.size.width=window.innerWidth-0)),n.position.y+n.size.height>window.innerHeight&&(n.position.y=0,n.size.height>window.innerHeight&&(n.size.height=window.innerHeight-0)),C(n))},D=function(){var t=x.current.filter((function(t){return"visible"===t.status})),n=t.find((function(n){return n.zIndex===Math.max.apply(Math,Object(o.a)(t.map((function(t){return t.zIndex||0}))))}));return n},z=function(t){var n=D();if(n){var e=n.opacity||1;n.opacity=e+t,n.opacity>1&&(n.opacity=1),n.opacity<0&&(n.opacity=0),C(n)}},B=function(t){var n=D();if(n){if(Object(d.a)(t))n.view=t;else{n.view=Object(g.c)(n.view);var e=n.file;Object(g.b)(null===e||void 0===e?void 0:e.path,n.view)}C(n)}},W=function(){z(.1)},U=function(){z(-.1)},H=function(){var t=D();if(t){var n=Object(u.a)(t.file),e=Object(u.a)(t.ctagConfig);t.file=Object(f.e)(""),t.ctagConfig=void 0,C(t),setTimeout((function(){t.file=n,t.ctagConfig=e,C(t)}),100)}};Object(a.useEffect)((function(){var t=["alt + o","alt + shift + o","alt + shift > v","alt + shift > r"];return Object(b.a)(t[0],W),Object(b.a)(t[1],U),Object(b.a)(t[2],B),Object(b.a)(t[3],H),function(){Object(b.c)(t[0],W),Object(b.c)(t[1],U),Object(b.c)(t[2],B),Object(b.c)(t[3],H)}}));var q={create:_,openFile:L,update:C,toggleFile:function(t,n){var e=x.current.find((function(n){return n.file.path===t}));if(!e)return L(t,n);"visible"===e.status?N(e.id):P(e.id)},updateAll:I,delete:E,movePanel:function(t,n){C(Object(i.a)(Object(i.a)({},x.current.find((function(n){return n.id===t}))),{},{position:n}))},resizePanel:function(t,n){C(Object(i.a)(Object(i.a)({},x.current.find((function(n){return n.id===t}))),{},{size:n}))},updatePanelLayout:function(t,n){if("active"===t){var e=w.filter((function(t){return"visible"===t.status&&"mobile"!==t.device})),o=e.find((function(t){return t.isTopWindow}));if(!o)return;t=o.id}n||(n="full");var i=Object(u.a)(x.current.find((function(n){return n.id===t})));i&&(i=k(i,n),C(i))},minimizePanel:N,deminimizePanel:P,actionAll:function(t,n){if("organizeWindows"===t)return A();if("toggleWindowsLayout"===t)return function(t){var n=Object(u.a)(x.current),e=n.filter((function(t){return"visible"===t.status&&"mobile"!==t.device}));"current"===t&&(t=R.current);var o=["grid","horizontal","vertical","tiled"];if(R.current=t||o[(o.indexOf(R.current)+1)%o.length],"grid"===R.current){for(var i=Math.ceil(Math.sqrt(e.length)),c=Math.ceil(e.length/i),a=[],r=Object(p.e)()?2:15,l=(h()-r-2)/i,s=m()/c,d=0;d<c;d++)for(var f=0;f<i;f++)a.push({x:f*l+r,y:d*s+2});var b=0;n.forEach((function(t,n){"visible"===t.status&&"mobile"!==t.device&&(t.position=a[b],t.size={width:l,height:s},b++)})),I(n)}else if("horizontal"===R.current){var g=h()/e.length,v=0;n.forEach((function(t,n){"visible"===t.status&&"mobile"!==t.device&&(t.position={x:v*g,y:0},t.size={width:g,height:m()},v++)})),I(n)}else if("vertical"===R.current){var w=m()/e.length,O=0;n.forEach((function(t,n){"visible"===t.status&&"mobile"!==t.device&&(t.position={x:0,y:O*w},t.size={width:h(),height:w},O++)})),I(n)}else"tiled"===R.current&&A()}(null===n||void 0===n?void 0:n.layout);if("minimizeActive"===t)return function(){var t=D();t&&N(t.id)}();if("closeActive"===t)return function(){var t=D();t&&E(t.id)}();if("deminimizeFirst"===t)return P();var e=Object(u.a)(x.current);e.forEach((function(n){n.status="hide"===t?"visible":"minimized"})),I(e)},panels:w,refreshFromBackend:j,pushWindowOnTop:T,movePositioninArray:function(t,n){var e=Object(u.a)(x.current),o=e.findIndex((function(n){return n.id===t}));if(-1!==o){var i=e.splice(o,1)[0];"up"===n?e.splice(o-1,0,i):"down"===n?e.splice(o+1,0,i):"first"===n?e.splice(0,0,i):"last"===n&&e.push(i),I(e)}},updateOrderPosition:F,resizeWindowIfOutOfWindow:M};return q},O=function(t){var n=!1,e=t.filter((function(t){return"visible"===t.status&&"mobile"!==t.device}));return e.forEach((function(t,o){n||e.forEach((function(e,i){if(!n&&o!==i){var c=t.position.x,a=t.position.y,r=e.position.x,l=e.position.y,s=t.size.width,u=t.size.height,d=e.size.width,p=e.size.height;c+20<r+d&&c+s>r+20&&(a+20<l+p&&a+u>l+20)&&(n=!0)}}))})),n}},134:function(t,n,e){"use strict";e.d(n,"c",(function(){return r})),e.d(n,"b",(function(){return l})),e.d(n,"a",(function(){return s}));var o=e(15),i=e(369),c=e(37),a=e(246),r=function(t,n){var e="render-react-wrapper-".concat(Object(c.a)()),o=function(){var n=l(t),o=setInterval((function(){var t=document.getElementById(e);t&&(t.innerHTML="",t.appendChild(n),clearInterval(o))}),10)};return n&&n.delay?setTimeout(o,n.delay):o(),e},l=function(t,n){return n||(n=document.createElement("div")),Object(i.createRoot)(n).render(t),n},s=function(t){return Object(a.a)((function(){return t.apply(void 0,arguments)}),(function(t){return JSON.stringify(Object(o.a)(t))}))}},136:function(t,n,e){"use strict";e.d(n,"b",(function(){return p})),e.d(n,"a",(function(){return f}));var o=e(11),i=e(111),c=e(26),a=e(9),r=e(18),l=e(14),s=e(545),u={curr:[]},d=Object(i.a)((function(t){console.log("[UPLOAD] inserting ".concat(u.curr.length," files after debounce")),Object(a.d)((function(n){var e="";Object(c.a)(u.curr,(function(t,n){if(!t.inserted){var o=t.file.name.replace(/\[/g,"").replace(/\]/g,"");e+=".concat(t.file.path,")\n"),t.inserted=!0}})),n.ui.note.editorAction.dispatch({type:"insertText",insertPos:"currentLineStart",insertText:e,windowId:t})}))}),1e3),p=function(t){console.log("[UPLOAD] FILE TO EDITOR started",t.fileToUpload);var n=Object(o.a)({},t),e=n.fileToUpload,i=n.folder,c=n.windowId;Object(a.d)((function(t){t.upload.uploadFile({file:e,folderPath:i,onSuccess:function(t){u.curr.push({file:t,inserted:!1}),d(c)},onProgress:function(n){t.ui.note.editorAction.dispatch({type:"uploadProgress",uploadProgress:n,windowId:c})}})}))},f=function(t){var n=Object(o.a)({},t),e=n.file,i=n.path,c=n.idReq,a=n.onProgress,u=e.name,d=e.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=e.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 n=Math.round(t.bytesLoaded/t.file.size*100);a(n)})),g.submitFiles([e])}},137:function(t,n,e){"use strict";e.d(n,"a",(function(){return l}));var o=e(142),i=e(30),c="[FRONT PERF]",a={value:!1};"true"===Object(o.a)("tiroConsoleLogEnabled")||(console.error("=============================================================================="),console.error("!!! console.log is disabled, to enable it again, tiroDevCli.log.toggle_enable()"),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 n=r[t],e=n[1]-n[0];console.warn(c,"".concat(t," = ").concat(e," ms"),n)}}},138:function(t,n,e){"use strict";e.d(n,"c",(function(){return w})),e.d(n,"b",(function(){return y})),e.d(n,"a",(function(){return k}));var o=e(15),i=e(4),c=e(26),a=e(287),r=e(39),l=e(176),s=e(38),u=e(0),d=e(27),p=e(17),f=e(14),b=e(95),g=e(18),h=e(59),m=e(61),v=e(9),w=function(t){var n=Object(u.useState)([]),e=Object(i.a)(n,2),f=e[0],g=e[1],w=Object(u.useState)(-1),y=Object(i.a)(w,2),k=y[0],_=y[1],C=Object(m.a)("selected-folder",""),E=Object(i.a)(C,2),S=E[0],T=E[1],I=Object(u.useRef)("");Object(u.useEffect)((function(){I.current=S}),[S]);var P=Object(u.useRef)({}),N=Object(u.useState)(O),A=Object(i.a)(N,2),R=A[0],F=A[1],L=Object(u.useState)(""),M=Object(i.a)(L,2),D=M[0],z=M[1],B=Object(h.a)("folders-open",["/"]),W=Object(i.a)(B,3),U=W[0],H=W[1],q=W[2],V=Object(u.useRef)([]),J=function(t){t=Object(a.a)(t),H(t)},G=Object(u.useRef)(!1);Object(u.useEffect)((function(){G.current||(K(U),U.length>1&&(G.current=!0))}),[U]);var K=function(t,n){Object(c.a)(t,(function(n,e){""===t[e]&&(t[e]="/")})),t=Object(a.a)(t),n||(n={}),Object(l.a)(n.cache)||(n.cache=!0);var e=!!Object(l.a)(n.background)&&n.background,o=0;Object(v.d)((function(i){Object(c.a)(t,(function(c){i.folders.get([c],(function(i){var c;!e&&$(i.pathBase,i.folders),++o>=t.length&&(null===(c=n)||void 0===c?void 0:c.cb)&&n.cb()}))}))}))},Y=Object(u.useRef)([]),$=function(t,n){var e=Object(s.a)(Y.current),o={current:e};Object(c.a)(n,(function(t){t&&(o.current=o.current.filter((function(n){return t.path!==n.path})))})),Object(c.a)(n,(function(t){t&&(o.current=x(t,o.current))})),e=o.current,Y.current=e;var i=j("/",e);i&&F(i),z(t)};return{goTo:function(t,n,e){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(n&&Object(c.a)(a,(function(t,e){t.name===n&&(r=e)})),_(r),g(a),e&&e.openIn){var l=a[r];if("active"===e.openIn||"activeWindow"===e.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([e.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(n," ").concat(JSON.stringify(e))),o.ui.search.term.set(""),o.status.searching.set(!0),T(t)}))};if(e&&e.ramCache&&P.current[t])i(),o(P.current[t]);else{if(""===t)return;Object(v.d)((function(n){i(),n.files.get(t,(function(n){o(n),P.current[t]=n}))}))}},files:{active:{get:f[k],getIndex:k,set:_},set:g,get:f},folders:{refreshFromBackend:function(){q((function(t){V.current=t}))},base:D,get:function(cb){return cb&&cb(R),R},clean:function(){F(O)},scan:K,open:{get:function(){return V.current},add:function(t){console.log("ADD",t),V.current=Object(r.a)(V.current)?V.current:[],V.current=[].concat(Object(o.a)(V.current),[t]),V.current=Object(a.a)(V.current),J(V.current)},remove:function(t){console.log("REMOVE",t),Object(c.a)(t,(function(t){V.current=V.current.filter((function(n){return n!==t}))})),J(V.current)}},current:{get:function(){return I.current},set:T,getSync:S}}}},O={title:"",key:"",path:""},j=function t(n,e){for(var o,i=0;i<e.length;i++)if(Object(d.a)(e[i].path,n)){o=Object(s.a)(e[i]);var c=e[i].children;if(Object(r.a)(c))for(var a=0;a<c.length;a++){var l=t(c[a].path,e);l&&(o.children[a]=l)}}return o},x=function(t,n){for(var e="add",o=0;o<n.length;o++)Object(d.a)(t.path,n[o].path)&&(n[o]=t,e="update");return"add"===e&&n.push(t),n},y={title:".trash",key:"/.tiro/.trash",path:"/.tiro/.trash"},k=function(t,n){console.log("[askFolderDelete]",t,n),f.b.emit("askFolderDelete",{typeFolder:t,cacheFolderName:n,token:Object(g.b)()})}},14:function(t,n,e){"use strict";e.d(n,"a",(function(){return o})),e.d(n,"b",(function(){return h})),e.d(n,"c",(function(){return m})),e.d(n,"d",(function(){return v}));var o,i=e(11),c=e(15),a=e(672),r=e(106),l=e(64),s=e(284),u=e.n(s),d=e(9),p=e(27),f=e(17),b="[RIPGREP INSTALL]",g=function(t){var n="rg-".concat(t.os,"-").concat(t.arch);"win"===t.os&&(n+=".exe");var e=-1!==["rg-darwin-arm","rg-darwin-x64","rg-darwin-x64","rg-linux-x64","rg-win-x64.exe"].indexOf(n),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";e&&(o+="<br>Do you want Tiro to download and install it? <br><br> The following version will be downloaded and installed: <br><code>".concat(n,"</code>"),c=function(){var e="".concat("https://github.com/dotgreg/tiro-notes/raw/master/platforms/electron/not-packaged/ripgrep/").concat(n);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(n));console.log(c,r),o.ui.notification.emit({id:a,content:"".concat(b," downloading ripgrep..."),options:{hideAfter:-1}}),o.ressource.download(e,c,(function(){var n,cb;o.ui.notification.emit({id:a,content:"".concat(b," updating config..."),options:{hideAfter:-1}}),n=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 e="chmod 0755 ".concat(n);t.command.exec(e,(function(t){console.log("".concat(b," -> cmd: ").concat(e," : ").concat(t)),cb(t)}))})):cb()}),{fileName:n})}))}))}),e||(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,n=Object(r.b)("backend-port")?":".concat(Object(r.b)("backend-port")):"".concat(l.a.global.port),e="".concat(t).concat(l.a.global.url).concat(n);return Object(r.b)("backend-port").includes(".")&&(e="".concat(t).concat(Object(r.b)("backend-port"))),e},v=function(){return new Promise((function(t,n){if(!o){var e=s?u.a:function(){};o=e(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(n){g(t.platform)}))})),h.on("connectionSuccess",(function(n){l.a.log.socket&&console.log("[SOCKET] connection successful!, socket.connected :".concat(o.connected),n),n.isRgGood,t({socket:o,ipsServer:n.ipsServer,socketManager:h})}))}}))},w=function(t,n){return["%c [CLIENT SOCKET 2] ".concat(t),"background: #ccc; color: red",n||null]},O=function(t){var n={};return{on:function(e,o){var r=function(t,n){return function(e){var o;l.a.log.socket&&(o=console).log.apply(o,Object(c.a)(w("<== ON ".concat(t," "),Object(i.a)({},e)))),n(e)}}(e,o),s=Object(a.a)(1,1e8);return n[s]={endpoint:e,apiFn:r},t.on(e,r),s},off:function(e){n[e]&&(t.off(n[e].endpoint,n[e].apiFn),delete n[e])},emit:function(n,e){var o;l.a.log.socket&&(o=console).log.apply(o,Object(c.a)(w("==> EMIT ".concat(n," "),Object(i.a)({},e)))),t.emit(n,e)}}}},140:function(t,n,e){"use strict";e.d(n,"a",(function(){return j})),e.d(n,"b",(function(){return x}));var o=e(4),i=e(11),c=e(38),a=e(176),r=e(0),l=e.n(r),s=e(9),u=e(34),d=e(184),p=e(86),f=e(221),b=e(10),g=(e(56),e(220)),h=e(136),m=e(28),v=e(141),w=e(1),O=function(t){var n,e,b=Object(i.a)({},t.content),O=b.file,j=b.view,x=b.active,y=b.i,k=Object(r.useState)(""),_=Object(o.a)(k,2),C=_[0],E=_[1],S=Object(r.useState)("editor"),T=Object(o.a)(S,2),I=T[0],P=T[1],N=y;Object(r.useEffect)((function(){if(t.forceView)return P(t.forceView);P(j),Object(p.a)(null===O||void 0===O?void 0:O.path).then((function(t){P(t||"editor")}))}),[j,null===O||void 0===O?void 0:O.path,N,t.forceView,null===(n=t.content)||void 0===n||null===(e=n.file)||void 0===e?void 0:e.path]);var A=Object(r.useState)(!0),R=Object(o.a)(A,2),F=R[0],L=R[1],M=Object(r.useState)(O),D=Object(o.a)(M,2),z=D[0],B=D[1],W=Object(r.useState)(C),U=Object(o.a)(W,2),H=U[0],q=U[1];Object(r.useEffect)((function(){var t=V(C);if(t){var n=t.contentWithoutMeta,e=t.file;q(n),B(e)}}),[C,O]);var V=function(t){var n=t,e=Object(v.b)(n),o=e.metas,i=e.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}},J=Object(r.useRef)((null===O||void 0===O?void 0:O.path)||"");Object(r.useEffect)((function(){J.current=(null===O||void 0===O?void 0:O.path)||"",$(!1),O&&Object(s.d)((function(t){t.file.getContent(O.path,(function(t){E(t),$(!0)})),!0===m.d.curr.ui_editor_live_watch&&t.watch.file(O.path,(function(t){if(J.current===t.filePath)return!0===it.current?ot.current=t.fileContent:void E(t.fileContent)}))}))}),[null===O||void 0===O?void 0:O.path,N,F]);var G=Object(r.useState)(!1),K=Object(o.a)(G,2),Y=K[0],$=K[1],Z=Object(u.a)((function(t){Object(d.a)(t,20)}),3e3),X=Object(r.useRef)(!1),Q=(Object(u.a)((function(){X.current=!1,console.log("reenable watch file")}),1e4),Object(r.useRef)({})),tt=Object(r.useRef)(0);Object(r.useEffect)((function(){Q.current;Object(s.d)((function(t){t.watch.appStatus((function(t){if(!1===t.isConnected)tt.current=tt.current+1,console.log("disabling watch update as disconnected"),X.current=!0;else if(!0===t.isConnected){if(tt.current>=1&&t.isConnected)return}}))}))}),[null===O||void 0===O?void 0:O.path,C]);var nt=Object(r.useRef)(C);Object(r.useEffect)((function(){nt.current=C}),[C]);var et=function(t,n){Object(s.d)((function(e){e.file.saveContent(t,n,{history:!0,debounced:500,withMetas:z})})),it.current=!0,ct(),Q.current={content:n,path:null===O||void 0===O?void 0:O.path},Z({path:t,content:n,timestamp:Date.now()})},ot=Object(r.useRef)(!1),it=Object(r.useRef)(!1),ct=Object(u.a)((function(){it.current=!1,Object(a.a)(ot.current)||(ot.current=!1)}),2e3);Object(r.useEffect)((function(){O&&x&&Object(s.d)((function(t){t.ui.browser.goTo(O.folder,O.name,{ramCache:!0})}))}),[x]);var at=Object(u.a)((function(){ut(!1)}),100),rt=Object(r.useState)(!1),lt=Object(o.a)(rt,2),st=lt[0],ut=lt[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:function(t){null!==O&&void 0!==O&&O.path&&Object(g.b)(t,(function(t){Object(h.b)({fileToUpload:t,folder:O.folder,windowId:N})}))},onDragOver:function(t){t.preventDefault(),t.stopPropagation(),console.log("handle dragover",null===O||void 0===O?void 0:O.path),ut(!0),at()},onDragLeave:function(t){},onDrop:function(t){console.log("window drop"),t.preventDefault(),t.stopPropagation(),ut(!1),console.log("handle drop",null===O||void 0===O?void 0:O.path),null!==O&&void 0!==O&&O.path&&function(t,n){if(console.log("handleFileDrop"),t.preventDefault(),t.dataTransfer&&t.dataTransfer.items){var e=t.dataTransfer.items;if(!e[0])return;for(var o=0;o<e.length;o++)n(e[o].getAsFile())}}(t,(function(t){Object(h.b)({fileToUpload:t,folder:O.folder,windowId:N})}))}},Object(w.c)(f.a,{noteParentType:t.noteParentType,windowId:N,file:z||O,fileContent:H,isActive:x,canEdit:Y,isDragging:st,showViewToggler:t.showViewToggler,showToolbar:t.showToolbar,titleEditor:t.titleEditor,viewType:I,mobileView:t.mobileView,onLayoutUpdate:t.onLayoutUpdate,onReloadContent:function(){L(!1),setTimeout((function(){L(!0)}),100)},onFileEdited:function(t,n){et(t,n)}})))},j=l.a.memo(O,(function(t,n){return!1})),x=function(){return"\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")}},141:function(t,n,e){"use strict";e.d(n,"b",(function(){return l})),e.d(n,"a",(function(){return s}));var o=e(26),i=e(29),c=e(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 n=t.split(": ");if(2!==n.length)return null;var e=n.shift();if(!e)return null;var o=n.join(":").trim();if("created"===e||"modified"===e){var i=new Date(o).getTime();isNaN(i)||(o=i)}return{name:e,value:o}},l=function(t){var n=t.match(i.a.metas),e={};if(n&&n[0])for(var o=n[0].split("\n"),c=0;c<o.length;c++){var a=r(o[c]);a&&(e[a.name]=a.value)}10==="".concat(e.created).length&&(e.created=1e3*parseInt("".concat(e.created))),10==="".concat(e.updated).length&&(e.updated=1e3*parseInt("".concat(e.updated)));var l=t;return{metas:e,content:l=(l=l.replace(i.a.metasAndSpace,"")).replace(i.a.metas,"")}},s=function(t,n){var e=function(t){var n="".concat(c.a.metas.headerStart,"\n");return Object(o.a)(t,(function(t,e){n+="".concat(e,": ").concat(t,"\n")})),n+="".concat(c.a.metas.headerEnd,"\n")}(n);return e+=t}},142:function(t,n,e){"use strict";e.d(n,"a",(function(){return o})),e.d(n,"b",(function(){return i}));var o=function(t){var n,e="; ".concat(document.cookie).split("; ".concat(t,"="));return 2===e.length?null===(n=e.pop())||void 0===n?void 0:n.split(";").shift():void 0},i=function(t,n,e){var o=new Date;o.setTime(o.getTime()+60*e*60*1e3);var i="expires="+o.toUTCString();document.cookie=t+"="+n+";"+i+";path=/"}},159:function(t,n,e){"use strict";e.d(n,"a",(function(){return f})),e.d(n,"c",(function(){return b})),e.d(n,"b",(function(){return h}));var o=e(15),i=e(29),c=e(9),a=e(12),r=e(33),l=e(10),s=e(45),u=e(134),d=e(46),p=e(30),f=Object(u.a)((function(t,n){return g(t,n)})),b=function(t,n){return Object(s.a)({file:t,windowId:n,pattern:i.a.externalLink3,replacement:function(t){var n=t.matchs,e=document.createElement("span");return e.innerHTML=f(n),e}})},g=function(t,n){var e=[];e=Array.isArray(t)?t:Object(o.a)(t.matchAll(i.a.externalLink3))[0];var l=document.createElement("span"),s=e[0].slice(0,-1),u=Object(d.c)(s),f=function(t,cb){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],e=t.dataset.link;Object(c.d)((function(t){Object(p.d)('fetching article "'.concat(e,'"...'),"fetchArticle",5),t.ressource.fetchUrlArticle(e,(function(e){var o=encodeURIComponent(e.html);n&&t.ui.floatingPanel.create({type:"ctag",ctagConfig:{tagName:"web",content:o}}),cb(e)}))}))},b="";null!==n&&void 0!==n&&n.addLineJump&&(b="\n");var g=r.d,h='<span title="Open link in detached window" onclick="'.concat(Object(r.c)("open-win-link",(function(t){if(t){var n=t.dataset.link;window.open(n,"popup-preview-link","width=800,height=1000")}})),'"\nclass="link-action link-openwindow" data-link="').concat(s,'">').concat(g("up-right-from-square"),"</span>"),m='<span\nonclick="'.concat(Object(r.c)("fetch-link",(function(t){t&&f(t,(function(){}))})),'"\ntitle="Display url content" class="link-fetcharticle link-action" data-link="').concat(s,'">').concat(g("file-lines"),"</span>"),v='<span\nonclick="'.concat(Object(r.c)("audio-link",(function(t){t&&f(t,(function(n){n.text&&Object(c.d)((function(e){e.ui.textToSpeechPopup.open(n.text,{id:t.dataset.link})}))}),!1)})),'"\ntitle="Text to speech url content" class="link-audio link-action" data-link="').concat(s,'">').concat(g("volume-high"),"</span>"),w='<span\n\t\t title="Detach link in floating panel" class="link-detach link-action" data-link="'.concat(s,'">').concat(g("window-restore"),"</span>"),O='<a\n\t\thref="'.concat(s,'" target="_blank" rel="noreferrer"\n\t\ttitle="Go to link" class="link-goto link-action">').concat(g("link"),"</a>"),j='<span class="link-action-more"><span class="icon-more">'.concat(g("ellipsis"),'</span><span class="link-action-wrapper">').concat(m," ").concat(v," ").concat(w," ").concat(h," </span></span>"),x='<span class="link-action-wrapper">'.concat(m," ").concat(v," ").concat(O," ").concat(w," ").concat(h," </span>"),y='<span class="cm-hover-popup cm-hover-popup"></span>',k='<span class="'.concat(Object(a.e)()?"mobile-version":"",' link-mdpreview-wrapper"><a href="').concat(s,'" class="link-mdpreview" title="').concat(s,'" target="_blank" rel="noreferrer">').concat(g("link")).concat(u,"</a>").concat(j).concat(y,"</span>").concat(b);return Object(a.e)()&&(k='<span class="'.concat(Object(a.e)()?"mobile-version":"",' link-mdpreview-wrapper"><span class="link-action-more link-mdpreview" title="').concat(s,'" rel="noreferrer">').concat(g("link")).concat(u).concat(x).concat(y,"</span>").concat(b)),l.innerHTML="".concat(k),l.outerHTML},h=function(t){var n=parseFloat(t.get("ui_editor_links_preview_zoom")),e=t.get("beta_floating_windows");return isNaN(n)&&(n=1),isNaN(e)&&(e=!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(e?"":".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\topacity: 0;\n\t\ttransition: 0.2s all;\n\t\tpointer-events: none;\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.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\tpointer-events: none;\n transform: translate(-50%,-50%);\n padding: 30px 50px;\n background: white;\n width: 170px;\n z-index:2;\n opacity: 0;\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\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/n,"%!important;\n\t\theight: ").concat(100/n,"!important;\n\t\tmax-height: ").concat(100/n,"%!important;\n\t\ttransform-origin:top left;\n\t\ttransform: scale(").concat(n,");\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(l.a.colors.main,";\n\t\t// border: solid 2px ").concat(l.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(l.a.colors.main,";\n\t\t}\n}\n")}},161:function(t,n,e){"use strict";e.d(n,"a",(function(){return v})),e.d(n,"b",(function(){return w}));var o=e(15),i=e(4),c=e(11),a=e(37),r=e(39),l=e(38),s=e(26),u=e(128),d=e(217),p=e(59),f=e(124),b=e(9),g=e(12),h=e(0),m=e(86),v=function(t){var n=Object(c.a)({},t),e=n.w,o=n.h,i=n.x,r=n.y,l=n.file;o||(o=f.c.rows),e||(e=f.c.cols),i||(i=0),r||(r=0);var s=Object(a.a)();return{layout:{i:s,x:i,y:r,w:e,h:o,minH:1,maxH:2,forceRender:0},content:{i:s,active:!1,file:l,view:"both"}}},w=function(){var t=Object(h.useState)([]),n=Object(i.a)(t,2),e=n[0],c=n[1],a=Object(p.a)("tabs",[],{history:!1,debouncedSave:5e3}),d=Object(i.a)(a,3),f=d[0],v=d[1],w=d[2],_=Object(p.a)("tabs-mobile",[],{history:!1,debouncedSave:5e3}),C=Object(i.a)(_,3),E=C[0],S=C[1],T=C[2],I=Object(h.useRef)([]),P=function(t,cb){I.current=t,c(I.current),"mobile"!==Object(g.a)()&&v(I.current),"mobile"===Object(g.a)()&&S(I.current)},N=function(){w(),T()};Object(h.useEffect)((function(){N()}),[]),Object(h.useEffect)((function(){I.current=e}),[e]),Object(h.useEffect)((function(){"mobile"!==Object(g.a)()&&c(f)}),[f]),Object(h.useEffect)((function(){"mobile"===Object(g.a)()&&c(E)}),[E]);var A=function(t){console.log("[TAB] open in new tab",t);var n=k({fullWindowFile:t});if(n){I.current=Object(r.a)(I.current)?I.current:[];var e=[].concat(Object(o.a)(I.current),[n]),i=y(n.id,e);P(i)}},R=function(t){var n=[],e=Object(l.a)(I.current);Object(s.a)(e,(function(e,o){e.id!==t&&n.push(e)})),P(n)},F=function(){var t=null;return Object(s.a)(I.current,(function(n){n.active&&(t=n)})),t},L=function(t,n,e){var o="activeTab"!==n&&n?n:F();if(o)if("add"===t)Object(b.e)().then((function(t){A(t.ui.browser.files.active.get)}));else if("close"===t){if(!o)return;R(o.id)}else if("rename"===t){if(!o)return;if(e.length>15)return;var i=Object(l.a)(I.current);Object(s.a)(i,(function(t){t.id===(null===o||void 0===o?void 0:o.id)&&(t.name=e,t.manualName=!0)})),P(i)}else if("activateTabWindow"===t){if(!o)return;var c=Object(l.a)(I.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===e}))}));var a=O(c);P(a)}else if("activate"===t){if(!o)return;var r=y(o.id,I.current),u=O(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 n=Object(l.a)(I.current),e=x(n);if(!Object(u.a)(e))return;t=n[e]}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,n){t.active&&(i={layout:o.layout[n],content:o.content[n]})})),i}};return{tabs:e,updateTab:L,refreshTabsFromBackend:N,updateActiveTabGrid:function(t,cb){var n=Object(l.a)(I.current),e=x(n);if(Object(u.a)(e)){n[e].grid=Object.assign(n[e].grid,t);var o=n[e].refresh;n[e].refresh=o?o+1:1,P(n)}},refreshWindowGrid:function(){var t=O(I.current);P(t)},tabsApi:{get:function(){return I.current},close:R,openInNewTab:A,reorder:function(t,n){var e=Object(l.a)(I.current),o=e[t];e.splice(t,1),e.splice(n,0,o),P(e)},active:{get:F},updateTab:L},windowsApi:{close:function(t){var n=Object(l.a)(I.current);Object(s.a)(t,(function(t){Object(s.a)(n,(function(n,e){for(var o=0;o<n.grid.content.length;o++){var i=n.grid.content[o],c=n.grid.layout[o];i.i===t&&n.grid.content.splice(o,1),c.i===t&&n.grid.layout.splice(o,1)}}))}));var e=O(n);P(e)},active:{get:M,setContent:function(t){if(t){var n=Object(l.a)(I.current),e=x(n);if(Object(u.a)(e)){var o=n[e],i=M(o);if(i){i.content.file=Object(l.a)(t),o.manualName||(o.name=j(t.name));var c=O(n);P(c)}}}},toggleView:function(t){var n=Object(l.a)(I.current),e=x(n);if(Object(u.a)(e)){var o=n[e].grid.content;if(!(o.length<1)){var i=0;Object(s.a)(o,(function(t,n){!0===t.active&&(i=n)})),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(n)}}}},updateWindows:function(t,n){var e=Object(l.a)(I.current);Object(s.a)(t,(function(t){Object(s.a)(e,(function(e,o){Object(s.a)(e.grid.content,(function(e){e.i===t&&(e.file=n)}))}))}));var o=O(e);P(o)},getIdsFromFile:function(t){var n=[];return Object(s.a)(I.current,(function(e){Object(s.a)(e.grid.content,(function(e){e.file&&e.file.path===t&&n.push(e.i)}))})),n}}}},O=function(t){var n=Object(l.a)(t);return Object(s.a)(n,(function(t){t.refresh=Object(d.a)(t.refresh)})),n},j=function(t){return t.length>15?"".concat(t.substring(0,13),".."):t},x=function(t){var n=void 0;return Object(s.a)(t,(function(t,e){t.active&&(n=e)})),n},y=function(t,n){var e=Object(l.a)(n);return Object(s.a)(e,(function(n){n.refresh=Object(u.a)(n.refresh)?n.refresh++:1,n.id===t?n.active=!0:n.active=!1})),e},k=function(t){if(t.copiedTab){var n=Object(l.a)(t.copiedTab);return n.id=Object(a.a)(),n.name=_(t.copiedTab.name),n}if(t.fullWindowFile){var e=v({file:t.fullWindowFile});return{id:Object(a.a)(),name:j(t.fullWindowFile.name),active:!0,grid:{layout:[e.layout],content:[e.content]}}}},_=function(t){var n=t,e=n[n.length-1];return isNaN(parseInt(e))?n+=" 1":(n=n.slice(0,-1),n+="".concat(parseInt(e)+1)),n}},165:function(t,n,e){"use strict";e.d(n,"a",(function(){return i}));var o=function(t){return("0"+t).slice(-2)};String.prototype.replaceAll||(String.prototype.replaceAll=function(t,n){return"[object regexp]"===Object.prototype.toString.call(t).toLowerCase()?this.replace(t,n):this.replace(new RegExp(t,"g"),n)});var i=function(t){var n=function(t){var n=new Date;if(t&&""!==t&&"undefined"!==t)if("string"===typeof t){var e=t,i=t;if(t.startsWith("f")){var c=(e=t.replaceAll("f","").replaceAll("h",":").replaceAll("m",":00").replaceAll("-","/").replaceAll("_"," ")).split("/");e="".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("-");e="".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]));e="".concat(r[1],"/").concat(l,"/").concat(r[2])}else if(t.startsWith("h")){var s=(e=t.replace("h","").replaceAll("h",":00:00").replaceAll("-","/").replaceAll("_"," ")).split("/");e="".concat(s[1],"/").concat(s[0],"/").concat(s[2])}var u=Number.isNaN(new Date(e).getDate());n=new Date(e),u&&(n=new Date(i))}else n=new Date(t);else n=new Date;return n}(t),e=n.getFullYear(),i=n.getMonth()+1,c=n.getDate(),a=e.toString(),r=o(i),l=o(c),s=o(n.getHours()),u=o(n.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:e,month:i,day:c,hour:n.getHours(),min:n.getMinutes(),timestamp:n.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:n,full_file:f,full_file_fr:b,full_fr:p,date_fr:h,getWeekNb:v,getCustomFormat:function(t){var n="f".concat(b);return"day"===t&&(n="d".concat(l,"-").concat(r,"-").concat(e)),"week"===t&&(n="w".concat(v(),"-").concat(r,"-").concat(e)),"hour"===t&&(n="h".concat(l,"-").concat(r,"-").concat(e,"_").concat(s,"h")),"".concat(n)}}}},166:function(t,n,e){"use strict";e.d(n,"c",(function(){return tt})),e.d(n,"a",(function(){return nt})),e.d(n,"b",(function(){return et}));var o=e(24),i=e(15),c=e(4),a=e(0),r=e.n(a),l=e(12),s=e(242),u=e(57),d=e(62),p=function(t){var n=Object(a.useRef)(0),e=t.editorRef,o=t.editorRef,i=t.editorRef,c=function(){var c;if("codemirror"===t.editorType){var a=u.a.getCurrentLineInfos(e.current);if(!a)return null;c=a,n.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(),n.current=c&&c.monacoPosition?c.monacoPosition:0;else c=i.current?Object(d.c)(i.current):null,n.current=c&&c.currentPosition?c.currentPosition:0}return c},r=function(c){var a=n.current+c;if("codemirror"===t.editorType)u.a.updateCursor(e.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,n){var e=c();return e?Object(d.g)(t,e,(function(t){r(t)}),n):null}}},f=e(111),b=function(t,n){var e=p({editorType:"monaco-textarea",deviceType:"mobile",editorRef:n.mobileTextarea}),o=e.getLineTextInfos,i=e.resetCursorPosition,r=function(t){var n=Object(a.useState)(0),e=Object(c.a)(n,2),o=e[0],i=e[1];return{saveYTextarea:function(n){var e=t.current?t.current.scrollTop:0;i(n||e)},resetYTextarea:function(){t.current&&(console.log("resetYTextarea",o),t.current.scrollTop=o)}}}(n.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(e){console.log("onTextareaChange");var c=e.target.value,a=c[e.target.selectionStart-1]&&c[e.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()}))}))}n.onMobileNoteEdition(c)},onTextareaScroll:function(t){if(!g){var n=t.target.scrollTop;l(n),console.log("onTextareaScroll")}}}},g="",h=e(216),m=e(108),v=e(1),w=e(14),O=e(71),j=e(10),x=e(20),y=e(232),k=e(47),_=e(231),C=e(224),E=e(188),S=e(225),T=e(239),I=e(9),P=e(220),N=e(96),A=e(26),R=e(81),F=function(t,n){var e=".window-id-".concat(t," .preview-area-wrapper"),o=document.querySelector(e),i="print-wrapper";if(o){!function(){var t=document.querySelectorAll(".".concat(i));Object(A.a)(t,(function(t){t.classList.remove(i)}))}();var c=Object(O.a)(new Date(n.modified||0)),a=Object(O.a)(new Date(n.modified||0)),r="\n<head>\n\t<title>".concat(n.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(n.name,"<br>\n\t\t\t\t\tNote Path : ").concat(n.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(R.c)({w:".simple-css-print-wrapper",pl:".preview-link",r:".resource-link-icon"}),"</style>\n\t\t\t<style>").concat(L(),'</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)}},L=function(){return"\n@page {\nmargin: 0;\n}\n@media print {\n.hide-print {\ndisplay: none;\n\n}\n}\n\n* {\n\t-webkit-print-color-adjust: exact; \n\tprint-color-adjust: exact; \n}\n\n\t.file-path-wrapper {\n\t\tdisplay: none;\n\t}\n\th1.title.big-title {\n\t\tdisplay: none;\n\t}\n\t.file-infos-wrapper {\n\t\tdisplay: none;\n\t\tbackground: #eeeeee;\n\t\tpadding: 10px;\n\t\tmargin: 10px;\n\t}\n\n\t.simple-css-print-wrapper {\n\t\tmargin: 20px;\n\t\twidth: 90%;\n\t}\n\t.simple-css-wrapper {\n\t\tfont-size: 12px;\n\t}\n\n\ttable {\n\t\tfont-size: 12px!important;\n\t}\n\timg {\n\t\t// max-width: 300px!important;\n\t\t// max-height: 500px!important;\n\t\tmax-width: 100%;\n\t\tmax-height: 500px;\n\t}\n\t.block-tag {\n\t\t\tdisplay: none;\n\t}\n"},M=e(189),D=e(27),z=e(17),B=e(223),W=e(33),U="[EXPORT]",H=function(t){if(t){var n=t.dataset.format,e=t.dataset.path;if(n&&e){var o=Object(D.e)(e);Object(I.d)((function(t){Object(I.d)((function(t){t.ui.notification.emit({content:"[EXPORT] converting...",id:"export",options:{hideAfter:-1}})})),t.config.get((function(e){var i="/".concat(z.a.path.configFolder,"/").concat(z.a.path.cacheFolder,"/pandoc");t.folders.create(i,(function(c){var a="";"dzslides"===n&&(a="--self-contained"),"slideous"===n&&(a="--self-contained"),"revealjs"===n&&(a="--self-contained"),"beamer"===n&&(a="--self-contained");var r=n;"dzslides"===n&&(r="html"),"slideous"===n&&(r="html"),"revealjs"===n&&(r="html"),"latex"===n&&(r="tex"),"gfm"===n&&(r="md"),"latex-pdf"===n&&(r="pdf"),"beamer"===n&&(r="pdf");var l="".concat(o.name),s="".concat(l,".").concat(r),u="".concat(e.dataFolder,"/"),d=Object(D.b)("".concat(u,"/").concat(o.folder)),p=(Object(D.b)("./".concat(o.name)),Object(D.b)("".concat(u,"/").concat(i))),f=Object(D.b)("".concat(p,"/").concat(s)),b=Object(D.b)("/".concat(z.a.path.configFolder,"/").concat(z.a.path.cacheFolder,"/pandoc/").concat(s)),g=Object(D.b)("".concat(o.folder,"/.export_md_pandoc.txt")),h=Object(D.b)("./.export_md_pandoc.txt");t.file.getContent(o.path,(function(e){e=e.replace(/\]\(\/\./g,"](."),t.file.saveContent(g,e,{},(function(){console.log(U,"saved"),t.file.getContent(g,(function(e){var o='cd "'.concat(d,'" && pandoc --output="').concat(f,'" --verbose ').concat(function(t,n){var e=t.userSettings.get("export_pandoc_cli_options").split("\n")||[],o={};return Object(A.a)(e,(function(t){var n=t.split("|");2===n.length&&(o[n[0].trim()]=n[1].trim())})),console.log(o,e),o[n]||""}(t,n)," ").concat(a," --to=").concat(n,' "').concat(h,'" ');!1===o.includes("--from=")&&(o=o.replace("--to=","--from=markdown --to="));var i=o;"latex-pdf"===n&&(i='cd "'.concat(d,'" && pdflatex -halt-on-error -output-directory="').concat(p,'" -jobname="').concat(l,'" "').concat(h,'" '));var c=function(n){var e=""===n.stderr?n.stdout:n.stderr;console.error("[CONVERT ERROR]:",n),t.ui.notification.emit({content:'[EXPORT] Error <br/> "'.concat(e," <br/><br/> ").concat(n.shortMessage,'"'),id:"export",options:{hideAfter:-1}})};console.log(U,"pandocCmd",o),t.command.exec("pkill -9 pandoc",(function(n){t.command.exec(i,(function(t){var n={failed:!1,stderr:null,shortMessage:null};try{n=JSON.parse(t)||{failed:!1}}catch(o){c(n)}if(n.failed)c(n);else{var e=Object(B.a)(b);!function(t,n){var e=document.createElement("a");e.setAttribute("download",t),e.setAttribute("href",n),e.setAttribute("target","_blank"),Object(I.d)((function(t){t.ui.notification.emit({content:"[EXPORT] done",id:"export",options:{hideAfter:3}})})),e.click()}(s,e)}}))}))}))}))}),{removeMetaHeader:!0})}))}))}))}}},q=e(176),V=e(286),J=e(128),G=e(77),K=e(28),Y=e(25),$=function(t){console.log("addTableCol");var n=t.cursorInfos.from,e=Object(d.d)(t.fileContent,n),o=e.activeLine;if(o.includes("|")){var i=o.split("|").length;console.log("tableColsNb",i);for(var c=[],a=e.lineIndex;a<e.lines.length;a++){if(e.lines[a].split("|").length!==i)break;c.push(a)}for(var r=e.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:e,colIndex:s}}},Z=e(68),X=e(93),Q=function(t){var n=Object(a.useState)(""),e=Object(c.a)(n,2),o=e[0],f=e[1],j=Object(a.useRef)(null),R=!0;!1===t.canEdit&&(R=!1),!1===t.isConnected&&(R=!1);var L=!0;!1===t.showViewToggler&&(L=!1);var z=!0;!1===t.showToolbar&&(z=!1);var B=!Object(q.a)(t.titleEditor)&&!Object(V.a)(t.titleEditor)||t.titleEditor,U=Object(a.useRef)(t.file);Object(a.useEffect)((function(){U.current=t.file}),[t.file.path]);var Y=function(t){var n=Object(a.useRef)(!1),e=Object(a.useRef)(!1);Object(a.useEffect)((function(){e.current=t.canEdit}),[t.canEdit]),Object(a.useEffect)((function(){return n.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(n.current,g),g=t.file.path};return{triggerNoteEdition:function(e){n.current?t.onNoteEdition&&t.onNoteEdition(e,!1):t.onNoteEdition&&t.onNoteEdition(e,!0),n.current=!0}}}({file:t.file,fileContent:t.fileContent,canEdit:R,onEditorDidMount:function(){f(t.fileContent)},onEditorWillUnmount:function(){},onNoteContentDidLoad:function(){w.a&&f(t.fileContent)},onNoteEdition:function(n,e){var o=U.current;e&&Object(I.d)((function(n){n.history.save(o.path,t.fileContent,"enter")})),t.onFileEdited(o.path,n),f(n)},onNoteLeaving:function(t,n){}}).triggerNoteEdition,Q=Object(a.useRef)(null),tt=b(o,{mobileTextarea:Q,onMobileNoteEdition:Y}),nt=(tt.onTextareaChange,tt.onTextareaScroll,Object(a.useRef)(null)),et="desktop"!==Object(l.a)()?Q:j;"codemirror"===t.editorType&&(et=nt);var ot=p({editorType:t.editorType,deviceType:Object(l.a)(),editorRef:et}).applyTextModifAction,it=function(t,n,e){var o=ot("insertAt",{textToInsert:t,insertPosition:n,replaceText:e});o&&(Y(o),Pt())},ct=function(t){var n=Object(a.useState)(null),e=Object(c.a)(n,2),o=e[0],i=e[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),w=Object(c.a)(g,2),O=w[0],j=w[1],x=function(n){var e=t.fileContent,o=Object(m.c)(e,n);if("failure"===o.status)j(null);else{console.log("encryption done",o),u(!1);var i=o.cipher;t.onTextEncrypted(i)}},y=function(n){var e=t.fileContent,o=Object(m.a)(e,n);if("failure"===o.status)j(null),alert("wrong password");else{b(!0),u(!0),console.log("decryption done",o);var i=o.plaintext;t.onTextDecrypted(i)}};return{APasswordPopup:Object(v.c)(h.a,{onClose:function(){i(null)},onSubmit:function(t){var n=o;i(null),j(t),"toEncrypt"===n&&x(t),"toDecrypt"===n&&y(t)}}),askForPassword:o,decryptButtonConfig:{title:"decrypt text",icon:"faUnlock",action:function(){O?y(O):i("toDecrypt")}},encryptButtonConfig:{title:"encrypt text",icon:"faLock",action:function(){O?x(O):i("toEncrypt")}},ifEncryptOnLeave:function(cb){if(s&&O){console.log("[EVENTS EDITOR] shouldEncryptOnLeave");var n=Object(m.c)(t.fileContent,O);n.cipher&&cb(n.cipher)}j(null),b(!1)},noHistoryBackupWhenDecrypted:f}}({fileContent:o,onTextEncrypted:function(n){Y(n),Pt(),Object(I.d)((function(e){e.history.save(t.file.path,n,"int")}))},onTextDecrypted:function(t){Y(t),Pt()}}),at=ct.APasswordPopup,rt=ct.askForPassword,lt=ct.decryptButtonConfig,st=ct.encryptButtonConfig,ut=(ct.ifEncryptOnLeave,ct.noHistoryBackupWhenDecrypted,Object(a.useContext)(T.a)),dt=Object(a.useState)(-1),pt=Object(c.a)(dt,2),ft=pt[0],bt=pt[1],gt=function(n,e){return{title:"",class:"upload-button-wrapper",action:function(){},customHtml:Object(v.c)(E.a,{file:t.file,windowId:t.windowId,type:n,label:e})}},ht=[{title:"Reload content",icon:"faSync",action:function(){_t.current=_t.current+1,t.onReloadContent(_t.current)}},{icon:"faWindowRestore",title:"Detach Window",action:function(){Object(I.d)((function(n){n.ui.floatingPanel.create({type:"file",file:t.file,view:t.viewType})}))}}].concat(Object(i.a)(function(){var t=[gt("all","Upload files")];return"desktop"!==Object(l.a)()&&(t.push(gt("image","Upload Gallery")),t.push(gt("camera","Capture")),t.push(gt("microphone","Record"))),t}()),[{title:"Search",icon:"faSearch",action:function(){Object(I.d)((function(n){n.ui.note.editorAction.dispatch({windowId:t.windowId,type:"searchWord",searchWordString:" "})}))}},Object(m.d)(o)?lt:st,{title:"Export",icon:"faFileDownload",action:function(){var n;n=t.file,Object(I.d)((function(t){t.popup.show('\n <div id="export-popup-wrapper">\n <div class="buttons-list"> \n <button onclick="'.concat(Object(W.c)("export-note-to",H),'" data-format="docx" data-path="').concat(n.path,'">docx</button>\n <button onclick="').concat(Object(W.c)("export-note-to",H),'" data-format="odt " data-path="').concat(n.path,'">odt</button>\n <button onclick="').concat(Object(W.c)("export-note-to",H),'" data-format="pdf" data-path="').concat(n.path,'">pdf</button>\n \n <button onclick="').concat(Object(W.c)("export-note-to",H),'" data-format="gfm" data-path="').concat(n.path,'">markdown</button>\n <button onclick="').concat(Object(W.c)("export-note-to",H),'" data-format="epub" data-path="').concat(n.path,'">epub</button>\n <button onclick="').concat(Object(W.c)("export-note-to",H),'" data-format="rtf" data-path="').concat(n.path,'">rtf</button>\n </div>\n <br/>\n <div class="buttons-list"> \n Latex:\n <br/>\n <button onclick="').concat(Object(W.c)("export-note-to",H),'" data-format="latex" data-path="').concat(n.path,'">latex (.tex)</button>\n <button onclick="').concat(Object(W.c)("export-note-to",H),'" data-format="latex-pdf" data-path="').concat(n.path,'">latex (.pdf)</button>\n \n </div>\n <br/>\n <div class="buttons-list"> \n Slides: \n <br/>\n <button onclick="').concat(Object(W.c)("export-note-to",H),'" data-format="pptx" data-path="').concat(n.path,'">pptx</button>\n <button onclick="').concat(Object(W.c)("export-note-to",H),'" data-format="beamer" data-path="').concat(n.path,'">beamer</button>\n <br/>\n <br/>\n HTML Slides: <br/>\n <button onclick="').concat(Object(W.c)("export-note-to",H),'" data-format="revealjs" data-path="').concat(n.path,'">revealjs</button>\n <button onclick="').concat(Object(W.c)("export-note-to",H),'" data-format="dzslides" data-path="').concat(n.path,'">dzslides</button>\n <button onclick="').concat(Object(W.c)("export-note-to",H),'" data-format="slideous" data-path="').concat(n.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")?(Bt("both"),setTimeout((function(){F(t.windowId,t.file),setTimeout((function(){Bt("editor")}))}),100)):F(t.windowId,t.file)}},{title:x.a.editorBar.explanation.history,icon:"faHistory",action:function(){Ot(!wt)}},{title:x.a.editorBar.tts,icon:"faCommentDots",action:function(){Object(I.d)((function(n){n.ui.textToSpeechPopup.open(o,{id:t.file.name})}))}},{title:"Delete note",class:"delete",icon:"faTrash",action:function(){ut.file.onFileDelete(t.file)}}]),mt=Object(a.useState)(!1),vt=Object(c.a)(mt,2),wt=vt[0],Ot=vt[1],jt=Object(a.useRef)(null),xt=jt.current,yt=700;xt&&(yt=xt.clientHeight/1.3),"mobile"===Object(l.a)()&&(yt=window.innerHeight);var kt=Object(a.useRef)(null);Object(a.useEffect)((function(){Pt()}),[t.fileContent,t.file.path,t.windowId]);var _t=Object(a.useRef)(0),Ct=Object(a.useRef)(0),Et=Object(a.useState)(0),St=Object(c.a)(Et,2),Tt=St[0],It=St[1],Pt=function(){Ct.current=Ct.current+1,It(Ct.current)},Nt=Object(a.useState)(!1),At=Object(c.a)(Nt,2),Rt=At[0],Ft=At[1],Lt=Object(a.useState)(!1),Mt=Object(c.a)(Lt,2),Dt=Mt[0],zt=Mt[1];Object(a.useEffect)((function(){var t=o.length>3e10&&"desktop"!==Object(l.a)();Ft(t)}),[o,t.viewType]),Object(a.useEffect)((function(){var n=o.length>3e9&&"desktop"!==Object(l.a)();Ft(n),Pt();var e="desktop"===Object(l.a)()&&"preview"===t.viewType||"desktop"!==Object(l.a)()&&"preview"===t.mobileView;zt(e);var i=t.file.path;setTimeout((function(){i===t.file.path&&Pt()}),100)}),[t.viewType,t.mobileView]);var Bt=function(n){t.onLayoutUpdate("windowViewChange",{view:n})},Wt=Object(a.useState)(-1),Ut=Object(c.a)(Wt,2),Ht=Ut[0],qt=Ut[1];Object(a.useEffect)((function(){console.log("222222, editorAction updated",t.editorAction),Object(I.d)((function(n){t.editorAction&&function(n,e){if(n&&("active"!==n.windowId&&(n.noteParentType="any"),(n.windowId===t.windowId||"active"===n.windowId)&&("any"===n.noteParentType||n.noteParentType===t.noteParentType)&&e.note.ui.editorAction.canExecuteAction(n)&&(console.log("[EDITOR ACTION] action ".concat(n.type," triggered on ").concat(n.windowId,", with noteParentType ").concat(n.noteParentType," ").concat(t.windowId)),("mobile"===Object(l.a)()||"active"!==n.windowId||t.isActive)&&("mobile"===Object(l.a)()||"active"===n.windowId||n.windowId===t.windowId)))){if("lineJump"===n.type){var i="both";n.lineJumpType&&(i=n.lineJumpType);var c="editor"===i||"both"===i,a="preview"===i||"both"===i,r=0;if(n.lineJumpNb&&(r=n.lineJumpNb),n.lineJumpString){var s=(null===n||void 0===n?void 0:n.lineJumpString)||"",d=t.fileContent.split("\n");Object(A.a)(d,(function(t,n){t.includes(s)&&(r=n+3)}))}if(c&&(qt(r),setTimeout((function(){qt(-1)}),100)),a){var p,f=Object(X.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 n=document.querySelector(g),e=".dual-view-wrapper.window-id-".concat(t.windowId," .preview-area"),o=document.querySelector(e);n&&(o.scrollTop=(null===n||void 0===n?void 0:n.offsetTop)-100)}),10)}}if("insertText"===n.type&&n.insertText&&n.insertPos&&it(n.insertText,n.insertPos,!1),"replaceText"===n.type&&n.replaceText&&n.replacePos){it(n.replaceText,n.replacePos,!0);var h=nt.current;if(!h)return;if(!Object(J.a)(n.replacePos))return;u.a.updateCursor(h,n.replacePos,!0)}if("searchWord"===n.type&&n.searchWordString){var v=nt.current;if(!v)return;u.a.searchWord(v,n.searchWordString,n.searchReplacementString,!0)}if("setSelection"===n.type&&n.selection){var w=nt.current;if(!w)return;u.a.setSelection(w,n.selection)}if("undo"===n.type){var O=nt.current;if(!O)return;u.a.undo(O.view)}if("redo"===n.type){var j=nt.current;if(console.log(j,j.view),!j)return;u.a.redo(j.view)}if("uploadProgress"===n.type&&bt(n.uploadProgress||-1),"highlightLine"===n.type){var x=nt.current;if(!x)return;!function(t){var n=t.state,e=n.selection.main,o=n.doc.lineAt(e.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"===n.type&&(Object(m.d)(o)?lt.action():st.action()),"triggerUpload"===n.type){var y=document.querySelector(".window-id-".concat(t.windowId," .upload-button-wrapper input"));if(!y)return;console.log("[EDITOR ACTION] TRIGGER UPLOAD2222",y),y.dispatchEvent(new MouseEvent("click",{view:window,bubbles:!0,cancelable:!0}))}if("toggleContextMenu"===n.type){var k=!0;void 0!==n.state&&(k=n.state),Kt(k),console.log("[EDITOR ACTION] OPEN CONTEXT MENU")}}}(t.editorAction,n)}))}),[t.editorAction,t.windowId]);var Vt=Object(a.useState)(!1),Jt=Object(c.a)(Vt,2),Gt=Jt[0],Kt=Jt[1],Yt=function(){Object(I.d)((function(n){var e;null===(e=n.lastNotesApi)||void 0===e||e.addToHistory(t.file,!1)}))},$t=Object(a.useState)({x:0,y:0,from:0,to:0,fromPx:0,toPx:0}),Zt=Object(c.a)($t,2),Xt=Zt[0],Qt=Zt[1],tn=o.substring(Xt.from,Xt.to),nn=".window-id-".concat(t.windowId),en=0;try{var on;en=(null===(on=document.querySelector(nn))||void 0===on?void 0:on.getBoundingClientRect().top)||0}catch(dn){console.log("error",dn)}Xt.y;var cn="desktop"===Object(l.a)()?40:60,an="desktop"===Object(l.a)()?0:10,rn=Object(a.useState)(0),ln=Object(c.a)(rn,2),sn=ln[0],un=ln[1];return Object(a.useEffect)((function(){var t,n;Object(l.e)()&&("visualViewport"in window&&(null===(t=window)||void 0===t||null===(n=t.visualViewport)||void 0===n||n.addEventListener("resize",(function(t){setTimeout((function(){var t,n=null===(t=window.visualViewport)||void 0===t?void 0:t.offsetTop;un(n||0)}),200)}))))}),[]),Object(v.c)("div",{className:"editor-area ".concat(t.isActive?"active":""," note-parent-type-").concat(t.noteParentType),ref:jt,onWheel:function(n){Z.a.scrollPreviewPx(t.windowId,n.deltaY)}},Object(v.c)("div",{className:"infos-editor-wrapper ".concat(B?"with-title-editor":"no-title-editor"," ").concat(t.isActive?"active":"")},(!0===B||"disabled"===B)&&Object(v.c)(r.a.Fragment,null,Object(v.c)("div",{className:"file-path-wrapper"},t.file.path.replace("/".concat(t.file.name),"")),Object(v.c)(s.a,{title:t.file.name.replace(".md",""),enabled:!0===B,onEdited:function(n,e){t.onTitleEditedHook&&t.onTitleEditedHook();var o="".concat(t.file.folder).concat(n,".md"),i="".concat(t.file.folder).concat(e,".md");ut.file.onTitleUpdate(o,i);Object(D.e)(i);Pt()}})),z&&Object(v.c)("div",{className:"toolbar-and-dates-wrapper"},Object(v.c)("div",{className:"editor-toolbar-dropdown"},Object(v.c)(C.a,{hover:!0,dir:"right",maxHeight:yt,forceShow:Gt,onMouseEnter:function(n){t.onLayoutUpdate("windowActiveStatus")}},Object(v.c)(r.a.Fragment,null,L&&Object(v.c)("div",{className:"view-toggler-wrapper"},"mobile"!==Object(l.a)()&&Object(v.c)(k.a,{class:"editor-view-toolbar",size:.8,buttons:[{title:"Editor",icon:"custom_icons/view-3.svg",action:function(){Bt("editor")}},{title:"Editor with minimap",icon:"custom_icons/view-4.svg",action:function(){Bt("editor-with-map")}},{title:"Dual view",icon:"custom_icons/view-1.svg",action:function(){Bt("both")}},{title:"Render view",icon:"custom_icons/view-2.svg",action:function(){Bt("preview")}}]})),Object(v.c)("div",{className:"toolbar-wrapper"},Object(v.c)(k.a,{class:"editor-main-toolbar",design:"vertical",size:1,buttons:ht})),Object(v.c)("div",{className:"separation-bar"}),Object(v.c)("div",{className:"note-id-wrapper"},Object(v.c)("h4",null,"Note Link"),Object(v.c)("div",{className:"note-id-form"},Object(v.c)("input",{type:"text",ref:kt,onClick:function(t){var n=t.target;n.setSelectionRange(0,n.value.length)},value:Object(M.a)(t.file),readOnly:!0}),Object(v.c)(k.a,{class:"note-id-toolbar",size:1,buttons:[{title:"Copy note ID",icon:"faClipboard",action:function(){var t=kt.current;t&&Object(P.a)(t)}}]}))),Object(v.c)("div",{className:"dates-wrapper"},Object(v.c)("div",{className:"date modified"},Object(v.c)("h4",null,"Modified"),Object(O.a)(new Date(t.file.modified||0))),Object(v.c)("div",{className:"date created"},Object(v.c)("h4",null,"Created"),Object(O.a)(new Date(t.file.created||0)))),Object(v.c)("div",{className:"path-wrapper"},Object(v.c)("div",{className:"path"},Object(v.c)("h4",null,"Path"),Object(v.c)("span",null," ",t.file.path," ")))))))),Object(v.c)(S.a,{progress:ft}),Object(v.c)("div",{className:"main-editor-wrapper ".concat(B?"with-title-editor":"no-title-editor"," ").concat(t.windowId)},!Dt&&!Rt&&"codemirror"===t.editorType&&Object(v.c)(N.a,{windowId:t.windowId,ref:nt,file:t.file,pluginsConfig:t.pluginsConfig,value:o,posY:t.posY,jumpToLine:Ht||0,forceRender:Tt,onChange:function(t){Yt(),Y(t)},onEvent:function(t){},onScroll:function(n){t.onScroll(n),Qt({x:-9999,y:-9999,from:0,to:0,fromPx:-9999,toPx:-9999})},onTitleClick:t.onTitleClick,onCursorMove:function(t){Qt(t)}}),!Dt&&Rt&&Object(v.c)("div",{className:"codemirror-mobile-fallback"},Object(v.c)("p",null," Note is too long for mobile, the advanced edition features are disabled "),Object(v.c)("textarea",{defaultValue:o,onChange:function(t){Yt(),Y(t.target.value)}}))),Object(v.c)("div",{className:"mobile-text-manip-toolbar-wrapper",style:{top:cn+sn,left:an}},Object(v.c)(_.a,{cursorInfos:Xt,selection:tn,onButtonClicked:function(n,e){if("aiSearch"===n){if(!e.aiConfig)return;var i=e.aiConfig;Object(I.d)((function(n){var e=n.ai.setStatus("new");Object(G.a)({uuid:e,aiBtnConfig:i,typeAnswer:i.typeAnswer,aiCommand:i.command,selectionTxt:tn,file:t.file,windowIdFile:t.windowId,innerFileContent:o,cursorInfos:Xt})}))}else if("calc"===n)Object(d.f)({windowId:t.windowId,file:t.file,fileContent:o,selectionTxt:tn,insertPos:Xt.to});else if("addTableCol"===n)!function(t){var n=$(t);if(n){for(var e=n.linesOfTable,o=n.linesInfos,i=n.colIndex,c=0;c<e.length;c++){var a=e[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(I.d)((function(n){n.file.saveContent(t.file.path,l,{history:!0})}))}}({windowId:t.windowId,file:t.file,fileContent:o,selectionTxt:tn,cursorInfos:Xt});else if("removeTableCol"===n)!function(t){var n=$(t);if(n){for(var e=n.linesOfTable,o=n.linesInfos,i=n.colIndex,c=0;c<e.length;c++){var a=e[c],r=o.lines[a].split("|");r.splice(i,1),o.lines[a]=r.join("|")}var l=o.lines.join("\n");Object(I.d)((function(n){n.file.saveContent(t.file.path,l,{history:!0,withMetas:t.file})}))}}({windowId:t.windowId,file:t.file,fileContent:o,selectionTxt:tn,cursorInfos:Xt});else if("searchEngine"===n){var c=K.d.curr.ui_editor_search_highlight_url;if(!c)return;var a=c+tn;window.open(a,"_blank")}else if("highlightLine"===n)Object(I.d)((function(n){n.ui.note.editorAction.dispatch({windowId:t.windowId,type:"highlightLine",cursorPos:Xt.from})}));else if("undo"===n)Object(I.d)((function(n){n.ui.note.editorAction.dispatch({windowId:t.windowId,type:"undo"})}));else if("redo"===n)Object(I.d)((function(n){n.ui.note.editorAction.dispatch({windowId:t.windowId,type:"redo"})}));else if("proofread"===n)Object(I.d)((function(n){n.ui.floatingPanel.create({type:"ctag",layout:"bottom",ctagConfig:{tagName:"proofread",content:tn,opts:{file:t.file}}})}));else if("copyLineLink"===n)Object(I.d)((function(n){var e=Object(M.a)(t.file,tn);n.popup.prompt({title:"Selection note link",text:'Link to the selected text <br/><br/> <input type="text" value="'.concat(e,'">')})}));else{var r=ot(n);r&&(Yt(),Y(r),Pt())}}})),rt&&at,wt&&Object(v.c)(y.a,{file:t.file,onClose:function(){Ot(!1)}}))},tt=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(j.a.sizes.mobile.editorTopWrapper,"px;"),"\n\t\t\t\t").concat(Object(l.c)("desktop")?"width: calc(200% - ".concat(3*j.a.sizes.block*2,"px);"):"","\n\t\t\t\tpadding: 0px ").concat(Object(l.c)("desktop")?3*j.a.sizes.block:2*j.a.sizes.block,"px;\n\t\t\t\tposition: relative;\n\n\t\t\t\t").concat(et(),"\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(j.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*j.a.sizes.block,"px 0px ").concat(2*j.a.sizes.block,"px;"),"\n ").concat(Object(l.c)("desktop")?"":"margin: 0px 0px ".concat(j.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(j.a.sizes.mobile.editorTopWrapper+j.a.sizes.mobile.editorBar+2*j.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(j.a.font.editor,";\n\t\t\t\t\t\t\tcolor: grey;\n\t\t\t\t\t\t\tfont-size: ").concat(Object(Y.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(j.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 n=Object(a.useContext)(I.a),e=(null===n||void 0===n?void 0:n.status.isConnected)||!1;return Object(a.useMemo)((function(){return Object(v.c)(Q,Object(o.a)({},t,{isConnected:e}))}),[t.noteParentType,t.viewType,t.mobileView,e,t.canEdit,t.editorType,t.windowId,t.file.created,t.file.name,t.file.path,t.file,t.fileContent,t.isActive,t.editorAction])},et=function(){return"\n\n\n.file-path-wrapper {\n\t\tpadding-top: ".concat(Object(l.c)("desktop")?j.a.sizes.block:j.a.sizes.block/2,"px;\n\t\tfont-size: ").concat(Object(Y.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(j.a.colors.main,";\n\t\tfont-size: ").concat(Object(Y.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(j.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(j.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")}},167:function(t,n,e){"use strict";e.d(n,"a",(function(){return H})),e.d(n,"b",(function(){return V}));var o=e(11),i=e(24),c=e(4),a=e(0),r=e.n(a),l=e(37),s=e(94),u=function(t){var n=t.headerLog,e={},o=function(t){e[t]&&delete e[t]};return{notify:function(t){for(var i in e){var c=e[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){n&&console.log("".concat(n," error with function"),r)}}},subscribe:function(t,cb){e[t]=cb},subscribeOnce:function(t,cb){var n="".concat(t,"-once");e[n]=cb},unsubscribe:o}},d=e(93),p=e(43),f=e(18),b=e(14),g=e(17),h=e(9),m=e(30),v={curr:-1},w=setInterval((function(){O(),-1!==v.curr&&clearInterval(w)}),1e3),O=function(cb){Object(h.d)((function(t){t.cache.get("cacheId",(function(t){var n=t||0;v.curr=n,cb&&cb(n)}))}))};Object(m.a)("cache","clean_cache",(function(){Object(m.d)("Cache clean started...","clean_cache"),Object(h.d)((function(t){var cb;t.folders.delete("cache","ctag-ressources"),t.ressource.cleanCache(),t.cache.cleanRamCache(),cb=function(t){Object(m.d)("Cache cleaned successfully (".concat(t,")"),"clean_cache")},Object(h.d)((function(t){t.cache.get("cacheId",(function(n){var e=n||0;t.cache.set("cacheId",e+1,-1,(function(){v.curr=e+1,console.log("cacheId incremented to "+e+1),cb&&cb(v.curr)}))}))}))}))}));var j="[IFRAME PARENT] 00563",x=g.a.client.log.iframe,y=u({headerLog:j}),k=y.notify,_=y.subscribe,C=y.unsubscribe;window.addEventListener("message",(function(t){t.data.subId&&(x&&console.log(j,"parent <== iframe",t.data.data),k(t.data))}));var E={subscribe:_,unsubscribe:C,send:function(t,n){t&&t.contentWindow&&(x&&console.log(j,"parent ==> iframe",n),t.contentWindow.postMessage(n,"*"))}},S=function(t){var n,e="[IFRAME child js]",o={file:null,frameId:"",reloadCounter:0,windowId:"",innerTag:"",tagName:"",tagContent:"",loginToken:t.loginToken,backendUrl:t.backendUrl,ressCacheId:0},i=function(t){if(""===o.frameId)return console.warn(e,"NO FRAME ID, CANNOT SEND TO PARENT");var n={subId:o.frameId,data:t};window.parent.postMessage(n,"*")},c=function(t){var n={error:"CUSTOM TAG/SCRIPT ERROR: ".concat(t)};i({action:"iframeError",data:n})},a={value:"100%"},r=function(t){var n=document.getElementById("content-wrapper"),e=t;if(!e){if(!n||0===n.clientHeight)return;e=n.clientHeight+20}a.value="".concat(e),i({action:"resize",data:{height:e}})},l=function(){var t=document.body,n=t.requestFullScreen||t.webkitRequestFullScreen||t.mozRequestFullScreen||t.msRequestFullScreen;n&&n.call(t)},s=t.createEventBus({headerLog:"[FRAME API] 00567"}),u=s.subscribeOnce,d=s.notify,p=function(t,n){var o,i=t.url;i.includes(".js")?((o=document.createElement("script")).crossorigin="anonymous",o.rel="preload",o.src=i,t.type&&(o.type=t.type)):i.includes(".css")?((o=document.createElement("link")).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")).rel="preload",o.href=i,o.as="fetch",o.crossorigin="anonymous",o.type="application/wasm",t.type&&(o.type=t.type)),o.onload=function(){n()};var 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=function(n,e){var o="?token=".concat(t.loginToken),i=e||t.getRessourceIdFromUrl(n);return"".concat(t.backendUrl,"/static").concat("/.tiro/cache/ctag-ressources/").concat(i).concat(o)},b=function(t,cb){cb||(cb=function(){});for(var n=0,i=function(){if(++n===t.length)try{cb&&cb()}catch(o){console.error(e,"ERROR LoadScript Callback : ".concat(o)),console.log(o),console.log("tried to load scripts:",t)}},c=function(){var n,c=t[a],r=(n=c.constructor===String?{url:c}:JSON.parse(JSON.stringify(c))).fileName,l=f(n.url,r),s=JSON.parse(JSON.stringify(n));s.url=l;var u=!0===window.disableCache;if(u){var d=Math.floor(1e6*Math.random()),b="&nocache=".concat(d,"-").concat(o.ressCacheId);s.url+=b}else{var h="&cacheId=".concat(o.ressCacheId);s.url+=h}var m,v,w,O=function(t){t||(t={}),t.frontendCache||(t.frontendCache=!1),g("ressource.download",[n.url,"/.tiro/cache/ctag-ressources/",{fileName:r}],(function(t){p(s,(function(){i()}))}))};u?(console.warn(e,"CACHE DISABLED (both frontend + backend fetch), DOWNLOADING RESSOURCES EVERYTIME and NOT CACHING THEM ON FRONTEND!"),O({frontendCache:!1})):(m=s.url,v=function(){p(s,(function(){i()}))},w=function(){O({frontendCache:!0})},fetch(m,{method:"HEAD"}).then((function(t){return t.ok?v():w()})).catch((function(t){return w(t)})))},a=0;a<t.length;a++)c()},g=function(n,e,cb){if(!e||!n||e.constructor!==Array||"string"!==typeof n)return c("Call Api : ".concat(n," => wrong arguments type / number(").concat(JSON.stringify({apiName:n,apiArguments:e,cb:cb}),")"));var o="iframe-api-call-".concat(t.generateUUID()," ");u(o,(function(t){cb&&cb(t)})),i({action:"apiCall",data:{reqId:o,apiName:n,apiArguments:e}})},h={version:1.2,call:g,utils:{getInfos:function(){return o},loadCachedRessources:b,getCachedRessourceUrl:f,getRessourceIdFromUrl:t.getRessourceIdFromUrl,loadScripts:function(t,cb){b(t,cb)},loadRessources:function(t,cb){b(t,cb)},loadRessourcesOneByOne:function(t,cb){cb||(cb=function(){});var n=0;!function e(){if(n===t.length)return cb();var o=t[n];b([o],(function(){n++,e()}))}()},loadScriptsNoCache:function(t,cb){for(var n=0,o=function(){var o=t[i],c=document.createElement("script");c.src=o,c.onload=function(){if(++n===t.length)try{cb&&cb()}catch(i){console.error(e,"ERROR LoadScript Callback : ".concat(i),o),console.log(i)}};var a=document.getElementById("external-ressources-wrapper");a&&a.appendChild(c)},i=0;i<t.length;i++)o()},resizeIframe:r,fullscreenIframe:l,canScrollIframe:function(t){i({action:"canScrollIframe",data:{status:t}})},loadCustomTag:function(t,n,e){var o=h.utils.createDiv(),i=o.div,c=o.updateContent;e||(e={}),e.base_url=t.split("/").slice(0,-1).join("/").replace("//","/"),e.plugins_root_url=e.base_url.split("/").slice(0,-1).join("/").replace("//","/");var a=!0;return!1===e.padding&&(a=e.padding),h.utils.loadScripts([t],(function(){var t=window.initCustomTag("".concat(n),e);a&&(t='<div class="with-padding" style="padding: 0px 15px;">'.concat(t,"</div>")),c(t)})),i},uuid:t.generateUUID,createDiv:function(){var n="ctag-content-wrapper-".concat(t.generateUUID()," ");return{div:'<div id="'.concat(n,'"></div>'),updateContent:function t(e){var o=document.getElementById(n);o?o.innerHTML=e:setTimeout((function(){t(e)}),100)}}}}};return window.api=h,n={init:function(n){o.frameId=n.frameId,o.innerTag=n.innerTag,o.tagContent=n.tagContent,o.tagName=n.tagName,o.file=n.file,o.reloadCounter=n.reloadCounter,o.windowId=n.windowId,o.ressCacheId=n.ressCacheId;var i,a=document.getElementById("content-wrapper");if(a){var l=t.unescapeHtml(a.innerHTML),s=(i=l,t.replaceCustomMdTags(i,"[[script]]",(function(t){var n="".concat(t);try{return new Function(n)()}catch(o){console.warn(e,"[SCRIPT] error: ".concat(o),n),c("".concat(o,' in Code "').concat(n,'"'))}})));a.innerHTML=s,setTimeout((function(){r()}),100),t.bindToElClass("title-search-link",(function(t){var n=t.dataset.file,e=t.dataset.folder,o=t.dataset.windowid;h.call("ui.browser.goTo",[e,n,{openIn:o}])}))}},askFullscreen:l,apiAnswer:function(t){var n={subId:t.reqId,data:t.data};d(n)}},window.onmessage=function(t){var e=t.data;if(e)for(var o in n)n&&n[o]&&o===e.action&&n[o](t.data.data)},h},T=e(81),I=e(34),P=e(111),N=e(286),A=e(128),R=e(56);g.a.client.log.verbose;var F=["epub","pdf","iframe","web","smartlist","proofread","datatable","forms"],L=function(t,cb){Object(h.d)((function(n){n.file.getContent("/.tiro/tags/".concat(t,".md"),(function(t){cb(t)}),{onError:function(){F.includes(t)?function(t,cb){var n="https://raw.githubusercontent.com/dotgreg/tiro-notes/dev/plugins/".concat(t,"/").concat(t,".ctag.js"),e="";"epub"===t&&(e='open:true, size: "80%"'),"pdf"===t&&(e="open:true"),"web"===t&&(e='"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(n,'",`{{innerTag}}`,{').concat(e,"})\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)}})}))},M=e(12),D=e(1),z=(g.a.client.log.verbose,{}),B={},W=["latex","l"],U=function(t){var n="tag"===t.block.type&&!W.includes(t.block.tagName||""),e=Object(a.useState)(null),o=Object(c.a)(e,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),m=g[0],v=g[1];Object(a.useEffect)((function(){var e,cb;n&&(v("loading"),"script"===t.block.tagName?(l("\n[[script]]".concat(t.block.content,"[[script]]")),setTimeout((function(){v("loaded")}),100),t.block.content=""):t.block.tagName&&(e=t.block.tagName,cb=function(t){t?(l(t),setTimeout((function(){v("loaded")}),100)):l(null)},Object(h.d)((function(t){t.plugins.get(e,"tag",(function(t){t&&"tag"===t.type?cb(t.code):("iframe"===e&&(e="web"),L(e,(function(t){cb(t)})))}))}))))}),[t.windowId,t.block.content]);var w="l"===t.block.tagName||"latex"===t.block.tagName;return Object(a.useEffect)((function(){if(!n){var e=s.b.render({raw:t.block.content,file:t.file,windowId:t.windowId});w&&(e="[[l]]".concat(t.block.content,"[[l]]")),f(e)}}),[t.windowId,t.file,t.block]),Object(D.c)("span",{className:"content-block ".concat(n?"block-tag":"block-text"," ")},"loaded"===m&&n&&r&&Object(D.c)(q,Object(i.a)({},t,{noteTagContent:r})),!n&&p&&Object(D.c)("span",{className:"content-block-text",dangerouslySetInnerHTML:{__html:p}}))},H=r.a.memo(U,(function(t,n){var e=!0;return JSON.stringify(t.block)!==JSON.stringify(n.block)&&(e=!1),t.block.content!==n.block.content&&(e=!1),t.file.path!==n.file.path&&(e=!1),t.windowId!==n.windowId&&(e=!1),e})),q=function(t){var n=Object(o.a)({},t).noteTagContent,e=Object(a.useState)(""),i=Object(c.a)(e,2),g=i[0],w=i[1],O=Object(a.useRef)(null),j=Object(a.useState)(""),x=Object(c.a)(j,2),y=x[0],k=x[1],_=Object(a.useState)(!1),C=Object(c.a)(_,2),F=C[0],L=C[1],W=Object(a.useState)(null),U=Object(c.a)(W,2),H=U[0],q=U[1],V=Object(a.useState)(!1),J=Object(c.a)(V,2),G=J[0],K=J[1],Y=function(){var n,e,o=function(n){G&&t.onIframeMouseWheel(n)};return null===(n=O.current)||void 0===n||null===(e=n.contentDocument)||void 0===e||e.addEventListener("mousewheel",o),function(){var t,n;return null===(t=O.current)||void 0===t||null===(n=t.contentDocument)||void 0===n?void 0:n.removeEventListener("mousewheel",o)}};Object(a.useEffect)(Y,[t.yCnt,G]);var $=Object(a.useState)("relativeToParent"),Z=Object(c.a)($,2),X=Z[0],Q=Z[1],tt=Object(a.useRef)("relativeToParent"),nt=function(t){tt.current=t,Q(t)},et=Object(a.useState)(0),ot=Object(c.a)(et,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(n,e){var o=document.querySelector(".window-id-sizeref-".concat(t.windowId));o&&function(t,n){var e=Object(P.a)(n,200);new ResizeObserver((function(){return e()})).observe(t)}(o,(function(){var t=o.getBoundingClientRect();e(t)}))},dt=function(n,e){if("fixed"!==tt.current||"parent"!==e){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(N.a)(n)&&n.endsWith("%")){var r=parseInt(n.replace("%",""))/100;o=a.height*r}else Object(N.a)(n)&&n.endsWith("px")?o=parseInt(n.replace("px","")):Object(A.a)(n)?o=n:(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&&(l/=2);var s="".concat(o-=35,"px"),u="".concat(l,"px");ct(s),st(u),L(!0)}}},pt=Object(I.a)((function(e){Y(),k(e),q(null),ut(0,(function(t){dt(t.height,"parent")})),E.subscribe(e,(function(t){if("resize"===t.action){var n=t.data;Object(N.a)(n.height)&&n.height.endsWith("%")?nt("relativeToParent"):nt("fixed"),dt(n.height,"iframe")}if("canScrollIframe"===t.action){var e=t.data;K(e.status)}if("apiCall"===t.action){var o=t.data;Object(h.b)(o,(function(n,e){if("nok"===n)return q(e.error);var o={reqId:t.data.reqId,data:e};E.send(O.current,{action:"apiAnswer",data:o})}))}if("iframeError"===t.action){var i=t.data.error;q(i),Object(m.d)("".concat(i))}})),setTimeout((function(){var o={file:t.file,innerTag:t.block.content,windowId:t.windowId,frameId:e,reloadCounter:ht,tagContent:n,tagName:t.block.tagName||"",loginToken:Object(f.b)(),backendUrl:Object(b.c)(),ressCacheId:v.curr};E.send(O.current,{action:"init",data:o})}),100)}),500),ft=function(){var e=s.b.render({raw:n,windowId:t.windowId,file:t.file}),o='\n<html>\n\t\t<div id="content-wrapper">\n\t\t\t\t'.concat(e,'\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(v.curr,"\n\t\t\t\tconst main = ").concat(S.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(T.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(R.a)(i,[["{{innerTag}}",t.block.content.trim()]]),w(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(){L(!1),ft();var t="iframe-".concat(Object(l.a)());return pt(t),function(){E.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(){z[jt]?_t(!0):z={},B[jt]?Tt(!0):z={}}),[]);var xt=Object(a.useState)(!1),yt=Object(c.a)(xt,2),kt=yt[0],_t=yt[1],Ct=Object(a.useState)(!1),Et=Object(c.a)(Ct,2),St=Et[0],Tt=Et[1],It=function(t){t||(t=!St),B[jt]=t,Tt(t),_t(!1)};Object(a.useEffect)((function(){t.ctagFullscreen&&It(!0)}),[t.ctagFullscreen]);var Pt=Object(l.a)();return Object(D.c)(r.a.Fragment,null,St&&Object(D.c)("div",{className:"fullscreen-pin-bg",onClick:function(n){It(!1),t.ctagOnFullscreenClose&&t.ctagOnFullscreenClose()}}),Object(D.c)("div",{className:"iframe-view-wrapper ".concat(F?"can-show":"hide"," iframe-tag-").concat(t.block.tagName," ").concat(kt?"pinned":"not-pinned"," ").concat(St?"pinned fullscreen":"not-fullscreen"," ").concat(Object(M.e)()?"mobile":"")},!wt&&Object(D.c)("iframe",{onMouseLeave:function(t){!function(t,n){var e=document.getElementById(n);e&&e.focus({preventScroll:!0})}(0,Pt)},ref:O,id:y,"data-testid":"iframe",title:y,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(D.c)("div",{className:"iframe-error"},Object(D.c)("code",null,Object(D.c)("pre",null,H))),Object(D.c)("input",{className:"refocus-input",id:Pt,type:"text"})))},V=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,n,e){"use strict";e.d(n,"a",(function(){return o}));var o={version:"0.43.41",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}}},173:function(t,n,e){"use strict";e.d(n,"a",(function(){return o}));var o=function(t){!function(){var t=document.getElementById("icon-page");t&&t.remove()}(),function(t){var n=document.createElement("link");n.rel="icon",n.href=t,n.id="icon-page",document.getElementsByTagName("head")[0].appendChild(n)}(t)}},18:function(t,n,e){"use strict";e.d(n,"b",(function(){return m})),e.d(n,"c",(function(){return v})),e.d(n,"a",(function(){return O})),e.d(n,"d",(function(){return j}));var o=e(4),i=e(38),c=e(0),a=e.n(c),r=e(17),l=e(67),s=e(53),u=e(142),d=e(14),p=e(20),f=e(46),b=e(9),g=e(61),h=e(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 n=Object(c.useState)(!1),e=Object(o.a)(n,2),r=e[0],u=e[1],v=Object(c.useState)(""),O=Object(o.a)(v,2),j=O[0],x=O[1],y=Object(c.useState)(""),k=Object(o.a)(y,2),_=k[0],C=k[1],E=Object(c.useState)(),S=Object(o.a)(E,2),T=S[0],I=S[1],P=Object(c.useRef)(0);Object(c.useEffect)((function(){return P.current=d.b.on("getLoginInfos",(function(n){switch(n.code){case"SUCCESS":if(!n.token)return;w(n.token),u(!1),t.onLoginSuccess();break;case"WRONG_TOKEN":u(!0),I(["error",p.a.loginForm.wrongToken]);var e=n.loginInfos;null!==e&&void 0!==e&&e.demo_mode&&(x("viewer"),C(e.viewer_password)),t.onLoginAsked();break;case"WRONG_USER_PASSWORD":I(["error",p.a.loginForm.wrongUserPassword]),u(!0)}})),function(){d.b.off(P.current)}}),[]);var N=Object(g.a)("user-password-cache-ls",{}),A=Object(o.a)(N,2),R=A[0],F=A[1];Object(c.useEffect)((function(){if(r){var t=Object(f.d)().dic,n="__HARDCODED_LOGIN_LS_PASSWORD_0129dsfaf1029__";t.l1&&t.l2&&t.l1.value&&t.l2.value&&Object(b.d)((function(e){var o,c,a=t.l1.value+t.l2.value;if(R[a])o=R[a].usr,c=R[a].pass;else if(o=e.encryption.decryptUrlParam(t.l1.value,n).plaintext,c=e.encryption.decryptUrlParam(t.l2.value,n).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:_,token:m()})},M=Object(c.useState)(1),D=Object(o.a)(M,2),z=D[0],B=D[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:_,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])))))}}}},184:function(t,n,e){"use strict";e.d(n,"b",(function(){return b})),e.d(n,"a",(function(){return g}));var o=e(15),i=e(38),c=e(672),a=e(17),r=e(30),l="tiro-ls-id-",s=function(t,n){var e=JSON.stringify(n);localStorage.setItem(l+t,e)},u="local_node_history",d="[".concat(u.toUpperCase(),"]"),p=a.a.client.log.verbose,f="notes-history-ls",b=function(t){var n=[],e=Object(i.a)(function(t){var n,e=window.localStorage.getItem(l+t);return e&&(n=JSON.parse(e)),n||null}(f));e&&(n=t?e.filter((function(n){return n.path===t})):e);return n},g=function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:6,e=arguments.length>2?arguments[2]:void 0;if(!t.content.includes("--disable-history--")){var i=t,c=b(),a=b(i.path);e&&console.log(d,"adding el to ls : ",{itAdd:i}),c=c.filter((function(t){return t.path!==i.path})),a.unshift(i),a.length>n&&(a=a.slice(0,n)),c=[].concat(Object(o.a)(a),Object(o.a)(c));var r=h(c,3);s(f,r)}},h=function t(n,e){var o=n,i=JSON.stringify(o);return m(i)>e&&o.length>1?(o.pop(),p&&console.log(d,"recursivelyReduceArrTillSmallerThan REDUCE ARR > new length=",o.length),t(o,e)):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],n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"/woopy/doopy",e={timestamp:Date.now(),path:n,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(e,10,t)})),Object(r.a)(u,"addLocalNoteHistorySeveral",(function(){for(var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:10,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"/woopy/doopy",o=0;o<t;o++)Object(r.c)(u,"addLocalNoteHistory")(n,e)})),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"))}))},188:function(t,n,e){"use strict";e.d(n,"a",(function(){return u})),e.d(n,"b",(function(){return d}));var o=e(569),i=e(26),c=(e(0),e(10)),a=e(23),r=e(136),l=e(25),s=e(1),u=function(t){var n="faPaperclip";"image"===t.type&&(n="faImage"),"camera"===t.type&&(n="faCamera"),"microphone"===t.type&&(n="faMicrophone");var e="*";"image"===t.type&&(e="image/*"),"camera"===t.type&&(e="image/*"),"microphone"===t.type&&(e="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:e,onChange:function(n){var e=n.target.files;0!==e.length&&Object(i.a)(e,(function(n,e){Object(r.b)({fileToUpload:n,folder:t.file.folder,windowId:t.windowId})}))}}),Object(s.c)("label",{htmlFor:"file-".concat(c)},Object(s.c)(a.a,{name:n}),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")}},189:function(t,n,e){"use strict";e.d(n,"a",(function(){return o}));var o=function(t,n){var e=n?"|".concat(n):"";return"[link|".concat(t.realname," ").concat(t.folder).concat(e,"]\n")}},190:function(t,n,e){"use strict";e.d(n,"a",(function(){return s})),e.d(n,"b",(function(){return d}));var o=e(11),i=e(71),c=e(9),a=e(128),r="tiro-analytics",l=function(cb){Object(c.d)((function(t){t.cache.get(r,(function(t){var n={};t&&(n=t),cb(n)}))}))},s=function(t){var n=Object(i.c)();l((function(e){var i,l=Object(o.a)({},e);l[n[0]]||(l[n[0]]={}),l[n[0]][n[1]]||(l[n[0]][n[1]]={}),l[n[0]][n[1]][n[2]]||(l[n[0]][n[1]][n[2]]={}),Object(a.a)(l[n[0]][n[1]][n[2]][t])?l[n[0]][n[1]][n[2]][t]++:l[n[0]][n[1]][n[2]][t]=1,i=l,Object(c.d)((function(t){t.cache.set(r,i,-1)}))}))},u=function(cb,t){t||(t={});t.start?t.start:Object(i.c)(Object(i.b)("lastMonth")),t.end?t.end:Object(i.c)();l((function(t){cb(t)}))},d=function(t){return{log:s,report:u}}},20:function(t,n,e){"use strict";e.d(n,"a",(function(){return o}));var o=e(17).a.strings},212:function(t,n,e){"use strict";e.d(n,"a",(function(){return r}));var o=e(26),i=e(29),c=e(43),a=e(46),r=function(t,n){var e=t.match(i.a.image),r=[];return Object(o.a)(e,(function(t){var e=t.match(i.a.firstPartImg),o=e&&e[0]?e[0].replace("![","").replace("]","").replace("(",""):"",l=t.replace(i.a.firstPartImg,"").replace(")",""),s={url:Object(a.b)(Object(c.a)(n.folder)+"/"+l),title:o,file:n};r.push(s)})),r}},215:function(t,n,e){"use strict";e.d(n,"a",(function(){return l}));var o=e(372),i=e(5),c=e(10),a=e(122),r=e(28),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})},216:function(t,n,e){"use strict";e.d(n,"a",(function(){return u})),e.d(n,"b",(function(){return d}));var o=e(4),i=e(0),c=e(53),a=e(20),r=e(10),l=e(67),s=e(1),u=function(t){var n=Object(i.useState)(""),e=Object(o.a)(n,2),r=e[0],u=e[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 ")}},217:function(t,n,e){"use strict";e.d(n,"a",(function(){return i}));var o=e(374),i=function(t){return t||(t=0),Object(o.isNumber)(t)?t+1:0}},219:function(t,n,e){"use strict";e.d(n,"b",(function(){return a})),e.d(n,"a",(function(){return r}));var o=e(4),i=e(111),c=e(0),a=function(){var t=Object(c.useState)(!1),n=Object(o.a)(t,2),e=n[0],a=n[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:e,resizeCount:r}},r=function(t){var n=Object(c.useState)(!1),e=Object(o.a)(n,2),a=e[0],r=e[1];return Object(c.useEffect)((function(){var n,e=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){(n=new ResizeObserver((function(t){e()}))).observe(t)}(i),clearInterval(c)),(o+=1)>5&&clearInterval(c)}),200);return function(){n&&n.disconnect()}}),[]),{resizeState:a}}},220:function(t,n,e){"use strict";e.d(n,"b",(function(){return o})),e.d(n,"a",(function(){return i}));var o=function(t,n){c(t,(function(t){t&&n(t)}))},i=function(t){var n=t.value;navigator&&navigator.clipboard&&navigator.clipboard.writeText(n).then((function(){console.log("Text copied to clipboard...")})).catch((function(t){console.log("Something went wrong",t)}))},c=function(t,n){0==t.clipboardData&&"function"==typeof n&&n(void 0);var e=t.clipboardData.items;void 0==e&&"function"==typeof n&&n(void 0);for(var o=!1,i=0;i<e.length;i++){var c=e[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!=e[i].type.indexOf("image")){console.log("[PASTE] informations on files pasted : ",t,e,e.length);var a=e[i].getAsFile();"function"==typeof n&&n(a)}}}},221:function(t,n,e){"use strict";e.d(n,"b",(function(){return m})),e.d(n,"a",(function(){return v}));var o=e(24),i=e(4),c=e(0),a=e(81),r=e(166),l=e(68),s=e(12),u=e(222),d=e(9),p=e(34),f=e(10),b=e(75),g=e(1),h=function(t){var n=Object(c.useState)(""),e=Object(i.a)(n,2),o=e[0],d=e[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),y=Object(i.a)(x,2),k=y[0],_=y[1];return Object(c.useEffect)((function(){_(!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(){_(!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(n,e){t.onFileEdited(n,e),O(e)},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,n){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\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 n=Object(c.useContext)(d.a),e=(null===n||void 0===n?void 0:n.ui.note.editorAction.get)||null;return Object(g.c)(h,Object(o.a)({},t,{editorAction:e}))}},222:function(t,n,e){"use strict";e.d(n,"a",(function(){return u})),e.d(n,"b",(function(){return d}));var o=e(3),i=e(4),c=e(0),a=e(133),r=e.n(a),l=e(68),s=e(1),u=function(t){var n=Object(c.useState)(0),e=Object(i.a)(n,2),a=e[0],u=e[1],d=Object(c.useRef)(null),p=Object(c.useRef)(null),f=function(){var t={maxY:0,y:0,percent:0},n=p.current?p.current:null,e=d.current?d.current:null;if(!e||!n)return t;var o=e.getBoundingClientRect().height,i=n.getBoundingClientRect().y;return t.maxY=n.getBoundingClientRect().height-o,t.y=e.getBoundingClientRect().y-i,t.percent=t.y/t.maxY*100,t};Object(c.useEffect)((function(){var n=p.current?p.current:null;if(n){var e=new MutationObserver((function(n,e){var i,c=Object(o.a)(n);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 e.observe(n,{attributes:!0}),function(){e.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(n){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"}},223:function(t,n,e){"use strict";e.d(n,"a",(function(){return r}));var o=e(27),i=e(17),c=e(18),a=e(14),r=function(t){return Object(o.b)("".concat(Object(a.c)(),"/").concat(i.a.path.staticResources,"/").concat(t,"?token=").concat(Object(c.b)()))}},224:function(t,n,e){"use strict";e.d(n,"a",(function(){return a})),e.d(n,"b",(function(){return r}));e(0);var o=e(10),i=e(23),c=e(1),a=function(t){var n=t.dir?t.dir:"left",e=t.maxHeight?t.maxHeight:50;return Object(c.c)("div",{className:"dropdown-wrapper ".concat(n," ").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:e}},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")}},225:function(t,n,e){"use strict";e.d(n,"a",(function(){return a})),e.d(n,"b",(function(){return r}));var o=e(0),i=e.n(o),c=e(1),a=function(t){var n=t.progress,e=n>=0&&n<100;return Object(c.c)(i.a.Fragment,null,e&&Object(c.c)("div",{className:"upload-progress-bar-wrapper"},Object(c.c)("div",{className:"bg-fill",style:{width:"".concat(n,"%")}}),Object(c.c)("div",{className:"label"},n,"% 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"}},226:function(t,n,e){"use strict";e.d(n,"b",(function(){return s})),e.d(n,"a",(function(){return d}));var o=e(29),i=e(9),c=e(12),a=e(33),r=e(10),l=e(45),s=function(t,n){return Object(l.a)({file:t,windowId:n,pattern:o.a.hashtag,replacement:function(n){var e=n.matchs,o=document.createElement("span");return o.classList.add("cm-hashtag"),o.innerHTML='<span class="hash-inner" \n data-hashtag="'.concat(e[1],'"\n data-hashtag2="').concat(e[0],'"\n data-folder="').concat(t.folder,'"\n onclick="').concat(Object(a.c)("open-win-smartlist-hashtag",u),'" >').concat(e[0],"</a>"),o},options:{isAtomic:!1}})},u=function(t){if(t){var n=t.dataset.hashtag2,e=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(n," | ").concat(e)}})}))}},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")}},227:function(t,n,e){"use strict";e.d(n,"a",(function(){return s})),e.d(n,"b",(function(){return d}));var o=e(29),i=e(9),c=e(33),a=e(10),r=e(45),l=e(25),s=function(t,n){return Object(r.a)({file:t,windowId:n,pattern:o.a.dateFrFormat,replacement:function(t){var e=t.matchs,o=(t.view,t.pos),i=document.createElement("span"),a=e[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(n,'" 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 n=t.dataset.replacepos,e=t.dataset.windowid;console.log("el",t.value,n);var o=t.value.split("-"),c="".concat(o[2],"/").concat(o[1],"/").concat(o[0]);if(-1===(n=parseInt(n)||-1))return console.warn("no pos");Object(i.d)((function(t){console.log("replacedatetext",c,n),t.ui.note.editorAction.dispatch({windowId:e,type:"replaceText",replaceText:c,replacePos:n})}))}},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")}},228:function(t,n,e){"use strict";e.d(n,"a",(function(){return r})),e.d(n,"b",(function(){return s}));var o=e(29),i=e(9),c=e(33),a=e(45),r=function(t,n){return Object(a.a)({file:t,windowId:n,pattern:o.a.checkbox,replacement:function(t){var e=t.matchs,o=(t.view,t.pos),i=document.createElement("span"),a=e[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(n,'" value="" ')+'onchange="'.concat(Object(c.c)("replace-checkbox-todo-text",l),'"/></span>'),i},options:{cache:!1}})},l=function(t){if(t){var n=t.dataset.replacepos,e=t.dataset.windowid,o=t.dataset.ischecked;if(-1===(n=parseInt(n)||-1))return console.warn("no pos");Object(i.d)((function(t){t.ui.note.editorAction.dispatch({windowId:e,type:"replaceText",replaceText:"true"===o?"[ ]":"[x]",replacePos:n})}))}},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"}},229:function(t,n,e){"use strict";e.d(n,"a",(function(){return u})),e.d(n,"b",(function(){return d}));var o=e(27),i=e(29),c=e(33),a=e(72),r=e(56),l=e(10),s=e(45),u=function(t,n){return Object(s.a)({file:t,windowId:n,pattern:i.a.userCustomTagFull2,replacement:function(e){var i=document.createElement("span");return i.innerHTML=function(t,n,e){var i=t[2].replaceAll("[[","").replaceAll("]]",""),l=t[0].replaceAll("[[".concat(i,"]]"),""),s=function(t,n,e){return"".concat(Object(r.b)(t,""),"-").concat(Object(r.b)(n,""),"-").concat(Object(r.b)(e,""))},u=s(i,l,n.path),d="ress-".concat(u);Object(c.a)(n,u,(function(){var t=document.querySelector(".".concat(d," .iframe-wrapper-cm-ctag"));if(t){var o=Object(a.b)(i,l,e,{file:n});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 n=t.dataset.filepath,e=decodeURIComponent(t.dataset.tagcontent),i=t.dataset.tagname,r=t.dataset.windowid,l=s(i,e,n),u=Object(o.e)(n),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,e,r,{file:u});Object(a.c)(d,f)}})),'"\n\t\tdata-filepath="').concat(n.path,'"\n\t\tdata-windowid="').concat(e,'"\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>")}(e.matchs,t,n),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")}},23:function(t,n,e){"use strict";e.d(n,"b",(function(){return r})),e.d(n,"c",(function(){return l})),e.d(n,"a",(function(){return s}));var o=e(0),i=e.n(o),c=e(33),a=e(1),r=function(t){var n=t.name,e=n.endsWith(".svg")||n.endsWith(".png")||n.endsWith(".jpg"),o=t.size?t.size:1;return o-=.2,n.startsWith("fa")&&(n=n.substr(2)),n[0]===n[0].toUpperCase()&&(n=n[0].toLowerCase()+n.substr(1)),n=n.replace(/[A-Z]/g,(function(t){return"-".concat(t.toLowerCase())})),Object(a.c)("span",{style:{transform:"scale(".concat(o,")"),display:"inline-block"}},!e&&Object(a.c)("span",{className:"icon-2-wrapper icon-wrapper",title:t.label,dangerouslySetInnerHTML:{__html:Object(c.d)(n)},style:{color:t.color||"#797979"}}),e&&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\t.icon-wrapper{\n\t\tdisplay: inline-block;\n\t}\n"},s=i.a.memo(r,(function(t,n){return JSON.stringify(t)===JSON.stringify(n)}))},230:function(t,n,e){"use strict";e.d(n,"a",(function(){return c})),e.d(n,"b",(function(){return a}));var o=e(29),i=e(45),c=function(t,n){return Object(i.a)({file:t,windowId:n,pattern:o.a.boldOrStrike,replacement:function(t){var n=t.matchs,e=(t.view,t.pos,document.createElement("span"));e.classList.add("markdown-synthax-cm-wrapper");var o="";n[0].startsWith("***")?o="***":n[0].startsWith("**")?o="**":n[0].startsWith("~~")?o="~~":n[0].startsWith("__")?o="__":n[0].startsWith("*")&&(o="*"),"**"===o&&e.classList.add("bold"),"~~"===o&&e.classList.add("strike"),"__"===o&&e.classList.add("bold"),"*"===o&&e.classList.add("italic"),"***"===o&&e.classList.add("bold_and_italic");var i=n[0];return i=i.replaceAll(o,""),e.innerHTML="".concat(i),e},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"}},231:function(t,n,e){"use strict";e.d(n,"a",(function(){return h})),e.d(n,"b",(function(){return m}));var o=e(11),i=e(15),c=e(4),a=e(0),r=e(62),l=e(10),s=e(47),u=e(12),d=e(28),p=e(25),f=e(77),b=e(26),g=e(1),h=function(t){var n=Object(a.useState)(!1),e=Object(c.a)(n,2),p=e[0],h=e[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(n){O(!1),t.onButtonClicked(n)},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")}}]},y=[{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 _=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)))};_&&(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 E=d.d.curr.ui_editor_ai_text_selection,S=function(){var n=[];if(d.d.curr.ui_editor_live_watch&&E){var e=Object(f.b)();Object(b.a)(e,(function(e){n.push({icon:e.icon,title:e.title,action:function(){t.onButtonClicked("aiSearch",{aiConfig:e}),h(!1)}})}))}return n},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)(S()))).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 P=Object(o.a)({},C);P.class="separator-right",d.d.curr.ui_editor_live_watch&&y.push(P),d.d.curr.ui_editor_search_highlight_enable&&y.push({icon:"search",title:"Search selection",action:function(){t.onButtonClicked("searchEngine"),h(!1)}}),y.push(T),y.push(I),y=[].concat(Object(i.a)(y),Object(i.a)(S()))}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:y,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")}},232:function(t,n,e){"use strict";e.d(n,"a",(function(){return x})),e.d(n,"b",(function(){return y}));var o=e(15),i=e(4),c=e(26),a=e(570),r=e(0),l=e.n(r),s=e(165),u=e(9),d=e(18),p=e(91),f=e(71),b=e(184),g=e(14),h=e(20),m=e(10),v=e(23),w=e(53),O=e(25),j=e(1),x=function(t){var n=Object(r.useState)([]),e=Object(i.a)(n,2),m=e[0],O=e[1],x=Object(r.useState)(!1),y=Object(i.a)(x,2),k=y[0],_=y[1],C=function(){var n=E();O([].concat(n)),_(!0),g.b.emit("askFileHistory",{filepath:t.file.path,token:Object(d.b)()});var e=g.b.on("getFileHistory",(function(t){var i=[];Object(c.a)(t.files,(function(t){var n,e=null===(n=t.filenameWithoutExt)||void 0===n?void 0:n.split("___")[1];e&&(t.created=Object(s.a)(e).num.timestamp),t.created&&t.created<Date.now()&&i.push(t)}));var r=Object(a.a)(i,["created"],["desc"]);O([].concat(n,Object(o.a)(r))),_(!1),g.b.off(e)}))},E=function(){var n=[],e=Object(b.b)(t.file.path);return Object(c.a)(e,(function(t,e){var o=e+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,n.push(i)})),console.log("getLSHistoryList",e,t.file.path),n};Object(r.useEffect)((function(){C()}),[]);var S=Object(r.useContext)(u.a),T=Object(r.useState)(""),I=Object(i.a)(T,2),P=I[0],N=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?(N(t.localContent),L(t)):S&&S.file.getContent(t.path,(function(n){N(n),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(n){n.file.delete(t,(function(t){C(),L(null),N("")}))}))}(t)}}," ",Object(j.c)(v.a,{name:"faTrash",color:"grey"})," ")))}))))),P&&Object(j.c)(l.a.Fragment,null,Object(j.c)("div",{className:"note-preview"},Object(j.c)("textarea",{className:"note-preview-textarea",value:P}),Object(j.c)("div",{className:"button-wrapper"},Object(j.c)("button",{className:"button",onClick:function(){Object(u.d)((function(n){n.file.saveContent(t.file.path,P)}))}},"Restore version")),Object(j.c)("div",{className:"advice"},' To disable history backup for a note, add "--disable-history--"in it')))))},y=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")}},234:function(t,n,e){"use strict";e.d(n,"a",(function(){return l})),e.d(n,"b",(function(){return s}));var o=e(14),i=e(18),c=e(9),a=e(37),r="[NOTIFICATIONS]",l={},s=function(t){return{emit:function(t,cb){var n,e=function(){var n;if(console.log(r,"emitNotification",t),null!==(n=t.options)&&void 0!==n&&n.onClick){var e,c="notif-onclick-fnid-".concat(t.id,"-").concat(Object(a.a)());l[c]=null===(e=t.options)||void 0===e?void 0:e.onClick,t.options.onClickId=c}cb&&cb(),o.b.emit("emitNotification",{notification:t,token:Object(i.b)()})};null!==(n=t.options)&&void 0!==n&&n.showOnceEvery&&t.id?Object(c.d)((function(n){var o="notif-showevery-".concat(t.id);n.cache.get(o,(function(i){var c;if(i&&!0===i.alreadyShown)return console.log(r,"showOnceEvery => already shown notif, dont reshow it",t);e(),n.cache.set(o,{alreadyShown:!0},null===(c=t.options)||void 0===c?void 0:c.showOnceEvery)}))})):e()}}}},239:function(t,n,e){"use strict";e.d(n,"a",(function(){return g})),e.d(n,"b",(function(){return h}));var o=e(4),i=e(11),c=e(170),a=e(26),r=e(38),l=e(0),s=e.n(l),u=e(9),d=e(20),p=e(124),f=e(1);var b={upload:{uploadCounter:0,reinit:function(){}},file:{onTitleUpdate:function(t,n){},onFileDelete:function(t){}}},g=s.a.createContext(b),h=function(t){var n=Object(i.a)({},t).tab,e=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),n=Object(l.useState)({name:"",data:{}}),e=Object(o.a)(n,2),i=e[0],c=e[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,n){var e=t.ui.browser.folders.current.get();e===n.folder&&(t.ui.browser.goTo(e,n.name,{openIn:"activeWindow"}),O({name:"checkIfNoWindows"}))})),j("checkIfNoWindows",(function(t){0===n.grid.content.length&&t.tabs.close(n.id)}));var x=Object(r.a)(h);x.file.onFileDelete=function(t){e&&e.popup.confirm("".concat(d.a.trashNote),(function(){var n;null===(n=e.lastNotesApi)||void 0===n||n.removeFile(t.path),e.file.delete(t,(function(n){e.ui.windows.getIdsFromFile(t.path),n[n.length-1];var o=n[0];Object(a.a)(n,(function(t){t.modified&&o.modified&&t.modified>o.modified&&(o=t)})),O({name:"refreshFolderList",data:o})}))}))},x.file.onTitleUpdate=function(t,n){e&&e.file.move(t,n,(function(o){var i,c=null;if(Object(a.a)(o,(function(t){t.path===n&&(c=t)})),c){var r=e.ui.windows.getIdsFromFile(t);e.ui.windows.updateWindows(r,c),null===(i=e.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 y=Object(l.useState)(0),k=Object(o.a)(y,2),_=k[0],C=k[1];return Object(l.useEffect)((function(){C(_+1)}),[n.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:_,grid:n.grid,onGridUpdate:t.onGridUpdate,mobileView:t.mobileView}))))},m=Object(c.a)("div",{target:"ejnwhwz0"})({name:"zk0z9r",styles:"height:100%;.window-grid-wrapper{height:100%;}"})},242:function(t,n,e){"use strict";e.d(n,"b",(function(){return p})),e.d(n,"a",(function(){return f}));var o=e(4),i=e(0),c=e.n(i),a=e(12),r=e(10),l=e(23),s=e(176),u=e(1),d=function(t){var n=Object(i.useState)(""),e=Object(o.a)(n,2),c=e[0],d=e[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 n=function(t){var n=t;return n.replace(/[^A-Za-z0-9_\ \-\u00a9\u00ae\u2000-\u3300\ud83c\ud000-\udfff\ud83d\ud000-\udfff\ud83e\ud000-\udfff]/g,"")}(t.target.value);d(n),g(!0)},onKeyDown:function(n){if(!1!==h&&"Enter"===n.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,n){var e=!1;return t.title!==n.title&&(e=!1),e}))},25:function(t,n,e){"use strict";e.d(n,"a",(function(){return c}));var o=e(28),i=e(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}},27:function(t,n,e){"use strict";e.d(n,"b",(function(){return o})),e.d(n,"e",(function(){return i})),e.d(n,"d",(function(){return c})),e.d(n,"a",(function(){return a})),e.d(n,"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 n=function(t){var n=t.split("/"),e=t.split("\\"),o=n.length>e.length?n:e,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),e=n.extension?"file":"folder";return{path:n.path,realname:n.filename,nature:e,name:n.filename,extension:n.extension,folder:n.folder,filenameWithoutExt:n.filenameWithoutExt}},c=function(t){var n=t.match(/(.*)[\/\\]/),e=n?n[1]+"/":"";return o(e)},a=function(t,n){return o(t+"/")===o(n+"/")},r=function(t){return t.replace(/[^a-zA-Z0-9]/g,"_")}},28:function(t,n,e){"use strict";e.d(n,"d",(function(){return h})),e.d(n,"b",(function(){return m})),e.d(n,"a",(function(){return j})),e.d(n,"c",(function(){return _}));var o=e(4),i=e(26),c=e(571),a=e(384),r=e(38),l=e(0),s=e(37),u=e(17),d=e(14),p=e(10),f=e(18),b=e(34),g=e(59),h={curr:{}},m=function(){return h.curr},v=function(t){var n={};return new URLSearchParams(t).forEach((function(t,e){n[e]=t})),n}(window.location.search),w={};for(var O in v)w[O]=v[O];var j={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 ",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_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"},x=j,y="[USER SETTINGS] :",k=u.a.client.log.verbose,_=function(t){var n=Object(g.a)("user-settings",{},{history:!0}),e=Object(o.a)(n,3),u=e[0],m=e[1],v=e[2],w=Object(l.useState)(0),O=Object(o.a)(w,2),_=O[0],C=O[1],E=Object(l.useRef)([]),S=function(t,n,e){E.current[t]||(E.current[t]=n[e]);var o=u[t];Object(c.a)(o)||Object(a.a)(o)||(""===o&&E.current[t]&&(o=E.current[t]),n[e]=o)};Object(l.useEffect)((function(){T(),h.curr=u,Object(i.a)(x,(function(t,n){Object(a.a)(u[n])&&(u[n]=t)}))}),[u]);var T=Object(b.a)((function(){k&&console.log(y,"UPDATE!",u,_),S("ui_layout_colors_main",p.a.colors,"main"),S("ui_layout_colors_main_font",p.a.colors,"mainFont"),S("ui_layout_font_family_editor",p.a.font,"editor"),S("ui_layout_font_family_interface",p.a.font,"main"),C(_+1)}),1e3),I=function(n,e,cb,o){var i="updateSetupJson-".concat(Object(s.a)());t.eventBus.subscribe(i,(function(t){cb&&cb(t)})),d.b.emit("updateSetupJson",{paramName:n,paramValue:e,opts:o,token:Object(f.b)(),idReq:i})};Object(l.useEffect)((function(){d.b.on("onServerTaskFinished",(function(n){t.eventBus.notify(n.idReq,{data:n})}))}),[]);var P={refreshUserSettingsFromBackend:v,updateSetupJson:I,set:function(t,n,e){e||(e={}),e.writeInSetupJson||(e.writeInSetupJson=!1),e.writeInSetupJson&&I(t,"".concat(n)),k&&console.log(y,"updateUserSettings ".concat(t," to ").concat(n));var o=Object(r.a)(u);o[t]=n,m(o)},get:function(t,cb){var n=x[t],e=n;return t in u&&(e=u[t]),""===e&&(e=n),cb&&cb({currentValue:e,defaultValue:n}),e},list:function(){return function(t){var n=[];return Object(i.a)(t,(function(t,e){var o=e;n.push({key:o,val:t})})),Object(i.a)(j,(function(t,e){var o=e;n.find((function(t){return t.key===o}))||n.push({key:o,val:t})})),n}(u)},refresh:{css:{get:_}}};return{userSettingsApi:P}}},29:function(t,n,e){"use strict";e.d(n,"a",(function(){return r}));var o=e(40),i=e.n(o),c=e(17),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>")}},30:function(t,n,e){"use strict";e.d(n,"a",(function(){return c})),e.d(n,"c",(function(){return a})),e.d(n,"b",(function(){return r})),e.d(n,"d",(function(){return l}));e(11);var o=e(9),i="tiroDevCli",c=function(t,n,e){window[i]||(window[i]={}),window[i][t]||(window[i][t]={}),window[i][t][n]=e},a=function(t,n){return window[i]&&window[i][t]&&window[i][t][n]?window[i][t][n]:function(){console.log("DEV FN",t,n,"does not exists")}},r=function(t,n){if(window[i]&&window[i][t]&&window[i][t][n])window[i][t][n]();else{var e="DEV FN ".concat(t," ").concat(n," does not exists");console.log(e),l(e)}},l=function(t,n,e){console.log("[NOTIF LOG]: ",t),e||(e=60),Object(o.d)((function(o){o.ui.notification.emit({content:t,id:n,options:{hideAfter:e,type:"warning",keepInHistory:!0}})}))}},33:function(t,n,e){"use strict";e.d(n,"d",(function(){return i})),e.d(n,"c",(function(){return c})),e.d(n,"b",(function(){return r})),e.d(n,"a",(function(){return l}));e(428);var o=e(9),i=function(t){return'<i class="ssr-icon fa-solid fa-'.concat(t,'"></i>')};window.ssrActionsDic={};var c=function(t,n){var e="window.ssrActionsDic['".concat(t,"'](this)"),o=window.ssrActionsDic;return o[t]||(o[t]=function(t){n(t)}),e},a=function(t,n){var e="ressource-preview-status-".concat(t.path),o=n.indexOf("token=");return o>-1&&(n=n.substring(0,o)),{cacheId:e,idRess:"".concat(t.path,"-").concat(n)}},r=function(t,n,e){var i=a(t,n),c=i.cacheId,r=i.idRess;Object(o.d)((function(t){t.cache.get(c,(function(n){n||(n={}),n[r]=e,t.cache.set(c,n,-1)}))}))},l=function(t,n,e){!function(t,n,cb){var e=a(t,n),i=e.cacheId,c=e.idRess;Object(o.d)((function(t){t.cache.get(i,(function(t){if(t){var n=t[c]?t[c]:"closed";cb(n)}}))}))}(t,n,(function(t){"open"===t&&setTimeout((function(){e()}),500)}))}},34:function(t,n,e){"use strict";e.d(n,"b",(function(){return a})),e.d(n,"a",(function(){return r}));var o=e(383),i=e(111),c=e(0);function a(cb,t){var n=Object(c.useRef)(cb);return Object(c.useEffect)((function(){n.current=cb})),Object(c.useCallback)(Object(o.a)((function(){return n.current.apply(n,arguments)}),t,{leading:!0,trailing:!1}),[t])}function r(cb,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],e={leading:!1,trailing:!0};n&&(e.leading=n);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 n;o.current.delay===t&&a()&&(n=o.current).cb.apply(n,arguments)}),t,e),[t,i.a])}},35:function(t,n,e){"use strict";e.d(n,"a",(function(){return s})),e.d(n,"c",(function(){return u})),e.d(n,"d",(function(){return d})),e.d(n,"b",(function(){return p}));var o=e(4),i=e(100),c=e(9),a=e(56),r=e(96),l=e(30),s=function(t,n){i&&i.bind&&i.bind(t,n)},u=function(t,n){i&&i.bind&&i.unbind(t,n)},d=function(){i&&i.bind&&i.releaseAllKeys()},p=function(t){var n=t.split("\n");return(n=n.filter((function(t){return""!==t.trim()}))).map((function(t){var n,e,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?(e=p,b=function(){Object(c.d)((function(t){var n=e,o=Object(a.d)(n),i="floating-panel-".concat(o);t.ui.floatingPanel.toggleFile(n,{idpanel:i})}))}):"highlight_to_ai"===f?(n=p,b=function(){console.log("CM",r.c,n);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(e){e.ai.search(t,n)}))}):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}}))}},37:function(t,n,e){"use strict";e.d(n,"a",(function(){return o})),e.d(n,"b",(function(){return i}));var o=function(){var t=(new Date).getTime(),n="undefined"!==typeof performance&&performance.now&&1e3*performance.now()||0;return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(e){var o=16*Math.random();return t>0?(o=(t+o)%16|0,t=Math.floor(t/16)):(o=(n+o)%16|0,n=Math.floor(n/16)),("x"===e?o:3&o|8).toString(16)}))},i=function(t){var n=t,e=n.split("?")[1]||"",o=n.split("?")[0],i=o.replace(/[^\w\s]/gi,"_"),c=e.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)}},376:function(module,__webpack_exports__,__webpack_require__){"use strict";__webpack_require__.d(__webpack_exports__,"a",(function(){return useRessourceApi}));var _config_workspace_tiro_notes_client_node_modules_babel_runtime_helpers_esm_construct_js__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__(233),_config_workspace_tiro_notes_client_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__(11),react__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__(0),react__WEBPACK_IMPORTED_MODULE_2___default=__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_2__),_shared_helpers_id_helper__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__(37),_shared_shared_config__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__(17),_managers_sockets_socket_manager__WEBPACK_IMPORTED_MODULE_5__=__webpack_require__(14),_app_loginToken_hook__WEBPACK_IMPORTED_MODULE_6__=__webpack_require__(18),_api_hook__WEBPACK_IMPORTED_MODULE_7__=__webpack_require__(9),_managers_url_manager__WEBPACK_IMPORTED_MODULE_8__=__webpack_require__(46),lodash_es__WEBPACK_IMPORTED_MODULE_9__=__webpack_require__(26),_managers_ressource_manager__WEBPACK_IMPORTED_MODULE_10__=__webpack_require__(223),_managers_devCli_manager__WEBPACK_IMPORTED_MODULE_11__=__webpack_require__(30),_managers_tryCatch_manager__WEBPACK_IMPORTED_MODULE_12__=__webpack_require__(377),h="[RESSOURCE API] ",useRessourceApi=function useRessourceApi(p){var _p=Object(_config_workspace_tiro_notes_client_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_1__.a)({},p),eventBus=_p.eventBus;Object(react__WEBPACK_IMPORTED_MODULE_2__.useEffect)((function(){_managers_sockets_socket_manager__WEBPACK_IMPORTED_MODULE_5__.b.on("getRessourceApiAnswer",(function(t){eventBus.notify(t.idReq,t)})),_managers_sockets_socket_manager__WEBPACK_IMPORTED_MODULE_5__.b.on("getRessourceScan",(function(t){eventBus.notify(t.idReq,t)}))}),[]);var deleteRessource=function(t,cb){var n=Object(_api_hook__WEBPACK_IMPORTED_MODULE_7__.c)("delete-ressource");console.log("".concat(h," delete ressource ").concat(t)),p.eventBus.subscribe(n,cb),_managers_sockets_socket_manager__WEBPACK_IMPORTED_MODULE_5__.b.emit("askRessourceDelete",{path:t,idReq:n,token:Object(_app_loginToken_hook__WEBPACK_IMPORTED_MODULE_6__.b)()})},downloadRessource=function(t,n,cb,e){var o=Object(_api_hook__WEBPACK_IMPORTED_MODULE_7__.c)("download-ressource");p.eventBus.subscribe(o,cb),_managers_sockets_socket_manager__WEBPACK_IMPORTED_MODULE_5__.b.emit("askRessourceDownload",{url:t,folder:n,idReq:o,opts:e,token:Object(_app_loginToken_hook__WEBPACK_IMPORTED_MODULE_6__.b)()})},fetchRessource=function(t,cb,n){n||(n={}),n.disableCache||(n.disableCache=!1),n.returnsPathOnly||(n.returnsPathOnly=!1),"false"===n.disableCache&&(n.disableCache=!1),"true"===n.disableCache&&(n.disableCache=!0),!0===n.disableCache&&console.log(h,"FETCHING => disableCache is true",{url:t,options:n});var e=n.persistentCache?"/.tiro/cache/fetch-persistent/":"/.tiro/cache/fetch/",o=Object(_managers_ressource_manager__WEBPACK_IMPORTED_MODULE_10__.a)("/".concat(e).concat(Object(_shared_helpers_id_helper__WEBPACK_IMPORTED_MODULE_3__.b)(t))),i=function(){fetch(o).then((function(t){return t.text()})).then((function(t){Object(_managers_tryCatch_manager__WEBPACK_IMPORTED_MODULE_12__.a)((function(){return cb(t,o)}))}))},c=function(){cb(o)},a=function(){downloadRessource(t,e,(function(t){var e;t.message&&(null!==(e=n)&&void 0!==e&&e.returnsPathOnly?c():i())}),n)};!0===n.disableCache?a():Object(_managers_url_manager__WEBPACK_IMPORTED_MODULE_8__.a)({url:o,onSuccess:function(){var t;null!==(t=n)&&void 0!==t&&t.returnsPathOnly?c():i()},onFail:function(){a()}})},fetchUrlArticle=function fetchUrlArticle(url,cb,options){var readabilityUrl="https://cdn.jsdelivr.net/npm/moz-readability@0.2.1/Readability.js";fetchRessource(readabilityUrl,(function(readabilityTxt){var r1=eval(readabilityTxt);fetchRessource(url,(function(t){var n=document.implementation.createHTMLDocument("");n.open(),n.write(t),n.close();var e=new r1(n).parse(),o=(null===e||void 0===e?void 0:e.textContent.replaceAll(" ","\n"))||"";o=(o=(o=(o=o.replaceAll(" ","\n")).replaceAll(" ","\n")).replaceAll(" ","\n")).replaceAll(" ","\n");var i=(null===e||void 0===e?void 0:e.content)||"",c=(null===e||void 0===e?void 0:e.title)||"";cb({title:c,text:o,html:i,raw:t})}))}))},ramFetchEvalCache={val:{}},fetchEval=function(t,n,e,cb){e||(e={}),e.disableCache||(e.disableCache=!1),"true"===e.disableCache&&(e.disableCache=!0),console.log(h,"fetchEval",t,n,e);var o=function(e){try{var o=[],i=[];Object(lodash_es__WEBPACK_IMPORTED_MODULE_9__.a)(n,(function(t,n){o.push(n),i.push(t)}));var c=Object(_config_workspace_tiro_notes_client_node_modules_babel_runtime_helpers_esm_construct_js__WEBPACK_IMPORTED_MODULE_0__.a)(Function,o.concat([e])).apply(void 0,i);cb&&cb(c)}catch(r){var a="[ERR remote code] (api.ress.fetchEval): ".concat(r," <br> url: ").concat(t," (more infos in console)");Object(_managers_devCli_manager__WEBPACK_IMPORTED_MODULE_11__.d)("".concat(a))}};!0===e.disableCache&&(ramFetchEvalCache.val[t]=null),ramFetchEvalCache.val[t]&&!0!==e.disableCache?o(ramFetchEvalCache.val[t]):fetchRessource(t,(function(n){o(n),ramFetchEvalCache.val[t]=n}),e)},cleanCache=function(){ramFetchEvalCache.val={},Object(_api_hook__WEBPACK_IMPORTED_MODULE_7__.d)((function(t){t.folders.delete("cache","fetch")}))},scanRessourceFolder=function(t,cb){_shared_shared_config__WEBPACK_IMPORTED_MODULE_4__.a.client.log.socket&&console.log("[CLIENT API] get ressources files ".concat(t));var n=Object(_api_hook__WEBPACK_IMPORTED_MODULE_7__.c)("get-ressources-files-");p.eventBus.subscribe(n,cb),_managers_sockets_socket_manager__WEBPACK_IMPORTED_MODULE_5__.b.emit("askRessourceScan",{folderPath:t,token:Object(_app_loginToken_hook__WEBPACK_IMPORTED_MODULE_6__.b)(),idReq:n})},compressImage=function(t,cb){var n=Object(_api_hook__WEBPACK_IMPORTED_MODULE_7__.c)("compress-image");console.log("".concat(h," compress image ").concat(t.path)),p.eventBus.subscribe(n,cb||function(){}),_managers_sockets_socket_manager__WEBPACK_IMPORTED_MODULE_5__.b.emit("askRessourceImageCompress",{params:t,idReq:n,token:Object(_app_loginToken_hook__WEBPACK_IMPORTED_MODULE_6__.b)()})},ressourceApi={delete:deleteRessource,download:downloadRessource,compressImage:compressImage,scanFolder:scanRessourceFolder,fetch:fetchRessource,fetchEval:fetchEval,fetchUrlArticle:fetchUrlArticle,cleanCache:cleanCache};return ressourceApi}},377:function(t,n,e){"use strict";e.d(n,"a",(function(){return i}));var o=e(30),i=function(t){try{t()}catch(n){Object(o.d)("".concat(n))}}},422:function(t,n){},43:function(t,n,e){"use strict";e.d(n,"g",(function(){return b})),e.d(n,"f",(function(){return g})),e.d(n,"e",(function(){return h})),e.d(n,"a",(function(){return m})),e.d(n,"d",(function(){return v})),e.d(n,"c",(function(){return w})),e.d(n,"b",(function(){return O})),e.d(n,"h",(function(){return j}));e(0);var o=e(17),i=e(29),c=e(56),a=e(14),r=e(93),l=e(90),s=e(213),u=e(75),d=(e(26),e(159)),p=e(117),f=e(1),b=function(t){return Object(r.d)(t,i.a.externalLink3,(function(t){return Object(d.a)(t,{addLineJump:!0})}))},g=function(t,n){var e=Object(u.a)("$1","$2",null,t,!0);return n.replace(i.a.linklink,e)},h=function(t){var n=t.replace(i.a.searchlink,'<a class="search-link preview-link" href="javascript:window.tiroCli.triggerSearch.func(\'$1$2\');">$1</a>');return n=Object(c.a)(n,[[">[__id_",">["],[">[__tags_",">["],[">[__tag_",">["],[" ]</a>","]</a>"]])},m=function(t){var n=t.replace("".concat(Object(a.c)(),"/").concat(o.a.path.staticResources,"/"),"");n=t.replace("".concat(o.a.path.staticResources),"");var e="".concat(Object(a.c)(),"/").concat(o.a.path.staticResources,"/").concat(n);return t.startsWith("http")?t:e},v=function(t,n,e){var o=0,c=Object(r.d)(e,i.a.ressource,(function(e){o++;"".concat(e,"-").concat(o);var i="".concat(function(t,n,e){return Object(s.renderToString)(Object(f.c)(l.a,{markdownTag:t,file:n,windowId:e}))}(e,t,n)," ");return i}));return c},w=function(t,n){return Object(r.d)(n,i.a.image,(function(n){var e=n.split("](")[1].slice(0,-1);return Object(p.a)(n,e,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,"'")}},436:function(t,n){},438:function(t,n){},449:function(t,n){},45:function(t,n,e){"use strict";e.d(n,"a",(function(){return f}));var o=e(6),i=e(7),c=e(21),a=e(22),r=e(13),l=e(30),s=function(t){Object(c.a)(e,t);var n=Object(a.a)(e);function e(t,i,c,a){var r;return Object(o.a)(this,e),(r=n.call(this)).match=t,r.view=i,r.pos=c,r.replacement=a,r}return Object(i.a)(e,[{key:"toDOM",value:function(){return this.replacement({matchs:this.match,view:this.view,pos:this.pos})}},{key:"estimatedHeight",get:function(){return 500}}]),e}(r.g),u={};Object(l.a)("code_mirror","cache_get",(function(){return u}));var d=function(t,n,e,o,i){return new r.e({regexp:t,decoration:function(t,c,a){var l,d=t.input+t.index,p=e.path+o;if(u[p]||(u[p]={}),u[p][d])l=u[p][d];else{var f=new s(t,c,a,n),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,n){return new r.e({regexp:t,decoration:function(t,e,o){return r.a.mark({class:n(t)})}})},f=function(t){var n,e=t.replacement,c=!1!==(null===(n=t.options)||void 0===n?void 0:n.cache);return r.f.fromClass(function(){function n(i){Object(o.a)(this,n),this.decorations=void 0,this.decorations=e?d(t.pattern,e,t.file,t.windowId,c).createDeco(i):p(t.pattern,t.classWrap).createDeco(i)}return Object(i.a)(n,[{key:"update",value:function(n){try{e&&(n.docChanged||n.viewportChanged)?this.decorations=d(t.pattern,t.replacement,t.file,t.windowId,c).updateDeco(n,this.decorations):this.decorations=p(t.pattern,t.classWrap).updateDeco(n,this.decorations)}catch(o){console.warn("[ERROR VIEWPLUGIN CM]",o,n)}}}]),n}(),{decorations:function(t){return t.decorations},provide:function(n){return r.c.atomicRanges.of((function(e){var o,i,c=(null===(o=e.plugin(n))||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}))}})}},451:function(t,n){},46:function(t,n,e){"use strict";e.d(n,"b",(function(){return p})),e.d(n,"c",(function(){return f})),e.d(n,"f",(function(){return g})),e.d(n,"e",(function(){return h})),e.d(n,"d",(function(){return v})),e.d(n,"g",(function(){return w})),e.d(n,"a",(function(){return O}));var o=e(3),i=e(26),c=e(27),a=e(64),r=e(9),l=e(12),s=e(212),u=e(18),d=e(173),p=function(t){return t=(t=t.replaceAll("//","/")).replace(/(http[s]?:)\/([^/])/,"$1//$2")},f=function(t){var n=new URL(t),e=n.hostname.replace(/^www\./,""),o=n.pathname.split("/").filter((function(t){return""!==t.trim()})),i="";return o.length>0&&(i=(i=o[o.length-1]).length>20?i.substring(0,20).replace(/[^A-Za-z0-9-_\ ]/g,""):i.replace(/[^A-Za-z0-9]/g,"")),e.length>15&&(e=e.substring(0,15)),i.length>0?"".concat(e,"/").concat(i):e},b={value:!1},g=function(t,n){b.value&&Object(r.d)((function(t){var e,o=t.ui.windows.active.get(),i=null===o||void 0===o||null===(e=o.content.file)||void 0===e?void 0:e.path,a=null===o||void 0===o?void 0:o.content.view,r=v().array;r=r.filter((function(t){return"filepath"!==t.name&&"view"!==t.name})),i&&a&&(r.unshift({name:"filepath",value:i}),Object(d.a)("/favicon.png"),document.title="Tiro","mobile"===Object(l.a)()?r.unshift({name:"view",value:n}):r.unshift({name:"view",value:a}),m(r),t.file.getContent(i,(function(t){var n=Object(s.a)(t,Object(c.e)(i));if(!(n.length<1)){var e="".concat(n[0].url).concat(Object(u.c)()),o=Object(c.e)(i).filenameWithoutExt||Object(c.e)(i).name;document.title=o,Object(d.a)(e),setTimeout((function(){document.title=o}),300)}})))}))},h=function(t){var n,e;Object(d.a)("/favicon.png"),document.title="Tiro",setTimeout((function(){b.value=!0}),5e3);var o=v().dic,i=null===(n=o.filepath)||void 0===n?void 0:n.value,a=null===(e=o.view)||void 0===e?void 0:e.value;if(i&&a&&"mobile"===Object(l.a)()){var s=Object(c.e)(i);Object(r.d)((function(n){n.ui.browser.goTo(s.folder,s.name,{openIn:"activeWindow"}),t(a)}))}},m=function(t){var n="".concat(a.a.global.protocol).concat(a.a.global.url).concat(a.a.global.port,"/?");Object(i.a)(t,(function(e,o){var i=o<t.length-1?"&":"";n+="".concat(e.name,"=").concat(e.value).concat(i)})),window.history.pushState({},document.title,n)},v=function(){var t,n=[],e={},i=window.location.search,c=new URLSearchParams(i).entries(),a=Object(o.a)(c);try{for(a.s();!(t=a.n()).done;){var r=t.value;n.push({name:r[0],value:r[1]}),e[r[0]]={name:r[0],value:r[1]}}}catch(l){a.e(l)}finally{a.f()}return{array:n,dic:e}},w=function(t){var n="",e=0;for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&t[o]&&(n+="".concat(0===e?"":"&").concat(o.toLowerCase(),"=").concat(t[o]),e++);return n},O=function(t){try{var n=new XMLHttpRequest;return n.open("HEAD",t.url,!1),n.send(),404!==n.status?t.onSuccess():t.onFail()}catch(e){t.onFail(e)}}},47:function(t,n,e){"use strict";e.d(n,"a",(function(){return p})),e.d(n,"b",(function(){return b}));var o=e(11),i=e(0),c=e.n(i),a=e(105),r=e(10),l=e(23),s=e(25),u=e(1),d=function(t){var n=Object(o.a)({},t),e=n.design,c=n.colors,l=n.size;e||(e="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(e," ").concat(!0===s?"with-popup":"no-popup")},t.buttons.map((function(t,n){var e;return t.action&&Object(u.c)("li",{className:"".concat(t.class," btn-").concat(null===(e=t.title)||void 0===e?void 0:e.toLowerCase()),title:t.title,key:n},Object(u.c)(f,t))}))))}),[t.buttons])},p=c.a.memo(d,(function(t,n){return!1})),f=function(t){var n=Object(u.c)(c.a.Fragment,null);t.title&&(n=Object(u.c)(c.a.Fragment,null,t.title));var e=t.size?t.size:1;t.icon&&(n=t.icon.startsWith("fa")||t.icon.includes(".")?Object(u.c)(l.a,{name:t.icon,size:e,color:t.color}):Object(u.c)(l.b,{name:t.icon,size:e,color:t.color})),t.customHtml&&(n=t.customHtml);var o="toolbar-button ".concat(t.class&&t.class," ").concat(t.active&&"active");return Object(u.c)("button",{className:o,onMouseEnter:function(n){t.onHover&&t.onHover()},onClick:function(n){t.action&&t.action(n)}},Object(u.c)("div",{className:"inside-html-wrapper"},n),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")}},476:function(t,n){},478:function(t,n){},479:function(t,n){},484:function(t,n){},486:function(t,n){},492:function(t,n){},494:function(t,n){},513:function(t,n){},525:function(t,n){},528:function(t,n){},53:function(t,n,e){"use strict";e.d(n,"a",(function(){return f})),e.d(n,"b",(function(){return b}));var o=e(6),i=e(7),c=e(21),a=e(22),r=e(0),l=e.n(r),s=e(10),u=e(12),d=e(105),p=e(1),f=function(t){Object(c.a)(e,t);var n=Object(a.a)(e);function e(){var t;Object(o.a)(this,e);for(var i=arguments.length,c=new Array(i),a=0;a<i;a++)c[a]=arguments[a];return(t=n.call.apply(n,[this].concat(c))).canBgClose=!t.props.canBgClose||t.props.canBgClose,t.cssStr=t.props.cssStr?t.props.cssStr:"",t}return Object(i.a)(e,[{key:"render",value:function(){var t=this;return Object(p.c)("div",{className:"".concat(Object(d.a)(this.cssStr,";","")," popup-wrapper-component")},Object(p.c)("div",{className:"overlay-click-popup",onClick:function(n){t.canBgClose&&t.props.onClose()}}),Object(p.c)("div",{className:"popup-wrapper ".concat(Object(u.d)()?"ipad":"")},Object(p.c)("div",{className:"popupTitle"}," ",this.props.title),Object(p.c)("div",{className:"popupContent"},this.props.children)))}}]),e}(l.a.Component),b=function(){return"\n.popup-wrapper-component {\n\t\t\t\tposition: absolute;\n top: 0px;\n left: 0px;\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 .popup-wrapper {\n overflow-y: auto;\n position: fixed;\n z-index:10010;\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")}},56:function(t,n,e){"use strict";e.d(n,"d",(function(){return o})),e.d(n,"b",(function(){return i})),e.d(n,"a",(function(){return c})),e.d(n,"c",(function(){return a}));var o=function(t){var n=t;return n=(n=c(n,[["-",""],["_",""],[" ",""],["/",""],[".md",""],[":",""],["?",""]])).toLowerCase()},i=function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"_";return(t=c(t,[["-",n],["_",n],[" ",n],["/",n]])).replace(/[^\w\s]/gi,"")},c=function(t,n){for(var e=0;e<n.length;e++){var o=n[e];t=t.split(o[0]).join(o[1])}return t};function a(t,n){for(var e=t.split("\n"),o=n.split("\n"),i=Math.max(e.length,o.length),c=[],a=0;a<i;a++)void 0!==e[a]&&void 0!==o[a]?e[a]!==o[a]?c.push('<span class="diff-sign diff-modified">~~~</span> '+o[a]):c.push(o[a]):void 0!==e[a]&&void 0===o[a]?c.push('<span class="diff-sign diff-deleted">---</span> '+e[a]):void 0===e[a]&&void 0!==o[a]&&c.push('<span class="diff-sign diff-added">+++</span> '+o[a]);return c.join("\n")}},568:function(t,n,e){"use strict";e.r(n);var o=e(0),i=e.n(o),c=e(4),a=e(1),r=e(12),l=e(14),s=e(11),u=e(105),d=e(10),p=e(166),f=e(81),b=e(47),g=e(672),h=e(61),m={};window.tiroCli=m;var v=function(t,n){var e,r,l=Object(h.a)("showRenderId",!1),s=Object(c.a)(l,2),u=s[0],d=s[1];e="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[e]=r;var p=Object(g.a)(0,1e3);return Object(o.useMemo)((function(){var n=(new Date).getTime(),e=(new Error).stack,o=(null===e||void 0===e||e.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}),n)},w=function(){var t=Object(o.useState)("navigator"),n=Object(c.a)(t,2),e=n[0],l=n[1];return{mobileView:e,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"===e?"active":""),action:function(){l("navigator")}},{icon:"faPenNib",class:"".concat("editor"===e?"active":""),action:function(){l("editor")}},{icon:"faEye",class:"".concat("preview"===e?"active":""),action:function(){l("preview")}},{icon:"faSearch",class:"",action:function(){t.onButtons[0]&&t.onButtons[0]()}}]})),[e,t.forceRerender])}}},O=e(17),j=e(9),x=function(t,n){var e=Object(o.useRef)();Object(o.useEffect)((function(){e.current=t}),[t]),Object(o.useEffect)((function(){if(null!==n){var t=setInterval((function(){e.current()}),n);return function(){return clearInterval(t)}}}),[n])},y=function(){return"Tiro","Tiro"},k=function(){Object(o.useRef)([]);var t=Object(o.useState)(!1),n=Object(c.a)(t,2),e=n[0],i=n[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;var t=e?"".concat(y()):"".concat(y()," ").concat(f.current);"mobile"!==Object(r.a)()&&(document.title=t)}),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:e,connectionStatusComponent:function(){var t=["connected","connected"];return u&&(t=["back-online","back online"]),e||(t=["disconnected","disconnected"]),Object(a.c)("div",{className:"connection-status"},Object(a.c)("div",{className:t[0]},t[1]))},toggleSocketConnection:b}},_=e(23),C=e(20),E=function(t){return Object(a.c)("button",{className:"new-file-button",onClick:function(n){t.onNewFile()}},Object(a.c)(_.a,{name:"faPlusCircle",color:"white"}),Object(a.c)("span",null,C.a.newNote))},S=i.a.memo(E,(function(t,n){return!0})),T=e(6),I=e(7),P=e(21),N=e(22),A=e(111),R=e(38),F=e(71),L=e(43),M=e(381),D=e(378),z=e(18),B=e(571),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=e(95),J=e(25),G=e(46),K=function(t){Object(P.a)(e,t);var n=Object(N.a)(e);function e(t){var o;return Object(T.a)(this,e),(o=n.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 n=t.getBoundingClientRect().height,e=-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<n+100)-1===e&&(e=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 n=!1;return o.state.selectionEdges[0]<=t&&o.state.selectionEdges[1]>=t&&(n=!0),n},o.itemToScroll=0,o.autoScrollToItem=function(t){var n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];o.itemToScroll=n?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)(e,[{key:"shouldComponentUpdate",value:function(t,n){if(JSON.stringify(t.files)!==JSON.stringify(this.oldFiles)){this.oldFiles=Object(R.a)(t.files),this.liRefs=[];for(var e=0;e<t.files.length;e++)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,n=V.a[this.props.sortMode],e=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)(D.a,null,(function(o){o.height;var r=o.width;return Object(a.c)(M.a,{itemData:t.props.files,className:"List",ref:t.scrollerListRef,height:c,itemCount:t.props.files.length,itemSize:e,width:r||0,onScroll:t.onListScroll},(function(e){var o=e.index,c=e.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 n=[],e=t.state.selectionEdges;n=-1!==e[0]||-1!==e[1]?t.props.files.slice(e[0],e[1]+1):[l],t.props.onFileDragStart(n)},onDragEnd:function(){t.props.onFileDragEnd()},onClick:function(n){if(W["shift"]){var e=[t.props.activeFileIndex,o];e.sort(),t.setState({selectionEdges:e})}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(n){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(n)},Object(F.a)(new Date(("modified"===n?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(G.b)(s.picture+t.getUrlLoginToken()):Object(G.b)("".concat(Object(L.a)(t.props.files[0].folder),"/").concat(s.picture).concat(t.getUrlLoginToken())),"')")}}))))}))}))))}}]),e}(i.a.Component),Y=i.a.memo(K,(function(t,n){return!1})),$=Object(s.a)({},d.a),Z=($.els,$.colors),X=($.font,$.sizes),Q=e(231),tt=e(27),nt=e(39),et=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(n){Object(j.d)((function(e){e.ui.browser.folders.open.add(n),t.onFolderOpen(n)}))},onFolderClose:function(n){Object(j.d)((function(e){console.log("ONFOLDERCLOSE",n),e.ui.browser.folders.open.remove([n]),t.onFolderClose(n)}))},onFolderDragStart:t.onFolderDragStart,onFolderDragEnd:t.onFolderDragEnd,onFolderDrop:t.onFolderDrop}))},ot=function t(n){var e=Object(nt.a)(n.openFolders)?n.openFolders:[],i=e.includes(n.folder.path)&&n.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&&!n.folder.children||i&&n.folder.children&&0===n.folder.children.length?g(!0):g(!1)}),[n.folder.children,i]);var O=Object(tt.a)(n.current,n.folder.key);return Object(a.c)("li",{className:"folder-wrapper ".concat(O?"current":""," "),draggable:!0,onDrop:function(t){console.log("DROP",t),n.folder.key&&(n.onFolderDrop(n.folder),t.stopPropagation())},onDragStart:function(t){n.folder.key&&(n.onFolderDragStart(n.folder),t.stopPropagation())},onDragOver:function(t){w("drag"),t.preventDefault(),t.stopPropagation()},onDragEnd:function(){n.folder.key&&n.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?n.onFolderClose(n.folder.key):n.onFolderOpen(n.folder.key)}},n.folder.hasFolderChildren&&Object(a.c)(_.a,{name:i?"faCaretDown":"faCaretRight",color:d.a.colors.main})),Object(a.c)("span",{className:"title",onClick:function(t){n.onFolderClicked(n.folder.key)}},Object(a.c)("div",{className:"title-drag-bg"}),Object(a.c)("div",{className:"title-label"}," ",n.folder.title)),Object(a.c)("span",{onClick:function(){u(!s)},className:"context-menu-wrapper"},Object(a.c)(_.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(""===n.folder.path)return u(!1);var t=prompt("".concat(C.a.renameFolderPrompt," "),n.folder.title);t&&""!==t&&t!==n.folder.title&&n.onFolderMenuAction("rename",n.folder,t),u(!1)}},C.a.renameFolder),Object(a.c)("li",{onClick:function(){if(""===n.folder.path)return u(!1);Object(j.e)().then((function(t){t.popup.prompt({text:"".concat(C.a.createFolderPrompt,' "').concat(n.folder.path,'"?'),userInput:!0,onAccept:function(t){t&&""!==t&&n.onFolderMenuAction("create",n.folder,t)},onRefuse:function(){}})})),u(!1)}},C.a.createFolder),-1===n.folder.path.indexOf(".tiro/.trash")&&Object(a.c)("li",{onClick:function(){if(""===n.folder.path)return u(!1);u(!1),n.onFolderMenuAction("moveToTrash",n.folder)}},C.a.moveToTrash),-1!==n.folder.path.indexOf(".tiro/.trash")&&Object(a.c)("li",{onClick:function(){if(""===n.folder.path)return u(!1);u(!1),Object(j.e)().then((function(t){t.popup.confirm("".concat(C.a.deleteFolderPrompt,' "').concat(n.folder.path,'"?'),(function(){n.onFolderMenuAction("delete",n.folder)}))}))}},C.a.deleteFolder))))),b&&Object(a.c)("div",{className:"loading"},"..."),i&&Object(a.c)("ul",{className:"folder-children"},n.folder.children&&n.folder.children.map((function(o,i){return Object(a.c)(t,{openFolders:e,key:i,folder:o,current:n.current,onFolderOpen:n.onFolderOpen,onFolderMenuAction:n.onFolderMenuAction,onFolderClose:n.onFolderClose,onFolderClicked:n.onFolderClicked,onFolderDragStart:n.onFolderDragStart,onFolderDragEnd:n.onFolderDragEnd,onFolderDrop:n.onFolderDrop})}))))},it=function(t){var n=Object(s.a)({},t).files,e=Object(nt.a)(n)?n.slice(0,20):[];return Object(a.c)(i.a.Fragment,null,e.length>0&&Object(a.c)("div",{className:"last-notes-component"},Object(a.c)("h3",{className:"subtitle"},C.a.lastNotes),Object(a.c)("ul",null,e.map((function(n,e){var o=n.name.replace(".md","");return o=o.length>20?"".concat(o.substr(0,20)):o,Object(a.c)("li",{key:e,title:o,onClick:function(e){t.onClick(n)},className:"note"},Object(a.c)(_.a,{name:"faFile"}),o)})))))},ct=i.a.memo(it,(function(t,n){return t.files===n.files})),at=e(67),rt=e(53),lt=function(t){var n=Object(o.useContext)(j.a),e=!!n&&n.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(e){if("Enter"===e.key){if(t.term.length<3)return;n&&n.ui.search.search(t.term)}},onChange:function(e){!function(e,o){if(n){var i=n.ui.browser.folders.current.get();""===t.term&&""!==i&&(e=e+" "+i,o&&setTimeout((function(){var t=(o.selectionStart||0)-i.length-1;o.selectionStart=t,o.selectionEnd=t}),10)),n.ui.search.term.set(e)}}(e.target.value,e.target)}}),Object(a.c)("div",{className:"search-status"},e&&C.a.searchingLabel)))},st=e(64),ut=function(t){var n={title:t.realname,folder:t.folder,mobileview:"editor"},e="".concat(st.a.global.protocol).concat(st.a.global.url).concat(st.a.global.port,"?").concat(Object(G.g)(n));window.open(e,"popupDetached","width=600,height=600")},dt=e(34),pt=e(35),ft=function(t){var n=Object(o.useState)(0),e=Object(c.a)(n,2),i=e[0],l=e[1],s=Object(o.useRef)(0);Object(o.useEffect)((function(){u(t.startingIndex)}),[t.startingIndex]);var u=function(t){d(),l(t),s.current=t},d=function(){j(!1),m(10)},p=function(n){j(!1),m(10),-1===n&&0===s.current?s.current=t.images.length-1:1===n&&s.current===t.images.length-1?s.current=0:s.current=s.current+n,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=function(t){var n=t+h;n<0&&(n=0),n>20&&(n=20),m(n)},y=Object(o.useRef)(null),k=(function(){var t="0px";if(y.current){var n=y.current.clientHeight;t="".concat(n-5,"px")}}(),Object(dt.b)((function(t){var n=t.deltaY>0?1:-1;x(n)}),150)),_=Object(o.useRef)(0),C=(Object(dt.b)((function(t){if(2===t.touches.length){var n=t.touches[0].clientY>_.current?1:-1;_.current=t.touches[0].clientY,x(n)}}),150),function(){var n="mobile"===Object(r.a)()?"mobile":"desktop",e=[{class:"left ".concat(n),title:"left",icon:"faChevronLeft",action:function(){p(-1)}},{class:"close",title:"close",icon:"faTimes",action:function(){t.onClose()}},{class:"right ".concat(n),title:"right",icon:"faChevronRight",action:function(){p(1)}}];return O&&(e.unshift({class:"zoom",title:"zoom",icon:"faPlus",action:function(){x(1)}}),e.unshift({class:"dezoom",title:"dezoom",icon:"faMinus",action:function(){x(-1)}})),e.push({class:"zoomToggle",title:"zoomToggle",icon:"magnifying-glass-".concat(O?"minus":"plus"),action:function(){j(!O)}}),e});Object(o.useEffect)((function(){var t=function(){p(1)},n=function(){p(-1)};return Object(pt.a)("right",t),Object(pt.a)("left",n),function(){console.log("destroying lightbox"),Object(pt.c)("right",t),Object(pt.c)("left",n)}}),[]);return Object(a.c)("div",{className:"lightbox-component"},Object(a.c)("div",{className:"lightbox-bg",onClick:function(){t.onClose()}}),Object(a.c)("div",{className:"lightbox-content images-nb-".concat(t.images.length),onWheel:k,ref:y},Object(a.c)("div",{className:"lightbox-main-image-wrapper"},t.images.map((function(n,e){return Object(a.c)("div",{key:e,className:"lightbox-image",style:{display:e===i?"flex":"none"}},Object(a.c)("figure",{className:"zoom2 ".concat(O?"zoomed":"not-zoomed"),style:{backgroundImage:"url(".concat(Object(L.a)(n.url)+Object(z.c)(),")"),backgroundSize:"".concat(h/10*100,"%")},onMouseMove:function(t){!function(t){var n,e,o,i,c=t.currentTarget;n=t.clientX,e=t.clientY,o=n/c.offsetWidth*100,i=e/c.offsetHeight*100;var a=function(t){return(t-50)/("mobile"===Object(r.a)()?1:3)},l=(o+=a(o))+"% "+(i+=a(i))+"%";c.style.backgroundPosition=l}(t)}},Object(a.c)("img",{src:Object(L.a)(n.url)+Object(z.c)(),onClick:function(t){!function(t){var n=t.target.src;t.target.parentElement.style.backgroundImage="url(".concat(n,")"),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"},n.file.name&&n.title&&Object(a.c)("div",{className:"image-name",onClick:function(t){return ut(n.file)}},n.file.name," - ",n.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((function(t,n){return Object(a.c)("div",{key:n,className:"thumbnail"+(n===i?" selected":""),style:{backgroundImage:"url(".concat(Object(L.a)(t.url)+Object(z.c)(),")")},onClick:function(){u(n)}})}))))))},bt=e(26),gt=e(165),ht={onAccept:function(){},onRefuse:function(){}},mt=function(t){var n=Object(o.useState)(!1),e=Object(c.a)(n,2),r=e[0],l=e[1],u=Object(o.useState)(""),d=Object(c.a)(u,2),p=d[0],f=d[1],b=Object(o.useState)(null),g=Object(c.a)(b,2),h=g[0],m=g[1],v=Object(o.useState)(C.a.promptPopup.defaultTitle),w=Object(c.a)(v,2),O=w[0],x=w[1],y=Object(o.useState)(!1),k=Object(c.a)(y,2),_=k[0],E=k[1],S=Object(o.useState)(C.a.promptPopup.accept),T=Object(c.a)(S,2),I=T[0],P=T[1],N=Object(o.useState)(C.a.promptPopup.refuse),A=Object(c.a)(N,2),R=A[0],F=A[1],L=Object(o.useState)(""),M=Object(c.a)(L,2),D=M[0],z=M[1],B=function(t){var n;l(!0),f(t.text),t.acceptLabelButton&&P(t.acceptLabelButton),t.refuseLabelButton&&F(t.refuseLabelButton),null!==(n=t.options)&&void 0!==n&&n.cssStr&&z(t.options.cssStr),t.title&&x(t.title),t.userInput&&m(""),t.onAccept&&(ht.onAccept=t.onAccept),t.onRefuse?(ht.onRefuse=t.onRefuse,E(!0)):E(!1)},W=function(){l(!1),V(!1),m(null),x(""),f(""),E(!1)},U=Object(o.useState)(!1),H=Object(c.a)(U,2),q=H[0],V=H[1],J=Object(o.useState)([]),G=Object(c.a)(J,2),K=G[0],Y=G[1],$=Object(o.useState)([]),Z=Object(c.a)($,2),X=(Z[0],Z[1],Object(o.useRef)({})),Q={title:"Popup Form",insertFilePath:"/popup_form_results.md",insertLine:0,insertStringFormat:"{{name}} | {{age|number}}\n"},tt=Object(o.useState)(Q),nt=Object(c.a)(tt,2),et=nt[0],ot=nt[1],it=Object(o.useRef)(),ct=function(t,cb){Object(j.d)((function(n){n.file.getContent(t,(function(t){var n=t.split("\n"),e=[];n.forEach((function(t){if(t.trim().startsWith("form|")||t.startsWith("form |")){var n=t.split("|");n.shift();for(var o=n.join("|"),i={title:"",fields:[]},c=o.split(","),a=0;a<c.length;a++)c[a].includes("=")||(c[a-1]=c[a-1]+","+c[a],c.splice(a,1),a--);c.forEach((function(t){var n=t.split("="),e=n[0].trim();n.shift();var o=n.join("=").trim();"name"===e&&(i.title=o),"path"===e&&(i.insertFilePath=o),"line"===e&&(i.insertLine=parseInt(o)),"line_format"===e&&(i.insertStringFormat=o)})),e.push(i)}})),cb(e)}),{removeMetaHeader:!0})}))},lt=function(cb){ct("/.tiro/forms.md",cb)},st=function(t,cb){var n=Object(s.a)(Object(s.a)({},Q),t),e=[],o=(n.insertStringFormat||"").match(/{{(.*?)}}/g);null===o||void 0===o||o.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 l,s=[];null!==(l=a)&&void 0!==l&&l.startsWith("select")&&(s=a.split(":")[1].split(",").map((function(t,n){return{key:n,label:t,obj:t}})),a="select");var u=!1;null!==r&&void 0!==r&&r.includes("optional")&&(u=!0),e.find((function(t){return t.id===i}))||e.push({name:i,type:a||"text",description:r||i,selectOptions:s,optional:u,id:i})}})),n.fields=e,console.log("[POPUP > FORM] opening with config:",n),x(n.title),Y(e),ot(n),V(!0),it.current=cb},ut={confirm:function(t,cb,n,e){B({title:"",text:t,onAccept:cb,onRefuse:function(t){function n(){return t.apply(this,arguments)}return n.toString=function(){return t.toString()},n}((function(){n&&n()})),options:e})},show:function(t,n,cb,e){B({title:n,text:t,onAccept:cb,onRefuse:function(){},options:e})},prompt:B,form:{create:st,readConfigFromNote:ct,getAll:lt,open:function(t,cb){lt((function(n){var e=n.find((function(n){return n.title===t}));e?st(e,cb):(console.warn("Form not found",t),Object(j.d)((function(n){n.ui.notification.emit({id:"form-not-found",content:"Form <b>".concat(t,"</b> not found.")})})))}))}}};return{popupApi:ut,PromptPopupComponent:function(){return Object(a.c)(i.a.Fragment,null,q&&Object(a.c)("div",{className:"form-popup-component"},Object(a.c)(rt.a,{title:O,onClose:W,canBgClose:!1,cssStr:D},K.map((function(t,n){return Object(a.c)("div",{key:n,className:"form-input-wrapper"},Object(a.c)(at.a,{label:t.name,explanation:t.description,shouldNotSelectOnClick:!0,type:t.type,list:t.selectOptions,onLoad:function(n){X.current[t.id]=n},onChange:function(n){X.current[t.id]=n},onSelectChange:function(n){X.current[t.id]=n}}),!t.optional&&Object(a.c)("div",{className:"mandatory"},"*"))})),Object(a.c)("br",null),Object(a.c)("button",{value:"submit",className:"accept submit-button",onClick:function(t){!function(){K.forEach((function(t){var n;"date"===t.type&&X.current[t.id]&&(X.current[t.id]=new Date(X.current[t.id]).toLocaleDateString("fr-FR")),"datetime"===t.type&&(X.current[t.id]&&(X.current[t.id]=new Date(X.current[t.id]).toLocaleString("fr-FR")),X.current[t.id]=null===(n=X.current[t.id])||void 0===n?void 0:n.substring(0,X.current[t.id].length-3))}));var t=[];if(K.forEach((function(n){n.optional||X.current[n.id]||t.push(n.name)})),t.length>0)Object(j.d)((function(n){n.ui.notification.emit({id:"insert-form-error",content:"FORM: fields <b>".concat(t.join(", "),"</b> are mandatory.")})}));else{V(!1);var n=et.insertStringFormat;n=n||Q.insertStringFormat,X.current=X.current||{},K.forEach((function(t){X.current[t.id]||(X.current[t.id]="")})),Object(bt.a)(X.current,(function(t,e){var o,i,c=new RegExp("{{".concat(e,"\\|.*?}}"),"g");n=null===(o=n)||void 0===o?void 0:o.replace(c,t);var a=new RegExp("{{".concat(e,"}}"),"g");n=null===(i=n)||void 0===i?void 0:i.replace(a,t)}));var e=Object(gt.a)(),o=new RegExp("{{_datetime}}","g");n=n.replace(o,e.full_fr);var i=new RegExp("{{_date}}","g");n=n.replace(i,e.date_fr);var c=et.insertFilePath||Q.insertFilePath,a=et.insertLine||Q.insertLine;Object(j.d)((function(t){t.file.insertContent(c,n||"",{insertLine:a},(function(e){it.current&&it.current(),it.current=void 0,t.ui.notification.emit({id:"insert-form-success",content:"<b>FORM: line ".concat(a,' insert success</b>: <br><br> "').concat(n,'" <br><br> to <b>').concat(c,"</b>"),options:{onClick:function(){console.log("open file"),Object(j.d)((function(t){t.ui.floatingPanel.openFile(c,{searchedString:n})}))}}})}))})),W()}}()}},I),Object(a.c)("div",{className:"details"},"Form result will be ",et.insertLine," to ",et.insertFilePath," with format: ",et.insertStringFormat))),r&&Object(a.c)("div",{className:"prompt-popup-component"},Object(a.c)(rt.a,{title:O,onClose:W,canBgClose:!1,cssStr:D},Object(a.c)("div",null,Object(a.c)("div",{className:"content",dangerouslySetInnerHTML:{__html:p}}),Object(a.c)("br",null),null!==h&&Object(a.c)("div",null,Object(a.c)("input",{type:"text",value:h,onChange:function(t){m(t.target.value)}}),Object(a.c)("br",null)),Object(a.c)("button",{value:"submit",className:"accept submit-button",onClick:function(t){ht.onAccept(h),W()}},I),_&&Object(a.c)("button",{value:"submit",className:"refuse submit-button",onClick:function(t){ht.onRefuse(h),W()}},R)))))}}},vt=e(222),wt=e(124),Ot=function(t){var n=Object(o.useContext)(j.a),e=Object(o.useState)(-1),i=Object(c.a)(e,2),r=i[0],l=i[1],s=Object(nt.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(e,o){return Object(a.c)(xt,{key:o,tab:e,onDrop:function(t){l(t)},onDragEnter:function(t){l(t)},onDragEnd:function(t){n&&n.tabs.reorder(t,r),l(-1)},dragIndic:r,pos:o,onUpdate:t.onUpdate})})),(null===n||void 0===n?void 0:n.ui.browser.files.active.get)&&Object(a.c)("div",{className:"tab-wrapper tab-more",onClick:function(n){t.onUpdate("add")}},"+"),Object(a.c)("div",{className:"tab-wrapper tab-more",onClick:function(n){t.onPinToggle()}},Object(a.c)(_.b,{name:"thumbtack",size:.8}))))))},jt=function(t){var n=Object(s.a)({},t),e=n.tab,o=n.pos,c="Six",l=e.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(e.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",e)}},"mobile"!==Object(r.a)()&&Object(a.c)("input",{type:"text",className:"tab-input-text",value:e.name,style:{width:10*e.name.length+"px"},onChange:function(n){t.onUpdate("rename",e,n.target.value)}}),"mobile"===Object(r.a)()&&Object(a.c)(i.a.Fragment,null,e.name)),e.grid.layout.length>1&&Object(a.c)("div",{className:"tab-nb-windows",onClick:function(){t.onUpdate("activate",e)}},Object(a.c)(_.a,{name:c,color:"#b2b2b2"})),Object(a.c)("div",{className:"tab-close",onClick:function(){Object(j.d)((function(n){n.popup.confirm("".concat(C.a.deleteTabPrompt,' "').concat(e.name,'"?'),(function(){t.onUpdate("close",e)}))}))}},Object(a.c)(_.a,{name:"faPlus",color:"#b2b2b2"}))))},xt=i.a.memo(jt,(function(t,n){var e=!0,o=Object(R.a)({n:t.tab,p:n.tab});return o.n.grid=o.p.grid={},o.n.refresh=o.p.refresh="",JSON.stringify(o.p)!==JSON.stringify(o.n)&&(e=!1),n.pos!==t.pos&&(e=!1),n.dragIndic!==t.dragIndic&&(e=!1),n.tab.active!==t.tab.active&&(e=!1),n.onUpdate!==t.onUpdate&&(e=!1),e})),yt=e(224),kt=e(188),_t=e(225),Ct=e(167),Et=e(106),St=e(96),Tt=e(103),It=e(15),Pt=e(379),Nt=e(570),At=e(37),Rt=e(140),Ft=function(t){var n=Object(o.useState)(""),e=Object(c.a)(n,2),i=(e[0],e[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(n){n.file.getContent(t.file.path,(function(n){i(n),t.searchedString&&Object(j.d)((function(n){setTimeout((function(){console.log("searchword",t.searchedString,t.replacementString,t.windowId),n.ui.note.editorAction.dispatch({type:"searchWord",searchWordString:t.searchedString,searchReplacementString:t.replacementString,windowId:t.windowId});var e=document.querySelector(".select-wrapper input");e&&(e.focus(),setTimeout((function(){e.focus(),setTimeout((function(){e.focus()}),100)}),50))}),300)}))}))}))}),200));Object(o.useEffect)((function(){u()}),[t.file,t.searchedString,s]);var d=t.height?t.height+"px":"100%",p=Object(o.useState)(t.windowId||Object(At.a)()),f=Object(c.a)(p,2),b=f[0],g=f[1];return Object(o.useEffect)((function(){g(t.windowId||Object(At.a)())}),[t.windowId]),Object(a.c)("div",{className:"note-preview-wrapper "+s,style:{height:d}},Object(a.c)(Rt.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(){}}))},Lt=i.a.memo(Ft,(function(t,n){return JSON.stringify(t)===JSON.stringify(n)})),Mt=e(190),Dt=e(189),zt=e(59),Bt=e(233),Wt=e(384),Ut=e(30),Ht="[PLUGIN CRON]";Object(Ut.a)("cron","trigger",(function(){Jt()}));var qt="plugins-cron-infos",Vt=function(t,n){var e=[],o=[];Object(bt.a)(n,(function(t,n){e.push(n),o.push(t)}));try{Object(Bt.a)(Function,e.concat([t.code])).apply(void 0,o)}catch(c){var i="[ERR in ".concat(t.type.toLocaleUpperCase()," plugin ").concat(t.name.toLocaleUpperCase(),"]: ").concat(c);console.log(i,c,{paramsNames:e,paramsValues:o,plugin:t}),console.trace(c),Object(Ut.d)("".concat(i))}},Jt=function(){var t=(new Date).toJSON().replace("T","").replace("Z","");Object(j.d)((function(n){n.plugins.list((function(e){n.cache.get(qt,(function(o){o||(o={}),Object(bt.a)(e,(function(e){var i,c,a,r=!0;if(!1===(null===(i=e.options)||void 0===i?void 0:i.disabled)&&(r=!1),"background"===e.type&&r){o[e.name]||(o[e.name]={vars:{}});var l=60*((null===(c=e.options)||void 0===c?void 0:c.background_exec_interval_in_min)||60)*1e3,s=(new Date).getTime(),u=(null===(a=o[e.name])||void 0===a?void 0:a.lastRunTime)||0;if(u+l>s)return console.log(Ht,"".concat(t," => \ud83d\udd51\u23f3 bg plugin ").concat(e.name,", wait for ").concat(Math.round((u+l-s)/1e3)," seconds"));var d=u+l>s;console.log(Ht,"".concat(t," => \ud83d\udd51\u25b6\ufe0f exec the bg plugin ").concat(e.name,", last exec was ").concat(new Date(u).toJSON()),{p:e,lastRun:u,intervalRun:l,now:s,status:d});var p=o[e.name];Vt(e,{tiroApi:n,bgState:p}),o[e.name]&&!Object(Wt.a)(o[e.name])||(o[e.name]={vars:{}}),o[e.name].lastRunTime=s}})),n.cache.set(qt,o,-1)}),{disableRamCache:!0})}))}))},Gt=e(28),Kt=function(){var t=Gt.d.curr.privacy_work_mode_enable,n=Gt.d.curr.privacy_work_mode_filters,e=n.split(",");return e.forEach((function(t,n){e[n]=t.trim().toLowerCase()})),{workModeEnabled:t,workModeFilters:n,workModeFiltersArr:e}},Yt=e(382),$t=e(133),Zt=e(127),Xt=e(72),Qt=e(248),tn=15,nn=!1,en=function(){if(nn)return tn;var t=document.createElement("div");t.style.visibility="hidden",t.style.overflow="scroll",t.style.msOverflowStyle="scrollbar",document.body.appendChild(t);var n=document.createElement("div");return t.appendChild(n),tn=t.offsetWidth-n.offsetWidth,t.parentNode.removeChild(t),nn=!0,tn},on=function(t){if(!t)return"";if("file"===t.type)return t.file.name.replace(".md","");if("ctag"===t.type){var n;if("iframe"===(null===(n=t.ctagConfig)||void 0===n?void 0:n.tagName)){var e,o=null===(e=t.ctagConfig)||void 0===e?void 0:e.content;return Object(G.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""},cn=function(t){var n,e,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(n){t.onPanelUpdate&&(console.log("update panel",n),Object(j.d)((function(t){t.ui.floatingPanel.update(n)})))}),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],y=O[1],k=function(){K(),S(!0),y(!0),t.onPanelDragStart()},C=Object(o.useState)(!1),E=Object(c.a)(C,2),S=(E[0],E[1]),T=function(){y(!1),S(!1),t.onPanelDragEnd()},I=Object(o.useRef)({x:0,y:0}),P=Object(o.useState)({x:-9999,y:-9999}),N=Object(c.a)(P,2),A=N[0],R=N[1];Object(o.useEffect)((function(){t.panel.position&&R({x:t.panel.position.x,y:t.panel.position.y})}),[null===(n=t.panel)||void 0===n||null===(e=n.position)||void 0===e?void 0:e.x,null===(i=t.panel)||void 0===i||null===(l=i.position)||void 0===l?void 0:l.y]);var F=function(t,n){var e=arguments.length>2&&void 0!==arguments[2]&&arguments[2];t.touches&&(t=t.touches[0]);var o={x:t.clientX,y:t.clientY};return e&&(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}),M=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 D=Object(o.useState)(t.panel),z=Object(c.a)(D,2),B=(z[0],z[1],function(n){return function(){Object(j.d)((function(e){e.ui.floatingPanel.updatePanelLayout(t.panel.id,n)}))}}),W=Object(dt.a)((function(){T()}),500),U=function(){Object(j.d)((function(n){n.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),J=V[0],G=V[1],K=function(){t.highestVisibleZIndex!==t.panel.zIndex&&Object(j.d)((function(n){n.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(At.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||1},key:t.panel.id,onMouseDown:function(){K()}},Object(a.c)($t.DraggableCore,{cancel:"body",handle:".handle",onStart:function(n,e){Object(r.e)()||(p(Object(s.a)(Object(s.a)({},t.panel),{},{position:F(n,e,!0)})),k())},onDrag:function(n,e){Object(r.e)()||p(Object(s.a)(Object(s.a)({},t.panel),{},{position:F(n,e)}))},onStop:function(n,e){Object(r.e)()||(T(),p(Object(s.a)(Object(s.a)({},t.panel),{},{position:F(n,e)})))}},Object(a.c)(Yt.a,{boundsByDirection:!0,className:"floating-panel",size:t.panel.size,onResize:function(n,e,o,i){Object(r.e)()||(-1===L.current.x&&(L.current={x:A.x,y:A.y}),M.current=-M.current,p("top"===e||"left"===e?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+M.current,height:o.offsetHeight}}):Object(s.a)(Object(s.a)({},t.panel),{},{size:{width:o.offsetWidth+M.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)(_.b,{name:"expand"})),Object(a.c)("ul",null,Object(a.c)("span",{onClick:B("top")}," ",Object(a.c)(_.a,{name:"custom_icons/top.png"})," "),Object(a.c)("span",{onClick:B("bottom")}," ",Object(a.c)(_.a,{name:"custom_icons/bottom.png"})),Object(a.c)("span",{onClick:B("left")}," ",Object(a.c)(_.a,{name:"custom_icons/left.png"})),Object(a.c)("span",{onClick:B("right")}," ",Object(a.c)(_.a,{name:"custom_icons/right.png"})),Object(a.c)("br",null),Object(a.c)("span",{onClick:B("top-right")}," ",Object(a.c)(_.a,{name:"custom_icons/top-right.png"})),Object(a.c)("span",{onClick:B("bottom-right")}," ",Object(a.c)(_.a,{name:"custom_icons/bottom-right.png"})),Object(a.c)("span",{onClick:B("top-left")}," ",Object(a.c)(_.a,{name:"custom_icons/top-left.png"})),Object(a.c)("span",{onClick:B("bottom-left")}," ",Object(a.c)(_.a,{name:"custom_icons/bottom-left.png"})))),action:function(){}},"ctag"===t.panel.type?{title:"Reload content",icon:"rotate-right",action:function(){G(!1),setTimeout((function(){G(!0)}),100)}}:{},{title:"Close window",icon:"xmark",action:function(){Object(j.d)((function(n){n.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)(Lt,{noteParentType:"floating",windowId:t.panel.id||Object(At.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,n){"windowViewChange"===t&&null!==n&&void 0!==n&&n.view&&p(Object(s.a)(Object(s.a)({},d.current),{},{view:n.view}))}})),"ctag"===t.panel.type&&t.panel.ctagConfig&&J&&Object(a.c)("div",{className:"floating-panel__inner-content ctag window-id-sizeref-".concat(X),style:{height:H}},Object(Xt.a)(t.panel.ctagConfig)))))))},an=function(t){var n=Object(nt.a)(t.panels)?t.panels:[],e=Object(o.useRef)([]);Object(o.useEffect)((function(){e.current=n}),[n]);var i=function(t){Object(j.d)((function(n){n.ui.floatingPanel.update(t)}))},l=function(t,n){Object(j.d)((function(e){e.ui.floatingPanel.actionAll(t,n)}))},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&&n.length>h.current&&b(!1),0===n.length&&b(!1);var t=n.filter((function(t){return"visible"===t.status}));t.length>m.current&&b(!1),m.current=t.length,h.current=n.length}),[n]);var v=function(t){Object(j.d)((function(n){n.ui.floatingPanel.updatePanelLayout("active",t)}))},w=["alt+q","alt+w","alt+shift > a","alt+shift > c","alt+shift > w","ctrl + up","ctrl + down","ctrl + left","ctrl + right","shift + ctrl + up","shift + ctrl + right","shift + ctrl + left","shift + ctrl + down","alt+shift > s"],O=[function(){g()},function(){l("toggleWindowsLayout")},function(){l("minimizeActive")},function(){l("closeActive")},function(){l("toggleWindowsLayout",{layout:"current"})},function(){v("top")},function(){v("bottom")},function(){v("left")},function(){v("right")},function(){v("top-right")},function(){v("bottom-right")},function(){v("top-left")},function(){v("bottom-left")},function(){l("deminimizeFirst")}];Object(o.useEffect)((function(){return w.forEach((function(t,n){Object(pt.a)(t,O[n])})),function(){w.forEach((function(t,n){Object(pt.c)(t,O[n])}))}}),[n]);var x=Object(o.useState)(!1),y=Object(c.a)(x,2),k=y[0],C=y[1],E=function(t){return function(){C("start"===t)}},S=Object(o.useState)(!1),T=Object(c.a)(S,2),I=T[0],P=T[1];Object(o.useEffect)((function(){if(!I&&0!==e.current.length){var t=Object(R.a)(e.current);Object(nt.a)(t)||(t=[]),P(!0),t.forEach((function(t){"minimized"===t.status&&(t.status="hidden")})),Object(j.d)((function(n){n.ui.floatingPanel.updateAll(t)}))}}),[I,n]);var N=Object(o.useState)([]),A=Object(c.a)(N,2),F=A[0],L=A[1],M=Object(o.useState)(0),D=Object(c.a)(M,2),z=D[0],B=D[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;n.forEach((function(n){void 0!==n.zIndex&&n.zIndex>t&&(t=n.zIndex)})),B(t),q(n.filter((function(t){return"visible"===t.status})).length);var o=Object(R.a)(e.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(Qt.a)(r,(function(t){return t.orderPosition})),L(r)}),100);Object(o.useEffect)((function(){V()}),[n]);var J=Object(o.useState)(!1),G=Object(c.a)(J,2),K=G[0],Y=G[1],$=Object(dt.a)((function(t){Y(Object(Zt.a)(t))}),100);return Object(o.useEffect)((function(){$(n)}),[n]),Object(a.c)("div",{className:"floating-panels-wrapper",style:{pointerEvents:k?"all":"none"}},Object(nt.a)(n)&&n.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)(cn,{panel:t,onPanelUpdate:i,onPanelDragStart:E("start"),onPanelDragEnd:E("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+en(),"px"),bottom:"-".concat(en(),"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(n.length>8?15*n.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)(_.b,{name:"layer-group"})," "),Object(a.c)("div",{className:"btn-action toggle-visibility",onClick:g}," ",!0===d?Object(a.c)(_.b,{name:"eye-slash"}):Object(a.c)(_.b,{name:"eye"})," "),Object(a.c)("div",{className:"btn-action pin-bar",onClick:function(){return t.onPinChange(!t.pinStatus)}}," ",Object(a.c)(_.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(n){!function(t){t.status="visible",i(t),Object(j.d)((function(n){n.ui.floatingPanel.pushWindowOnTop(t.id),n.ui.floatingPanel.updateOrderPosition(t.id,"first"),n.ui.floatingPanel.resizeWindowIfOutOfWindow(t.id)}))}(t)}},Object(a.c)("div",{className:"label-wrapper"},Object(a.c)("div",{className:"label",title:on(t)},on(t))),Object(a.c)("div",{className:"close-btn",onClick:function(n){n.stopPropagation(),"minimized"===t.status?function(t){t.status="hidden",i(t)}(t):function(t){Object(j.d)((function(n){n.ui.floatingPanel.delete(t.id)}))}(t)}},Object(a.c)(_.b,{name:"xmark"})))})))))},rn={charsStart:2},ln=[{label:"loading...",value:""}],sn="[\ud83d\udd0e Search Mode]",un="[\ud83d\udcc1 Explorer Mode]",dn="[\u2728 History Mode]",pn="[\ud83d\udd0c Plugin Mode]",fn="[\ud83d\udda5\ufe0f Floating Windows]",bn={dict:{},config:{enabled:!0}},gn=function(){bn.config.enabled=!1,bn.dict={}},hn={hasBeenLoaded:!1},mn=function(t){var n=Object(o.useState)("editable"),e=Object(c.a)(n,2),i=e[0],l=e[1];Object(o.useEffect)((function(){L.current.focus()}),[i]);var u=Object(o.useState)([]),p=Object(c.a)(u,2),f=p[0],b=p[1],g=Object(o.useRef)([]),h=function(t){Object(nt.a)(t)&&(b(t),g.current=t)},m=Object(o.useState)([]),v=Object(c.a)(m,2),w=v[0],O=v[1],x=function(t){nn(t),O(t)},y=Object(o.useState)("No Options"),k=Object(c.a)(y,2),C=k[0],E=(k[1],function(n){Object(j.d)((function(e){e.ui.note.editorAction.dispatch({type:"insertText",insertText:Object(Dt.a)(n)}),t.onClose()}))}),S=function(n){Object(j.d)((function(e){e.ui.floatingPanel.create({type:"file",file:n}),t.onClose()}))},T=function(t){var n=Object(o.useState)(!1),e=Object(c.a)(n,2),i=e[0],l=e[1];return Object(o.useMemo)((function(){return Object(a.c)("div",{className:"path-option-wrapper device-".concat(Object(r.a)()),onMouseEnter:function(t){l(!0)},onMouseLeave:function(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:function(n){n.stopPropagation(),E(t.file)}},Object(a.c)(_.b,{name:"link",label:"insert note link in the current note"})),Object(a.c)("div",{className:"action",onClick:function(n){n.stopPropagation(),S(t.file)}},Object(a.c)(_.b,{name:"window-restore",label:"Open note in a floating window"}))))}),[t.file,i])},I=function(t){return Object(a.c)(T,{file:t})},P=window.innerHeight-160-200,N=(Object(o.useRef)(!1),Object(o.useState)({indicatorsContainer:function(t,n){return Object(s.a)(Object(s.a)({},t),{},{display:"none"})},menuList:function(t,n){var e="mobile"===Object(r.a)()?{}:{maxHeight:P};return Object(s.a)(Object(s.a)({},t),e)},menu:function(t,n){var e="mobile"===Object(r.a)()?"all":"none";return Object(s.a)(Object(s.a)({},t),{},{position:"relative",pointerEvents:e})},control:function(t,n){return Object(s.a)(Object(s.a)({},t),{},{outline:"none",boxShadow:"none",border:0})},multiValue:function(t,n){return n.data.editable?t:Object(s.a)(Object(s.a)({},t),{},{backgroundColor:d.a.colors.main})},multiValueLabel:function(t,n){var e=Object(s.a)(Object(s.a)({},t),{},{color:"#919090!important"});return Object(s.a)({},e)},multiValueRemove:function(t,n){var e="mobile"===Object(r.a)()?"block":"none";return n.data.editable?t:Object(s.a)(Object(s.a)({},t),{},{display:e,opacity:"0.2",position:"relative",top:"3px"})}})),A=Object(c.a)(N,2),R=A[0],F=A[1];Object(o.useEffect)((function(){setTimeout((function(){R.menu=function(t,n){var e=(Object(r.a)(),"all");return Object(s.a)(Object(s.a)({},t),{},{position:"relative",pointerEvents:e})},F(R)}),500)}),[]);var L=Object(o.useRef)(),M=w[0]||{label:"",value:""},D=function(n){var e=Object(tt.e)(n);z.current?(console.log("jumpToFileModifier",z.current),t.onClose(),S(e)):Object(j.d)((function(n){n.ui.browser.goTo(e.folder,e.name,{openIn:"activeWindow"}),t.onClose()}))},z=Object(o.useRef)(!1),B=["alt"],W=[function(){z.current=!0}];Object(o.useEffect)((function(){return B.forEach((function(t,n){Object(pt.a)(t,W[n])})),function(){B.forEach((function(t,n){Object(pt.c)(t,W[n])}))}}),[]);var U=Object(o.useState)(""),H=Object(c.a)(U,2),q=H[0],V=H[1],J=Object(o.useRef)(null);Object(o.useEffect)((function(){J.current=q}),[q]);var G=Object(o.useRef)(""),K=Object(zt.a)("omni-history",[],{history:!0}),Y=Object(c.a)(K,3),$=Y[0],Z=Y[1],X=Y[2];Object(o.useEffect)((function(){!function(){var n=g.current,e=q.trim();if(On("editor"),0===n.length)"/"===e&&(Object(Mt.a)("omnibar_explorer"),Object(j.d)((function(t){V("");var n=t.ui.browser.folders.current.get();ht(n)}))),""===e&&xt(),";"===e&&(V(""),jn()),"?"===e&&(Object(Mt.a)("omnibar_search"),mt()),":"===e&&yt(),","===e&&rt();else if(n[0].label===sn)wt(n,e);else if(n[0].label===un){var o,i=function(){var t=Object(It.a)(n);t.shift();var e="";return Object(bt.a)(t,(function(t){e+="/"+t.value})),e}();if("createNewFile"===(null===(o=n[n.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")){var c=Object(It.a)(n);c.pop(),""===q&&c.push({label:q,value:q}),lt(c),i=i.replace(n[0].label,""),D(i)}else G.current!==i&&(G.current=i,ht(i))}else n[0].label===pn?kt(e,n):n[0].label===dn?st(e,n):n[0].label===fn&&xn(e,n)}(),_t.current&&_t.current()}),[f,q]);var Q=function(t){return t.replaceAll("[","").replaceAll("]","")},et='[OMNIBAR "ctrl+alt+space"] type "?" for '.concat(Q(sn),', "/" for ').concat(Q(un),', ":" for ').concat(Q(pn),', "," for ').concat(Q(dn),', ";" for ').concat(Q(fn)),ot=Object(o.useState)(et),it=Object(c.a)(ot,2),ct=it[0],at=it[1],rt=function(){h([{value:dn,label:dn}])};Object(o.useEffect)((function(){hn.hasBeenLoaded||(X(),gt.current=window.__Tiro_omniCacheFoldersRam,hn.hasBeenLoaded=!0)}),[]);var lt=function(t){console.log("1/2 [HIST mode]: addToOmniHistory",Object(It.a)(t));var n=[];Object(bt.a)(t,(function(t){n.push(t.label)}));var e=n.join(" "),o={options:t,id:e},i=$.filter((function(t){return t.id!==e})),c=[o].concat(Object(It.a)(i));c.length>100&&c.splice(0,100),console.log("2/2 [HIST mode] add to omnihist ",{nItem:o,nItems:c}),Z(c)},st=function(t,n){if(Wt(null),n[1]){if(n[1]){var e;console.log("HIST selected",n[1]);var o=null===(e=n[1].payload)||void 0===e?void 0:e.options;if(!o)return;var i=o.pop();i&&V(i.label),h(o)}}else at("loading history mode..."),X((function(t){var n=[];Object(bt.a)(t,(function(t){n.push({label:t.id,value:t.id,payload:t})})),at("history mode"),x(n)})),","===t&&V("")},ut=Object(o.useRef)(0),ft=Object(o.useRef)(""),gt=Object(o.useRef)(window.__Tiro_omniCacheFoldersRam||{}),ht=function(t){var n=Object(tt.b)(t),e='Explorer mode for "'.concat(n,'"'),o='Loading explorer mode for "'.concat(n,'"...');if(at(e),""!==t&&(t.endsWith("/")||(t+="/"),t!==ft.current)){ft.current=t,console.log("== EXPLORER",t),x(ln),l("locked"),ut.current++;var i=ut.current;if(gt.current[t]){console.log("[OMNI > EXPLORER] using cache for ".concat(t));for(var c=gt.current[t],r=0;r<c.length;r++){var s,u=c[r];u.label.props&&(c[r].label=I(null===u||void 0===u||null===(s=u.payload)||void 0===s?void 0:s.file))}x(c)}var d=t.split("/"),p=[];p.push({value:un,label:un}),p.push({value:"/",label:"/"}),Object(bt.a)(d,(function(t){""!==t&&p.push({value:t,label:t+"/"})})),h(p),Object(j.d)((function(n){at(o);var c=[t];n.folders.get(c,(function(o){if(i===ut.current&&(o.folderPaths.join("")===c.join("")&&o.folders[0])){var r=o.folders[0].children;n.files.get(t,(function(n,o){if(o===t){var i=[];Object(a.c)("div",{style:{},className:"barimage"});i.push({value:"",label:"\u2795 create file",payload:{action:"createNewFile"}}),Object(bt.a)(r,(function(t){var n=t.path.split("/"),e=n[n.length-1]+"/";i.push({value:e,label:"\ud83d\udcc1 "+e})})),n=Object(Nt.a)(n,["modified"],["desc"]),Object(bt.a)(n,(function(t){var n=t.path.split("/"),e=n[n.length-1],o={file:t},c=I(t);i.push({value:e,label:c,payload:o})})),x(i),l("editable"),gt.current[t]=i,window.__Tiro_omniCacheFoldersRam=gt.current,at(e)}}))}}))}))}},mt=function(){h([{value:sn,label:sn}])},vt=Object(o.useRef)(""),wt=function(t,n){if(t[1]){if(2===t.length)On("editor"),jt(n,t[1].label,t);else if(3===t.length&&Ot.current===t[2].value)On("preview"),console.log("STEP 3-1 (optional) : filter found results",Ot.current);else if(3===t.length||4===t.length){var e;console.log("STEP 3-2 : jump to page",{w:Ot.current,stags:t});var o=t.length-1;if(null===(e=t[o].payload)||void 0===e||!e.file)return;var i=t[o].payload.file;D(i.path)}}else"?"===n&&Object(j.d)((function(t){var n=t.ui.browser.folders.current.get;V(n)})),""===n?V(vt.current):vt.current=n.slice(0,-1),at('Path to search (ex:"/path/to/folder") + ENTER'),x([{label:n,value:n}])},Ot=Object(o.useRef)(null),jt=Object(dt.a)((function(t,n,e){var o=n,i=t;if(i&&o&&i.length>=rn.charsStart&&o.length>0){at('Searching "'.concat(i,'" in "').concat(o,'" ...')),x(ln);var c=i.includes("*"),r=[];x(r),Ot.current=i,lt([].concat(Object(It.a)(e),[{label:i,value:i}])),Object(j.d)((function(t){t.search.word(i,o,(function(t){Object(bt.a)(t,(function(t){Object(bt.a)(t.results,(function(n){var e=c?"(".concat(i,")"):"",o="".concat(t.file.path," ").concat(e),l=n.indexOf(i),s=100,u=n,d=l>50?l-50:0,p=l+50<u.length?l+50:u.length;u.length>s&&(u=u.substring(d,p));var 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"},o),Object(a.c)("div",{className:"occur-wrapper",dangerouslySetInnerHTML:{__html:b}}));r.push({label:g,value:Ot.current+t.file+f+o,payload:{file:t.file,line:f,raw:n}})}))})),0===r.length&&Wt(null),r.unshift({label:"\ud83d\udd0e Filter the ".concat(r.length,' results for "').concat(Ot.current,'"'),value:Ot.current}),at("".concat(r.length-1,' results found for "').concat(i,'" in "').concat(o,'" ')),x(r)}))}))}else at("Type the searched word"),x([]),setTimeout((function(){L.current.focus()}),100),Wt(null),Ot.current=""}),500),xt=function(){var n;at(et);var e=function(t){var n=[];return Object(bt.a)(t,(function(t){var e={value:t.path,label:I(t),payload:{file:t}};n.push(e)})),n}(function(t){var n=Kt(),e=n.workModeEnabled,o=n.workModeFilters,i=n.workModeFiltersArr;if(!e)return t;var c=[];return Object(bt.a)(i,(function(n){var e=t.filter((function(t){return t.name.toLowerCase().includes(n)||t.path.toLowerCase().includes(n)}));c.push.apply(c,Object(It.a)(e))})),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(e.length>=2){var o=e.shift(),i=e.shift();e.unshift(o),e.unshift(i)}var c=e[0]?null===(n=e[0].payload)||void 0===n?void 0:n.file:null;c&&Wt(c),x(e)},yt=function(){h([{value:pn,label:pn}])},kt=function(n,e){Wt(null),Object(j.d)((function(o){if(1===e.length){var i=[];o.plugins.list((function(t){Object(bt.a)(t,(function(t){"bar"===t.type&&i.push({label:t.name,value:t})})),x(i),":"===n&&V(""),i=Object(Nt.a)(i,["label"]),at("".concat(i.length," bar plugins found"))}))}else if(e.length>=2){var c={input:n,setInputTxt:V,inputTxt:q,inputTxtRef:J,options:w,setOptions:x,onChange:_t,onClose:t.onClose,onHide:t.onHide,close:t.onClose,hide:t.onHide,selectedOptionRef:g,setSelectedOption:h,addToOmniHistory:lt,selectedTags:e,setNotePreview:Wt,notePreview:Ft,setHtmlPreview:Jt,htmlPreview:qt,disableCache:gn},a=e[1].value;x(ln),Object(j.d)((function(t){Vt(a,{barApi:c,tiroApi:t})}))}}))},_t=Object(o.useRef)(null),Ct=Object(o.useState)(Object(At.a)()),Et=Object(c.a)(Ct,2),St=Et[0],Tt=(Et[1],Object(o.useState)(null)),Rt=Object(c.a)(Tt,2),Ft=Rt[0],Bt=Rt[1],Wt=function(t){Bt(t)},Ut=Object(o.useState)(null),Ht=Object(c.a)(Ut,2),qt=Ht[0],Jt=Ht[1],Gt=Object(o.useState)(void 0),Yt=Object(c.a)(Gt,2),$t=Yt[0],Zt=Yt[1],Xt=function(t,n){var e=g.current;e[0]&&e[0].label===un?Wt(t):e[0]&&e[0].label===sn?(Wt(t),setTimeout((function(){Zt(n)}),300)):e[0]?Wt(null):Wt(t)},Qt=Object(o.useRef)([]),tn=Object(dt.a)((function(){var t=document.querySelectorAll("div[id*='-option']");if(0===t.length)return Wt(null);Object(bt.a)(t,(function(t){if("rgb(222, 235, 255)"===getComputedStyle(t)["background-color"]){var n=parseInt(t.id.split("-").pop()),e=w[n].payload;if(!e)return;var o=e.file,i=e.line||void 0;Xt(o,i)}}))}),400),nn=Object(dt.a)((function(t){!function(t){Object(bt.a)(Qt.current,(function(t){t.disconnect()})),Qt.current=[];var n=document.querySelectorAll("div[id*='-option']");Object(bt.a)(n,(function(t,n){var e=new MutationObserver((function(n){var e=parseInt(t.id.split("-").pop());if("rgba(0, 0, 0, 0)"!==getComputedStyle(t)["background-color"]&&w[e]&&w[e].payload){var o=w[e].payload;if(!o)return;var i=o.file,c=o.line||void 0;document.querySelectorAll("div[id*='-option']"),Xt(i,c)}}));e.observe(t,{childList:!0,attributes:!0,subtree:!1}),Qt.current.push(e)}))}()}),100);Object(o.useEffect)((function(){nn(w)}),[w,q,$]);var en=Object(o.useState)(300),cn=Object(c.a)(en,2),an=cn[0],bn=cn[1],mn=Object(o.useRef)(null);Object(dt.a)((function(){if(mn&&mn.current){var t=mn.current.clientHeight+30,n=window.innerHeight-t-50;an!==n&&bn(n)}}),10)();var vn=Object(o.useState)("editor"),wn=Object(c.a)(vn,2),On=(wn[0],wn[1]),jn=function(){h([{value:fn,label:fn}]),Object(j.d)((function(t){var n=[];x(n),Object(bt.a)(t.ui.floatingPanel.panels,(function(t){"visible"!=t.status&&n.push({label:on(t),value:t,payload:{floatingPanel:t}})})),x(n),at("".concat(n.length," floating windows found"))}))},xn=function(n,e){if(Wt(null),2===e.length){var o,i=null===(o=e[1].payload)||void 0===o?void 0:o.floatingPanel;if(!i)return;Object(j.d)((function(t){t.ui.floatingPanel.deminimizePanel(i.id)})),t.onClose()}};return Object(a.c)("div",{className:"omnibar-popup-bg ".concat(t.show?"":"hide"),onClick:function(n){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:function(t){t.stopPropagation()}},Object(a.c)("div",{className:"select-wrapper",ref:mn},Object(a.c)("div",{className:"help"},ct),Object(a.c)("div",{className:"help-right",onClick:function(n){t.onHide()}},Object(a.c)(_.a,{name:"faEyeSlash",color:"#b2b2b2"})),Object(a.c)(Pt.a,{isMulti:!0,ref:L,menuIsOpen:!0,defaultValue:M,value:f,autoFocus:!0,isDisabled:"locked"===i,onChange:function(t,n){var e=t[0];if(e&&e.payload&&e.payload.file){var o=e.payload.file;D(o.path),t=[]}h(t)},openMenuOnClick:!1,inputValue:q,onInputChange:function(t,n){tn(),"input-blur"===n.action||"menu-close"===n.action||V(t)},onFocus:function(t){},options:w,styles:R,noOptionsMessage:function(){return C}})),Ft&&"mobile"!==Object(r.a)()&&Object(a.c)("div",{className:"preview-wrapper ".concat(Ft?"note-preview":"html-preview-wrapper"),style:{height:an}},Ft&&"mobile"!==Object(r.a)()&&Object(a.c)(Lt,{noteParentType:"omnibar",file:Ft,showToolbar:!0,titleEditor:!1,searchedString:$t,height:an,windowId:St}),qt&&Object(a.c)("div",{className:"html-preview",dangerouslySetInnerHTML:{__html:qt},style:{height:an}})))))},vn=function(t){var n=Object(o.useState)(""),e=Object(c.a)(n,2),r=e[0],l=e[1];return Object(o.useEffect)((function(){Object(j.d)((function(n){n.file.getContent(t.filePath,(function(e){var o=Object(tt.e)(t.filePath),i=n.note.render({raw:e,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}})))},wn=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)(vn,{filePath:t.filePath})))},On=e(159),jn=e(242),xn=e(229),yn=e(234),kn="[NOTIFICATIONS]";Object(Ut.a)("notification","emit",(function(t,n){var e=t||"";Object(j.d)((function(o){console.log(t,n),o.ui.notification.emit({content:(new Date).toJSON()+" \n\n <br/> test notif => \n"+e,options:Object(s.a)({},n)})}))}));var _n=function(t){var n=Object(o.useState)([]),e=Object(c.a)(n,2),i=e[0],r=e[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(n){return!0===!n?console.log("[NOTIFS] notifications disabled, not displaying it"):function(t){var n=Kt(),e=n.workModeEnabled,o=(n.workModeFilters,n.workModeFiltersArr);if(!e)return!0;var i=!1;return Object(bt.a)(o,(function(n){t.toLowerCase().includes(n)&&(i=!0)})),i}(t.notification.content)?(t.notification.id||(t.notification.id=Object(At.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 n,e=1e3*((null===(n=t.options)||void 0===n?void 0:n.hideAfter)||10);e<0||t.id&&(s.current[t.id]=setTimeout((function(){f(t.id)}),e))},d=function(t){l.current=l.current.filter((function(n){return n.id!==t.id})),t.id&&s.current[t.id]&&clearTimeout(s.current[t.id]),l.current.unshift(t),r(Object(It.a)(l.current))},p=function(t){var n,e;null!==(n=t.options)&&void 0!==n&&n.onClickId&&function(t){console.log(kn,"triggerNotifOnClick => ",t);var n=yn.a[t];n?n():console.log(kn,"no fn found for idFn",t)}(null===(e=t.options)||void 0===e?void 0:e.onClickId)},f=function(t){t&&(l.current=l.current.filter((function(n){return n.id!==t})),r(Object(It.a)(l.current)))},b=function(t){var n,e,o="normal";return null!==(n=t.options)&&void 0!==n&&n.type&&(o=null===(e=t.options)||void 0===e?void 0:e.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(n){p(t),f(t.id)}},Object(a.c)("div",{className:"notif-close",onClick:function(n){f(t.id)}},Object(a.c)(_.b,{name:"close"})),Object(a.c)("div",{className:"notif-content",dangerouslySetInnerHTML:{__html:t.content}}))}))))},Cn=e(221),En=e(75),Sn=function(t){var n,e,i=Object(tt.e)(t.notePreview.filepath);Object(o.useEffect)((function(){u("note-preview-popup-wid-".concat(Object(At.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(n){var e,o=Object(tt.e)(t.notePreview.filepath);o&&null!==(e=t.notePreview.opts)&&void 0!==e&&e.windowIdToOpenIn&&(Object(En.d)(!0),Object(j.d)((function(n){var e;n.ui.browser.goTo(o.folder,o.name,{openIn:null===(e=t.notePreview.opts)||void 0===e?void 0:e.windowIdToOpenIn})})))}}),Object(a.c)("div",{className:"page-link-preview-popup-int"},Object(a.c)(Lt,{noteParentType:"popup",file:i,searchedString:null===(n=t.notePreview.opts)||void 0===n?void 0:n.searchedString,replacementString:null===(e=t.notePreview.opts)||void 0===e?void 0:e.replacementString,windowId:s,showToolbar:!0,titleEditor:!1,view:"editor",linkPreview:!1})))},Tn=400,In=300,Pn=e(122),Nn=e(90),An=e(99),Rn=window._tiro_generatePluginsMarketplaceHtml?window._tiro_generatePluginsMarketplaceHtml:function(){},Fn=function(t){var n=Object(o.useState)([]),e=Object(c.a)(n,2),i=e[0],r=e[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 n=Rn({pluginsDescriptions:t,fullDisplayMode:!0,onPluginClick:function(t){console.log("pluginClick",t)},onSettingChange:function(t){console.log("onSettingChange",t)}});d(n)}))}))}),[]),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...")))},Ln=e(137),Mn=e(246),Dn=e(216),zn=e(226),Bn=e(227),Wn=e(232),Un=function(t){var n=t.url;(n=n.trim()).includes("?")?n+="&autoplay=1&mute=1":n+="?autoplay=1&mute=1";var e=Object(o.useState)(!1),i=Object(c.a)(e,2),r=i[0],l=i[1];return Object(o.useEffect)((function(){setTimeout((function(){l(!0)}),3e3)}),[]),Object(a.c)("div",{className:"background-video",style:{width:"".concat(t.width,"%"),height:"".concat(t.height,"%")}},r&&Object(a.c)("iframe",{src:"".concat(n),allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share"}))},Hn=e(228),qn=e(230),Vn=(Object(r.a)(),Object(s.a)({},d.a)),Jn=Vn.els,Gn=Vn.colors,Kn=(Vn.font,Vn.sizes),Yn=Object(Mn.a)((function(t,n,e,o){return Xn(t,n,e,o)}),(function(){for(var t=arguments.length,n=new Array(t),e=0;e<t;e++)n[e]=arguments[e];return JSON.stringify(n)})),$n=Object(Mn.a)((function(t){return Zn(t)}),(function(){for(var t=arguments.length,n=new Array(t),e=0;e<t;e++)n[e]=arguments[e];return JSON.stringify(n)})),Zn=function(t){var n=Object(Ln.a)("CssAppDynamic"),e=Gt.d.curr.ui_layout_background_image_enable,o=Gt.d.curr.ui_layout_background_image,i=100,c=100,a=Gt.d.curr.ui_layout_background_video_enable;if(!0===e&&!1===a){var l=o.indexOf("?token=");l>0&&(o=o.substring(0,l)),(o+="?token=".concat(Object(z.b)())).startsWith("http")||(o="".concat(Object(L.a)(o)))}!0!==a&&!0!==e||(i=parseInt(Gt.d.curr.ui_layout_background_image_window_opacity)/100,c=parseInt(Gt.d.curr.ui_layout_background_image_window_opacity_active)/100);var s="\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(e?"background-image: url('".concat(o,"');"):"","\n\t\t\n\t\tbackground-size: cover;\n\t\t.react-grid-item {\n\t\t\topacity: ").concat(i,";\n\t\t}\n\t\t.react-grid-item.active {\n\t\t\topacity: ").concat(c,";\n\t\t}\n\n\t\t").concat("\n.background-video {\n position: fixed;\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(Pn.d)(),"\n\t\t// FILE RESSOURCE PREVIEW\n\t\t").concat(Object(Nn.b)(),"\n\t\t// PREVIEW LINK\n\t\t").concat(Object(En.b)(),"\n\t\t").concat(Object(An.e)(),"\n\n\t\t").concat(Object(Wn.b)(),"\n\n\t\t").concat(Object(_.c)(),"\n\t\t").concat(Object(zn.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(Tn,"px;\n height: ").concat(In,"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(Tt.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(J.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\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\t.popup-wrapper {\n\t\t\tinput, select {\n\t\t\t\twidth: 90%;\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(yt.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(J.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(Ct.b)(),"\n\n\t\t").concat(Object(Et.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(J.a)(-3),"px;\n margin-bottom: 4px;\n overflow: hidden;\n height: ").concat(15,"px;\n list-style: none;\n font-size:").concat(Object(J.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(St.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(jn.b)(),"\n\n\t\t").concat(Object(rt.b)(),"\n\t\t").concat(Object(On.b)(t),"\n\t\t").concat(Object(xn.b)(),"\n\t\t").concat(Object(Dn.b)(),"\n\t\t").concat(Object(Bn.b)(),"\n\t\t").concat(Object(qn.b)(),"\n\t\t").concat(Object(Hn.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(Rt.b)(),"\n\t\t").concat(Object(f.b)(),"\n\t\t").concat(Object(St.b)(),"\n\t\t").concat(Object(kt.b)(),"\n\t\t").concat(Object(_t.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(J.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(J.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(Gn.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(Gn.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\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(Kn.search.padding,"px;\n\t\t\t\t\t\t\t\theight: ").concat(Kn.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(Kn.block,"px ").concat(Kn.block,"px ").concat(Kn.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(Gn.l2.text,";\n\t\t\t\t\t\t\t\t\t\t\t\tfont-size: ").concat(Object(J.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(Gn.l2.text,";\n\t\t\t\t\t\tbutton {\n\t\t\t\t\t\t\t\tcolor: ").concat(Gn.l2.text,";\n\t\t\t\t\t\t\t\t").concat(Jn().button,"\n\t\t\t\t\t\t\t\tpadding: 0px;\n\t\t\t\t\t\t\t\tmargin-right: ").concat(Kn.block,"px; \n\t\t\t\t\t\t\t\tfont-size: ").concat(Object(J.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(J.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(J.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(Gn.l2.bg,"; \n\t\t\t\t\t.image-gallery-header {\n\t\t\t\t\t\t\tpadding-top: ").concat(Kn.search.padding,"px;\n\t\t\t\t\t\t\theight: ").concat(Kn.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(J.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(wt.b)(),"\n\n\t\t\t\n\t\t\t").concat(Object(vt.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 n(),Object(u.a)(s,";","")},Xn=function(t,n,e,o){var i=Object(Ln.a)("CssAppDynamic"+t+n),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(Cn.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(wt.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}\n\t\t} // end main-wrapper\n");return i(),Object(u.a)(c,";","")},Qn=function(t){return t.path.substr(0,t.path.length-(t.title.length+1))},te=function(t){var n=t.split("/");(n=n.filter((function(t){return""!==t}))).pop();var e="/"+n.join("/")+"/";return e=e.replaceAll("//","/")},ne="\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",ee=function(t,n,e,o){var i=function(t,n){console.log("[MOVEFILE] ".concat(t," -> ").concat(n)),Object(j.e)().then((function(e){e.file.move(t,n,(function(){e&&e.ui.browser.goTo(e.ui.browser.folders.current.get())}))}))};return{askForMoveFile:i,promptAndBatchMoveFiles:function(n){var e=n.files,o=n.folderToDropInto,c="Move <p>".concat(null===e||void 0===e?void 0:e.length,'</p> file(s) to <p>"').concat(o.key,'"</p>?\n<br>\n<br>\nRessources links will be automatically updated<br>\n').concat(ne,"\n");Object(j.d)((function(n){n.popup.confirm(c,(function(){!function(){for(var n=0;n<e.length;n++){var c=e[n],a="".concat(c.path),r="".concat(o.key,"/").concat(c.name);i(a,r),t()}}()}))}))},promptAndMoveFolder:function(e){var o=Object(s.a)({},e),i=o.folder,c=o.folderToDropInto,a=o.folderBasePath,r=o.newTitle,l=o.renameOnly,u=[i.path,"".concat(l?Qn(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(ne,"\n"),b=function(){!function(t,n,cb){console.log("[MOVEFOLDER] ".concat(t," -> ").concat(n)),Object(j.d)((function(e){e.folders.move(t,n,(function(){e&&e.ui.browser.goTo(e.ui.browser.folders.current.get()),cb&&cb()}))}))}(d,p,(function(){t(),n(),e.onMoveFn&&e.onMoveFn()}))};e.disablePrompt?b():Object(j.e)().then((function(t){t.popup.confirm(f,(function(){b()}))}))}}},oe="[LAST FILE]",ie=O.a.client.log.verbose,ce=[".tiro/answers/"],ae=function(t){var n=Object(zt.a)("files-history",[],{history:!1,debouncedSave:5e3}),e=Object(c.a)(n,3),a=e[0],r=e[1],l=e[2],s=i.a.useRef(a);Object(o.useEffect)((function(){s.current=a}),[a]),Object(o.useEffect)((function(){ie&&console.log(oe," activeFile changed!",t),t&&u(t)}),[t]);var u=function(t){if(!function(t){for(var n=0,e=ce;n<e.length;n++){var o=e[n];if(t.includes(o))return!0}return!1}(t.path)){ie&&console.log(oe,"Add to last notes",t.name);var n=s.current;if(!(n.length>0&&n[0].name===t.name)){var e=!0,o=-1,i=n;!1===Object(nt.a)(n)&&(i=[]);for(var c=0;c<n.length;c++)n[c].name===t.name&&(e=!1,o=c);e||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(oe," removing ").concat(t," from last notes"));var n=Object(R.a)(a);n=n.filter((function(n){return n.path!==t})),r(n)},addToHistory:function(t){!(arguments.length>1&&void 0!==arguments[1])||arguments[1]?d(t):u(t)}};return{filesHistory:a,filesHistoryRef:s,cleanLastFilesHistory:function(){r([])},refreshFilesHistoryFromBackend:l,lastFilesHistoryApi:p}},re=function(){var t=Object(o.useState)(!1),n=Object(c.a)(t,2),e=n[0],i=n[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:e,frr:u,responsiveRefreshCounter:l,setResponsiveRefresh:s}},le=e(161),se=e(239),ue=e(91),de=function(t){var n=Object(o.useState)({}),e=Object(c.a)(n,2),i=e[0],r=e[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 n=f+1>=V.a.length?0:f+1;Object(j.d)((function(e){e.userSettings.set("ui_filesList_sortMode",n),b(n),t.onSortFiles(Object(V.d)(t.files,n))}))}},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)(_.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(n){t.onFileClicked(n)},onFileDragStart:t.onFileDragStart,onFileDragEnd:t.onFileDragEnd,onVisibleItemsChange:function(t){!function(t){for(var n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],e=[],o=0;o<t.length;o++){var c=t[o];i[c]&&!n||e.push(c)}e.length>1&&Object(j.d)((function(t){t.files.getPreviews(e,(function(t){Object(bt.a)(t,(function(t){i[t.path]=t})),r(i),s()}))}))}(t,!0)}})))},pe=function(){var t="[NOTE HISTORY] ",n=O.a.client.log.verbose,e=Object(o.useRef)({}),i=function(){return(new Date).getTime()},c=function(e,o,i){n&&console.log("".concat(t," saveNoteHistory ").concat(e)),l.b.emit("createHistoryFile",{filePath:e,content:o,historyFileType:i,token:Object(z.b)()})};return{save:c,intervalSave:function(o,a){var r=e.current[o];(!r||r&&r+6e4<i())&&(n&&console.log("".concat(t," ").concat(o,", time ").concat(1," expired/inexistand, PROCEED BACKUP")),c(o,a,"int"),e.current[o]=i())}}},fe=function(t){var n=Object(o.useState)(!1),e=Object(c.a)(n,2),i=e[0],a=e[1],r=Object(o.useState)([]),l=Object(c.a)(r,2),u=l[0],d=l[1];return{isConnected:t.isConnected,searching:{get:i,set:a},ipsServer:{get:u,set:d,getLocal:function(){var t=u[0];return Object(bt.a)(u,(function(n){n.startsWith("192.168")&&(t=n)})),t}},refresh:Object(s.a)(Object(s.a)({},t.refresh),{},{increment:function(){t.refresh.set(t.refresh.get+1)}})}},be=e(138),ge="[PWA]",he=O.a.client.log.verbose,me=function(){he&&console.log(ge," init"),"serviceWorker"in navigator&&navigator.serviceWorker.register("/service-worker.js"),window.addEventListener("beforeinstallprompt",(function(t){t.preventDefault(),he&&console.log(ge," beforeinstallprompt WORKING=>",t),window.deferredPrompt=t}))},ve=e(170),we=e(29),Oe=function(t){var n=t;return n=(n=(n=(n=(n=(n=(n=(n=(n=(n=(n=(n=(n=n.replace(we.a.ressource,"")).replace(we.a.ref,"")).replace(we.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")},je=function(t){return t.replace(/(\r\n\r\n|\n\n|\r\r|\n)/gm,".")},xe=function(){var t=[];return window.speechSynthesis.getVoices().forEach((function(n,e){var o=n.lang?" (".concat(n.lang,")"):"",i="".concat(n.name).concat(o);t.push({key:e,label:i,obj:n})})),t},ye=function(t){return t=(t=(t=(t=t.replace(/\u2019/g,"'")).replace(/\u201c/g,'"')).replace(/[^a-zA-Z0-9]/g,"")).trim()},ke=function(t,n,e){var o=Gt.d.curr.tts_sentences_per_part,i=_e(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,n.length);var a=-1;return Object(bt.a)(n,(function(t,n){Object(bt.a)(i,(function(e,o){if(-1==a&&-1!==ye(t).indexOf(ye(e)))return a=n-o+1,!1}))})),a},_e=function(t,n){for(var e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:70,o=(t=je(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%n===0&&(r.push(a),a=""),(a+=c[l]).split(" ").length>e&&(r.push(a),a="")}return r=r.filter((function(t){return t.length>1}))},Ce=function(t,n){for(var e=(t=je(t)).split(/[.!?]+/),o=[],i=0;i<e.length;i++){var c=e[i];if(c.length>n)for(var a=c.split(" "),r="",l=0;l<a.length;l++)((r+=a[l]+" ").length>n||l===a.length-1)&&(o.push(r),r="");else o.push(c)}return o},Ee=Object(I.a)((function t(n){var e=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=Ce,this.loadVoice=function(t){console.log("[TTS] LOAD VOICE",t),e.voice=t,e.pause(),e.play()},this.updateSpeed=function(t){e.speed=t,e.pause(),e.play()},this.play=function(){if(e.isLoaded)window.speechSynthesis.resume();else{if(e.currChunkId>e.chunkedText.length-1)return console.log("[TTS] finished played");e.isLoaded=!0,e.currSpeechObj=new SpeechSynthesisUtterance,e.currSpeechObj.text=e.chunkedText[e.currChunkId],e.currSpeechObj.rate=e.speed,e.voice&&(e.currSpeechObj.voice=e.voice),setTimeout((function(){window.speechSynthesis.speak(e.currSpeechObj)}),0),e.currSpeechObj.addEventListener("end",(function(){e.isLoaded=!1,e.shouldStop?e.shouldStop=!1:(e.currChunkId+=1,e.play())}))}},this.isPlaying=function(){var t=window.speechSynthesis.speaking;return t&&(t=!window.speechSynthesis.paused),t},this.pause=function(){e.stop()},this.stop=function(){e.shouldStop=!0,e.isLoaded=!1,e.debounceReinitStop(),window.speechSynthesis.cancel()},this.debounceReinitStop=Object(A.a)((function(){e.shouldStop=!1}),1e3),this.goToChunk=function(t){t<=0||t>e.chunkedText.length-1||(e.currChunkId=t,e.isPlaying()&&e.debounceRestart())},this.extractToChunkPos=ke,this.getCurrentChunkText=function(){return e.chunkedText[e.currChunkId]},this.debounceRestart=Object(A.a)((function(){e.stop(),e.play()}),500),this.goBack=function(){e.goToChunk(e.currChunkId-1)},this.goForward=function(){e.goToChunk(e.currChunkId+1)},this.rawText=n.text,this.text2read=Oe(n.text),this.chunkedText=this.chunkText(this.text2read,this.chunkLength),console.log("[TTS] init new manager ",{p:n,text:this.chunkedText,length:this.chunkedText.length})})),Se=e(32),Te=e(44),Ie="[SCREEN WAKE LOCK]",Pe=null,Ne=function(){var t=Object(Te.a)(Object(Se.a)().mark((function t(){return Object(Se.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:Pe=t.sent,console.log(Ie,"ACTIVE"),t.next=10;break;case 7:t.prev=7,t.t0=t.catch(0),console.log(Ie,"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)}}(),Ae=function(){Pe&&Pe.release().then((function(){Pe=null,console.log(Ie,"DISABLED")}))};var Re=function(t){var n=Object(o.useState)(!1),e=Object(c.a)(n,2),i=e[0],l=e[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?Ne():Ae(),m(t)},w=Object(h.a)("tts-pos-".concat(t.id),0),O=Object(c.a)(w,2),j=O[0],y=O[1],k=Object(h.a)("tts-rate",1),E=Object(c.a)(k,2),S=E[0],T=E[1],I=Object(o.useState)(0),P=Object(c.a)(I,2),N=P[0],A=P[1],R=Object(o.useState)(""),F=Object(c.a)(R,2),L=F[0],M=F[1];Object(o.useEffect)((function(){var t=function(t){var n=0,e="".concat(Math.ceil(t),"m");if(t>60){n=Math.floor(t/60);Math.ceil(t%60);e="".concat(n,"h")}return e},n=t(6*(N-j)/(60*S)),e=t(6*N/(60*S)),o=" ".concat(n," left of ").concat(e);M(o)}),[N,S,j]);var D=Object(o.useRef)();window.tts=D,Object(o.useEffect)((function(){D.current=new Ee({text:t.fileContent}),D.current.goToChunk(j)}),[]),Object(o.useEffect)((function(){D.current.updateSpeed(S)}),[S]);var z=Object(o.useRef)(!1);return x((function(){l(D.current.isPlaying());var n=-1;(n=0!==D.current.currChunkId?D.current.currChunkId:D.current.currChunkId=1,t.startString&&!z.current)&&(n=D.current.extractToChunkPos(t.startString,D.current.chunkedText,D.current.chunkLength),D.current.goToChunk(n),z.current=!0);-1!==n&&y(n),A(D.current.chunkedText.length)}),500),Object(o.useEffect)((function(){var n=D.current.getCurrentChunkText();t.onUpdate({totalChunks:N,currentChunk:j,isPlaying:i,currentText:n})}),[N,j,i]),Object(a.c)(Fe,null,Object(a.c)(rt.a,{title:"".concat(C.a.ttsPopup.title),onClose:function(){D.current.stop(),t.onUpdate({totalChunks:N,currentChunk:j,isPlaying:!1}),t.onClose()}},Object(a.c)(at.a,{value:d,type:"select",list:xe(),label:C.a.ttsPopup.voice,onSelectChange:function(t){!function(t){p(t);var n=xe();n[d]&&D.current.loadVoice(n[d].obj)}(parseInt(t))}}),Object(a.c)("span",null," SPEED : "),Object(a.c)("input",{className:"speed-range",type:"range",value:S,min:"0.5",max:"2",step:"0.1",onChange:function(t){var n=t.target.value;T(n)}})," (",S,")",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:N,onChange:function(t){var n=parseInt(t.target.value);D.current.goToChunk(n),y(n)}})," / ",N,Object(a.c)("br",null),Object(a.c)("input",{type:"range",value:j,className:"range-pos",min:"0",max:N,onChange:function(t){var n=parseInt(t.target.value);D.current.goToChunk(n),y(n)}}),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){D.current.goBack()}},Object(a.c)(_.a,{name:"faFastBackward",color:"black"})),Object(a.c)("button",{onClick:function(t){i||D.current.goToChunk(j),i?D.current.stop():D.current.play()}},Object(a.c)(_.a,{name:i?"faPause":"faPlay",color:"black"})),Object(a.c)("button",{onClick:function(t){D.current.goForward()}},Object(a.c)(_.a,{name:"faFastForward",color:"black"})),"desktop"!==Object(r.a)()&&Object(a.c)("button",{onClick:function(t){v(!0)}},Object(a.c)(_.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)(_.a,{name:"faUnlock",color:"black"}))))},Fe=Object(ve.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;}}"}),Le=function(){var t=Object(o.useState)(!1),n=Object(c.a)(t,2),e=n[0],i=n[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,n){var e=(n=n||{}).id?n.id:null,o=n.startString?n.startString:null,c=t.length<1500?t:t.substring(0,1500)+"..., total size chars = "+t.length;console.log("[TTS API]","open",{id:e,contentSub:c,startString:o}),s(e),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:e,syncTtsStatus:function(t){v.current=t}}},Me=function(){var t=Object(o.useState)(null),n=Object(c.a)(t,2),e=n[0],i=n[1];return{notePreviewPopupApi:{open:function(t,n,e){var o=n[0],c=n[1];Tn+o>window.innerWidth&&(o-=Math.abs(window.innerWidth-Tn-o-10)),In+c>window.innerHeight&&(c-=Math.abs(window.innerHeight-In-c-10)),"50%"===o&&(o="calc(50% - ".concat(Tn/2,"px)")),"50%"===c&&(c="calc(50% - ".concat(Tn/2,"px)")),i({isOpen:!0,filepath:t,position:n=[o,c],opts:e})},close:function(){i(null)}},notePreviewPopup:e,setNotePreviewPopup:i}},De=e(41),ze=e(176),Be=e(173),We=function(t){console.log("createNewNote",t),Object(j.d)((function(n){var e=t.folderPath||n.ui.browser.folders.current.get();n.file.create(e,(function(o){var i=Object(V.c)(o);i&&("floatingWindow"===t.openIn?n.ui.floatingPanel.create({type:"file",file:i,view:"editor"}):i&&n.ui.browser.goTo(e,i.name,{openIn:"activeWindow"}))}))}))};var Ue="[TtsCustomPopup] ",He=function(t){var n=Object(o.useState)(!1),e=Object(c.a)(n,2),i=e[0],l=e[1],s=Object(o.useRef)(!1),u=function(t){l(t),s.current=t},d=Object(h.a)("tts-selected-voice",0),p=Object(c.a)(d,2),f=(p[0],p[1],Object(h.a)("tts-rate",1)),b=Object(c.a)(f,2),g=b[0],m=b[1],v=Object(o.useRef)(g),w=Object(zt.a)("tts-word-stats",0,{debug:!1}),O=Object(c.a)(w,3),y=O[0],k=O[1],E=O[2],S=Object(o.useRef)(0);Object(o.useEffect)((function(){E((function(t){"number"===typeof t&&(S.current=t)}))}),[]);var T=Object(o.useState)(!1),I=Object(c.a)(T,2),P=I[0],N=I[1],A=function(t){!0===t?Ne():Ae(),N(t)},R=Object(h.a)("tts-pos-".concat(t.id),0),F=Object(c.a)(R,2),L=F[0],M=F[1],D=Object(o.useState)(""),z=Object(c.a)(D,2),B=z[0],W=z[1],U=Object(o.useState)(!0),H=Object(c.a)(U,2),q=H[0],V=H[1],J=Object(o.useRef)(""),G=function(t){var n=t.replaceAll("".concat(Ue,":"),"");n=n.replaceAll(Ue,""),J.current=n+"<br>"+J.current;if(J.current.split("<br>").length>50){var e=J.current.split("<br>");J.current=e.slice(0,50).join("<br>"),J.current=J.current+"<br>~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"}W(J.current)},K=Object(o.useState)([]),Y=Object(c.a)(K,2),$=Y[0],Z=Y[1];Object(o.useEffect)((function(){var n=$[L];n&&(n=n.split(/[.?!:]/)[0]),t.onUpdate({totalChunks:$.length,currentChunk:L,isPlaying:i,currentText:n})}),[$,L,i]),Object(o.useEffect)((function(){var n=Oe(t.fileContent),e=Gt.d.curr.tts_sentences_per_part,o=_e(n,e);Z(o),console.log("".concat(Ue,": loading and chunking text in ").concat(o.length," parts"))}),[t.fileContent]);var X=function(){ot(!1),u(!1)},Q=Object(o.useRef)(!1),tt=Object(dt.a)((function t(n){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];X(),bt(n,(function(o){if(o.includes("ERROR")){G("".concat(Ue,": \u274c\u25b6\ufe0f ERROR could not play chunk ").concat(n,", no audio url, retrying in ").concat(4,"s")),setTimeout((function(){t(n,e)}),4e3)}else G("".concat(Ue,": \u25b6\ufe0f playing chunk ").concat(n)),st(o,(function(){ut()}))}));var o=Gt.d.curr.tts_preload_parts;if(e)for(var i=1;i<=o;i++)n+i<=$.length&&bt(n+i,(function(){}))}),500),nt=tt,et=Object(o.useRef)(null),ot=function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];void 0===window.tiro_tts_allAudiosRef&&(window.tiro_tts_allAudiosRef=[]);for(var n=0;n<window.tiro_tts_allAudiosRef.length;n++)window.tiro_tts_allAudiosRef[n].pause(),window.tiro_tts_allAudiosRef[n].currentTime=0;!0===t&&(window.tiro_tts_allAudiosRef=[])},it=Object(o.useRef)(L),ct=function(t){M(t),it.current=t},at=Object(o.useRef)(0);x((function(){var t,n,e,o=null===(t=et.current)||void 0===t?void 0:t.currentTime,i=null===(n=et.current)||void 0===n?void 0:n.duration,c=null===(e=et.current)||void 0===e?void 0:e.paused;G("".concat(Ue,": audio status: ").concat(o,"/").concat(i," ").concat(c?"paused":"playing")),0===o&&isNaN(i)&&(at.current=at.current+1,console.log("".concat(Ue,": audio ERROR detected ").concat(at.current," times")),at.current>=3&&(G("".concat(Ue,": audio ERROR, stopping and restarting")),at.current=0,nt(it.current)))}),5e3);var lt=Object(o.useRef)(null),st=function(t,n){if(X(),!0!==Ot.current){u(!0);var e=null;lt.current?(e=lt.current).src=t:(e=new Audio(t),lt.current=e),function(t){void 0===window.tiro_tts_allAudiosRef&&(window.tiro_tts_allAudiosRef=[]),window.tiro_tts_allAudiosRef.push(t)}(e),et.current=e,e.oncanplaythrough=function(){!0!==Q.current&&(G("".concat(Ue,": audio LOADED, start PLAY, ").concat(Q.current)),e.play(),pt(v.current))},e.onended=function(){G("".concat(Ue,": audio ENDED")),et.current=null,e.remove(),u(!1),n()}}},ut=function(){if(it.current<$.length-1){var t=it.current+1;G("".concat(Ue,": \ufe0f\u23ed next chunk ").concat(t)),nt(t),ct(t)}},pt=function(t){et.current.playbackRate=t},ft=Object(o.useRef)([]),bt=function(t,cb){var n=Gt.d.curr.tts_custom_engine_command,e=$[t];if(!e||0===e.length)return G("".concat(Ue,": \u26a0\ufe0f chunk ").concat(t," is empty, do not download"));var o=(null===e||void 0===e?void 0:e.split(" ").length)||0;"number"===typeof o&&"number"===typeof S.current&&(S.current=S.current+o,k(S.current+o));var i="[".concat(o," words]");n=n.replace("{{input}}",e);var c=!1,a=function(t){c||(cb(t),c=!0)};if(ft.current[t]){a(ft.current[t]);ft.current.filter((function(t){return null!==t}))}else{G("".concat(Ue,": \ud83d\udce5 [...] downloading chunk ").concat(t," ").concat(i,' "').concat(e.substring(0,100),'..."'));var r=Date.now();setTimeout((function(){c||(G("".concat(Ue,": \ud83d\udce5\u274c timeout for chunk ").concat(t," ").concat(i," ")),a("ERROR: timeout"))}),2e4),Object(j.d)((function(e){e.command.exec(n,(function(n){if(!c){var e=n.match(/https?:\/\/[^\s]+\.(mp3|wav)/g);if(e&&e[0]){var o=Date.now()-r,l="[".concat(o,"ms]");G("".concat(Ue,": \ud83d\udce5 [ok] API done for chunk ").concat(t," ").concat(i," ").concat(l)),ft.current[t]=e[0],new Audio(e[0]).preload="auto",a(e[0])}else{var s=n;try{var u=JSON.parse(n);s="".concat(u.stderr," - ").concat(u.shortMessage),G("".concat(Ue,": \ud83d\udce5\u274c [!! error] chunk ").concat(t,": API answer error: ").concat(s," ").concat(i))}catch(d){}a("ERROR: API")}}}))}))}};Object(o.useEffect)((function(){G("=====================================================================")}),[]),Object(o.useEffect)((function(){nt(L)}),[$,L]);var gt=Object(o.useRef)(!1);x((function(){if(t.startString&&!gt.current){var n,e=ke(t.startString,$);n=e,gt.current=!0;var o=t.startString.substring(0,100),i="".concat(Ue,' \ud83d\udd0e found startString "').concat(o,'" at chunk ').concat(e);-1===e&&(i="".concat(Ue,' \ud83d\udd0e NOT FOUND startString "').concat(o,'" at chunk ').concat(e)),G(i),-1!=n&&ct(n)}}),500),x((function(){if(!0===s.current){if(!et.current)return;if(!et.current.src)return;et.current.play()}}),3e3);var ht=Object(o.useState)(""),mt=Object(c.a)(ht,2),vt=mt[0],wt=mt[1];Object(o.useEffect)((function(){var t=function(t){var n=0,e="".concat(Math.ceil(t),"m");if(t>60){n=Math.floor(t/60);Math.ceil(t%60);e="".concat(n,"h")}return e},n=Gt.d.curr.tts_sentences_per_part,e=$.length*n,o=t(6*(e-L)/(60*g)),i=t(6*e/(60*g)),c=" ".concat(o," left of ").concat(i);wt(c)}),[$,g,L]);var Ot=Object(o.useRef)(!1);return Object(a.c)(qe,null,Object(a.c)(rt.a,{title:"".concat(C.a.ttsPopup.title),onClose:function(){console.log("".concat(Ue,": audio DESTROYED")),ot(!0),u(!1),Q.current=!0,ot(!0),Ot.current=!0;var n=$[L];n&&(n=n.split(/[.?!:]/)[0]),t.onUpdate({totalChunks:$.length,currentChunk:L,isPlaying:!1,currentText:n}),t.onClose()}},Object(a.c)("span",null," SPEED : "),Object(a.c)("input",{className:"speed-range",type:"range",value:g,min:"0.5",max:"3",step:"0.1",onChange:function(t){var n,e=t.target.value;m(n=e),v.current=n,pt(v.current)}})," (",g,")",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:L,min:"0",max:$.length,onChange:function(t){var n=parseInt(t.target.value);ct(n),nt(n)}})," / ",$.length,Object(a.c)("br",null),Object(a.c)("input",{type:"range",value:L,className:"range-pos",min:"0",max:$.length,onChange:function(t){var n=parseInt(t.target.value);ct(n),nt(n)}}),Object(a.c)("div",{className:"estimated-time"},Object(a.c)("b",null,"Reading Time")," :",vt),Object(a.c)("div",{className:"buttons"},Object(a.c)("button",{onClick:function(t){!function(){if(0!==it.current){var t=it.current-1;G("".concat(Ue,":\ufe0f\u23ee prev chunk ").concat(t)),nt(t),ct(t)}}()}},Object(a.c)(_.a,{name:"faFastBackward",color:"black"})),Object(a.c)("button",{onClick:function(t){i?(u(!1),et.current.pause(),G("".concat(Ue,": \u23f8\ufe0f paused"))):nt(L)}},Object(a.c)(_.a,{name:i?"faPause":"faPlay",color:"black"})),Object(a.c)("button",{onClick:function(t){ut()}},Object(a.c)(_.a,{name:"faFastForward",color:"black"})),"desktop"!==Object(r.a)()&&Object(a.c)("button",{onClick:function(t){A(!0)}},Object(a.c)(_.a,{name:"faLock",color:"black"}))),Object(a.c)("div",{onClick:function(t){return V(!q)},className:"log-button"}," details "),q&&"number"===typeof y&&Object(a.c)("div",{className:"stats"},"API Words sent: ",y,Object(a.c)("br",null),"Estimated time spoken: ",y/10/60/2<60?"".concat(Math.round(y/10/60/2)," minutes"):"".concat(Math.round(y/10/60/2/60*10)/10," hours (").concat(Math.round(y/10/60/2)," mins)"),Object(a.c)("br",null),"Estimated price : ",Math.round(y*Gt.d.curr.tts_price_per_word*1e5)/1e5,Object(a.c)("br",null),Object(a.c)("button",{onClick:function(){k(0),S.current=0}}," reset stats")),q&&Object(a.c)("div",{className:"log-wrapper"},Object(a.c)("div",{dangerouslySetInnerHTML:{__html:B}}))),P&&Object(a.c)("div",{className:"bg-lock"},Object(a.c)("button",{onContextMenu:function(t){A(!1)}},Object(a.c)(_.a,{name:"faUnlock",color:"black"}))))},qe=Object(ve.a)("div",{target:"e1bujtpy0"})({name:"11wye7o",styles:".stats{font-size:10px;padding:10px;}.log-button{cursor:pointer;color:#0000ff;margin-top:10px;text-align:center;font-size:12px;}.log-wrapper{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;}}"}),Ve=e(134);window.location.pathname.startsWith("/public_site")?Object(Ve.b)(Object(a.c)((function(){Object(o.useEffect)((function(){me(),console.log("========= [APP PUBLIC] MOUNTED on a ".concat(Object(r.a)())),Object(l.d)().then((function(t){Object(j.d)((function(n){n.status.ipsServer.set(t.ipsServer),n.ui.browser.folders.refreshFromBackend()}))}))}),[]);var t=k(),n=t.isConnected,e=(t.connectionStatusComponent,t.toggleSocketConnection,re()),i=(e.forceResponsiveRender,e.responsiveRefreshCounter),c=e.setResponsiveRefresh,s=fe({isConnected:n,refresh:{get:i,set:c}}),u=Object(le.b)(),d=(u.tabs,u.updateTab,u.refreshTabsFromBackend,u.updateActiveTabGrid,u.refreshWindowGrid,u.tabsApi),p=u.windowsApi,f=Object(ue.b)(),b=f.lightboxApi,g=(f.lightboxImages,f.lightboxIndex,mt()),h=(g.PromptPopupComponent,g.popupApi),m=pe(),v=Le(),O=v.ttsApi,x=(v.ttsPos,v.ttsPopup,v.setTtsPopup,v.ttsPopupContent,v.ttsPopupId,v.syncTtsStatus,Me()),y=x.notePreviewPopupApi,_=(x.notePreviewPopup,Object(j.f)({popupApi:h,tabsApi:d,windowsApi:p,statusApi:s,historyApi:m,notePreviewPopupApi:y,lightboxApi:b,ttsApi:O})),C=_,E=C.ui.browser.files,S=C.ui.browser.folders,T=(S.scan,S.clean,S.base,ae(E.active.get)),I=(T.filesHistory,T.filesHistoryRef,T.cleanLastFilesHistory,T.refreshFilesHistoryFromBackend,T.lastFilesHistoryApi);C.lastNotesApi=I;var P=ee((function(){E.active.set(-1)}),(function(){_.ui.browser.files.set([])})),N=(P.askForMoveFile,P.promptAndMoveFolder,P.promptAndBatchMoveFiles,w());return N.mobileView,N.setMobileView,N.MobileToolbarComponent,window.api=C,Object(a.c)("div",null,"hello world public app",window.location.pathname)}),null),document.getElementById("root")):Object(Ve.b)(Object(a.c)((function(){Object(o.useEffect)((function(){return setTimeout((function(){console.log(Ht,"starting frontendBackgroundPlugins Cron"),setInterval((function(){Jt()}),6e4)}),Object(g.a)(1e3,1e4)),me(),console.log("========= [APP] MOUNTED on a ".concat(Object(r.a)())),Object(l.d)().then((function(t){Y(!0),Ft&&Ft.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 n=H(t);Object(B.a)(W[n])||(W[n]=!0);var e="".concat(n,"-down");q[e]&&q[e]()},window.onkeyup=function(t){var n=H(t);Object(B.a)(W[n])||(W[n]=!1);var e="".concat(n,"-up");q[e]&&q[e]()},Object(Ut.a)("init","init",(function(){})),function(){console.log("app will unmount")}}),[]);var t=function(){setTimeout((function(){Object(G.e)(en)}),300)},n=function(){Lt.active.set(-1)},e=function(){Rt.ui.browser.files.set([])},u=function(t){var n=Object(o.useState)(!1),e=Object(c.a)(n,2),r=e[0],s=e[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],y=Object(o.useState)(),k=Object(c.a)(y,2),_=k[0],E=k[1],S="[SETUP CONFIG]",T=O.a.client.log.verbose,I=Object(o.useRef)(0);return Object(o.useEffect)((function(){return T&&console.log(S," init socket listener"),I.current=l.b.on("getSetupInfos",(function(n){"SUCCESS_CONFIG_CREATION"===n.code?(E(["success","".concat(C.a.setupForm.successReload)]),setTimeout((function(){window.location.reload()}),3e3)):"ASK_SETUP"===n.code?(t.cleanAllApp(),s(!0),n.defaultFolder&&x(n.defaultFolder)):E(["error","".concat(n.code,": ").concat(n.message)])})),function(){T&&console.log(S," clean socket listener"),l.b.off(I.current)}}),[]),{displayWelcomePopup:r,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){E(void 0),l.b.emit("sendSetupInfos",{form:{user:p,password:h,dataFolder:j},token:Object(z.b)()})}}),_&&Object(a.c)("div",{className:_[0]},_[1])))))}}}({cleanAllApp:function(){console.log("[cleanAllApp]"),Kt(),Bt(),n(),e()}}).SetupPopupComponent,p=Object(z.d)({onLoginAsked:function(){n(),e()},onLoginSuccess:function(){v(),En(),Yt(),Object(j.d)((function(t){t.userSettings.refreshUserSettingsFromBackend(),t.ui.floatingPanel.refreshFromBackend()})),Object(j.d)((function(t){t.ui.browser.folders.refreshFromBackend()})),Dt(["/"]),t()}}).LoginPopupComponent,f=Object(le.b)(),h=f.tabs,m=f.updateTab,v=f.refreshTabsFromBackend,x=f.updateActiveTabGrid,y=f.refreshWindowGrid,E=f.tabsApi,T=f.windowsApi,I=Object(o.useState)(0),P=Object(c.a)(I,2),N=P[0],A=P[1],F=E.active.get(),L=mt(),M=L.PromptPopupComponent,D=L.popupApi,U=k(),V=U.isConnected,K=U.connectionStatusComponent,Y=U.toggleSocketConnection,$=re(),Z=$.forceResponsiveRender,X=$.responsiveRefreshCounter,Q=$.setResponsiveRefresh,tt=Object(o.useRef)([]),nt=Object(o.useState)(null),ot=Object(c.a)(nt,2),it=ot[0],st=ot[1];Object(o.useEffect)((function(){setTimeout((function(){}),2e3)}),[]);var ut=Object(ue.b)(),dt=ut.lightboxApi,ht=ut.lightboxImages,vt=ut.lightboxIndex,wt=Le(),jt=wt.ttsApi,xt=wt.ttsPos,yt=wt.ttsPopup,kt=wt.setTtsPopup,_t=wt.ttsPopupContent,Ct=wt.ttsPopupId,St=wt.syncTtsStatus,Tt=fe({isConnected:V,refresh:{get:X,set:Q}}),It=pe(),Pt=Me(),Nt=Pt.notePreviewPopupApi,At=Pt.notePreviewPopup,Rt=Object(j.f)({popupApi:D,tabsApi:E,windowsApi:T,statusApi:Tt,historyApi:It,notePreviewPopupApi:Nt,lightboxApi:dt,ttsApi:jt}),Ft=Rt,Lt=Ft.ui.browser.files,Mt=Ft.ui.browser.folders,Dt=Mt.scan,Bt=Mt.clean,Wt=Mt.base,qt=ae(Lt.active.get),Vt=qt.filesHistory,Kt=(qt.filesHistoryRef,qt.cleanLastFilesHistory),Yt=qt.refreshFilesHistoryFromBackend,$t=qt.lastFilesHistoryApi;Ft.lastNotesApi=$t;var Zt=ee(n,e),Xt=(Zt.askForMoveFile,Zt.promptAndMoveFolder),Qt=Zt.promptAndBatchMoveFiles,tn=w(),nn=tn.mobileView,en=tn.setMobileView,on=tn.MobileToolbarComponent;window.api=Ft;var cn=Object(o.useState)(!1),rn=Object(c.a)(cn,2),ln=rn[0],sn=rn[1],un=Object(o.useState)(!1),dn=Object(c.a)(un,2),pn=dn[0],fn=dn[1];Object(o.useEffect)((function(){var t=function(){sn(!0),fn(!0)};return Object(pt.a)("alt + spacebar",t),Object(pt.a)("alt + p",t),Object(pt.a)("alt + ,",(function(){st("settings")})),Object(pt.a)("alt + e",(function(){Ft.note.ui.editorAction.dispatch({type:"toggleEncryption",noteParentType:"grid"})})),Object(pt.a)("alt + shift + e",(function(){Ft.note.ui.editorAction.dispatch({type:"toggleEncryption",noteParentType:"floating"})})),Object(pt.a)("alt + shift + u",(function(){Ft.note.ui.editorAction.dispatch({type:"triggerUpload",noteParentType:"floating"})})),Object(pt.a)("alt + e",(function(){Ft.note.ui.editorAction.dispatch({type:"toggleEncryption",noteParentType:"grid"})})),Object(pt.a)("alt + u",(function(){Ft.note.ui.editorAction.dispatch({type:"triggerUpload",noteParentType:"grid"})})),Object(pt.a)("alt + s",(function(){Ft.ai.setStatus("stop")})),Object(pt.a)("esc",(function(){sn(!1),st(null)})),function(){Object(pt.d)()}}),[Vt]);var bn=function(){We({openIn:"activeWindow"})},gn=function(){Object(j.d)((function(t){t.ui.windows.active.toggleView()}))},hn=function(){Object(j.d)((function(t){var n=t.ui.browser.files.active.get;n&&t.ui.floatingPanel.create({type:"file",file:n})}))};Object(o.useEffect)((function(){return Object(pt.a)("alt > n",bn),Object(pt.a)("alt > v",gn),Object(pt.a)("alt > d",hn),function(){Object(pt.c)("alt > n",bn),Object(pt.c)("alt > v",gn),Object(pt.c)("alt > d",hn)}})),Object(o.useEffect)((function(){if("mobile"!==Object(r.a)())return Object(Be.a)("/favicon.png");Object(G.f)(h,nn)}),[h,nn]);var vn=Z?0:1,On=Ft.userSettings.refresh.css.get+vn,jn=Ft.userSettings,xn=function(){var t=Object(zt.a)("interface-pin-element-status",{topTab:!0,bottomBar:!0}),n=Object(c.a)(t,3),e=n[0],i=n[1],a=n[2];return Object(o.useEffect)((function(){a()}),[]),{pinStatus:Object(ze.a)(e.topTab)||Object(ze.a)(e.bottomBar)?Object(R.a)(e):{topTab:!0,bottomBar:!0},updatePinStatus:function(t){return function(n){i(Object(s.a)(Object(s.a)({},e),{},Object(De.a)({},t,n)))}},togglePinStatus:function(t){return function(){i(Object(s.a)(Object(s.a)({},e),{},Object(De.a)({},t,!e[t])))}},refreshPinStatus:a}}(),yn=xn.pinStatus,kn=xn.updatePinStatus,Cn=xn.togglePinStatus,En=xn.refreshPinStatus,Tn=Object(o.useState)(void 0),In=Object(c.a)(Tn,2),Pn=In[0],Nn=In[1],An=Gt.d.curr.ui_layout_background_video_width,Rn=Gt.d.curr.ui_layout_background_video_height;return Object(o.useEffect)((function(){var t=Gt.d.curr.ui_layout_background_video_enable,n=Gt.d.curr.ui_layout_background_image;t&&n&&Nn(n)}),[On,jn]),Object(o.useEffect)((function(){var t=Gt.d.curr.keyboard_shortcuts_textarea;if(t){var n=Object(pt.b)(t);return Object(bt.a)(n,(function(t){Object(pt.a)(t.shortcut,t.func)})),function(){Object(bt.a)(n,(function(t){Object(pt.c)(t.shortcut,t.func)}))}}}),[On,jn]),Object(a.c)("div",{className:$n(jn)},Object(a.c)("div",{className:Yn(nn,On,jn,yn)},Pn&&Object(a.c)(Un,{url:Pn,width:An,height:Rn}),Object(a.c)("div",{className:" ".concat("mobile"===Object(r.a)()?"mobile-view-container mobile-view-".concat(nn):"")},Object(a.c)(j.a.Provider,{value:Rt},Object(a.c)("div",{className:"config-buttons-bar"},Object(a.c)("div",{className:"config-button infos-button",onClick:function(){!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 </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>Alt + e : Toggle Encryption</li>\n <li>Alt + 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 + c : Close active floating window</li>\n <li>Alt + Shift + e : Toggle encryption</li>\n <li>Alt + Shift + 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>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>\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>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{{_datetime}} and {{_date}} will automatically insert the date <br>\nthe line_format is used to format the line in the note<br>\nyou can insert tags in it like: {{NAME_FIELD|TYPE_FIELD (text, number, select, date) | COMMENT FIELD comment field. optional}}<br>\nIn the comment field, adding "optional" will make the field optional<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</p>\n<code>\n\t<pre>\n form | name=simple insert form, path=/noteToInsert.md, line_format= {{_datetime}} | name: {{name}} | age: {{age|number|comment field. optional}}, 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\n</p>\n');Object(j.d)((function(n){n.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"})}))}()}},Object(a.c)(_.b,{name:"question"})),Ft.userSettings.get("beta_plugins_marketplace")&&Object(a.c)("div",{className:"config-button plugins-marketplace-button",onClick:function(){st("plugins-marketplace")}},Object(a.c)(_.b,{name:"puzzle-piece"})),"mobile"!==Object(r.a)()&&Object(a.c)("div",{className:"config-button search-button",onClick:function(){fn(!0),sn(!0)}},Object(a.c)(_.b,{name:"search"})),Object(a.c)("div",{className:"config-button settings-button",onClick:function(){st("settings")}},Object(a.c)(_.b,{name:"cog"}))),(null===At||void 0===At?void 0:At.isOpen)&&Object(a.c)(Sn,{notePreview:At}),ln&&Object(a.c)(mn,{show:pn,lastNotes:Vt,onClose:function(t){sn(!1)},onHide:function(t){fn(!1)},onNoteCreate:function(t){We({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(J.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(Ft.userSettings.get("ui_sidebar")?"with-sidebar":"without-sidebar"," device-view-").concat(Object(r.a)())},M(),p({}),u({}),K(),on({forceRerender:Z,onButtons:[function(){fn(!0),sn(!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)(S,{onNewFile:function(){We({openIn:"activeWindow"})}}),Ft.userSettings.get("ui_layout_shortcuts_panel")&&Object(a.c)(wn,{filePath:".tiro/shortcuts.md",onClick:function(){}}),Object(a.c)(ct,{files:Vt,onClick:function(t){Rt.ui.browser.goTo(t.folder,t.name,{openIn:"active"})}}),Object(a.c)(et,{openFolders:Mt.open.get(),folder:Mt.get(),current:Mt.current.get(),onFolderClicked:function(t){Rt.ui.browser.goTo(t,null)},onFolderMenuAction:function(t,n,e){"rename"===t&&e?Xt({folder:n,folderToDropInto:n,folderBasePath:Wt,newTitle:e,renameOnly:!0,disablePrompt:!0,onMoveFn:function(){Dt([te(n.path)],{cache:!1,cb:function(){}})}}):"create"===t&&e?Object(j.d)((function(t){t.folders.create("".concat(n.path,"/").concat(e),(function(t){Dt([n.path],{cache:!1})}))})):"moveToTrash"===t?Xt({folder:n,folderToDropInto:be.b,folderBasePath:Wt,newTitle:"".concat(n.title,"_").concat(Object(gt.a)().full_file),onMoveFn:function(){Dt([te(n.path),n.path],{cache:!1,cb:function(){Mt.open.add(n.path)}})}}):"delete"===t&&(Object(be.a)("trash"),setTimeout((function(){Dt([n.path],{cache:!1})})))},onFolderOpen:function(t){Dt([t],{cache:!1})},onFolderClose:function(t){},onFolderDragStart:function(t){console.log("[DRAG MOVE] onFolderDragStart",t),tt.current=[{type:"folder",folder:t}]},onFolderDragEnd:function(){console.log("[DRAG MOVE] onFolderDragEnd"),tt.current=[]},onFolderDrop:function(t){!function(t){console.log("[DRAG MOVE] processDragDropAction ->",tt.current,t);var n=tt.current[0];"file"===n.type&&n.files?Qt({files:n.files,folderToDropInto:t}):"folder"===n.type&&n.folder&&Xt({folder:n.folder,folderToDropInto:t,folderBasePath:Wt,disablePrompt:!0,onMoveFn:function(){if(n.folder){var e=n.folder.path,o=t.path;Dt([te(e),te(o),o,e],{cache:!1,cb:function(){Mt.open.add(e),Mt.open.add(o),Mt.open.add(te(e)),Mt.open.add(te(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"},Ft&&Ft.ui.browser.folders.current.get(),!Ft.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"))})),y()},active:!0===Rt.userSettings.get("ui_sidebar")}],size:.8}))),Object(a.c)(lt,{term:Rt.ui.search.term.get})),Object(a.c)("div",{className:"files-list-wrapper"},Object(a.c)(de,{files:Lt.get,activeFileIndex:Lt.active.getIndex,onSortFiles:function(t){Rt.ui.browser.files.set(t)},onFileClicked:function(t){Lt.active.set(t);var n=Lt.get[t];Ft.tabs.active.get()?T.active.setContent(n):Ft.tabs.openInNewTab(n)},onFileDragStart:function(t){console.log("[DRAG MOVE] onFileDragStart",t),tt.current=[{type:"file",files:t}]},onFileDragEnd:function(){console.log("[DRAG MOVE] onFileDragEnd"),tt.current=[]}}))))),Object(a.c)("div",{className:"right-wrapper draggable-grid-editors-view"},"mobile"!==Object(r.a)()&&Object(a.c)(Ot,{tabs:h,onUpdate:m,onPinToggle:Cn("topTab"),pinStatus:yn.topTab}),F&&Object(a.c)(se.b,{tab:F,forceRefresh:N,onGridUpdate:function(t){x(t),A(N+1)},mobileView:nn,pinStatus:yn})),Object(a.c)(an,{panels:Ft.ui.floatingPanel.panels,pinStatus:yn.bottomBar,onPinChange:kn("bottomBar")}),"plugins-marketplace"===it&&Object(a.c)(Fn,{onClose:function(){st(null)}}),"settings"===it&&Object(a.c)(Et.a,{onClose:function(){st(null)}})))),Object(a.c)(_n,null),ht.length>0&&Object(a.c)(ft,{images:ht,startingIndex:vt,onClose:Rt.ui.lightbox.close}),yt&&!Gt.d.curr.tts_custom_engine_enabled&&Object(a.c)(Re,{id:Ct,fileContent:_t,startString:xt,onUpdate:function(t){St(t)},onClose:function(){kt(!1)}}),yt&&Gt.d.curr.tts_custom_engine_enabled&&Object(a.c)(He,{id:Ct,fileContent:_t,startString:xt,onUpdate:function(t){St(t)},onClose:function(){kt(!1)}})))}),null),document.getElementById("root"))},57:function(t,n,e){"use strict";e.d(n,"a",(function(){return O}));var o=e(15),i=e(13),c=e(2),a=e(17),r=e(215),l=e(26),s=e(8),u=e(126),d=e(82),p=e(29),f="[Code Mirror]",b=a.a.client.log.verbose,g=function(t,n){var e=arguments.length>2&&void 0!==arguments[2]&&arguments[2];b&&console.log(f," update cursor",n,t);try{e&&t.view.dispatch({selection:{anchor:n,head:n},scrollIntoView:!0})}catch(o){console.warn(f,"update Cursor error",o)}},h=function(t){if(!(t&&t.view&&t.view.state))return null;var n=t.view.state.doc.lineAt(t.view.state.selection.main.head).number-1,e=function(t){return t.view.state.selection.ranges[0].from}(t),o=t.view.state.doc.toString().split("\n");return{lines:o,currentPosition:e,activeLine:o[n]||"",lineIndex:n,activeLinePos:-1}},m=function(t){if(!t.view)return-1;for(var n=t.view.state.doc.toString(),e=t.view.lineBlockAtHeight(t.view.scrollDOM.scrollTop),o=(t.view.lineBlockAtHeight(t.view.scrollDOM.scrollTop),e.from),i=n.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 n=null===t||void 0===t?void 0:t.view;if(!n)return[];for(var e=n.state.doc.toString().split("\n"),i=[],c=0,a=0;a<e.length;a++){var r=e[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 n=t,e=Math.round(n.viewState.pixelViewport.top),o=n.contentHeight,i=function(){return n.viewState.editorHeight},c=function(){return(o-i())/100};return{viewportHeight:i,contentHeight:o,visibleFirstLine:function(){var t=n.lineBlockAtHeight(e);return n.state.doc.lineAt(t.from).number},percentPx:c,currentPercentScrolled:function(){return n.viewState.pixelViewport.top/c()}}},getCurrentLineInfos:h,getScrolledLine:function(t){var n=m(t),e=t.view.state.doc.toString().split("\n"),o=e[n];return{totLine:e.length,lineNb:n,lineText:o,lines:e}},updateCursor:g,updateText:function(t,n,e){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:n}})),g(t,i,!0)},scrollTo:function(t,n){if(!t.view)return-1;g(t,n,!0)},scrollToLine:function(t,n){var e=t.view.state.doc.line(n);g(t,e.from,!0)},getCustomTheme:r.a,getMarkdownStructure:v,foldAllChildren:function(t){var n=v(t),e=h(t);Object(l.a)(n,(function(o,i){if(null!==t&&void 0!==t&&t.view){var c=n[i+1]?n[i+1].from-1:t.view.state.doc.length,a=o.to-1;e&&e.currentPosition>a&&e.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,n){var e=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.d)(c);var a={search:n};e&&Object.assign(a,{replace:e}),w.current=n;setTimeout((function(){n==w.current&&(console.log("Enabling search box with config:",a),c.dispatch({effects:u.f.of(new u.a(a))}))}),2e3),setTimeout((function(){!function(){if(console.log(o,"centerToNext"),o){Object(u.b)(c);var t=c.state.selection.main,n=t.from;t.to,c.dispatch({effects:i.c.scrollIntoView(n,{y:"center"})})}}()}),4e3)}catch(r){console.log("[CM utils > search word] error:",r)}},setSelection:function(t,n){if(null!==t&&void 0!==t&&t.view)try{var e=t.view,o=[0,0];n.range&&(o=n.range),e.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}},59:function(t,n,e){"use strict";e.d(n,"a",(function(){return s}));var o=e(4),i=e(0),c=e(17),a=e(9),r=e(38),l=e(34);function s(t,n,e){var s=Object(i.useRef)(!1),u=Object(i.useState)(n),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)((function(){var cb=null!==e&&void 0!==e&&e.onInitialRefresh?e.onInitialRefresh:void 0;h(cb)}),[]);var g=Object(l.a)((function(t){Object(a.d)((function(n){n.history.save(b,t,"int")}))}),6e4),h=function(cb){Object(a.d)((function(n){n.file.getContent(b,(function(n){var o=void 0;if("NO_FILE"===n)o={};else try{o=JSON.parse(n)}catch(i){console.error("[BACKEND STATE] Error parsing JSON for ".concat(t),i)}void 0!==o&&(!0===(null===e||void 0===e?void 0:e.debug)&&console.log("[BACKEND STATE] refreshValFromBackend: ".concat(t," => "),o),f(o),s.current=!0,cb&&cb(o))}))}))};return[p,function(n){if(!s.current&&!0!==(null===e||void 0===e?void 0:e.editIfNotLoaded))return console.error("BACKEND VAR: var ".concat(t," not loaded yet"));var o=Object(r.a)(n);f(Object(r.a)(o)),!0===(null===e||void 0===e?void 0:e.debug)&&console.log("[BACKEND STATE] setValue: ".concat(t," => "),o);var i=JSON.stringify(o),c=!(null===e||void 0===e||!e.debouncedSave)&&(null===e||void 0===e?void 0:e.debouncedSave),l=!0===(null===e||void 0===e?void 0:e.debouncedSaveWithThrottle);Object(a.d)((function(t){t.file.saveContent(b,i,{debounced:c,withThrottle:l})})),!0===(null===e||void 0===e?void 0:e.history)&&g(i)},h]}},61:function(t,n,e){"use strict";e.d(n,"a",(function(){return c}));var o=e(4),i=e(0);function c(t,n){var e=Object(i.useState)((function(){try{var e=window.localStorage.getItem(t);return e?JSON.parse(e):n}catch(o){return console.log(o),n}})),c=Object(o.a)(e,2),a=c[0],r=c[1];return[a,function(n){try{var e=n instanceof Function?n(a):n;r(e),window.localStorage.setItem(t,JSON.stringify(e))}catch(o){console.log(o)}}]}},62:function(t,n,e){"use strict";e.d(n,"c",(function(){return p})),e.d(n,"d",(function(){return f})),e.d(n,"h",(function(){return g})),e.d(n,"g",(function(){return h})),e.d(n,"i",(function(){return m})),e.d(n,"e",(function(){return v})),e.d(n,"a",(function(){return w})),e.d(n,"f",(function(){return O})),e.d(n,"b",(function(){return j}));var o=e(11),i=e(15),c=e(128),a=e(286),r=e(26),l=e(176),s=e(383),u=e(9),d=e(30),p=function(t){var n=t.value,e=t.selectionStart;return f(n,e)},f=function(t,n){for(var e=t.split("\n"),o=0,i=0;o<n+1;){o+=e[i].length+1,i++}var c=n-o+e[--i].length-1;return{currentPosition:n,lines:e,activeLine:e[i],activeLinePos:c,lineIndex:i}},b=function(t){for(var n=!0,e=0;e<t.length;e++)32!==t[e].charCodeAt(0)&&45!==t[e].charCodeAt(0)&&91!==t[e].charCodeAt(0)&&93!==t[e].charCodeAt(0)&&(n=!1);return n},g=function(t,n,cb){if(10===n){console.log("updateTextFromLetterInput => ENTER PRESSED");var e=t.lines[t.lineIndex-1],o=e.indexOf("- ["),i=e.indexOf("-"),c="";-1!==o&&"- [ ] "!==e?(c=e.substr(0,o+3)+" ] ",b(c)&&(t.lines[t.lineIndex]=c+t.activeLine,cb(c.length))):-1!==i&&"- "!==e&&"- [ ] "!==e&&(c=e.substr(0,i+1)+" ",b(c)&&(t.lines[t.lineIndex]=c+t.activeLine,cb(c.length)))}return t.lines.join("\n")},h=function(t,n,cb,e){var o=n.lines;if("^"===t){var r=o[n.lineIndex-1],l=o[n.lineIndex];o[n.lineIndex]=r,o[n.lineIndex-1]=l,cb(-r.length-1)}if("v"===t){var s=o[n.lineIndex+1],u=o[n.lineIndex];o[n.lineIndex]=s,o[n.lineIndex+1]=u,cb(+s.length+1)}if("X"===t){o[n.lineIndex].length;var d=Object(i.a)(o).splice(0,n.lineIndex).join("\n").length+1-n.currentPosition;o[n.lineIndex]="",cb(d)}if("C"===t){var p=o[n.lineIndex].length,f=o[n.lineIndex];o.splice(n.lineIndex,0,f),cb(p+1)}"->"===t&&(o[n.lineIndex]=" "+o[n.lineIndex],cb(2)),"<-"===t&&(n.activeLine.startsWith(" ")?(o[n.lineIndex]=o[n.lineIndex].substr(2,o[n.lineIndex].length),cb(-2)):cb(0));var b=n.activeLine.trim();if("[x]"===t&&(b.startsWith("- [ ]")||b.startsWith("- [x]")?b.startsWith("- [ ]")?(o[n.lineIndex]=o[n.lineIndex].replace("[ ]","[x]"),cb(0)):b.startsWith("- [x]")?(o[n.lineIndex]=o[n.lineIndex].replace("[x]","[ ]"),cb(0)):cb(0):(o[n.lineIndex]=o[n.lineIndex].replace(b,"- [ ] "+b.replace("-","")),cb(6))),"insertAt"===t&&e&&e.textToInsert&&(Object(c.a)(e.insertPosition)||Object(a.a)(e.insertPosition))){var g=0;Object(c.a)(e.insertPosition)&&(g=e.insertPosition),"currentPos"===e.insertPosition&&(g=n.currentPosition+1),"currentLineStart"===e.insertPosition&&(g=Object(i.a)(o).splice(0,n.lineIndex).join("\n").length);var h=o.join("\n"),m=e.textToInsert.length;o=[h.slice(0,g),e.textToInsert,e.replaceText?h.slice(g+m,h.length):h.slice(g,h.length)].join("").split("\n")}return o.join("\n")},m=function(t){var n=t.split("\n"),e=0;return Array.isArray(n)?(Object(r.a)(n,(function(t){var n=t.split(" ").filter((function(t){return""!==t}));e+=n.length})),e):e},v=function(t){var n=!1;return(t="".concat(t)).toLowerCase().startsWith("math.")&&(n=!0),t.startsWith("(")&&(n=!0),isNaN(parseInt(t))||(n=!0),t.includes("\n")&&(n=!1),t.length>400&&(n=!1),n},w=function(t){var n=null;if(!v(t))return n;try{n=new Function("return ".concat(t))()}catch(e){}return n},O=function(t){var n=t.windowId,e=t.file,i=t.fileContent,c=t.selectionTxt,a=t.insertPos;try{var r=new Function("return ".concat(c))(),l=Object(o.a)(Object(o.a)({},{wrapSyntax:!1,title:"",currentContent:i,insertPos:a,windowId:n,selection:c,file:e,linejump:!1,isLast:!1}),{},{textUpdate:" = ".concat(r),isLast:!0});j(l)}catch(s){Object(d.d)('[CALC] Error <br/> "'.concat(s,'"'))}},j=function(t){t.question||(t.question=""),t.title||(t.title=""),Object(l.a)(t.linejump)||(t.linejump=!0),Object(l.a)(t.viewFollow)||(t.viewFollow=!0),Object(l.a)(t.wrapSyntax)||(t.wrapSyntax=!0);var n=t.linejump?"\n\n":" ",e="###",o="---",i="".concat(n," ").concat(e," [").concat(t.title,"] (generating ...) ").concat(n),c="".concat(n," ").concat(o," [").concat(t.title,"] (done) ").concat(n),a="".concat(n).concat(t.textUpdate);t.wrapSyntax||(i=c=o=e=""),a="".concat(i).concat(t.textUpdate).concat(n).concat(e," \n"),t.isLast&&(a="".concat(c).concat(t.textUpdate).concat(n).concat(o," \n"));var r=t.currentContent.substring(0,t.insertPos),s=t.currentContent.substring(t.insertPos),d=r+a+s;Object(u.d)((function(n){if(n.file.saveContent(t.file.path,d),t.viewFollow){var e=("".concat(r).concat(a).split("\n").length||0)-2;e<0&&(e=0),x(t.windowId,e)}}))},x=Object(s.a)((function(t,n){Object(u.d)((function(e){e.ui.note.editorAction.dispatch({windowId:t,type:"lineJump",lineJumpNb:n})}))}),1e3)},64:function(t,n,e){"use strict";e.d(n,"a",(function(){return a}));var o=e(11),i=e(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),{},{global:{protocol:"".concat(window.location.protocol,"//"),url:"".concat(window.location.hostname),port:c}})},67:function(t,n,e){"use strict";e.d(n,"a",(function(){return l})),e.d(n,"b",(function(){return s}));var o=e(105),i=e(176),c=e(0),a=e(25),r=e(1),l=function(t){var n,e=Object(c.useRef)(),a=function(){t.shouldFocus&&e.current.focus()};Object(c.useEffect)((function(){a()}),[t.shouldFocus]),Object(c.useEffect)((function(){a()}),[]);var l="checkbox"===t.type&&(!0===t.value||"true"===t.value),s=t.value;Object(i.a)(s)&&(s="");var u=s;"date"!==t.type||s||(u=(new Date).toISOString().split("T")[0]);var d=t.type;"datetime"===t.type&&(d="datetime-local",u=(u=(new Date).toISOString().substring(0,16)).substring(0,u.length-5)+"12:00"),Object(c.useEffect)((function(){t.onLoad&&t.onLoad(u)}),[]);return Object(r.c)("div",{className:"input-component-wrapper ".concat(t.style?Object(o.a)(t.style,";",""):"")},Object(r.c)("div",{className:"input-component ".concat(t.id?t.id:""," ").concat(t.type)},t.label&&Object(r.c)("span",{onClick:function(n){"checkbox"===t.type&&(e.current.checked=!e.current.checked,t.onChange&&t.onChange(e.current.checked))}},t.label," "),Object(r.c)("div",{className:"input-wrapper"},"select"!==t.type&&"textarea"!==t.type&&Object(r.c)("input",{ref:e,type:d||"text",defaultValue:u,value:s,checked:l,readOnly:t.readonly,max:t.max,min:t.min,step:t.step,onFocus:function(){t.onFocus&&t.onFocus()},onClick:function(){!t.shouldNotSelectOnClick&&e.current.select()},onKeyPress:function(n){"Enter"==(n.code||n.key)&&t.onEnterPressed&&t.onEnterPressed()},onChange:function(n){t.onCheckedChange&&t.onCheckedChange(n.target.checked),function(n){var e=n;"number"===t.type&&(t.max&&e>t.max&&(e=t.max),t.min&&e<t.min&&(e=t.min),e=e.toString()),t.onChange&&t.onChange(e)}(n.target.value)}}),"select"===t.type&&Object(r.c)("select",{value:s,multiple:!0,onChange:function(n){var e=Array.from(n.target.selectedOptions,(function(t){return t.label})).join(",");t.onSelectChange&&t.onSelectChange(e)}},null===(n=t.list)||void 0===n?void 0:n.map((function(t,n){return Object(r.c)("option",{value:t.key},t.label," ")}))),"textarea"===t.type&&Object(r.c)("textarea",{defaultValue:s,onChange:function(n){t.onChange&&t.onChange(n.target.value)}}),t.explanation&&Object(r.c)("div",{className:"explanation"}," ",t.explanation," "))))},s=function(){return"\n .input-component {\n display: flex;\n align-items: center;\n\t\tjustify-content: space-between;\n padding-bottom: 7px;\n input, select {\n max-width: 100%;\n }\n &.select {\n span {\n width: 20%;\n }\n }\n span {\n // width: 30%;\n font-weight: 700;\n\t\t\tmargin-right: 10px;\n text-transform: uppercase;\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(a.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(a.a)(1),"px;\n background: #ececec;\n border-radius: 5px;\n }\n\t\t\ttextarea {\n\t\t\t\theight: 120px;\n\t\t\t\tfont-size: ").concat(Object(a.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(a.a)(1),"px;\n color: grey;\n }\n }\n }\n")}},68:function(t,n,e){"use strict";e.d(n,"a",(function(){return g}));var o=e(17),i=e(77),c=e(30),a={};window.dbscroll=a,Object(c.a)("syncscroll","get_db",(function(){return a}));o.a.client.log.verbose;var r=function(t){var n=document.querySelector(".window-id-".concat(t," .preview-area")),e=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:n,editor:e,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=n,a[t].els.editor=e,a[t].els.scroller=o,a[t]},l=function(t){var n,e,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===(n=o.els.scroller)||void 0===n?void 0:n.clientHeight)||0,s=a*l,u={viewport:s=s>l?l:s,full:l};o.dims.scroller=u;var d=null===(e=o.els.scroller)||void 0===e?void 0:e.dataset;d&&(d.scrollRefresh||(d.scrollRefresh=1),d.scrollRefresh=parseInt(d.scrollRefresh)+1)},s=function(t,n){var e;i.c[t]=!1;var o=r(t);o.posPercent=n||0;var c=null===(e=o.els.scroller)||void 0===e?void 0:e.dataset;c||(c={scrollRefresh:1}),c.scrollRefresh||(c.scrollRefresh=1),c.scrollRefresh=parseInt(c.scrollRefresh)+1},u=function(t,n){i.c[t]=!1;var e=r(t);if(e.els.editor){e.dims.editor;e.els.editor.scrollTop+=n}},d=function(t,n){i.c[t]=!1;var e=r(t);if(e.els.preview){e.dims.preview;e.els.preview.scrollTop+=n}},p=function(t,n){i.c[t]=!1;var e=r(t);if(e.els.editor){var o=e.dims.editor;n||(n=e.posPercent);var c=o.full/100;e.els.editor.scrollTop=c*n}},f=function(t,n){i.c[t]=!1;var e=r(t);if(e.els.preview){var o=e.dims.preview;n||(n=e.posPercent);var c=o.full/100,a=Math.round(c*n);e.els.preview.scrollTop=a+e.previewOffsetY}},b=function(t,n){var e=r(t),o=e.dims.preview.full/100,i=n-Math.round(o*e.posPercent);e.previewOffsetY=i},g={getScrollObj:r,updateEditorDims:function(t,n){var e=r(t);e.els.editor&&(e.dims.editor=n)},updatePreviewDims:function(t){var n=r(t);if(n.els.preview){var e=n.els.preview.querySelector(".preview-area-full-height-content"),o=e.clientHeight-e.parentNode.clientHeight,i=n.els.preview.clientHeight;n.dims.preview={viewport:i,full:o},n.dims.preview={viewport:i,full:o}}},updateScrollerDims:l,updatePreviewOffset:b,onEditorScroll:function(t,n){var e=r(t);e.els.editor&&(e.posPercent=n,s(t,n),f(t,n))},onScrollerScroll:function(t,n){r(t).posPercent=n,p(t,n),f(t,n)},onPreviewScroll:function(t){var n=r(t),e=n.els.preview.scrollTop;b(t,e),n.posPercent=e/n.dims.preview.full*100,p(t,n.posPercent),s(t,n.posPercent)},onWindowLoad:function(t){if(a[t]){var n=r(t).posPercent;l(t),s(t,n),p(t,n),f(t,n)}},scrollEditor:p,scrollPreview:f,scrollScroller:s,scrollAllPx:function(t,n){u(t,n),d(t,n)},scrollEditorPx:u,scrollPreviewPx:d}},71:function(t,n,e){"use strict";e.d(n,"a",(function(){return i})),e.d(n,"c",(function(){return c})),e.d(n,"b",(function(){return a}));var o=e(20),i=function(t){var n=((new Date).getTime()-t.getTime())/1e3,e=604800,i="";if(n<=3600)i="".concat(Math.ceil(n/60)," ").concat(o.a.minsAgo);else if(n>3600&&n<=86400)i="".concat(Math.ceil(n/3600)," ").concat(o.a.hoursAgo);else if(n>86400&&n<=e)i="".concat(Math.ceil(n/86400)," ").concat(o.a.daysAgo);else if(n>e){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 n=new Date(t);return[n.getFullYear(),n.getMonth()+1,n.getDate()]},a=function(t){var n=(new Date).getTime();return"lastMonth"===t&&(n=n-432e5),n}},72:function(t,n,e){"use strict";e.d(n,"c",(function(){return r})),e.d(n,"a",(function(){return l})),e.d(n,"b",(function(){return s}));e(0);var o=e(167),i=e(91),c=e(134),a=e(1),r=function(t,n,e){if(!t)return"";var o=t.querySelector("iframe"),i=Object(c.c)(n,{delay:100}),a='<div id="'.concat(i,'" class="resource-link-ctag"><div class="loading-string">loading...</div></div>'),r=!o||!0===e;t.innerHTML=r?a:""},l=function(t){var n;return s(t.tagName,t.content,(null===(n=t.opts)||void 0===n?void 0:n.windowId)||"null",t.opts)},s=function(t,n,e,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:n,start:0,end:0},windowId:e,ctagHeightOffset:l,yCnt:0,onIframeMouseWheel:function(){},ctagSandboxed:c.sandboxed,ctagFullscreen:c.fullscreen,ctagOnFullscreenClose:c.onFullscreenClose})}},75:function(t,n,e){"use strict";e.d(n,"c",(function(){return u})),e.d(n,"d",(function(){return h})),e.d(n,"a",(function(){return m})),e.d(n,"b",(function(){return v}));var o=e(29),i=e(9),c=e(12),a=e(33),r=e(10),l=e(45),s=e(56),u=function(t,n,e){return Object(l.a)({file:t,windowId:n,pattern:o.a.linklink,replacement:function(t){var o=e||!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,n,o);return c.innerHTML="".concat(u),c}})},d=function(t){if(t){h(),g++;var n=t.dataset.file,e=t.dataset.folder,o=(t.dataset.searchedstring,t.dataset.windowid||"active");n&&e&&o&&Object(i.d)((function(t){t.ui.browser.goTo(e,n,{openIn:o})}))}},p=function(t){if(t){var n=t.getBoundingClientRect(),e=[n.left+window.scrollX,n.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,e,c,a)}}},f=function(t,n,e,o){var c=++g;b&&clearTimeout(b),b=setTimeout((function(){g===c&&(""===e&&(e=null),Object(i.d)((function(o){o.ui.floatingPanel.openFile(t,{idpanel:"preview-popup-"+Object(s.d)(t),searchedString:e}),setTimeout((function(){o.ui.floatingPanel.movePanel("preview-popup",{x:n[0],y:n[1]+20})}),10)})))}),700)},b=null,g=0,h=function(t){b&&clearTimeout(b),g++,t&&setTimeout((function(){g++}),700)},m=function(t,n,e,o,i){var r=t;if(e){var l=e.length>20?e.substring(0,20)+"...":e;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(n,'" \ndata-searchedstring="').concat(e||"",'"\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} ")}},77:function(t,n,e){"use strict";e.d(n,"c",(function(){return p})),e.d(n,"b",(function(){return f})),e.d(n,"a",(function(){return b}));var o=e(11),i=e(3),c=e(111),a=e(9),r=e(62),l=e(27),s=e(28),u=e(12),d="[AI]",p={},f=function(){var t,n=[],e=s.d.curr.ui_editor_ai_command.split("\n"),o=1,c=Object(i.a)(e);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("|");n.push({title:r[0].trim(),icon:r[1].trim(),typeAnswer:l,command:u})}else{if(""===a.trim())continue;n.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 n},b=function(t){var n=t.typeAnswer,e=t.aiCommand,o=t.selectionTxt,i=t.file,c=t.windowIdFile,r=t.innerFileContent,s=t.cursorInfos;if(console.log(d,"AiAnswer",{typeAnswer:n,aiCommand:e,selectionTxt:o,file:i,windowIdFile:c,innerFileContent:r,cursorInfos:s}),"currentWindow"===n){if(!i||!c||!r||!s)return;g({uuid:t.uuid,command:e,aiBtnConfig:t.aiBtnConfig,windowId:c,file:i,fileContent:r,selectionTxt:o,insertPos:s.to})}else"newWindow"===n?Object(a.d)((function(n){var i=(new Date).toISOString().replace(":","h").replace(":","m").replace(/T/g,"-").substring(0,19),c=Object(l.c)(o).substring(0,40),a=".tiro/answers/answer-".concat(i,"---").concat(c,".md"),r='# Answer for "'.concat(c,'" \n ## Answer \n\n '),s=r+"\n ## Question: \n \n ".concat(o," \n"),d=Object(l.e)(a),p=Object(l.c)(a),f=r.length;n.file.saveContent(a,s,{},(function(){n.ui.floatingPanel.create({type:"file",file:d,view:"preview",id:p,layout:(Object(u.a)(),"right")}),g({uuid:t.uuid,command:e,windowId:p,aiBtnConfig:t.aiBtnConfig,file:d,fileContent:s,selectionTxt:o,insertPos:f,wrapSyntax:!1})}))})):console.error(d,"AiAnswer: typeAnswer not recognized",n)},g=function(t){console.log("trigger AI search",t.windowId,t.file.path,t.selectionTxt,t.insertPos);var n=t.selectionTxt,e=t.fileContent,i=t.insertPos,l=e,s=!1,u=n=(n=(n=(n=n.replaceAll('"','\\"')).replaceAll("'","\\'")).replaceAll("`","\\`")).replaceAll("$","\\$"),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}};console.log(),p[t.windowId]=!0;var b={curr:""},g=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),h=function(){Object(a.d)((function(n){n.ui.notification.emit({content:"[AI] \ud83d\udcac generating text... <br/><br/> \u274c (click popup to stop generation)",options:{hideAfter:5,onClick:function(){n.ai.setStatus("stop",t.uuid)}},id:"ai-status"})}))};Object(a.d)((function(e){var i=Date.now(),c=t.command;c=c.replace("{{input}}",n),Object(r.b)(f());var a=!0,l=!0;h(),e.command.stream(c,(function(n){if(a=e.ai.getStatus(t.uuid),n.isError&&(s=!0),s){if(console.log(d,"ERROR",n),""===n.text||"[object Object]"===n.text)return;b.curr+=n.text+"\n\n",g(),Object(r.b)(Object(o.a)(Object(o.a)({},f()),{},{textUpdate:"",isLast:!0,viewFollow:p[t.windowId]}))}else{if(!a)return;h(),n.isLast&&(n.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:n.textTot,isLast:n.isLast,viewFollow:p[t.windowId]}))}a!==l&&(l=a,n.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:n.textTot,isLast:n.isLast,viewFollow:p[t.windowId]})))}))}))}},81:function(t,n,e){"use strict";e.d(n,"a",(function(){return m})),e.d(n,"c",(function(){return v})),e.d(n,"b",(function(){return w}));var o=e(4),i=e(572),c=e(0),a=e(12),r=e(94),l=e(10),s=e(166),u=e(167),d=e(68),p=e(90),f=e(75),b=e(25),g=e(141),h=e(1),m=function(t){var n={wrapper:Object(c.useRef)(null),main:Object(c.useRef)(null)},e=Object(c.useState)(""),a=Object(o.a)(e,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=n.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 n=r.b.chunks.chunk(l);w(n),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(n){d.a.scrollPreviewPx(t.windowId,n.deltaY)}},Object(h.c)("div",{className:"preview-area",ref:n.wrapper,style:{bottom:function(){var n=f(),e=t.posY+0;return Object(i.a)(e,0,n)}()}},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(n,e){return Object(h.c)(u.a,{key:e,index:e,block:n,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")}},86:function(t,n,e){"use strict";e.d(n,"c",(function(){return i})),e.d(n,"a",(function(){return a})),e.d(n,"b",(function(){return r}));e(26);var o=e(9),i=function(t){return t="editor"===t?"preview":"preview"===t?"both":"editor"},c="notes-view-type",a=function(t){return new Promise((function(n,e){Object(o.d)((function(e){e.cache.get(c,(function(e){if(e){var o=e[t];n(o||!1)}}))}))}))},r=function(t,n){Object(o.d)((function(e){e.cache.get(c,(function(o){o||(o={}),o[t]=n,e.cache.set(c,o,-1)}))}))}},9:function(t,n,e){"use strict";e.d(n,"e",(function(){return dt})),e.d(n,"d",(function(){return pt})),e.d(n,"a",(function(){return ft})),e.d(n,"f",(function(){return bt})),e.d(n,"c",(function(){return gt})),e.d(n,"b",(function(){return ht}));var o=e(15),i=e(26),c=e(128),a=e(38),r=e(206),l=e(0),s=e.n(l),u=e(37),d=e(28),p=e(138),f=e(11),b=e(27),g=e(29),h=e(137),m=e(14),v=e(18),w=function(t){Object(l.useEffect)((function(){m.b.on("moveFolderAnswer",(function(n){t.eventBus.notify(n.idReq,n.idReq)}))}),[]);return{file:function(n,e,cb){var o=gt("move-file-get-files");t.eventBus.subscribe(o,cb||function(){}),console.log("[MOVEFILE] ".concat(n," -> ").concat(e)),m.b.emit("moveFile",{initPath:n,endPath:e,idReq:o,token:Object(v.b)()})},folder:function(n,e,cb){var o=gt("move-folder-get-files");t.eventBus.subscribe(o,cb||function(){}),console.log("[MOVEFOLDER] ".concat(n," -> ").concat(e)),m.b.emit("moveFolder",{initPath:n,endPath:e,idReq:o,token:Object(v.b)()})}}},O=e(34),j=e(111),x=e(383),y=e(141),k=function(t){var n="[FILE API] 005363 ";Object(l.useEffect)((function(){m.b.on("onServerTaskFinished",(function(n){t.eventBus.notify(n.idReq,{data:n})})),m.b.on("getFileContent",(function(n){n.error?t.eventBus.notify(n.idReq,{error:n.error}):t.eventBus.notify(n.idReq,Object(f.a)({},n))}))}),[]);var e={},o=function(n,cb,o){var i=Object(h.a)("getFileContent "+n),c=_(n),a=gt("get-file-content");t.eventBus.subscribe(a,(function(n){if(n.error&&o&&o.onError)o.onError(n.error);else if(!n.error||o&&o.onError){if(!n.error&&(e[a]=e[a]||[],e[a][n.chunkNb]=n.chunkContent,e[a].length===n.chunksLength)){var c=e[a].join("");if(o&&o.removeMetaHeader)c=Object(y.b)(c).content;delete e[a],t.eventBus.unsubscribe(a),cb(c)}}else cb(n.error);i()}),{persistent:!0}),m.b.emit("askForFileContent",{filePath:c,token:Object(v.b)(),idReq:a})},i=Object(l.useRef)(""),c=function(n,e,o,cb){var c=!(!o||!o.history)&&o.history,a=(!(!o||!o.withMetas)&&o.withMetas,[]),r=9e5;if(e.length>r)for(var l=Math.ceil(e.length/r),s=0;s<l;s++){var u=s*r,d=(s+1)*r;a.push(e.slice(u,d))}else a=[e];var p=gt("save-file-content");cb&&t.eventBus.subscribe(p,(function(t){cb&&cb(t)}));for(var f=_(n),g=0;g<a.length;g++){var h=a[g];m.b.emit("saveFileContent",{filePath:f,chunkContent:h,chunkNb:g,chunksLength:a.length,token:Object(v.b)(),idReq:p,withCb:!!cb})}c&&(n!==i.current&&dt().then((function(t){var e=t.ui.browser.folders.current.get();if(e===Object(b.d)(n)){var o,i="",c=t.ui.windows.active.get();if(c)i=(null===(o=c.content.file)||void 0===o?void 0:o.name)||"";t.ui.browser.goTo(e,i)}})),t.historyApi.intervalSave(n,e),i.current=n)},a=(Object(O.a)((function(t,n,e,cb){c(t,n,e,cb)}),500),Object(l.useRef)({})),r=Object(l.useRef)({}),s=function(t,n,e,cb){var o=!(!e||!e.debounced)&&e.debounced,i=!(!e||!e.withThrottle)&&e.withThrottle,l=t.includes("/.tiro/");if(null!==e&&void 0!==e&&e.withMetas&&!l){var s=null===e||void 0===e?void 0:e.withMetas;s.modified=Date.now(),n=Object(y.a)(n,{created:s.created||Date.now(),updated:s.modified})}o?function(t,n,e,o,i,cb){var l=function(t,n){return"".concat(t,"-").concat(n)}(e,t);a.current[l]||(a.current[l]=Object(j.a)((function(t,n,e,cb){c(t,n,e,cb)}),t),!0===n&&(r.current[l]=Object(x.a)((function(n,e,o,cb){console.log("throttledFuncs",t,n),c(n,e,o,cb)}),t))),a.current[l](e,o,i,cb),!0===n&&r.current[l](e,o,i,cb)}(o,i,t,n,e,cb):c(t,n,e,cb)},u=w({eventBus:t.eventBus});return{getContent:o,saveContent:s,insertContent:function(t,n,e,cb){var i=e&&e.insertLine?e.insertLine:0,c=function(e){var o;(i=i<0?e.split("\n").length+i:i)<0&&(i=e.split("\n").length),i>e.split("\n").length&&(i=e.split("\n").length),o=e.split("\n").slice(0,i).join("\n")+"\n"+n+"\n"+e.split("\n").slice(i).join("\n"),s(t,o,{},(function(t){cb&&cb(t)}))};o(t,(function(t){c(t)}),{onError:function(t){console.log("file does not exists, creating it"),c("")},removeMetaHeader:!0})},delete:function(e,cb){var o=gt("delete-file");console.log("".concat(n," delete file ").concat(e.path)),t.eventBus.subscribe(o,cb),m.b.emit("onFileDelete",{filepath:e.path,idReq:o,token:Object(v.b)()})},move:u.file,create:function(e,cb){var o=gt("create-file");console.log("".concat(n," create file in ").concat(e)),t.eventBus.subscribe(o,cb),m.b.emit("createNote",{folderPath:e,idReq:o,token:Object(v.b)()})}}},_=function(t){return t.replace(g.a.linklink,"$2/$1")},C=e(17),E=e(4),S=e(32),T=e(44),I=e(287),P=function(){var t=Object(T.a)(Object(S.a)().mark((function t(n){return Object(S.a)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",new Promise((function(t,e){var o={},c=[];dt().then((function(e){e.search.word("#",n,(function(n){var e=[],r={};console.log(n),Object(i.a)(n,(function(t,n){var c={file:t.file,titleName:""};Object(i.a)(t.results,(function(t,n){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(n),o[t].lines=Object(I.a)(o[t].lines);var e=c.file.name+"-"+c.titleName;r[e]||(r[e]=[]),r[e].push(o[t].id),l.push(o[t])})),Object(i.a)(l,(function(t,n){Object(i.a)(l,(function(o,i){if(n!==i){var c=t.id,a=o.id,r="".concat(c,"-").concat(a),l="".concat(a,"-").concat(c);-1===e.indexOf(r)&&-1===e.indexOf(l)&&e.push(r)}}))}))}))})),Object(i.a)(o,(function(t){c.push(t)})),t({nodesObj:o,nodesArr:c,edges:e})}))}))})));case 1:case"end":return t.stop()}}),t)})));return function(n){return t.apply(this,arguments)}}(),N=function(t){var n="[SEARCH API] ",e=Object(l.useState)(""),o=Object(E.a)(e,2),i=o[0],c=o[1];Object(l.useEffect)((function(){m.b.on("getWordSearch",(function(n){t.eventBus.notify(n.idReq,n.result)}))}),[]);var a=function(e,cb){!function(e,cb,o){var i=gt("search-".concat(o,"-"));console.log("".concat(n," searching ").concat(e," with type ").concat(o)),t.statusApi.searching.set(!0),t.eventBus.subscribe(i,(function(n){t.statusApi.searching.set(!1),cb(n)})),m.b.emit("searchFor",{term:e,token:Object(v.b)(),type:o,idReq:i})}(e,cb,"text")};return{files:{search:a},word:function(e,o,cb,i){var c=gt("search-word-");e=e.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"),console.log("".concat(n," searching WORD ").concat(e," in ").concat(o),i),t.eventBus.subscribe(c,(function(t){cb(t)})),m.b.emit("searchWord",{word:e,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){dt().then((function(n){n.ui.browser.files.set([]),c(t),a(t,(function(t){n.ui.browser.files.set(t)}))}))},term:{set:c,get:i}}}},A=e(136),R=e(30),F=e(12),L=/((\/\/.*$)|(\/\*[\s\S]*?\*\/))/gm,M=/([^\s,]+)/g,D=e(94),z=function(t){var n=Object(l.useState)(null),e=Object(E.a)(n,2),o=e[0],i=e[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)};return Object(f.a)(Object(f.a)({},D.b),{},{ui:{lineJump:{jump:function(t,n){a({type:"lineJump",windowId:t,lineJumpNb:n})}},editorAction:{dispatch:a,get:o,canExecuteAction:function(t){return t.uuid===c.current&&(c.current=null,!0)}}}})},B=e(376),W=e(56),U="/".concat(C.a.path.configFolder,"/").concat(C.a.path.cacheFolder,"/cache-api"),H="[CACHE API]",q=C.a.client.log.verbose,V=C.a.client.log.verbose,J=function(){return(new Date).getTime()},G=function(t){var n=t-J()<0;return q&&console.log(H,"isExpired? : ",n,(t-J())/6e4,"mins"),n},K=function(t){var n=function(t){return"".concat(U,"/cache-api-storage-").concat(Object(W.b)(t),".md")},e=Object(l.useRef)({}),o=function(t,n,o){var i;e.current[t]={content:n,until:(i=o,J()+60*i*1e3)}},i=8e5,c="__CHUNKED__CACHED__OBJ__SIZE:",a="[CACHE CHUNK]",r=function(t,e,o){var r=arguments.length>3&&void 0!==arguments[3]&&arguments[3]?JSON.stringify(e,null,"\t"):JSON.stringify(e),l=function(t,e,cb){V&&console.log(a,n(t),{str:e}),pt((function(o){o.file.saveContent(n(t),"".concat(e),{},(function(t){cb(t)}))}))};if(!(r.length>i))return l(t,r,(function(){o&&o()}));var s=(u=i,r.match(new RegExp(".{1,"+u+"}","g")));V&&console.log(a,"SAVE >> TOO LARGE, split in ".concat(s.length," parts"),{cacheId:t,contentArr:s});var u,d=0,p=function(){++d===s.length-1&&o&&o()};l(t,"".concat(c).concat(s.length),p);for(var f=function(n){setTimeout((function(){l("c".concat(n,"_").concat(t),s[n],p)}),1e3*n)},b=0;b<s.length;b++)f(b)},s=function(t,cb,e){var o=function(t,e,o){pt((function(i){i.file.getContent(n(t),e,{onError:o})}))},i="___ERROR___CHUNK___LOADING___FAILURE";o(t,(function(n){try{if(n.startsWith(c)){var r=parseInt(n.replaceAll(c,""));V&&console.log(H,"GET >> remerging a ".concat(r," part"),{cacheId:t}),function(n,e,c,r){for(var l=Object(h.a)("".concat(H," getAllChunksAndMerge")),s=[],u=0,d=function(){if(u===e){var n=s.join(""),o=n.includes(i);V&&console.log("GET >> RESULT remerging",{hasFailed:o,cacheId:t,nbChunks:e,resMerge:n}),l(),o?r():c(n)}},p=function(n){o("c".concat(n,"_").concat(t),(function(o){s[n]=o,V&&console.log(a,"c".concat(n,"_").concat(t),{loadingCounter:u,nbChunks:e}),u++,d()}),(function(t){u++,s[n]=i,d()}))},f=0;f<e;f++)p(f)}(0,r,(function(t){cb(t)}),(function(t){e()}))}else cb(n)}catch(l){e(l)}}),(function(t){e(t)}))},u=function(){e.current={}};return{get:function(t,cb,n){if(!0===(null===n||void 0===n?void 0:n.disableRamCache)&&u(),t in e.current){var i=e.current[t],c=G(i.until);c&&(i.content=void 0),q&&console.log(H,"FROM RAM",t," expired:",c),cb(i.content)}else s(t,(function(n){try{var i=JSON.parse(n);e.current[t]=Object(f.a)({},i);var c=e.current[t],a=G(c.until);a&&(c.content=void 0),q&&console.log(H,"FROM FILE",t," expired:",a),cb(c.content)}catch(r){q&&console.log(H,"error getting cache",r,t),o(t,void 0,60),cb(e.current[t].content)}}),(function(n){return"NO_FILE"===n?(q&&console.log(H,"FROM FILE: NO_FILE",t),o(t,void 0,60),cb(e.current[t].content)):cb(void 0)}))},set:function(t,n,i,cb,c){i||(i=60),-1===i&&(i=1e32),o(t,n,i);var a=e.current[t];q&&console.log(H,"SETTING",t," with cachedTime in min",i),r(t,a,(function(t){cb&&cb(t)}),null===c||void 0===c?void 0:c.uncompressed)},cleanRamCache:u,getCachePath:function(t,cb){return cb&&cb(n(t)),n(t)}}},Y=e(190),$=e(286),Z=e(108),X=e(248),Q=e(39),tt="[PLUGINS]",nt=e(234),et={obj:null},ot={play:function(t,n){pt((function(e){var o,i,c,a=null===(o=null===n||void 0===n?void 0:n.cache)||void 0===o||o;i=null===n||void 0===n?void 0:n.start,c=null===n||void 0===n?void 0:n.time;e.ressource.fetch(t,(function(t,n){et.obj=new Audio(n),et.obj.load(),et.obj.play(),et.obj.onprogress=function(){},console.log("[AUDIO] Playing:",n,"audio object in window.__tiro_audio_obj_curr__"),window.__tiro_audio_obj_curr__=et}),{returnsPathOnly:!0,disableCache:!a})}))},stop:function(){et.obj.pause(),et.obj.currentTime=0}},it=e(127),ct=e(77),at=function(t,n){var e=Object(ct.b)();console.log("search",{searchText:t,modelName:n,configAllAis:e}),n||(n=e[0].title);var o=e.find((function(t){return t.title===n}));if(o){var i=st("new");o.typeAnswer="newWindow",Object(ct.a)({uuid:i,typeAnswer:o.typeAnswer,aiCommand:o.command,aiBtnConfig:o,selectionTxt:t})}else Object(R.d)('Model "'.concat(n,'" not found in config'))},rt={},lt=function(t){return rt[t]||!1},st=function(t,n){return"new"===t&&(n=Object(u.a)(),rt[n]=!0),"stop"===t&&(n?rt[n]=!1:Object(i.a)(rt,(function(t,n){rt[n]=!1})),pt((function(t){t.ui.notification.emit({content:"[AI] AI generation stop requested",options:{hideAfter:3},id:"ai-status"})}))),console.log("setStatus",{status:t,uuid:n,aiStatusManagerDic:rt}),n||(n=""),n},ut=null,dt=function(){return new Promise((function(t,n){if(ut)return t(ut);var e=setInterval((function(){if(ut)return clearInterval(e),t(ut)}),200)}))},pt=function(cb){dt().then((function(t){cb(t)}))},ft=s.a.createContext(null),bt=function(t){var n=Object(l.useRef)({}),e=function(t){delete n.current[t]},o={subscribe:function(t,cb,e){e||(e={}),n.current[t]||(n.current[t]=[]),n.current[t].push({cb:cb,options:e})},unsubscribe:e,notify:function(t,o){Object(i.a)(n.current,(function(n,c){c===t&&Object(i.a)(n,(function(n){try{n.cb(o)}catch(i){console.warn("[CLIENT API] error with function",i)}n.options.persistent||e(t)}))}))}};Object(l.useEffect)((function(){C.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(n,{isConnected:!0})})),m.b.on("reconnect",(function(){t.eventBus.notify(n,{isConnected:!0})})),m.b.on("disconnect",(function(){t.eventBus.notify(n,{isConnected:!1})}))}),[]);var n="watch-api-unique-id-request";return Object(l.useEffect)((function(){m.b.on("onNoteWatchUpdate",(function(e){t.eventBus.notify(n,e)}))}),[]),{file:function(e,cb){t.eventBus.subscribe(n,(function(t){e===t.filePath&&cb(t)}),{persistent:!0})},appStatus:function(cb){t.eventBus.subscribe(n,(function(t){cb(t)}),{persistent:!0})},dev:{toggleIsConnected:function(e){t.eventBus.notify(n,{isConnected:e})}}}}({eventBus:o}),a=N({eventBus:o,statusApi:t.statusApi}),r=k({eventBus:o,historyApi:t.historyApi}),s=function(t){return Object(l.useEffect)((function(){m.b.on("getFiles",(function(n){t.eventBus.notify(n.idReq,n.files)})),m.b.on("getFilesPreview",(function(n){t.eventBus.notify(n.idReq,n.filesPreview)}))}),[]),{get:function(n,cb){C.a.client.log.socket&&console.log("[CLIENT API] get files ".concat(n));var e=gt("get-files-");t.statusApi.searching.set(!0),t.eventBus.subscribe(e,(function(e){t.statusApi.searching.set(!1),e=e.filter((function(t){return"md"===t.extension})),cb(e,n)})),m.b.emit("askForFiles",{folderPath:n,token:Object(v.b)(),idReq:e})},getPreviews:function(n,cb){var e=gt("get-files-");t.eventBus.subscribe(e,cb),m.b.emit("askFilesPreview",{filesPath:n,idReq:e,token:Object(v.b)()})},search:t.searchApi.files.search}}({eventBus:o,searchApi:a,statusApi:t.statusApi}),u=function(t){var n=Object(f.a)({},t).eventBus;Object(l.useEffect)((function(){m.b.on("getUploadedFile",(function(t){n.notify(t.idReq,t)}))}),[]);var e=function(t,cb){try{var e=gt("upload-file");n.subscribe(e,(function(n){delete n.idReq,t.onSuccess&&t.onSuccess(n),cb&&cb({message:"success",succesObj:n})})),Object(A.a)({file:t.file,path:t.folderPath,idReq:e,onProgress:function(n){t.onProgress&&t.onProgress(n)}})}catch(o){console.warn(o)}},o=Object(l.useRef)([]),c=Object(O.a)(Object(T.a)(Object(S.a)().mark((function t(){var n,c,a,r;return Object(S.a)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!(o.current.length<1)){t.next=2;break}return t.abrupt("return");case 2:if(n=o.current.length,c=0,Object(R.d)("Files Uploaded: \n ".concat(c,"/").concat(n),"upload-info"),"mobile"!==Object(F.a)()){t.next=16;break}a=Object(S.a)().mark((function t(i){return Object(S.a)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,new Promise((function(t,a){var 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)),e(r.uploadInfos,(function(e){var o=++c===n?5:60;Object(R.d)("Files Uploaded: \n ".concat(c,"/").concat(n),"upload-info",o),r&&r.cb&&r.cb(e),t(void 0)}))}));case 2:case"end":return t.stop()}}),t)})),r=0;case 8:if(!(r<o.current.length)){t.next=13;break}return t.delegateYield(a(r),"t0",10);case 10:r++,t.next=8;break;case 13:o.current=[],t.next=18;break;case 16:Object(i.a)(o.current,(function(t,o){setTimeout((function(){console.log("[UPLOAD] starting upload item ".concat(t.uploadInfos.file.name)),e(t.uploadInfos,(function(e){var o=++c===n?5:60;Object(R.d)("Files Uploaded: \n ".concat(c,"/").concat(n),"upload-info",o),t.cb&&t.cb(e)}))}),500*o)})),o.current=[];case 18:case"end":return t.stop()}}),t)}))),500);return{uploadFile:function(t,cb){o.current.length,Object(R.d)("Starting Uploading Files...","upload-info"),o.current.push({uploadInfos:t,cb:cb}),c()}}}({eventBus:o}),g=Object(B.a)({eventBus:o}),h=function(t){return Object(l.useEffect)((function(){m.b.on("getFoldersScan",(function(n){t.eventBus.notify(n.idReq,{folders:n.folders,pathBase:n.pathBase})})),m.b.on("onServerTaskFinished",(function(n){t.eventBus.notify(n.idReq,n.status)}))}),[]),{get:function(n,cb,e){C.a.client.log.socket&&console.log("[FOLDERS API] get folders ",n,e);var o=gt("get-folders-");t.eventBus.subscribe(o,(function(t){var e=Object(f.a)({},t);e.folderPaths=n,cb(e)})),m.b.emit("askFoldersScan",{foldersPaths:n,depth:(null===e||void 0===e?void 0:e.depth)||0,token:Object(v.b)(),idReq:o})},move:w({eventBus:t.eventBus}).folder,create:function(n,cb){console.log("[askFolderCreate]",n);var e=gt("create-folder-");n=Object(b.b)(n),cb&&t.eventBus.subscribe(e,(function(t){cb(t)})),m.b.emit("askFolderCreate",{newFolderPath:n,token:Object(v.b)(),idReq:e})},delete:p.a}}({eventBus:o}),j=function(t){return Object(l.useEffect)((function(){m.b.on("getCommandExec",(function(n){t.eventBus.notify(n.idReq,n.resultCommand)})),m.b.on("getCommandExecStream",(function(n){t.eventBus.notify(n.idReq,n.streamChunk)}))}),[]),{exec:function(n,cb){var e=gt("command-exec-");t.eventBus.subscribe(e,(function(t){Object($.a)(t)||(t=JSON.stringify(t)),cb(t)}),{persistent:!0}),m.b.emit("askCommandExec",{commandString:n,token:Object(v.b)(),idReq:e})},stream:function(n,cb){var e=gt("command-stream-");t.eventBus.subscribe(e,(function(n){cb(n),n.isLast&&t.eventBus.unsubscribe(e)}),{persistent:!0}),m.b.emit("askCommandExecStream",{commandString:n,token:Object(v.b)(),idReq:e})}}}({eventBus:o}),x=function(t){Object(l.useEffect)((function(){m.b.on("getBackendConfig",(function(n){t.eventBus.notify(n.idReq,n.config)}))}),[]);var n={get:function(cb){var n=gt("get-config-");t.eventBus.subscribe(n,(function(t){cb(t)})),m.b.emit("askBackendConfig",{token:Object(v.b)(),idReq:n})},getPlatform:function t(){return t()}};return n}({eventBus:o}),y=function(t){Object(l.useEffect)((function(){m.b.on("getPluginsList",(function(n){t.eventBus.notify(n.idReq,n)}))}),[]);var n=function(cb,n){n||(n={}),n.noCache||(n.noCache=!1),C.a.client.log.socket&&console.log("".concat(tt," get plugins"));var e=gt("get-plugins-");t.eventBus.subscribe(e,(function(t){t.scanLog.length>0&&pt((function(n){return n.ui.notification.emit({content:"PLUGIN SCAN LOG:<br/>".concat(JSON.stringify(t.scanLog)),options:{hideAfter:60}})}));var n=Object(X.a)(t.plugins,(function(t){return t.name}));cb(n,t.scanLog)})),m.b.emit("askPluginsList",{noCache:n.noCache,token:Object(v.b)(),idReq:e})},e={list:n,get:function(t,e,cb){n((function(n,o){var i=n.filter((function(n){return n.name===t&&n.type===e}))[0]||null;cb(i)}),{noCache:!0})},cronCache:{set:function(t,n){var e="plugins-cron-infos";pt((function(o){o.cache.get(e,(function(i){i||(i={}),i[t]||(i[t]={vars:{}}),i[t].vars=n,o.cache.set(e,i,-1)}))}))}},marketplace:{fetchList:function(cb){pt((function(t){var n=t.userSettings.get("plugins_marketplace_url"),e="".concat(tt," api.plugins.marketplace.fetchList error for url: ").concat(n," :");t.ressource.fetch(n,(function(t){try{var o=JSON.parse(t),c=[];Object(Q.a)(o)?(Object(i.a)(o,(function(t){var n={name:"",description:"",versions:[],configuration:[]};t.name&&(n.name=t.name),t.description&&(n.description=t.description),t.versions&&(n.versions=t.versions),t.images&&(n.images=t.images),t.icon&&(n.icon=t.icon),t.configuration&&(n.configuration=t.configuration),""!==n.name&&c.push(n)})),cb(c)):Object(R.d)("".concat(e,": did not find a plugin list"))}catch(a){Object(R.d)("".concat(e," ").concat(JSON.stringify(a),", url: ").concat(n))}}),{disableCache:!0})}))}}};return e}({eventBus:o}),_=K(),E=Object(nt.b)({}),I={get:function(cb){var t=setInterval((function(){m.b&&(cb(m.b),clearInterval(t))}),10)}},P=Object(d.c)({eventBus:o}).userSettingsApi,L=Object(p.c)({searchUiApi:a.ui,statusApi:t.statusApi,filesApi:s,foldersApi:h,windowApi:t.windowsApi,tabsApi:t.tabsApi,userSettingsApi:P}),M=z(),D=Object(Y.b)({}),W=function(t){return Object(l.useEffect)((function(){m.b.on("getPerformanceReport",(function(n){t.eventBus.notify(n.idReq,n)}))}),[]),{getReport:function(cb){var n=gt("get-perf-report");t.eventBus.subscribe(n,(function(t){cb?cb(t):(console.log("[PERF API]","report"),console.log(t.report))})),m.b.emit("askPerformanceReport",{token:Object(v.b)(),idReq:n})}}}({eventBus:o}),U=function(t){var n="[ACTIVITY API]";return Object(l.useEffect)((function(){m.b.on("getActivityReport",(function(n){t.eventBus.notify(n.idReq,n)}))}),[]),{getReport:function(e,cb){console.log(n,"asked for report (if no cb provided, will be outputed to console.log)",e);var o=gt("get-perf-report");t.eventBus.subscribe(o,(function(t){cb?cb(t):(console.log(n,"report"),console.log(t.report))})),m.b.emit("askActivityReport",{params:e,token:Object(v.b)(),idReq:o})}}}({eventBus:o}),H=Object(it.b)({}),q={search:at,setStatus:st,getStatus:lt},V={cache:_,file:r,audio:ot,encryption:Z.b,files:s,socket:I,popup:t.popupApi,upload:u,ressource:g,tabs:t.tabsApi,folders:h,config:x,userSettings:P,history:t.historyApi,status:t.statusApi,note:M,analytics:D,search:a,command:j,plugins:y,watch:c,performance:W,activity:U,ai:q,ui:{browser:L,floatingPanel:H,notification:E,windows:t.windowsApi,lightbox:t.lightboxApi,textToSpeechPopup:t.ttsApi,search:a.ui,note:M.ui,notePreviewPopup:t.notePreviewPopupApi}};return ut=V,V},gt=function(t){return"client-api-".concat(t,"-req-").concat(Object(u.a)())},ht=function(t,cb){dt().then((function(n){var e=t.apiName.split("."),r=n;if(Object(i.a)(e,(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(vt("",n))});try{var l=mt(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)})}}))},mt=function(t){var n=function(t){var n=t.toString().replace(L,""),e=null;return null===(e=n.startsWith("cb =>")?["cb"]:n.slice(n.indexOf("(")+1,n.indexOf(")")).match(M))&&(e=[]),e}(t),e=n.indexOf("cb");return-1===e?null:e},vt=function t(n,e){var o="";for(var c in e)if("object"===typeof e[c]&&e[c].constructor!==Array){if(c.length>1&&"get"!==c){var a=""!==n?"".concat(n,"."):"";o+=t("".concat(a).concat(c),e[c])}}else o="".concat(o).concat(n,".").concat(c,"\n");var l=o.split("\n"),s=[];return dt().then((function(t){Object(i.a)(l,(function(n){var e=n.split("."),o=t;Object(i.a)(e,(function(t,n){o[t]&&(o=o[t])}));var c="var",a="";Object(r.a)(o)&&(c="Function",a=o.toString()),s.push({name:n,type:c,description:a})}))})),o}},90:function(t,n,e){"use strict";e.d(n,"a",(function(){return h})),e.d(n,"b",(function(){return v}));e(26),e(0);var o=e(27),i=e(18),c=e(12),a=e(98),r=e(33),l=e(72),s=e(56),u=e(10),d=e(43),p=e(9),f=e(25),b=e(1),g=400,h=function(t){var n=t.markdownTag.split("](")[1].slice(0,-1),e=t.markdownTag.split("](")[0].replace("![",""),u="".concat(Object(d.a)(t.file.folder),"/").concat(n).concat(Object(i.c)()),f="".concat(e,".").concat(Object(a.a)(n)),g=Object(o.b)(u),h="ress-".concat(Object(s.b)(g));Object(r.a)(t.file,g,(function(){var n=document.querySelector(".".concat(h," .iframe-wrapper"));n&&v(g,n,t.file.path)}));var m=r.d,v=function(n,e,i,s){var u=(null===s||void 0===s?void 0:s.fullscreen)||!1;null===s||void 0===s||s.fullscreen;if(e){var d=Object(o.e)(i);if(null!==s&&void 0!==s&&s.persist){var p=e.querySelector("iframe")?"closed":"open";Object(r.b)(d,n,p)}var f=function(){e.innerHTML=""},b="mobile"===Object(c.a)()?-300:-100,g=Object(a.a)(n).toLocaleLowerCase();"epub"===g?Object(l.c)(e,Object(l.b)("epub",n,t.windowId,{file:d,fullscreen:u,onFullscreenClose:f,ctagHeightOffset:b}),null===s||void 0===s?void 0:s.openOnly):"pdf"===g?Object(l.c)(e,Object(l.b)("pdf",n,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)(e,Object(l.b)("datatable",n,t.windowId,{file:d,fullscreen:u,onFullscreenClose:f,ctagHeightOffset:b}),null===s||void 0===s?void 0:s.openOnly):Object(l.c)(e,Object(l.b)("iframe",n,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 n=t.dataset.link;window.open(n,"popup-preview-link","width=800,height=1000")}})),'"\n\t\tdata-link="').concat(g,'">').concat(m("up-right-from-square"),"</li>"),j='<li\n\t\tonclick="'.concat(Object(r.c)("preview-link-ress",(function(t){return function(t,n){if(t){var e=t.dataset.link,o=t.dataset.filepath,i=function(t){return t.parentNode.parentNode.parentNode.parentNode.parentNode.querySelector(".iframe-wrapper")}(t);v(e,i,o,n)}}(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>"),x='<li\n\t\tonclick="'.concat(Object(r.c)("download-link-ress",(function(t){if(t){var n=t.dataset.link,e=t.dataset.filename;console.log(u,f),w(e,n)}})),'"\n\t\ttitle="Preview link" data-filename="').concat(f,'" data-link="').concat(g,'">').concat(m("download"),"</li>"),y="<ul>".concat(j," ").concat(O," ").concat(x,"</ul>"),k='<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 n=t.dataset.link,e="iframe",o=Object(a.a)(n).toLocaleLowerCase();"epub"===o&&(e="epub"),"pdf"===o&&(e="pdf"),"csv"!==o&&"arrow"!==o||(e="datatable"),Object(p.d)((function(t){t.ui.floatingPanel.create({type:"ctag",layout:"full-center",ctagConfig:{tagName:e,content:n}})}))}})),'">\n\t\t\t').concat(e," (").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:k}}),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: 90px;\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: 90px;\n\t\tpointer-events: all;\n}\n\n")},w=function(t,n){var e=document.createElement("a");e.style.display="none",document.body.appendChild(e),e.href=n,e.target="_blank",e.setAttribute("download",t),e.click(),window.URL.revokeObjectURL(e.href),document.body.removeChild(e)}},91:function(t,n,e){"use strict";e.d(n,"b",(function(){return r})),e.d(n,"a",(function(){return l}));var o=e(4),i=e(26),c=e(286),a=e(0),r=function(){var t=Object(a.useState)([]),n=Object(o.a)(t,2),e=n[0],r=n[1],s=Object(a.useState)(0),u=Object(o.a)(s,2),d=u[0],p=u[1];return{lightboxApi:{open:function(t,n){var e=[];Object(i.a)(n,(function(t){if(Object(c.a)(t)){var n={file:l(),title:"",url:t};e.push(n)}else e.push(t)})),r(e),p(t)},close:function(){r([]),p(0)}},lightboxImages:e,lightboxIndex:d}},l=function(t,n){return{nature:"file",name:t||"",realname:"",path:n||"",folder:""}}},93:function(t,n,e){"use strict";e.d(n,"b",(function(){return a})),e.d(n,"d",(function(){return r})),e.d(n,"c",(function(){return l})),e.d(n,"a",(function(){return u}));var o=e(15),i=e(26),c=e(427);c.setOptions({gfm:!0,breaks:!0,headerPrefix:"t-"});var a=function(t){var n=t;return n=c.parse(n)},r=function(t,n,e){var o=t,c=o.match(n)||"";return Object(i.a)(c,(function(t){o=o.replace(t,e(t))})),o},l=function(t,n,e){var o=t,i=n.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(n),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]=e(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(n,e){var o=!1;if(Object(i.a)(n,(function(t){t.id===e&&(o=!0)})),o){var c=!1,a=[e[e.length-2],e[e.length-1]],r=e.slice(0,-2),l=parseInt(a[1]);return"-"!==a[0]||isNaN(l)||(c=!0),c?e="".concat(r,"-").concat(l+1):e+="-1",t(n,e)}return e},u=function(t,n){var e=n.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<e.length;c++){if(e[c].includes(t)){i=c;break}}}else i=t;for(var a=function(t){for(var n=[],e=t.split("\n"),i=[],c=0;c<e.length;c++){var a=e[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}),n.push({id:p,title:u,line:d,ranking:l[1].length,previewId:f})}}return n}(n),r=null,l=0;l<a.length;l++){var u=a[l];if(u.line>i)break;r=u}return{line:i,mdPart:r}}},94:function(t,n,e){"use strict";e.d(n,"a",(function(){return u})),e.d(n,"b",(function(){return f}));var o=e(11),i=e(26),c=e(29),a=e(103),r=e(93),l=e(43),s=function(t){var n=Object(o.a)({},t),e=n.raw,i=n.file,c=n.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)(e))))));return Object(a.d)(),s},u=function(t,cb){for(var n=document.getElementsByClassName(t),e=function(){var t=n[o];t.onclick=function(){cb(t)}},o=0;o<n.length;o++)e()},d=function(t){var n=t.split(c.a.userCustomTagManual),e=[],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,n){t>=2&&p.push(n)})),Object(i.a)(l,(function(t,e){if(p.includes(t))if(s){if(s===t){var i=[u+1,e+1];d.push.apply(d,i);for(var c=n.slice(i[0],i[1]),a=l.slice(u+1,e+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:e}),u=-1,s=null}}else s=t,u=e})),0===d.length)e.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];n[g]&&e.push({type:"text",content:n[g],start:g,end:g+1})}}for(var h=0===t.indexOf(l[0]),m=[],v=o.length>e.length?o.length:e.length,w=0;w<v;w++)h?(o[w]&&m.push(o[w]),e[w]&&m.push(e[w])):(e[w]&&m.push(e[w]),o[w]&&m.push(o[w]));return m},p=function(t){var n="";return Object(i.a)(t,(function(t){"text"===t.type?n+=t.content:"tag"===t.type&&(n+="[[".concat(t.tagName,"]]").concat(t.content,"[[").concat(t.tagName,"]]"))})),n},f={render:function(t){var n=Object(o.a)({},t),e=n.raw,c=n.file,a=n.windowId;a||(a="");var r=d(e);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}}},95:function(t,n,e){"use strict";e.d(n,"b",(function(){return c})),e.d(n,"a",(function(){return a})),e.d(n,"d",(function(){return r})),e.d(n,"c",(function(){return l}));var o=e(248),i=e(26),c=["Az","Crea","Modif"],a=["alphabetical","created","modified"],r=function(t,n){var e;switch(a[n]){case"alphabetical":default:e=Object(o.a)(t,[function(t){return t.realname.toLocaleLowerCase()}]);break;case"created":e=Object(o.a)(t,["created"]).reverse();break;case"modified":e=Object(o.a)(t,["modified"]).reverse()}return e},l=function(t){var n=t[0];return n?(Object(i.a)(t,(function(t){t.created&&n.created&&t.created>n.created&&(n=t)})),n):null}},96:function(t,n,e){"use strict";e.d(n,"c",(function(){return st})),e.d(n,"a",(function(){return ft})),e.d(n,"b",(function(){return bt}));var o=e(4),i=e(0),c=e.n(i),a=e(245),r=e(247),l=e(54),s=e(13),u=e(380),d=e(10),p=e(68),f=e(12),b=e(219),g=e(57),h=e(215),m=e(15),v=e(26),w=e(17),O=e(9),j=e(30),x=(w.a.client.log.verbose,function(t,n,e,o,i){return{label:t,apply:n||t,info:e,detail:i,type:"tag",boost:o||0}}),y=function(t,n){var e=_(t,n);return[C(n),e,k(n)]},k=function(t){return function(n){var e=n.matchBefore(/\-/);if(!n.explicit&&!e)return null;var o="".concat(w.a.path.configFolder,"/snippets.md");return new Promise((function(i,c){Object(O.d)((function(c){c.file.getContent(o,(function(o){var c=[],a=o.split("\n");Object(v.a)(a,(function(t){var n,e=(t=t.split("\\n").join("\n")).split("|"),o=null===(n=e.shift())||void 0===n?void 0:n.trim(),i=e.join("|").trim();if(i&&o){if(o="--"+o,i.includes("${")){var a=i;try{i=new Function("return `"+a+"`")()}catch(s){var r="".concat("[Code Mirror]"," snippets error: ").concat(JSON.stringify({e:s,oto:a}));Object(j.d)(r)}}var l=i.length>20?"".concat(i.substring(0,20),"..."):i;c.push(x(o,i,void 0,void 0,l))}}));var r={from:e?e.from:n.pos,options:c,validFor:/.*/};t("snippets"),i(r)}))}))}))}},_=function(t,n){return function(e){var o=e.matchBefore(/\#/);return e.explicit||o?new Promise((function(i,c){Object(O.d)((function(c){var a=t.folder;console.log("searching for folder",a),c.search.word("#",a,(function(t){var c=[];Object(v.a)(t,(function(t){Object(v.a)(t.results,(function(t){var n=t.split(" ");Object(v.a)(n,(function(t){(t=t.trim())&&t.startsWith("#")&&(t.length<=1||"#"!==t[1]&&c.push(x(t,t)))}))}))}));var a={from:o?o.from:e.pos,options:c,validFor:/.*/};n("hashtag"),i(a)}))}))})):null}},C=function(t){return function(n){var e=n.matchBefore(/\[\[/);return n.explicit||e?new Promise((function(o,i){var c=new Promise((function(t,n){Object(O.d)((function(n){n.files.get("/.tiro/tags",(function(e){var o=0,i=[];Object(v.a)(e,(function(c){n.file.getContent(c.path,(function(n){o++,i.push({name:c.name,content:n}),o===e.length&&t(i)}))}))}))}))})),a=new Promise((function(t,n){Object(O.d)((function(n){var e=[];n.plugins.list((function(n){Object(v.a)(n,(function(t){"tag"===t.type&&e.push({name:t.name,content:t.code})})),t(e)}))}))}));Promise.all([a,c]).then((function(t){var n=function(t){var n=[];return Object(v.a)(t,(function(t){var e=t.name.replace(".md",""),o="[[".concat(e,"]]"),i="".concat(o," ").concat(o),c="Insert installed custom tag ".concat(o),a=0,r=t.content.split("\n"),l="// --insert:",s="// --comment:",u="// --boost:";Object(v.a)(r,(function(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,"")))})),n.push(x(o,i,c,a))})),n}([].concat(Object(m.a)(t[0]),Object(m.a)(t[1])));r(n)})).catch((function(){console.warn("ERROR HERE")}));var r=function(i){var c={from:e?e.from:n.pos,options:i,validFor:/.*/};t("ctag"),o(c)}})):null}},E=e(122),S=e(28),T=e(90),I=e(159),P=e(75),N=e(117),A=e(213),R=e(29),F=e(98),L=e(45),M=e(1),D=function(t,n){return Object(L.a)({file:t,windowId:n,pattern:R.a.ressource,replacement:function(e){var o=e.matchs,i=document.createElement("span"),c=o[2];return"none"===Object(F.a)(c)?i.innerHTML=Object(N.a)(o[0],o[2],t,!0):i.innerHTML=function(t,n,e){var o=t[0],i='<div class="mdpreview-source">'.concat(o,"</div>"),c=Object(A.renderToString)(Object(M.c)(T.a,{markdownTag:o,file:n,windowId:e}));return"".concat(c," ").concat(i)}(o,t,n),i}})},z=e(99),B=e(229),W=e(23),U=e(176),H=e(128),q=e(38),V=e(34),J=e(226),G=e(227),K=e(103),Y=e(25),$=e(228),Z=e(230),X=e(8),Q=e(32),tt=e(3),nt=e(44),et=e(285),ot=e(383),it={lines:[],words:[],sentences:[],userDicStr:[]},ct={lastLinePos:-1},at=Object(ot.a)((function(){Object(O.d)((function(t){t.file.getContent(".tiro/suggestions.md",(function(t){"NO_FILE"!==t&&(it.userDicStr=["\n"+t])}))}))}),6e4),rt=Object(ot.a)((function(t,n,e){at();var o=t;e>0&&(o=t.slice(0,-e));var i=o+n+it.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)),it.lines=c,it.words=l,it.sentences=r}),6e3),lt=Object(et.b)(function(){var t=Object(nt.a)(Object(Q.a)().mark((function t(n,e){var o,i,c,a,r,l,s,u,d,p,f,b,g,h,m,v,w,j,x,y,k,_,C,E,S,T,I,P,N,A,R,F,L,M,D,z,B,W,U,H,q,V;return Object(Q.a)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(new Promise((function(t,n){Object(O.d)((function(t){}))})),o=n.split("\n").slice(-1)[0],i=o.split(".").slice(-1)[0].split("?").slice(-1)[0].split("!").slice(-1)[0],c=n.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=n+e,(r.startsWith("d'")||r.startsWith("l'"))&&(r=r.slice(2)),d=i.length,p="",rt(n,e,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}w=[],j=[],x=Object(tt.a)(it.words);try{for(x.s();!(y=x.n()).done;)if((k=y.value).startsWith(r)&&(w.push(k),l&&l.length>0))for(_=l+" "+k,C=u.indexOf(_);-1!==C&&""!==k;)j.push(k),C=u.indexOf(_,C+1)}catch(J){x.e(J)}finally{x.f()}if(!(j.length>0)){t.next=47;break}E="",S=0,T=Object(tt.a)(j),t.prev=31,P=Object(Q.a)().mark((function t(){var n,e;return Object(Q.a)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:n=I.value,(e=j.filter((function(t){return t===n})).length)>S&&(E=n,S=e);case 3:case"end":return t.stop()}}),t)})),T.s();case 34:if((I=T.n()).done){t.next=38;break}return t.delegateYield(P(),"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=[E];case 47:N=j.length>0?j:w,m&&(N=j),A="",N.length>0&&(R=N.sort((function(t,n){return n.length-t.length})),F=R.slice(0,10),L=Math.floor(Math.random()*F.length),A=(A=F[L]).replace(r,"")),M=[".",",","!","?","|"].includes(A.slice(-1)),D=" "===A.slice(-2,-1),M&&D&&(A=A.slice(0,-2)),M&&(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(tt.a)(it.sentences);try{for(W.s();!(U=W.n()).done;)(H=U.value).toLocaleLowerCase().startsWith(a.toLocaleLowerCase())&&B.push(H)}catch(J){W.e(J)}finally{W.f()}B.length>0&&(h=B.sort((function(t,n){return n.length-t.length}))[0],q=a.length,h=h.slice(q)),f&&(p=h)}return V=!0,ct.lastLinePos!==c&&(V=!1),ct.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(n,e){return t.apply(this,arguments)}}(),100),st={lastCMSelection:{from:-1,to:-1,line:-1,selectionContent:"",lineContent:""},lastCMId:""},ut="[Code Mirror]",dt=w.a.client.log.verbose,pt=Object(i.forwardRef)((function(t,n){var e=function(){var t=n.current;return t&&t.state?t:null},d=Object(i.useRef)(null);Object(i.useEffect)((function(){!function(){var n,o=e();if(!o)return!1;if(t.value===d.current)return!1;if("loading..."===t.value)return!1;if((null===(n=o.view)||void 0===n?void 0:n.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 m=Object(i.useState)(!1),w=Object(o.a)(m,2),j=w[0],x=w[1];Object(i.useEffect)((function(){x(!1)}),[t.file.path]),Object(i.useEffect)((function(){!0===j&&k()}),[t.value]);var k=Object(V.a)((function(){var t=e();g.a.foldAllChildren(t)}),500),_=Object(i.useRef)(t.value);Object(i.useEffect)((function(){_.current=t.value}),[t.value]);var C=function(n,e){n!==t.value&&(d.current=n,_.current=n,t.onChange(n),Ht(!1),z.a.val=!1,A(),tt(n))};Object(i.useEffect)((function(){if(dt&&console.log(ut,"JUMP to line :",t.jumpToLine),-1!==t.jumpToLine){var n=e();if(n&&!(t.posY<=-10))try{g.a.scrollToLine(n,t.jumpToLine)}catch(o){console.log(o)}}}),[t.jumpToLine]);Object(i.useEffect)((function(){A()}),[t.value]),Object(i.useEffect)((function(){A()}),[]);var T=Object(b.a)(".window-id-".concat(t.windowId," .cm-content")).resizeState;Object(i.useEffect)((function(){A()}),[T,t.windowId]);var A=function(){var o=e();if(o){var i=g.a.getEditorInfos(o.view);n.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),L=F[0],Y=F[1];Object(i.useEffect)((function(){var t=null;Object(v.a)(r.a,(function(n){"Javascript"===n.name&&(t=n)})),Y(t)}),[]),Object(v.a)(r.a);var Q={base:a.markdownLanguage,codeLanguages:r.a,extensions:[]};L&&(Q.defaultCodeLanguage=L);var tt=Object(V.a)((function(t){t.includes("--table")&&!ot&&(it(!0),jt()),t.includes("--latex")&&!rt&&(pt(!0),jt()),t.includes("--spellcheck")&&!gt&&(ht(!0),jt()),!t.includes("--table")&&ot&&(it(!1),jt()),!t.includes("--latex")&&rt&&(pt(!1),jt()),!t.includes("--spellcheck")&>&&(ht(!1),jt())}),500),nt=Object(i.useState)(!1),et=Object(o.a)(nt,2),ot=et[0],it=et[1],ct=Object(i.useState)(!1),at=Object(o.a)(ct,2),rt=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)(0),vt=Object(o.a)(mt,2),wt=vt[0],Ot=vt[1],jt=function(){Ot(wt+1)};Object(i.useEffect)((function(){tt(t.value)}),[t.value]);var xt=Object(i.useState)([]),yt=Object(o.a)(xt,2),kt=yt[0],_t=yt[1],Ct=Object(i.useState)(""),Et=Object(o.a)(Ct,2),St=Et[0],Tt=Et[1],It=function(){var t=document.querySelector(".cm-tooltip");if(t){var n="translate(".concat(-Math.round(Pt.current[0]),"px, ").concat(-Math.round(Pt.current[1]-20),"px)");t.style.transform=n}},Pt=Object(i.useRef)([0,0]),Nt=function(){var e,o=(null===n||void 0===n||null===(e=n.current)||void 0===e?void 0:e.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&&(Pt.current=[a.left,a.top],It())}),100)}},At=Object(V.a)((function(){Rt.current&&Object(O.d)((function(n){var e;n.note.ui.editorAction.dispatch({type:"lineJump",windowId:t.windowId,lineJumpString:null===Rt||void 0===Rt||null===(e=Rt.current)||void 0===e?void 0:e.lineText,lineJumpType:"preview"})}))}),400),Rt=Object(i.useRef)(null);Object(i.useEffect)((function(){Object(O.d)((function(e){var o=[Object(l.a)({override:y(t.file,Nt)}),s.c.updateListener.of((function(t){t.docChanged&&It()})),s.c.domEventHandlers({scroll:function(t,e){if(S.d.curr.ui_editor_synced_title_scrolling){var o=n.current;if(o){var i=g.a.getScrolledLine(o);i.lineText.startsWith("#")&&(Rt.current=i,At())}}},wheel:function(n,e){var o=g.a.getEditorInfos(e);p.a.scrollScroller(t.windowId,o.currentPercentScrolled()),t.onScroll()}})];(e.userSettings.get("ui_editor_spellcheck")||gt)&&o.push(s.c.contentAttributes.of({spellcheck:"true"}));var i=t.pluginsConfig;i||(i={}),Object(U.a)(i.markdown)||(i.markdown=!0),Object(U.a)(i.linkPreview)||(i.linkPreview=!0);var c=e.userSettings;Object(f.a)();if(c.get("ui_editor_markdown_tags")&&o.push(Object(J.b)(t.file,t.windowId)),c.get("ui_editor_links_as_button")&&(o.push(Object(I.c)(t.file,t.windowId)),o.push(Object(P.c)(t.file,t.windowId,i.linkPreview))),c.get("ui_editor_markdown_table_preview")&&ot&&(o.push(Object(z.f)(t.file,t.windowId)),o.push(Object(z.g)(t.file,t.windowId)),o.push(Object(z.d)(t.file,t.windowId)),o.push(Object(z.c)(t.file,t.windowId))),c.get("ui_editor_markdown_latex_preview")&&rt&&Q.extensions.push(E.a),c.get("ui_editor_markdown_preview")){K.b||Object(K.a)();var r=Object(E.c)({file:t.file,onTitleClick:function(n,e){Object(O.d)((function(n){n.note.ui.editorAction.dispatch({type:"lineJump",windowId:t.windowId,lineJumpNb:e,lineJumpType:"preview"})}))}});o.push(r),c.get("ui_editor_markdown_enhanced_preview")&&(o.push(Object(G.a)(t.file,t.windowId)),o.push(Object($.a)(t.file,t.windowId)),o.push(Object(N.c)(t.file,t.windowId)),o.push(D(t.file,t.windowId)),o.push(Object(B.a)(t.file,t.windowId))),c.get("ui_editor_markdown_syntax")&&o.push(Object(Z.a)(t.file,t.windowId))}i.markdown?o.push(Object(a.markdown)(Q)):o.push(Object(z.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(Ft),o.push(X.A.of(" ")),c.get("ui_editor_inline_suggestion")&&o.push(lt),_t(o),Tt(u)}))}),[t.pluginsConfig,t.windowId,t.file.path,t.value,rt,ot,gt,wt]);var Ft=s.c.domEventHandlers({blur:function(n,e){t.onEvent("blur")},focus:function(n,e){t.onEvent("focus")}}),Lt=Object(i.useRef)(""),Mt=Object(i.useRef)([-9999,-9999]),Dt=Object(i.useState)([-9999,-9999]),zt=Object(o.a)(Dt,2),Bt=(zt[0],zt[1]),Wt=Object(i.useState)(!1),Ut=Object(o.a)(Wt,2),Ht=(Ut[0],Ut[1]),qt=Object(i.useRef)({from:-1,to:-1}),Vt=Object(i.useRef)({from:-1,to:-1}),Jt=[30,10],Gt=Object(i.useState)({x:0,y:0}),Kt=Object(o.a)(Gt,2),Yt=(Kt[0],Kt[1],Object(V.a)((function(n){var o,i=null===(o=e())||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:n.from,to:n.to,fromPx:(null===a||void 0===a?void 0:a.top)||0,toPx:(null===a||void 0===a?void 0:a.bottom)||0})}n.from!==n.to&&Object(H.a)(n.from)&&Object(H.a)(n.to)&&(n.from<0||n.to<0||JSON.stringify(Vt.current)!==JSON.stringify(n)&&(Vt.current=Object(q.a)(n),Zt()))}),200)),$t=function(t,n){"up"===t?Lt.current=t:"down"===t?Ht(!1):"move"===t&&(Mt.current=[n.clientX,n.clientY])},Zt=function(){Object(O.d)((function(t){if(t.userSettings.get("ui_editor_ai_text_selection")){Ht(!0);var n=Mt.current;Bt([n[0]+Jt[0],n[1]+Jt[1]])}}))},Xt=Object(i.useMemo)((function(){return Object(M.c)(c.a.Fragment,null,Object(M.c)(u.a,{value:"",ref:n,theme:Object(h.a)(),onChange:C,onUpdate:function(n){!function(n){var e=n.state.selection.ranges[0];qt.current=e;var o=n.state.doc.sliceString(e.from,e.to),i=n.state.doc.lineAt(e.from),c=i.text;st.lastCMSelection={from:e.from,to:e.to,line:i.number,selectionContent:o,lineContent:c},st.lastCMId=t.windowId,Yt(e)}(n)},basicSetup:{foldGutter:!0,dropCursor:!1,allowMultipleSelections:!1,indentOnInput:!1,closeBrackets:!1,history:!0,bracketMatching:!1,lineNumbers:!1},extensions:kt}))}),[t.value,kt]);return Object(M.c)(c.a.Fragment,null,Object(M.c)("div",{className:"codemirror-editor-wrapper ".concat(St," "),onClick:function(t){$t("up",t)},onMouseDown:function(t){$t("down",t)},onMouseMove:function(t){return $t("move",t)}},Object(M.c)("div",{className:"foldall-wrapper ".concat(Object(f.a)()),onClick:function(t){!function(){var t=e();j?g.a.unfoldAllChildren(t):g.a.foldAllChildren(t,!1),x(!j)}()}},Object(M.c)(W.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")})),Xt))})),ft=c.a.memo(pt,(function(t,n){var e=!0;return t.forceRender!==n.forceRender&&(e=!1),t.jumpToLine!==n.jumpToLine&&(e=!1),t.file.path!==n.file.path&&(e=!1),e})),bt=function(t){t||(t={});var n=t.searchBottom;return n||(n=0),Object(f.c)("mobile")&&(n=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(n,"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(Y.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(Y.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(Y.a)(2),"px;\n\t\t\t}\n\t\t\t&.h4 {\n\t\t\t\t\tfont-size: ").concat(Object(Y.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(Y.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(Y.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(E.d)(),"\n\t\n\t// // FILE RESSOURCE PREVIEW\n\t// ").concat(Object(T.b)(),"\n\t\n\t// // PREVIEW LINK\n\t// ").concat(Object(P.b)(),"\n\t\n\t\n\t// ").concat(Object(z.e)(),"\n\t")}},98:function(t,n,e){"use strict";e.d(n,"a",(function(){return o}));var o=function(t){var n="none",e=t.split(".");return"7z"===(n=e[e.length-1].split("?")[0])&&(n="d7z"),n.length>10&&(n="none"),n}},99:function(t,n,e){"use strict";e.d(n,"a",(function(){return r})),e.d(n,"f",(function(){return s})),e.d(n,"g",(function(){return u})),e.d(n,"d",(function(){return d})),e.d(n,"b",(function(){return p})),e.d(n,"c",(function(){return f})),e.d(n,"e",(function(){return b}));var o=e(29),i=e(10),c=e(45),a=e(25),r={val:!1},l=r,s=function(t,n){return Object(c.a)({file:t,windowId:n,pattern:/\|/gim,classWrap:function(t){return"md-table-limiter"}})},u=function(t,n){return Object(c.a)({file:t,windowId:n,pattern:/t1.+t2/gim,classWrap:function(t){return"ttt4"}})},d=function(t,n){return Object(c.a)({file:t,windowId:n,pattern:o.a.mdTableCell,classWrap:function(t){var n=t[0].trim();return n&&"-"===n||n&&"-|"===n||n&&n.includes("[")||n.includes("]")||n&&!n.includes("|")?"":"md-table-cell"}})},p=function(t,n){return Object(c.a)({file:t,windowId:n,pattern:o.a.mdTitle,classWrap:function(t){var n=t[1].length;return"md-title-wrapper level-".concat(n)}})},f=function(t,n){return Object(c.a)({file:t,windowId:n,pattern:o.a.mdTableLine,classWrap:function(t){var n=t[0].trim();if(n&&n.includes("[")||n.includes("]"))return"";if(n&&n.startsWith("-"))return"";n.startsWith("|")&&(n=n.substring(1)),n.endsWith("|")&&(n=n.substring(0,n.length-1));var e=n.split("|").length;return l.val=!l.val,"md-table-line md-table-".concat(e," ").concat(l.val?"even":"")}})},b=function(){for(var t="",n=0;n<30;n++){var e=Math.floor(100/n);t+="\n\t\t\t\t&.md-table-".concat(n," span.md-table-cell{\n\t\t\t\t\t\twidth: calc(").concat(e,"% - 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")}}},[[568,11,12]]]);
|
|
1
|
+
(this["webpackJsonptiro-notes-client"]=this["webpackJsonptiro-notes-client"]||[]).push([[10],{10:function(t,n,e){"use strict";e.d(n,"a",(function(){return w}));e(429),e(430),e(431),e(432);var o=e.p+"static/media/deco-bg-map.7ca9103b.png",i=e.p+"static/media/file-solid.6415173e.svg",c=e.p+"static/media/compact-disc-solid.55b6e50c.svg",a=e.p+"static/media/file-pdf-solid.0a9d75fe.svg",r=e.p+"static/media/file-word-solid.9228e1ff.svg",l=e.p+"static/media/file-code-solid.62b467ac.svg",s=e.p+"static/media/book-solid.87f5b737.svg",u=e.p+"static/media/file-excel-solid.217d73db.svg",d=e.p+"static/media/file-video-solid.312288cf.svg",p=e.p+"static/media/file-audio-solid.a76f99f0.svg",f=e.p+"static/media/file-zipper-solid.7db57917.svg",b=e.p+"static/media/file-powerpoint-solid.4d969453.svg",g=e.p+"static/media/link-solid.7b689dbd.svg",h=e.p+"static/media/globe-africa-solid.0ad34146.svg",m=e.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"}}},103:function(t,n,e){"use strict";e.d(n,"b",(function(){return l})),e.d(n,"a",(function(){return p})),e.d(n,"e",(function(){return f})),e.d(n,"d",(function(){return b})),e.d(n,"c",(function(){return h}));var o=e(111),i=e(26),c=e(17),a=null,r=null,l=!1,s="[LATEX]",u=c.a.client.log.verbose,d=function(t,n){var e=document.createElement("script");e.src=t,e.crossorigin="anonymous",document.body.appendChild(e),e.onload=function(){n()}},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 n=document.createElement("link");n.type="text/css",n.rel="stylesheet",n.href=t,document.body.appendChild(n)}("https://cdn.jsdelivr.net/npm/katex@0.15.2/dist/katex.css")},f=function(t){var n=t=t.replaceAll("$","");if(!a)return n;try{window.ka=a,n=a.renderToString(t)}catch(e){u&&console.log("LATEX ERR:",e)}return n},b=Object(o.a)((function(){u&&console.log(s,"REFRESH"),g(".render-latex")}),100),g=function(t){if(r){var n=document.querySelectorAll(t);if(!n)return console.warn(s,"no el found :",t);u&&console.log(s,n),Object(i.a)(n,(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"}},106:function(t,n,e){"use strict";e.d(n,"b",(function(){return j})),e.d(n,"a",(function(){return y})),e.d(n,"c",(function(){return k}));var o=e(4),i=e(0),c=e(61),a=e(20),r=e(53),l=e(67),s=e(9),u=e(59),d=e(38),p=e(64),f=e(10),b=e(56),g=e(18),h=e(28),m=e(30),v=e(12),w=e(25),O=e(1),j=function(t){var n=localStorage.getItem("settings-".concat(t))||"";return Object(b.a)(n,[['"',""]])},x=function(t){return"<br/> <br/> Default value: ".concat(h.a[t].toString().replaceAll("\n","<br/>"))},y=function(t){var n="<br/> Requires interface reload",e=Object(c.a)("settings-backend-port",-1),f=Object(o.a)(e,2),b=f[0],v=f[1],w=Object(c.a)("settings-backend-protocol","same"),j=Object(o.a)(w,2),y=(j[0],j[1],Object(i.useContext)(s.a)),k=a.a.settingsPopup,_=[];if(y){var C=y.userSettings,E="".concat(window.location.protocol,"//"),S="".concat(E).concat(y.status.ipsServer.getLocal()).concat(p.a.global.port);"https://api.qrserver.com/v1/create-qr-code/?size=400x400&margin=50&data=".concat(S);_=[{title:"Privacy",fields:[{type:"checkbox",title:"Disable notification popups",expl:"Force notification popups to not appear on the interface"+n,var:C.get("view_disable_notification_popups"),modifier:function(t){L(!0),C.set("view_disable_notification_popups",t)}},{type:"checkbox",title:"Work mode ",expl:"Only displays notifications and omnibar history items related to your work",var:C.get("privacy_work_mode_enable"),modifier:function(t){L(!0),C.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(x("privacy_work_mode_filters")),var:C.get("privacy_work_mode_filters"),modifier:function(t){C.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:C.get("server_activity_logging_enable"),modifier:function(t){C.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:C.get("plugins_marketplace_url"),modifier:function(t){C.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:function(){},onCustomHtmlClick:function(){Object(m.b)("cache","clean_cache")}}]},{title:"layout",fields:[{type:"text",title:"Main color",expl:"A color string like 'orange' or 'blue' or an Hex string like '#E86666' (tiro red) or '#729fc4'",var:C.get("ui_layout_colors_main"),modifier:function(t){C.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:C.get("ui_layout_colors_main_font"),modifier:function(t){C.set("ui_layout_colors_main_font",t)}},{type:"number",title:"Font size (desktop)",expl:"General font size for desktop"+x("ui_layout_general_font_size")+n,var:C.get("ui_layout_general_font_size"),modifier:function(t){C.set("ui_layout_general_font_size",t),L(!0)}},{type:"text",title:"Font family for interface",expl:"Font family for interface"+x("ui_layout_font_family_interface")+n,var:C.get("ui_layout_font_family_interface"),modifier:function(t){C.set("ui_layout_font_family_interface",t),L(!0)}},{type:"text",title:"Font family for editor",expl:"Font family for editor"+x("ui_layout_font_family_editor")+n,var:C.get("ui_layout_font_family_editor"),modifier:function(t){C.set("ui_layout_font_family_editor",t),L(!0)}},{type:"checkbox",title:"Enable Background Image",expl:"Enable Background Image"+n,var:C.get("ui_layout_background_image_enable"),modifier:function(t){C.set("ui_layout_background_image_enable",t),L(!0)}},{type:"checkbox",title:"Enable Background Video",expl:"Enable Background Video"+n,var:C.get("ui_layout_background_video_enable"),modifier:function(t){C.set("ui_layout_background_video_enable",t),L(!0)}},{type:"text",title:"Background image/video url",expl:"Background image/video url.<br>- it can start with http. <br> - 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 <br>(ex: 'static/_new/useful/.resources/wintersolstice.jpg'). <br> - you can add a youtube video/webcam stream in background by using the embed url like 'https://www.youtube-nocookie.com/embed/dQw4w9WgXcQ' or 'https://www.skaping.com/batz-sur-mer/plage-valentin' or even websites",var:C.get("ui_layout_background_image"),modifier:function(t){C.set("ui_layout_background_image",t),L(!0)}},{type:"number",title:"Windows opacity",expl:"If Background image, how opaque should the windows be (between 0 and 100)"+x("ui_layout_background_image_window_opacity")+n,var:C.get("ui_layout_background_image_window_opacity"),max:100,min:0,modifier:function(t){C.set("ui_layout_background_image_window_opacity",t),L(!0)}},{type:"number",title:"Active Windows opacity",expl:"If Background image, how opaque should the active windows be (between 0 and 100)"+x("ui_layout_background_image_window_opacity_active")+n,var:C.get("ui_layout_background_image_window_opacity_active"),max:100,min:0,modifier:function(t){C.set("ui_layout_background_image_window_opacity_active",t),L(!0)}},{type:"number",title:"background video width",expl:"background video width in percent (between 0 and 200)"+x("ui_layout_background_video_width")+n,var:C.get("ui_layout_background_video_width"),max:200,min:0,modifier:function(t){C.set("ui_layout_background_video_width",t),L(!0)}},{type:"number",title:"background video height",expl:"background video height percent (between 0 and 200)"+x("ui_layout_background_video_height")+n,var:C.get("ui_layout_background_video_height"),max:200,min:0,modifier:function(t){C.set("ui_layout_background_video_height",t),L(!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:C.get("ui_layout_shortcuts_panel"),modifier:function(t){C.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:C.get("tts_custom_engine_enabled"),modifier:function(t){C.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}}.\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:C.get("tts_custom_engine_command"),modifier:function(t){C.set("tts_custom_engine_command",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:C.get("tts_sentences_per_part"),modifier:function(t){C.set("tts_sentences_per_part",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:C.get("tts_preload_parts"),modifier:function(t){C.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:C.get("tts_price_per_word"),modifier:function(t){C.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"+n,var:C.get("ui_editor_ai_text_selection"),modifier:function(t){L(!0),C.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:C.get("ui_editor_ai_command"),modifier:function(t){C.set("ui_editor_ai_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"+n,var:C.get("ui_editor_inline_suggestion"),modifier:function(t){L(!0),C.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"+n,var:C.get("ui_editor_search_highlight_enable"),modifier:function(t){L(!0),C.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:C.get("ui_editor_search_highlight_url"),modifier:function(t){C.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"+n,var:C.get("ui_editor_synced_title_scrolling"),modifier:function(t){L(!0),C.set("ui_editor_synced_title_scrolling",t)}},{type:"checkbox",title:"Markdown Tags",expl:"Displays #tag as clickable tag you can interact with "+n,var:C.get("ui_editor_markdown_tags"),modifier:function(t){L(!0),C.set("ui_editor_markdown_tags",t)}},{type:"checkbox",title:"Markdown Preview",expl:"Markdown preview "+n,var:C.get("ui_editor_markdown_preview"),modifier:function(t){L(!0),C.set("ui_editor_markdown_preview",t)}},{type:"checkbox",title:"Enhanced Markdown Preview",expl:"Enhanced Markdown Preview for files, documents, date etc"+n,var:C.get("ui_editor_markdown_enhanced_preview"),modifier:function(t){L(!0),C.set("ui_editor_markdown_enhanced_preview",t)}},{type:"checkbox",title:"Enhanced Markdown Syntax",expl:"Enhance Markdown Syntax (**bold**, ~~text~~, and other)",var:C.get("ui_editor_markdown_syntax"),modifier:function(t){L(!0),C.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."+n,var:C.get("ui_editor_markdown_table_preview"),modifier:function(t){L(!0),C.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."+n,var:C.get("ui_editor_links_as_button"),modifier:function(t){L(!0),C.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_$"+n,var:C.get("ui_editor_markdown_latex_preview"),modifier:function(t){L(!0),C.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>"+n,var:C.get("ui_editor_spellcheck"),modifier:function(t){L(!0),C.set("ui_editor_spellcheck",t)}},{type:"checkbox",title:"Image title",expl:"Show image title on interface and exports"+n,var:C.get("ui_editor_show_image_title"),modifier:function(t){L(!0),C.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"+n,var:C.get("ui_editor_live_watch"),modifier:function(t){L(!0),C.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:C.get("keyboard_shortcuts_textarea"),modifier:function(t){C.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(x("export_pandoc_cli_options")),var:C.get("export_pandoc_cli_options"),modifier:function(t){C.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:function(){},onCustomHtmlClick:function(){}}]},{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:C.get("users_viewer_user_enable"),modifier:function(t){C.set("users_viewer_user_enable",t,{writeInSetupJson:!0})}},{type:"text",title:"Viewer user password",expl:'Define the "viewer" user password',var:C.get("users_viewer_user_password"),modifier:function(t){C.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:C.get("demo_mode_enable"),modifier:function(t){C.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:function(){},onCustomHtmlClick:function(){Object(g.a)(),t.onClose(),Object(s.d)((function(t){t.folders.get(["/"],(function(){}))}))}}]},{title:"Advanced",fields:[{type:"text",var:b,title:k.backend.port,expl:k.backend.portExpl,modifier:v},{type:"textarea",title:"Options for Image compression",expl:"Modify default image compression settings ".concat(x("advanced_image_compression_settings")),var:C.get("advanced_image_compression_settings"),modifier:function(t){C.set("advanced_image_compression_settings",t)}}]},{title:"Beta",fields:[{type:"checkbox",title:"Plugins Marketplace",expl:"Enable the plugin marketplace system",var:C.get("beta_plugins_marketplace"),modifier:function(t){C.set("beta_plugins_marketplace",t)}}]}]}var T=Object(u.a)("config-panels-opened",[],{editIfNotLoaded:!0}),I=Object(o.a)(T,3),P=I[0],N=I[1],A=(I[2],Object(i.useState)(!1)),R=Object(o.a)(A,2),F=R[0],L=R[1];return Object(O.c)("div",{className:"settings-popup-wrapper"},Object(O.c)(r.a,{title:"".concat(k.title),onClose:function(){t.onClose()}},_.map((function(t,n){return Object(O.c)("div",{className:"settings-panel"},Object(O.c)("h3",{onClick:function(){!function(t){var n=Object(d.a)(P);n[t]=!n[t],N(n)}(n)}},Object(O.c)("div",{className:"arrow"},P[n]?"\u25bc":"\u25ba"),t.title),Object(O.c)("div",{className:"fields-wrapper ".concat(P[n]?"active":"")},t.fields.map((function(t){return Object(O.c)("div",{className:"field-wrapper"},Object(O.c)("div",{className:"input-and-html-wrapper"},"none"===t.type&&Object(O.c)("span",null,t.title),"none"!==t.type&&Object(O.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:function(n){"checkbox"!==t.type&&t.modifier(n)},onCheckedChange:function(n){"checkbox"===t.type&&t.modifier(n)}}),t.customHtml&&Object(O.c)("div",{className:"custom-html-wrapper",onClick:function(n){t.onCustomHtmlClick&&t.onCustomHtmlClick()},dangerouslySetInnerHTML:{__html:t.customHtml}}),Object(O.c)("div",{className:"explanation",dangerouslySetInnerHTML:{__html:t.expl||"woop"}})))}))))})),F&&Object(O.c)("button",{className:"submit-button reload-btn",onClick:function(t){window.location.reload()}},"Reload App")))},k=function(){return"\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")}},108:function(t,n,e){"use strict";e.d(n,"c",(function(){return c})),e.d(n,"a",(function(){return a})),e.d(n,"b",(function(){return r})),e.d(n,"d",(function(){return u}));var o=e(175),i=e.n(o),c=function(t,n){var e=i.a.generateRSAKey(n,1024),o=i.a.publicKeyString(e);return i.a.encrypt(t,o)},a=function(t,n){var e=i.a.generateRSAKey(n,1024);return i.a.decrypt(t,e)},r={encryptText:c,decryptText:a,encryptUrlParam:function(t,n){var e=c(t,n);return e.cipher&&(e.cipher=encodeURIComponent(e.cipher)),e},decryptUrlParam:function(t,n){return t=decodeURIComponent(t),a(t,n)}},l=function(t,n){var e=n.replace(t,"").length,o=n.length;return Math.round(e/o*100)/100},s=function(t){return t>0&&t<=.9},u=function(t){var n=!1,e={nb:l(/[^0-9]/g,t),up:l(/[^A-Z]/g,t),low:l(/[^a-z]/g,t),spe:l(/[^\/\=\?\+]/g,t)},o=s(e.nb)&&s(e.up)&&s(e.low)&&e.spe>0,i=(t.trim().endsWith("==")||t.trim().endsWith("="),/^[a-zA-Z0-9\/\=\?\+]+$/.test(t)),c=t.length>100;return i&&o&&c&&(n=!0),n}},117:function(t,n,e){"use strict";e.d(n,"c",(function(){return g})),e.d(n,"a",(function(){return m})),e.d(n,"b",(function(){return v}));var o=e(29),i=e(43),c=e(45),a=e(18),r=e(26),l=e(9),s=e(33),u=e(212),d=e(27),p=e(28),f=e(46),b=function(t){if(t){var n=t.dataset.filePath,e=t.dataset.src;Object(l.d)((function(t){t.file.getContent(n,(function(o){var i=Object(u.a)(o,Object(d.e)(n));if(!(i.length<1)){var c=[],a=0;Object(r.a)(i,(function(t,n){Object(f.b)(e).includes(Object(f.b)(t.url))&&(a=n),c.push(t.url)})),t.ui.lightbox.open(a,c)}}))}))}},g=function(t,n){return Object(c.a)({file:t,windowId:n,pattern:o.a.image2,replacement:function(n){var e=n.matchs,o=document.createElement("div");return o.innerHTML=h(e[0],e[2],e[1],e[5],t),o}})},h=function(t,n,e,o,c){"image"!==e&&(e='<div class="mdpreview-source">'.concat(e,"</div>")),p.d.curr.ui_editor_show_image_title||(e="");var r=n.startsWith("http")?n:"".concat(Object(i.a)(c.folder),"/").concat(n).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(e)},m=function(t,n,e){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=n.startsWith("http")?n:"".concat(Object(i.a)(e.folder),"/").concat(n).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(e.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"}},12:function(t,n,e){"use strict";e.d(n,"e",(function(){return o})),e.d(n,"c",(function(){return i})),e.d(n,"b",(function(){return c})),e.d(n,"d",(function(){return a})),e.d(n,"a",(function(){return r}));var o=function(){var t,n=!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)))&&(n=!0),n},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,n="desktop";return l()||t<1e3&&(n="tablet"),t<500&&(n="mobile"),n},l=function(){return!s()},s=function(){var t,n=!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)))&&(n=!0),n}},122:function(t,n,e){"use strict";e.d(n,"b",(function(){return f})),e.d(n,"a",(function(){return g})),e.d(n,"c",(function(){return v})),e.d(n,"d",(function(){return w}));var o=e(3),i=e(6),c=e(7),a=e(21),r=e(22),l=e(13),s=e(8),u=e(5),d=e(103),p=e(117),f={LatexMdEl:u.a.define()},b={resolve:"LatexMdEl"},g={defineNodes:["LatexMdEl"],parseInline:[{name:"MdCustomTagsParser",parse:function(t,n,e){return 36===n?t.addDelimiter(b,e,e+1,!0,!0):-1},after:"Emphasis"}],props:[Object(u.c)({LatexMdEl:f.LatexMdEl})]},h=function(t){Object(a.a)(e,t);var n=Object(r.a)(e);function e(t){var o;return Object(i.a)(this,e),(o=n.call(this)).str=t,o}return Object(c.a)(e,[{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 n=Object(d.e)(this.str);return t.innerHTML=' <div class="latex-height" >'.concat(n,"</div> "),t}}]),e}(l.g);function m(t,n){var e,i=[],c=Object(o.a)(t.visibleRanges);try{for(c.s();!(e=c.n()).done;){var a=e.value,r=a.from,u=a.to;Object(s.F)(t.state).iterate({from:r,to:u,enter:function(n){if("LatexMdEl"===n.name){var e=t.state.doc.sliceString(n.from,n.to),o=l.a.widget({widget:new h(e),side:1});i.push(o.range(n.from))}}})}}catch(d){c.e(d)}finally{c.f()}return l.a.set(i)}var v=function(t){return l.f.fromClass(function(){function n(e){Object(i.a)(this,n),this.decorations=void 0,this.decorations=m(e,t.file)}return Object(c.a)(n,[{key:"update",value:function(n){(n.docChanged||n.viewportChanged)&&(this.decorations=m(n.view,t.file))}}]),n}(),{decorations:function(t){return t.decorations},eventHandlers:{mousedown:function(n,e){var o=n.target,i=e.posAtCoords({x:n.clientX,y:n.clientY});if(i){var c=e.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 ")}},124:function(t,n,e){"use strict";e.d(n,"c",(function(){return j})),e.d(n,"a",(function(){return y})),e.d(n,"b",(function(){return k})),e.d(n,"d",(function(){return _}));var o=e(4),i=e(0),c=e.n(i),a=e(38),r=e(673),l=e(26),s=e(373),u=e.n(s),d=(e(543),e(544),e(217)),p=e(161),f=e(219),b=e(140),g=e(10),h=e(47),m=e(9),v=e(12),w=e(86),O=e(1),j={rows:2,cols:4},x={m:10,rows:j.rows,cols:j.cols,decalBottom:10},y=function(t){var n=Object(i.useState)([]),e=Object(o.a)(n,2),s=e[0],g=e[1],y=function(t){g(t),k.current=t},k=Object(i.useRef)([]),_=Object(i.useState)([]),C=Object(o.a)(_,2),E=C[0],S=C[1],T=Object(i.useRef)();Object(i.useEffect)((function(){t.grid&&t.grid.layout&&(S(t.grid.layout),y(t.grid.content))}),[t.refresh]),Object(i.useEffect)((function(){W(),L()}),[E]);var I=function(n,e){t.onGridUpdate({layout:n,content:e})},P=function(){var t=s[0].file;if(t){var n=function(t){for(var n=[],e=j,o=function(o){for(var i=[],c=function(n){var e=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===n&&r===o&&(e=1)}})),i.push(e)},a=0;a<e.cols;a++)c(a);n.push(i)},i=0;i<e.rows;i++)o(i);for(var c=[-1,-1],a=[-1,-1],r=0;r<e.rows;r++)for(var s=0;s<e.cols;s++)0===n[r][s]&&-1===c[0]&&-1===c[1]&&(c[0]=s,c[1]=r),0===n[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}}(E),e=Object(p.a)({file:t,w:n.w,h:n.h,x:n.x,y:n.y}),o=Object(a.a)(E);o.push(e.layout),V(o)&&(S(o),setTimeout((function(){var t=Object(a.a)(s);t.push(e.content);var n=U(e.content.i,t);y(n),I(o,n)})),I(o,s))}},N=Object(i.useState)(!1),A=Object(o.a)(N,2),R=A[0],F=A[1],L=function(){F(E.length>1)},M=Object(i.useState)(!1),D=Object(o.a)(M,2),z=D[0],B=D[1],W=function(){var t=0,n=x.cols*x.rows;Object(l.a)(E,(function(n){t+=n.w*n.h})),B(t!==n)},U=function(t,n){var e=Object(a.a)(n);return Object(l.a)(e,(function(n){n.active=n.i===t})),e},H=function(t,n){Object(m.d)((function(n){n.tabs.updateTab("activateTabWindow","activeTab",t)}))},q=function(t){T.current=Object(a.a)(t)},V=function(t){for(var n=!0,e=0;e<t.length;e++){var o=t[e];o.y>1&&(n=!1),o.h>1&&o.y>0&&(n=!1)}return n};Object(f.b)(),Object(i.useEffect)((function(){var t=J.current;if(t)return t.addEventListener("resize",(function(){})),function(){t.removeEventListener("resize",(function(){}))}}),[]);var J=Object(i.useRef)(null),G={width:300,height:300};J.current&&(G.width=J.current.clientWidth,G.height=J.current.clientHeight-x.decalBottom);Object(i.useContext)(m.a);var K=function(n,e){return function(o,i){if("windowActiveStatus"===o)n&&!n.active&&H(n.i,n.file);else if("windowViewChange"===o){var c;if(null===i||void 0===i||!i.view||!t.grid.content[e].file)return;!function(t,n){var e=Object(a.a)(s);e[n].view=t,y(e),I(E,e)}(null===i||void 0===i?void 0:i.view,e);var r=(null===(c=t.grid.content[e].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,n,e){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(){P()}},{icon:"faPlus",title:"Delete Window",class:"delete-button",action:function(){!function(t){var n=Object(r.a)(Object(a.a)(E),(function(n){return n.i!==t}));setTimeout((function(){var e=Object(r.a)(Object(a.a)(s),(function(n){return n.i!==t}));y(e),I(n,e)})),I(n,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:J},"mobile"!==Object(v.a)()&&Object(O.c)(u.a,{className:"draggable-grid",autoSize:!1,layout:E,onLayoutChange:function(t){var n=Object(a.a)(t);if(V(n)){var e=n;q(e),S(e),I(e,s)}else{if(!T.current)return;var o=function(t){var n=t,e=j,o=null;console.log("0035",n),(2===n.length&&(n[0].w===e.cols-1&&n[0].h===e.rows&&n[1].w===e.cols/2&&n[1].h===e.rows||n[1].w===e.cols-1&&n[1].h===e.rows&&n[0].w===e.cols/2&&n[0].h===e.rows)||2===n.length&&(n[0].w===e.cols-1&&n[0].h===e.rows&&n[1].w===e.cols/2&&n[1].h===e.rows||n[1].w===e.cols-1&&n[1].h===e.rows&&n[0].w===e.cols/2&&n[0].h===e.rows))&&(console.log("[ALT LAYOUT] 0035 found i|iii to ii|ii"),o=Object(a.a)(t),Object(l.a)(o,(function(t,n){t.w=e.cols/2,t.y=0,1===n&&(t.x=e.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)})),S(c),I(c,s)}},cols:x.cols,compactType:"horizontal",useCSSTransforms:!1,rowHeight:G.height/x.rows-x.m*(x.rows+1),draggableHandle:".drag-handle",width:G.width,margin:[x.m,x.m]},E.map((function(n,e){return Object(O.c)("div",{key:n.i,className:" ".concat(s[e]&&s[e].active?"active":""," window-wrapper "),onClick:function(){s[e]&&!s[e].active&&H(s[e].i,s[e].file)},onMouseEnter:function(){}},Y(n,0,t.grid.content[e]),Object(O.c)("div",{className:"window-editor-wrapper-wrapper"},Object(O.c)(b.a,{noteParentType:"grid",content:t.grid.content[e]&&t.grid.content[e],onLayoutUpdate:K(n,e),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")},_=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")}},127:function(t,n,e){"use strict";e.d(n,"d",(function(){return h})),e.d(n,"c",(function(){return m})),e.d(n,"b",(function(){return w})),e.d(n,"a",(function(){return O}));var o=e(15),i=e(11),c=e(4),a=e(0),r=e.n(a),l=e(59),s=e(91),u=e(38),d=e(286),p=e(12),f=e(27),b=e(35),g=e(86),h=function(){return window.innerWidth},m=function(){return window.innerHeight-35},v=1e3,w=function(t){var n=Object(l.a)("floatingPanelsConfig3",[],{history:!1,onInitialRefresh:function(t){x.current=t,"mobile"===Object(p.a)()&&(x.current=x.current.filter((function(t){return"mobile"!==t.device}))),y(x.current)},debouncedSave:5e3}),e=Object(c.a)(n,3),w=e[0],O=e[1],j=e[2],x=r.a.useRef([]),y=function(t){x.current=t,O(t)};Object(a.useEffect)((function(){x.current=w}),[w]);var k=function(t,n){var e,o,i=Object(p.e)()?2:30,c=Object(p.e)()?2:15,a=window.innerWidth-c-4,r=window.innerHeight-4-i;switch(n){case"full-center":case"full":e=c,o=2;break;case"half-right":case"right":e=window.innerWidth/2+c/2,o=2,a/=2;break;case"half-left":case"left":e=c,o=2,a/=2;break;case"full-bottom":case"bottom":e=c,o=window.innerHeight/2-i/2,r/=2;break;case"full-top":case"top":e=c,o=2,r/=2;break;case"bottom-left":e=c,o=window.innerHeight/2-i/2,a/=2,r/=2;break;case"bottom-right":e=window.innerWidth/2+c/2,o=window.innerHeight/2-i/2,a/=2,r/=2;break;case"top-left":e=c,o=2,a/=2,r/=2;break;case"top-right":e=window.innerWidth/2+c/2,o=2,a/=2,r/=2}return t.position={x:e,y:o},t.size={width:a,height:r},t},_=function(t){var n=x.current.find((function(n){var e;return n.file.path===(null===t||void 0===t||null===(e=t.file)||void 0===e?void 0:e.path)&&"visible"!==n.status}));if(n)P(n.id);else{var e=x.current.filter((function(t){return!t.status.includes("hidden")})),o="mobile"===Object(p.a)()?10:100,c=window.innerWidth/2-o;"mobile"===Object(p.a)()&&(c=window.innerWidth-2*o);var a=window.innerHeight/1.2-o;t.id&&(t.id=Object(p.a)()+"-"+t.id);var r=Object(i.a)({position:{x:o+20*e.length,y:o+20*e.length},size:{width:c,height:a},status:"visible",file:Object(s.a)(),view:"editor",id:Math.random().toString(36).substring(7),zIndex:v,device:Object(p.a)(),orderPosition:e.length},t);if(t.layout){var l=k(r,t.layout);r.position=l.position,r.size=l.size}var u=function(t){console.log("".concat("[FLOATING PANELS]"," createPanel"),t);var n=x.current.find((function(n){return n.id===t.id}));n&&(t.position=n.position,t.size=n.size,E(t.id));var e=x.current.filter((function(n){return n.id!==t.id}));e.push(t),y(e),F(t.id,"first"),T(t.id)};t.file&&!t.view?Object(g.a)(t.file.path).then((function(t){t&&(r.view=t),u(r)})):u(r)}},C=function(t){var n=x.current.map((function(n){return n.id===t.id?t:n}));y(n)},E=function(t){var n=x.current.filter((function(n){return n.id!==t}));n=S(n),y(n)},S=function(t){var n=t.filter((function(t){return"visible"===t.status})),e=Math.max.apply(Math,Object(o.a)(n.map((function(t){return t.zIndex||0})))),i=n.find((function(t){return t.zIndex===e}));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},T=function(t){var n=Math.max.apply(Math,Object(o.a)(x.current.map((function(t){return t.zIndex||0})))),e=x.current.findIndex((function(n){return n.id===t}));if(-1!==e){var i=Object(u.a)(x.current)[e];i.zIndex=n+1;var c=Object(u.a)(x.current);if(c.forEach((function(t){t.isTopWindow=!1})),i.zIndex=n+1,i.isTopWindow=!0,c[e]=i,y(c),n>v+2*x.current.length){var a=Object(u.a)(x.current);a.forEach((function(t){t.zIndex=t.zIndex-x.current.length})),y(a)}}},I=function(t){y(Object(u.a)(t))},P=function(t){if(!t){var n=x.current.filter((function(t){return"visible"!==t.status})),e=n.find((function(t){return t.orderPosition===Math.min.apply(Math,Object(o.a)(n.map((function(t){return t.orderPosition||0}))))}));if(!e)return;t=e.id}var i=x.current.find((function(n){return n.id===t}));i&&(i.status="visible",C(i),T(i.id),F(i.id,"first"),M(i.id))},N=function(t){var n=Object(u.a)(x.current);n.find((function(n){return n.id===t})).status="minimized";n.find((function(n){return n.id===t}));n=S(n),y(n)},A=function(){var t=Object(u.a)(x.current),n=0;t.forEach((function(t){"visible"===t.status&&(t.zIndex=v+n,t.position={x:100+20*n,y:100+20*n},t.size={width:320,height:200},n++)})),I(t)},R=r.a.useRef("grid"),F=function(t,n){var e=Object(u.a)(x.current.find((function(n){return n.id===t})));if(e){if("last"===n){var i=Math.max.apply(Math,Object(o.a)(x.current.map((function(t){return t.orderPosition||0}))));n=i+1}if("first"===n){var c=Math.min.apply(Math,Object(o.a)(x.current.map((function(t){return t.orderPosition||0}))));n=c-1}e.orderPosition=n,C(e)}},L=function(t,n){var e=n||{},o=e.idpanel,i=e.layout,c=e.searchedString,a=e.replacementString;o||(o=Math.random().toString(36).substring(7)),o&&(o=Object(p.a)()+"-"+o);var r=Object(u.a)(x.current.find((function(t){return t.id===o})));if(r)null!==n&&void 0!==n&&n.noteView&&(r.view=n.noteView),null!==n&&void 0!==n&&n.view&&(r.view=n.view),"minimized"===r.status&&(r.status="visible"),"hidden"===r.status&&(r.status="visible"),r.file=Object(f.e)(t),c&&(r.searchedString=c),a&&(r.replacementString=a),C(r),T(null===r||void 0===r?void 0:r.id);else{var l={id:o,type:"file",file:Object(f.e)(t)};i&&(l.layout=i),c&&(l.searchedString=c),a&&(l.replacementString=a),null!==n&&void 0!==n&&n.noteView&&(l.view=n.noteView),null!==n&&void 0!==n&&n.view&&(l.view=n.view),_(l)}},M=function(t){var n=Object(u.a)(x.current.find((function(n){return n.id===t})));n&&(n.position.x+n.size.width>window.innerWidth&&(n.position.x=0,n.size.width>window.innerWidth&&(n.size.width=window.innerWidth-0)),n.position.y+n.size.height>window.innerHeight&&(n.position.y=0,n.size.height>window.innerHeight&&(n.size.height=window.innerHeight-0)),C(n))},D=function(){var t=x.current.filter((function(t){return"visible"===t.status})),n=t.find((function(n){return n.zIndex===Math.max.apply(Math,Object(o.a)(t.map((function(t){return t.zIndex||0}))))}));return n},z=function(t){var n=D();if(n){var e=n.opacity||1;n.opacity=e+t,n.opacity>1&&(n.opacity=1),n.opacity<0&&(n.opacity=0),C(n)}},B=function(t){var n=D();if(n){if(Object(d.a)(t))n.view=t;else{n.view=Object(g.c)(n.view);var e=n.file;Object(g.b)(null===e||void 0===e?void 0:e.path,n.view)}C(n)}},W=function(){z(.1)},U=function(){z(-.1)},H=function(){var t=D();if(t){var n=Object(u.a)(t.file),e=Object(u.a)(t.ctagConfig);t.file=Object(f.e)(""),t.ctagConfig=void 0,C(t),setTimeout((function(){t.file=n,t.ctagConfig=e,C(t)}),100)}};Object(a.useEffect)((function(){var t=["alt + o","alt + shift + o","alt + shift > v","alt + shift > r"];return Object(b.a)(t[0],W),Object(b.a)(t[1],U),Object(b.a)(t[2],B),Object(b.a)(t[3],H),function(){Object(b.c)(t[0],W),Object(b.c)(t[1],U),Object(b.c)(t[2],B),Object(b.c)(t[3],H)}}));var q={create:_,openFile:L,update:C,toggleFile:function(t,n){var e=x.current.find((function(n){return n.file.path===t}));if(!e)return L(t,n);"visible"===e.status?N(e.id):P(e.id)},updateAll:I,delete:E,movePanel:function(t,n){C(Object(i.a)(Object(i.a)({},x.current.find((function(n){return n.id===t}))),{},{position:n}))},resizePanel:function(t,n){C(Object(i.a)(Object(i.a)({},x.current.find((function(n){return n.id===t}))),{},{size:n}))},updatePanelLayout:function(t,n){if("active"===t){var e=w.filter((function(t){return"visible"===t.status&&"mobile"!==t.device})),o=e.find((function(t){return t.isTopWindow}));if(!o)return;t=o.id}n||(n="full");var i=Object(u.a)(x.current.find((function(n){return n.id===t})));i&&(i=k(i,n),C(i))},minimizePanel:N,deminimizePanel:P,actionAll:function(t,n){if("organizeWindows"===t)return A();if("toggleWindowsLayout"===t)return function(t){var n=Object(u.a)(x.current),e=n.filter((function(t){return"visible"===t.status&&"mobile"!==t.device}));"current"===t&&(t=R.current);var o=["grid","horizontal","vertical","tiled"];if(R.current=t||o[(o.indexOf(R.current)+1)%o.length],"grid"===R.current){for(var i=Math.ceil(Math.sqrt(e.length)),c=Math.ceil(e.length/i),a=[],r=Object(p.e)()?2:15,l=(h()-r-2)/i,s=m()/c,d=0;d<c;d++)for(var f=0;f<i;f++)a.push({x:f*l+r,y:d*s+2});var b=0;n.forEach((function(t,n){"visible"===t.status&&"mobile"!==t.device&&(t.position=a[b],t.size={width:l,height:s},b++)})),I(n)}else if("horizontal"===R.current){var g=h()/e.length,v=0;n.forEach((function(t,n){"visible"===t.status&&"mobile"!==t.device&&(t.position={x:v*g,y:0},t.size={width:g,height:m()},v++)})),I(n)}else if("vertical"===R.current){var w=m()/e.length,O=0;n.forEach((function(t,n){"visible"===t.status&&"mobile"!==t.device&&(t.position={x:0,y:O*w},t.size={width:h(),height:w},O++)})),I(n)}else"tiled"===R.current&&A()}(null===n||void 0===n?void 0:n.layout);if("minimizeActive"===t)return function(){var t=D();t&&N(t.id)}();if("closeActive"===t)return function(){var t=D();t&&E(t.id)}();if("deminimizeFirst"===t)return P();var e=Object(u.a)(x.current);e.forEach((function(n){n.status="hide"===t?"visible":"minimized"})),I(e)},panels:w,refreshFromBackend:j,pushWindowOnTop:T,movePositioninArray:function(t,n){var e=Object(u.a)(x.current),o=e.findIndex((function(n){return n.id===t}));if(-1!==o){var i=e.splice(o,1)[0];"up"===n?e.splice(o-1,0,i):"down"===n?e.splice(o+1,0,i):"first"===n?e.splice(0,0,i):"last"===n&&e.push(i),I(e)}},updateOrderPosition:F,resizeWindowIfOutOfWindow:M};return q},O=function(t){var n=!1,e=t.filter((function(t){return"visible"===t.status&&"mobile"!==t.device}));return e.forEach((function(t,o){n||e.forEach((function(e,i){if(!n&&o!==i){var c=t.position.x,a=t.position.y,r=e.position.x,l=e.position.y,s=t.size.width,u=t.size.height,d=e.size.width,p=e.size.height;c+20<r+d&&c+s>r+20&&(a+20<l+p&&a+u>l+20)&&(n=!0)}}))})),n}},134:function(t,n,e){"use strict";e.d(n,"c",(function(){return r})),e.d(n,"b",(function(){return l})),e.d(n,"a",(function(){return s}));var o=e(15),i=e(369),c=e(37),a=e(246),r=function(t,n){var e="render-react-wrapper-".concat(Object(c.a)()),o=function(){var n=l(t),o=setInterval((function(){var t=document.getElementById(e);t&&(t.innerHTML="",t.appendChild(n),clearInterval(o))}),10)};return n&&n.delay?setTimeout(o,n.delay):o(),e},l=function(t,n){return n||(n=document.createElement("div")),Object(i.createRoot)(n).render(t),n},s=function(t){return Object(a.a)((function(){return t.apply(void 0,arguments)}),(function(t){return JSON.stringify(Object(o.a)(t))}))}},136:function(t,n,e){"use strict";e.d(n,"b",(function(){return p})),e.d(n,"a",(function(){return f}));var o=e(11),i=e(111),c=e(26),a=e(9),r=e(18),l=e(14),s=e(545),u={curr:[]},d=Object(i.a)((function(t){console.log("[UPLOAD] inserting ".concat(u.curr.length," files after debounce")),Object(a.d)((function(n){var e="";Object(c.a)(u.curr,(function(t,n){if(!t.inserted){var o=t.file.name.replace(/\[/g,"").replace(/\]/g,"");e+=".concat(t.file.path,")\n"),t.inserted=!0}})),n.ui.note.editorAction.dispatch({type:"insertText",insertPos:"currentLineStart",insertText:e,windowId:t})}))}),1e3),p=function(t){console.log("[UPLOAD] FILE TO EDITOR started",t.fileToUpload);var n=Object(o.a)({},t),e=n.fileToUpload,i=n.folder,c=n.windowId;Object(a.d)((function(t){t.upload.uploadFile({file:e,folderPath:i,onSuccess:function(t){u.curr.push({file:t,inserted:!1}),d(c)},onProgress:function(n){t.ui.note.editorAction.dispatch({type:"uploadProgress",uploadProgress:n,windowId:c})}})}))},f=function(t){var n=Object(o.a)({},t),e=n.file,i=n.path,c=n.idReq,a=n.onProgress,u=e.name,d=e.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=e.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 n=Math.round(t.bytesLoaded/t.file.size*100);a(n)})),g.submitFiles([e])}},137:function(t,n,e){"use strict";e.d(n,"a",(function(){return l}));var o=e(142),i=e(30),c="[FRONT PERF]",a={value:!1};"true"===Object(o.a)("tiroConsoleLogEnabled")||(console.error("=============================================================================="),console.error("!!! console.log is disabled, to enable it again, tiroDevCli.log.toggle_enable()"),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 n=r[t],e=n[1]-n[0];console.warn(c,"".concat(t," = ").concat(e," ms"),n)}}},138:function(t,n,e){"use strict";e.d(n,"c",(function(){return w})),e.d(n,"b",(function(){return y})),e.d(n,"a",(function(){return k}));var o=e(15),i=e(4),c=e(26),a=e(287),r=e(39),l=e(176),s=e(38),u=e(0),d=e(27),p=e(17),f=e(14),b=e(95),g=e(18),h=e(59),m=e(61),v=e(9),w=function(t){var n=Object(u.useState)([]),e=Object(i.a)(n,2),f=e[0],g=e[1],w=Object(u.useState)(-1),y=Object(i.a)(w,2),k=y[0],_=y[1],C=Object(m.a)("selected-folder",""),E=Object(i.a)(C,2),S=E[0],T=E[1],I=Object(u.useRef)("");Object(u.useEffect)((function(){I.current=S}),[S]);var P=Object(u.useRef)({}),N=Object(u.useState)(O),A=Object(i.a)(N,2),R=A[0],F=A[1],L=Object(u.useState)(""),M=Object(i.a)(L,2),D=M[0],z=M[1],B=Object(h.a)("folders-open",["/"]),W=Object(i.a)(B,3),U=W[0],H=W[1],q=W[2],V=Object(u.useRef)([]),J=function(t){t=Object(a.a)(t),H(t)},G=Object(u.useRef)(!1);Object(u.useEffect)((function(){G.current||(K(U),U.length>1&&(G.current=!0))}),[U]);var K=function(t,n){Object(c.a)(t,(function(n,e){""===t[e]&&(t[e]="/")})),t=Object(a.a)(t),n||(n={}),Object(l.a)(n.cache)||(n.cache=!0);var e=!!Object(l.a)(n.background)&&n.background,o=0;Object(v.d)((function(i){Object(c.a)(t,(function(c){i.folders.get([c],(function(i){var c;!e&&$(i.pathBase,i.folders),++o>=t.length&&(null===(c=n)||void 0===c?void 0:c.cb)&&n.cb()}))}))}))},Y=Object(u.useRef)([]),$=function(t,n){var e=Object(s.a)(Y.current),o={current:e};Object(c.a)(n,(function(t){t&&(o.current=o.current.filter((function(n){return t.path!==n.path})))})),Object(c.a)(n,(function(t){t&&(o.current=x(t,o.current))})),e=o.current,Y.current=e;var i=j("/",e);i&&F(i),z(t)};return{goTo:function(t,n,e){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(n&&Object(c.a)(a,(function(t,e){t.name===n&&(r=e)})),_(r),g(a),e&&e.openIn){var l=a[r];if("active"===e.openIn||"activeWindow"===e.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([e.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(n," ").concat(JSON.stringify(e))),o.ui.search.term.set(""),o.status.searching.set(!0),T(t)}))};if(e&&e.ramCache&&P.current[t])i(),o(P.current[t]);else{if(""===t)return;Object(v.d)((function(n){i(),n.files.get(t,(function(n){o(n),P.current[t]=n}))}))}},files:{active:{get:f[k],getIndex:k,set:_},set:g,get:f},folders:{refreshFromBackend:function(){q((function(t){V.current=t}))},base:D,get:function(cb){return cb&&cb(R),R},clean:function(){F(O)},scan:K,open:{get:function(){return V.current},add:function(t){console.log("ADD",t),V.current=Object(r.a)(V.current)?V.current:[],V.current=[].concat(Object(o.a)(V.current),[t]),V.current=Object(a.a)(V.current),J(V.current)},remove:function(t){console.log("REMOVE",t),Object(c.a)(t,(function(t){V.current=V.current.filter((function(n){return n!==t}))})),J(V.current)}},current:{get:function(){return I.current},set:T,getSync:S}}}},O={title:"",key:"",path:""},j=function t(n,e){for(var o,i=0;i<e.length;i++)if(Object(d.a)(e[i].path,n)){o=Object(s.a)(e[i]);var c=e[i].children;if(Object(r.a)(c))for(var a=0;a<c.length;a++){var l=t(c[a].path,e);l&&(o.children[a]=l)}}return o},x=function(t,n){for(var e="add",o=0;o<n.length;o++)Object(d.a)(t.path,n[o].path)&&(n[o]=t,e="update");return"add"===e&&n.push(t),n},y={title:".trash",key:"/.tiro/.trash",path:"/.tiro/.trash"},k=function(t,n){console.log("[askFolderDelete]",t,n),f.b.emit("askFolderDelete",{typeFolder:t,cacheFolderName:n,token:Object(g.b)()})}},14:function(t,n,e){"use strict";e.d(n,"a",(function(){return o})),e.d(n,"b",(function(){return h})),e.d(n,"c",(function(){return m})),e.d(n,"d",(function(){return v}));var o,i=e(11),c=e(15),a=e(672),r=e(106),l=e(64),s=e(284),u=e.n(s),d=e(9),p=e(27),f=e(17),b="[RIPGREP INSTALL]",g=function(t){var n="rg-".concat(t.os,"-").concat(t.arch);"win"===t.os&&(n+=".exe");var e=-1!==["rg-darwin-arm","rg-darwin-x64","rg-darwin-x64","rg-linux-x64","rg-win-x64.exe"].indexOf(n),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";e&&(o+="<br>Do you want Tiro to download and install it? <br><br> The following version will be downloaded and installed: <br><code>".concat(n,"</code>"),c=function(){var e="".concat("https://github.com/dotgreg/tiro-notes/raw/master/platforms/electron/not-packaged/ripgrep/").concat(n);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(n));console.log(c,r),o.ui.notification.emit({id:a,content:"".concat(b," downloading ripgrep..."),options:{hideAfter:-1}}),o.ressource.download(e,c,(function(){var n,cb;o.ui.notification.emit({id:a,content:"".concat(b," updating config..."),options:{hideAfter:-1}}),n=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 e="chmod 0755 ".concat(n);t.command.exec(e,(function(t){console.log("".concat(b," -> cmd: ").concat(e," : ").concat(t)),cb(t)}))})):cb()}),{fileName:n})}))}))}),e||(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,n=Object(r.b)("backend-port")?":".concat(Object(r.b)("backend-port")):"".concat(l.a.global.port),e="".concat(t).concat(l.a.global.url).concat(n);return Object(r.b)("backend-port").includes(".")&&(e="".concat(t).concat(Object(r.b)("backend-port"))),e},v=function(){return new Promise((function(t,n){if(!o){var e=s?u.a:function(){};o=e(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(n){g(t.platform)}))})),h.on("connectionSuccess",(function(n){l.a.log.socket&&console.log("[SOCKET] connection successful!, socket.connected :".concat(o.connected),n),n.isRgGood,t({socket:o,ipsServer:n.ipsServer,socketManager:h})}))}}))},w=function(t,n){return["%c [CLIENT SOCKET 2] ".concat(t),"background: #ccc; color: red",n||null]},O=function(t){var n={};return{on:function(e,o){var r=function(t,n){return function(e){var o;l.a.log.socket&&(o=console).log.apply(o,Object(c.a)(w("<== ON ".concat(t," "),Object(i.a)({},e)))),n(e)}}(e,o),s=Object(a.a)(1,1e8);return n[s]={endpoint:e,apiFn:r},t.on(e,r),s},off:function(e){n[e]&&(t.off(n[e].endpoint,n[e].apiFn),delete n[e])},emit:function(n,e){var o;l.a.log.socket&&(o=console).log.apply(o,Object(c.a)(w("==> EMIT ".concat(n," "),Object(i.a)({},e)))),t.emit(n,e)}}}},140:function(t,n,e){"use strict";e.d(n,"a",(function(){return j})),e.d(n,"b",(function(){return x}));var o=e(4),i=e(11),c=e(38),a=e(176),r=e(0),l=e.n(r),s=e(9),u=e(34),d=e(184),p=e(86),f=e(221),b=e(10),g=(e(56),e(220)),h=e(136),m=e(28),v=e(141),w=e(1),O=function(t){var n,e,b=Object(i.a)({},t.content),O=b.file,j=b.view,x=b.active,y=b.i,k=Object(r.useState)(""),_=Object(o.a)(k,2),C=_[0],E=_[1],S=Object(r.useState)("editor"),T=Object(o.a)(S,2),I=T[0],P=T[1],N=y;Object(r.useEffect)((function(){if(t.forceView)return P(t.forceView);P(j),Object(p.a)(null===O||void 0===O?void 0:O.path).then((function(t){P(t||"editor")}))}),[j,null===O||void 0===O?void 0:O.path,N,t.forceView,null===(n=t.content)||void 0===n||null===(e=n.file)||void 0===e?void 0:e.path]);var A=Object(r.useState)(!0),R=Object(o.a)(A,2),F=R[0],L=R[1],M=Object(r.useState)(O),D=Object(o.a)(M,2),z=D[0],B=D[1],W=Object(r.useState)(C),U=Object(o.a)(W,2),H=U[0],q=U[1];Object(r.useEffect)((function(){var t=V(C);if(t){var n=t.contentWithoutMeta,e=t.file;q(n),B(e)}}),[C,O]);var V=function(t){var n=t,e=Object(v.b)(n),o=e.metas,i=e.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}},J=Object(r.useRef)((null===O||void 0===O?void 0:O.path)||"");Object(r.useEffect)((function(){J.current=(null===O||void 0===O?void 0:O.path)||"",$(!1),O&&Object(s.d)((function(t){t.file.getContent(O.path,(function(t){E(t),$(!0)})),!0===m.d.curr.ui_editor_live_watch&&t.watch.file(O.path,(function(t){if(J.current===t.filePath)return!0===it.current?ot.current=t.fileContent:void E(t.fileContent)}))}))}),[null===O||void 0===O?void 0:O.path,N,F]);var G=Object(r.useState)(!1),K=Object(o.a)(G,2),Y=K[0],$=K[1],Z=Object(u.a)((function(t){Object(d.a)(t,20)}),3e3),X=Object(r.useRef)(!1),Q=(Object(u.a)((function(){X.current=!1,console.log("reenable watch file")}),1e4),Object(r.useRef)({})),tt=Object(r.useRef)(0);Object(r.useEffect)((function(){Q.current;Object(s.d)((function(t){t.watch.appStatus((function(t){if(!1===t.isConnected)tt.current=tt.current+1,console.log("disabling watch update as disconnected"),X.current=!0;else if(!0===t.isConnected){if(tt.current>=1&&t.isConnected)return}}))}))}),[null===O||void 0===O?void 0:O.path,C]);var nt=Object(r.useRef)(C);Object(r.useEffect)((function(){nt.current=C}),[C]);var et=function(t,n){Object(s.d)((function(e){e.file.saveContent(t,n,{history:!0,debounced:500,withMetas:z})})),it.current=!0,ct(),Q.current={content:n,path:null===O||void 0===O?void 0:O.path},Z({path:t,content:n,timestamp:Date.now()})},ot=Object(r.useRef)(!1),it=Object(r.useRef)(!1),ct=Object(u.a)((function(){it.current=!1,Object(a.a)(ot.current)||(ot.current=!1)}),2e3);Object(r.useEffect)((function(){O&&x&&Object(s.d)((function(t){t.ui.browser.goTo(O.folder,O.name,{ramCache:!0})}))}),[x]);var at=Object(u.a)((function(){ut(!1)}),100),rt=Object(r.useState)(!1),lt=Object(o.a)(rt,2),st=lt[0],ut=lt[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:function(t){null!==O&&void 0!==O&&O.path&&Object(g.b)(t,(function(t){Object(h.b)({fileToUpload:t,folder:O.folder,windowId:N})}))},onDragOver:function(t){t.preventDefault(),t.stopPropagation(),console.log("handle dragover",null===O||void 0===O?void 0:O.path),ut(!0),at()},onDragLeave:function(t){},onDrop:function(t){console.log("window drop"),t.preventDefault(),t.stopPropagation(),ut(!1),console.log("handle drop",null===O||void 0===O?void 0:O.path),null!==O&&void 0!==O&&O.path&&function(t,n){if(console.log("handleFileDrop"),t.preventDefault(),t.dataTransfer&&t.dataTransfer.items){var e=t.dataTransfer.items;if(!e[0])return;for(var o=0;o<e.length;o++)n(e[o].getAsFile())}}(t,(function(t){Object(h.b)({fileToUpload:t,folder:O.folder,windowId:N})}))}},Object(w.c)(f.a,{noteParentType:t.noteParentType,windowId:N,file:z||O,fileContent:H,isActive:x,canEdit:Y,isDragging:st,showViewToggler:t.showViewToggler,showToolbar:t.showToolbar,titleEditor:t.titleEditor,viewType:I,mobileView:t.mobileView,onLayoutUpdate:t.onLayoutUpdate,onReloadContent:function(){L(!1),setTimeout((function(){L(!0)}),100)},onFileEdited:function(t,n){et(t,n)}})))},j=l.a.memo(O,(function(t,n){return!1})),x=function(){return"\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")}},141:function(t,n,e){"use strict";e.d(n,"b",(function(){return l})),e.d(n,"a",(function(){return s}));var o=e(26),i=e(29),c=e(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 n=t.split(": ");if(2!==n.length)return null;var e=n.shift();if(!e)return null;var o=n.join(":").trim();if("created"===e||"modified"===e){var i=new Date(o).getTime();isNaN(i)||(o=i)}return{name:e,value:o}},l=function(t){var n=t.match(i.a.metas),e={};if(n&&n[0])for(var o=n[0].split("\n"),c=0;c<o.length;c++){var a=r(o[c]);a&&(e[a.name]=a.value)}10==="".concat(e.created).length&&(e.created=1e3*parseInt("".concat(e.created))),10==="".concat(e.updated).length&&(e.updated=1e3*parseInt("".concat(e.updated)));var l=t;return{metas:e,content:l=(l=l.replace(i.a.metasAndSpace,"")).replace(i.a.metas,"")}},s=function(t,n){var e=function(t){var n="".concat(c.a.metas.headerStart,"\n");return Object(o.a)(t,(function(t,e){n+="".concat(e,": ").concat(t,"\n")})),n+="".concat(c.a.metas.headerEnd,"\n")}(n);return e+=t}},142:function(t,n,e){"use strict";e.d(n,"a",(function(){return o})),e.d(n,"b",(function(){return i}));var o=function(t){var n,e="; ".concat(document.cookie).split("; ".concat(t,"="));return 2===e.length?null===(n=e.pop())||void 0===n?void 0:n.split(";").shift():void 0},i=function(t,n,e){var o=new Date;o.setTime(o.getTime()+60*e*60*1e3);var i="expires="+o.toUTCString();document.cookie=t+"="+n+";"+i+";path=/"}},159:function(t,n,e){"use strict";e.d(n,"a",(function(){return f})),e.d(n,"c",(function(){return b})),e.d(n,"b",(function(){return h}));var o=e(15),i=e(29),c=e(9),a=e(12),r=e(33),l=e(10),s=e(45),u=e(134),d=e(46),p=e(30),f=Object(u.a)((function(t,n){return g(t,n)})),b=function(t,n){return Object(s.a)({file:t,windowId:n,pattern:i.a.externalLink3,replacement:function(t){var n=t.matchs,e=document.createElement("span");return e.innerHTML=f(n),e}})},g=function(t,n){var e=[];e=Array.isArray(t)?t:Object(o.a)(t.matchAll(i.a.externalLink3))[0];var l=document.createElement("span"),s=e[0].slice(0,-1),u=Object(d.c)(s),f=function(t,cb){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],e=t.dataset.link;Object(c.d)((function(t){Object(p.d)('fetching article "'.concat(e,'"...'),"fetchArticle",5),t.ressource.fetchUrlArticle(e,(function(e){var o=encodeURIComponent(e.html);n&&t.ui.floatingPanel.create({type:"ctag",ctagConfig:{tagName:"web",content:o}}),cb(e)}))}))},b="";null!==n&&void 0!==n&&n.addLineJump&&(b="\n");var g=r.d,h='<span title="Open link in detached window" onclick="'.concat(Object(r.c)("open-win-link",(function(t){if(t){var n=t.dataset.link;window.open(n,"popup-preview-link","width=800,height=1000")}})),'"\nclass="link-action link-openwindow" data-link="').concat(s,'">').concat(g("up-right-from-square"),"</span>"),m='<span\nonclick="'.concat(Object(r.c)("fetch-link",(function(t){t&&f(t,(function(){}))})),'"\ntitle="Display url content" class="link-fetcharticle link-action" data-link="').concat(s,'">').concat(g("file-lines"),"</span>"),v='<span\nonclick="'.concat(Object(r.c)("audio-link",(function(t){t&&f(t,(function(n){n.text&&Object(c.d)((function(e){e.ui.textToSpeechPopup.open(n.text,{id:t.dataset.link})}))}),!1)})),'"\ntitle="Text to speech url content" class="link-audio link-action" data-link="').concat(s,'">').concat(g("volume-high"),"</span>"),w='<span\n\t\t title="Detach link in floating panel" class="link-detach link-action" data-link="'.concat(s,'">').concat(g("window-restore"),"</span>"),O='<a\n\t\thref="'.concat(s,'" target="_blank" rel="noreferrer"\n\t\ttitle="Go to link" class="link-goto link-action">').concat(g("link"),"</a>"),j='<span class="link-action-more"><span class="icon-more">'.concat(g("ellipsis"),'</span><span class="link-action-wrapper">').concat(m," ").concat(v," ").concat(w," ").concat(h," </span></span>"),x='<span class="link-action-wrapper">'.concat(m," ").concat(v," ").concat(O," ").concat(w," ").concat(h," </span>"),y='<span class="cm-hover-popup cm-hover-popup"></span>',k='<span class="'.concat(Object(a.e)()?"mobile-version":"",' link-mdpreview-wrapper"><a href="').concat(s,'" class="link-mdpreview" title="').concat(s,'" target="_blank" rel="noreferrer">').concat(g("link")).concat(u,"</a>").concat(j).concat(y,"</span>").concat(b);return Object(a.e)()&&(k='<span class="'.concat(Object(a.e)()?"mobile-version":"",' link-mdpreview-wrapper"><span class="link-action-more link-mdpreview" title="').concat(s,'" rel="noreferrer">').concat(g("link")).concat(u).concat(x).concat(y,"</span>").concat(b)),l.innerHTML="".concat(k),l.outerHTML},h=function(t){var n=parseFloat(t.get("ui_editor_links_preview_zoom")),e=t.get("beta_floating_windows");return isNaN(n)&&(n=1),isNaN(e)&&(e=!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(e?"":".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\topacity: 0;\n\t\ttransition: 0.2s all;\n\t\tpointer-events: none;\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.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\tpointer-events: none;\n transform: translate(-50%,-50%);\n padding: 30px 50px;\n background: white;\n width: 170px;\n z-index:2;\n opacity: 0;\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\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/n,"%!important;\n\t\theight: ").concat(100/n,"!important;\n\t\tmax-height: ").concat(100/n,"%!important;\n\t\ttransform-origin:top left;\n\t\ttransform: scale(").concat(n,");\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(l.a.colors.main,";\n\t\t// border: solid 2px ").concat(l.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(l.a.colors.main,";\n\t\t}\n}\n")}},161:function(t,n,e){"use strict";e.d(n,"a",(function(){return v})),e.d(n,"b",(function(){return w}));var o=e(15),i=e(4),c=e(11),a=e(37),r=e(39),l=e(38),s=e(26),u=e(128),d=e(217),p=e(59),f=e(124),b=e(9),g=e(12),h=e(0),m=e(86),v=function(t){var n=Object(c.a)({},t),e=n.w,o=n.h,i=n.x,r=n.y,l=n.file;o||(o=f.c.rows),e||(e=f.c.cols),i||(i=0),r||(r=0);var s=Object(a.a)();return{layout:{i:s,x:i,y:r,w:e,h:o,minH:1,maxH:2,forceRender:0},content:{i:s,active:!1,file:l,view:"both"}}},w=function(){var t=Object(h.useState)([]),n=Object(i.a)(t,2),e=n[0],c=n[1],a=Object(p.a)("tabs",[],{history:!1,debouncedSave:5e3}),d=Object(i.a)(a,3),f=d[0],v=d[1],w=d[2],_=Object(p.a)("tabs-mobile",[],{history:!1,debouncedSave:5e3}),C=Object(i.a)(_,3),E=C[0],S=C[1],T=C[2],I=Object(h.useRef)([]),P=function(t,cb){I.current=t,c(I.current),"mobile"!==Object(g.a)()&&v(I.current),"mobile"===Object(g.a)()&&S(I.current)},N=function(){w(),T()};Object(h.useEffect)((function(){N()}),[]),Object(h.useEffect)((function(){I.current=e}),[e]),Object(h.useEffect)((function(){"mobile"!==Object(g.a)()&&c(f)}),[f]),Object(h.useEffect)((function(){"mobile"===Object(g.a)()&&c(E)}),[E]);var A=function(t){console.log("[TAB] open in new tab",t);var n=k({fullWindowFile:t});if(n){I.current=Object(r.a)(I.current)?I.current:[];var e=[].concat(Object(o.a)(I.current),[n]),i=y(n.id,e);P(i)}},R=function(t){var n=[],e=Object(l.a)(I.current);Object(s.a)(e,(function(e,o){e.id!==t&&n.push(e)})),P(n)},F=function(){var t=null;return Object(s.a)(I.current,(function(n){n.active&&(t=n)})),t},L=function(t,n,e){var o="activeTab"!==n&&n?n:F();if(o)if("add"===t)Object(b.e)().then((function(t){A(t.ui.browser.files.active.get)}));else if("close"===t){if(!o)return;R(o.id)}else if("rename"===t){if(!o)return;if(e.length>15)return;var i=Object(l.a)(I.current);Object(s.a)(i,(function(t){t.id===(null===o||void 0===o?void 0:o.id)&&(t.name=e,t.manualName=!0)})),P(i)}else if("activateTabWindow"===t){if(!o)return;var c=Object(l.a)(I.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===e}))}));var a=O(c);P(a)}else if("activate"===t){if(!o)return;var r=y(o.id,I.current),u=O(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 n=Object(l.a)(I.current),e=x(n);if(!Object(u.a)(e))return;t=n[e]}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,n){t.active&&(i={layout:o.layout[n],content:o.content[n]})})),i}};return{tabs:e,updateTab:L,refreshTabsFromBackend:N,updateActiveTabGrid:function(t,cb){var n=Object(l.a)(I.current),e=x(n);if(Object(u.a)(e)){n[e].grid=Object.assign(n[e].grid,t);var o=n[e].refresh;n[e].refresh=o?o+1:1,P(n)}},refreshWindowGrid:function(){var t=O(I.current);P(t)},tabsApi:{get:function(){return I.current},close:R,openInNewTab:A,reorder:function(t,n){var e=Object(l.a)(I.current),o=e[t];e.splice(t,1),e.splice(n,0,o),P(e)},active:{get:F},updateTab:L},windowsApi:{close:function(t){var n=Object(l.a)(I.current);Object(s.a)(t,(function(t){Object(s.a)(n,(function(n,e){for(var o=0;o<n.grid.content.length;o++){var i=n.grid.content[o],c=n.grid.layout[o];i.i===t&&n.grid.content.splice(o,1),c.i===t&&n.grid.layout.splice(o,1)}}))}));var e=O(n);P(e)},active:{get:M,setContent:function(t){if(t){var n=Object(l.a)(I.current),e=x(n);if(Object(u.a)(e)){var o=n[e],i=M(o);if(i){i.content.file=Object(l.a)(t),o.manualName||(o.name=j(t.name));var c=O(n);P(c)}}}},toggleView:function(t){var n=Object(l.a)(I.current),e=x(n);if(Object(u.a)(e)){var o=n[e].grid.content;if(!(o.length<1)){var i=0;Object(s.a)(o,(function(t,n){!0===t.active&&(i=n)})),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(n)}}}},updateWindows:function(t,n){var e=Object(l.a)(I.current);Object(s.a)(t,(function(t){Object(s.a)(e,(function(e,o){Object(s.a)(e.grid.content,(function(e){e.i===t&&(e.file=n)}))}))}));var o=O(e);P(o)},getIdsFromFile:function(t){var n=[];return Object(s.a)(I.current,(function(e){Object(s.a)(e.grid.content,(function(e){e.file&&e.file.path===t&&n.push(e.i)}))})),n}}}},O=function(t){var n=Object(l.a)(t);return Object(s.a)(n,(function(t){t.refresh=Object(d.a)(t.refresh)})),n},j=function(t){return t.length>15?"".concat(t.substring(0,13),".."):t},x=function(t){var n=void 0;return Object(s.a)(t,(function(t,e){t.active&&(n=e)})),n},y=function(t,n){var e=Object(l.a)(n);return Object(s.a)(e,(function(n){n.refresh=Object(u.a)(n.refresh)?n.refresh++:1,n.id===t?n.active=!0:n.active=!1})),e},k=function(t){if(t.copiedTab){var n=Object(l.a)(t.copiedTab);return n.id=Object(a.a)(),n.name=_(t.copiedTab.name),n}if(t.fullWindowFile){var e=v({file:t.fullWindowFile});return{id:Object(a.a)(),name:j(t.fullWindowFile.name),active:!0,grid:{layout:[e.layout],content:[e.content]}}}},_=function(t){var n=t,e=n[n.length-1];return isNaN(parseInt(e))?n+=" 1":(n=n.slice(0,-1),n+="".concat(parseInt(e)+1)),n}},165:function(t,n,e){"use strict";e.d(n,"a",(function(){return i}));var o=function(t){return("0"+t).slice(-2)};String.prototype.replaceAll||(String.prototype.replaceAll=function(t,n){return"[object regexp]"===Object.prototype.toString.call(t).toLowerCase()?this.replace(t,n):this.replace(new RegExp(t,"g"),n)});var i=function(t){var n=function(t){var n=new Date;if(t&&""!==t&&"undefined"!==t)if("string"===typeof t){var e=t,i=t;if(t.startsWith("f")){var c=(e=t.replaceAll("f","").replaceAll("h",":").replaceAll("m",":00").replaceAll("-","/").replaceAll("_"," ")).split("/");e="".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("-");e="".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]));e="".concat(r[1],"/").concat(l,"/").concat(r[2])}else if(t.startsWith("h")){var s=(e=t.replace("h","").replaceAll("h",":00:00").replaceAll("-","/").replaceAll("_"," ")).split("/");e="".concat(s[1],"/").concat(s[0],"/").concat(s[2])}var u=Number.isNaN(new Date(e).getDate());n=new Date(e),u&&(n=new Date(i))}else n=new Date(t);else n=new Date;return n}(t),e=n.getFullYear(),i=n.getMonth()+1,c=n.getDate(),a=e.toString(),r=o(i),l=o(c),s=o(n.getHours()),u=o(n.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:e,month:i,day:c,hour:n.getHours(),min:n.getMinutes(),timestamp:n.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:n,full_file:f,full_file_fr:b,full_fr:p,date_fr:h,getWeekNb:v,getCustomFormat:function(t){var n="f".concat(b);return"day"===t&&(n="d".concat(l,"-").concat(r,"-").concat(e)),"week"===t&&(n="w".concat(v(),"-").concat(r,"-").concat(e)),"hour"===t&&(n="h".concat(l,"-").concat(r,"-").concat(e,"_").concat(s,"h")),"".concat(n)}}}},166:function(t,n,e){"use strict";e.d(n,"c",(function(){return tt})),e.d(n,"a",(function(){return nt})),e.d(n,"b",(function(){return et}));var o=e(24),i=e(15),c=e(4),a=e(0),r=e.n(a),l=e(12),s=e(242),u=e(57),d=e(62),p=function(t){var n=Object(a.useRef)(0),e=t.editorRef,o=t.editorRef,i=t.editorRef,c=function(){var c;if("codemirror"===t.editorType){var a=u.a.getCurrentLineInfos(e.current);if(!a)return null;c=a,n.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(),n.current=c&&c.monacoPosition?c.monacoPosition:0;else c=i.current?Object(d.c)(i.current):null,n.current=c&&c.currentPosition?c.currentPosition:0}return c},r=function(c){var a=n.current+c;if("codemirror"===t.editorType)u.a.updateCursor(e.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,n){var e=c();return e?Object(d.g)(t,e,(function(t){r(t)}),n):null}}},f=e(111),b=function(t,n){var e=p({editorType:"monaco-textarea",deviceType:"mobile",editorRef:n.mobileTextarea}),o=e.getLineTextInfos,i=e.resetCursorPosition,r=function(t){var n=Object(a.useState)(0),e=Object(c.a)(n,2),o=e[0],i=e[1];return{saveYTextarea:function(n){var e=t.current?t.current.scrollTop:0;i(n||e)},resetYTextarea:function(){t.current&&(console.log("resetYTextarea",o),t.current.scrollTop=o)}}}(n.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(e){console.log("onTextareaChange");var c=e.target.value,a=c[e.target.selectionStart-1]&&c[e.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()}))}))}n.onMobileNoteEdition(c)},onTextareaScroll:function(t){if(!g){var n=t.target.scrollTop;l(n),console.log("onTextareaScroll")}}}},g="",h=e(216),m=e(108),v=e(1),w=e(14),O=e(71),j=e(10),x=e(20),y=e(232),k=e(47),_=e(231),C=e(224),E=e(188),S=e(225),T=e(239),I=e(9),P=e(220),N=e(96),A=e(26),R=e(81),F=function(t,n){var e=".window-id-".concat(t," .preview-area-wrapper"),o=document.querySelector(e),i="print-wrapper";if(o){!function(){var t=document.querySelectorAll(".".concat(i));Object(A.a)(t,(function(t){t.classList.remove(i)}))}();var c=Object(O.a)(new Date(n.modified||0)),a=Object(O.a)(new Date(n.modified||0)),r="\n<head>\n\t<title>".concat(n.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(n.name,"<br>\n\t\t\t\t\tNote Path : ").concat(n.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(R.c)({w:".simple-css-print-wrapper",pl:".preview-link",r:".resource-link-icon"}),"</style>\n\t\t\t<style>").concat(L(),'</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)}},L=function(){return"\n@page {\nmargin: 0;\n}\n@media print {\n.hide-print {\ndisplay: none;\n\n}\n}\n\n* {\n\t-webkit-print-color-adjust: exact; \n\tprint-color-adjust: exact; \n}\n\n\t.file-path-wrapper {\n\t\tdisplay: none;\n\t}\n\th1.title.big-title {\n\t\tdisplay: none;\n\t}\n\t.file-infos-wrapper {\n\t\tdisplay: none;\n\t\tbackground: #eeeeee;\n\t\tpadding: 10px;\n\t\tmargin: 10px;\n\t}\n\n\t.simple-css-print-wrapper {\n\t\tmargin: 20px;\n\t\twidth: 90%;\n\t}\n\t.simple-css-wrapper {\n\t\tfont-size: 12px;\n\t}\n\n\ttable {\n\t\tfont-size: 12px!important;\n\t}\n\timg {\n\t\t// max-width: 300px!important;\n\t\t// max-height: 500px!important;\n\t\tmax-width: 100%;\n\t\tmax-height: 500px;\n\t}\n\t.block-tag {\n\t\t\tdisplay: none;\n\t}\n"},M=e(189),D=e(27),z=e(17),B=e(223),W=e(33),U="[EXPORT]",H=function(t){if(t){var n=t.dataset.format,e=t.dataset.path;if(n&&e){var o=Object(D.e)(e);Object(I.d)((function(t){Object(I.d)((function(t){t.ui.notification.emit({content:"[EXPORT] converting...",id:"export",options:{hideAfter:-1}})})),t.config.get((function(e){var i="/".concat(z.a.path.configFolder,"/").concat(z.a.path.cacheFolder,"/pandoc");t.folders.create(i,(function(c){var a="";"dzslides"===n&&(a="--self-contained"),"slideous"===n&&(a="--self-contained"),"revealjs"===n&&(a="--self-contained"),"beamer"===n&&(a="--self-contained");var r=n;"dzslides"===n&&(r="html"),"slideous"===n&&(r="html"),"revealjs"===n&&(r="html"),"latex"===n&&(r="tex"),"gfm"===n&&(r="md"),"latex-pdf"===n&&(r="pdf"),"beamer"===n&&(r="pdf");var l="".concat(o.name),s="".concat(l,".").concat(r),u="".concat(e.dataFolder,"/"),d=Object(D.b)("".concat(u,"/").concat(o.folder)),p=(Object(D.b)("./".concat(o.name)),Object(D.b)("".concat(u,"/").concat(i))),f=Object(D.b)("".concat(p,"/").concat(s)),b=Object(D.b)("/".concat(z.a.path.configFolder,"/").concat(z.a.path.cacheFolder,"/pandoc/").concat(s)),g=Object(D.b)("".concat(o.folder,"/.export_md_pandoc.txt")),h=Object(D.b)("./.export_md_pandoc.txt");t.file.getContent(o.path,(function(e){e=e.replace(/\]\(\/\./g,"](."),t.file.saveContent(g,e,{},(function(){console.log(U,"saved"),t.file.getContent(g,(function(e){var o='cd "'.concat(d,'" && pandoc --output="').concat(f,'" --verbose ').concat(function(t,n){var e=t.userSettings.get("export_pandoc_cli_options").split("\n")||[],o={};return Object(A.a)(e,(function(t){var n=t.split("|");2===n.length&&(o[n[0].trim()]=n[1].trim())})),console.log(o,e),o[n]||""}(t,n)," ").concat(a," --to=").concat(n,' "').concat(h,'" ');!1===o.includes("--from=")&&(o=o.replace("--to=","--from=markdown --to="));var i=o;"latex-pdf"===n&&(i='cd "'.concat(d,'" && pdflatex -halt-on-error -output-directory="').concat(p,'" -jobname="').concat(l,'" "').concat(h,'" '));var c=function(n){var e=""===n.stderr?n.stdout:n.stderr;console.error("[CONVERT ERROR]:",n),t.ui.notification.emit({content:'[EXPORT] Error <br/> "'.concat(e," <br/><br/> ").concat(n.shortMessage,'"'),id:"export",options:{hideAfter:-1}})};console.log(U,"pandocCmd",o),t.command.exec("pkill -9 pandoc",(function(n){t.command.exec(i,(function(t){var n={failed:!1,stderr:null,shortMessage:null};try{n=JSON.parse(t)||{failed:!1}}catch(o){c(n)}if(n.failed)c(n);else{var e=Object(B.a)(b);!function(t,n){var e=document.createElement("a");e.setAttribute("download",t),e.setAttribute("href",n),e.setAttribute("target","_blank"),Object(I.d)((function(t){t.ui.notification.emit({content:"[EXPORT] done",id:"export",options:{hideAfter:3}})})),e.click()}(s,e)}}))}))}))}))}),{removeMetaHeader:!0})}))}))}))}}},q=e(176),V=e(286),J=e(128),G=e(77),K=e(28),Y=e(25),$=function(t){console.log("addTableCol");var n=t.cursorInfos.from,e=Object(d.d)(t.fileContent,n),o=e.activeLine;if(o.includes("|")){var i=o.split("|").length;console.log("tableColsNb",i);for(var c=[],a=e.lineIndex;a<e.lines.length;a++){if(e.lines[a].split("|").length!==i)break;c.push(a)}for(var r=e.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:e,colIndex:s}}},Z=e(68),X=e(93),Q=function(t){var n=Object(a.useState)(""),e=Object(c.a)(n,2),o=e[0],f=e[1],j=Object(a.useRef)(null),R=!0;!1===t.canEdit&&(R=!1),!1===t.isConnected&&(R=!1);var L=!0;!1===t.showViewToggler&&(L=!1);var z=!0;!1===t.showToolbar&&(z=!1);var B=!Object(q.a)(t.titleEditor)&&!Object(V.a)(t.titleEditor)||t.titleEditor,U=Object(a.useRef)(t.file);Object(a.useEffect)((function(){U.current=t.file}),[t.file.path]);var Y=function(t){var n=Object(a.useRef)(!1),e=Object(a.useRef)(!1);Object(a.useEffect)((function(){e.current=t.canEdit}),[t.canEdit]),Object(a.useEffect)((function(){return n.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(n.current,g),g=t.file.path};return{triggerNoteEdition:function(e){n.current?t.onNoteEdition&&t.onNoteEdition(e,!1):t.onNoteEdition&&t.onNoteEdition(e,!0),n.current=!0}}}({file:t.file,fileContent:t.fileContent,canEdit:R,onEditorDidMount:function(){f(t.fileContent)},onEditorWillUnmount:function(){},onNoteContentDidLoad:function(){w.a&&f(t.fileContent)},onNoteEdition:function(n,e){var o=U.current;e&&Object(I.d)((function(n){n.history.save(o.path,t.fileContent,"enter")})),t.onFileEdited(o.path,n),f(n)},onNoteLeaving:function(t,n){}}).triggerNoteEdition,Q=Object(a.useRef)(null),tt=b(o,{mobileTextarea:Q,onMobileNoteEdition:Y}),nt=(tt.onTextareaChange,tt.onTextareaScroll,Object(a.useRef)(null)),et="desktop"!==Object(l.a)()?Q:j;"codemirror"===t.editorType&&(et=nt);var ot=p({editorType:t.editorType,deviceType:Object(l.a)(),editorRef:et}).applyTextModifAction,it=function(t,n,e){var o=ot("insertAt",{textToInsert:t,insertPosition:n,replaceText:e});o&&(Y(o),Pt())},ct=function(t){var n=Object(a.useState)(null),e=Object(c.a)(n,2),o=e[0],i=e[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),w=Object(c.a)(g,2),O=w[0],j=w[1],x=function(n){var e=t.fileContent,o=Object(m.c)(e,n);if("failure"===o.status)j(null);else{console.log("encryption done",o),u(!1);var i=o.cipher;t.onTextEncrypted(i)}},y=function(n){var e=t.fileContent,o=Object(m.a)(e,n);if("failure"===o.status)j(null),alert("wrong password");else{b(!0),u(!0),console.log("decryption done",o);var i=o.plaintext;t.onTextDecrypted(i)}};return{APasswordPopup:Object(v.c)(h.a,{onClose:function(){i(null)},onSubmit:function(t){var n=o;i(null),j(t),"toEncrypt"===n&&x(t),"toDecrypt"===n&&y(t)}}),askForPassword:o,decryptButtonConfig:{title:"decrypt text",icon:"faUnlock",action:function(){O?y(O):i("toDecrypt")}},encryptButtonConfig:{title:"encrypt text",icon:"faLock",action:function(){O?x(O):i("toEncrypt")}},ifEncryptOnLeave:function(cb){if(s&&O){console.log("[EVENTS EDITOR] shouldEncryptOnLeave");var n=Object(m.c)(t.fileContent,O);n.cipher&&cb(n.cipher)}j(null),b(!1)},noHistoryBackupWhenDecrypted:f}}({fileContent:o,onTextEncrypted:function(n){Y(n),Pt(),Object(I.d)((function(e){e.history.save(t.file.path,n,"int")}))},onTextDecrypted:function(t){Y(t),Pt()}}),at=ct.APasswordPopup,rt=ct.askForPassword,lt=ct.decryptButtonConfig,st=ct.encryptButtonConfig,ut=(ct.ifEncryptOnLeave,ct.noHistoryBackupWhenDecrypted,Object(a.useContext)(T.a)),dt=Object(a.useState)(-1),pt=Object(c.a)(dt,2),ft=pt[0],bt=pt[1],gt=function(n,e){return{title:"",class:"upload-button-wrapper",action:function(){},customHtml:Object(v.c)(E.a,{file:t.file,windowId:t.windowId,type:n,label:e})}},ht=[{title:"Reload content",icon:"faSync",action:function(){_t.current=_t.current+1,t.onReloadContent(_t.current)}},{icon:"faWindowRestore",title:"Detach Window",action:function(){Object(I.d)((function(n){n.ui.floatingPanel.create({type:"file",file:t.file,view:t.viewType})}))}}].concat(Object(i.a)(function(){var t=[gt("all","Upload files")];return"desktop"!==Object(l.a)()&&(t.push(gt("image","Upload Gallery")),t.push(gt("camera","Capture")),t.push(gt("microphone","Record"))),t}()),[{title:"Search",icon:"faSearch",action:function(){Object(I.d)((function(n){n.ui.note.editorAction.dispatch({windowId:t.windowId,type:"searchWord",searchWordString:" "})}))}},Object(m.d)(o)?lt:st,{title:"Export",icon:"faFileDownload",action:function(){var n;n=t.file,Object(I.d)((function(t){t.popup.show('\n <div id="export-popup-wrapper">\n <div class="buttons-list"> \n <button onclick="'.concat(Object(W.c)("export-note-to",H),'" data-format="docx" data-path="').concat(n.path,'">docx</button>\n <button onclick="').concat(Object(W.c)("export-note-to",H),'" data-format="odt " data-path="').concat(n.path,'">odt</button>\n <button onclick="').concat(Object(W.c)("export-note-to",H),'" data-format="pdf" data-path="').concat(n.path,'">pdf</button>\n \n <button onclick="').concat(Object(W.c)("export-note-to",H),'" data-format="gfm" data-path="').concat(n.path,'">markdown</button>\n <button onclick="').concat(Object(W.c)("export-note-to",H),'" data-format="epub" data-path="').concat(n.path,'">epub</button>\n <button onclick="').concat(Object(W.c)("export-note-to",H),'" data-format="rtf" data-path="').concat(n.path,'">rtf</button>\n </div>\n <br/>\n <div class="buttons-list"> \n Latex:\n <br/>\n <button onclick="').concat(Object(W.c)("export-note-to",H),'" data-format="latex" data-path="').concat(n.path,'">latex (.tex)</button>\n <button onclick="').concat(Object(W.c)("export-note-to",H),'" data-format="latex-pdf" data-path="').concat(n.path,'">latex (.pdf)</button>\n \n </div>\n <br/>\n <div class="buttons-list"> \n Slides: \n <br/>\n <button onclick="').concat(Object(W.c)("export-note-to",H),'" data-format="pptx" data-path="').concat(n.path,'">pptx</button>\n <button onclick="').concat(Object(W.c)("export-note-to",H),'" data-format="beamer" data-path="').concat(n.path,'">beamer</button>\n <br/>\n <br/>\n HTML Slides: <br/>\n <button onclick="').concat(Object(W.c)("export-note-to",H),'" data-format="revealjs" data-path="').concat(n.path,'">revealjs</button>\n <button onclick="').concat(Object(W.c)("export-note-to",H),'" data-format="dzslides" data-path="').concat(n.path,'">dzslides</button>\n <button onclick="').concat(Object(W.c)("export-note-to",H),'" data-format="slideous" data-path="').concat(n.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")?(Bt("both"),setTimeout((function(){F(t.windowId,t.file),setTimeout((function(){Bt("editor")}))}),100)):F(t.windowId,t.file)}},{title:x.a.editorBar.explanation.history,icon:"faHistory",action:function(){Ot(!wt)}},{title:x.a.editorBar.tts,icon:"faCommentDots",action:function(){Object(I.d)((function(n){n.ui.textToSpeechPopup.open(o,{id:t.file.name})}))}},{title:"Delete note",class:"delete",icon:"faTrash",action:function(){ut.file.onFileDelete(t.file)}}]),mt=Object(a.useState)(!1),vt=Object(c.a)(mt,2),wt=vt[0],Ot=vt[1],jt=Object(a.useRef)(null),xt=jt.current,yt=700;xt&&(yt=xt.clientHeight/1.3),"mobile"===Object(l.a)()&&(yt=window.innerHeight);var kt=Object(a.useRef)(null);Object(a.useEffect)((function(){Pt()}),[t.fileContent,t.file.path,t.windowId]);var _t=Object(a.useRef)(0),Ct=Object(a.useRef)(0),Et=Object(a.useState)(0),St=Object(c.a)(Et,2),Tt=St[0],It=St[1],Pt=function(){Ct.current=Ct.current+1,It(Ct.current)},Nt=Object(a.useState)(!1),At=Object(c.a)(Nt,2),Rt=At[0],Ft=At[1],Lt=Object(a.useState)(!1),Mt=Object(c.a)(Lt,2),Dt=Mt[0],zt=Mt[1];Object(a.useEffect)((function(){var t=o.length>3e10&&"desktop"!==Object(l.a)();Ft(t)}),[o,t.viewType]),Object(a.useEffect)((function(){var n=o.length>3e9&&"desktop"!==Object(l.a)();Ft(n),Pt();var e="desktop"===Object(l.a)()&&"preview"===t.viewType||"desktop"!==Object(l.a)()&&"preview"===t.mobileView;zt(e);var i=t.file.path;setTimeout((function(){i===t.file.path&&Pt()}),100)}),[t.viewType,t.mobileView]);var Bt=function(n){t.onLayoutUpdate("windowViewChange",{view:n})},Wt=Object(a.useState)(-1),Ut=Object(c.a)(Wt,2),Ht=Ut[0],qt=Ut[1];Object(a.useEffect)((function(){console.log("222222, editorAction updated",t.editorAction),Object(I.d)((function(n){t.editorAction&&function(n,e){if(n&&("active"!==n.windowId&&(n.noteParentType="any"),(n.windowId===t.windowId||"active"===n.windowId)&&("any"===n.noteParentType||n.noteParentType===t.noteParentType)&&e.note.ui.editorAction.canExecuteAction(n)&&(console.log("[EDITOR ACTION] action ".concat(n.type," triggered on ").concat(n.windowId,", with noteParentType ").concat(n.noteParentType," ").concat(t.windowId)),("mobile"===Object(l.a)()||"active"!==n.windowId||t.isActive)&&("mobile"===Object(l.a)()||"active"===n.windowId||n.windowId===t.windowId)))){if("lineJump"===n.type){var i="both";n.lineJumpType&&(i=n.lineJumpType);var c="editor"===i||"both"===i,a="preview"===i||"both"===i,r=0;if(n.lineJumpNb&&(r=n.lineJumpNb),n.lineJumpString){var s=(null===n||void 0===n?void 0:n.lineJumpString)||"",d=t.fileContent.split("\n");Object(A.a)(d,(function(t,n){t.includes(s)&&(r=n+3)}))}if(c&&(qt(r),setTimeout((function(){qt(-1)}),100)),a){var p,f=Object(X.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 n=document.querySelector(g),e=".dual-view-wrapper.window-id-".concat(t.windowId," .preview-area"),o=document.querySelector(e);n&&(o.scrollTop=(null===n||void 0===n?void 0:n.offsetTop)-100)}),10)}}if("insertText"===n.type&&n.insertText&&n.insertPos&&it(n.insertText,n.insertPos,!1),"replaceText"===n.type&&n.replaceText&&n.replacePos){it(n.replaceText,n.replacePos,!0);var h=nt.current;if(!h)return;if(!Object(J.a)(n.replacePos))return;u.a.updateCursor(h,n.replacePos,!0)}if("searchWord"===n.type&&n.searchWordString){var v=nt.current;if(!v)return;u.a.searchWord(v,n.searchWordString,n.searchReplacementString,!0)}if("setSelection"===n.type&&n.selection){var w=nt.current;if(!w)return;u.a.setSelection(w,n.selection)}if("undo"===n.type){var O=nt.current;if(!O)return;u.a.undo(O.view)}if("redo"===n.type){var j=nt.current;if(console.log(j,j.view),!j)return;u.a.redo(j.view)}if("uploadProgress"===n.type&&bt(n.uploadProgress||-1),"highlightLine"===n.type){var x=nt.current;if(!x)return;!function(t){var n=t.state,e=n.selection.main,o=n.doc.lineAt(e.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"===n.type&&(Object(m.d)(o)?lt.action():st.action()),"triggerUpload"===n.type){var y=document.querySelector(".window-id-".concat(t.windowId," .upload-button-wrapper input"));if(!y)return;console.log("[EDITOR ACTION] TRIGGER UPLOAD2222",y),y.dispatchEvent(new MouseEvent("click",{view:window,bubbles:!0,cancelable:!0}))}if("toggleContextMenu"===n.type){var k=!0;void 0!==n.state&&(k=n.state),Kt(k),console.log("[EDITOR ACTION] OPEN CONTEXT MENU")}}}(t.editorAction,n)}))}),[t.editorAction,t.windowId]);var Vt=Object(a.useState)(!1),Jt=Object(c.a)(Vt,2),Gt=Jt[0],Kt=Jt[1],Yt=function(){Object(I.d)((function(n){var e;null===(e=n.lastNotesApi)||void 0===e||e.addToHistory(t.file,!1)}))},$t=Object(a.useState)({x:0,y:0,from:0,to:0,fromPx:0,toPx:0}),Zt=Object(c.a)($t,2),Xt=Zt[0],Qt=Zt[1],tn=o.substring(Xt.from,Xt.to),nn=".window-id-".concat(t.windowId),en=0;try{var on;en=(null===(on=document.querySelector(nn))||void 0===on?void 0:on.getBoundingClientRect().top)||0}catch(dn){console.log("error",dn)}Xt.y;var cn="desktop"===Object(l.a)()?40:60,an="desktop"===Object(l.a)()?0:10,rn=Object(a.useState)(0),ln=Object(c.a)(rn,2),sn=ln[0],un=ln[1];return Object(a.useEffect)((function(){var t,n;Object(l.e)()&&("visualViewport"in window&&(null===(t=window)||void 0===t||null===(n=t.visualViewport)||void 0===n||n.addEventListener("resize",(function(t){setTimeout((function(){var t,n=null===(t=window.visualViewport)||void 0===t?void 0:t.offsetTop;un(n||0)}),200)}))))}),[]),Object(v.c)("div",{className:"editor-area ".concat(t.isActive?"active":""," note-parent-type-").concat(t.noteParentType),ref:jt,onWheel:function(n){Z.a.scrollPreviewPx(t.windowId,n.deltaY)}},Object(v.c)("div",{className:"infos-editor-wrapper ".concat(B?"with-title-editor":"no-title-editor"," ").concat(t.isActive?"active":"")},(!0===B||"disabled"===B)&&Object(v.c)(r.a.Fragment,null,Object(v.c)("div",{className:"file-path-wrapper"},t.file.path.replace("/".concat(t.file.name),"")),Object(v.c)(s.a,{title:t.file.name.replace(".md",""),enabled:!0===B,onEdited:function(n,e){t.onTitleEditedHook&&t.onTitleEditedHook();var o="".concat(t.file.folder).concat(n,".md"),i="".concat(t.file.folder).concat(e,".md");ut.file.onTitleUpdate(o,i);Object(D.e)(i);Pt()}})),z&&Object(v.c)("div",{className:"toolbar-and-dates-wrapper"},Object(v.c)("div",{className:"editor-toolbar-dropdown"},Object(v.c)(C.a,{hover:!0,dir:"right",maxHeight:yt,forceShow:Gt,onMouseEnter:function(n){t.onLayoutUpdate("windowActiveStatus")}},Object(v.c)(r.a.Fragment,null,L&&Object(v.c)("div",{className:"view-toggler-wrapper"},"mobile"!==Object(l.a)()&&Object(v.c)(k.a,{class:"editor-view-toolbar",size:.8,buttons:[{title:"Editor",icon:"custom_icons/view-3.svg",action:function(){Bt("editor")}},{title:"Editor with minimap",icon:"custom_icons/view-4.svg",action:function(){Bt("editor-with-map")}},{title:"Dual view",icon:"custom_icons/view-1.svg",action:function(){Bt("both")}},{title:"Render view",icon:"custom_icons/view-2.svg",action:function(){Bt("preview")}}]})),Object(v.c)("div",{className:"toolbar-wrapper"},Object(v.c)(k.a,{class:"editor-main-toolbar",design:"vertical",size:1,buttons:ht})),Object(v.c)("div",{className:"separation-bar"}),Object(v.c)("div",{className:"note-id-wrapper"},Object(v.c)("h4",null,"Note Link"),Object(v.c)("div",{className:"note-id-form"},Object(v.c)("input",{type:"text",ref:kt,onClick:function(t){var n=t.target;n.setSelectionRange(0,n.value.length)},value:Object(M.a)(t.file),readOnly:!0}),Object(v.c)(k.a,{class:"note-id-toolbar",size:1,buttons:[{title:"Copy note ID",icon:"faClipboard",action:function(){var t=kt.current;t&&Object(P.a)(t)}}]}))),Object(v.c)("div",{className:"dates-wrapper"},Object(v.c)("div",{className:"date modified"},Object(v.c)("h4",null,"Modified"),Object(O.a)(new Date(t.file.modified||0))),Object(v.c)("div",{className:"date created"},Object(v.c)("h4",null,"Created"),Object(O.a)(new Date(t.file.created||0)))),Object(v.c)("div",{className:"path-wrapper"},Object(v.c)("div",{className:"path"},Object(v.c)("h4",null,"Path"),Object(v.c)("span",null," ",t.file.path," ")))))))),Object(v.c)(S.a,{progress:ft}),Object(v.c)("div",{className:"main-editor-wrapper ".concat(B?"with-title-editor":"no-title-editor"," ").concat(t.windowId)},!Dt&&!Rt&&"codemirror"===t.editorType&&Object(v.c)(N.a,{windowId:t.windowId,ref:nt,file:t.file,pluginsConfig:t.pluginsConfig,value:o,posY:t.posY,jumpToLine:Ht||0,forceRender:Tt,onChange:function(t){Yt(),Y(t)},onEvent:function(t){},onScroll:function(n){t.onScroll(n),Qt({x:-9999,y:-9999,from:0,to:0,fromPx:-9999,toPx:-9999})},onTitleClick:t.onTitleClick,onCursorMove:function(t){Qt(t)}}),!Dt&&Rt&&Object(v.c)("div",{className:"codemirror-mobile-fallback"},Object(v.c)("p",null," Note is too long for mobile, the advanced edition features are disabled "),Object(v.c)("textarea",{defaultValue:o,onChange:function(t){Yt(),Y(t.target.value)}}))),Object(v.c)("div",{className:"mobile-text-manip-toolbar-wrapper",style:{top:cn+sn,left:an}},Object(v.c)(_.a,{cursorInfos:Xt,selection:tn,onButtonClicked:function(n,e){if("aiSearch"===n){if(!e.aiConfig)return;var i=e.aiConfig;Object(I.d)((function(n){var e=n.ai.setStatus("new");Object(G.a)({uuid:e,aiBtnConfig:i,typeAnswer:i.typeAnswer,aiCommand:i.command,selectionTxt:tn,file:t.file,windowIdFile:t.windowId,innerFileContent:o,cursorInfos:Xt})}))}else if("calc"===n)Object(d.f)({windowId:t.windowId,file:t.file,fileContent:o,selectionTxt:tn,insertPos:Xt.to});else if("addTableCol"===n)!function(t){var n=$(t);if(n){for(var e=n.linesOfTable,o=n.linesInfos,i=n.colIndex,c=0;c<e.length;c++){var a=e[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(I.d)((function(n){n.file.saveContent(t.file.path,l,{history:!0})}))}}({windowId:t.windowId,file:t.file,fileContent:o,selectionTxt:tn,cursorInfos:Xt});else if("removeTableCol"===n)!function(t){var n=$(t);if(n){for(var e=n.linesOfTable,o=n.linesInfos,i=n.colIndex,c=0;c<e.length;c++){var a=e[c],r=o.lines[a].split("|");r.splice(i,1),o.lines[a]=r.join("|")}var l=o.lines.join("\n");Object(I.d)((function(n){n.file.saveContent(t.file.path,l,{history:!0,withMetas:t.file})}))}}({windowId:t.windowId,file:t.file,fileContent:o,selectionTxt:tn,cursorInfos:Xt});else if("searchEngine"===n){var c=K.d.curr.ui_editor_search_highlight_url;if(!c)return;var a=c+tn;window.open(a,"_blank")}else if("highlightLine"===n)Object(I.d)((function(n){n.ui.note.editorAction.dispatch({windowId:t.windowId,type:"highlightLine",cursorPos:Xt.from})}));else if("undo"===n)Object(I.d)((function(n){n.ui.note.editorAction.dispatch({windowId:t.windowId,type:"undo"})}));else if("redo"===n)Object(I.d)((function(n){n.ui.note.editorAction.dispatch({windowId:t.windowId,type:"redo"})}));else if("proofread"===n)Object(I.d)((function(n){n.ui.floatingPanel.create({type:"ctag",layout:"bottom",ctagConfig:{tagName:"proofread",content:tn,opts:{file:t.file}}})}));else if("copyLineLink"===n)Object(I.d)((function(n){var e=Object(M.a)(t.file,tn);n.popup.prompt({title:"Selection note link",text:'Link to the selected text <br/><br/> <input type="text" value="'.concat(e,'">')})}));else{var r=ot(n);r&&(Yt(),Y(r),Pt())}}})),rt&&at,wt&&Object(v.c)(y.a,{file:t.file,onClose:function(){Ot(!1)}}))},tt=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(j.a.sizes.mobile.editorTopWrapper,"px;"),"\n\t\t\t\t").concat(Object(l.c)("desktop")?"width: calc(200% - ".concat(3*j.a.sizes.block*2,"px);"):"","\n\t\t\t\tpadding: 0px ").concat(Object(l.c)("desktop")?3*j.a.sizes.block:2*j.a.sizes.block,"px;\n\t\t\t\tposition: relative;\n\n\t\t\t\t").concat(et(),"\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(j.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*j.a.sizes.block,"px 0px ").concat(2*j.a.sizes.block,"px;"),"\n ").concat(Object(l.c)("desktop")?"":"margin: 0px 0px ".concat(j.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(j.a.sizes.mobile.editorTopWrapper+j.a.sizes.mobile.editorBar+2*j.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(j.a.font.editor,";\n\t\t\t\t\t\t\tcolor: grey;\n\t\t\t\t\t\t\tfont-size: ").concat(Object(Y.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(j.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 n=Object(a.useContext)(I.a),e=(null===n||void 0===n?void 0:n.status.isConnected)||!1;return Object(a.useMemo)((function(){return Object(v.c)(Q,Object(o.a)({},t,{isConnected:e}))}),[t.noteParentType,t.viewType,t.mobileView,e,t.canEdit,t.editorType,t.windowId,t.file.created,t.file.name,t.file.path,t.file,t.fileContent,t.isActive,t.editorAction])},et=function(){return"\n\n\n.file-path-wrapper {\n\t\tpadding-top: ".concat(Object(l.c)("desktop")?j.a.sizes.block:j.a.sizes.block/2,"px;\n\t\tfont-size: ").concat(Object(Y.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(j.a.colors.main,";\n\t\tfont-size: ").concat(Object(Y.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(j.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(j.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")}},167:function(t,n,e){"use strict";e.d(n,"a",(function(){return H})),e.d(n,"b",(function(){return V}));var o=e(11),i=e(24),c=e(4),a=e(0),r=e.n(a),l=e(37),s=e(94),u=function(t){var n=t.headerLog,e={},o=function(t){e[t]&&delete e[t]};return{notify:function(t){for(var i in e){var c=e[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){n&&console.log("".concat(n," error with function"),r)}}},subscribe:function(t,cb){e[t]=cb},subscribeOnce:function(t,cb){var n="".concat(t,"-once");e[n]=cb},unsubscribe:o}},d=e(93),p=e(43),f=e(18),b=e(14),g=e(17),h=e(9),m=e(30),v={curr:-1},w=setInterval((function(){O(),-1!==v.curr&&clearInterval(w)}),1e3),O=function(cb){Object(h.d)((function(t){t.cache.get("cacheId",(function(t){var n=t||0;v.curr=n,cb&&cb(n)}))}))};Object(m.a)("cache","clean_cache",(function(){Object(m.d)("Cache clean started...","clean_cache"),Object(h.d)((function(t){var cb;t.folders.delete("cache","ctag-ressources"),t.ressource.cleanCache(),t.cache.cleanRamCache(),cb=function(t){Object(m.d)("Cache cleaned successfully (".concat(t,")"),"clean_cache")},Object(h.d)((function(t){t.cache.get("cacheId",(function(n){var e=n||0;t.cache.set("cacheId",e+1,-1,(function(){v.curr=e+1,console.log("cacheId incremented to "+e+1),cb&&cb(v.curr)}))}))}))}))}));var j="[IFRAME PARENT] 00563",x=g.a.client.log.iframe,y=u({headerLog:j}),k=y.notify,_=y.subscribe,C=y.unsubscribe;window.addEventListener("message",(function(t){t.data.subId&&(x&&console.log(j,"parent <== iframe",t.data.data),k(t.data))}));var E={subscribe:_,unsubscribe:C,send:function(t,n){t&&t.contentWindow&&(x&&console.log(j,"parent ==> iframe",n),t.contentWindow.postMessage(n,"*"))}},S=function(t){var n,e="[IFRAME child js]",o={file:null,frameId:"",reloadCounter:0,windowId:"",innerTag:"",tagName:"",tagContent:"",loginToken:t.loginToken,backendUrl:t.backendUrl,ressCacheId:0},i=function(t){if(""===o.frameId)return console.warn(e,"NO FRAME ID, CANNOT SEND TO PARENT");var n={subId:o.frameId,data:t};window.parent.postMessage(n,"*")},c=function(t){var n={error:"CUSTOM TAG/SCRIPT ERROR: ".concat(t)};i({action:"iframeError",data:n})},a={value:"100%"},r=function(t){var n=document.getElementById("content-wrapper"),e=t;if(!e){if(!n||0===n.clientHeight)return;e=n.clientHeight+20}a.value="".concat(e),i({action:"resize",data:{height:e}})},l=function(){var t=document.body,n=t.requestFullScreen||t.webkitRequestFullScreen||t.mozRequestFullScreen||t.msRequestFullScreen;n&&n.call(t)},s=t.createEventBus({headerLog:"[FRAME API] 00567"}),u=s.subscribeOnce,d=s.notify,p=function(t,n){var o,i=t.url;i.includes(".js")?((o=document.createElement("script")).crossorigin="anonymous",o.rel="preload",o.src=i,t.type&&(o.type=t.type)):i.includes(".css")?((o=document.createElement("link")).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")).rel="preload",o.href=i,o.as="fetch",o.crossorigin="anonymous",o.type="application/wasm",t.type&&(o.type=t.type)),o.onload=function(){n()};var 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=function(n,e){var o="?token=".concat(t.loginToken),i=e||t.getRessourceIdFromUrl(n);return"".concat(t.backendUrl,"/static").concat("/.tiro/cache/ctag-ressources/").concat(i).concat(o)},b=function(t,cb){cb||(cb=function(){});for(var n=0,i=function(){if(++n===t.length)try{cb&&cb()}catch(o){console.error(e,"ERROR LoadScript Callback : ".concat(o)),console.log(o),console.log("tried to load scripts:",t)}},c=function(){var n,c=t[a],r=(n=c.constructor===String?{url:c}:JSON.parse(JSON.stringify(c))).fileName,l=f(n.url,r),s=JSON.parse(JSON.stringify(n));s.url=l;var u=!0===window.disableCache;if(u){var d=Math.floor(1e6*Math.random()),b="&nocache=".concat(d,"-").concat(o.ressCacheId);s.url+=b}else{var h="&cacheId=".concat(o.ressCacheId);s.url+=h}var m,v,w,O=function(t){t||(t={}),t.frontendCache||(t.frontendCache=!1),g("ressource.download",[n.url,"/.tiro/cache/ctag-ressources/",{fileName:r}],(function(t){p(s,(function(){i()}))}))};u?(console.warn(e,"CACHE DISABLED (both frontend + backend fetch), DOWNLOADING RESSOURCES EVERYTIME and NOT CACHING THEM ON FRONTEND!"),O({frontendCache:!1})):(m=s.url,v=function(){p(s,(function(){i()}))},w=function(){O({frontendCache:!0})},fetch(m,{method:"HEAD"}).then((function(t){return t.ok?v():w()})).catch((function(t){return w(t)})))},a=0;a<t.length;a++)c()},g=function(n,e,cb){if(!e||!n||e.constructor!==Array||"string"!==typeof n)return c("Call Api : ".concat(n," => wrong arguments type / number(").concat(JSON.stringify({apiName:n,apiArguments:e,cb:cb}),")"));var o="iframe-api-call-".concat(t.generateUUID()," ");u(o,(function(t){cb&&cb(t)})),i({action:"apiCall",data:{reqId:o,apiName:n,apiArguments:e}})},h={version:1.2,call:g,utils:{getInfos:function(){return o},loadCachedRessources:b,getCachedRessourceUrl:f,getRessourceIdFromUrl:t.getRessourceIdFromUrl,loadScripts:function(t,cb){b(t,cb)},loadRessources:function(t,cb){b(t,cb)},loadRessourcesOneByOne:function(t,cb){cb||(cb=function(){});var n=0;!function e(){if(n===t.length)return cb();var o=t[n];b([o],(function(){n++,e()}))}()},loadScriptsNoCache:function(t,cb){for(var n=0,o=function(){var o=t[i],c=document.createElement("script");c.src=o,c.onload=function(){if(++n===t.length)try{cb&&cb()}catch(i){console.error(e,"ERROR LoadScript Callback : ".concat(i),o),console.log(i)}};var a=document.getElementById("external-ressources-wrapper");a&&a.appendChild(c)},i=0;i<t.length;i++)o()},resizeIframe:r,fullscreenIframe:l,canScrollIframe:function(t){i({action:"canScrollIframe",data:{status:t}})},loadCustomTag:function(t,n,e){var o=h.utils.createDiv(),i=o.div,c=o.updateContent;e||(e={}),e.base_url=t.split("/").slice(0,-1).join("/").replace("//","/"),e.plugins_root_url=e.base_url.split("/").slice(0,-1).join("/").replace("//","/");var a=!0;return!1===e.padding&&(a=e.padding),h.utils.loadScripts([t],(function(){var t=window.initCustomTag("".concat(n),e);a&&(t='<div class="with-padding" style="padding: 0px 15px;">'.concat(t,"</div>")),c(t)})),i},uuid:t.generateUUID,createDiv:function(){var n="ctag-content-wrapper-".concat(t.generateUUID()," ");return{div:'<div id="'.concat(n,'"></div>'),updateContent:function t(e){var o=document.getElementById(n);o?o.innerHTML=e:setTimeout((function(){t(e)}),100)}}}}};return window.api=h,n={init:function(n){o.frameId=n.frameId,o.innerTag=n.innerTag,o.tagContent=n.tagContent,o.tagName=n.tagName,o.file=n.file,o.reloadCounter=n.reloadCounter,o.windowId=n.windowId,o.ressCacheId=n.ressCacheId;var i,a=document.getElementById("content-wrapper");if(a){var l=t.unescapeHtml(a.innerHTML),s=(i=l,t.replaceCustomMdTags(i,"[[script]]",(function(t){var n="".concat(t);try{return new Function(n)()}catch(o){console.warn(e,"[SCRIPT] error: ".concat(o),n),c("".concat(o,' in Code "').concat(n,'"'))}})));a.innerHTML=s,setTimeout((function(){r()}),100),t.bindToElClass("title-search-link",(function(t){var n=t.dataset.file,e=t.dataset.folder,o=t.dataset.windowid;h.call("ui.browser.goTo",[e,n,{openIn:o}])}))}},askFullscreen:l,apiAnswer:function(t){var n={subId:t.reqId,data:t.data};d(n)}},window.onmessage=function(t){var e=t.data;if(e)for(var o in n)n&&n[o]&&o===e.action&&n[o](t.data.data)},h},T=e(81),I=e(34),P=e(111),N=e(286),A=e(128),R=e(56);g.a.client.log.verbose;var F=["epub","pdf","iframe","web","smartlist","proofread","datatable","forms"],L=function(t,cb){Object(h.d)((function(n){n.file.getContent("/.tiro/tags/".concat(t,".md"),(function(t){cb(t)}),{onError:function(){F.includes(t)?function(t,cb){var n="https://raw.githubusercontent.com/dotgreg/tiro-notes/dev/plugins/".concat(t,"/").concat(t,".ctag.js"),e="";"epub"===t&&(e='open:true, size: "80%"'),"pdf"===t&&(e="open:true"),"web"===t&&(e='"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(n,'",`{{innerTag}}`,{').concat(e,"})\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)}})}))},M=e(12),D=e(1),z=(g.a.client.log.verbose,{}),B={},W=["latex","l"],U=function(t){var n="tag"===t.block.type&&!W.includes(t.block.tagName||""),e=Object(a.useState)(null),o=Object(c.a)(e,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),m=g[0],v=g[1];Object(a.useEffect)((function(){var e,cb;n&&(v("loading"),"script"===t.block.tagName?(l("\n[[script]]".concat(t.block.content,"[[script]]")),setTimeout((function(){v("loaded")}),100),t.block.content=""):t.block.tagName&&(e=t.block.tagName,cb=function(t){t?(l(t),setTimeout((function(){v("loaded")}),100)):l(null)},Object(h.d)((function(t){t.plugins.get(e,"tag",(function(t){t&&"tag"===t.type?cb(t.code):("iframe"===e&&(e="web"),L(e,(function(t){cb(t)})))}))}))))}),[t.windowId,t.block.content]);var w="l"===t.block.tagName||"latex"===t.block.tagName;return Object(a.useEffect)((function(){if(!n){var e=s.b.render({raw:t.block.content,file:t.file,windowId:t.windowId});w&&(e="[[l]]".concat(t.block.content,"[[l]]")),f(e)}}),[t.windowId,t.file,t.block]),Object(D.c)("span",{className:"content-block ".concat(n?"block-tag":"block-text"," ")},"loaded"===m&&n&&r&&Object(D.c)(q,Object(i.a)({},t,{noteTagContent:r})),!n&&p&&Object(D.c)("span",{className:"content-block-text",dangerouslySetInnerHTML:{__html:p}}))},H=r.a.memo(U,(function(t,n){var e=!0;return JSON.stringify(t.block)!==JSON.stringify(n.block)&&(e=!1),t.block.content!==n.block.content&&(e=!1),t.file.path!==n.file.path&&(e=!1),t.windowId!==n.windowId&&(e=!1),e})),q=function(t){var n=Object(o.a)({},t).noteTagContent,e=Object(a.useState)(""),i=Object(c.a)(e,2),g=i[0],w=i[1],O=Object(a.useRef)(null),j=Object(a.useState)(""),x=Object(c.a)(j,2),y=x[0],k=x[1],_=Object(a.useState)(!1),C=Object(c.a)(_,2),F=C[0],L=C[1],W=Object(a.useState)(null),U=Object(c.a)(W,2),H=U[0],q=U[1],V=Object(a.useState)(!1),J=Object(c.a)(V,2),G=J[0],K=J[1],Y=function(){var n,e,o=function(n){G&&t.onIframeMouseWheel(n)};return null===(n=O.current)||void 0===n||null===(e=n.contentDocument)||void 0===e||e.addEventListener("mousewheel",o),function(){var t,n;return null===(t=O.current)||void 0===t||null===(n=t.contentDocument)||void 0===n?void 0:n.removeEventListener("mousewheel",o)}};Object(a.useEffect)(Y,[t.yCnt,G]);var $=Object(a.useState)("relativeToParent"),Z=Object(c.a)($,2),X=Z[0],Q=Z[1],tt=Object(a.useRef)("relativeToParent"),nt=function(t){tt.current=t,Q(t)},et=Object(a.useState)(0),ot=Object(c.a)(et,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(n,e){var o=document.querySelector(".window-id-sizeref-".concat(t.windowId));o&&function(t,n){var e=Object(P.a)(n,200);new ResizeObserver((function(){return e()})).observe(t)}(o,(function(){var t=o.getBoundingClientRect();e(t)}))},dt=function(n,e){if("fixed"!==tt.current||"parent"!==e){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(N.a)(n)&&n.endsWith("%")){var r=parseInt(n.replace("%",""))/100;o=a.height*r}else Object(N.a)(n)&&n.endsWith("px")?o=parseInt(n.replace("px","")):Object(A.a)(n)?o=n:(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&&(l/=2);var s="".concat(o-=35,"px"),u="".concat(l,"px");ct(s),st(u),L(!0)}}},pt=Object(I.a)((function(e){Y(),k(e),q(null),ut(0,(function(t){dt(t.height,"parent")})),E.subscribe(e,(function(t){if("resize"===t.action){var n=t.data;Object(N.a)(n.height)&&n.height.endsWith("%")?nt("relativeToParent"):nt("fixed"),dt(n.height,"iframe")}if("canScrollIframe"===t.action){var e=t.data;K(e.status)}if("apiCall"===t.action){var o=t.data;Object(h.b)(o,(function(n,e){if("nok"===n)return q(e.error);var o={reqId:t.data.reqId,data:e};E.send(O.current,{action:"apiAnswer",data:o})}))}if("iframeError"===t.action){var i=t.data.error;q(i),Object(m.d)("".concat(i))}})),setTimeout((function(){var o={file:t.file,innerTag:t.block.content,windowId:t.windowId,frameId:e,reloadCounter:ht,tagContent:n,tagName:t.block.tagName||"",loginToken:Object(f.b)(),backendUrl:Object(b.c)(),ressCacheId:v.curr};E.send(O.current,{action:"init",data:o})}),100)}),500),ft=function(){var e=s.b.render({raw:n,windowId:t.windowId,file:t.file}),o='\n<html>\n\t\t<div id="content-wrapper">\n\t\t\t\t'.concat(e,'\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(v.curr,"\n\t\t\t\tconst main = ").concat(S.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(T.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(R.a)(i,[["{{innerTag}}",t.block.content.trim()]]),w(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(){L(!1),ft();var t="iframe-".concat(Object(l.a)());return pt(t),function(){E.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(){z[jt]?_t(!0):z={},B[jt]?Tt(!0):z={}}),[]);var xt=Object(a.useState)(!1),yt=Object(c.a)(xt,2),kt=yt[0],_t=yt[1],Ct=Object(a.useState)(!1),Et=Object(c.a)(Ct,2),St=Et[0],Tt=Et[1],It=function(t){t||(t=!St),B[jt]=t,Tt(t),_t(!1)};Object(a.useEffect)((function(){t.ctagFullscreen&&It(!0)}),[t.ctagFullscreen]);var Pt=Object(l.a)();return Object(D.c)(r.a.Fragment,null,St&&Object(D.c)("div",{className:"fullscreen-pin-bg",onClick:function(n){It(!1),t.ctagOnFullscreenClose&&t.ctagOnFullscreenClose()}}),Object(D.c)("div",{className:"iframe-view-wrapper ".concat(F?"can-show":"hide"," iframe-tag-").concat(t.block.tagName," ").concat(kt?"pinned":"not-pinned"," ").concat(St?"pinned fullscreen":"not-fullscreen"," ").concat(Object(M.e)()?"mobile":"")},!wt&&Object(D.c)("iframe",{onMouseLeave:function(t){!function(t,n){var e=document.getElementById(n);e&&e.focus({preventScroll:!0})}(0,Pt)},ref:O,id:y,"data-testid":"iframe",title:y,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(D.c)("div",{className:"iframe-error"},Object(D.c)("code",null,Object(D.c)("pre",null,H))),Object(D.c)("input",{className:"refocus-input",id:Pt,type:"text"})))},V=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,n,e){"use strict";e.d(n,"a",(function(){return o}));var o={version:"0.43.44",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}}},173:function(t,n,e){"use strict";e.d(n,"a",(function(){return o}));var o=function(t){!function(){var t=document.getElementById("icon-page");t&&t.remove()}(),function(t){var n=document.createElement("link");n.rel="icon",n.href=t,n.id="icon-page",document.getElementsByTagName("head")[0].appendChild(n)}(t)}},18:function(t,n,e){"use strict";e.d(n,"b",(function(){return m})),e.d(n,"c",(function(){return v})),e.d(n,"a",(function(){return O})),e.d(n,"d",(function(){return j}));var o=e(4),i=e(38),c=e(0),a=e.n(c),r=e(17),l=e(67),s=e(53),u=e(142),d=e(14),p=e(20),f=e(46),b=e(9),g=e(61),h=e(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 n=Object(c.useState)(!1),e=Object(o.a)(n,2),r=e[0],u=e[1],v=Object(c.useState)(""),O=Object(o.a)(v,2),j=O[0],x=O[1],y=Object(c.useState)(""),k=Object(o.a)(y,2),_=k[0],C=k[1],E=Object(c.useState)(),S=Object(o.a)(E,2),T=S[0],I=S[1],P=Object(c.useRef)(0);Object(c.useEffect)((function(){return P.current=d.b.on("getLoginInfos",(function(n){switch(n.code){case"SUCCESS":if(!n.token)return;w(n.token),u(!1),t.onLoginSuccess();break;case"WRONG_TOKEN":u(!0),I(["error",p.a.loginForm.wrongToken]);var e=n.loginInfos;null!==e&&void 0!==e&&e.demo_mode&&(x("viewer"),C(e.viewer_password)),t.onLoginAsked();break;case"WRONG_USER_PASSWORD":I(["error",p.a.loginForm.wrongUserPassword]),u(!0)}})),function(){d.b.off(P.current)}}),[]);var N=Object(g.a)("user-password-cache-ls",{}),A=Object(o.a)(N,2),R=A[0],F=A[1];Object(c.useEffect)((function(){if(r){var t=Object(f.d)().dic,n="__HARDCODED_LOGIN_LS_PASSWORD_0129dsfaf1029__";t.l1&&t.l2&&t.l1.value&&t.l2.value&&Object(b.d)((function(e){var o,c,a=t.l1.value+t.l2.value;if(R[a])o=R[a].usr,c=R[a].pass;else if(o=e.encryption.decryptUrlParam(t.l1.value,n).plaintext,c=e.encryption.decryptUrlParam(t.l2.value,n).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:_,token:m()})},M=Object(c.useState)(1),D=Object(o.a)(M,2),z=D[0],B=D[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:_,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])))))}}}},184:function(t,n,e){"use strict";e.d(n,"b",(function(){return b})),e.d(n,"a",(function(){return g}));var o=e(15),i=e(38),c=e(672),a=e(17),r=e(30),l="tiro-ls-id-",s=function(t,n){var e=JSON.stringify(n);localStorage.setItem(l+t,e)},u="local_node_history",d="[".concat(u.toUpperCase(),"]"),p=a.a.client.log.verbose,f="notes-history-ls",b=function(t){var n=[],e=Object(i.a)(function(t){var n,e=window.localStorage.getItem(l+t);return e&&(n=JSON.parse(e)),n||null}(f));e&&(n=t?e.filter((function(n){return n.path===t})):e);return n},g=function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:6,e=arguments.length>2?arguments[2]:void 0;if(!t.content.includes("--disable-history--")){var i=t,c=b(),a=b(i.path);e&&console.log(d,"adding el to ls : ",{itAdd:i}),c=c.filter((function(t){return t.path!==i.path})),a.unshift(i),a.length>n&&(a=a.slice(0,n)),c=[].concat(Object(o.a)(a),Object(o.a)(c));var r=h(c,3);s(f,r)}},h=function t(n,e){var o=n,i=JSON.stringify(o);return m(i)>e&&o.length>1?(o.pop(),p&&console.log(d,"recursivelyReduceArrTillSmallerThan REDUCE ARR > new length=",o.length),t(o,e)):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],n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"/woopy/doopy",e={timestamp:Date.now(),path:n,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(e,10,t)})),Object(r.a)(u,"addLocalNoteHistorySeveral",(function(){for(var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:10,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"/woopy/doopy",o=0;o<t;o++)Object(r.c)(u,"addLocalNoteHistory")(n,e)})),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"))}))},188:function(t,n,e){"use strict";e.d(n,"a",(function(){return u})),e.d(n,"b",(function(){return d}));var o=e(569),i=e(26),c=(e(0),e(10)),a=e(23),r=e(136),l=e(25),s=e(1),u=function(t){var n="faPaperclip";"image"===t.type&&(n="faImage"),"camera"===t.type&&(n="faCamera"),"microphone"===t.type&&(n="faMicrophone");var e="*";"image"===t.type&&(e="image/*"),"camera"===t.type&&(e="image/*"),"microphone"===t.type&&(e="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:e,onChange:function(n){var e=n.target.files;0!==e.length&&Object(i.a)(e,(function(n,e){Object(r.b)({fileToUpload:n,folder:t.file.folder,windowId:t.windowId})}))}}),Object(s.c)("label",{htmlFor:"file-".concat(c)},Object(s.c)(a.a,{name:n}),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")}},189:function(t,n,e){"use strict";e.d(n,"a",(function(){return o}));var o=function(t,n){var e=n?"|".concat(n):"";return"[link|".concat(t.realname," ").concat(t.folder).concat(e,"]\n")}},190:function(t,n,e){"use strict";e.d(n,"a",(function(){return s})),e.d(n,"b",(function(){return d}));var o=e(11),i=e(71),c=e(9),a=e(128),r="tiro-analytics",l=function(cb){Object(c.d)((function(t){t.cache.get(r,(function(t){var n={};t&&(n=t),cb(n)}))}))},s=function(t){var n=Object(i.c)();l((function(e){var i,l=Object(o.a)({},e);l[n[0]]||(l[n[0]]={}),l[n[0]][n[1]]||(l[n[0]][n[1]]={}),l[n[0]][n[1]][n[2]]||(l[n[0]][n[1]][n[2]]={}),Object(a.a)(l[n[0]][n[1]][n[2]][t])?l[n[0]][n[1]][n[2]][t]++:l[n[0]][n[1]][n[2]][t]=1,i=l,Object(c.d)((function(t){t.cache.set(r,i,-1)}))}))},u=function(cb,t){t||(t={});t.start?t.start:Object(i.c)(Object(i.b)("lastMonth")),t.end?t.end:Object(i.c)();l((function(t){cb(t)}))},d=function(t){return{log:s,report:u}}},20:function(t,n,e){"use strict";e.d(n,"a",(function(){return o}));var o=e(17).a.strings},212:function(t,n,e){"use strict";e.d(n,"a",(function(){return r}));var o=e(26),i=e(29),c=e(43),a=e(46),r=function(t,n){var e=t.match(i.a.image),r=[];return Object(o.a)(e,(function(t){var e=t.match(i.a.firstPartImg),o=e&&e[0]?e[0].replace("![","").replace("]","").replace("(",""):"",l=t.replace(i.a.firstPartImg,"").replace(")",""),s={url:Object(a.b)(Object(c.a)(n.folder)+"/"+l),title:o,file:n};r.push(s)})),r}},215:function(t,n,e){"use strict";e.d(n,"a",(function(){return l}));var o=e(372),i=e(5),c=e(10),a=e(122),r=e(28),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})},216:function(t,n,e){"use strict";e.d(n,"a",(function(){return u})),e.d(n,"b",(function(){return d}));var o=e(4),i=e(0),c=e(53),a=e(20),r=e(10),l=e(67),s=e(1),u=function(t){var n=Object(i.useState)(""),e=Object(o.a)(n,2),r=e[0],u=e[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 ")}},217:function(t,n,e){"use strict";e.d(n,"a",(function(){return i}));var o=e(374),i=function(t){return t||(t=0),Object(o.isNumber)(t)?t+1:0}},219:function(t,n,e){"use strict";e.d(n,"b",(function(){return a})),e.d(n,"a",(function(){return r}));var o=e(4),i=e(111),c=e(0),a=function(){var t=Object(c.useState)(!1),n=Object(o.a)(t,2),e=n[0],a=n[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:e,resizeCount:r}},r=function(t){var n=Object(c.useState)(!1),e=Object(o.a)(n,2),a=e[0],r=e[1];return Object(c.useEffect)((function(){var n,e=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){(n=new ResizeObserver((function(t){e()}))).observe(t)}(i),clearInterval(c)),(o+=1)>5&&clearInterval(c)}),200);return function(){n&&n.disconnect()}}),[]),{resizeState:a}}},220:function(t,n,e){"use strict";e.d(n,"b",(function(){return o})),e.d(n,"a",(function(){return i}));var o=function(t,n){c(t,(function(t){t&&n(t)}))},i=function(t){var n=t.value;navigator&&navigator.clipboard&&navigator.clipboard.writeText(n).then((function(){console.log("Text copied to clipboard...")})).catch((function(t){console.log("Something went wrong",t)}))},c=function(t,n){0==t.clipboardData&&"function"==typeof n&&n(void 0);var e=t.clipboardData.items;void 0==e&&"function"==typeof n&&n(void 0);for(var o=!1,i=0;i<e.length;i++){var c=e[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!=e[i].type.indexOf("image")){console.log("[PASTE] informations on files pasted : ",t,e,e.length);var a=e[i].getAsFile();"function"==typeof n&&n(a)}}}},221:function(t,n,e){"use strict";e.d(n,"b",(function(){return m})),e.d(n,"a",(function(){return v}));var o=e(24),i=e(4),c=e(0),a=e(81),r=e(166),l=e(68),s=e(12),u=e(222),d=e(9),p=e(34),f=e(10),b=e(75),g=e(1),h=function(t){var n=Object(c.useState)(""),e=Object(i.a)(n,2),o=e[0],d=e[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),y=Object(i.a)(x,2),k=y[0],_=y[1];return Object(c.useEffect)((function(){_(!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(){_(!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(n,e){t.onFileEdited(n,e),O(e)},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,n){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\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 n=Object(c.useContext)(d.a),e=(null===n||void 0===n?void 0:n.ui.note.editorAction.get)||null;return Object(g.c)(h,Object(o.a)({},t,{editorAction:e}))}},222:function(t,n,e){"use strict";e.d(n,"a",(function(){return u})),e.d(n,"b",(function(){return d}));var o=e(3),i=e(4),c=e(0),a=e(133),r=e.n(a),l=e(68),s=e(1),u=function(t){var n=Object(c.useState)(0),e=Object(i.a)(n,2),a=e[0],u=e[1],d=Object(c.useRef)(null),p=Object(c.useRef)(null),f=function(){var t={maxY:0,y:0,percent:0},n=p.current?p.current:null,e=d.current?d.current:null;if(!e||!n)return t;var o=e.getBoundingClientRect().height,i=n.getBoundingClientRect().y;return t.maxY=n.getBoundingClientRect().height-o,t.y=e.getBoundingClientRect().y-i,t.percent=t.y/t.maxY*100,t};Object(c.useEffect)((function(){var n=p.current?p.current:null;if(n){var e=new MutationObserver((function(n,e){var i,c=Object(o.a)(n);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 e.observe(n,{attributes:!0}),function(){e.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(n){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"}},223:function(t,n,e){"use strict";e.d(n,"a",(function(){return r}));var o=e(27),i=e(17),c=e(18),a=e(14),r=function(t){return Object(o.b)("".concat(Object(a.c)(),"/").concat(i.a.path.staticResources,"/").concat(t,"?token=").concat(Object(c.b)()))}},224:function(t,n,e){"use strict";e.d(n,"a",(function(){return a})),e.d(n,"b",(function(){return r}));e(0);var o=e(10),i=e(23),c=e(1),a=function(t){var n=t.dir?t.dir:"left",e=t.maxHeight?t.maxHeight:50;return Object(c.c)("div",{className:"dropdown-wrapper ".concat(n," ").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:e}},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")}},225:function(t,n,e){"use strict";e.d(n,"a",(function(){return a})),e.d(n,"b",(function(){return r}));var o=e(0),i=e.n(o),c=e(1),a=function(t){var n=t.progress,e=n>=0&&n<100;return Object(c.c)(i.a.Fragment,null,e&&Object(c.c)("div",{className:"upload-progress-bar-wrapper"},Object(c.c)("div",{className:"bg-fill",style:{width:"".concat(n,"%")}}),Object(c.c)("div",{className:"label"},n,"% 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"}},226:function(t,n,e){"use strict";e.d(n,"b",(function(){return s})),e.d(n,"a",(function(){return d}));var o=e(29),i=e(9),c=e(12),a=e(33),r=e(10),l=e(45),s=function(t,n){return Object(l.a)({file:t,windowId:n,pattern:o.a.hashtag,replacement:function(n){var e=n.matchs,o=document.createElement("span");return o.classList.add("cm-hashtag"),o.innerHTML='<span class="hash-inner" \n data-hashtag="'.concat(e[1],'"\n data-hashtag2="').concat(e[0],'"\n data-folder="').concat(t.folder,'"\n onclick="').concat(Object(a.c)("open-win-smartlist-hashtag",u),'" >').concat(e[0],"</a>"),o},options:{isAtomic:!1}})},u=function(t){if(t){var n=t.dataset.hashtag2,e=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(n," | ").concat(e)}})}))}},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")}},227:function(t,n,e){"use strict";e.d(n,"a",(function(){return s})),e.d(n,"b",(function(){return d}));var o=e(29),i=e(9),c=e(33),a=e(10),r=e(45),l=e(25),s=function(t,n){return Object(r.a)({file:t,windowId:n,pattern:o.a.dateFrFormat,replacement:function(t){var e=t.matchs,o=(t.view,t.pos),i=document.createElement("span"),a=e[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(n,'" 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 n=t.dataset.replacepos,e=t.dataset.windowid;console.log("el",t.value,n);var o=t.value.split("-"),c="".concat(o[2],"/").concat(o[1],"/").concat(o[0]);if(-1===(n=parseInt(n)||-1))return console.warn("no pos");Object(i.d)((function(t){console.log("replacedatetext",c,n),t.ui.note.editorAction.dispatch({windowId:e,type:"replaceText",replaceText:c,replacePos:n})}))}},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")}},228:function(t,n,e){"use strict";e.d(n,"a",(function(){return r})),e.d(n,"b",(function(){return s}));var o=e(29),i=e(9),c=e(33),a=e(45),r=function(t,n){return Object(a.a)({file:t,windowId:n,pattern:o.a.checkbox,replacement:function(t){var e=t.matchs,o=(t.view,t.pos),i=document.createElement("span"),a=e[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(n,'" value="" ')+'onchange="'.concat(Object(c.c)("replace-checkbox-todo-text",l),'"/></span>'),i},options:{cache:!1}})},l=function(t){if(t){var n=t.dataset.replacepos,e=t.dataset.windowid,o=t.dataset.ischecked;if(-1===(n=parseInt(n)||-1))return console.warn("no pos");Object(i.d)((function(t){t.ui.note.editorAction.dispatch({windowId:e,type:"replaceText",replaceText:"true"===o?"[ ]":"[x]",replacePos:n})}))}},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"}},229:function(t,n,e){"use strict";e.d(n,"a",(function(){return u})),e.d(n,"b",(function(){return d}));var o=e(27),i=e(29),c=e(33),a=e(72),r=e(56),l=e(10),s=e(45),u=function(t,n){return Object(s.a)({file:t,windowId:n,pattern:i.a.userCustomTagFull2,replacement:function(e){var i=document.createElement("span");return i.innerHTML=function(t,n,e){var i=t[2].replaceAll("[[","").replaceAll("]]",""),l=t[0].replaceAll("[[".concat(i,"]]"),""),s=function(t,n,e){return"".concat(Object(r.b)(t,""),"-").concat(Object(r.b)(n,""),"-").concat(Object(r.b)(e,""))},u=s(i,l,n.path),d="ress-".concat(u);Object(c.a)(n,u,(function(){var t=document.querySelector(".".concat(d," .iframe-wrapper-cm-ctag"));if(t){var o=Object(a.b)(i,l,e,{file:n});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 n=t.dataset.filepath,e=decodeURIComponent(t.dataset.tagcontent),i=t.dataset.tagname,r=t.dataset.windowid,l=s(i,e,n),u=Object(o.e)(n),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,e,r,{file:u});Object(a.c)(d,f)}})),'"\n\t\tdata-filepath="').concat(n.path,'"\n\t\tdata-windowid="').concat(e,'"\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>")}(e.matchs,t,n),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")}},23:function(t,n,e){"use strict";e.d(n,"b",(function(){return r})),e.d(n,"c",(function(){return l})),e.d(n,"a",(function(){return s}));var o=e(0),i=e.n(o),c=e(33),a=e(1),r=function(t){var n=t.name,e=n.endsWith(".svg")||n.endsWith(".png")||n.endsWith(".jpg"),o=t.size?t.size:1;return o-=.2,n.startsWith("fa")&&(n=n.substr(2)),n[0]===n[0].toUpperCase()&&(n=n[0].toLowerCase()+n.substr(1)),n=n.replace(/[A-Z]/g,(function(t){return"-".concat(t.toLowerCase())})),Object(a.c)("span",{style:{transform:"scale(".concat(o,")"),display:"inline-block"}},!e&&Object(a.c)("span",{className:"icon-2-wrapper icon-wrapper",title:t.label,dangerouslySetInnerHTML:{__html:Object(c.d)(n)},style:{color:t.color||"#797979"}}),e&&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\t.icon-wrapper{\n\t\tdisplay: inline-block;\n\t}\n"},s=i.a.memo(r,(function(t,n){return JSON.stringify(t)===JSON.stringify(n)}))},230:function(t,n,e){"use strict";e.d(n,"a",(function(){return c})),e.d(n,"b",(function(){return a}));var o=e(29),i=e(45),c=function(t,n){return Object(i.a)({file:t,windowId:n,pattern:o.a.boldOrStrike,replacement:function(t){var n=t.matchs,e=(t.view,t.pos,document.createElement("span"));e.classList.add("markdown-synthax-cm-wrapper");var o="";n[0].startsWith("***")?o="***":n[0].startsWith("**")?o="**":n[0].startsWith("~~")?o="~~":n[0].startsWith("__")?o="__":n[0].startsWith("*")&&(o="*"),"**"===o&&e.classList.add("bold"),"~~"===o&&e.classList.add("strike"),"__"===o&&e.classList.add("bold"),"*"===o&&e.classList.add("italic"),"***"===o&&e.classList.add("bold_and_italic");var i=n[0];return i=i.replaceAll(o,""),e.innerHTML="".concat(i),e},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"}},231:function(t,n,e){"use strict";e.d(n,"a",(function(){return h})),e.d(n,"b",(function(){return m}));var o=e(11),i=e(15),c=e(4),a=e(0),r=e(62),l=e(10),s=e(47),u=e(12),d=e(28),p=e(25),f=e(77),b=e(26),g=e(1),h=function(t){var n=Object(a.useState)(!1),e=Object(c.a)(n,2),p=e[0],h=e[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(n){O(!1),t.onButtonClicked(n)},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")}}]},y=[{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 _=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)))};_&&(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 E=d.d.curr.ui_editor_ai_text_selection,S=function(){var n=[];if(d.d.curr.ui_editor_live_watch&&E){var e=Object(f.b)();Object(b.a)(e,(function(e){n.push({icon:e.icon,title:e.title,action:function(){t.onButtonClicked("aiSearch",{aiConfig:e}),h(!1)}})}))}return n},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)(S()))).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 P=Object(o.a)({},C);P.class="separator-right",d.d.curr.ui_editor_live_watch&&y.push(P),d.d.curr.ui_editor_search_highlight_enable&&y.push({icon:"search",title:"Search selection",action:function(){t.onButtonClicked("searchEngine"),h(!1)}}),y.push(T),y.push(I),y=[].concat(Object(i.a)(y),Object(i.a)(S()))}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:y,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")}},232:function(t,n,e){"use strict";e.d(n,"a",(function(){return x})),e.d(n,"b",(function(){return y}));var o=e(15),i=e(4),c=e(26),a=e(570),r=e(0),l=e.n(r),s=e(165),u=e(9),d=e(18),p=e(91),f=e(71),b=e(184),g=e(14),h=e(20),m=e(10),v=e(23),w=e(53),O=e(25),j=e(1),x=function(t){var n=Object(r.useState)([]),e=Object(i.a)(n,2),m=e[0],O=e[1],x=Object(r.useState)(!1),y=Object(i.a)(x,2),k=y[0],_=y[1],C=function(){var n=E();O([].concat(n)),_(!0),g.b.emit("askFileHistory",{filepath:t.file.path,token:Object(d.b)()});var e=g.b.on("getFileHistory",(function(t){var i=[];Object(c.a)(t.files,(function(t){var n,e=null===(n=t.filenameWithoutExt)||void 0===n?void 0:n.split("___")[1];e&&(t.created=Object(s.a)(e).num.timestamp),t.created&&t.created<Date.now()&&i.push(t)}));var r=Object(a.a)(i,["created"],["desc"]);O([].concat(n,Object(o.a)(r))),_(!1),g.b.off(e)}))},E=function(){var n=[],e=Object(b.b)(t.file.path);return Object(c.a)(e,(function(t,e){var o=e+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,n.push(i)})),console.log("getLSHistoryList",e,t.file.path),n};Object(r.useEffect)((function(){C()}),[]);var S=Object(r.useContext)(u.a),T=Object(r.useState)(""),I=Object(i.a)(T,2),P=I[0],N=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?(N(t.localContent),L(t)):S&&S.file.getContent(t.path,(function(n){N(n),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(n){n.file.delete(t,(function(t){C(),L(null),N("")}))}))}(t)}}," ",Object(j.c)(v.a,{name:"faTrash",color:"grey"})," ")))}))))),P&&Object(j.c)(l.a.Fragment,null,Object(j.c)("div",{className:"note-preview"},Object(j.c)("textarea",{className:"note-preview-textarea",value:P}),Object(j.c)("div",{className:"button-wrapper"},Object(j.c)("button",{className:"button",onClick:function(){Object(u.d)((function(n){n.file.saveContent(t.file.path,P)}))}},"Restore version")),Object(j.c)("div",{className:"advice"},' To disable history backup for a note, add "--disable-history--"in it')))))},y=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")}},234:function(t,n,e){"use strict";e.d(n,"a",(function(){return l})),e.d(n,"b",(function(){return s}));var o=e(14),i=e(18),c=e(9),a=e(37),r="[NOTIFICATIONS]",l={},s=function(t){return{emit:function(t,cb){var n,e=function(){var n;if(console.log(r,"emitNotification",t),null!==(n=t.options)&&void 0!==n&&n.onClick){var e,c="notif-onclick-fnid-".concat(t.id,"-").concat(Object(a.a)());l[c]=null===(e=t.options)||void 0===e?void 0:e.onClick,t.options.onClickId=c}cb&&cb(),o.b.emit("emitNotification",{notification:t,token:Object(i.b)()})};null!==(n=t.options)&&void 0!==n&&n.showOnceEvery&&t.id?Object(c.d)((function(n){var o="notif-showevery-".concat(t.id);n.cache.get(o,(function(i){var c;if(i&&!0===i.alreadyShown)return console.log(r,"showOnceEvery => already shown notif, dont reshow it",t);e(),n.cache.set(o,{alreadyShown:!0},null===(c=t.options)||void 0===c?void 0:c.showOnceEvery)}))})):e()}}}},239:function(t,n,e){"use strict";e.d(n,"a",(function(){return g})),e.d(n,"b",(function(){return h}));var o=e(4),i=e(11),c=e(170),a=e(26),r=e(38),l=e(0),s=e.n(l),u=e(9),d=e(20),p=e(124),f=e(1);var b={upload:{uploadCounter:0,reinit:function(){}},file:{onTitleUpdate:function(t,n){},onFileDelete:function(t){}}},g=s.a.createContext(b),h=function(t){var n=Object(i.a)({},t).tab,e=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),n=Object(l.useState)({name:"",data:{}}),e=Object(o.a)(n,2),i=e[0],c=e[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,n){var e=t.ui.browser.folders.current.get();e===n.folder&&(t.ui.browser.goTo(e,n.name,{openIn:"activeWindow"}),O({name:"checkIfNoWindows"}))})),j("checkIfNoWindows",(function(t){0===n.grid.content.length&&t.tabs.close(n.id)}));var x=Object(r.a)(h);x.file.onFileDelete=function(t){e&&e.popup.confirm("".concat(d.a.trashNote),(function(){var n;null===(n=e.lastNotesApi)||void 0===n||n.removeFile(t.path),e.file.delete(t,(function(n){e.ui.windows.getIdsFromFile(t.path),n[n.length-1];var o=n[0];Object(a.a)(n,(function(t){t.modified&&o.modified&&t.modified>o.modified&&(o=t)})),O({name:"refreshFolderList",data:o})}))}))},x.file.onTitleUpdate=function(t,n){e&&e.file.move(t,n,(function(o){var i,c=null;if(Object(a.a)(o,(function(t){t.path===n&&(c=t)})),c){var r=e.ui.windows.getIdsFromFile(t);e.ui.windows.updateWindows(r,c),null===(i=e.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 y=Object(l.useState)(0),k=Object(o.a)(y,2),_=k[0],C=k[1];return Object(l.useEffect)((function(){C(_+1)}),[n.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:_,grid:n.grid,onGridUpdate:t.onGridUpdate,mobileView:t.mobileView}))))},m=Object(c.a)("div",{target:"ejnwhwz0"})({name:"zk0z9r",styles:"height:100%;.window-grid-wrapper{height:100%;}"})},242:function(t,n,e){"use strict";e.d(n,"b",(function(){return p})),e.d(n,"a",(function(){return f}));var o=e(4),i=e(0),c=e.n(i),a=e(12),r=e(10),l=e(23),s=e(176),u=e(1),d=function(t){var n=Object(i.useState)(""),e=Object(o.a)(n,2),c=e[0],d=e[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 n=function(t){var n=t;return n.replace(/[^A-Za-z0-9_\ \-\u00a9\u00ae\u2000-\u3300\ud83c\ud000-\udfff\ud83d\ud000-\udfff\ud83e\ud000-\udfff]/g,"")}(t.target.value);d(n),g(!0)},onKeyDown:function(n){if(!1!==h&&"Enter"===n.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,n){var e=!1;return t.title!==n.title&&(e=!1),e}))},25:function(t,n,e){"use strict";e.d(n,"a",(function(){return c}));var o=e(28),i=e(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}},27:function(t,n,e){"use strict";e.d(n,"b",(function(){return o})),e.d(n,"e",(function(){return i})),e.d(n,"d",(function(){return c})),e.d(n,"a",(function(){return a})),e.d(n,"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 n=function(t){var n=t.split("/"),e=t.split("\\"),o=n.length>e.length?n:e,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),e=n.extension?"file":"folder";return{path:n.path,realname:n.filename,nature:e,name:n.filename,extension:n.extension,folder:n.folder,filenameWithoutExt:n.filenameWithoutExt}},c=function(t){var n=t.match(/(.*)[\/\\]/),e=n?n[1]+"/":"";return o(e)},a=function(t,n){return o(t+"/")===o(n+"/")},r=function(t){return t.replace(/[^a-zA-Z0-9]/g,"_")}},28:function(t,n,e){"use strict";e.d(n,"d",(function(){return h})),e.d(n,"b",(function(){return m})),e.d(n,"a",(function(){return j})),e.d(n,"c",(function(){return _}));var o=e(4),i=e(26),c=e(571),a=e(384),r=e(38),l=e(0),s=e(37),u=e(17),d=e(14),p=e(10),f=e(18),b=e(34),g=e(59),h={curr:{}},m=function(){return h.curr},v=function(t){var n={};return new URLSearchParams(t).forEach((function(t,e){n[e]=t})),n}(window.location.search),w={};for(var O in v)w[O]=v[O];var j={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 ",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_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"},x=j,y="[USER SETTINGS] :",k=u.a.client.log.verbose,_=function(t){var n=Object(g.a)("user-settings",{},{history:!0}),e=Object(o.a)(n,3),u=e[0],m=e[1],v=e[2],w=Object(l.useState)(0),O=Object(o.a)(w,2),_=O[0],C=O[1],E=Object(l.useRef)([]),S=function(t,n,e){E.current[t]||(E.current[t]=n[e]);var o=u[t];Object(c.a)(o)||Object(a.a)(o)||(""===o&&E.current[t]&&(o=E.current[t]),n[e]=o)};Object(l.useEffect)((function(){T(),h.curr=u,Object(i.a)(x,(function(t,n){Object(a.a)(u[n])&&(u[n]=t)}))}),[u]);var T=Object(b.a)((function(){k&&console.log(y,"UPDATE!",u,_),S("ui_layout_colors_main",p.a.colors,"main"),S("ui_layout_colors_main_font",p.a.colors,"mainFont"),S("ui_layout_font_family_editor",p.a.font,"editor"),S("ui_layout_font_family_interface",p.a.font,"main"),C(_+1)}),1e3),I=function(n,e,cb,o){var i="updateSetupJson-".concat(Object(s.a)());t.eventBus.subscribe(i,(function(t){cb&&cb(t)})),d.b.emit("updateSetupJson",{paramName:n,paramValue:e,opts:o,token:Object(f.b)(),idReq:i})};Object(l.useEffect)((function(){d.b.on("onServerTaskFinished",(function(n){t.eventBus.notify(n.idReq,{data:n})}))}),[]);var P={refreshUserSettingsFromBackend:v,updateSetupJson:I,set:function(t,n,e){e||(e={}),e.writeInSetupJson||(e.writeInSetupJson=!1),e.writeInSetupJson&&I(t,"".concat(n)),k&&console.log(y,"updateUserSettings ".concat(t," to ").concat(n));var o=Object(r.a)(u);o[t]=n,m(o)},get:function(t,cb){var n=x[t],e=n;return t in u&&(e=u[t]),""===e&&(e=n),cb&&cb({currentValue:e,defaultValue:n}),e},list:function(){return function(t){var n=[];return Object(i.a)(t,(function(t,e){var o=e;n.push({key:o,val:t})})),Object(i.a)(j,(function(t,e){var o=e;n.find((function(t){return t.key===o}))||n.push({key:o,val:t})})),n}(u)},refresh:{css:{get:_}}};return{userSettingsApi:P}}},29:function(t,n,e){"use strict";e.d(n,"a",(function(){return r}));var o=e(40),i=e.n(o),c=e(17),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>")}},30:function(t,n,e){"use strict";e.d(n,"a",(function(){return c})),e.d(n,"c",(function(){return a})),e.d(n,"b",(function(){return r})),e.d(n,"d",(function(){return l}));e(11);var o=e(9),i="tiroDevCli",c=function(t,n,e){window[i]||(window[i]={}),window[i][t]||(window[i][t]={}),window[i][t][n]=e},a=function(t,n){return window[i]&&window[i][t]&&window[i][t][n]?window[i][t][n]:function(){console.log("DEV FN",t,n,"does not exists")}},r=function(t,n){if(window[i]&&window[i][t]&&window[i][t][n])window[i][t][n]();else{var e="DEV FN ".concat(t," ").concat(n," does not exists");console.log(e),l(e)}},l=function(t,n,e){console.log("[NOTIF LOG]: ",t),e||(e=60),Object(o.d)((function(o){o.ui.notification.emit({content:t,id:n,options:{hideAfter:e,type:"warning",keepInHistory:!0}})}))}},33:function(t,n,e){"use strict";e.d(n,"d",(function(){return i})),e.d(n,"c",(function(){return c})),e.d(n,"b",(function(){return r})),e.d(n,"a",(function(){return l}));e(428);var o=e(9),i=function(t){return'<i class="ssr-icon fa-solid fa-'.concat(t,'"></i>')};window.ssrActionsDic={};var c=function(t,n){var e="window.ssrActionsDic['".concat(t,"'](this)"),o=window.ssrActionsDic;return o[t]||(o[t]=function(t){n(t)}),e},a=function(t,n){var e="ressource-preview-status-".concat(t.path),o=n.indexOf("token=");return o>-1&&(n=n.substring(0,o)),{cacheId:e,idRess:"".concat(t.path,"-").concat(n)}},r=function(t,n,e){var i=a(t,n),c=i.cacheId,r=i.idRess;Object(o.d)((function(t){t.cache.get(c,(function(n){n||(n={}),n[r]=e,t.cache.set(c,n,-1)}))}))},l=function(t,n,e){!function(t,n,cb){var e=a(t,n),i=e.cacheId,c=e.idRess;Object(o.d)((function(t){t.cache.get(i,(function(t){if(t){var n=t[c]?t[c]:"closed";cb(n)}}))}))}(t,n,(function(t){"open"===t&&setTimeout((function(){e()}),500)}))}},34:function(t,n,e){"use strict";e.d(n,"b",(function(){return a})),e.d(n,"a",(function(){return r}));var o=e(383),i=e(111),c=e(0);function a(cb,t){var n=Object(c.useRef)(cb);return Object(c.useEffect)((function(){n.current=cb})),Object(c.useCallback)(Object(o.a)((function(){return n.current.apply(n,arguments)}),t,{leading:!0,trailing:!1}),[t])}function r(cb,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],e={leading:!1,trailing:!0};n&&(e.leading=n);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 n;o.current.delay===t&&a()&&(n=o.current).cb.apply(n,arguments)}),t,e),[t,i.a])}},35:function(t,n,e){"use strict";e.d(n,"a",(function(){return s})),e.d(n,"c",(function(){return u})),e.d(n,"d",(function(){return d})),e.d(n,"b",(function(){return p}));var o=e(4),i=e(100),c=e(9),a=e(56),r=e(96),l=e(30),s=function(t,n){i&&i.bind&&i.bind(t,n)},u=function(t,n){i&&i.bind&&i.unbind(t,n)},d=function(){i&&i.bind&&i.releaseAllKeys()},p=function(t){var n=t.split("\n");return(n=n.filter((function(t){return""!==t.trim()}))).map((function(t){var n,e,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?(e=p,b=function(){Object(c.d)((function(t){var n=e,o=Object(a.d)(n),i="floating-panel-".concat(o);t.ui.floatingPanel.toggleFile(n,{idpanel:i})}))}):"highlight_to_ai"===f?(n=p,b=function(){console.log("CM",r.c,n);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(e){e.ai.search(t,n)}))}):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}}))}},37:function(t,n,e){"use strict";e.d(n,"a",(function(){return o})),e.d(n,"b",(function(){return i}));var o=function(){var t=(new Date).getTime(),n="undefined"!==typeof performance&&performance.now&&1e3*performance.now()||0;return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(e){var o=16*Math.random();return t>0?(o=(t+o)%16|0,t=Math.floor(t/16)):(o=(n+o)%16|0,n=Math.floor(n/16)),("x"===e?o:3&o|8).toString(16)}))},i=function(t){var n=t,e=n.split("?")[1]||"",o=n.split("?")[0],i=o.replace(/[^\w\s]/gi,"_"),c=e.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)}},376:function(module,__webpack_exports__,__webpack_require__){"use strict";__webpack_require__.d(__webpack_exports__,"a",(function(){return useRessourceApi}));var _config_workspace_tiro_notes_client_node_modules_babel_runtime_helpers_esm_construct_js__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__(233),_config_workspace_tiro_notes_client_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__(11),react__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__(0),react__WEBPACK_IMPORTED_MODULE_2___default=__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_2__),_shared_helpers_id_helper__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__(37),_shared_shared_config__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__(17),_managers_sockets_socket_manager__WEBPACK_IMPORTED_MODULE_5__=__webpack_require__(14),_app_loginToken_hook__WEBPACK_IMPORTED_MODULE_6__=__webpack_require__(18),_api_hook__WEBPACK_IMPORTED_MODULE_7__=__webpack_require__(9),_managers_url_manager__WEBPACK_IMPORTED_MODULE_8__=__webpack_require__(46),lodash_es__WEBPACK_IMPORTED_MODULE_9__=__webpack_require__(26),_managers_ressource_manager__WEBPACK_IMPORTED_MODULE_10__=__webpack_require__(223),_managers_devCli_manager__WEBPACK_IMPORTED_MODULE_11__=__webpack_require__(30),_managers_tryCatch_manager__WEBPACK_IMPORTED_MODULE_12__=__webpack_require__(377),h="[RESSOURCE API] ",useRessourceApi=function useRessourceApi(p){var _p=Object(_config_workspace_tiro_notes_client_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_1__.a)({},p),eventBus=_p.eventBus;Object(react__WEBPACK_IMPORTED_MODULE_2__.useEffect)((function(){_managers_sockets_socket_manager__WEBPACK_IMPORTED_MODULE_5__.b.on("getRessourceApiAnswer",(function(t){eventBus.notify(t.idReq,t)})),_managers_sockets_socket_manager__WEBPACK_IMPORTED_MODULE_5__.b.on("getRessourceScan",(function(t){eventBus.notify(t.idReq,t)}))}),[]);var deleteRessource=function(t,cb){var n=Object(_api_hook__WEBPACK_IMPORTED_MODULE_7__.c)("delete-ressource");console.log("".concat(h," delete ressource ").concat(t)),p.eventBus.subscribe(n,cb),_managers_sockets_socket_manager__WEBPACK_IMPORTED_MODULE_5__.b.emit("askRessourceDelete",{path:t,idReq:n,token:Object(_app_loginToken_hook__WEBPACK_IMPORTED_MODULE_6__.b)()})},downloadRessource=function(t,n,cb,e){var o=Object(_api_hook__WEBPACK_IMPORTED_MODULE_7__.c)("download-ressource");p.eventBus.subscribe(o,cb),_managers_sockets_socket_manager__WEBPACK_IMPORTED_MODULE_5__.b.emit("askRessourceDownload",{url:t,folder:n,idReq:o,opts:e,token:Object(_app_loginToken_hook__WEBPACK_IMPORTED_MODULE_6__.b)()})},fetchRessource=function(t,cb,n){n||(n={}),n.disableCache||(n.disableCache=!1),n.returnsPathOnly||(n.returnsPathOnly=!1),"false"===n.disableCache&&(n.disableCache=!1),"true"===n.disableCache&&(n.disableCache=!0),!0===n.disableCache&&console.log(h,"FETCHING => disableCache is true",{url:t,options:n});var e=n.persistentCache?"/.tiro/cache/fetch-persistent/":"/.tiro/cache/fetch/",o=Object(_managers_ressource_manager__WEBPACK_IMPORTED_MODULE_10__.a)("/".concat(e).concat(Object(_shared_helpers_id_helper__WEBPACK_IMPORTED_MODULE_3__.b)(t))),i=function(){fetch(o).then((function(t){return t.text()})).then((function(t){Object(_managers_tryCatch_manager__WEBPACK_IMPORTED_MODULE_12__.a)((function(){return cb(t,o)}))}))},c=function(){cb(o)},a=function(){downloadRessource(t,e,(function(t){var e;t.message&&(null!==(e=n)&&void 0!==e&&e.returnsPathOnly?c():i())}),n)};!0===n.disableCache?a():Object(_managers_url_manager__WEBPACK_IMPORTED_MODULE_8__.a)({url:o,onSuccess:function(){var t;null!==(t=n)&&void 0!==t&&t.returnsPathOnly?c():i()},onFail:function(){a()}})},fetchUrlArticle=function fetchUrlArticle(url,cb,options){var readabilityUrl="https://cdn.jsdelivr.net/npm/moz-readability@0.2.1/Readability.js";fetchRessource(readabilityUrl,(function(readabilityTxt){var r1=eval(readabilityTxt);fetchRessource(url,(function(t){var n=document.implementation.createHTMLDocument("");n.open(),n.write(t),n.close();var e=new r1(n).parse(),o=(null===e||void 0===e?void 0:e.textContent.replaceAll(" ","\n"))||"";o=(o=(o=(o=o.replaceAll(" ","\n")).replaceAll(" ","\n")).replaceAll(" ","\n")).replaceAll(" ","\n");var i=(null===e||void 0===e?void 0:e.content)||"",c=(null===e||void 0===e?void 0:e.title)||"";cb({title:c,text:o,html:i,raw:t})}))}))},ramFetchEvalCache={val:{}},fetchEval=function(t,n,e,cb){e||(e={}),e.disableCache||(e.disableCache=!1),"true"===e.disableCache&&(e.disableCache=!0),console.log(h,"fetchEval",t,n,e);var o=function(e){try{var o=[],i=[];Object(lodash_es__WEBPACK_IMPORTED_MODULE_9__.a)(n,(function(t,n){o.push(n),i.push(t)}));var c=Object(_config_workspace_tiro_notes_client_node_modules_babel_runtime_helpers_esm_construct_js__WEBPACK_IMPORTED_MODULE_0__.a)(Function,o.concat([e])).apply(void 0,i);cb&&cb(c)}catch(r){var a="[ERR remote code] (api.ress.fetchEval): ".concat(r," <br> url: ").concat(t," (more infos in console)");Object(_managers_devCli_manager__WEBPACK_IMPORTED_MODULE_11__.d)("".concat(a))}};!0===e.disableCache&&(ramFetchEvalCache.val[t]=null),ramFetchEvalCache.val[t]&&!0!==e.disableCache?o(ramFetchEvalCache.val[t]):fetchRessource(t,(function(n){o(n),ramFetchEvalCache.val[t]=n}),e)},cleanCache=function(){ramFetchEvalCache.val={},Object(_api_hook__WEBPACK_IMPORTED_MODULE_7__.d)((function(t){t.folders.delete("cache","fetch")}))},scanRessourceFolder=function(t,cb){_shared_shared_config__WEBPACK_IMPORTED_MODULE_4__.a.client.log.socket&&console.log("[CLIENT API] get ressources files ".concat(t));var n=Object(_api_hook__WEBPACK_IMPORTED_MODULE_7__.c)("get-ressources-files-");p.eventBus.subscribe(n,cb),_managers_sockets_socket_manager__WEBPACK_IMPORTED_MODULE_5__.b.emit("askRessourceScan",{folderPath:t,token:Object(_app_loginToken_hook__WEBPACK_IMPORTED_MODULE_6__.b)(),idReq:n})},compressImage=function(t,cb){var n=Object(_api_hook__WEBPACK_IMPORTED_MODULE_7__.c)("compress-image");console.log("".concat(h," compress image ").concat(t.path)),p.eventBus.subscribe(n,cb||function(){}),_managers_sockets_socket_manager__WEBPACK_IMPORTED_MODULE_5__.b.emit("askRessourceImageCompress",{params:t,idReq:n,token:Object(_app_loginToken_hook__WEBPACK_IMPORTED_MODULE_6__.b)()})},ressourceApi={delete:deleteRessource,download:downloadRessource,compressImage:compressImage,scanFolder:scanRessourceFolder,fetch:fetchRessource,fetchEval:fetchEval,fetchUrlArticle:fetchUrlArticle,cleanCache:cleanCache};return ressourceApi}},377:function(t,n,e){"use strict";e.d(n,"a",(function(){return i}));var o=e(30),i=function(t){try{t()}catch(n){Object(o.d)("".concat(n))}}},422:function(t,n){},43:function(t,n,e){"use strict";e.d(n,"g",(function(){return b})),e.d(n,"f",(function(){return g})),e.d(n,"e",(function(){return h})),e.d(n,"a",(function(){return m})),e.d(n,"d",(function(){return v})),e.d(n,"c",(function(){return w})),e.d(n,"b",(function(){return O})),e.d(n,"h",(function(){return j}));e(0);var o=e(17),i=e(29),c=e(56),a=e(14),r=e(93),l=e(90),s=e(213),u=e(75),d=(e(26),e(159)),p=e(117),f=e(1),b=function(t){return Object(r.d)(t,i.a.externalLink3,(function(t){return Object(d.a)(t,{addLineJump:!0})}))},g=function(t,n){var e=Object(u.a)("$1","$2",null,t,!0);return n.replace(i.a.linklink,e)},h=function(t){var n=t.replace(i.a.searchlink,'<a class="search-link preview-link" href="javascript:window.tiroCli.triggerSearch.func(\'$1$2\');">$1</a>');return n=Object(c.a)(n,[[">[__id_",">["],[">[__tags_",">["],[">[__tag_",">["],[" ]</a>","]</a>"]])},m=function(t){var n=t.replace("".concat(Object(a.c)(),"/").concat(o.a.path.staticResources,"/"),"");n=t.replace("".concat(o.a.path.staticResources),"");var e="".concat(Object(a.c)(),"/").concat(o.a.path.staticResources,"/").concat(n);return t.startsWith("http")?t:e},v=function(t,n,e){var o=0,c=Object(r.d)(e,i.a.ressource,(function(e){o++;"".concat(e,"-").concat(o);var i="".concat(function(t,n,e){return Object(s.renderToString)(Object(f.c)(l.a,{markdownTag:t,file:n,windowId:e}))}(e,t,n)," ");return i}));return c},w=function(t,n){return Object(r.d)(n,i.a.image,(function(n){var e=n.split("](")[1].slice(0,-1);return Object(p.a)(n,e,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,"'")}},436:function(t,n){},438:function(t,n){},449:function(t,n){},45:function(t,n,e){"use strict";e.d(n,"a",(function(){return f}));var o=e(6),i=e(7),c=e(21),a=e(22),r=e(13),l=e(30),s=function(t){Object(c.a)(e,t);var n=Object(a.a)(e);function e(t,i,c,a){var r;return Object(o.a)(this,e),(r=n.call(this)).match=t,r.view=i,r.pos=c,r.replacement=a,r}return Object(i.a)(e,[{key:"toDOM",value:function(){return this.replacement({matchs:this.match,view:this.view,pos:this.pos})}},{key:"estimatedHeight",get:function(){return 500}}]),e}(r.g),u={};Object(l.a)("code_mirror","cache_get",(function(){return u}));var d=function(t,n,e,o,i){return new r.e({regexp:t,decoration:function(t,c,a){var l,d=t.input+t.index,p=e.path+o;if(u[p]||(u[p]={}),u[p][d])l=u[p][d];else{var f=new s(t,c,a,n),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,n){return new r.e({regexp:t,decoration:function(t,e,o){return r.a.mark({class:n(t)})}})},f=function(t){var n,e=t.replacement,c=!1!==(null===(n=t.options)||void 0===n?void 0:n.cache);return r.f.fromClass(function(){function n(i){Object(o.a)(this,n),this.decorations=void 0,this.decorations=e?d(t.pattern,e,t.file,t.windowId,c).createDeco(i):p(t.pattern,t.classWrap).createDeco(i)}return Object(i.a)(n,[{key:"update",value:function(n){try{e&&(n.docChanged||n.viewportChanged)?this.decorations=d(t.pattern,t.replacement,t.file,t.windowId,c).updateDeco(n,this.decorations):this.decorations=p(t.pattern,t.classWrap).updateDeco(n,this.decorations)}catch(o){console.warn("[ERROR VIEWPLUGIN CM]",o,n)}}}]),n}(),{decorations:function(t){return t.decorations},provide:function(n){return r.c.atomicRanges.of((function(e){var o,i,c=(null===(o=e.plugin(n))||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}))}})}},451:function(t,n){},46:function(t,n,e){"use strict";e.d(n,"b",(function(){return p})),e.d(n,"c",(function(){return f})),e.d(n,"f",(function(){return g})),e.d(n,"e",(function(){return h})),e.d(n,"d",(function(){return v})),e.d(n,"g",(function(){return w})),e.d(n,"a",(function(){return O}));var o=e(3),i=e(26),c=e(27),a=e(64),r=e(9),l=e(12),s=e(212),u=e(18),d=e(173),p=function(t){return t=(t=t.replaceAll("//","/")).replace(/(http[s]?:)\/([^/])/,"$1//$2")},f=function(t){var n=new URL(t),e=n.hostname.replace(/^www\./,""),o=n.pathname.split("/").filter((function(t){return""!==t.trim()})),i="";return o.length>0&&(i=(i=o[o.length-1]).length>20?i.substring(0,20).replace(/[^A-Za-z0-9-_\ ]/g,""):i.replace(/[^A-Za-z0-9]/g,"")),e.length>15&&(e=e.substring(0,15)),i.length>0?"".concat(e,"/").concat(i):e},b={value:!1},g=function(t,n){b.value&&Object(r.d)((function(t){var e,o=t.ui.windows.active.get(),i=null===o||void 0===o||null===(e=o.content.file)||void 0===e?void 0:e.path,a=null===o||void 0===o?void 0:o.content.view,r=v().array;r=r.filter((function(t){return"filepath"!==t.name&&"view"!==t.name})),i&&a&&(r.unshift({name:"filepath",value:i}),Object(d.a)("/favicon.png"),document.title="Tiro","mobile"===Object(l.a)()?r.unshift({name:"view",value:n}):r.unshift({name:"view",value:a}),m(r),t.file.getContent(i,(function(t){var n=Object(s.a)(t,Object(c.e)(i));if(!(n.length<1)){var e="".concat(n[0].url).concat(Object(u.c)()),o=Object(c.e)(i).filenameWithoutExt||Object(c.e)(i).name;document.title=o,Object(d.a)(e),setTimeout((function(){document.title=o}),300)}})))}))},h=function(t){var n,e;Object(d.a)("/favicon.png"),document.title="Tiro",setTimeout((function(){b.value=!0}),5e3);var o=v().dic,i=null===(n=o.filepath)||void 0===n?void 0:n.value,a=null===(e=o.view)||void 0===e?void 0:e.value;if(i&&a&&"mobile"===Object(l.a)()){var s=Object(c.e)(i);Object(r.d)((function(n){n.ui.browser.goTo(s.folder,s.name,{openIn:"activeWindow"}),t(a)}))}},m=function(t){var n="".concat(a.a.global.protocol).concat(a.a.global.url).concat(a.a.global.port,"/?");Object(i.a)(t,(function(e,o){var i=o<t.length-1?"&":"";n+="".concat(e.name,"=").concat(e.value).concat(i)})),window.history.pushState({},document.title,n)},v=function(){var t,n=[],e={},i=window.location.search,c=new URLSearchParams(i).entries(),a=Object(o.a)(c);try{for(a.s();!(t=a.n()).done;){var r=t.value;n.push({name:r[0],value:r[1]}),e[r[0]]={name:r[0],value:r[1]}}}catch(l){a.e(l)}finally{a.f()}return{array:n,dic:e}},w=function(t){var n="",e=0;for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&t[o]&&(n+="".concat(0===e?"":"&").concat(o.toLowerCase(),"=").concat(t[o]),e++);return n},O=function(t){try{var n=new XMLHttpRequest;return n.open("HEAD",t.url,!1),n.send(),404!==n.status?t.onSuccess():t.onFail()}catch(e){t.onFail(e)}}},47:function(t,n,e){"use strict";e.d(n,"a",(function(){return p})),e.d(n,"b",(function(){return b}));var o=e(11),i=e(0),c=e.n(i),a=e(105),r=e(10),l=e(23),s=e(25),u=e(1),d=function(t){var n=Object(o.a)({},t),e=n.design,c=n.colors,l=n.size;e||(e="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(e," ").concat(!0===s?"with-popup":"no-popup")},t.buttons.map((function(t,n){var e;return t.action&&Object(u.c)("li",{className:"".concat(t.class," btn-").concat(null===(e=t.title)||void 0===e?void 0:e.toLowerCase()),title:t.title,key:n},Object(u.c)(f,t))}))))}),[t.buttons])},p=c.a.memo(d,(function(t,n){return!1})),f=function(t){var n=Object(u.c)(c.a.Fragment,null);t.title&&(n=Object(u.c)(c.a.Fragment,null,t.title));var e=t.size?t.size:1;t.icon&&(n=t.icon.startsWith("fa")||t.icon.includes(".")?Object(u.c)(l.a,{name:t.icon,size:e,color:t.color}):Object(u.c)(l.b,{name:t.icon,size:e,color:t.color})),t.customHtml&&(n=t.customHtml);var o="toolbar-button ".concat(t.class&&t.class," ").concat(t.active&&"active");return Object(u.c)("button",{className:o,onMouseEnter:function(n){t.onHover&&t.onHover()},onClick:function(n){t.action&&t.action(n)}},Object(u.c)("div",{className:"inside-html-wrapper"},n),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")}},476:function(t,n){},478:function(t,n){},479:function(t,n){},484:function(t,n){},486:function(t,n){},492:function(t,n){},494:function(t,n){},513:function(t,n){},525:function(t,n){},528:function(t,n){},53:function(t,n,e){"use strict";e.d(n,"a",(function(){return f})),e.d(n,"b",(function(){return b}));var o=e(6),i=e(7),c=e(21),a=e(22),r=e(0),l=e.n(r),s=e(10),u=e(12),d=e(105),p=e(1),f=function(t){Object(c.a)(e,t);var n=Object(a.a)(e);function e(){var t;Object(o.a)(this,e);for(var i=arguments.length,c=new Array(i),a=0;a<i;a++)c[a]=arguments[a];return(t=n.call.apply(n,[this].concat(c))).canBgClose=!t.props.canBgClose||t.props.canBgClose,t.cssStr=t.props.cssStr?t.props.cssStr:"",t}return Object(i.a)(e,[{key:"render",value:function(){var t=this;return Object(p.c)("div",{className:"".concat(Object(d.a)(this.cssStr,";","")," popup-wrapper-component")},Object(p.c)("div",{className:"overlay-click-popup",onClick:function(n){t.canBgClose&&t.props.onClose()}}),Object(p.c)("div",{className:"popup-wrapper ".concat(Object(u.d)()?"ipad":"")},Object(p.c)("div",{className:"popupTitle"}," ",this.props.title),Object(p.c)("div",{className:"popupContent"},this.props.children)))}}]),e}(l.a.Component),b=function(){return"\n.popup-wrapper-component {\n\t\t\t\tposition: absolute;\n top: 0px;\n left: 0px;\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 .popup-wrapper {\n overflow-y: auto;\n position: fixed;\n z-index:10010;\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")}},56:function(t,n,e){"use strict";e.d(n,"d",(function(){return o})),e.d(n,"b",(function(){return i})),e.d(n,"a",(function(){return c})),e.d(n,"c",(function(){return a}));var o=function(t){var n=t;return n=(n=c(n,[["-",""],["_",""],[" ",""],["/",""],[".md",""],[":",""],["?",""]])).toLowerCase()},i=function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"_";return(t=c(t,[["-",n],["_",n],[" ",n],["/",n]])).replace(/[^\w\s]/gi,"")},c=function(t,n){for(var e=0;e<n.length;e++){var o=n[e];t=t.split(o[0]).join(o[1])}return t};function a(t,n){for(var e=t.split("\n"),o=n.split("\n"),i=Math.max(e.length,o.length),c=[],a=0;a<i;a++)void 0!==e[a]&&void 0!==o[a]?e[a]!==o[a]?c.push('<span class="diff-sign diff-modified">~~~</span> '+o[a]):c.push(o[a]):void 0!==e[a]&&void 0===o[a]?c.push('<span class="diff-sign diff-deleted">---</span> '+e[a]):void 0===e[a]&&void 0!==o[a]&&c.push('<span class="diff-sign diff-added">+++</span> '+o[a]);return c.join("\n")}},568:function(t,n,e){"use strict";e.r(n);var o=e(0),i=e.n(o),c=e(4),a=e(1),r=e(12),l=e(14),s=e(11),u=e(105),d=e(10),p=e(166),f=e(81),b=e(47),g=e(672),h=e(61),m={};window.tiroCli=m;var v=function(t,n){var e,r,l=Object(h.a)("showRenderId",!1),s=Object(c.a)(l,2),u=s[0],d=s[1];e="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[e]=r;var p=Object(g.a)(0,1e3);return Object(o.useMemo)((function(){var n=(new Date).getTime(),e=(new Error).stack,o=(null===e||void 0===e||e.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}),n)},w=function(){var t=Object(o.useState)("navigator"),n=Object(c.a)(t,2),e=n[0],l=n[1];return{mobileView:e,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"===e?"active":""),action:function(){l("navigator")}},{icon:"faPenNib",class:"".concat("editor"===e?"active":""),action:function(){l("editor")}},{icon:"faEye",class:"".concat("preview"===e?"active":""),action:function(){l("preview")}},{icon:"faSearch",class:"",action:function(){t.onButtons[0]&&t.onButtons[0]()}}]})),[e,t.forceRerender])}}},O=e(17),j=e(9),x=function(t,n){var e=Object(o.useRef)();Object(o.useEffect)((function(){e.current=t}),[t]),Object(o.useEffect)((function(){if(null!==n){var t=setInterval((function(){e.current()}),n);return function(){return clearInterval(t)}}}),[n])},y=function(){return"Tiro","Tiro"},k=function(){Object(o.useRef)([]);var t=Object(o.useState)(!1),n=Object(c.a)(t,2),e=n[0],i=n[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;var t=e?"".concat(y()):"".concat(y()," ").concat(f.current);"mobile"!==Object(r.a)()&&(document.title=t)}),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:e,connectionStatusComponent:function(){var t=["connected","connected"];return u&&(t=["back-online","back online"]),e||(t=["disconnected","disconnected"]),Object(a.c)("div",{className:"connection-status"},Object(a.c)("div",{className:t[0]},t[1]))},toggleSocketConnection:b}},_=e(23),C=e(20),E=function(t){return Object(a.c)("button",{className:"new-file-button",onClick:function(n){t.onNewFile()}},Object(a.c)(_.a,{name:"faPlusCircle",color:"white"}),Object(a.c)("span",null,C.a.newNote))},S=i.a.memo(E,(function(t,n){return!0})),T=e(6),I=e(7),P=e(21),N=e(22),A=e(111),R=e(38),F=e(71),L=e(43),M=e(381),D=e(378),z=e(18),B=e(571),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=e(95),J=e(25),G=e(46),K=function(t){Object(P.a)(e,t);var n=Object(N.a)(e);function e(t){var o;return Object(T.a)(this,e),(o=n.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 n=t.getBoundingClientRect().height,e=-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<n+100)-1===e&&(e=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 n=!1;return o.state.selectionEdges[0]<=t&&o.state.selectionEdges[1]>=t&&(n=!0),n},o.itemToScroll=0,o.autoScrollToItem=function(t){var n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];o.itemToScroll=n?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)(e,[{key:"shouldComponentUpdate",value:function(t,n){if(JSON.stringify(t.files)!==JSON.stringify(this.oldFiles)){this.oldFiles=Object(R.a)(t.files),this.liRefs=[];for(var e=0;e<t.files.length;e++)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,n=V.a[this.props.sortMode],e=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)(D.a,null,(function(o){o.height;var r=o.width;return Object(a.c)(M.a,{itemData:t.props.files,className:"List",ref:t.scrollerListRef,height:c,itemCount:t.props.files.length,itemSize:e,width:r||0,onScroll:t.onListScroll},(function(e){var o=e.index,c=e.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 n=[],e=t.state.selectionEdges;n=-1!==e[0]||-1!==e[1]?t.props.files.slice(e[0],e[1]+1):[l],t.props.onFileDragStart(n)},onDragEnd:function(){t.props.onFileDragEnd()},onClick:function(n){if(W["shift"]){var e=[t.props.activeFileIndex,o];e.sort(),t.setState({selectionEdges:e})}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(n){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(n)},Object(F.a)(new Date(("modified"===n?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(G.b)(s.picture+t.getUrlLoginToken()):Object(G.b)("".concat(Object(L.a)(t.props.files[0].folder),"/").concat(s.picture).concat(t.getUrlLoginToken())),"')")}}))))}))}))))}}]),e}(i.a.Component),Y=i.a.memo(K,(function(t,n){return!1})),$=Object(s.a)({},d.a),Z=($.els,$.colors),X=($.font,$.sizes),Q=e(231),tt=e(27),nt=e(39),et=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(n){Object(j.d)((function(e){e.ui.browser.folders.open.add(n),t.onFolderOpen(n)}))},onFolderClose:function(n){Object(j.d)((function(e){console.log("ONFOLDERCLOSE",n),e.ui.browser.folders.open.remove([n]),t.onFolderClose(n)}))},onFolderDragStart:t.onFolderDragStart,onFolderDragEnd:t.onFolderDragEnd,onFolderDrop:t.onFolderDrop}))},ot=function t(n){var e=Object(nt.a)(n.openFolders)?n.openFolders:[],i=e.includes(n.folder.path)&&n.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&&!n.folder.children||i&&n.folder.children&&0===n.folder.children.length?g(!0):g(!1)}),[n.folder.children,i]);var O=Object(tt.a)(n.current,n.folder.key);return Object(a.c)("li",{className:"folder-wrapper ".concat(O?"current":""," "),draggable:!0,onDrop:function(t){console.log("DROP",t),n.folder.key&&(n.onFolderDrop(n.folder),t.stopPropagation())},onDragStart:function(t){n.folder.key&&(n.onFolderDragStart(n.folder),t.stopPropagation())},onDragOver:function(t){w("drag"),t.preventDefault(),t.stopPropagation()},onDragEnd:function(){n.folder.key&&n.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?n.onFolderClose(n.folder.key):n.onFolderOpen(n.folder.key)}},n.folder.hasFolderChildren&&Object(a.c)(_.a,{name:i?"faCaretDown":"faCaretRight",color:d.a.colors.main})),Object(a.c)("span",{className:"title",onClick:function(t){n.onFolderClicked(n.folder.key)}},Object(a.c)("div",{className:"title-drag-bg"}),Object(a.c)("div",{className:"title-label"}," ",n.folder.title)),Object(a.c)("span",{onClick:function(){u(!s)},className:"context-menu-wrapper"},Object(a.c)(_.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(""===n.folder.path)return u(!1);var t=prompt("".concat(C.a.renameFolderPrompt," "),n.folder.title);t&&""!==t&&t!==n.folder.title&&n.onFolderMenuAction("rename",n.folder,t),u(!1)}},C.a.renameFolder),Object(a.c)("li",{onClick:function(){if(""===n.folder.path)return u(!1);Object(j.e)().then((function(t){t.popup.prompt({text:"".concat(C.a.createFolderPrompt,' "').concat(n.folder.path,'"?'),userInput:!0,onAccept:function(t){t&&""!==t&&n.onFolderMenuAction("create",n.folder,t)},onRefuse:function(){}})})),u(!1)}},C.a.createFolder),-1===n.folder.path.indexOf(".tiro/.trash")&&Object(a.c)("li",{onClick:function(){if(""===n.folder.path)return u(!1);u(!1),n.onFolderMenuAction("moveToTrash",n.folder)}},C.a.moveToTrash),-1!==n.folder.path.indexOf(".tiro/.trash")&&Object(a.c)("li",{onClick:function(){if(""===n.folder.path)return u(!1);u(!1),Object(j.e)().then((function(t){t.popup.confirm("".concat(C.a.deleteFolderPrompt,' "').concat(n.folder.path,'"?'),(function(){n.onFolderMenuAction("delete",n.folder)}))}))}},C.a.deleteFolder))))),b&&Object(a.c)("div",{className:"loading"},"..."),i&&Object(a.c)("ul",{className:"folder-children"},n.folder.children&&n.folder.children.map((function(o,i){return Object(a.c)(t,{openFolders:e,key:i,folder:o,current:n.current,onFolderOpen:n.onFolderOpen,onFolderMenuAction:n.onFolderMenuAction,onFolderClose:n.onFolderClose,onFolderClicked:n.onFolderClicked,onFolderDragStart:n.onFolderDragStart,onFolderDragEnd:n.onFolderDragEnd,onFolderDrop:n.onFolderDrop})}))))},it=function(t){var n=Object(s.a)({},t).files,e=Object(nt.a)(n)?n.slice(0,20):[];return Object(a.c)(i.a.Fragment,null,e.length>0&&Object(a.c)("div",{className:"last-notes-component"},Object(a.c)("h3",{className:"subtitle"},C.a.lastNotes),Object(a.c)("ul",null,e.map((function(n,e){var o=n.name.replace(".md","");return o=o.length>20?"".concat(o.substr(0,20)):o,Object(a.c)("li",{key:e,title:o,onClick:function(e){t.onClick(n)},className:"note"},Object(a.c)(_.a,{name:"faFile"}),o)})))))},ct=i.a.memo(it,(function(t,n){return t.files===n.files})),at=e(67),rt=e(53),lt=function(t){var n=Object(o.useContext)(j.a),e=!!n&&n.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(e){if("Enter"===e.key){if(t.term.length<3)return;n&&n.ui.search.search(t.term)}},onChange:function(e){!function(e,o){if(n){var i=n.ui.browser.folders.current.get();""===t.term&&""!==i&&(e=e+" "+i,o&&setTimeout((function(){var t=(o.selectionStart||0)-i.length-1;o.selectionStart=t,o.selectionEnd=t}),10)),n.ui.search.term.set(e)}}(e.target.value,e.target)}}),Object(a.c)("div",{className:"search-status"},e&&C.a.searchingLabel)))},st=e(64),ut=function(t){var n={title:t.realname,folder:t.folder,mobileview:"editor"},e="".concat(st.a.global.protocol).concat(st.a.global.url).concat(st.a.global.port,"?").concat(Object(G.g)(n));window.open(e,"popupDetached","width=600,height=600")},dt=e(34),pt=e(35),ft=function(t){var n=Object(o.useState)(0),e=Object(c.a)(n,2),i=e[0],l=e[1],s=Object(o.useRef)(0);Object(o.useEffect)((function(){u(t.startingIndex)}),[t.startingIndex]);var u=function(t){d(),l(t),s.current=t},d=function(){j(!1),m(10)},p=function(n){j(!1),m(10),-1===n&&0===s.current?s.current=t.images.length-1:1===n&&s.current===t.images.length-1?s.current=0:s.current=s.current+n,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=function(t){var n=t+h;n<0&&(n=0),n>20&&(n=20),m(n)},y=Object(o.useRef)(null),k=(function(){var t="0px";if(y.current){var n=y.current.clientHeight;t="".concat(n-5,"px")}}(),Object(dt.b)((function(t){var n=t.deltaY>0?1:-1;x(n)}),150)),_=Object(o.useRef)(0),C=(Object(dt.b)((function(t){if(2===t.touches.length){var n=t.touches[0].clientY>_.current?1:-1;_.current=t.touches[0].clientY,x(n)}}),150),function(){var n="mobile"===Object(r.a)()?"mobile":"desktop",e=[{class:"left ".concat(n),title:"left",icon:"faChevronLeft",action:function(){p(-1)}},{class:"close",title:"close",icon:"faTimes",action:function(){t.onClose()}},{class:"right ".concat(n),title:"right",icon:"faChevronRight",action:function(){p(1)}}];return O&&(e.unshift({class:"zoom",title:"zoom",icon:"faPlus",action:function(){x(1)}}),e.unshift({class:"dezoom",title:"dezoom",icon:"faMinus",action:function(){x(-1)}})),e.push({class:"zoomToggle",title:"zoomToggle",icon:"magnifying-glass-".concat(O?"minus":"plus"),action:function(){j(!O)}}),e});Object(o.useEffect)((function(){var t=function(){p(1)},n=function(){p(-1)};return Object(pt.a)("right",t),Object(pt.a)("left",n),function(){console.log("destroying lightbox"),Object(pt.c)("right",t),Object(pt.c)("left",n)}}),[]);return Object(a.c)("div",{className:"lightbox-component"},Object(a.c)("div",{className:"lightbox-bg",onClick:function(){t.onClose()}}),Object(a.c)("div",{className:"lightbox-content images-nb-".concat(t.images.length),onWheel:k,ref:y},Object(a.c)("div",{className:"lightbox-main-image-wrapper"},t.images.map((function(n,e){return Object(a.c)("div",{key:e,className:"lightbox-image",style:{display:e===i?"flex":"none"}},Object(a.c)("figure",{className:"zoom2 ".concat(O?"zoomed":"not-zoomed"),style:{backgroundImage:"url(".concat(Object(L.a)(n.url)+Object(z.c)(),")"),backgroundSize:"".concat(h/10*100,"%")},onMouseMove:function(t){!function(t){var n,e,o,i,c=t.currentTarget;n=t.clientX,e=t.clientY,o=n/c.offsetWidth*100,i=e/c.offsetHeight*100;var a=function(t){return(t-50)/("mobile"===Object(r.a)()?1:3)},l=(o+=a(o))+"% "+(i+=a(i))+"%";c.style.backgroundPosition=l}(t)}},Object(a.c)("img",{src:Object(L.a)(n.url)+Object(z.c)(),onClick:function(t){!function(t){var n=t.target.src;t.target.parentElement.style.backgroundImage="url(".concat(n,")"),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"},n.file.name&&n.title&&Object(a.c)("div",{className:"image-name",onClick:function(t){return ut(n.file)}},n.file.name," - ",n.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((function(t,n){return Object(a.c)("div",{key:n,className:"thumbnail"+(n===i?" selected":""),style:{backgroundImage:"url(".concat(Object(L.a)(t.url)+Object(z.c)(),")")},onClick:function(){u(n)}})}))))))},bt=e(26),gt=e(165),ht={onAccept:function(){},onRefuse:function(){}},mt=function(t){var n=Object(o.useState)(!1),e=Object(c.a)(n,2),r=e[0],l=e[1],u=Object(o.useState)(""),d=Object(c.a)(u,2),p=d[0],f=d[1],b=Object(o.useState)(null),g=Object(c.a)(b,2),h=g[0],m=g[1],v=Object(o.useState)(C.a.promptPopup.defaultTitle),w=Object(c.a)(v,2),O=w[0],x=w[1],y=Object(o.useState)(!1),k=Object(c.a)(y,2),_=k[0],E=k[1],S=Object(o.useState)(C.a.promptPopup.accept),T=Object(c.a)(S,2),I=T[0],P=T[1],N=Object(o.useState)(C.a.promptPopup.refuse),A=Object(c.a)(N,2),R=A[0],F=A[1],L=Object(o.useState)(""),M=Object(c.a)(L,2),D=M[0],z=M[1],B=function(t){var n;l(!0),f(t.text),t.acceptLabelButton&&P(t.acceptLabelButton),t.refuseLabelButton&&F(t.refuseLabelButton),null!==(n=t.options)&&void 0!==n&&n.cssStr&&z(t.options.cssStr),t.title&&x(t.title),t.userInput&&m(""),t.onAccept&&(ht.onAccept=t.onAccept),t.onRefuse?(ht.onRefuse=t.onRefuse,E(!0)):E(!1)},W=function(){l(!1),V(!1),m(null),x(""),f(""),E(!1)},U=Object(o.useState)(!1),H=Object(c.a)(U,2),q=H[0],V=H[1],J=Object(o.useState)([]),G=Object(c.a)(J,2),K=G[0],Y=G[1],$=Object(o.useState)([]),Z=Object(c.a)($,2),X=(Z[0],Z[1],Object(o.useRef)({})),Q={title:"Popup Form",insertFilePath:"/popup_form_results.md",insertLine:0,insertStringFormat:"{{name}} | {{age|number}}\n"},tt=Object(o.useState)(Q),nt=Object(c.a)(tt,2),et=nt[0],ot=nt[1],it=Object(o.useRef)(),ct=function(t,cb){Object(j.d)((function(n){n.file.getContent(t,(function(t){var n=t.split("\n"),e=[];n.forEach((function(t){if(t.trim().startsWith("form|")||t.startsWith("form |")){var n=t.split("|");n.shift();for(var o=n.join("|"),i={title:"",fields:[]},c=o.split(","),a=0;a<c.length;a++)c[a].includes("=")||(c[a-1]=c[a-1]+","+c[a],c.splice(a,1),a--);c.forEach((function(t){var n=t.split("="),e=n[0].trim();n.shift();var o=n.join("=").trim();"name"===e&&(i.title=o),"path"===e&&(i.insertFilePath=o),"line"===e&&(i.insertLine=parseInt(o)),"line_format"===e&&(i.insertStringFormat=o)})),e.push(i)}})),cb(e)}),{removeMetaHeader:!0})}))},lt=function(cb){ct("/.tiro/forms.md",cb)},st=function(t,cb){var n=Object(s.a)(Object(s.a)({},Q),t),e=[],o=(n.insertStringFormat||"").match(/{{(.*?)}}/g);null===o||void 0===o||o.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 l,s=[];null!==(l=a)&&void 0!==l&&l.startsWith("select")&&(s=a.split(":")[1].split(",").map((function(t,n){return{key:n,label:t,obj:t}})),a="select");var u=!1;null!==r&&void 0!==r&&r.includes("optional")&&(u=!0),e.find((function(t){return t.id===i}))||e.push({name:i,type:a||"text",description:r||i,selectOptions:s,optional:u,id:i})}})),n.fields=e,console.log("[POPUP > FORM] opening with config:",n),x(n.title),Y(e),ot(n),V(!0),it.current=cb},ut={confirm:function(t,cb,n,e){B({title:"",text:t,onAccept:cb,onRefuse:function(t){function n(){return t.apply(this,arguments)}return n.toString=function(){return t.toString()},n}((function(){n&&n()})),options:e})},show:function(t,n,cb,e){B({title:n,text:t,onAccept:cb,onRefuse:function(){},options:e})},prompt:B,form:{create:st,readConfigFromNote:ct,getAll:lt,open:function(t,cb){lt((function(n){var e=n.find((function(n){return n.title===t}));e?st(e,cb):(console.warn("Form not found",t),Object(j.d)((function(n){n.ui.notification.emit({id:"form-not-found",content:"Form <b>".concat(t,"</b> not found.")})})))}))}}};return{popupApi:ut,PromptPopupComponent:function(){return Object(a.c)(i.a.Fragment,null,q&&Object(a.c)("div",{className:"form-popup-component"},Object(a.c)(rt.a,{title:O,onClose:W,canBgClose:!1,cssStr:D},K.map((function(t,n){return Object(a.c)("div",{key:n,className:"form-input-wrapper"},Object(a.c)(at.a,{label:t.name,explanation:t.description,shouldNotSelectOnClick:!0,type:t.type,list:t.selectOptions,onLoad:function(n){X.current[t.id]=n},onChange:function(n){X.current[t.id]=n},onSelectChange:function(n){X.current[t.id]=n}}),!t.optional&&Object(a.c)("div",{className:"mandatory"},"*"))})),Object(a.c)("br",null),Object(a.c)("button",{value:"submit",className:"accept submit-button",onClick:function(t){!function(){K.forEach((function(t){var n;"date"===t.type&&X.current[t.id]&&(X.current[t.id]=new Date(X.current[t.id]).toLocaleDateString("fr-FR")),"datetime"===t.type&&(X.current[t.id]&&(X.current[t.id]=new Date(X.current[t.id]).toLocaleString("fr-FR")),X.current[t.id]=null===(n=X.current[t.id])||void 0===n?void 0:n.substring(0,X.current[t.id].length-3))}));var t=[];if(K.forEach((function(n){n.optional||X.current[n.id]||t.push(n.name)})),t.length>0)Object(j.d)((function(n){n.ui.notification.emit({id:"insert-form-error",content:"FORM: fields <b>".concat(t.join(", "),"</b> are mandatory.")})}));else{V(!1);var n=et.insertStringFormat;n=n||Q.insertStringFormat,X.current=X.current||{},K.forEach((function(t){X.current[t.id]||(X.current[t.id]="")})),Object(bt.a)(X.current,(function(t,e){var o,i,c=new RegExp("{{".concat(e,"\\|.*?}}"),"g");n=null===(o=n)||void 0===o?void 0:o.replace(c,t);var a=new RegExp("{{".concat(e,"}}"),"g");n=null===(i=n)||void 0===i?void 0:i.replace(a,t)}));var e=Object(gt.a)(),o=new RegExp("{{_datetime}}","g");n=n.replace(o,e.full_fr);var i=new RegExp("{{_date}}","g");n=n.replace(i,e.date_fr);var c=et.insertFilePath||Q.insertFilePath,a=et.insertLine||Q.insertLine;Object(j.d)((function(t){t.file.insertContent(c,n||"",{insertLine:a},(function(e){it.current&&it.current(),it.current=void 0,t.ui.notification.emit({id:"insert-form-success",content:"<b>FORM: line ".concat(a,' insert success</b>: <br><br> "').concat(n,'" <br><br> to <b>').concat(c,"</b>"),options:{onClick:function(){console.log("open file"),Object(j.d)((function(t){t.ui.floatingPanel.openFile(c,{searchedString:n})}))}}})}))})),W()}}()}},I),Object(a.c)("div",{className:"details"},"Form result will be ",et.insertLine," to ",et.insertFilePath," with format: ",et.insertStringFormat))),r&&Object(a.c)("div",{className:"prompt-popup-component"},Object(a.c)(rt.a,{title:O,onClose:W,canBgClose:!1,cssStr:D},Object(a.c)("div",null,Object(a.c)("div",{className:"content",dangerouslySetInnerHTML:{__html:p}}),Object(a.c)("br",null),null!==h&&Object(a.c)("div",null,Object(a.c)("input",{type:"text",value:h,onChange:function(t){m(t.target.value)}}),Object(a.c)("br",null)),Object(a.c)("button",{value:"submit",className:"accept submit-button",onClick:function(t){ht.onAccept(h),W()}},I),_&&Object(a.c)("button",{value:"submit",className:"refuse submit-button",onClick:function(t){ht.onRefuse(h),W()}},R)))))}}},vt=e(222),wt=e(124),Ot=function(t){var n=Object(o.useContext)(j.a),e=Object(o.useState)(-1),i=Object(c.a)(e,2),r=i[0],l=i[1],s=Object(nt.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(e,o){return Object(a.c)(xt,{key:o,tab:e,onDrop:function(t){l(t)},onDragEnter:function(t){l(t)},onDragEnd:function(t){n&&n.tabs.reorder(t,r),l(-1)},dragIndic:r,pos:o,onUpdate:t.onUpdate})})),(null===n||void 0===n?void 0:n.ui.browser.files.active.get)&&Object(a.c)("div",{className:"tab-wrapper tab-more",onClick:function(n){t.onUpdate("add")}},"+"),Object(a.c)("div",{className:"tab-wrapper tab-more",onClick:function(n){t.onPinToggle()}},Object(a.c)(_.b,{name:"thumbtack",size:.8}))))))},jt=function(t){var n=Object(s.a)({},t),e=n.tab,o=n.pos,c="Six",l=e.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(e.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",e)}},"mobile"!==Object(r.a)()&&Object(a.c)("input",{type:"text",className:"tab-input-text",value:e.name,style:{width:10*e.name.length+"px"},onChange:function(n){t.onUpdate("rename",e,n.target.value)}}),"mobile"===Object(r.a)()&&Object(a.c)(i.a.Fragment,null,e.name)),e.grid.layout.length>1&&Object(a.c)("div",{className:"tab-nb-windows",onClick:function(){t.onUpdate("activate",e)}},Object(a.c)(_.a,{name:c,color:"#b2b2b2"})),Object(a.c)("div",{className:"tab-close",onClick:function(){Object(j.d)((function(n){n.popup.confirm("".concat(C.a.deleteTabPrompt,' "').concat(e.name,'"?'),(function(){t.onUpdate("close",e)}))}))}},Object(a.c)(_.a,{name:"faPlus",color:"#b2b2b2"}))))},xt=i.a.memo(jt,(function(t,n){var e=!0,o=Object(R.a)({n:t.tab,p:n.tab});return o.n.grid=o.p.grid={},o.n.refresh=o.p.refresh="",JSON.stringify(o.p)!==JSON.stringify(o.n)&&(e=!1),n.pos!==t.pos&&(e=!1),n.dragIndic!==t.dragIndic&&(e=!1),n.tab.active!==t.tab.active&&(e=!1),n.onUpdate!==t.onUpdate&&(e=!1),e})),yt=e(224),kt=e(188),_t=e(225),Ct=e(167),Et=e(106),St=e(96),Tt=e(103),It=e(15),Pt=e(379),Nt=e(570),At=e(37),Rt=e(140),Ft=function(t){var n=Object(o.useState)(""),e=Object(c.a)(n,2),i=(e[0],e[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(n){n.file.getContent(t.file.path,(function(n){i(n),t.searchedString&&Object(j.d)((function(n){setTimeout((function(){console.log("searchword",t.searchedString,t.replacementString,t.windowId),n.ui.note.editorAction.dispatch({type:"searchWord",searchWordString:t.searchedString,searchReplacementString:t.replacementString,windowId:t.windowId});var e=document.querySelector(".select-wrapper input");e&&(e.focus(),setTimeout((function(){e.focus(),setTimeout((function(){e.focus()}),100)}),50))}),300)}))}))}))}),200));Object(o.useEffect)((function(){u()}),[t.file,t.searchedString,s]);var d=t.height?t.height+"px":"100%",p=Object(o.useState)(t.windowId||Object(At.a)()),f=Object(c.a)(p,2),b=f[0],g=f[1];return Object(o.useEffect)((function(){g(t.windowId||Object(At.a)())}),[t.windowId]),Object(a.c)("div",{className:"note-preview-wrapper "+s,style:{height:d}},Object(a.c)(Rt.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(){}}))},Lt=i.a.memo(Ft,(function(t,n){return JSON.stringify(t)===JSON.stringify(n)})),Mt=e(190),Dt=e(189),zt=e(59),Bt=e(233),Wt=e(384),Ut=e(30),Ht="[PLUGIN CRON]";Object(Ut.a)("cron","trigger",(function(){Jt()}));var qt="plugins-cron-infos",Vt=function(t,n){var e=[],o=[];Object(bt.a)(n,(function(t,n){e.push(n),o.push(t)}));try{Object(Bt.a)(Function,e.concat([t.code])).apply(void 0,o)}catch(c){var i="[ERR in ".concat(t.type.toLocaleUpperCase()," plugin ").concat(t.name.toLocaleUpperCase(),"]: ").concat(c);console.log(i,c,{paramsNames:e,paramsValues:o,plugin:t}),console.trace(c),Object(Ut.d)("".concat(i))}},Jt=function(){var t=(new Date).toJSON().replace("T","").replace("Z","");Object(j.d)((function(n){n.plugins.list((function(e){n.cache.get(qt,(function(o){o||(o={}),Object(bt.a)(e,(function(e){var i,c,a,r=!0;if(!1===(null===(i=e.options)||void 0===i?void 0:i.disabled)&&(r=!1),"background"===e.type&&r){o[e.name]||(o[e.name]={vars:{}});var l=60*((null===(c=e.options)||void 0===c?void 0:c.background_exec_interval_in_min)||60)*1e3,s=(new Date).getTime(),u=(null===(a=o[e.name])||void 0===a?void 0:a.lastRunTime)||0;if(u+l>s)return console.log(Ht,"".concat(t," => \ud83d\udd51\u23f3 bg plugin ").concat(e.name,", wait for ").concat(Math.round((u+l-s)/1e3)," seconds"));var d=u+l>s;console.log(Ht,"".concat(t," => \ud83d\udd51\u25b6\ufe0f exec the bg plugin ").concat(e.name,", last exec was ").concat(new Date(u).toJSON()),{p:e,lastRun:u,intervalRun:l,now:s,status:d});var p=o[e.name];Vt(e,{tiroApi:n,bgState:p}),o[e.name]&&!Object(Wt.a)(o[e.name])||(o[e.name]={vars:{}}),o[e.name].lastRunTime=s}})),n.cache.set(qt,o,-1)}),{disableRamCache:!0})}))}))},Gt=e(28),Kt=function(){var t=Gt.d.curr.privacy_work_mode_enable,n=Gt.d.curr.privacy_work_mode_filters,e=n.split(",");return e.forEach((function(t,n){e[n]=t.trim().toLowerCase()})),{workModeEnabled:t,workModeFilters:n,workModeFiltersArr:e}},Yt=e(382),$t=e(133),Zt=e(127),Xt=e(72),Qt=e(248),tn=15,nn=!1,en=function(){if(nn)return tn;var t=document.createElement("div");t.style.visibility="hidden",t.style.overflow="scroll",t.style.msOverflowStyle="scrollbar",document.body.appendChild(t);var n=document.createElement("div");return t.appendChild(n),tn=t.offsetWidth-n.offsetWidth,t.parentNode.removeChild(t),nn=!0,tn},on=function(t){if(!t)return"";if("file"===t.type)return t.file.name.replace(".md","");if("ctag"===t.type){var n;if("iframe"===(null===(n=t.ctagConfig)||void 0===n?void 0:n.tagName)){var e,o=null===(e=t.ctagConfig)||void 0===e?void 0:e.content;return Object(G.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""},cn=function(t){var n,e,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(n){t.onPanelUpdate&&(console.log("update panel",n),Object(j.d)((function(t){t.ui.floatingPanel.update(n)})))}),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],y=O[1],k=function(){K(),S(!0),y(!0),t.onPanelDragStart()},C=Object(o.useState)(!1),E=Object(c.a)(C,2),S=(E[0],E[1]),T=function(){y(!1),S(!1),t.onPanelDragEnd()},I=Object(o.useRef)({x:0,y:0}),P=Object(o.useState)({x:-9999,y:-9999}),N=Object(c.a)(P,2),A=N[0],R=N[1];Object(o.useEffect)((function(){t.panel.position&&R({x:t.panel.position.x,y:t.panel.position.y})}),[null===(n=t.panel)||void 0===n||null===(e=n.position)||void 0===e?void 0:e.x,null===(i=t.panel)||void 0===i||null===(l=i.position)||void 0===l?void 0:l.y]);var F=function(t,n){var e=arguments.length>2&&void 0!==arguments[2]&&arguments[2];t.touches&&(t=t.touches[0]);var o={x:t.clientX,y:t.clientY};return e&&(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}),M=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 D=Object(o.useState)(t.panel),z=Object(c.a)(D,2),B=(z[0],z[1],function(n){return function(){Object(j.d)((function(e){e.ui.floatingPanel.updatePanelLayout(t.panel.id,n)}))}}),W=Object(dt.a)((function(){T()}),500),U=function(){Object(j.d)((function(n){n.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),J=V[0],G=V[1],K=function(){t.highestVisibleZIndex!==t.panel.zIndex&&Object(j.d)((function(n){n.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(At.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||1},key:t.panel.id,onMouseDown:function(){K()}},Object(a.c)($t.DraggableCore,{cancel:"body",handle:".handle",onStart:function(n,e){Object(r.e)()||(p(Object(s.a)(Object(s.a)({},t.panel),{},{position:F(n,e,!0)})),k())},onDrag:function(n,e){Object(r.e)()||p(Object(s.a)(Object(s.a)({},t.panel),{},{position:F(n,e)}))},onStop:function(n,e){Object(r.e)()||(T(),p(Object(s.a)(Object(s.a)({},t.panel),{},{position:F(n,e)})))}},Object(a.c)(Yt.a,{boundsByDirection:!0,className:"floating-panel",size:t.panel.size,onResize:function(n,e,o,i){Object(r.e)()||(-1===L.current.x&&(L.current={x:A.x,y:A.y}),M.current=-M.current,p("top"===e||"left"===e?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+M.current,height:o.offsetHeight}}):Object(s.a)(Object(s.a)({},t.panel),{},{size:{width:o.offsetWidth+M.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)(_.b,{name:"expand"})),Object(a.c)("ul",null,Object(a.c)("span",{onClick:B("top")}," ",Object(a.c)(_.a,{name:"custom_icons/top.png"})," "),Object(a.c)("span",{onClick:B("bottom")}," ",Object(a.c)(_.a,{name:"custom_icons/bottom.png"})),Object(a.c)("span",{onClick:B("left")}," ",Object(a.c)(_.a,{name:"custom_icons/left.png"})),Object(a.c)("span",{onClick:B("right")}," ",Object(a.c)(_.a,{name:"custom_icons/right.png"})),Object(a.c)("br",null),Object(a.c)("span",{onClick:B("top-right")}," ",Object(a.c)(_.a,{name:"custom_icons/top-right.png"})),Object(a.c)("span",{onClick:B("bottom-right")}," ",Object(a.c)(_.a,{name:"custom_icons/bottom-right.png"})),Object(a.c)("span",{onClick:B("top-left")}," ",Object(a.c)(_.a,{name:"custom_icons/top-left.png"})),Object(a.c)("span",{onClick:B("bottom-left")}," ",Object(a.c)(_.a,{name:"custom_icons/bottom-left.png"})))),action:function(){}},"ctag"===t.panel.type?{title:"Reload content",icon:"rotate-right",action:function(){G(!1),setTimeout((function(){G(!0)}),100)}}:{},{title:"Close window",icon:"xmark",action:function(){Object(j.d)((function(n){n.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)(Lt,{noteParentType:"floating",windowId:t.panel.id||Object(At.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,n){"windowViewChange"===t&&null!==n&&void 0!==n&&n.view&&p(Object(s.a)(Object(s.a)({},d.current),{},{view:n.view}))}})),"ctag"===t.panel.type&&t.panel.ctagConfig&&J&&Object(a.c)("div",{className:"floating-panel__inner-content ctag window-id-sizeref-".concat(X),style:{height:H}},Object(Xt.a)(t.panel.ctagConfig)))))))},an=function(t){var n=Object(nt.a)(t.panels)?t.panels:[],e=Object(o.useRef)([]);Object(o.useEffect)((function(){e.current=n}),[n]);var i=function(t){Object(j.d)((function(n){n.ui.floatingPanel.update(t)}))},l=function(t,n){Object(j.d)((function(e){e.ui.floatingPanel.actionAll(t,n)}))},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&&n.length>h.current&&b(!1),0===n.length&&b(!1);var t=n.filter((function(t){return"visible"===t.status}));t.length>m.current&&b(!1),m.current=t.length,h.current=n.length}),[n]);var v=function(t){Object(j.d)((function(n){n.ui.floatingPanel.updatePanelLayout("active",t)}))},w=["alt+q","alt+w","alt+shift > a","alt+shift > c","alt+shift > w","ctrl + up","ctrl + down","ctrl + left","ctrl + right","shift + ctrl + up","shift + ctrl + right","shift + ctrl + left","shift + ctrl + down","alt+shift > s"],O=[function(){g()},function(){l("toggleWindowsLayout")},function(){l("minimizeActive")},function(){l("closeActive")},function(){l("toggleWindowsLayout",{layout:"current"})},function(){v("top")},function(){v("bottom")},function(){v("left")},function(){v("right")},function(){v("top-right")},function(){v("bottom-right")},function(){v("top-left")},function(){v("bottom-left")},function(){l("deminimizeFirst")}];Object(o.useEffect)((function(){return w.forEach((function(t,n){Object(pt.a)(t,O[n])})),function(){w.forEach((function(t,n){Object(pt.c)(t,O[n])}))}}),[n]);var x=Object(o.useState)(!1),y=Object(c.a)(x,2),k=y[0],C=y[1],E=function(t){return function(){C("start"===t)}},S=Object(o.useState)(!1),T=Object(c.a)(S,2),I=T[0],P=T[1];Object(o.useEffect)((function(){if(!I&&0!==e.current.length){var t=Object(R.a)(e.current);Object(nt.a)(t)||(t=[]),P(!0),t.forEach((function(t){"minimized"===t.status&&(t.status="hidden")})),Object(j.d)((function(n){n.ui.floatingPanel.updateAll(t)}))}}),[I,n]);var N=Object(o.useState)([]),A=Object(c.a)(N,2),F=A[0],L=A[1],M=Object(o.useState)(0),D=Object(c.a)(M,2),z=D[0],B=D[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;n.forEach((function(n){void 0!==n.zIndex&&n.zIndex>t&&(t=n.zIndex)})),B(t),q(n.filter((function(t){return"visible"===t.status})).length);var o=Object(R.a)(e.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(Qt.a)(r,(function(t){return t.orderPosition})),L(r)}),100);Object(o.useEffect)((function(){V()}),[n]);var J=Object(o.useState)(!1),G=Object(c.a)(J,2),K=G[0],Y=G[1],$=Object(dt.a)((function(t){Y(Object(Zt.a)(t))}),100);return Object(o.useEffect)((function(){$(n)}),[n]),Object(a.c)("div",{className:"floating-panels-wrapper",style:{pointerEvents:k?"all":"none"}},Object(nt.a)(n)&&n.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)(cn,{panel:t,onPanelUpdate:i,onPanelDragStart:E("start"),onPanelDragEnd:E("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+en(),"px"),bottom:"-".concat(en(),"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(n.length>8?15*n.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)(_.b,{name:"layer-group"})," "),Object(a.c)("div",{className:"btn-action toggle-visibility",onClick:g}," ",!0===d?Object(a.c)(_.b,{name:"eye-slash"}):Object(a.c)(_.b,{name:"eye"})," "),Object(a.c)("div",{className:"btn-action pin-bar",onClick:function(){return t.onPinChange(!t.pinStatus)}}," ",Object(a.c)(_.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(n){!function(t){t.status="visible",i(t),Object(j.d)((function(n){n.ui.floatingPanel.pushWindowOnTop(t.id),n.ui.floatingPanel.updateOrderPosition(t.id,"first"),n.ui.floatingPanel.resizeWindowIfOutOfWindow(t.id)}))}(t)}},Object(a.c)("div",{className:"label-wrapper"},Object(a.c)("div",{className:"label",title:on(t)},on(t))),Object(a.c)("div",{className:"close-btn",onClick:function(n){n.stopPropagation(),"minimized"===t.status?function(t){t.status="hidden",i(t)}(t):function(t){Object(j.d)((function(n){n.ui.floatingPanel.delete(t.id)}))}(t)}},Object(a.c)(_.b,{name:"xmark"})))})))))},rn={charsStart:2},ln=[{label:"loading...",value:""}],sn="[\ud83d\udd0e Search Mode]",un="[\ud83d\udcc1 Explorer Mode]",dn="[\u2728 History Mode]",pn="[\ud83d\udd0c Plugin Mode]",fn="[\ud83d\udda5\ufe0f Floating Windows]",bn={dict:{},config:{enabled:!0}},gn=function(){bn.config.enabled=!1,bn.dict={}},hn={hasBeenLoaded:!1},mn=function(t){var n=Object(o.useState)("editable"),e=Object(c.a)(n,2),i=e[0],l=e[1];Object(o.useEffect)((function(){L.current.focus()}),[i]);var u=Object(o.useState)([]),p=Object(c.a)(u,2),f=p[0],b=p[1],g=Object(o.useRef)([]),h=function(t){Object(nt.a)(t)&&(b(t),g.current=t)},m=Object(o.useState)([]),v=Object(c.a)(m,2),w=v[0],O=v[1],x=function(t){nn(t),O(t)},y=Object(o.useState)("No Options"),k=Object(c.a)(y,2),C=k[0],E=(k[1],function(n){Object(j.d)((function(e){e.ui.note.editorAction.dispatch({type:"insertText",insertText:Object(Dt.a)(n)}),t.onClose()}))}),S=function(n){Object(j.d)((function(e){e.ui.floatingPanel.create({type:"file",file:n}),t.onClose()}))},T=function(t){var n=Object(o.useState)(!1),e=Object(c.a)(n,2),i=e[0],l=e[1];return Object(o.useMemo)((function(){return Object(a.c)("div",{className:"path-option-wrapper device-".concat(Object(r.a)()),onMouseEnter:function(t){l(!0)},onMouseLeave:function(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:function(n){n.stopPropagation(),E(t.file)}},Object(a.c)(_.b,{name:"link",label:"insert note link in the current note"})),Object(a.c)("div",{className:"action",onClick:function(n){n.stopPropagation(),S(t.file)}},Object(a.c)(_.b,{name:"window-restore",label:"Open note in a floating window"}))))}),[t.file,i])},I=function(t){return Object(a.c)(T,{file:t})},P=window.innerHeight-160-200,N=(Object(o.useRef)(!1),Object(o.useState)({indicatorsContainer:function(t,n){return Object(s.a)(Object(s.a)({},t),{},{display:"none"})},menuList:function(t,n){var e="mobile"===Object(r.a)()?{}:{maxHeight:P};return Object(s.a)(Object(s.a)({},t),e)},menu:function(t,n){var e="mobile"===Object(r.a)()?"all":"none";return Object(s.a)(Object(s.a)({},t),{},{position:"relative",pointerEvents:e})},control:function(t,n){return Object(s.a)(Object(s.a)({},t),{},{outline:"none",boxShadow:"none",border:0})},multiValue:function(t,n){return n.data.editable?t:Object(s.a)(Object(s.a)({},t),{},{backgroundColor:d.a.colors.main})},multiValueLabel:function(t,n){var e=Object(s.a)(Object(s.a)({},t),{},{color:"#919090!important"});return Object(s.a)({},e)},multiValueRemove:function(t,n){var e="mobile"===Object(r.a)()?"block":"none";return n.data.editable?t:Object(s.a)(Object(s.a)({},t),{},{display:e,opacity:"0.2",position:"relative",top:"3px"})}})),A=Object(c.a)(N,2),R=A[0],F=A[1];Object(o.useEffect)((function(){setTimeout((function(){R.menu=function(t,n){var e=(Object(r.a)(),"all");return Object(s.a)(Object(s.a)({},t),{},{position:"relative",pointerEvents:e})},F(R)}),500)}),[]);var L=Object(o.useRef)(),M=w[0]||{label:"",value:""},D=function(n){var e=Object(tt.e)(n);z.current?(console.log("jumpToFileModifier",z.current),t.onClose(),S(e)):Object(j.d)((function(n){n.ui.browser.goTo(e.folder,e.name,{openIn:"activeWindow"}),t.onClose()}))},z=Object(o.useRef)(!1),B=["alt"],W=[function(){z.current=!0}];Object(o.useEffect)((function(){return B.forEach((function(t,n){Object(pt.a)(t,W[n])})),function(){B.forEach((function(t,n){Object(pt.c)(t,W[n])}))}}),[]);var U=Object(o.useState)(""),H=Object(c.a)(U,2),q=H[0],V=H[1],J=Object(o.useRef)(null);Object(o.useEffect)((function(){J.current=q}),[q]);var G=Object(o.useRef)(""),K=Object(zt.a)("omni-history",[],{history:!0}),Y=Object(c.a)(K,3),$=Y[0],Z=Y[1],X=Y[2];Object(o.useEffect)((function(){!function(){var n=g.current,e=q.trim();if(On("editor"),0===n.length)"/"===e&&(Object(Mt.a)("omnibar_explorer"),Object(j.d)((function(t){V("");var n=t.ui.browser.folders.current.get();ht(n)}))),""===e&&xt(),";"===e&&(V(""),jn()),"?"===e&&(Object(Mt.a)("omnibar_search"),mt()),":"===e&&yt(),","===e&&rt();else if(n[0].label===sn)wt(n,e);else if(n[0].label===un){var o,i=function(){var t=Object(It.a)(n);t.shift();var e="";return Object(bt.a)(t,(function(t){e+="/"+t.value})),e}();if("createNewFile"===(null===(o=n[n.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")){var c=Object(It.a)(n);c.pop(),""===q&&c.push({label:q,value:q}),lt(c),i=i.replace(n[0].label,""),D(i)}else G.current!==i&&(G.current=i,ht(i))}else n[0].label===pn?kt(e,n):n[0].label===dn?st(e,n):n[0].label===fn&&xn(e,n)}(),_t.current&&_t.current()}),[f,q]);var Q=function(t){return t.replaceAll("[","").replaceAll("]","")},et='[OMNIBAR "ctrl+alt+space"] type "?" for '.concat(Q(sn),', "/" for ').concat(Q(un),', ":" for ').concat(Q(pn),', "," for ').concat(Q(dn),', ";" for ').concat(Q(fn)),ot=Object(o.useState)(et),it=Object(c.a)(ot,2),ct=it[0],at=it[1],rt=function(){h([{value:dn,label:dn}])};Object(o.useEffect)((function(){hn.hasBeenLoaded||(X(),gt.current=window.__Tiro_omniCacheFoldersRam,hn.hasBeenLoaded=!0)}),[]);var lt=function(t){console.log("1/2 [HIST mode]: addToOmniHistory",Object(It.a)(t));var n=[];Object(bt.a)(t,(function(t){n.push(t.label)}));var e=n.join(" "),o={options:t,id:e},i=$.filter((function(t){return t.id!==e})),c=[o].concat(Object(It.a)(i));c.length>100&&c.splice(0,100),console.log("2/2 [HIST mode] add to omnihist ",{nItem:o,nItems:c}),Z(c)},st=function(t,n){if(Wt(null),n[1]){if(n[1]){var e;console.log("HIST selected",n[1]);var o=null===(e=n[1].payload)||void 0===e?void 0:e.options;if(!o)return;var i=o.pop();i&&V(i.label),h(o)}}else at("loading history mode..."),X((function(t){var n=[];Object(bt.a)(t,(function(t){n.push({label:t.id,value:t.id,payload:t})})),at("history mode"),x(n)})),","===t&&V("")},ut=Object(o.useRef)(0),ft=Object(o.useRef)(""),gt=Object(o.useRef)(window.__Tiro_omniCacheFoldersRam||{}),ht=function(t){var n=Object(tt.b)(t),e='Explorer mode for "'.concat(n,'"'),o='Loading explorer mode for "'.concat(n,'"...');if(at(e),""!==t&&(t.endsWith("/")||(t+="/"),t!==ft.current)){ft.current=t,console.log("== EXPLORER",t),x(ln),l("locked"),ut.current++;var i=ut.current;if(gt.current[t]){console.log("[OMNI > EXPLORER] using cache for ".concat(t));for(var c=gt.current[t],r=0;r<c.length;r++){var s,u=c[r];u.label.props&&(c[r].label=I(null===u||void 0===u||null===(s=u.payload)||void 0===s?void 0:s.file))}x(c)}var d=t.split("/"),p=[];p.push({value:un,label:un}),p.push({value:"/",label:"/"}),Object(bt.a)(d,(function(t){""!==t&&p.push({value:t,label:t+"/"})})),h(p),Object(j.d)((function(n){at(o);var c=[t];n.folders.get(c,(function(o){if(i===ut.current&&(o.folderPaths.join("")===c.join("")&&o.folders[0])){var r=o.folders[0].children;n.files.get(t,(function(n,o){if(o===t){var i=[];Object(a.c)("div",{style:{},className:"barimage"});i.push({value:"",label:"\u2795 create file",payload:{action:"createNewFile"}}),Object(bt.a)(r,(function(t){var n=t.path.split("/"),e=n[n.length-1]+"/";i.push({value:e,label:"\ud83d\udcc1 "+e})})),n=Object(Nt.a)(n,["modified"],["desc"]),Object(bt.a)(n,(function(t){var n=t.path.split("/"),e=n[n.length-1],o={file:t},c=I(t);i.push({value:e,label:c,payload:o})})),x(i),l("editable"),gt.current[t]=i,window.__Tiro_omniCacheFoldersRam=gt.current,at(e)}}))}}))}))}},mt=function(){h([{value:sn,label:sn}])},vt=Object(o.useRef)(""),wt=function(t,n){if(t[1]){if(2===t.length)On("editor"),jt(n,t[1].label,t);else if(3===t.length&&Ot.current===t[2].value)On("preview"),console.log("STEP 3-1 (optional) : filter found results",Ot.current);else if(3===t.length||4===t.length){var e;console.log("STEP 3-2 : jump to page",{w:Ot.current,stags:t});var o=t.length-1;if(null===(e=t[o].payload)||void 0===e||!e.file)return;var i=t[o].payload.file;D(i.path)}}else"?"===n&&Object(j.d)((function(t){var n=t.ui.browser.folders.current.get;V(n)})),""===n?V(vt.current):vt.current=n.slice(0,-1),at('Path to search (ex:"/path/to/folder") + ENTER'),x([{label:n,value:n}])},Ot=Object(o.useRef)(null),jt=Object(dt.a)((function(t,n,e){var o=n,i=t;if(i&&o&&i.length>=rn.charsStart&&o.length>0){at('Searching "'.concat(i,'" in "').concat(o,'" ...')),x(ln);var c=i.includes("*"),r=[];x(r),Ot.current=i,lt([].concat(Object(It.a)(e),[{label:i,value:i}])),Object(j.d)((function(t){t.search.word(i,o,(function(t){Object(bt.a)(t,(function(t){Object(bt.a)(t.results,(function(n){var e=c?"(".concat(i,")"):"",o="".concat(t.file.path," ").concat(e),l=n.indexOf(i),s=100,u=n,d=l>50?l-50:0,p=l+50<u.length?l+50:u.length;u.length>s&&(u=u.substring(d,p));var 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"},o),Object(a.c)("div",{className:"occur-wrapper",dangerouslySetInnerHTML:{__html:b}}));r.push({label:g,value:Ot.current+t.file+f+o,payload:{file:t.file,line:f,raw:n}})}))})),0===r.length&&Wt(null),r.unshift({label:"\ud83d\udd0e Filter the ".concat(r.length,' results for "').concat(Ot.current,'"'),value:Ot.current}),at("".concat(r.length-1,' results found for "').concat(i,'" in "').concat(o,'" ')),x(r)}))}))}else at("Type the searched word"),x([]),setTimeout((function(){L.current.focus()}),100),Wt(null),Ot.current=""}),500),xt=function(){var n;at(et);var e=function(t){var n=[];return Object(bt.a)(t,(function(t){var e={value:t.path,label:I(t),payload:{file:t}};n.push(e)})),n}(function(t){var n=Kt(),e=n.workModeEnabled,o=n.workModeFilters,i=n.workModeFiltersArr;if(!e)return t;var c=[];return Object(bt.a)(i,(function(n){var e=t.filter((function(t){return t.name.toLowerCase().includes(n)||t.path.toLowerCase().includes(n)}));c.push.apply(c,Object(It.a)(e))})),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(e.length>=2){var o=e.shift(),i=e.shift();e.unshift(o),e.unshift(i)}var c=e[0]?null===(n=e[0].payload)||void 0===n?void 0:n.file:null;c&&Wt(c),x(e)},yt=function(){h([{value:pn,label:pn}])},kt=function(n,e){Wt(null),Object(j.d)((function(o){if(1===e.length){var i=[];o.plugins.list((function(t){Object(bt.a)(t,(function(t){"bar"===t.type&&i.push({label:t.name,value:t})})),x(i),":"===n&&V(""),i=Object(Nt.a)(i,["label"]),at("".concat(i.length," bar plugins found"))}))}else if(e.length>=2){var c={input:n,setInputTxt:V,inputTxt:q,inputTxtRef:J,options:w,setOptions:x,onChange:_t,onClose:t.onClose,onHide:t.onHide,close:t.onClose,hide:t.onHide,selectedOptionRef:g,setSelectedOption:h,addToOmniHistory:lt,selectedTags:e,setNotePreview:Wt,notePreview:Ft,setHtmlPreview:Jt,htmlPreview:qt,disableCache:gn},a=e[1].value;x(ln),Object(j.d)((function(t){Vt(a,{barApi:c,tiroApi:t})}))}}))},_t=Object(o.useRef)(null),Ct=Object(o.useState)(Object(At.a)()),Et=Object(c.a)(Ct,2),St=Et[0],Tt=(Et[1],Object(o.useState)(null)),Rt=Object(c.a)(Tt,2),Ft=Rt[0],Bt=Rt[1],Wt=function(t){Bt(t)},Ut=Object(o.useState)(null),Ht=Object(c.a)(Ut,2),qt=Ht[0],Jt=Ht[1],Gt=Object(o.useState)(void 0),Yt=Object(c.a)(Gt,2),$t=Yt[0],Zt=Yt[1],Xt=function(t,n){var e=g.current;e[0]&&e[0].label===un?Wt(t):e[0]&&e[0].label===sn?(Wt(t),setTimeout((function(){Zt(n)}),300)):e[0]?Wt(null):Wt(t)},Qt=Object(o.useRef)([]),tn=Object(dt.a)((function(){var t=document.querySelectorAll("div[id*='-option']");if(0===t.length)return Wt(null);Object(bt.a)(t,(function(t){if("rgb(222, 235, 255)"===getComputedStyle(t)["background-color"]){var n=parseInt(t.id.split("-").pop()),e=w[n].payload;if(!e)return;var o=e.file,i=e.line||void 0;Xt(o,i)}}))}),400),nn=Object(dt.a)((function(t){!function(t){Object(bt.a)(Qt.current,(function(t){t.disconnect()})),Qt.current=[];var n=document.querySelectorAll("div[id*='-option']");Object(bt.a)(n,(function(t,n){var e=new MutationObserver((function(n){var e=parseInt(t.id.split("-").pop());if("rgba(0, 0, 0, 0)"!==getComputedStyle(t)["background-color"]&&w[e]&&w[e].payload){var o=w[e].payload;if(!o)return;var i=o.file,c=o.line||void 0;document.querySelectorAll("div[id*='-option']"),Xt(i,c)}}));e.observe(t,{childList:!0,attributes:!0,subtree:!1}),Qt.current.push(e)}))}()}),100);Object(o.useEffect)((function(){nn(w)}),[w,q,$]);var en=Object(o.useState)(300),cn=Object(c.a)(en,2),an=cn[0],bn=cn[1],mn=Object(o.useRef)(null);Object(dt.a)((function(){if(mn&&mn.current){var t=mn.current.clientHeight+30,n=window.innerHeight-t-50;an!==n&&bn(n)}}),10)();var vn=Object(o.useState)("editor"),wn=Object(c.a)(vn,2),On=(wn[0],wn[1]),jn=function(){h([{value:fn,label:fn}]),Object(j.d)((function(t){var n=[];x(n),Object(bt.a)(t.ui.floatingPanel.panels,(function(t){"visible"!=t.status&&n.push({label:on(t),value:t,payload:{floatingPanel:t}})})),x(n),at("".concat(n.length," floating windows found"))}))},xn=function(n,e){if(Wt(null),2===e.length){var o,i=null===(o=e[1].payload)||void 0===o?void 0:o.floatingPanel;if(!i)return;Object(j.d)((function(t){t.ui.floatingPanel.deminimizePanel(i.id)})),t.onClose()}};return Object(a.c)("div",{className:"omnibar-popup-bg ".concat(t.show?"":"hide"),onClick:function(n){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:function(t){t.stopPropagation()}},Object(a.c)("div",{className:"select-wrapper",ref:mn},Object(a.c)("div",{className:"help"},ct),Object(a.c)("div",{className:"help-right",onClick:function(n){t.onHide()}},Object(a.c)(_.a,{name:"faEyeSlash",color:"#b2b2b2"})),Object(a.c)(Pt.a,{isMulti:!0,ref:L,menuIsOpen:!0,defaultValue:M,value:f,autoFocus:!0,isDisabled:"locked"===i,onChange:function(t,n){var e=t[0];if(e&&e.payload&&e.payload.file){var o=e.payload.file;D(o.path),t=[]}h(t)},openMenuOnClick:!1,inputValue:q,onInputChange:function(t,n){tn(),"input-blur"===n.action||"menu-close"===n.action||V(t)},onFocus:function(t){},options:w,styles:R,noOptionsMessage:function(){return C}})),Ft&&"mobile"!==Object(r.a)()&&Object(a.c)("div",{className:"preview-wrapper ".concat(Ft?"note-preview":"html-preview-wrapper"),style:{height:an}},Ft&&"mobile"!==Object(r.a)()&&Object(a.c)(Lt,{noteParentType:"omnibar",file:Ft,showToolbar:!0,titleEditor:!1,searchedString:$t,height:an,windowId:St}),qt&&Object(a.c)("div",{className:"html-preview",dangerouslySetInnerHTML:{__html:qt},style:{height:an}})))))},vn=function(t){var n=Object(o.useState)(""),e=Object(c.a)(n,2),r=e[0],l=e[1];return Object(o.useEffect)((function(){Object(j.d)((function(n){n.file.getContent(t.filePath,(function(e){var o=Object(tt.e)(t.filePath),i=n.note.render({raw:e,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}})))},wn=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)(vn,{filePath:t.filePath})))},On=e(159),jn=e(242),xn=e(229),yn=e(234),kn="[NOTIFICATIONS]";Object(Ut.a)("notification","emit",(function(t,n){var e=t||"";Object(j.d)((function(o){console.log(t,n),o.ui.notification.emit({content:(new Date).toJSON()+" \n\n <br/> test notif => \n"+e,options:Object(s.a)({},n)})}))}));var _n=function(t){var n=Object(o.useState)([]),e=Object(c.a)(n,2),i=e[0],r=e[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(n){return!0===!n?console.log("[NOTIFS] notifications disabled, not displaying it"):function(t){var n=Kt(),e=n.workModeEnabled,o=(n.workModeFilters,n.workModeFiltersArr);if(!e)return!0;var i=!1;return Object(bt.a)(o,(function(n){t.toLowerCase().includes(n)&&(i=!0)})),i}(t.notification.content)?(t.notification.id||(t.notification.id=Object(At.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 n,e=1e3*((null===(n=t.options)||void 0===n?void 0:n.hideAfter)||10);e<0||t.id&&(s.current[t.id]=setTimeout((function(){f(t.id)}),e))},d=function(t){l.current=l.current.filter((function(n){return n.id!==t.id})),t.id&&s.current[t.id]&&clearTimeout(s.current[t.id]),l.current.unshift(t),r(Object(It.a)(l.current))},p=function(t){var n,e;null!==(n=t.options)&&void 0!==n&&n.onClickId&&function(t){console.log(kn,"triggerNotifOnClick => ",t);var n=yn.a[t];n?n():console.log(kn,"no fn found for idFn",t)}(null===(e=t.options)||void 0===e?void 0:e.onClickId)},f=function(t){t&&(l.current=l.current.filter((function(n){return n.id!==t})),r(Object(It.a)(l.current)))},b=function(t){var n,e,o="normal";return null!==(n=t.options)&&void 0!==n&&n.type&&(o=null===(e=t.options)||void 0===e?void 0:e.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(n){p(t),f(t.id)}},Object(a.c)("div",{className:"notif-close",onClick:function(n){f(t.id)}},Object(a.c)(_.b,{name:"close"})),Object(a.c)("div",{className:"notif-content",dangerouslySetInnerHTML:{__html:t.content}}))}))))},Cn=e(221),En=e(75),Sn=function(t){var n,e,i=Object(tt.e)(t.notePreview.filepath);Object(o.useEffect)((function(){u("note-preview-popup-wid-".concat(Object(At.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(n){var e,o=Object(tt.e)(t.notePreview.filepath);o&&null!==(e=t.notePreview.opts)&&void 0!==e&&e.windowIdToOpenIn&&(Object(En.d)(!0),Object(j.d)((function(n){var e;n.ui.browser.goTo(o.folder,o.name,{openIn:null===(e=t.notePreview.opts)||void 0===e?void 0:e.windowIdToOpenIn})})))}}),Object(a.c)("div",{className:"page-link-preview-popup-int"},Object(a.c)(Lt,{noteParentType:"popup",file:i,searchedString:null===(n=t.notePreview.opts)||void 0===n?void 0:n.searchedString,replacementString:null===(e=t.notePreview.opts)||void 0===e?void 0:e.replacementString,windowId:s,showToolbar:!0,titleEditor:!1,view:"editor",linkPreview:!1})))},Tn=400,In=300,Pn=e(122),Nn=e(90),An=e(99),Rn=window._tiro_generatePluginsMarketplaceHtml?window._tiro_generatePluginsMarketplaceHtml:function(){},Fn=function(t){var n=Object(o.useState)([]),e=Object(c.a)(n,2),i=e[0],r=e[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 n=Rn({pluginsDescriptions:t,fullDisplayMode:!0,onPluginClick:function(t){console.log("pluginClick",t)},onSettingChange:function(t){console.log("onSettingChange",t)}});d(n)}))}))}),[]),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...")))},Ln=e(137),Mn=e(246),Dn=e(216),zn=e(226),Bn=e(227),Wn=e(232),Un=function(t){var n=t.url;(n=n.trim()).includes("?")?n+="&autoplay=1&mute=1":n+="?autoplay=1&mute=1";var e=Object(o.useState)(!1),i=Object(c.a)(e,2),r=i[0],l=i[1];return Object(o.useEffect)((function(){setTimeout((function(){l(!0)}),3e3)}),[]),Object(a.c)("div",{className:"background-video",style:{width:"".concat(t.width,"%"),height:"".concat(t.height,"%")}},r&&Object(a.c)("iframe",{src:"".concat(n),allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share"}))},Hn=e(228),qn=e(230),Vn=(Object(r.a)(),Object(s.a)({},d.a)),Jn=Vn.els,Gn=Vn.colors,Kn=(Vn.font,Vn.sizes),Yn=Object(Mn.a)((function(t,n,e,o){return Xn(t,n,e,o)}),(function(){for(var t=arguments.length,n=new Array(t),e=0;e<t;e++)n[e]=arguments[e];return JSON.stringify(n)})),$n=Object(Mn.a)((function(t){return Zn(t)}),(function(){for(var t=arguments.length,n=new Array(t),e=0;e<t;e++)n[e]=arguments[e];return JSON.stringify(n)})),Zn=function(t){var n=Object(Ln.a)("CssAppDynamic"),e=Gt.d.curr.ui_layout_background_image_enable,o=Gt.d.curr.ui_layout_background_image,i=100,c=100,a=Gt.d.curr.ui_layout_background_video_enable;if(!0===e&&!1===a){var l=o.indexOf("?token=");l>0&&(o=o.substring(0,l)),(o+="?token=".concat(Object(z.b)())).startsWith("http")||(o="".concat(Object(L.a)(o)))}!0!==a&&!0!==e||(i=parseInt(Gt.d.curr.ui_layout_background_image_window_opacity)/100,c=parseInt(Gt.d.curr.ui_layout_background_image_window_opacity_active)/100);var s="\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(e?"background-image: url('".concat(o,"');"):"","\n\t\t\n\t\tbackground-size: cover;\n\t\t.react-grid-item {\n\t\t\topacity: ").concat(i,";\n\t\t}\n\t\t.react-grid-item.active {\n\t\t\topacity: ").concat(c,";\n\t\t}\n\n\t\t").concat("\n.background-video {\n position: fixed;\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(Pn.d)(),"\n\t\t// FILE RESSOURCE PREVIEW\n\t\t").concat(Object(Nn.b)(),"\n\t\t// PREVIEW LINK\n\t\t").concat(Object(En.b)(),"\n\t\t").concat(Object(An.e)(),"\n\n\t\t").concat(Object(Wn.b)(),"\n\n\t\t").concat(Object(_.c)(),"\n\t\t").concat(Object(zn.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(Tn,"px;\n height: ").concat(In,"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(Tt.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(J.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\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\t.popup-wrapper {\n\t\t\tinput, select {\n\t\t\t\twidth: 90%;\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(yt.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(J.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(Ct.b)(),"\n\n\t\t").concat(Object(Et.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(J.a)(-3),"px;\n margin-bottom: 4px;\n overflow: hidden;\n height: ").concat(15,"px;\n list-style: none;\n font-size:").concat(Object(J.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(St.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(jn.b)(),"\n\n\t\t").concat(Object(rt.b)(),"\n\t\t").concat(Object(On.b)(t),"\n\t\t").concat(Object(xn.b)(),"\n\t\t").concat(Object(Dn.b)(),"\n\t\t").concat(Object(Bn.b)(),"\n\t\t").concat(Object(qn.b)(),"\n\t\t").concat(Object(Hn.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(Rt.b)(),"\n\t\t").concat(Object(f.b)(),"\n\t\t").concat(Object(St.b)(),"\n\t\t").concat(Object(kt.b)(),"\n\t\t").concat(Object(_t.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(J.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(J.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(Gn.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(Gn.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\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(Kn.search.padding,"px;\n\t\t\t\t\t\t\t\theight: ").concat(Kn.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(Kn.block,"px ").concat(Kn.block,"px ").concat(Kn.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(Gn.l2.text,";\n\t\t\t\t\t\t\t\t\t\t\t\tfont-size: ").concat(Object(J.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(Gn.l2.text,";\n\t\t\t\t\t\tbutton {\n\t\t\t\t\t\t\t\tcolor: ").concat(Gn.l2.text,";\n\t\t\t\t\t\t\t\t").concat(Jn().button,"\n\t\t\t\t\t\t\t\tpadding: 0px;\n\t\t\t\t\t\t\t\tmargin-right: ").concat(Kn.block,"px; \n\t\t\t\t\t\t\t\tfont-size: ").concat(Object(J.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(J.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(J.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(Gn.l2.bg,"; \n\t\t\t\t\t.image-gallery-header {\n\t\t\t\t\t\t\tpadding-top: ").concat(Kn.search.padding,"px;\n\t\t\t\t\t\t\theight: ").concat(Kn.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(J.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(wt.b)(),"\n\n\t\t\t\n\t\t\t").concat(Object(vt.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 n(),Object(u.a)(s,";","")},Xn=function(t,n,e,o){var i=Object(Ln.a)("CssAppDynamic"+t+n),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(Cn.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(wt.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}\n\t\t} // end main-wrapper\n");return i(),Object(u.a)(c,";","")},Qn=function(t){return t.path.substr(0,t.path.length-(t.title.length+1))},te=function(t){var n=t.split("/");(n=n.filter((function(t){return""!==t}))).pop();var e="/"+n.join("/")+"/";return e=e.replaceAll("//","/")},ne="\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",ee=function(t,n,e,o){var i=function(t,n){console.log("[MOVEFILE] ".concat(t," -> ").concat(n)),Object(j.e)().then((function(e){e.file.move(t,n,(function(){e&&e.ui.browser.goTo(e.ui.browser.folders.current.get())}))}))};return{askForMoveFile:i,promptAndBatchMoveFiles:function(n){var e=n.files,o=n.folderToDropInto,c="Move <p>".concat(null===e||void 0===e?void 0:e.length,'</p> file(s) to <p>"').concat(o.key,'"</p>?\n<br>\n<br>\nRessources links will be automatically updated<br>\n').concat(ne,"\n");Object(j.d)((function(n){n.popup.confirm(c,(function(){!function(){for(var n=0;n<e.length;n++){var c=e[n],a="".concat(c.path),r="".concat(o.key,"/").concat(c.name);i(a,r),t()}}()}))}))},promptAndMoveFolder:function(e){var o=Object(s.a)({},e),i=o.folder,c=o.folderToDropInto,a=o.folderBasePath,r=o.newTitle,l=o.renameOnly,u=[i.path,"".concat(l?Qn(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(ne,"\n"),b=function(){!function(t,n,cb){console.log("[MOVEFOLDER] ".concat(t," -> ").concat(n)),Object(j.d)((function(e){e.folders.move(t,n,(function(){e&&e.ui.browser.goTo(e.ui.browser.folders.current.get()),cb&&cb()}))}))}(d,p,(function(){t(),n(),e.onMoveFn&&e.onMoveFn()}))};e.disablePrompt?b():Object(j.e)().then((function(t){t.popup.confirm(f,(function(){b()}))}))}}},oe="[LAST FILE]",ie=O.a.client.log.verbose,ce=[".tiro/answers/"],ae=function(t){var n=Object(zt.a)("files-history",[],{history:!1,debouncedSave:5e3}),e=Object(c.a)(n,3),a=e[0],r=e[1],l=e[2],s=i.a.useRef(a);Object(o.useEffect)((function(){s.current=a}),[a]),Object(o.useEffect)((function(){ie&&console.log(oe," activeFile changed!",t),t&&u(t)}),[t]);var u=function(t){if(!function(t){for(var n=0,e=ce;n<e.length;n++){var o=e[n];if(t.includes(o))return!0}return!1}(t.path)){ie&&console.log(oe,"Add to last notes",t.name);var n=s.current;if(!(n.length>0&&n[0].name===t.name)){var e=!0,o=-1,i=n;!1===Object(nt.a)(n)&&(i=[]);for(var c=0;c<n.length;c++)n[c].name===t.name&&(e=!1,o=c);e||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(oe," removing ").concat(t," from last notes"));var n=Object(R.a)(a);n=n.filter((function(n){return n.path!==t})),r(n)},addToHistory:function(t){!(arguments.length>1&&void 0!==arguments[1])||arguments[1]?d(t):u(t)}};return{filesHistory:a,filesHistoryRef:s,cleanLastFilesHistory:function(){r([])},refreshFilesHistoryFromBackend:l,lastFilesHistoryApi:p}},re=function(){var t=Object(o.useState)(!1),n=Object(c.a)(t,2),e=n[0],i=n[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:e,frr:u,responsiveRefreshCounter:l,setResponsiveRefresh:s}},le=e(161),se=e(239),ue=e(91),de=function(t){var n=Object(o.useState)({}),e=Object(c.a)(n,2),i=e[0],r=e[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 n=f+1>=V.a.length?0:f+1;Object(j.d)((function(e){e.userSettings.set("ui_filesList_sortMode",n),b(n),t.onSortFiles(Object(V.d)(t.files,n))}))}},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)(_.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(n){t.onFileClicked(n)},onFileDragStart:t.onFileDragStart,onFileDragEnd:t.onFileDragEnd,onVisibleItemsChange:function(t){!function(t){for(var n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],e=[],o=0;o<t.length;o++){var c=t[o];i[c]&&!n||e.push(c)}e.length>1&&Object(j.d)((function(t){t.files.getPreviews(e,(function(t){Object(bt.a)(t,(function(t){i[t.path]=t})),r(i),s()}))}))}(t,!0)}})))},pe=function(){var t="[NOTE HISTORY] ",n=O.a.client.log.verbose,e=Object(o.useRef)({}),i=function(){return(new Date).getTime()},c=function(e,o,i){n&&console.log("".concat(t," saveNoteHistory ").concat(e)),l.b.emit("createHistoryFile",{filePath:e,content:o,historyFileType:i,token:Object(z.b)()})};return{save:c,intervalSave:function(o,a){var r=e.current[o];(!r||r&&r+6e4<i())&&(n&&console.log("".concat(t," ").concat(o,", time ").concat(1," expired/inexistand, PROCEED BACKUP")),c(o,a,"int"),e.current[o]=i())}}},fe=function(t){var n=Object(o.useState)(!1),e=Object(c.a)(n,2),i=e[0],a=e[1],r=Object(o.useState)([]),l=Object(c.a)(r,2),u=l[0],d=l[1];return{isConnected:t.isConnected,searching:{get:i,set:a},ipsServer:{get:u,set:d,getLocal:function(){var t=u[0];return Object(bt.a)(u,(function(n){n.startsWith("192.168")&&(t=n)})),t}},refresh:Object(s.a)(Object(s.a)({},t.refresh),{},{increment:function(){t.refresh.set(t.refresh.get+1)}})}},be=e(138),ge="[PWA]",he=O.a.client.log.verbose,me=function(){he&&console.log(ge," init"),"serviceWorker"in navigator&&navigator.serviceWorker.register("/service-worker.js"),window.addEventListener("beforeinstallprompt",(function(t){t.preventDefault(),he&&console.log(ge," beforeinstallprompt WORKING=>",t),window.deferredPrompt=t}))},ve=e(170),we=e(29),Oe=function(t){var n=t;return n=(n=(n=(n=(n=(n=(n=(n=(n=(n=(n=(n=(n=n.replace(we.a.ressource,"")).replace(we.a.ref,"")).replace(we.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")},je=function(t){return t.replace(/(\r\n\r\n|\n\n|\r\r|\n)/gm,".")},xe=function(){var t=[];return window.speechSynthesis.getVoices().forEach((function(n,e){var o=n.lang?" (".concat(n.lang,")"):"",i="".concat(n.name).concat(o);t.push({key:e,label:i,obj:n})})),t},ye=function(t){return t=(t=(t=(t=t.replace(/\u2019/g,"'")).replace(/\u201c/g,'"')).replace(/[^a-zA-Z0-9]/g,"")).trim()},ke=function(t,n,e){var o=Gt.d.curr.tts_sentences_per_part,i=_e(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,n.length);var a=-1;return Object(bt.a)(n,(function(t,n){Object(bt.a)(i,(function(e,o){if(-1==a&&-1!==ye(t).indexOf(ye(e)))return a=n-o+1,!1}))})),a},_e=function(t,n){for(var e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:70,o=(t=je(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%n===0&&(r.push(a),a=""),(a+=c[l]).split(" ").length>e&&(r.push(a),a="")}return r=r.filter((function(t){return t.length>1}))},Ce=function(t,n){for(var e=(t=je(t)).split(/[.!?]+/),o=[],i=0;i<e.length;i++){var c=e[i];if(c.length>n)for(var a=c.split(" "),r="",l=0;l<a.length;l++)((r+=a[l]+" ").length>n||l===a.length-1)&&(o.push(r),r="");else o.push(c)}return o},Ee=Object(I.a)((function t(n){var e=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=Ce,this.loadVoice=function(t){console.log("[TTS] LOAD VOICE",t),e.voice=t,e.pause(),e.play()},this.updateSpeed=function(t){e.speed=t,e.pause(),e.play()},this.play=function(){if(e.isLoaded)window.speechSynthesis.resume();else{if(e.currChunkId>e.chunkedText.length-1)return console.log("[TTS] finished played");e.isLoaded=!0,e.currSpeechObj=new SpeechSynthesisUtterance,e.currSpeechObj.text=e.chunkedText[e.currChunkId],e.currSpeechObj.rate=e.speed,e.voice&&(e.currSpeechObj.voice=e.voice),setTimeout((function(){window.speechSynthesis.speak(e.currSpeechObj)}),0),e.currSpeechObj.addEventListener("end",(function(){e.isLoaded=!1,e.shouldStop?e.shouldStop=!1:(e.currChunkId+=1,e.play())}))}},this.isPlaying=function(){var t=window.speechSynthesis.speaking;return t&&(t=!window.speechSynthesis.paused),t},this.pause=function(){e.stop()},this.stop=function(){e.shouldStop=!0,e.isLoaded=!1,e.debounceReinitStop(),window.speechSynthesis.cancel()},this.debounceReinitStop=Object(A.a)((function(){e.shouldStop=!1}),1e3),this.goToChunk=function(t){t<=0||t>e.chunkedText.length-1||(e.currChunkId=t,e.isPlaying()&&e.debounceRestart())},this.extractToChunkPos=ke,this.getCurrentChunkText=function(){return e.chunkedText[e.currChunkId]},this.debounceRestart=Object(A.a)((function(){e.stop(),e.play()}),500),this.goBack=function(){e.goToChunk(e.currChunkId-1)},this.goForward=function(){e.goToChunk(e.currChunkId+1)},this.rawText=n.text,this.text2read=Oe(n.text),this.chunkedText=this.chunkText(this.text2read,this.chunkLength),console.log("[TTS] init new manager ",{p:n,text:this.chunkedText,length:this.chunkedText.length})})),Se=e(32),Te=e(44),Ie="[SCREEN WAKE LOCK]",Pe=null,Ne=function(){var t=Object(Te.a)(Object(Se.a)().mark((function t(){return Object(Se.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:Pe=t.sent,console.log(Ie,"ACTIVE"),t.next=10;break;case 7:t.prev=7,t.t0=t.catch(0),console.log(Ie,"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)}}(),Ae=function(){Pe&&Pe.release().then((function(){Pe=null,console.log(Ie,"DISABLED")}))};var Re=function(t){var n=Object(o.useState)(!1),e=Object(c.a)(n,2),i=e[0],l=e[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?Ne():Ae(),m(t)},w=Object(h.a)("tts-pos-".concat(t.id),0),O=Object(c.a)(w,2),j=O[0],y=O[1],k=Object(h.a)("tts-rate",1),E=Object(c.a)(k,2),S=E[0],T=E[1],I=Object(o.useState)(0),P=Object(c.a)(I,2),N=P[0],A=P[1],R=Object(o.useState)(""),F=Object(c.a)(R,2),L=F[0],M=F[1];Object(o.useEffect)((function(){var t=function(t){var n=0,e="".concat(Math.ceil(t),"m");if(t>60){n=Math.floor(t/60);Math.ceil(t%60);e="".concat(n,"h")}return e},n=t(6*(N-j)/(60*S)),e=t(6*N/(60*S)),o=" ".concat(n," left of ").concat(e);M(o)}),[N,S,j]);var D=Object(o.useRef)();window.tts=D,Object(o.useEffect)((function(){D.current=new Ee({text:t.fileContent}),D.current.goToChunk(j)}),[]),Object(o.useEffect)((function(){D.current.updateSpeed(S)}),[S]);var z=Object(o.useRef)(!1);return x((function(){l(D.current.isPlaying());var n=-1;(n=0!==D.current.currChunkId?D.current.currChunkId:D.current.currChunkId=1,t.startString&&!z.current)&&(n=D.current.extractToChunkPos(t.startString,D.current.chunkedText,D.current.chunkLength),D.current.goToChunk(n),z.current=!0);-1!==n&&y(n),A(D.current.chunkedText.length)}),500),Object(o.useEffect)((function(){var n=D.current.getCurrentChunkText();t.onUpdate({totalChunks:N,currentChunk:j,isPlaying:i,currentText:n})}),[N,j,i]),Object(a.c)(Fe,null,Object(a.c)(rt.a,{title:"".concat(C.a.ttsPopup.title),onClose:function(){D.current.stop(),t.onUpdate({totalChunks:N,currentChunk:j,isPlaying:!1}),t.onClose()}},Object(a.c)(at.a,{value:d,type:"select",list:xe(),label:C.a.ttsPopup.voice,onSelectChange:function(t){!function(t){p(t);var n=xe();n[d]&&D.current.loadVoice(n[d].obj)}(parseInt(t))}}),Object(a.c)("span",null," SPEED : "),Object(a.c)("input",{className:"speed-range",type:"range",value:S,min:"0.5",max:"2",step:"0.1",onChange:function(t){var n=t.target.value;T(n)}})," (",S,")",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:N,onChange:function(t){var n=parseInt(t.target.value);D.current.goToChunk(n),y(n)}})," / ",N,Object(a.c)("br",null),Object(a.c)("input",{type:"range",value:j,className:"range-pos",min:"0",max:N,onChange:function(t){var n=parseInt(t.target.value);D.current.goToChunk(n),y(n)}}),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){D.current.goBack()}},Object(a.c)(_.a,{name:"faFastBackward",color:"black"})),Object(a.c)("button",{onClick:function(t){i||D.current.goToChunk(j),i?D.current.stop():D.current.play()}},Object(a.c)(_.a,{name:i?"faPause":"faPlay",color:"black"})),Object(a.c)("button",{onClick:function(t){D.current.goForward()}},Object(a.c)(_.a,{name:"faFastForward",color:"black"})),"desktop"!==Object(r.a)()&&Object(a.c)("button",{onClick:function(t){v(!0)}},Object(a.c)(_.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)(_.a,{name:"faUnlock",color:"black"}))))},Fe=Object(ve.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;}}"}),Le=function(){var t=Object(o.useState)(!1),n=Object(c.a)(t,2),e=n[0],i=n[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,n){var e=(n=n||{}).id?n.id:null,o=n.startString?n.startString:null,c=t.length<1500?t:t.substring(0,1500)+"..., total size chars = "+t.length;console.log("[TTS API]","open",{id:e,contentSub:c,startString:o}),s(e),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:e,syncTtsStatus:function(t){v.current=t}}},Me=function(){var t=Object(o.useState)(null),n=Object(c.a)(t,2),e=n[0],i=n[1];return{notePreviewPopupApi:{open:function(t,n,e){var o=n[0],c=n[1];Tn+o>window.innerWidth&&(o-=Math.abs(window.innerWidth-Tn-o-10)),In+c>window.innerHeight&&(c-=Math.abs(window.innerHeight-In-c-10)),"50%"===o&&(o="calc(50% - ".concat(Tn/2,"px)")),"50%"===c&&(c="calc(50% - ".concat(Tn/2,"px)")),i({isOpen:!0,filepath:t,position:n=[o,c],opts:e})},close:function(){i(null)}},notePreviewPopup:e,setNotePreviewPopup:i}},De=e(41),ze=e(176),Be=e(173),We=function(t){console.log("createNewNote",t),Object(j.d)((function(n){var e=t.folderPath||n.ui.browser.folders.current.get();n.file.create(e,(function(o){var i=Object(V.c)(o);i&&("floatingWindow"===t.openIn?n.ui.floatingPanel.create({type:"file",file:i,view:"editor"}):i&&n.ui.browser.goTo(e,i.name,{openIn:"activeWindow"}))}))}))},Ue=e(128);var He="[TtsCustomPopup] ",qe=function(t){var n=Object(o.useState)(!1),e=Object(c.a)(n,2),i=e[0],l=e[1],s=Object(o.useRef)(!1),u=function(t){l(t),s.current=t},d=Object(h.a)("tts-selected-voice",0),p=Object(c.a)(d,2),f=(p[0],p[1],Object(h.a)("tts-rate",1)),b=Object(c.a)(f,2),g=b[0],m=b[1],v=Object(o.useRef)(g),w=Object(zt.a)("tts-word-stats",0,{debug:!1}),O=Object(c.a)(w,3),y=O[0],k=O[1],E=O[2],S=Object(o.useRef)(0);Object(o.useEffect)((function(){E((function(t){"number"===typeof t&&(S.current=t)}))}),[]);var T=Object(o.useState)(!1),I=Object(c.a)(T,2),P=I[0],N=I[1],A=function(t){!0===t?Ne():Ae(),N(t)},R=Object(h.a)("tts-pos-".concat(t.id),0),F=Object(c.a)(R,2),L=F[0],M=F[1],D=Object(o.useState)(""),z=Object(c.a)(D,2),B=z[0],W=z[1],U=Object(o.useState)(!0),H=Object(c.a)(U,2),q=H[0],V=H[1],J=Object(o.useRef)(""),G=function(t){var n=t.replaceAll("".concat(He,":"),"");n=n.replaceAll(He,""),J.current=n+"<br>"+J.current;if(J.current.split("<br>").length>50){var e=J.current.split("<br>");J.current=e.slice(0,50).join("<br>"),J.current=J.current+"<br>~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"}W(J.current)},K=Object(o.useState)([]),Y=Object(c.a)(K,2),$=Y[0],Z=Y[1];Object(o.useEffect)((function(){var n=$[L];n&&(n=n.split(/[.?!:]/)[0]),t.onUpdate({totalChunks:$.length,currentChunk:L,isPlaying:i,currentText:n})}),[$,L,i]),Object(o.useEffect)((function(){var n=Oe(t.fileContent),e=Gt.d.curr.tts_sentences_per_part,o=_e(n,e);Z(o),console.log("".concat(He,": loading and chunking text in ").concat(o.length," parts"))}),[t.fileContent]);var X=function(){ot(!1),u(!1)},Q=Object(o.useRef)(!1),tt=Object(dt.a)((function(t){var n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];X(),bt(t,(function(n){if(!n.includes("ERROR")){if(ft.current[t]!==n)return;G("".concat(He,": \u25b6\ufe0f playing chunk ").concat(t)),st(n,(function(){ut()}))}}));var e=Gt.d.curr.tts_preload_parts;if(n)for(var o=1;o<=e;o++)t+o<=$.length&&bt(t+o,(function(){}))}),500),nt=tt,et=Object(o.useRef)(null),ot=function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];void 0===window.tiro_tts_allAudiosRef&&(window.tiro_tts_allAudiosRef=[]);for(var n=0;n<window.tiro_tts_allAudiosRef.length;n++)window.tiro_tts_allAudiosRef[n].pause();!0===t&&(window.tiro_tts_allAudiosRef=[])},it=Object(o.useRef)(L),ct=function(t){M(t),it.current=t},at=Object(o.useRef)(0);x((function(){var t,n,e,o=Math.round(null===(t=et.current)||void 0===t?void 0:t.currentTime),i=null===(n=et.current)||void 0===n?void 0:n.duration,c=null===(e=et.current)||void 0===e?void 0:e.paused,a=Math.round(i);G("".concat(He,": audio status: ").concat(o,"s/").concat(a,"s ").concat(c?"paused":"playing"," ").concat(s.current?"isPlaying":"isNotPlaying"," ")),Object(Ue.a)(i)&&!isNaN(a)&&"NaN"!=="".concat(a)||(G("".concat(He,": \u274c audio ERROR detected ").concat(at.current," times (timeAudio: ").concat(i,", roundTimeAudio: ").concat(a,")")),at.current>=2&&(G("".concat(He,": \u274c>> audio ERROR, stopping and restarting")),at.current=0,nt(it.current,!1,!1)),at.current=at.current+1)}),5e3);var lt=Object(o.useRef)(null),st=function(t,n){if(X(),!0!==Ot.current){u(!0);var e=null;lt.current?(e=lt.current).src=t:(e=new Audio(t),lt.current=e),function(t){void 0===window.tiro_tts_allAudiosRef&&(window.tiro_tts_allAudiosRef=[]),window.tiro_tts_allAudiosRef.push(t)}(e),et.current=e,e.oncanplaythrough=function(){!0!==Q.current&&(G("".concat(He,": audio LOADED, start PLAY, ").concat(Q.current)),e.play(),pt(v.current))},e.onended=function(){G("".concat(He,": audio ENDED")),et.current=null,e.remove(),u(!1),n()}}},ut=function(){if(it.current<$.length-1){var t=it.current+1;G("".concat(He,": \ufe0f\u23ed next chunk ").concat(t)),nt(t),ct(t)}},pt=function(t){et.current.playbackRate=t},ft=Object(o.useRef)([]),bt=function(t,cb){var n=Gt.d.curr.tts_custom_engine_command,e=$[t];if(!e||0===e.length)return G("".concat(He,": \u26a0\ufe0f chunk ").concat(t," is empty, do not download"));var o=(null===e||void 0===e?void 0:e.split(" ").length)||0;"number"===typeof o&&"number"===typeof S.current&&(S.current=S.current+o,k(S.current+o));var i="[".concat(o," words]");n=n.replace("{{input}}",e);var c=!1,a=function(t){c||(cb(t),c=!0)};if(ft.current[t]){a(ft.current[t]);ft.current.filter((function(t){return null!==t}))}else{var r=Date.now();Object(j.d)((function(e){e.command.exec(n,(function(n){if(!c){var e=n.match(/https?:\/\/[^\s]+\.(mp3|wav)/g);if(e&&e[0]){var o=Date.now()-r,l="[".concat(o,"ms]");G("".concat(He,": \ud83d\udce5 [ok] API done for chunk ").concat(t," ").concat(i," ").concat(l)),ft.current[t]=e[0],new Audio(e[0]).preload="auto",a(e[0])}else{var s=n;try{var u=JSON.parse(n);s="".concat(u.stderr," - ").concat(u.shortMessage),G("".concat(He,": \ud83d\udce5\u274c [!! error] chunk ").concat(t,": API answer error: ").concat(s," ").concat(i))}catch(d){}a("ERROR: API")}}}))}))}};Object(o.useEffect)((function(){G("=====================================================================")}),[]),Object(o.useEffect)((function(){nt(L)}),[$,L]);var gt=Object(o.useRef)(!1);x((function(){if(t.startString&&!gt.current){var n,e=ke(t.startString,$);n=e,gt.current=!0;var o=t.startString.substring(0,100),i="".concat(He,' \ud83d\udd0e found startString "').concat(o,'" at chunk ').concat(e);-1===e&&(i="".concat(He,' \ud83d\udd0e NOT FOUND startString "').concat(o,'" at chunk ').concat(e)),G(i),-1!=n&&ct(n)}}),500),x((function(){if(!0===s.current){if(!et.current)return;if(!et.current.src)return;et.current.play()}}),3e3);var ht=Object(o.useState)(""),mt=Object(c.a)(ht,2),vt=mt[0],wt=mt[1];Object(o.useEffect)((function(){var t=function(t){var n=0,e="".concat(Math.ceil(t),"m");if(t>60){n=Math.floor(t/60);Math.ceil(t%60);e="".concat(n,"h")}return e},n=Gt.d.curr.tts_sentences_per_part,e=$.length*n,o=t(6*(e-L)/(60*g)),i=t(6*e/(60*g)),c=" ".concat(o," left of ").concat(i);wt(c)}),[$,g,L]);var Ot=Object(o.useRef)(!1);return Object(a.c)(Ve,null,Object(a.c)(rt.a,{title:"".concat(C.a.ttsPopup.title),onClose:function(){console.log("".concat(He,": audio DESTROYED")),ot(!0),u(!1),Q.current=!0,ot(!0),Ot.current=!0;var n=$[L];n&&(n=n.split(/[.?!:]/)[0]),t.onUpdate({totalChunks:$.length,currentChunk:L,isPlaying:!1,currentText:n}),t.onClose()}},Object(a.c)("span",null," SPEED : "),Object(a.c)("input",{className:"speed-range",type:"range",value:g,min:"0.5",max:"3",step:"0.1",onChange:function(t){var n,e=t.target.value;m(n=e),v.current=n,pt(v.current)}})," (",g,")",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:L,min:"0",max:$.length,onChange:function(t){var n=parseInt(t.target.value);ct(n),nt(n)}})," / ",$.length,Object(a.c)("br",null),Object(a.c)("input",{type:"range",value:L,className:"range-pos",min:"0",max:$.length,onChange:function(t){var n=parseInt(t.target.value);ct(n),nt(n)}}),Object(a.c)("div",{className:"estimated-time"},Object(a.c)("b",null,"Reading Time")," :",vt),Object(a.c)("div",{className:"buttons"},Object(a.c)("button",{onClick:function(t){!function(){if(0!==it.current){var t=it.current-1;G("".concat(He,":\ufe0f\u23ee prev chunk ").concat(t)),nt(t),ct(t)}}()}},Object(a.c)(_.a,{name:"faFastBackward",color:"black"})),Object(a.c)("button",{onClick:function(t){i?(u(!1),et.current.pause(),G("".concat(He,": \u23f8\ufe0f paused"))):nt(L)}},Object(a.c)(_.a,{name:i?"faPause":"faPlay",color:"black"})),Object(a.c)("button",{onClick:function(t){ut()}},Object(a.c)(_.a,{name:"faFastForward",color:"black"})),"desktop"!==Object(r.a)()&&Object(a.c)("button",{onClick:function(t){A(!0)}},Object(a.c)(_.a,{name:"faLock",color:"black"}))),Object(a.c)("div",{onClick:function(t){return V(!q)},className:"log-button"}," details "),q&&"number"===typeof y&&Object(a.c)("div",{className:"stats"},"API Words sent: ",y,Object(a.c)("br",null),"Estimated time spoken: ",y/10/60/2<60?"".concat(Math.round(y/10/60/2)," minutes"):"".concat(Math.round(y/10/60/2/60*10)/10," hours (").concat(Math.round(y/10/60/2)," mins)"),Object(a.c)("br",null),"Estimated price : ",Math.round(y*Gt.d.curr.tts_price_per_word*1e5)/1e5,Object(a.c)("br",null),Object(a.c)("button",{onClick:function(){k(0),S.current=0}}," reset stats")),q&&Object(a.c)("div",{className:"log-wrapper"},Object(a.c)("div",{dangerouslySetInnerHTML:{__html:B}}))),P&&Object(a.c)("div",{className:"bg-lock"},Object(a.c)("button",{onContextMenu:function(t){A(!1)}},Object(a.c)(_.a,{name:"faUnlock",color:"black"}))))},Ve=Object(ve.a)("div",{target:"e1bujtpy0"})({name:"11wye7o",styles:".stats{font-size:10px;padding:10px;}.log-button{cursor:pointer;color:#0000ff;margin-top:10px;text-align:center;font-size:12px;}.log-wrapper{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;}}"}),Je=e(134);window.location.pathname.startsWith("/public_site")?Object(Je.b)(Object(a.c)((function(){Object(o.useEffect)((function(){me(),console.log("========= [APP PUBLIC] MOUNTED on a ".concat(Object(r.a)())),Object(l.d)().then((function(t){Object(j.d)((function(n){n.status.ipsServer.set(t.ipsServer),n.ui.browser.folders.refreshFromBackend()}))}))}),[]);var t=k(),n=t.isConnected,e=(t.connectionStatusComponent,t.toggleSocketConnection,re()),i=(e.forceResponsiveRender,e.responsiveRefreshCounter),c=e.setResponsiveRefresh,s=fe({isConnected:n,refresh:{get:i,set:c}}),u=Object(le.b)(),d=(u.tabs,u.updateTab,u.refreshTabsFromBackend,u.updateActiveTabGrid,u.refreshWindowGrid,u.tabsApi),p=u.windowsApi,f=Object(ue.b)(),b=f.lightboxApi,g=(f.lightboxImages,f.lightboxIndex,mt()),h=(g.PromptPopupComponent,g.popupApi),m=pe(),v=Le(),O=v.ttsApi,x=(v.ttsPos,v.ttsPopup,v.setTtsPopup,v.ttsPopupContent,v.ttsPopupId,v.syncTtsStatus,Me()),y=x.notePreviewPopupApi,_=(x.notePreviewPopup,Object(j.f)({popupApi:h,tabsApi:d,windowsApi:p,statusApi:s,historyApi:m,notePreviewPopupApi:y,lightboxApi:b,ttsApi:O})),C=_,E=C.ui.browser.files,S=C.ui.browser.folders,T=(S.scan,S.clean,S.base,ae(E.active.get)),I=(T.filesHistory,T.filesHistoryRef,T.cleanLastFilesHistory,T.refreshFilesHistoryFromBackend,T.lastFilesHistoryApi);C.lastNotesApi=I;var P=ee((function(){E.active.set(-1)}),(function(){_.ui.browser.files.set([])})),N=(P.askForMoveFile,P.promptAndMoveFolder,P.promptAndBatchMoveFiles,w());return N.mobileView,N.setMobileView,N.MobileToolbarComponent,window.api=C,Object(a.c)("div",null,"hello world public app",window.location.pathname)}),null),document.getElementById("root")):Object(Je.b)(Object(a.c)((function(){Object(o.useEffect)((function(){return setTimeout((function(){console.log(Ht,"starting frontendBackgroundPlugins Cron"),setInterval((function(){Jt()}),6e4)}),Object(g.a)(1e3,1e4)),me(),console.log("========= [APP] MOUNTED on a ".concat(Object(r.a)())),Object(l.d)().then((function(t){Y(!0),Ft&&Ft.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 n=H(t);Object(B.a)(W[n])||(W[n]=!0);var e="".concat(n,"-down");q[e]&&q[e]()},window.onkeyup=function(t){var n=H(t);Object(B.a)(W[n])||(W[n]=!1);var e="".concat(n,"-up");q[e]&&q[e]()},Object(Ut.a)("init","init",(function(){})),function(){console.log("app will unmount")}}),[]);var t=function(){setTimeout((function(){Object(G.e)(en)}),300)},n=function(){Lt.active.set(-1)},e=function(){Rt.ui.browser.files.set([])},u=function(t){var n=Object(o.useState)(!1),e=Object(c.a)(n,2),r=e[0],s=e[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],y=Object(o.useState)(),k=Object(c.a)(y,2),_=k[0],E=k[1],S="[SETUP CONFIG]",T=O.a.client.log.verbose,I=Object(o.useRef)(0);return Object(o.useEffect)((function(){return T&&console.log(S," init socket listener"),I.current=l.b.on("getSetupInfos",(function(n){"SUCCESS_CONFIG_CREATION"===n.code?(E(["success","".concat(C.a.setupForm.successReload)]),setTimeout((function(){window.location.reload()}),3e3)):"ASK_SETUP"===n.code?(t.cleanAllApp(),s(!0),n.defaultFolder&&x(n.defaultFolder)):E(["error","".concat(n.code,": ").concat(n.message)])})),function(){T&&console.log(S," clean socket listener"),l.b.off(I.current)}}),[]),{displayWelcomePopup:r,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){E(void 0),l.b.emit("sendSetupInfos",{form:{user:p,password:h,dataFolder:j},token:Object(z.b)()})}}),_&&Object(a.c)("div",{className:_[0]},_[1])))))}}}({cleanAllApp:function(){console.log("[cleanAllApp]"),Kt(),Bt(),n(),e()}}).SetupPopupComponent,p=Object(z.d)({onLoginAsked:function(){n(),e()},onLoginSuccess:function(){v(),En(),Yt(),Object(j.d)((function(t){t.userSettings.refreshUserSettingsFromBackend(),t.ui.floatingPanel.refreshFromBackend()})),Object(j.d)((function(t){t.ui.browser.folders.refreshFromBackend()})),Dt(["/"]),t()}}).LoginPopupComponent,f=Object(le.b)(),h=f.tabs,m=f.updateTab,v=f.refreshTabsFromBackend,x=f.updateActiveTabGrid,y=f.refreshWindowGrid,E=f.tabsApi,T=f.windowsApi,I=Object(o.useState)(0),P=Object(c.a)(I,2),N=P[0],A=P[1],F=E.active.get(),L=mt(),M=L.PromptPopupComponent,D=L.popupApi,U=k(),V=U.isConnected,K=U.connectionStatusComponent,Y=U.toggleSocketConnection,$=re(),Z=$.forceResponsiveRender,X=$.responsiveRefreshCounter,Q=$.setResponsiveRefresh,tt=Object(o.useRef)([]),nt=Object(o.useState)(null),ot=Object(c.a)(nt,2),it=ot[0],st=ot[1];Object(o.useEffect)((function(){setTimeout((function(){}),2e3)}),[]);var ut=Object(ue.b)(),dt=ut.lightboxApi,ht=ut.lightboxImages,vt=ut.lightboxIndex,wt=Le(),jt=wt.ttsApi,xt=wt.ttsPos,yt=wt.ttsPopup,kt=wt.setTtsPopup,_t=wt.ttsPopupContent,Ct=wt.ttsPopupId,St=wt.syncTtsStatus,Tt=fe({isConnected:V,refresh:{get:X,set:Q}}),It=pe(),Pt=Me(),Nt=Pt.notePreviewPopupApi,At=Pt.notePreviewPopup,Rt=Object(j.f)({popupApi:D,tabsApi:E,windowsApi:T,statusApi:Tt,historyApi:It,notePreviewPopupApi:Nt,lightboxApi:dt,ttsApi:jt}),Ft=Rt,Lt=Ft.ui.browser.files,Mt=Ft.ui.browser.folders,Dt=Mt.scan,Bt=Mt.clean,Wt=Mt.base,qt=ae(Lt.active.get),Vt=qt.filesHistory,Kt=(qt.filesHistoryRef,qt.cleanLastFilesHistory),Yt=qt.refreshFilesHistoryFromBackend,$t=qt.lastFilesHistoryApi;Ft.lastNotesApi=$t;var Zt=ee(n,e),Xt=(Zt.askForMoveFile,Zt.promptAndMoveFolder),Qt=Zt.promptAndBatchMoveFiles,tn=w(),nn=tn.mobileView,en=tn.setMobileView,on=tn.MobileToolbarComponent;window.api=Ft;var cn=Object(o.useState)(!1),rn=Object(c.a)(cn,2),ln=rn[0],sn=rn[1],un=Object(o.useState)(!1),dn=Object(c.a)(un,2),pn=dn[0],fn=dn[1];Object(o.useEffect)((function(){var t=function(){sn(!0),fn(!0)};return Object(pt.a)("alt + spacebar",t),Object(pt.a)("alt + p",t),Object(pt.a)("alt + ,",(function(){st("settings")})),Object(pt.a)("alt + e",(function(){Ft.note.ui.editorAction.dispatch({type:"toggleEncryption",noteParentType:"grid"})})),Object(pt.a)("alt + shift + e",(function(){Ft.note.ui.editorAction.dispatch({type:"toggleEncryption",noteParentType:"floating"})})),Object(pt.a)("alt + shift + u",(function(){Ft.note.ui.editorAction.dispatch({type:"triggerUpload",noteParentType:"floating"})})),Object(pt.a)("alt + e",(function(){Ft.note.ui.editorAction.dispatch({type:"toggleEncryption",noteParentType:"grid"})})),Object(pt.a)("alt + u",(function(){Ft.note.ui.editorAction.dispatch({type:"triggerUpload",noteParentType:"grid"})})),Object(pt.a)("alt + s",(function(){Ft.ai.setStatus("stop")})),Object(pt.a)("esc",(function(){sn(!1),st(null)})),function(){Object(pt.d)()}}),[Vt]);var bn=function(){We({openIn:"activeWindow"})},gn=function(){Object(j.d)((function(t){t.ui.windows.active.toggleView()}))},hn=function(){Object(j.d)((function(t){var n=t.ui.browser.files.active.get;n&&t.ui.floatingPanel.create({type:"file",file:n})}))};Object(o.useEffect)((function(){return Object(pt.a)("alt > n",bn),Object(pt.a)("alt > v",gn),Object(pt.a)("alt > d",hn),function(){Object(pt.c)("alt > n",bn),Object(pt.c)("alt > v",gn),Object(pt.c)("alt > d",hn)}})),Object(o.useEffect)((function(){if("mobile"!==Object(r.a)())return Object(Be.a)("/favicon.png");Object(G.f)(h,nn)}),[h,nn]);var vn=Z?0:1,On=Ft.userSettings.refresh.css.get+vn,jn=Ft.userSettings,xn=function(){var t=Object(zt.a)("interface-pin-element-status",{topTab:!0,bottomBar:!0}),n=Object(c.a)(t,3),e=n[0],i=n[1],a=n[2];return Object(o.useEffect)((function(){a()}),[]),{pinStatus:Object(ze.a)(e.topTab)||Object(ze.a)(e.bottomBar)?Object(R.a)(e):{topTab:!0,bottomBar:!0},updatePinStatus:function(t){return function(n){i(Object(s.a)(Object(s.a)({},e),{},Object(De.a)({},t,n)))}},togglePinStatus:function(t){return function(){i(Object(s.a)(Object(s.a)({},e),{},Object(De.a)({},t,!e[t])))}},refreshPinStatus:a}}(),yn=xn.pinStatus,kn=xn.updatePinStatus,Cn=xn.togglePinStatus,En=xn.refreshPinStatus,Tn=Object(o.useState)(void 0),In=Object(c.a)(Tn,2),Pn=In[0],Nn=In[1],An=Gt.d.curr.ui_layout_background_video_width,Rn=Gt.d.curr.ui_layout_background_video_height;return Object(o.useEffect)((function(){var t=Gt.d.curr.ui_layout_background_video_enable,n=Gt.d.curr.ui_layout_background_image;t&&n&&Nn(n)}),[On,jn]),Object(o.useEffect)((function(){var t=Gt.d.curr.keyboard_shortcuts_textarea;if(t){var n=Object(pt.b)(t);return Object(bt.a)(n,(function(t){Object(pt.a)(t.shortcut,t.func)})),function(){Object(bt.a)(n,(function(t){Object(pt.c)(t.shortcut,t.func)}))}}}),[On,jn]),Object(a.c)("div",{className:$n(jn)},Object(a.c)("div",{className:Yn(nn,On,jn,yn)},Pn&&Object(a.c)(Un,{url:Pn,width:An,height:Rn}),Object(a.c)("div",{className:" ".concat("mobile"===Object(r.a)()?"mobile-view-container mobile-view-".concat(nn):"")},Object(a.c)(j.a.Provider,{value:Rt},Object(a.c)("div",{className:"config-buttons-bar"},Object(a.c)("div",{className:"config-button infos-button",onClick:function(){!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 </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>Alt + e : Toggle Encryption</li>\n <li>Alt + 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 + c : Close active floating window</li>\n <li>Alt + Shift + e : Toggle encryption</li>\n <li>Alt + Shift + 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>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>\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>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{{_datetime}} and {{_date}} will automatically insert the date <br>\nthe line_format is used to format the line in the note<br>\nyou can insert tags in it like: {{NAME_FIELD|TYPE_FIELD (text, number, select, date) | COMMENT FIELD comment field. optional}}<br>\nIn the comment field, adding "optional" will make the field optional<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</p>\n<code>\n\t<pre>\n form | name=simple insert form, path=/noteToInsert.md, line_format= {{_datetime}} | name: {{name}} | age: {{age|number|comment field. optional}}, 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\n</p>\n');Object(j.d)((function(n){n.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"})}))}()}},Object(a.c)(_.b,{name:"question"})),Ft.userSettings.get("beta_plugins_marketplace")&&Object(a.c)("div",{className:"config-button plugins-marketplace-button",onClick:function(){st("plugins-marketplace")}},Object(a.c)(_.b,{name:"puzzle-piece"})),"mobile"!==Object(r.a)()&&Object(a.c)("div",{className:"config-button search-button",onClick:function(){fn(!0),sn(!0)}},Object(a.c)(_.b,{name:"search"})),Object(a.c)("div",{className:"config-button settings-button",onClick:function(){st("settings")}},Object(a.c)(_.b,{name:"cog"}))),(null===At||void 0===At?void 0:At.isOpen)&&Object(a.c)(Sn,{notePreview:At}),ln&&Object(a.c)(mn,{show:pn,lastNotes:Vt,onClose:function(t){sn(!1)},onHide:function(t){fn(!1)},onNoteCreate:function(t){We({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(J.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(Ft.userSettings.get("ui_sidebar")?"with-sidebar":"without-sidebar"," device-view-").concat(Object(r.a)())},M(),p({}),u({}),K(),on({forceRerender:Z,onButtons:[function(){fn(!0),sn(!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)(S,{onNewFile:function(){We({openIn:"activeWindow"})}}),Ft.userSettings.get("ui_layout_shortcuts_panel")&&Object(a.c)(wn,{filePath:".tiro/shortcuts.md",onClick:function(){}}),Object(a.c)(ct,{files:Vt,onClick:function(t){Rt.ui.browser.goTo(t.folder,t.name,{openIn:"active"})}}),Object(a.c)(et,{openFolders:Mt.open.get(),folder:Mt.get(),current:Mt.current.get(),onFolderClicked:function(t){Rt.ui.browser.goTo(t,null)},onFolderMenuAction:function(t,n,e){"rename"===t&&e?Xt({folder:n,folderToDropInto:n,folderBasePath:Wt,newTitle:e,renameOnly:!0,disablePrompt:!0,onMoveFn:function(){Dt([te(n.path)],{cache:!1,cb:function(){}})}}):"create"===t&&e?Object(j.d)((function(t){t.folders.create("".concat(n.path,"/").concat(e),(function(t){Dt([n.path],{cache:!1})}))})):"moveToTrash"===t?Xt({folder:n,folderToDropInto:be.b,folderBasePath:Wt,newTitle:"".concat(n.title,"_").concat(Object(gt.a)().full_file),onMoveFn:function(){Dt([te(n.path),n.path],{cache:!1,cb:function(){Mt.open.add(n.path)}})}}):"delete"===t&&(Object(be.a)("trash"),setTimeout((function(){Dt([n.path],{cache:!1})})))},onFolderOpen:function(t){Dt([t],{cache:!1})},onFolderClose:function(t){},onFolderDragStart:function(t){console.log("[DRAG MOVE] onFolderDragStart",t),tt.current=[{type:"folder",folder:t}]},onFolderDragEnd:function(){console.log("[DRAG MOVE] onFolderDragEnd"),tt.current=[]},onFolderDrop:function(t){!function(t){console.log("[DRAG MOVE] processDragDropAction ->",tt.current,t);var n=tt.current[0];"file"===n.type&&n.files?Qt({files:n.files,folderToDropInto:t}):"folder"===n.type&&n.folder&&Xt({folder:n.folder,folderToDropInto:t,folderBasePath:Wt,disablePrompt:!0,onMoveFn:function(){if(n.folder){var e=n.folder.path,o=t.path;Dt([te(e),te(o),o,e],{cache:!1,cb:function(){Mt.open.add(e),Mt.open.add(o),Mt.open.add(te(e)),Mt.open.add(te(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"},Ft&&Ft.ui.browser.folders.current.get(),!Ft.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"))})),y()},active:!0===Rt.userSettings.get("ui_sidebar")}],size:.8}))),Object(a.c)(lt,{term:Rt.ui.search.term.get})),Object(a.c)("div",{className:"files-list-wrapper"},Object(a.c)(de,{files:Lt.get,activeFileIndex:Lt.active.getIndex,onSortFiles:function(t){Rt.ui.browser.files.set(t)},onFileClicked:function(t){Lt.active.set(t);var n=Lt.get[t];Ft.tabs.active.get()?T.active.setContent(n):Ft.tabs.openInNewTab(n)},onFileDragStart:function(t){console.log("[DRAG MOVE] onFileDragStart",t),tt.current=[{type:"file",files:t}]},onFileDragEnd:function(){console.log("[DRAG MOVE] onFileDragEnd"),tt.current=[]}}))))),Object(a.c)("div",{className:"right-wrapper draggable-grid-editors-view"},"mobile"!==Object(r.a)()&&Object(a.c)(Ot,{tabs:h,onUpdate:m,onPinToggle:Cn("topTab"),pinStatus:yn.topTab}),F&&Object(a.c)(se.b,{tab:F,forceRefresh:N,onGridUpdate:function(t){x(t),A(N+1)},mobileView:nn,pinStatus:yn})),Object(a.c)(an,{panels:Ft.ui.floatingPanel.panels,pinStatus:yn.bottomBar,onPinChange:kn("bottomBar")}),"plugins-marketplace"===it&&Object(a.c)(Fn,{onClose:function(){st(null)}}),"settings"===it&&Object(a.c)(Et.a,{onClose:function(){st(null)}})))),Object(a.c)(_n,null),ht.length>0&&Object(a.c)(ft,{images:ht,startingIndex:vt,onClose:Rt.ui.lightbox.close}),yt&&!Gt.d.curr.tts_custom_engine_enabled&&Object(a.c)(Re,{id:Ct,fileContent:_t,startString:xt,onUpdate:function(t){St(t)},onClose:function(){kt(!1)}}),yt&&Gt.d.curr.tts_custom_engine_enabled&&Object(a.c)(qe,{id:Ct,fileContent:_t,startString:xt,onUpdate:function(t){St(t)},onClose:function(){kt(!1)}})))}),null),document.getElementById("root"))},57:function(t,n,e){"use strict";e.d(n,"a",(function(){return O}));var o=e(15),i=e(13),c=e(2),a=e(17),r=e(215),l=e(26),s=e(8),u=e(126),d=e(82),p=e(29),f="[Code Mirror]",b=a.a.client.log.verbose,g=function(t,n){var e=arguments.length>2&&void 0!==arguments[2]&&arguments[2];b&&console.log(f," update cursor",n,t);try{e&&t.view.dispatch({selection:{anchor:n,head:n},scrollIntoView:!0})}catch(o){console.warn(f,"update Cursor error",o)}},h=function(t){if(!(t&&t.view&&t.view.state))return null;var n=t.view.state.doc.lineAt(t.view.state.selection.main.head).number-1,e=function(t){return t.view.state.selection.ranges[0].from}(t),o=t.view.state.doc.toString().split("\n");return{lines:o,currentPosition:e,activeLine:o[n]||"",lineIndex:n,activeLinePos:-1}},m=function(t){if(!t.view)return-1;for(var n=t.view.state.doc.toString(),e=t.view.lineBlockAtHeight(t.view.scrollDOM.scrollTop),o=(t.view.lineBlockAtHeight(t.view.scrollDOM.scrollTop),e.from),i=n.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 n=null===t||void 0===t?void 0:t.view;if(!n)return[];for(var e=n.state.doc.toString().split("\n"),i=[],c=0,a=0;a<e.length;a++){var r=e[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 n=t,e=Math.round(n.viewState.pixelViewport.top),o=n.contentHeight,i=function(){return n.viewState.editorHeight},c=function(){return(o-i())/100};return{viewportHeight:i,contentHeight:o,visibleFirstLine:function(){var t=n.lineBlockAtHeight(e);return n.state.doc.lineAt(t.from).number},percentPx:c,currentPercentScrolled:function(){return n.viewState.pixelViewport.top/c()}}},getCurrentLineInfos:h,getScrolledLine:function(t){var n=m(t),e=t.view.state.doc.toString().split("\n"),o=e[n];return{totLine:e.length,lineNb:n,lineText:o,lines:e}},updateCursor:g,updateText:function(t,n,e){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:n}})),g(t,i,!0)},scrollTo:function(t,n){if(!t.view)return-1;g(t,n,!0)},scrollToLine:function(t,n){var e=t.view.state.doc.line(n);g(t,e.from,!0)},getCustomTheme:r.a,getMarkdownStructure:v,foldAllChildren:function(t){var n=v(t),e=h(t);Object(l.a)(n,(function(o,i){if(null!==t&&void 0!==t&&t.view){var c=n[i+1]?n[i+1].from-1:t.view.state.doc.length,a=o.to-1;e&&e.currentPosition>a&&e.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,n){var e=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.d)(c);var a={search:n};e&&Object.assign(a,{replace:e}),w.current=n;setTimeout((function(){n==w.current&&(console.log("Enabling search box with config:",a),c.dispatch({effects:u.f.of(new u.a(a))}))}),2e3),setTimeout((function(){!function(){if(console.log(o,"centerToNext"),o){Object(u.b)(c);var t=c.state.selection.main,n=t.from;t.to,c.dispatch({effects:i.c.scrollIntoView(n,{y:"center"})})}}()}),4e3)}catch(r){console.log("[CM utils > search word] error:",r)}},setSelection:function(t,n){if(null!==t&&void 0!==t&&t.view)try{var e=t.view,o=[0,0];n.range&&(o=n.range),e.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}},59:function(t,n,e){"use strict";e.d(n,"a",(function(){return s}));var o=e(4),i=e(0),c=e(17),a=e(9),r=e(38),l=e(34);function s(t,n,e){var s=Object(i.useRef)(!1),u=Object(i.useState)(n),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)((function(){var cb=null!==e&&void 0!==e&&e.onInitialRefresh?e.onInitialRefresh:void 0;h(cb)}),[]);var g=Object(l.a)((function(t){Object(a.d)((function(n){n.history.save(b,t,"int")}))}),6e4),h=function(cb){Object(a.d)((function(n){n.file.getContent(b,(function(n){var o=void 0;if("NO_FILE"===n)o={};else try{o=JSON.parse(n)}catch(i){console.error("[BACKEND STATE] Error parsing JSON for ".concat(t),i)}void 0!==o&&(!0===(null===e||void 0===e?void 0:e.debug)&&console.log("[BACKEND STATE] refreshValFromBackend: ".concat(t," => "),o),f(o),s.current=!0,cb&&cb(o))}))}))};return[p,function(n){if(!s.current&&!0!==(null===e||void 0===e?void 0:e.editIfNotLoaded))return console.error("BACKEND VAR: var ".concat(t," not loaded yet"));var o=Object(r.a)(n);f(Object(r.a)(o)),!0===(null===e||void 0===e?void 0:e.debug)&&console.log("[BACKEND STATE] setValue: ".concat(t," => "),o);var i=JSON.stringify(o),c=!(null===e||void 0===e||!e.debouncedSave)&&(null===e||void 0===e?void 0:e.debouncedSave),l=!0===(null===e||void 0===e?void 0:e.debouncedSaveWithThrottle);Object(a.d)((function(t){t.file.saveContent(b,i,{debounced:c,withThrottle:l})})),!0===(null===e||void 0===e?void 0:e.history)&&g(i)},h]}},61:function(t,n,e){"use strict";e.d(n,"a",(function(){return c}));var o=e(4),i=e(0);function c(t,n){var e=Object(i.useState)((function(){try{var e=window.localStorage.getItem(t);return e?JSON.parse(e):n}catch(o){return console.log(o),n}})),c=Object(o.a)(e,2),a=c[0],r=c[1];return[a,function(n){try{var e=n instanceof Function?n(a):n;r(e),window.localStorage.setItem(t,JSON.stringify(e))}catch(o){console.log(o)}}]}},62:function(t,n,e){"use strict";e.d(n,"c",(function(){return p})),e.d(n,"d",(function(){return f})),e.d(n,"h",(function(){return g})),e.d(n,"g",(function(){return h})),e.d(n,"i",(function(){return m})),e.d(n,"e",(function(){return v})),e.d(n,"a",(function(){return w})),e.d(n,"f",(function(){return O})),e.d(n,"b",(function(){return j}));var o=e(11),i=e(15),c=e(128),a=e(286),r=e(26),l=e(176),s=e(383),u=e(9),d=e(30),p=function(t){var n=t.value,e=t.selectionStart;return f(n,e)},f=function(t,n){for(var e=t.split("\n"),o=0,i=0;o<n+1;){o+=e[i].length+1,i++}var c=n-o+e[--i].length-1;return{currentPosition:n,lines:e,activeLine:e[i],activeLinePos:c,lineIndex:i}},b=function(t){for(var n=!0,e=0;e<t.length;e++)32!==t[e].charCodeAt(0)&&45!==t[e].charCodeAt(0)&&91!==t[e].charCodeAt(0)&&93!==t[e].charCodeAt(0)&&(n=!1);return n},g=function(t,n,cb){if(10===n){console.log("updateTextFromLetterInput => ENTER PRESSED");var e=t.lines[t.lineIndex-1],o=e.indexOf("- ["),i=e.indexOf("-"),c="";-1!==o&&"- [ ] "!==e?(c=e.substr(0,o+3)+" ] ",b(c)&&(t.lines[t.lineIndex]=c+t.activeLine,cb(c.length))):-1!==i&&"- "!==e&&"- [ ] "!==e&&(c=e.substr(0,i+1)+" ",b(c)&&(t.lines[t.lineIndex]=c+t.activeLine,cb(c.length)))}return t.lines.join("\n")},h=function(t,n,cb,e){var o=n.lines;if("^"===t){var r=o[n.lineIndex-1],l=o[n.lineIndex];o[n.lineIndex]=r,o[n.lineIndex-1]=l,cb(-r.length-1)}if("v"===t){var s=o[n.lineIndex+1],u=o[n.lineIndex];o[n.lineIndex]=s,o[n.lineIndex+1]=u,cb(+s.length+1)}if("X"===t){o[n.lineIndex].length;var d=Object(i.a)(o).splice(0,n.lineIndex).join("\n").length+1-n.currentPosition;o[n.lineIndex]="",cb(d)}if("C"===t){var p=o[n.lineIndex].length,f=o[n.lineIndex];o.splice(n.lineIndex,0,f),cb(p+1)}"->"===t&&(o[n.lineIndex]=" "+o[n.lineIndex],cb(2)),"<-"===t&&(n.activeLine.startsWith(" ")?(o[n.lineIndex]=o[n.lineIndex].substr(2,o[n.lineIndex].length),cb(-2)):cb(0));var b=n.activeLine.trim();if("[x]"===t&&(b.startsWith("- [ ]")||b.startsWith("- [x]")?b.startsWith("- [ ]")?(o[n.lineIndex]=o[n.lineIndex].replace("[ ]","[x]"),cb(0)):b.startsWith("- [x]")?(o[n.lineIndex]=o[n.lineIndex].replace("[x]","[ ]"),cb(0)):cb(0):(o[n.lineIndex]=o[n.lineIndex].replace(b,"- [ ] "+b.replace("-","")),cb(6))),"insertAt"===t&&e&&e.textToInsert&&(Object(c.a)(e.insertPosition)||Object(a.a)(e.insertPosition))){var g=0;Object(c.a)(e.insertPosition)&&(g=e.insertPosition),"currentPos"===e.insertPosition&&(g=n.currentPosition+1),"currentLineStart"===e.insertPosition&&(g=Object(i.a)(o).splice(0,n.lineIndex).join("\n").length);var h=o.join("\n"),m=e.textToInsert.length;o=[h.slice(0,g),e.textToInsert,e.replaceText?h.slice(g+m,h.length):h.slice(g,h.length)].join("").split("\n")}return o.join("\n")},m=function(t){var n=t.split("\n"),e=0;return Array.isArray(n)?(Object(r.a)(n,(function(t){var n=t.split(" ").filter((function(t){return""!==t}));e+=n.length})),e):e},v=function(t){var n=!1;return(t="".concat(t)).toLowerCase().startsWith("math.")&&(n=!0),t.startsWith("(")&&(n=!0),isNaN(parseInt(t))||(n=!0),t.includes("\n")&&(n=!1),t.length>400&&(n=!1),n},w=function(t){var n=null;if(!v(t))return n;try{n=new Function("return ".concat(t))()}catch(e){}return n},O=function(t){var n=t.windowId,e=t.file,i=t.fileContent,c=t.selectionTxt,a=t.insertPos;try{var r=new Function("return ".concat(c))(),l=Object(o.a)(Object(o.a)({},{wrapSyntax:!1,title:"",currentContent:i,insertPos:a,windowId:n,selection:c,file:e,linejump:!1,isLast:!1}),{},{textUpdate:" = ".concat(r),isLast:!0});j(l)}catch(s){Object(d.d)('[CALC] Error <br/> "'.concat(s,'"'))}},j=function(t){t.question||(t.question=""),t.title||(t.title=""),Object(l.a)(t.linejump)||(t.linejump=!0),Object(l.a)(t.viewFollow)||(t.viewFollow=!0),Object(l.a)(t.wrapSyntax)||(t.wrapSyntax=!0);var n=t.linejump?"\n\n":" ",e="###",o="---",i="".concat(n," ").concat(e," [").concat(t.title,"] (generating ...) ").concat(n),c="".concat(n," ").concat(o," [").concat(t.title,"] (done) ").concat(n),a="".concat(n).concat(t.textUpdate);t.wrapSyntax||(i=c=o=e=""),a="".concat(i).concat(t.textUpdate).concat(n).concat(e," \n"),t.isLast&&(a="".concat(c).concat(t.textUpdate).concat(n).concat(o," \n"));var r=t.currentContent.substring(0,t.insertPos),s=t.currentContent.substring(t.insertPos),d=r+a+s;Object(u.d)((function(n){if(n.file.saveContent(t.file.path,d),t.viewFollow){var e=("".concat(r).concat(a).split("\n").length||0)-2;e<0&&(e=0),x(t.windowId,e)}}))},x=Object(s.a)((function(t,n){Object(u.d)((function(e){e.ui.note.editorAction.dispatch({windowId:t,type:"lineJump",lineJumpNb:n})}))}),1e3)},64:function(t,n,e){"use strict";e.d(n,"a",(function(){return a}));var o=e(11),i=e(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),{},{global:{protocol:"".concat(window.location.protocol,"//"),url:"".concat(window.location.hostname),port:c}})},67:function(t,n,e){"use strict";e.d(n,"a",(function(){return l})),e.d(n,"b",(function(){return s}));var o=e(105),i=e(176),c=e(0),a=e(25),r=e(1),l=function(t){var n,e=Object(c.useRef)(),a=function(){t.shouldFocus&&e.current.focus()};Object(c.useEffect)((function(){a()}),[t.shouldFocus]),Object(c.useEffect)((function(){a()}),[]);var l="checkbox"===t.type&&(!0===t.value||"true"===t.value),s=t.value;Object(i.a)(s)&&(s="");var u=s;"date"!==t.type||s||(u=(new Date).toISOString().split("T")[0]);var d=t.type;"datetime"===t.type&&(d="datetime-local",u=(u=(new Date).toISOString().substring(0,16)).substring(0,u.length-5)+"12:00"),Object(c.useEffect)((function(){t.onLoad&&t.onLoad(u)}),[]);return Object(r.c)("div",{className:"input-component-wrapper ".concat(t.style?Object(o.a)(t.style,";",""):"")},Object(r.c)("div",{className:"input-component ".concat(t.id?t.id:""," ").concat(t.type)},t.label&&Object(r.c)("span",{onClick:function(n){"checkbox"===t.type&&(e.current.checked=!e.current.checked,t.onChange&&t.onChange(e.current.checked))}},t.label," "),Object(r.c)("div",{className:"input-wrapper"},"select"!==t.type&&"textarea"!==t.type&&Object(r.c)("input",{ref:e,type:d||"text",defaultValue:u,value:s,checked:l,readOnly:t.readonly,max:t.max,min:t.min,step:t.step,onFocus:function(){t.onFocus&&t.onFocus()},onClick:function(){!t.shouldNotSelectOnClick&&e.current.select()},onKeyPress:function(n){"Enter"==(n.code||n.key)&&t.onEnterPressed&&t.onEnterPressed()},onChange:function(n){t.onCheckedChange&&t.onCheckedChange(n.target.checked),function(n){var e=n;"number"===t.type&&(t.max&&e>t.max&&(e=t.max),t.min&&e<t.min&&(e=t.min),e=e.toString()),t.onChange&&t.onChange(e)}(n.target.value)}}),"select"===t.type&&Object(r.c)("select",{value:s,multiple:!0,onChange:function(n){var e=Array.from(n.target.selectedOptions,(function(t){return t.label})).join(",");t.onSelectChange&&t.onSelectChange(e)}},null===(n=t.list)||void 0===n?void 0:n.map((function(t,n){return Object(r.c)("option",{value:t.key},t.label," ")}))),"textarea"===t.type&&Object(r.c)("textarea",{defaultValue:s,onChange:function(n){t.onChange&&t.onChange(n.target.value)}}),t.explanation&&Object(r.c)("div",{className:"explanation"}," ",t.explanation," "))))},s=function(){return"\n .input-component {\n display: flex;\n align-items: center;\n\t\tjustify-content: space-between;\n padding-bottom: 7px;\n input, select {\n max-width: 100%;\n }\n &.select {\n span {\n width: 20%;\n }\n }\n span {\n // width: 30%;\n font-weight: 700;\n\t\t\tmargin-right: 10px;\n text-transform: uppercase;\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(a.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(a.a)(1),"px;\n background: #ececec;\n border-radius: 5px;\n }\n\t\t\ttextarea {\n\t\t\t\theight: 120px;\n\t\t\t\tfont-size: ").concat(Object(a.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(a.a)(1),"px;\n color: grey;\n }\n }\n }\n")}},68:function(t,n,e){"use strict";e.d(n,"a",(function(){return g}));var o=e(17),i=e(77),c=e(30),a={};window.dbscroll=a,Object(c.a)("syncscroll","get_db",(function(){return a}));o.a.client.log.verbose;var r=function(t){var n=document.querySelector(".window-id-".concat(t," .preview-area")),e=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:n,editor:e,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=n,a[t].els.editor=e,a[t].els.scroller=o,a[t]},l=function(t){var n,e,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===(n=o.els.scroller)||void 0===n?void 0:n.clientHeight)||0,s=a*l,u={viewport:s=s>l?l:s,full:l};o.dims.scroller=u;var d=null===(e=o.els.scroller)||void 0===e?void 0:e.dataset;d&&(d.scrollRefresh||(d.scrollRefresh=1),d.scrollRefresh=parseInt(d.scrollRefresh)+1)},s=function(t,n){var e;i.c[t]=!1;var o=r(t);o.posPercent=n||0;var c=null===(e=o.els.scroller)||void 0===e?void 0:e.dataset;c||(c={scrollRefresh:1}),c.scrollRefresh||(c.scrollRefresh=1),c.scrollRefresh=parseInt(c.scrollRefresh)+1},u=function(t,n){i.c[t]=!1;var e=r(t);if(e.els.editor){e.dims.editor;e.els.editor.scrollTop+=n}},d=function(t,n){i.c[t]=!1;var e=r(t);if(e.els.preview){e.dims.preview;e.els.preview.scrollTop+=n}},p=function(t,n){i.c[t]=!1;var e=r(t);if(e.els.editor){var o=e.dims.editor;n||(n=e.posPercent);var c=o.full/100;e.els.editor.scrollTop=c*n}},f=function(t,n){i.c[t]=!1;var e=r(t);if(e.els.preview){var o=e.dims.preview;n||(n=e.posPercent);var c=o.full/100,a=Math.round(c*n);e.els.preview.scrollTop=a+e.previewOffsetY}},b=function(t,n){var e=r(t),o=e.dims.preview.full/100,i=n-Math.round(o*e.posPercent);e.previewOffsetY=i},g={getScrollObj:r,updateEditorDims:function(t,n){var e=r(t);e.els.editor&&(e.dims.editor=n)},updatePreviewDims:function(t){var n=r(t);if(n.els.preview){var e=n.els.preview.querySelector(".preview-area-full-height-content"),o=e.clientHeight-e.parentNode.clientHeight,i=n.els.preview.clientHeight;n.dims.preview={viewport:i,full:o},n.dims.preview={viewport:i,full:o}}},updateScrollerDims:l,updatePreviewOffset:b,onEditorScroll:function(t,n){var e=r(t);e.els.editor&&(e.posPercent=n,s(t,n),f(t,n))},onScrollerScroll:function(t,n){r(t).posPercent=n,p(t,n),f(t,n)},onPreviewScroll:function(t){var n=r(t),e=n.els.preview.scrollTop;b(t,e),n.posPercent=e/n.dims.preview.full*100,p(t,n.posPercent),s(t,n.posPercent)},onWindowLoad:function(t){if(a[t]){var n=r(t).posPercent;l(t),s(t,n),p(t,n),f(t,n)}},scrollEditor:p,scrollPreview:f,scrollScroller:s,scrollAllPx:function(t,n){u(t,n),d(t,n)},scrollEditorPx:u,scrollPreviewPx:d}},71:function(t,n,e){"use strict";e.d(n,"a",(function(){return i})),e.d(n,"c",(function(){return c})),e.d(n,"b",(function(){return a}));var o=e(20),i=function(t){var n=((new Date).getTime()-t.getTime())/1e3,e=604800,i="";if(n<=3600)i="".concat(Math.ceil(n/60)," ").concat(o.a.minsAgo);else if(n>3600&&n<=86400)i="".concat(Math.ceil(n/3600)," ").concat(o.a.hoursAgo);else if(n>86400&&n<=e)i="".concat(Math.ceil(n/86400)," ").concat(o.a.daysAgo);else if(n>e){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 n=new Date(t);return[n.getFullYear(),n.getMonth()+1,n.getDate()]},a=function(t){var n=(new Date).getTime();return"lastMonth"===t&&(n=n-432e5),n}},72:function(t,n,e){"use strict";e.d(n,"c",(function(){return r})),e.d(n,"a",(function(){return l})),e.d(n,"b",(function(){return s}));e(0);var o=e(167),i=e(91),c=e(134),a=e(1),r=function(t,n,e){if(!t)return"";var o=t.querySelector("iframe"),i=Object(c.c)(n,{delay:100}),a='<div id="'.concat(i,'" class="resource-link-ctag"><div class="loading-string">loading...</div></div>'),r=!o||!0===e;t.innerHTML=r?a:""},l=function(t){var n;return s(t.tagName,t.content,(null===(n=t.opts)||void 0===n?void 0:n.windowId)||"null",t.opts)},s=function(t,n,e,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:n,start:0,end:0},windowId:e,ctagHeightOffset:l,yCnt:0,onIframeMouseWheel:function(){},ctagSandboxed:c.sandboxed,ctagFullscreen:c.fullscreen,ctagOnFullscreenClose:c.onFullscreenClose})}},75:function(t,n,e){"use strict";e.d(n,"c",(function(){return u})),e.d(n,"d",(function(){return h})),e.d(n,"a",(function(){return m})),e.d(n,"b",(function(){return v}));var o=e(29),i=e(9),c=e(12),a=e(33),r=e(10),l=e(45),s=e(56),u=function(t,n,e){return Object(l.a)({file:t,windowId:n,pattern:o.a.linklink,replacement:function(t){var o=e||!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,n,o);return c.innerHTML="".concat(u),c}})},d=function(t){if(t){h(),g++;var n=t.dataset.file,e=t.dataset.folder,o=(t.dataset.searchedstring,t.dataset.windowid||"active");n&&e&&o&&Object(i.d)((function(t){t.ui.browser.goTo(e,n,{openIn:o})}))}},p=function(t){if(t){var n=t.getBoundingClientRect(),e=[n.left+window.scrollX,n.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,e,c,a)}}},f=function(t,n,e,o){var c=++g;b&&clearTimeout(b),b=setTimeout((function(){g===c&&(""===e&&(e=null),Object(i.d)((function(o){o.ui.floatingPanel.openFile(t,{idpanel:"preview-popup-"+Object(s.d)(t),searchedString:e}),setTimeout((function(){o.ui.floatingPanel.movePanel("preview-popup",{x:n[0],y:n[1]+20})}),10)})))}),700)},b=null,g=0,h=function(t){b&&clearTimeout(b),g++,t&&setTimeout((function(){g++}),700)},m=function(t,n,e,o,i){var r=t;if(e){var l=e.length>20?e.substring(0,20)+"...":e;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(n,'" \ndata-searchedstring="').concat(e||"",'"\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} ")}},77:function(t,n,e){"use strict";e.d(n,"c",(function(){return p})),e.d(n,"b",(function(){return f})),e.d(n,"a",(function(){return b}));var o=e(11),i=e(3),c=e(111),a=e(9),r=e(62),l=e(27),s=e(28),u=e(12),d="[AI]",p={},f=function(){var t,n=[],e=s.d.curr.ui_editor_ai_command.split("\n"),o=1,c=Object(i.a)(e);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("|");n.push({title:r[0].trim(),icon:r[1].trim(),typeAnswer:l,command:u})}else{if(""===a.trim())continue;n.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 n},b=function(t){var n=t.typeAnswer,e=t.aiCommand,o=t.selectionTxt,i=t.file,c=t.windowIdFile,r=t.innerFileContent,s=t.cursorInfos;if(console.log(d,"AiAnswer",{typeAnswer:n,aiCommand:e,selectionTxt:o,file:i,windowIdFile:c,innerFileContent:r,cursorInfos:s}),"currentWindow"===n){if(!i||!c||!r||!s)return;g({uuid:t.uuid,command:e,aiBtnConfig:t.aiBtnConfig,windowId:c,file:i,fileContent:r,selectionTxt:o,insertPos:s.to})}else"newWindow"===n?Object(a.d)((function(n){var i=(new Date).toISOString().replace(":","h").replace(":","m").replace(/T/g,"-").substring(0,19),c=Object(l.c)(o).substring(0,40),a=".tiro/answers/answer-".concat(i,"---").concat(c,".md"),r='# Answer for "'.concat(c,'" \n ## Answer \n\n '),s=r+"\n ## Question: \n \n ".concat(o," \n"),d=Object(l.e)(a),p=Object(l.c)(a),f=r.length;n.file.saveContent(a,s,{},(function(){n.ui.floatingPanel.create({type:"file",file:d,view:"preview",id:p,layout:(Object(u.a)(),"right")}),g({uuid:t.uuid,command:e,windowId:p,aiBtnConfig:t.aiBtnConfig,file:d,fileContent:s,selectionTxt:o,insertPos:f,wrapSyntax:!1})}))})):console.error(d,"AiAnswer: typeAnswer not recognized",n)},g=function(t){console.log("trigger AI search",t.windowId,t.file.path,t.selectionTxt,t.insertPos);var n=t.selectionTxt,e=t.fileContent,i=t.insertPos,l=e,s=!1,u=n=(n=(n=(n=n.replaceAll('"','\\"')).replaceAll("'","\\'")).replaceAll("`","\\`")).replaceAll("$","\\$"),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}};console.log(),p[t.windowId]=!0;var b={curr:""},g=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),h=function(){Object(a.d)((function(n){n.ui.notification.emit({content:"[AI] \ud83d\udcac generating text... <br/><br/> \u274c (click popup to stop generation)",options:{hideAfter:5,onClick:function(){n.ai.setStatus("stop",t.uuid)}},id:"ai-status"})}))};Object(a.d)((function(e){var i=Date.now(),c=t.command;c=c.replace("{{input}}",n),Object(r.b)(f());var a=!0,l=!0;h(),e.command.stream(c,(function(n){if(a=e.ai.getStatus(t.uuid),n.isError&&(s=!0),s){if(console.log(d,"ERROR",n),""===n.text||"[object Object]"===n.text)return;b.curr+=n.text+"\n\n",g(),Object(r.b)(Object(o.a)(Object(o.a)({},f()),{},{textUpdate:"",isLast:!0,viewFollow:p[t.windowId]}))}else{if(!a)return;h(),n.isLast&&(n.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:n.textTot,isLast:n.isLast,viewFollow:p[t.windowId]}))}a!==l&&(l=a,n.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:n.textTot,isLast:n.isLast,viewFollow:p[t.windowId]})))}))}))}},81:function(t,n,e){"use strict";e.d(n,"a",(function(){return m})),e.d(n,"c",(function(){return v})),e.d(n,"b",(function(){return w}));var o=e(4),i=e(572),c=e(0),a=e(12),r=e(94),l=e(10),s=e(166),u=e(167),d=e(68),p=e(90),f=e(75),b=e(25),g=e(141),h=e(1),m=function(t){var n={wrapper:Object(c.useRef)(null),main:Object(c.useRef)(null)},e=Object(c.useState)(""),a=Object(o.a)(e,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=n.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 n=r.b.chunks.chunk(l);w(n),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(n){d.a.scrollPreviewPx(t.windowId,n.deltaY)}},Object(h.c)("div",{className:"preview-area",ref:n.wrapper,style:{bottom:function(){var n=f(),e=t.posY+0;return Object(i.a)(e,0,n)}()}},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(n,e){return Object(h.c)(u.a,{key:e,index:e,block:n,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")}},86:function(t,n,e){"use strict";e.d(n,"c",(function(){return i})),e.d(n,"a",(function(){return a})),e.d(n,"b",(function(){return r}));e(26);var o=e(9),i=function(t){return t="editor"===t?"preview":"preview"===t?"both":"editor"},c="notes-view-type",a=function(t){return new Promise((function(n,e){Object(o.d)((function(e){e.cache.get(c,(function(e){if(e){var o=e[t];n(o||!1)}}))}))}))},r=function(t,n){Object(o.d)((function(e){e.cache.get(c,(function(o){o||(o={}),o[t]=n,e.cache.set(c,o,-1)}))}))}},9:function(t,n,e){"use strict";e.d(n,"e",(function(){return dt})),e.d(n,"d",(function(){return pt})),e.d(n,"a",(function(){return ft})),e.d(n,"f",(function(){return bt})),e.d(n,"c",(function(){return gt})),e.d(n,"b",(function(){return ht}));var o=e(15),i=e(26),c=e(128),a=e(38),r=e(206),l=e(0),s=e.n(l),u=e(37),d=e(28),p=e(138),f=e(11),b=e(27),g=e(29),h=e(137),m=e(14),v=e(18),w=function(t){Object(l.useEffect)((function(){m.b.on("moveFolderAnswer",(function(n){t.eventBus.notify(n.idReq,n.idReq)}))}),[]);return{file:function(n,e,cb){var o=gt("move-file-get-files");t.eventBus.subscribe(o,cb||function(){}),console.log("[MOVEFILE] ".concat(n," -> ").concat(e)),m.b.emit("moveFile",{initPath:n,endPath:e,idReq:o,token:Object(v.b)()})},folder:function(n,e,cb){var o=gt("move-folder-get-files");t.eventBus.subscribe(o,cb||function(){}),console.log("[MOVEFOLDER] ".concat(n," -> ").concat(e)),m.b.emit("moveFolder",{initPath:n,endPath:e,idReq:o,token:Object(v.b)()})}}},O=e(34),j=e(111),x=e(383),y=e(141),k=function(t){var n="[FILE API] 005363 ";Object(l.useEffect)((function(){m.b.on("onServerTaskFinished",(function(n){t.eventBus.notify(n.idReq,{data:n})})),m.b.on("getFileContent",(function(n){n.error?t.eventBus.notify(n.idReq,{error:n.error}):t.eventBus.notify(n.idReq,Object(f.a)({},n))}))}),[]);var e={},o=function(n,cb,o){var i=Object(h.a)("getFileContent "+n),c=_(n),a=gt("get-file-content");t.eventBus.subscribe(a,(function(n){if(n.error&&o&&o.onError)o.onError(n.error);else if(!n.error||o&&o.onError){if(!n.error&&(e[a]=e[a]||[],e[a][n.chunkNb]=n.chunkContent,e[a].length===n.chunksLength)){var c=e[a].join("");if(o&&o.removeMetaHeader)c=Object(y.b)(c).content;delete e[a],t.eventBus.unsubscribe(a),cb(c)}}else cb(n.error);i()}),{persistent:!0}),m.b.emit("askForFileContent",{filePath:c,token:Object(v.b)(),idReq:a})},i=Object(l.useRef)(""),c=function(n,e,o,cb){var c=!(!o||!o.history)&&o.history,a=(!(!o||!o.withMetas)&&o.withMetas,[]),r=9e5;if(e.length>r)for(var l=Math.ceil(e.length/r),s=0;s<l;s++){var u=s*r,d=(s+1)*r;a.push(e.slice(u,d))}else a=[e];var p=gt("save-file-content");cb&&t.eventBus.subscribe(p,(function(t){cb&&cb(t)}));for(var f=_(n),g=0;g<a.length;g++){var h=a[g];m.b.emit("saveFileContent",{filePath:f,chunkContent:h,chunkNb:g,chunksLength:a.length,token:Object(v.b)(),idReq:p,withCb:!!cb})}c&&(n!==i.current&&dt().then((function(t){var e=t.ui.browser.folders.current.get();if(e===Object(b.d)(n)){var o,i="",c=t.ui.windows.active.get();if(c)i=(null===(o=c.content.file)||void 0===o?void 0:o.name)||"";t.ui.browser.goTo(e,i)}})),t.historyApi.intervalSave(n,e),i.current=n)},a=(Object(O.a)((function(t,n,e,cb){c(t,n,e,cb)}),500),Object(l.useRef)({})),r=Object(l.useRef)({}),s=function(t,n,e,cb){var o=!(!e||!e.debounced)&&e.debounced,i=!(!e||!e.withThrottle)&&e.withThrottle,l=t.includes("/.tiro/");if(null!==e&&void 0!==e&&e.withMetas&&!l){var s=null===e||void 0===e?void 0:e.withMetas;s.modified=Date.now(),n=Object(y.a)(n,{created:s.created||Date.now(),updated:s.modified})}o?function(t,n,e,o,i,cb){var l=function(t,n){return"".concat(t,"-").concat(n)}(e,t);a.current[l]||(a.current[l]=Object(j.a)((function(t,n,e,cb){c(t,n,e,cb)}),t),!0===n&&(r.current[l]=Object(x.a)((function(n,e,o,cb){console.log("throttledFuncs",t,n),c(n,e,o,cb)}),t))),a.current[l](e,o,i,cb),!0===n&&r.current[l](e,o,i,cb)}(o,i,t,n,e,cb):c(t,n,e,cb)},u=w({eventBus:t.eventBus});return{getContent:o,saveContent:s,insertContent:function(t,n,e,cb){var i=e&&e.insertLine?e.insertLine:0,c=function(e){var o;(i=i<0?e.split("\n").length+i:i)<0&&(i=e.split("\n").length),i>e.split("\n").length&&(i=e.split("\n").length),o=e.split("\n").slice(0,i).join("\n")+"\n"+n+"\n"+e.split("\n").slice(i).join("\n"),s(t,o,{},(function(t){cb&&cb(t)}))};o(t,(function(t){c(t)}),{onError:function(t){console.log("file does not exists, creating it"),c("")},removeMetaHeader:!0})},delete:function(e,cb){var o=gt("delete-file");console.log("".concat(n," delete file ").concat(e.path)),t.eventBus.subscribe(o,cb),m.b.emit("onFileDelete",{filepath:e.path,idReq:o,token:Object(v.b)()})},move:u.file,create:function(e,cb){var o=gt("create-file");console.log("".concat(n," create file in ").concat(e)),t.eventBus.subscribe(o,cb),m.b.emit("createNote",{folderPath:e,idReq:o,token:Object(v.b)()})}}},_=function(t){return t.replace(g.a.linklink,"$2/$1")},C=e(17),E=e(4),S=e(32),T=e(44),I=e(287),P=function(){var t=Object(T.a)(Object(S.a)().mark((function t(n){return Object(S.a)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",new Promise((function(t,e){var o={},c=[];dt().then((function(e){e.search.word("#",n,(function(n){var e=[],r={};console.log(n),Object(i.a)(n,(function(t,n){var c={file:t.file,titleName:""};Object(i.a)(t.results,(function(t,n){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(n),o[t].lines=Object(I.a)(o[t].lines);var e=c.file.name+"-"+c.titleName;r[e]||(r[e]=[]),r[e].push(o[t].id),l.push(o[t])})),Object(i.a)(l,(function(t,n){Object(i.a)(l,(function(o,i){if(n!==i){var c=t.id,a=o.id,r="".concat(c,"-").concat(a),l="".concat(a,"-").concat(c);-1===e.indexOf(r)&&-1===e.indexOf(l)&&e.push(r)}}))}))}))})),Object(i.a)(o,(function(t){c.push(t)})),t({nodesObj:o,nodesArr:c,edges:e})}))}))})));case 1:case"end":return t.stop()}}),t)})));return function(n){return t.apply(this,arguments)}}(),N=function(t){var n="[SEARCH API] ",e=Object(l.useState)(""),o=Object(E.a)(e,2),i=o[0],c=o[1];Object(l.useEffect)((function(){m.b.on("getWordSearch",(function(n){t.eventBus.notify(n.idReq,n.result)}))}),[]);var a=function(e,cb){!function(e,cb,o){var i=gt("search-".concat(o,"-"));console.log("".concat(n," searching ").concat(e," with type ").concat(o)),t.statusApi.searching.set(!0),t.eventBus.subscribe(i,(function(n){t.statusApi.searching.set(!1),cb(n)})),m.b.emit("searchFor",{term:e,token:Object(v.b)(),type:o,idReq:i})}(e,cb,"text")};return{files:{search:a},word:function(e,o,cb,i){var c=gt("search-word-");e=e.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"),console.log("".concat(n," searching WORD ").concat(e," in ").concat(o),i),t.eventBus.subscribe(c,(function(t){cb(t)})),m.b.emit("searchWord",{word:e,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){dt().then((function(n){n.ui.browser.files.set([]),c(t),a(t,(function(t){n.ui.browser.files.set(t)}))}))},term:{set:c,get:i}}}},A=e(136),R=e(30),F=e(12),L=/((\/\/.*$)|(\/\*[\s\S]*?\*\/))/gm,M=/([^\s,]+)/g,D=e(94),z=function(t){var n=Object(l.useState)(null),e=Object(E.a)(n,2),o=e[0],i=e[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)};return Object(f.a)(Object(f.a)({},D.b),{},{ui:{lineJump:{jump:function(t,n){a({type:"lineJump",windowId:t,lineJumpNb:n})}},editorAction:{dispatch:a,get:o,canExecuteAction:function(t){return t.uuid===c.current&&(c.current=null,!0)}}}})},B=e(376),W=e(56),U="/".concat(C.a.path.configFolder,"/").concat(C.a.path.cacheFolder,"/cache-api"),H="[CACHE API]",q=C.a.client.log.verbose,V=C.a.client.log.verbose,J=function(){return(new Date).getTime()},G=function(t){var n=t-J()<0;return q&&console.log(H,"isExpired? : ",n,(t-J())/6e4,"mins"),n},K=function(t){var n=function(t){return"".concat(U,"/cache-api-storage-").concat(Object(W.b)(t),".md")},e=Object(l.useRef)({}),o=function(t,n,o){var i;e.current[t]={content:n,until:(i=o,J()+60*i*1e3)}},i=8e5,c="__CHUNKED__CACHED__OBJ__SIZE:",a="[CACHE CHUNK]",r=function(t,e,o){var r=arguments.length>3&&void 0!==arguments[3]&&arguments[3]?JSON.stringify(e,null,"\t"):JSON.stringify(e),l=function(t,e,cb){V&&console.log(a,n(t),{str:e}),pt((function(o){o.file.saveContent(n(t),"".concat(e),{},(function(t){cb(t)}))}))};if(!(r.length>i))return l(t,r,(function(){o&&o()}));var s=(u=i,r.match(new RegExp(".{1,"+u+"}","g")));V&&console.log(a,"SAVE >> TOO LARGE, split in ".concat(s.length," parts"),{cacheId:t,contentArr:s});var u,d=0,p=function(){++d===s.length-1&&o&&o()};l(t,"".concat(c).concat(s.length),p);for(var f=function(n){setTimeout((function(){l("c".concat(n,"_").concat(t),s[n],p)}),1e3*n)},b=0;b<s.length;b++)f(b)},s=function(t,cb,e){var o=function(t,e,o){pt((function(i){i.file.getContent(n(t),e,{onError:o})}))},i="___ERROR___CHUNK___LOADING___FAILURE";o(t,(function(n){try{if(n.startsWith(c)){var r=parseInt(n.replaceAll(c,""));V&&console.log(H,"GET >> remerging a ".concat(r," part"),{cacheId:t}),function(n,e,c,r){for(var l=Object(h.a)("".concat(H," getAllChunksAndMerge")),s=[],u=0,d=function(){if(u===e){var n=s.join(""),o=n.includes(i);V&&console.log("GET >> RESULT remerging",{hasFailed:o,cacheId:t,nbChunks:e,resMerge:n}),l(),o?r():c(n)}},p=function(n){o("c".concat(n,"_").concat(t),(function(o){s[n]=o,V&&console.log(a,"c".concat(n,"_").concat(t),{loadingCounter:u,nbChunks:e}),u++,d()}),(function(t){u++,s[n]=i,d()}))},f=0;f<e;f++)p(f)}(0,r,(function(t){cb(t)}),(function(t){e()}))}else cb(n)}catch(l){e(l)}}),(function(t){e(t)}))},u=function(){e.current={}};return{get:function(t,cb,n){if(!0===(null===n||void 0===n?void 0:n.disableRamCache)&&u(),t in e.current){var i=e.current[t],c=G(i.until);c&&(i.content=void 0),q&&console.log(H,"FROM RAM",t," expired:",c),cb(i.content)}else s(t,(function(n){try{var i=JSON.parse(n);e.current[t]=Object(f.a)({},i);var c=e.current[t],a=G(c.until);a&&(c.content=void 0),q&&console.log(H,"FROM FILE",t," expired:",a),cb(c.content)}catch(r){q&&console.log(H,"error getting cache",r,t),o(t,void 0,60),cb(e.current[t].content)}}),(function(n){return"NO_FILE"===n?(q&&console.log(H,"FROM FILE: NO_FILE",t),o(t,void 0,60),cb(e.current[t].content)):cb(void 0)}))},set:function(t,n,i,cb,c){i||(i=60),-1===i&&(i=1e32),o(t,n,i);var a=e.current[t];q&&console.log(H,"SETTING",t," with cachedTime in min",i),r(t,a,(function(t){cb&&cb(t)}),null===c||void 0===c?void 0:c.uncompressed)},cleanRamCache:u,getCachePath:function(t,cb){return cb&&cb(n(t)),n(t)}}},Y=e(190),$=e(286),Z=e(108),X=e(248),Q=e(39),tt="[PLUGINS]",nt=e(234),et={obj:null},ot={play:function(t,n){pt((function(e){var o,i,c,a=null===(o=null===n||void 0===n?void 0:n.cache)||void 0===o||o;i=null===n||void 0===n?void 0:n.start,c=null===n||void 0===n?void 0:n.time;e.ressource.fetch(t,(function(t,n){et.obj=new Audio(n),et.obj.load(),et.obj.play(),et.obj.onprogress=function(){},console.log("[AUDIO] Playing:",n,"audio object in window.__tiro_audio_obj_curr__"),window.__tiro_audio_obj_curr__=et}),{returnsPathOnly:!0,disableCache:!a})}))},stop:function(){et.obj.pause(),et.obj.currentTime=0}},it=e(127),ct=e(77),at=function(t,n){var e=Object(ct.b)();console.log("search",{searchText:t,modelName:n,configAllAis:e}),n||(n=e[0].title);var o=e.find((function(t){return t.title===n}));if(o){var i=st("new");o.typeAnswer="newWindow",Object(ct.a)({uuid:i,typeAnswer:o.typeAnswer,aiCommand:o.command,aiBtnConfig:o,selectionTxt:t})}else Object(R.d)('Model "'.concat(n,'" not found in config'))},rt={},lt=function(t){return rt[t]||!1},st=function(t,n){return"new"===t&&(n=Object(u.a)(),rt[n]=!0),"stop"===t&&(n?rt[n]=!1:Object(i.a)(rt,(function(t,n){rt[n]=!1})),pt((function(t){t.ui.notification.emit({content:"[AI] AI generation stop requested",options:{hideAfter:3},id:"ai-status"})}))),console.log("setStatus",{status:t,uuid:n,aiStatusManagerDic:rt}),n||(n=""),n},ut=null,dt=function(){return new Promise((function(t,n){if(ut)return t(ut);var e=setInterval((function(){if(ut)return clearInterval(e),t(ut)}),200)}))},pt=function(cb){dt().then((function(t){cb(t)}))},ft=s.a.createContext(null),bt=function(t){var n=Object(l.useRef)({}),e=function(t){delete n.current[t]},o={subscribe:function(t,cb,e){e||(e={}),n.current[t]||(n.current[t]=[]),n.current[t].push({cb:cb,options:e})},unsubscribe:e,notify:function(t,o){Object(i.a)(n.current,(function(n,c){c===t&&Object(i.a)(n,(function(n){try{n.cb(o)}catch(i){console.warn("[CLIENT API] error with function",i)}n.options.persistent||e(t)}))}))}};Object(l.useEffect)((function(){C.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(n,{isConnected:!0})})),m.b.on("reconnect",(function(){t.eventBus.notify(n,{isConnected:!0})})),m.b.on("disconnect",(function(){t.eventBus.notify(n,{isConnected:!1})}))}),[]);var n="watch-api-unique-id-request";return Object(l.useEffect)((function(){m.b.on("onNoteWatchUpdate",(function(e){t.eventBus.notify(n,e)}))}),[]),{file:function(e,cb){t.eventBus.subscribe(n,(function(t){e===t.filePath&&cb(t)}),{persistent:!0})},appStatus:function(cb){t.eventBus.subscribe(n,(function(t){cb(t)}),{persistent:!0})},dev:{toggleIsConnected:function(e){t.eventBus.notify(n,{isConnected:e})}}}}({eventBus:o}),a=N({eventBus:o,statusApi:t.statusApi}),r=k({eventBus:o,historyApi:t.historyApi}),s=function(t){return Object(l.useEffect)((function(){m.b.on("getFiles",(function(n){t.eventBus.notify(n.idReq,n.files)})),m.b.on("getFilesPreview",(function(n){t.eventBus.notify(n.idReq,n.filesPreview)}))}),[]),{get:function(n,cb){C.a.client.log.socket&&console.log("[CLIENT API] get files ".concat(n));var e=gt("get-files-");t.statusApi.searching.set(!0),t.eventBus.subscribe(e,(function(e){t.statusApi.searching.set(!1),e=e.filter((function(t){return"md"===t.extension})),cb(e,n)})),m.b.emit("askForFiles",{folderPath:n,token:Object(v.b)(),idReq:e})},getPreviews:function(n,cb){var e=gt("get-files-");t.eventBus.subscribe(e,cb),m.b.emit("askFilesPreview",{filesPath:n,idReq:e,token:Object(v.b)()})},search:t.searchApi.files.search}}({eventBus:o,searchApi:a,statusApi:t.statusApi}),u=function(t){var n=Object(f.a)({},t).eventBus;Object(l.useEffect)((function(){m.b.on("getUploadedFile",(function(t){n.notify(t.idReq,t)}))}),[]);var e=function(t,cb){try{var e=gt("upload-file");n.subscribe(e,(function(n){delete n.idReq,t.onSuccess&&t.onSuccess(n),cb&&cb({message:"success",succesObj:n})})),Object(A.a)({file:t.file,path:t.folderPath,idReq:e,onProgress:function(n){t.onProgress&&t.onProgress(n)}})}catch(o){console.warn(o)}},o=Object(l.useRef)([]),c=Object(O.a)(Object(T.a)(Object(S.a)().mark((function t(){var n,c,a,r;return Object(S.a)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!(o.current.length<1)){t.next=2;break}return t.abrupt("return");case 2:if(n=o.current.length,c=0,Object(R.d)("Files Uploaded: \n ".concat(c,"/").concat(n),"upload-info"),"mobile"!==Object(F.a)()){t.next=16;break}a=Object(S.a)().mark((function t(i){return Object(S.a)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,new Promise((function(t,a){var 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)),e(r.uploadInfos,(function(e){var o=++c===n?5:60;Object(R.d)("Files Uploaded: \n ".concat(c,"/").concat(n),"upload-info",o),r&&r.cb&&r.cb(e),t(void 0)}))}));case 2:case"end":return t.stop()}}),t)})),r=0;case 8:if(!(r<o.current.length)){t.next=13;break}return t.delegateYield(a(r),"t0",10);case 10:r++,t.next=8;break;case 13:o.current=[],t.next=18;break;case 16:Object(i.a)(o.current,(function(t,o){setTimeout((function(){console.log("[UPLOAD] starting upload item ".concat(t.uploadInfos.file.name)),e(t.uploadInfos,(function(e){var o=++c===n?5:60;Object(R.d)("Files Uploaded: \n ".concat(c,"/").concat(n),"upload-info",o),t.cb&&t.cb(e)}))}),500*o)})),o.current=[];case 18:case"end":return t.stop()}}),t)}))),500);return{uploadFile:function(t,cb){o.current.length,Object(R.d)("Starting Uploading Files...","upload-info"),o.current.push({uploadInfos:t,cb:cb}),c()}}}({eventBus:o}),g=Object(B.a)({eventBus:o}),h=function(t){return Object(l.useEffect)((function(){m.b.on("getFoldersScan",(function(n){t.eventBus.notify(n.idReq,{folders:n.folders,pathBase:n.pathBase})})),m.b.on("onServerTaskFinished",(function(n){t.eventBus.notify(n.idReq,n.status)}))}),[]),{get:function(n,cb,e){C.a.client.log.socket&&console.log("[FOLDERS API] get folders ",n,e);var o=gt("get-folders-");t.eventBus.subscribe(o,(function(t){var e=Object(f.a)({},t);e.folderPaths=n,cb(e)})),m.b.emit("askFoldersScan",{foldersPaths:n,depth:(null===e||void 0===e?void 0:e.depth)||0,token:Object(v.b)(),idReq:o})},move:w({eventBus:t.eventBus}).folder,create:function(n,cb){console.log("[askFolderCreate]",n);var e=gt("create-folder-");n=Object(b.b)(n),cb&&t.eventBus.subscribe(e,(function(t){cb(t)})),m.b.emit("askFolderCreate",{newFolderPath:n,token:Object(v.b)(),idReq:e})},delete:p.a}}({eventBus:o}),j=function(t){return Object(l.useEffect)((function(){m.b.on("getCommandExec",(function(n){t.eventBus.notify(n.idReq,n.resultCommand)})),m.b.on("getCommandExecStream",(function(n){t.eventBus.notify(n.idReq,n.streamChunk)}))}),[]),{exec:function(n,cb){var e=gt("command-exec-");t.eventBus.subscribe(e,(function(t){Object($.a)(t)||(t=JSON.stringify(t)),cb(t)}),{persistent:!0}),m.b.emit("askCommandExec",{commandString:n,token:Object(v.b)(),idReq:e})},stream:function(n,cb){var e=gt("command-stream-");t.eventBus.subscribe(e,(function(n){cb(n),n.isLast&&t.eventBus.unsubscribe(e)}),{persistent:!0}),m.b.emit("askCommandExecStream",{commandString:n,token:Object(v.b)(),idReq:e})}}}({eventBus:o}),x=function(t){Object(l.useEffect)((function(){m.b.on("getBackendConfig",(function(n){t.eventBus.notify(n.idReq,n.config)}))}),[]);var n={get:function(cb){var n=gt("get-config-");t.eventBus.subscribe(n,(function(t){cb(t)})),m.b.emit("askBackendConfig",{token:Object(v.b)(),idReq:n})},getPlatform:function t(){return t()}};return n}({eventBus:o}),y=function(t){Object(l.useEffect)((function(){m.b.on("getPluginsList",(function(n){t.eventBus.notify(n.idReq,n)}))}),[]);var n=function(cb,n){n||(n={}),n.noCache||(n.noCache=!1),C.a.client.log.socket&&console.log("".concat(tt," get plugins"));var e=gt("get-plugins-");t.eventBus.subscribe(e,(function(t){t.scanLog.length>0&&pt((function(n){return n.ui.notification.emit({content:"PLUGIN SCAN LOG:<br/>".concat(JSON.stringify(t.scanLog)),options:{hideAfter:60}})}));var n=Object(X.a)(t.plugins,(function(t){return t.name}));cb(n,t.scanLog)})),m.b.emit("askPluginsList",{noCache:n.noCache,token:Object(v.b)(),idReq:e})},e={list:n,get:function(t,e,cb){n((function(n,o){var i=n.filter((function(n){return n.name===t&&n.type===e}))[0]||null;cb(i)}),{noCache:!0})},cronCache:{set:function(t,n){var e="plugins-cron-infos";pt((function(o){o.cache.get(e,(function(i){i||(i={}),i[t]||(i[t]={vars:{}}),i[t].vars=n,o.cache.set(e,i,-1)}))}))}},marketplace:{fetchList:function(cb){pt((function(t){var n=t.userSettings.get("plugins_marketplace_url"),e="".concat(tt," api.plugins.marketplace.fetchList error for url: ").concat(n," :");t.ressource.fetch(n,(function(t){try{var o=JSON.parse(t),c=[];Object(Q.a)(o)?(Object(i.a)(o,(function(t){var n={name:"",description:"",versions:[],configuration:[]};t.name&&(n.name=t.name),t.description&&(n.description=t.description),t.versions&&(n.versions=t.versions),t.images&&(n.images=t.images),t.icon&&(n.icon=t.icon),t.configuration&&(n.configuration=t.configuration),""!==n.name&&c.push(n)})),cb(c)):Object(R.d)("".concat(e,": did not find a plugin list"))}catch(a){Object(R.d)("".concat(e," ").concat(JSON.stringify(a),", url: ").concat(n))}}),{disableCache:!0})}))}}};return e}({eventBus:o}),_=K(),E=Object(nt.b)({}),I={get:function(cb){var t=setInterval((function(){m.b&&(cb(m.b),clearInterval(t))}),10)}},P=Object(d.c)({eventBus:o}).userSettingsApi,L=Object(p.c)({searchUiApi:a.ui,statusApi:t.statusApi,filesApi:s,foldersApi:h,windowApi:t.windowsApi,tabsApi:t.tabsApi,userSettingsApi:P}),M=z(),D=Object(Y.b)({}),W=function(t){return Object(l.useEffect)((function(){m.b.on("getPerformanceReport",(function(n){t.eventBus.notify(n.idReq,n)}))}),[]),{getReport:function(cb){var n=gt("get-perf-report");t.eventBus.subscribe(n,(function(t){cb?cb(t):(console.log("[PERF API]","report"),console.log(t.report))})),m.b.emit("askPerformanceReport",{token:Object(v.b)(),idReq:n})}}}({eventBus:o}),U=function(t){var n="[ACTIVITY API]";return Object(l.useEffect)((function(){m.b.on("getActivityReport",(function(n){t.eventBus.notify(n.idReq,n)}))}),[]),{getReport:function(e,cb){console.log(n,"asked for report (if no cb provided, will be outputed to console.log)",e);var o=gt("get-perf-report");t.eventBus.subscribe(o,(function(t){cb?cb(t):(console.log(n,"report"),console.log(t.report))})),m.b.emit("askActivityReport",{params:e,token:Object(v.b)(),idReq:o})}}}({eventBus:o}),H=Object(it.b)({}),q={search:at,setStatus:st,getStatus:lt},V={cache:_,file:r,audio:ot,encryption:Z.b,files:s,socket:I,popup:t.popupApi,upload:u,ressource:g,tabs:t.tabsApi,folders:h,config:x,userSettings:P,history:t.historyApi,status:t.statusApi,note:M,analytics:D,search:a,command:j,plugins:y,watch:c,performance:W,activity:U,ai:q,ui:{browser:L,floatingPanel:H,notification:E,windows:t.windowsApi,lightbox:t.lightboxApi,textToSpeechPopup:t.ttsApi,search:a.ui,note:M.ui,notePreviewPopup:t.notePreviewPopupApi}};return ut=V,V},gt=function(t){return"client-api-".concat(t,"-req-").concat(Object(u.a)())},ht=function(t,cb){dt().then((function(n){var e=t.apiName.split("."),r=n;if(Object(i.a)(e,(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(vt("",n))});try{var l=mt(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)})}}))},mt=function(t){var n=function(t){var n=t.toString().replace(L,""),e=null;return null===(e=n.startsWith("cb =>")?["cb"]:n.slice(n.indexOf("(")+1,n.indexOf(")")).match(M))&&(e=[]),e}(t),e=n.indexOf("cb");return-1===e?null:e},vt=function t(n,e){var o="";for(var c in e)if("object"===typeof e[c]&&e[c].constructor!==Array){if(c.length>1&&"get"!==c){var a=""!==n?"".concat(n,"."):"";o+=t("".concat(a).concat(c),e[c])}}else o="".concat(o).concat(n,".").concat(c,"\n");var l=o.split("\n"),s=[];return dt().then((function(t){Object(i.a)(l,(function(n){var e=n.split("."),o=t;Object(i.a)(e,(function(t,n){o[t]&&(o=o[t])}));var c="var",a="";Object(r.a)(o)&&(c="Function",a=o.toString()),s.push({name:n,type:c,description:a})}))})),o}},90:function(t,n,e){"use strict";e.d(n,"a",(function(){return h})),e.d(n,"b",(function(){return v}));e(26),e(0);var o=e(27),i=e(18),c=e(12),a=e(98),r=e(33),l=e(72),s=e(56),u=e(10),d=e(43),p=e(9),f=e(25),b=e(1),g=400,h=function(t){var n=t.markdownTag.split("](")[1].slice(0,-1),e=t.markdownTag.split("](")[0].replace("![",""),u="".concat(Object(d.a)(t.file.folder),"/").concat(n).concat(Object(i.c)()),f="".concat(e,".").concat(Object(a.a)(n)),g=Object(o.b)(u),h="ress-".concat(Object(s.b)(g));Object(r.a)(t.file,g,(function(){var n=document.querySelector(".".concat(h," .iframe-wrapper"));n&&v(g,n,t.file.path)}));var m=r.d,v=function(n,e,i,s){var u=(null===s||void 0===s?void 0:s.fullscreen)||!1;null===s||void 0===s||s.fullscreen;if(e){var d=Object(o.e)(i);if(null!==s&&void 0!==s&&s.persist){var p=e.querySelector("iframe")?"closed":"open";Object(r.b)(d,n,p)}var f=function(){e.innerHTML=""},b="mobile"===Object(c.a)()?-300:-100,g=Object(a.a)(n).toLocaleLowerCase();"epub"===g?Object(l.c)(e,Object(l.b)("epub",n,t.windowId,{file:d,fullscreen:u,onFullscreenClose:f,ctagHeightOffset:b}),null===s||void 0===s?void 0:s.openOnly):"pdf"===g?Object(l.c)(e,Object(l.b)("pdf",n,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)(e,Object(l.b)("datatable",n,t.windowId,{file:d,fullscreen:u,onFullscreenClose:f,ctagHeightOffset:b}),null===s||void 0===s?void 0:s.openOnly):Object(l.c)(e,Object(l.b)("iframe",n,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 n=t.dataset.link;window.open(n,"popup-preview-link","width=800,height=1000")}})),'"\n\t\tdata-link="').concat(g,'">').concat(m("up-right-from-square"),"</li>"),j='<li\n\t\tonclick="'.concat(Object(r.c)("preview-link-ress",(function(t){return function(t,n){if(t){var e=t.dataset.link,o=t.dataset.filepath,i=function(t){return t.parentNode.parentNode.parentNode.parentNode.parentNode.querySelector(".iframe-wrapper")}(t);v(e,i,o,n)}}(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>"),x='<li\n\t\tonclick="'.concat(Object(r.c)("download-link-ress",(function(t){if(t){var n=t.dataset.link,e=t.dataset.filename;console.log(u,f),w(e,n)}})),'"\n\t\ttitle="Preview link" data-filename="').concat(f,'" data-link="').concat(g,'">').concat(m("download"),"</li>"),y="<ul>".concat(j," ").concat(O," ").concat(x,"</ul>"),k='<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 n=t.dataset.link,e="iframe",o=Object(a.a)(n).toLocaleLowerCase();"epub"===o&&(e="epub"),"pdf"===o&&(e="pdf"),"csv"!==o&&"arrow"!==o||(e="datatable"),Object(p.d)((function(t){t.ui.floatingPanel.create({type:"ctag",layout:"full-center",ctagConfig:{tagName:e,content:n}})}))}})),'">\n\t\t\t').concat(e," (").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:k}}),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: 90px;\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: 90px;\n\t\tpointer-events: all;\n}\n\n")},w=function(t,n){var e=document.createElement("a");e.style.display="none",document.body.appendChild(e),e.href=n,e.target="_blank",e.setAttribute("download",t),e.click(),window.URL.revokeObjectURL(e.href),document.body.removeChild(e)}},91:function(t,n,e){"use strict";e.d(n,"b",(function(){return r})),e.d(n,"a",(function(){return l}));var o=e(4),i=e(26),c=e(286),a=e(0),r=function(){var t=Object(a.useState)([]),n=Object(o.a)(t,2),e=n[0],r=n[1],s=Object(a.useState)(0),u=Object(o.a)(s,2),d=u[0],p=u[1];return{lightboxApi:{open:function(t,n){var e=[];Object(i.a)(n,(function(t){if(Object(c.a)(t)){var n={file:l(),title:"",url:t};e.push(n)}else e.push(t)})),r(e),p(t)},close:function(){r([]),p(0)}},lightboxImages:e,lightboxIndex:d}},l=function(t,n){return{nature:"file",name:t||"",realname:"",path:n||"",folder:""}}},93:function(t,n,e){"use strict";e.d(n,"b",(function(){return a})),e.d(n,"d",(function(){return r})),e.d(n,"c",(function(){return l})),e.d(n,"a",(function(){return u}));var o=e(15),i=e(26),c=e(427);c.setOptions({gfm:!0,breaks:!0,headerPrefix:"t-"});var a=function(t){var n=t;return n=c.parse(n)},r=function(t,n,e){var o=t,c=o.match(n)||"";return Object(i.a)(c,(function(t){o=o.replace(t,e(t))})),o},l=function(t,n,e){var o=t,i=n.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(n),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]=e(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(n,e){var o=!1;if(Object(i.a)(n,(function(t){t.id===e&&(o=!0)})),o){var c=!1,a=[e[e.length-2],e[e.length-1]],r=e.slice(0,-2),l=parseInt(a[1]);return"-"!==a[0]||isNaN(l)||(c=!0),c?e="".concat(r,"-").concat(l+1):e+="-1",t(n,e)}return e},u=function(t,n){var e=n.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<e.length;c++){if(e[c].includes(t)){i=c;break}}}else i=t;for(var a=function(t){for(var n=[],e=t.split("\n"),i=[],c=0;c<e.length;c++){var a=e[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}),n.push({id:p,title:u,line:d,ranking:l[1].length,previewId:f})}}return n}(n),r=null,l=0;l<a.length;l++){var u=a[l];if(u.line>i)break;r=u}return{line:i,mdPart:r}}},94:function(t,n,e){"use strict";e.d(n,"a",(function(){return u})),e.d(n,"b",(function(){return f}));var o=e(11),i=e(26),c=e(29),a=e(103),r=e(93),l=e(43),s=function(t){var n=Object(o.a)({},t),e=n.raw,i=n.file,c=n.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)(e))))));return Object(a.d)(),s},u=function(t,cb){for(var n=document.getElementsByClassName(t),e=function(){var t=n[o];t.onclick=function(){cb(t)}},o=0;o<n.length;o++)e()},d=function(t){var n=t.split(c.a.userCustomTagManual),e=[],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,n){t>=2&&p.push(n)})),Object(i.a)(l,(function(t,e){if(p.includes(t))if(s){if(s===t){var i=[u+1,e+1];d.push.apply(d,i);for(var c=n.slice(i[0],i[1]),a=l.slice(u+1,e+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:e}),u=-1,s=null}}else s=t,u=e})),0===d.length)e.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];n[g]&&e.push({type:"text",content:n[g],start:g,end:g+1})}}for(var h=0===t.indexOf(l[0]),m=[],v=o.length>e.length?o.length:e.length,w=0;w<v;w++)h?(o[w]&&m.push(o[w]),e[w]&&m.push(e[w])):(e[w]&&m.push(e[w]),o[w]&&m.push(o[w]));return m},p=function(t){var n="";return Object(i.a)(t,(function(t){"text"===t.type?n+=t.content:"tag"===t.type&&(n+="[[".concat(t.tagName,"]]").concat(t.content,"[[").concat(t.tagName,"]]"))})),n},f={render:function(t){var n=Object(o.a)({},t),e=n.raw,c=n.file,a=n.windowId;a||(a="");var r=d(e);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}}},95:function(t,n,e){"use strict";e.d(n,"b",(function(){return c})),e.d(n,"a",(function(){return a})),e.d(n,"d",(function(){return r})),e.d(n,"c",(function(){return l}));var o=e(248),i=e(26),c=["Az","Crea","Modif"],a=["alphabetical","created","modified"],r=function(t,n){var e;switch(a[n]){case"alphabetical":default:e=Object(o.a)(t,[function(t){return t.realname.toLocaleLowerCase()}]);break;case"created":e=Object(o.a)(t,["created"]).reverse();break;case"modified":e=Object(o.a)(t,["modified"]).reverse()}return e},l=function(t){var n=t[0];return n?(Object(i.a)(t,(function(t){t.created&&n.created&&t.created>n.created&&(n=t)})),n):null}},96:function(t,n,e){"use strict";e.d(n,"c",(function(){return st})),e.d(n,"a",(function(){return ft})),e.d(n,"b",(function(){return bt}));var o=e(4),i=e(0),c=e.n(i),a=e(245),r=e(247),l=e(54),s=e(13),u=e(380),d=e(10),p=e(68),f=e(12),b=e(219),g=e(57),h=e(215),m=e(15),v=e(26),w=e(17),O=e(9),j=e(30),x=(w.a.client.log.verbose,function(t,n,e,o,i){return{label:t,apply:n||t,info:e,detail:i,type:"tag",boost:o||0}}),y=function(t,n){var e=_(t,n);return[C(n),e,k(n)]},k=function(t){return function(n){var e=n.matchBefore(/\-/);if(!n.explicit&&!e)return null;var o="".concat(w.a.path.configFolder,"/snippets.md");return new Promise((function(i,c){Object(O.d)((function(c){c.file.getContent(o,(function(o){var c=[],a=o.split("\n");Object(v.a)(a,(function(t){var n,e=(t=t.split("\\n").join("\n")).split("|"),o=null===(n=e.shift())||void 0===n?void 0:n.trim(),i=e.join("|").trim();if(i&&o){if(o="--"+o,i.includes("${")){var a=i;try{i=new Function("return `"+a+"`")()}catch(s){var r="".concat("[Code Mirror]"," snippets error: ").concat(JSON.stringify({e:s,oto:a}));Object(j.d)(r)}}var l=i.length>20?"".concat(i.substring(0,20),"..."):i;c.push(x(o,i,void 0,void 0,l))}}));var r={from:e?e.from:n.pos,options:c,validFor:/.*/};t("snippets"),i(r)}))}))}))}},_=function(t,n){return function(e){var o=e.matchBefore(/\#/);return e.explicit||o?new Promise((function(i,c){Object(O.d)((function(c){var a=t.folder;console.log("searching for folder",a),c.search.word("#",a,(function(t){var c=[];Object(v.a)(t,(function(t){Object(v.a)(t.results,(function(t){var n=t.split(" ");Object(v.a)(n,(function(t){(t=t.trim())&&t.startsWith("#")&&(t.length<=1||"#"!==t[1]&&c.push(x(t,t)))}))}))}));var a={from:o?o.from:e.pos,options:c,validFor:/.*/};n("hashtag"),i(a)}))}))})):null}},C=function(t){return function(n){var e=n.matchBefore(/\[\[/);return n.explicit||e?new Promise((function(o,i){var c=new Promise((function(t,n){Object(O.d)((function(n){n.files.get("/.tiro/tags",(function(e){var o=0,i=[];Object(v.a)(e,(function(c){n.file.getContent(c.path,(function(n){o++,i.push({name:c.name,content:n}),o===e.length&&t(i)}))}))}))}))})),a=new Promise((function(t,n){Object(O.d)((function(n){var e=[];n.plugins.list((function(n){Object(v.a)(n,(function(t){"tag"===t.type&&e.push({name:t.name,content:t.code})})),t(e)}))}))}));Promise.all([a,c]).then((function(t){var n=function(t){var n=[];return Object(v.a)(t,(function(t){var e=t.name.replace(".md",""),o="[[".concat(e,"]]"),i="".concat(o," ").concat(o),c="Insert installed custom tag ".concat(o),a=0,r=t.content.split("\n"),l="// --insert:",s="// --comment:",u="// --boost:";Object(v.a)(r,(function(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,"")))})),n.push(x(o,i,c,a))})),n}([].concat(Object(m.a)(t[0]),Object(m.a)(t[1])));r(n)})).catch((function(){console.warn("ERROR HERE")}));var r=function(i){var c={from:e?e.from:n.pos,options:i,validFor:/.*/};t("ctag"),o(c)}})):null}},E=e(122),S=e(28),T=e(90),I=e(159),P=e(75),N=e(117),A=e(213),R=e(29),F=e(98),L=e(45),M=e(1),D=function(t,n){return Object(L.a)({file:t,windowId:n,pattern:R.a.ressource,replacement:function(e){var o=e.matchs,i=document.createElement("span"),c=o[2];return"none"===Object(F.a)(c)?i.innerHTML=Object(N.a)(o[0],o[2],t,!0):i.innerHTML=function(t,n,e){var o=t[0],i='<div class="mdpreview-source">'.concat(o,"</div>"),c=Object(A.renderToString)(Object(M.c)(T.a,{markdownTag:o,file:n,windowId:e}));return"".concat(c," ").concat(i)}(o,t,n),i}})},z=e(99),B=e(229),W=e(23),U=e(176),H=e(128),q=e(38),V=e(34),J=e(226),G=e(227),K=e(103),Y=e(25),$=e(228),Z=e(230),X=e(8),Q=e(32),tt=e(3),nt=e(44),et=e(285),ot=e(383),it={lines:[],words:[],sentences:[],userDicStr:[]},ct={lastLinePos:-1},at=Object(ot.a)((function(){Object(O.d)((function(t){t.file.getContent(".tiro/suggestions.md",(function(t){"NO_FILE"!==t&&(it.userDicStr=["\n"+t])}))}))}),6e4),rt=Object(ot.a)((function(t,n,e){at();var o=t;e>0&&(o=t.slice(0,-e));var i=o+n+it.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)),it.lines=c,it.words=l,it.sentences=r}),6e3),lt=Object(et.b)(function(){var t=Object(nt.a)(Object(Q.a)().mark((function t(n,e){var o,i,c,a,r,l,s,u,d,p,f,b,g,h,m,v,w,j,x,y,k,_,C,E,S,T,I,P,N,A,R,F,L,M,D,z,B,W,U,H,q,V;return Object(Q.a)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(new Promise((function(t,n){Object(O.d)((function(t){}))})),o=n.split("\n").slice(-1)[0],i=o.split(".").slice(-1)[0].split("?").slice(-1)[0].split("!").slice(-1)[0],c=n.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=n+e,(r.startsWith("d'")||r.startsWith("l'"))&&(r=r.slice(2)),d=i.length,p="",rt(n,e,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}w=[],j=[],x=Object(tt.a)(it.words);try{for(x.s();!(y=x.n()).done;)if((k=y.value).startsWith(r)&&(w.push(k),l&&l.length>0))for(_=l+" "+k,C=u.indexOf(_);-1!==C&&""!==k;)j.push(k),C=u.indexOf(_,C+1)}catch(J){x.e(J)}finally{x.f()}if(!(j.length>0)){t.next=47;break}E="",S=0,T=Object(tt.a)(j),t.prev=31,P=Object(Q.a)().mark((function t(){var n,e;return Object(Q.a)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:n=I.value,(e=j.filter((function(t){return t===n})).length)>S&&(E=n,S=e);case 3:case"end":return t.stop()}}),t)})),T.s();case 34:if((I=T.n()).done){t.next=38;break}return t.delegateYield(P(),"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=[E];case 47:N=j.length>0?j:w,m&&(N=j),A="",N.length>0&&(R=N.sort((function(t,n){return n.length-t.length})),F=R.slice(0,10),L=Math.floor(Math.random()*F.length),A=(A=F[L]).replace(r,"")),M=[".",",","!","?","|"].includes(A.slice(-1)),D=" "===A.slice(-2,-1),M&&D&&(A=A.slice(0,-2)),M&&(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(tt.a)(it.sentences);try{for(W.s();!(U=W.n()).done;)(H=U.value).toLocaleLowerCase().startsWith(a.toLocaleLowerCase())&&B.push(H)}catch(J){W.e(J)}finally{W.f()}B.length>0&&(h=B.sort((function(t,n){return n.length-t.length}))[0],q=a.length,h=h.slice(q)),f&&(p=h)}return V=!0,ct.lastLinePos!==c&&(V=!1),ct.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(n,e){return t.apply(this,arguments)}}(),100),st={lastCMSelection:{from:-1,to:-1,line:-1,selectionContent:"",lineContent:""},lastCMId:""},ut="[Code Mirror]",dt=w.a.client.log.verbose,pt=Object(i.forwardRef)((function(t,n){var e=function(){var t=n.current;return t&&t.state?t:null},d=Object(i.useRef)(null);Object(i.useEffect)((function(){!function(){var n,o=e();if(!o)return!1;if(t.value===d.current)return!1;if("loading..."===t.value)return!1;if((null===(n=o.view)||void 0===n?void 0:n.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 m=Object(i.useState)(!1),w=Object(o.a)(m,2),j=w[0],x=w[1];Object(i.useEffect)((function(){x(!1)}),[t.file.path]),Object(i.useEffect)((function(){!0===j&&k()}),[t.value]);var k=Object(V.a)((function(){var t=e();g.a.foldAllChildren(t)}),500),_=Object(i.useRef)(t.value);Object(i.useEffect)((function(){_.current=t.value}),[t.value]);var C=function(n,e){n!==t.value&&(d.current=n,_.current=n,t.onChange(n),Ht(!1),z.a.val=!1,A(),tt(n))};Object(i.useEffect)((function(){if(dt&&console.log(ut,"JUMP to line :",t.jumpToLine),-1!==t.jumpToLine){var n=e();if(n&&!(t.posY<=-10))try{g.a.scrollToLine(n,t.jumpToLine)}catch(o){console.log(o)}}}),[t.jumpToLine]);Object(i.useEffect)((function(){A()}),[t.value]),Object(i.useEffect)((function(){A()}),[]);var T=Object(b.a)(".window-id-".concat(t.windowId," .cm-content")).resizeState;Object(i.useEffect)((function(){A()}),[T,t.windowId]);var A=function(){var o=e();if(o){var i=g.a.getEditorInfos(o.view);n.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),L=F[0],Y=F[1];Object(i.useEffect)((function(){var t=null;Object(v.a)(r.a,(function(n){"Javascript"===n.name&&(t=n)})),Y(t)}),[]),Object(v.a)(r.a);var Q={base:a.markdownLanguage,codeLanguages:r.a,extensions:[]};L&&(Q.defaultCodeLanguage=L);var tt=Object(V.a)((function(t){t.includes("--table")&&!ot&&(it(!0),jt()),t.includes("--latex")&&!rt&&(pt(!0),jt()),t.includes("--spellcheck")&&!gt&&(ht(!0),jt()),!t.includes("--table")&&ot&&(it(!1),jt()),!t.includes("--latex")&&rt&&(pt(!1),jt()),!t.includes("--spellcheck")&>&&(ht(!1),jt())}),500),nt=Object(i.useState)(!1),et=Object(o.a)(nt,2),ot=et[0],it=et[1],ct=Object(i.useState)(!1),at=Object(o.a)(ct,2),rt=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)(0),vt=Object(o.a)(mt,2),wt=vt[0],Ot=vt[1],jt=function(){Ot(wt+1)};Object(i.useEffect)((function(){tt(t.value)}),[t.value]);var xt=Object(i.useState)([]),yt=Object(o.a)(xt,2),kt=yt[0],_t=yt[1],Ct=Object(i.useState)(""),Et=Object(o.a)(Ct,2),St=Et[0],Tt=Et[1],It=function(){var t=document.querySelector(".cm-tooltip");if(t){var n="translate(".concat(-Math.round(Pt.current[0]),"px, ").concat(-Math.round(Pt.current[1]-20),"px)");t.style.transform=n}},Pt=Object(i.useRef)([0,0]),Nt=function(){var e,o=(null===n||void 0===n||null===(e=n.current)||void 0===e?void 0:e.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&&(Pt.current=[a.left,a.top],It())}),100)}},At=Object(V.a)((function(){Rt.current&&Object(O.d)((function(n){var e;n.note.ui.editorAction.dispatch({type:"lineJump",windowId:t.windowId,lineJumpString:null===Rt||void 0===Rt||null===(e=Rt.current)||void 0===e?void 0:e.lineText,lineJumpType:"preview"})}))}),400),Rt=Object(i.useRef)(null);Object(i.useEffect)((function(){Object(O.d)((function(e){var o=[Object(l.a)({override:y(t.file,Nt)}),s.c.updateListener.of((function(t){t.docChanged&&It()})),s.c.domEventHandlers({scroll:function(t,e){if(S.d.curr.ui_editor_synced_title_scrolling){var o=n.current;if(o){var i=g.a.getScrolledLine(o);i.lineText.startsWith("#")&&(Rt.current=i,At())}}},wheel:function(n,e){var o=g.a.getEditorInfos(e);p.a.scrollScroller(t.windowId,o.currentPercentScrolled()),t.onScroll()}})];(e.userSettings.get("ui_editor_spellcheck")||gt)&&o.push(s.c.contentAttributes.of({spellcheck:"true"}));var i=t.pluginsConfig;i||(i={}),Object(U.a)(i.markdown)||(i.markdown=!0),Object(U.a)(i.linkPreview)||(i.linkPreview=!0);var c=e.userSettings;Object(f.a)();if(c.get("ui_editor_markdown_tags")&&o.push(Object(J.b)(t.file,t.windowId)),c.get("ui_editor_links_as_button")&&(o.push(Object(I.c)(t.file,t.windowId)),o.push(Object(P.c)(t.file,t.windowId,i.linkPreview))),c.get("ui_editor_markdown_table_preview")&&ot&&(o.push(Object(z.f)(t.file,t.windowId)),o.push(Object(z.g)(t.file,t.windowId)),o.push(Object(z.d)(t.file,t.windowId)),o.push(Object(z.c)(t.file,t.windowId))),c.get("ui_editor_markdown_latex_preview")&&rt&&Q.extensions.push(E.a),c.get("ui_editor_markdown_preview")){K.b||Object(K.a)();var r=Object(E.c)({file:t.file,onTitleClick:function(n,e){Object(O.d)((function(n){n.note.ui.editorAction.dispatch({type:"lineJump",windowId:t.windowId,lineJumpNb:e,lineJumpType:"preview"})}))}});o.push(r),c.get("ui_editor_markdown_enhanced_preview")&&(o.push(Object(G.a)(t.file,t.windowId)),o.push(Object($.a)(t.file,t.windowId)),o.push(Object(N.c)(t.file,t.windowId)),o.push(D(t.file,t.windowId)),o.push(Object(B.a)(t.file,t.windowId))),c.get("ui_editor_markdown_syntax")&&o.push(Object(Z.a)(t.file,t.windowId))}i.markdown?o.push(Object(a.markdown)(Q)):o.push(Object(z.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(Ft),o.push(X.A.of(" ")),c.get("ui_editor_inline_suggestion")&&o.push(lt),_t(o),Tt(u)}))}),[t.pluginsConfig,t.windowId,t.file.path,t.value,rt,ot,gt,wt]);var Ft=s.c.domEventHandlers({blur:function(n,e){t.onEvent("blur")},focus:function(n,e){t.onEvent("focus")}}),Lt=Object(i.useRef)(""),Mt=Object(i.useRef)([-9999,-9999]),Dt=Object(i.useState)([-9999,-9999]),zt=Object(o.a)(Dt,2),Bt=(zt[0],zt[1]),Wt=Object(i.useState)(!1),Ut=Object(o.a)(Wt,2),Ht=(Ut[0],Ut[1]),qt=Object(i.useRef)({from:-1,to:-1}),Vt=Object(i.useRef)({from:-1,to:-1}),Jt=[30,10],Gt=Object(i.useState)({x:0,y:0}),Kt=Object(o.a)(Gt,2),Yt=(Kt[0],Kt[1],Object(V.a)((function(n){var o,i=null===(o=e())||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:n.from,to:n.to,fromPx:(null===a||void 0===a?void 0:a.top)||0,toPx:(null===a||void 0===a?void 0:a.bottom)||0})}n.from!==n.to&&Object(H.a)(n.from)&&Object(H.a)(n.to)&&(n.from<0||n.to<0||JSON.stringify(Vt.current)!==JSON.stringify(n)&&(Vt.current=Object(q.a)(n),Zt()))}),200)),$t=function(t,n){"up"===t?Lt.current=t:"down"===t?Ht(!1):"move"===t&&(Mt.current=[n.clientX,n.clientY])},Zt=function(){Object(O.d)((function(t){if(t.userSettings.get("ui_editor_ai_text_selection")){Ht(!0);var n=Mt.current;Bt([n[0]+Jt[0],n[1]+Jt[1]])}}))},Xt=Object(i.useMemo)((function(){return Object(M.c)(c.a.Fragment,null,Object(M.c)(u.a,{value:"",ref:n,theme:Object(h.a)(),onChange:C,onUpdate:function(n){!function(n){var e=n.state.selection.ranges[0];qt.current=e;var o=n.state.doc.sliceString(e.from,e.to),i=n.state.doc.lineAt(e.from),c=i.text;st.lastCMSelection={from:e.from,to:e.to,line:i.number,selectionContent:o,lineContent:c},st.lastCMId=t.windowId,Yt(e)}(n)},basicSetup:{foldGutter:!0,dropCursor:!1,allowMultipleSelections:!1,indentOnInput:!1,closeBrackets:!1,history:!0,bracketMatching:!1,lineNumbers:!1},extensions:kt}))}),[t.value,kt]);return Object(M.c)(c.a.Fragment,null,Object(M.c)("div",{className:"codemirror-editor-wrapper ".concat(St," "),onClick:function(t){$t("up",t)},onMouseDown:function(t){$t("down",t)},onMouseMove:function(t){return $t("move",t)}},Object(M.c)("div",{className:"foldall-wrapper ".concat(Object(f.a)()),onClick:function(t){!function(){var t=e();j?g.a.unfoldAllChildren(t):g.a.foldAllChildren(t,!1),x(!j)}()}},Object(M.c)(W.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")})),Xt))})),ft=c.a.memo(pt,(function(t,n){var e=!0;return t.forceRender!==n.forceRender&&(e=!1),t.jumpToLine!==n.jumpToLine&&(e=!1),t.file.path!==n.file.path&&(e=!1),e})),bt=function(t){t||(t={});var n=t.searchBottom;return n||(n=0),Object(f.c)("mobile")&&(n=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(n,"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(Y.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(Y.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(Y.a)(2),"px;\n\t\t\t}\n\t\t\t&.h4 {\n\t\t\t\t\tfont-size: ").concat(Object(Y.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(Y.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(Y.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(E.d)(),"\n\t\n\t// // FILE RESSOURCE PREVIEW\n\t// ").concat(Object(T.b)(),"\n\t\n\t// // PREVIEW LINK\n\t// ").concat(Object(P.b)(),"\n\t\n\t\n\t// ").concat(Object(z.e)(),"\n\t")}},98:function(t,n,e){"use strict";e.d(n,"a",(function(){return o}));var o=function(t){var n="none",e=t.split(".");return"7z"===(n=e[e.length-1].split("?")[0])&&(n="d7z"),n.length>10&&(n="none"),n}},99:function(t,n,e){"use strict";e.d(n,"a",(function(){return r})),e.d(n,"f",(function(){return s})),e.d(n,"g",(function(){return u})),e.d(n,"d",(function(){return d})),e.d(n,"b",(function(){return p})),e.d(n,"c",(function(){return f})),e.d(n,"e",(function(){return b}));var o=e(29),i=e(10),c=e(45),a=e(25),r={val:!1},l=r,s=function(t,n){return Object(c.a)({file:t,windowId:n,pattern:/\|/gim,classWrap:function(t){return"md-table-limiter"}})},u=function(t,n){return Object(c.a)({file:t,windowId:n,pattern:/t1.+t2/gim,classWrap:function(t){return"ttt4"}})},d=function(t,n){return Object(c.a)({file:t,windowId:n,pattern:o.a.mdTableCell,classWrap:function(t){var n=t[0].trim();return n&&"-"===n||n&&"-|"===n||n&&n.includes("[")||n.includes("]")||n&&!n.includes("|")?"":"md-table-cell"}})},p=function(t,n){return Object(c.a)({file:t,windowId:n,pattern:o.a.mdTitle,classWrap:function(t){var n=t[1].length;return"md-title-wrapper level-".concat(n)}})},f=function(t,n){return Object(c.a)({file:t,windowId:n,pattern:o.a.mdTableLine,classWrap:function(t){var n=t[0].trim();if(n&&n.includes("[")||n.includes("]"))return"";if(n&&n.startsWith("-"))return"";n.startsWith("|")&&(n=n.substring(1)),n.endsWith("|")&&(n=n.substring(0,n.length-1));var e=n.split("|").length;return l.val=!l.val,"md-table-line md-table-".concat(e," ").concat(l.val?"even":"")}})},b=function(){for(var t="",n=0;n<30;n++){var e=Math.floor(100/n);t+="\n\t\t\t\t&.md-table-".concat(n," span.md-table-cell{\n\t\t\t\t\t\twidth: calc(").concat(e,"% - 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")}}},[[568,11,12]]]);
|