From 9e46ff51017ee1f06f9759e403f9faf271a32e38 Mon Sep 17 00:00:00 2001 From: StandardNotes CI Date: Sat, 18 Jun 2022 14:25:41 +0000 Subject: [PATCH] chore(release): components --- .../dist/dist.js.map | 1 - packages/components/dist/zips/checksums.json | 64 +++++++++--------- .../org.standardnotes.advanced-checklist.zip | Bin 1111555 -> 1110892 bytes ...standardnotes.advanced-markdown-editor.zip | Bin 1008876 -> 1008725 bytes .../zips/org.standardnotes.bold-editor.zip | Bin 283931 -> 283900 bytes .../zips/org.standardnotes.code-editor.zip | Bin 456733 -> 456721 bytes ...rg.standardnotes.fancy-markdown-editor.zip | Bin 1403440 -> 1403372 bytes ...g.standardnotes.markdown-visual-editor.zip | Bin 6465689 -> 6464011 bytes ....standardnotes.minimal-markdown-editor.zip | Bin 270696 -> 270563 bytes .../zips/org.standardnotes.plus-editor.zip | Bin 187464 -> 187416 bytes ...g.standardnotes.simple-markdown-editor.zip | Bin 770492 -> 390493 bytes .../org.standardnotes.simple-task-editor.zip | Bin 71830 -> 71836 bytes .../org.standardnotes.standard-sheets.zip | Bin 4599765 -> 4599281 bytes .../zips/org.standardnotes.token-vault.zip | Bin 192794 -> 192763 bytes 14 files changed, 32 insertions(+), 33 deletions(-) delete mode 100644 packages/components/dist/assets/org.standardnotes.simple-markdown-editor/dist/dist.js.map diff --git a/packages/components/dist/assets/org.standardnotes.simple-markdown-editor/dist/dist.js.map b/packages/components/dist/assets/org.standardnotes.simple-markdown-editor/dist/dist.js.map deleted file mode 100644 index e96018a5d..000000000 --- a/packages/components/dist/assets/org.standardnotes.simple-markdown-editor/dist/dist.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"./dist.js","sources":["webpack:///./dist.js"],"sourcesContent":["!function(e){var t={};function n(r){if(t[r])return t[r].exports;var a=t[r]={i:r,l:!1,exports:{}};return e[r].call(a.exports,a,a.exports,n),a.l=!0,a.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){\"undefined\"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:\"Module\"}),Object.defineProperty(e,\"__esModule\",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&\"object\"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,\"default\",{enumerable:!0,value:e}),2&t&&\"string\"!=typeof e)for(var a in e)n.d(r,a,function(t){return e[t]}.bind(null,a));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,\"a\",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p=\"/\",n(n.s=23)}([function(e,t,n){\"use strict\";var r=Object.prototype.hasOwnProperty;function a(e,t){return r.call(e,t)}function i(e){return!(e>=55296&&e<=57343)&&(!(e>=64976&&e<=65007)&&(65535!=(65535&e)&&65534!=(65535&e)&&(!(e>=0&&e<=8)&&(11!==e&&(!(e>=14&&e<=31)&&(!(e>=127&&e<=159)&&!(e>1114111)))))))}function o(e){if(e>65535){var t=55296+((e-=65536)>>10),n=56320+(1023&e);return String.fromCharCode(t,n)}return String.fromCharCode(e)}var s=/\\\\([!\"#$%&'()*+,\\-.\\/:;<=>?@[\\\\\\]^_`{|}~])/g,l=new RegExp(s.source+\"|\"+/&([a-z#][a-z0-9]{1,31});/gi.source,\"gi\"),c=/^#((?:x[a-f0-9]{1,8}|[0-9]{1,8}))/i,d=n(12);var _=/[&<>\"]/,u=/[&<>\"]/g,p={\"&\":\"&\",\"<\":\"<\",\">\":\">\",'\"':\""\"};function m(e){return p[e]}var g=/[.?*+^$[\\]\\\\(){}|-]/g;var E=n(7);t.lib={},t.lib.mdurl=n(13),t.lib.ucmicro=n(37),t.assign=function(e){var t=Array.prototype.slice.call(arguments,1);return t.forEach((function(t){if(t){if(\"object\"!=typeof t)throw new TypeError(t+\"must be object\");Object.keys(t).forEach((function(n){e[n]=t[n]}))}})),e},t.isString=function(e){return\"[object String]\"===function(e){return Object.prototype.toString.call(e)}(e)},t.has=a,t.unescapeMd=function(e){return e.indexOf(\"\\\\\")<0?e:e.replace(s,\"$1\")},t.unescapeAll=function(e){return e.indexOf(\"\\\\\")<0&&e.indexOf(\"&\")<0?e:e.replace(l,(function(e,t,n){return t||function(e,t){var n=0;return a(d,t)?d[t]:35===t.charCodeAt(0)&&c.test(t)&&i(n=\"x\"===t[1].toLowerCase()?parseInt(t.slice(2),16):parseInt(t.slice(1),10))?o(n):e}(e,n)}))},t.isValidEntityCode=i,t.fromCodePoint=o,t.escapeHtml=function(e){return _.test(e)?e.replace(u,m):e},t.arrayReplaceAt=function(e,t,n){return[].concat(e.slice(0,t),n,e.slice(t+1))},t.isSpace=function(e){switch(e){case 9:case 32:return!0}return!1},t.isWhiteSpace=function(e){if(e>=8192&&e<=8202)return!0;switch(e){case 9:case 10:case 11:case 12:case 13:case 32:case 160:case 5760:case 8239:case 8287:case 12288:return!0}return!1},t.isMdAsciiPunct=function(e){switch(e){case 33:case 34:case 35:case 36:case 37:case 38:case 39:case 40:case 41:case 42:case 43:case 44:case 45:case 46:case 47:case 58:case 59:case 60:case 61:case 62:case 63:case 64:case 91:case 92:case 93:case 94:case 95:case 96:case 123:case 124:case 125:case 126:return!0;default:return!1}},t.isPunctChar=function(e){return E.test(e)},t.escapeRE=function(e){return e.replace(g,\"\\\\$&\")},t.normalizeReference=function(e){return e=e.trim().replace(/\\s+/g,\" \"),\"Ṿ\"===\"ẞ\".toLowerCase()&&(e=e.replace(/ẞ/g,\"ß\")),e.toLowerCase().toUpperCase()}},function(e,t,n){\"use strict\";e.exports=n(26)},function(e,t){function n(t){return e.exports=n=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},e.exports.__esModule=!0,e.exports.default=e.exports,n(t)}e.exports=n,e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t){e.exports=function(e,t){if(!(e instanceof t))throw new TypeError(\"Cannot call a class as a function\")},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t){function n(e,t){for(var n=0;n=0&&(n=this.attrs[t][1]),n},r.prototype.attrJoin=function(e,t){var n=this.attrIndex(e);n<0?this.attrPush([e,t]):this.attrs[n][1]=this.attrs[n][1]+\" \"+t},e.exports=r},function(e,t){e.exports=function(e){if(void 0===e)throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");return e},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t,n){\"use strict\";\n/*\nobject-assign\n(c) Sindre Sorhus\n@license MIT\n*/var r=Object.getOwnPropertySymbols,a=Object.prototype.hasOwnProperty,i=Object.prototype.propertyIsEnumerable;function o(e){if(null==e)throw new TypeError(\"Object.assign cannot be called with null or undefined\");return Object(e)}e.exports=function(){try{if(!Object.assign)return!1;var e=new String(\"abc\");if(e[5]=\"de\",\"5\"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t[\"_\"+String.fromCharCode(n)]=n;if(\"0123456789\"!==Object.getOwnPropertyNames(t).map((function(e){return t[e]})).join(\"\"))return!1;var r={};return\"abcdefghijklmnopqrst\".split(\"\").forEach((function(e){r[e]=e})),\"abcdefghijklmnopqrst\"===Object.keys(Object.assign({},r)).join(\"\")}catch(e){return!1}}()?Object.assign:function(e,t){for(var n,s,l=o(e),c=1;c`\\\\x00-\\\\x20]+|'[^']*'|\\\"[^\\\"]*\\\"))?)*\\\\s*\\\\/?>\",a=\"<\\\\/[A-Za-z][A-Za-z0-9\\\\-]*\\\\s*>\",i=new RegExp(\"^(?:\"+r+\"|\"+a+\"|\\x3c!----\\x3e|\\x3c!--(?:-?[^>-])(?:-?[^-])*--\\x3e|<[?].*?[?]>|]*>|)\"),o=new RegExp(\"^(?:\"+r+\"|\"+a+\")\");e.exports.HTML_TAG_RE=i,e.exports.HTML_OPEN_CLOSE_TAG_RE=o},function(e,t,n){\"use strict\";function r(e,t){var n,r,a,i,o,s=[],l=t.length;for(n=0;n=0;n--)95!==(r=t[n]).marker&&42!==r.marker||-1!==r.end&&(a=t[r.end],s=n>0&&t[n-1].end===r.end+1&&t[n-1].token===r.token-1&&t[r.end+1].token===a.token+1&&t[n-1].marker===r.marker,o=String.fromCharCode(r.marker),(i=e.tokens[r.token]).type=s?\"strong_open\":\"em_open\",i.tag=s?\"strong\":\"em\",i.nesting=1,i.markup=s?o+o:o,i.content=\"\",(i=e.tokens[a.token]).type=s?\"strong_close\":\"em_close\",i.tag=s?\"strong\":\"em\",i.nesting=-1,i.markup=s?o+o:o,i.content=\"\",s&&(e.tokens[t[n-1].token].content=\"\",e.tokens[t[r.end+1].token].content=\"\",n--))}e.exports.tokenize=function(e,t){var n,r,a=e.pos,i=e.src.charCodeAt(a);if(t)return!1;if(95!==i&&42!==i)return!1;for(r=e.scanDelims(e.pos,42===i),n=0;n{\"use strict\";var e={d:(t,n)=>{for(var r in n)e.o(n,r)&&!e.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:n[r]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t)},t={};let n,r,a,i;var o;e.d(t,{default:()=>N}),function(e){e.SetSize=\"set-size\",e.StreamItems=\"stream-items\",e.StreamContextItem=\"stream-context-item\",e.SaveItems=\"save-items\",e.SelectItem=\"select-item\",e.AssociateItem=\"associate-item\",e.DeassociateItem=\"deassociate-item\",e.ClearSelection=\"clear-selection\",e.CreateItem=\"create-item\",e.CreateItems=\"create-items\",e.DeleteItems=\"delete-items\",e.SetComponentData=\"set-component-data\",e.InstallLocalComponent=\"install-local-component\",e.ToggleActivateComponent=\"toggle-activate-component\",e.RequestPermissions=\"request-permissions\",e.PresentConflictResolution=\"present-conflict-resolution\",e.DuplicateItem=\"duplicate-item\",e.ComponentRegistered=\"component-registered\",e.ActivateThemes=\"themes\",e.Reply=\"reply\",e.SaveSuccess=\"save-success\",e.SaveError=\"save-error\",e.ThemesActivated=\"themes-activated\",e.KeyDown=\"key-down\",e.KeyUp=\"key-up\",e.Click=\"click\"}(n||(n={})),function(e){e[e.Web=1]=\"Web\",e[e.Desktop=2]=\"Desktop\",e[e.Mobile=3]=\"Mobile\"}(r||(r={})),function(e){e.Any=\"*\",e.Item=\"SF|Item\",e.RootKey=\"SN|RootKey|NoSync\",e.ItemsKey=\"SN|ItemsKey\",e.EncryptedStorage=\"SN|EncryptedStorage\",e.Note=\"Note\",e.Tag=\"Tag\",e.SmartTag=\"SN|SmartTag\",e.Component=\"SN|Component\",e.Editor=\"SN|Editor\",e.ActionsExtension=\"Extension\",e.UserPrefs=\"SN|UserPreferences\",e.HistorySession=\"SN|HistorySession\",e.Theme=\"SN|Theme\",e.Mfa=\"SF|MFA\",e.ServerExtension=\"SF|Extension\",e.FilesafeCredentials=\"SN|FileSafe|Credentials\",e.FilesafeFileMetadata=\"SN|FileSafe|FileMetadata\",e.FilesafeIntegration=\"SN|FileSafe|Integration\",e.ExtensionRepo=\"SN|ExtensionRepo\"}(a||(a={})),function(e){e.Pinned=\"pinned\",e.Archived=\"archived\",e.Locked=\"locked\",e.UserModifiedDate=\"client_updated_at\",e.DefaultEditor=\"defaultEditor\",e.MobileRules=\"mobileRules\",e.NotAvailableOnMobile=\"notAvailableOnMobile\",e.MobileActive=\"mobileActive\",e.LastSize=\"lastSize\",e.PrefersPlainEditor=\"prefersPlainEditor\",e.ComponentInstallError=\"installError\"}(i||(i={}));var s=new Uint8Array(16);function l(){if(!o&&!(o=\"undefined\"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||\"undefined\"!=typeof msCrypto&&\"function\"==typeof msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto)))throw new Error(\"crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported\");return o(s)}const c=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i,d=function(e){return\"string\"==typeof e&&c.test(e)};for(var _=[],u=0;u<256;++u)_.push((u+256).toString(16).substr(1));const p=function(e,t,n){var r=(e=e||{}).random||(e.rng||l)();if(r[6]=15&r[6]|64,r[8]=63&r[8]|128,t){n=n||0;for(var a=0;a<16;++a)t[n+a]=r[a];return t}return function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=(_[e[t+0]]+_[e[t+1]]+_[e[t+2]]+_[e[t+3]]+\"-\"+_[e[t+4]]+_[e[t+5]]+\"-\"+_[e[t+6]]+_[e[t+7]]+\"-\"+_[e[t+8]]+_[e[t+9]]+\"-\"+_[e[t+10]]+_[e[t+11]]+_[e[t+12]]+_[e[t+13]]+_[e[t+14]]+_[e[t+15]]).toLowerCase();if(!d(n))throw TypeError(\"Stringified UUID is invalid\");return n}(r)},m=e=>{var t;const n={[r.Web]:\"web\",[r.Desktop]:\"desktop\",[r.Mobile]:\"mobile\"};return null!==(t=n[e])&&void 0!==t?t:n[r.Web]},g=e=>null!=e,E=()=>{};class S{static get isSupported(){return!(!window.console&&!console)}static get info(){return S.isSupported&&this.enabled?console.log.bind(console):E}static get error(){return S.isSupported?console.error.bind(console):E}}var f,b,h,T;function C(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function v(e){for(var t=1;t0&&(this.initialPermissions=n),g(null==r?void 0:r.coallesedSaving)&&(this.coallesedSaving=r.coallesedSaving),g(null==r?void 0:r.coallesedSavingDelay)&&(this.coallesedSavingDelay=r.coallesedSavingDelay),g(null==r?void 0:r.acceptsThemes)&&(this.component.acceptsThemes=null===(o=null==r?void 0:r.acceptsThemes)||void 0===o||o),g(a)&&(this.onReadyCallback=a),g(i)&&(this.onThemesChangeCallback=i),S.enabled=null!==(t=null==r?void 0:r.debug)&&void 0!==t&&t}deinit(){this.onReadyCallback=void 0,this.component={acceptsThemes:!0,activeThemes:[]},this.messageQueue=[],this.sentMessages=[],this.lastStreamedItem=void 0,this.pendingSaveItems=void 0,this.pendingSaveTimeout=void 0,this.pendingSaveParams=void 0,this.messageHandler&&(this.contentWindow.document.removeEventListener(\"message\",this.messageHandler),this.contentWindow.removeEventListener(\"message\",this.messageHandler)),this.keyDownEventListener&&this.contentWindow.removeEventListener(\"keydown\",this.keyDownEventListener),this.keyUpEventListener&&this.contentWindow.removeEventListener(\"keyup\",this.keyUpEventListener),this.clickEventListener&&this.contentWindow.removeEventListener(\"click\",this.clickEventListener)}registerMessageHandler(){this.messageHandler=e=>{if(S.info(\"Components API Message received:\",e.data),document.referrer&&new URL(document.referrer).origin!==new URL(e.origin).origin)return;const{data:t}=e,r=(e=>{if(\"string\"!=typeof e)return!1;try{const t=JSON.parse(e),n=Object.prototype.toString.call(t);return\"[object Object]\"===n||\"[object Array]\"===n}catch(e){return!1}})(t)?JSON.parse(t):t;if(r){if(void 0===this.component.origin&&r.action===n.ComponentRegistered)this.component.origin=e.origin;else if(e.origin!==this.component.origin)return;this.handleMessage(r)}else S.error(\"Invalid data received. Skipping...\")},this.contentWindow.document.addEventListener(\"message\",this.messageHandler,!1),this.contentWindow.addEventListener(\"message\",this.messageHandler,!1),S.info(\"Waiting for messages...\")}registerKeyboardEventListeners(){this.keyDownEventListener=e=>{S.info(\"A key has been pressed: \".concat(e.key)),e.ctrlKey?this.keyDownEvent(T.Ctrl):e.shiftKey?this.keyDownEvent(T.Shift):(e.metaKey||\"Meta\"===e.key)&&this.keyDownEvent(T.Meta)},this.keyUpEventListener=e=>{S.info(\"A key has been released: \".concat(e.key)),\"Control\"===e.key?this.keyUpEvent(T.Ctrl):\"Shift\"===e.key?this.keyUpEvent(T.Shift):\"Meta\"===e.key&&this.keyUpEvent(T.Meta)},this.contentWindow.addEventListener(\"keydown\",this.keyDownEventListener,!1),this.contentWindow.addEventListener(\"keyup\",this.keyUpEventListener,!1)}registerMouseEventListeners(){this.clickEventListener=e=>{S.info(\"A click has been performed.\"),this.mouseClickEvent()},this.contentWindow.addEventListener(\"click\",this.clickEventListener,!1)}handleMessage(e){switch(e.action){case n.ComponentRegistered:this.component.sessionKey=e.sessionKey,e.componentData&&(this.component.data=e.componentData),this.onReady(e.data),S.info(\"Component successfully registered with payload:\",e);break;case n.ActivateThemes:this.activateThemes(e.data.themes);break;default:{var t,r;if(!e.original)return;const n=null===(t=this.sentMessages)||void 0===t?void 0:t.filter(t=>{var n;return t.messageId===(null===(n=e.original)||void 0===n?void 0:n.messageId)})[0];if(!n){const e=this.contentWindow.document.title,t=(\"The extension '\".concat(e,\"' is attempting to communicate with Standard Notes, \")+\"but an error is preventing it from doing so. Please restart this extension and try again.\").replace(\" \",\" \");return void S.info(t)}null==n||null===(r=n.callback)||void 0===r||r.call(n,e.data);break}}}onReady(e){this.component.environment=e.environment,this.component.platform=e.platform,this.component.uuid=e.uuid,this.initialPermissions&&this.initialPermissions.length>0&&this.requestPermissions(this.initialPermissions);for(const e of this.messageQueue)this.postMessage(e.action,e.data,e.callback);this.messageQueue=[],S.info(\"Data passed to onReady:\",e),this.activateThemes(e.activeThemeUrls||[]),this.postMessage(n.ThemesActivated,{}),this.onReadyCallback&&this.onReadyCallback()}getSelfComponentUUID(){return this.component.uuid}isRunningInDesktopApplication(){return this.component.environment===m(r.Desktop)}isRunningInMobileApplication(){return this.component.environment===m(r.Mobile)}getComponentDataValueForKey(e){if(this.component.data)return this.component.data[e]}setComponentDataValueForKey(e,t){if(!this.component.data)throw new Error(\"The component has not been initialized.\");if(!e||e&&0===e.length)throw new Error(\"The key for the data value should be a valid string.\");this.component.data=v(v({},this.component.data),{},{[e]:t}),this.postMessage(n.SetComponentData,{componentData:this.component.data})}clearComponentData(){this.component.data={},this.postMessage(n.SetComponentData,{componentData:this.component.data})}postMessage(e,t,n){if(!this.component.sessionKey)return void this.messageQueue.push({action:e,data:t,api:h.Component,callback:n});const r={action:e,data:t,messageId:this.generateUUID(),sessionKey:this.component.sessionKey,api:h.Component},a=JSON.parse(JSON.stringify(r));let i;a.callback=n,this.sentMessages.push(a),i=this.isRunningInMobileApplication()?JSON.stringify(r):r,S.info(\"Posting message:\",i),this.contentWindow.parent.postMessage(i,this.component.origin)}requestPermissions(e,t){this.postMessage(n.RequestPermissions,{permissions:e},()=>{t&&t()})}activateThemes(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];if(!this.component.acceptsThemes)return;S.info(\"Incoming themes:\",e);const{activeThemes:t}=this.component;if(t&&t.sort().toString()==e.sort().toString())return;let n=e;const r=[];for(const a of t)e.includes(a)?n=n.filter(e=>e!==a):r.push(a);S.info(\"Deactivating themes:\",r),S.info(\"Activating themes:\",n);for(const e of r)this.deactivateTheme(e);this.component.activeThemes=e;for(const e of n){if(!e)continue;const t=this.contentWindow.document.createElement(\"link\");t.id=btoa(e),t.href=e,t.type=\"text/css\",t.rel=\"stylesheet\",t.media=\"screen,print\",t.className=\"custom-theme\",this.contentWindow.document.getElementsByTagName(\"head\")[0].appendChild(t)}this.onThemesChangeCallback&&this.onThemesChangeCallback()}themeElementForUrl(e){return Array.from(this.contentWindow.document.getElementsByClassName(\"custom-theme\")).slice().find(t=>t.id==btoa(e))}deactivateTheme(e){const t=this.themeElementForUrl(e);t&&t.parentNode&&(t.setAttribute(\"disabled\",\"true\"),t.parentNode.removeChild(t))}generateUUID(){return p()}get platform(){return this.component.platform}get environment(){return this.component.environment}streamItems(e,t){this.postMessage(n.StreamItems,{content_types:e},e=>{t(e.items)})}streamContextItem(e){this.postMessage(n.StreamContextItem,{},t=>{const{item:n}=t;(!this.lastStreamedItem||this.lastStreamedItem.uuid!==n.uuid)&&this.pendingSaveTimeout&&(clearTimeout(this.pendingSaveTimeout),this.performSavingOfItems(this.pendingSaveParams),this.pendingSaveTimeout=void 0,this.pendingSaveParams=void 0),this.lastStreamedItem=n,e(this.lastStreamedItem)})}selectItem(e){this.postMessage(n.SelectItem,{item:this.jsonObjectForItem(e)})}clearSelection(){this.postMessage(n.ClearSelection,{content_type:a.Tag})}createItem(e,t){this.postMessage(n.CreateItem,{item:this.jsonObjectForItem(e)},e=>{let{item:n}=e;!n&&e.items&&e.items.length>0&&(n=e.items[0]),this.associateItem(n),t&&t(n)})}createItems(e,t){const r=e.map(e=>this.jsonObjectForItem(e));this.postMessage(n.CreateItems,{items:r},e=>{t&&t(e.items)})}associateItem(e){this.postMessage(n.AssociateItem,{item:this.jsonObjectForItem(e)})}deassociateItem(e){this.postMessage(n.DeassociateItem,{item:this.jsonObjectForItem(e)})}deleteItem(e,t){this.deleteItems([e],t)}deleteItems(e,t){const r={items:e.map(e=>this.jsonObjectForItem(e))};this.postMessage(n.DeleteItems,r,e=>{t&&t(e)})}sendCustomEvent(e,t,n){this.postMessage(e,t,e=>{n&&n(e)})}saveItem(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];this.saveItems([e],t,n)}saveItemWithPresave(e,t,n){this.saveItemsWithPresave([e],t,n)}saveItemsWithPresave(e,t,n){this.saveItems(e,n,!1,t)}performSavingOfItems(e){let{items:t,presave:r,callback:a}=e;const i=setTimeout(()=>{this.concernTimeouts.forEach(e=>clearTimeout(e)),alert(\"This editor is unable to communicate with Standard Notes. Your changes may not be saved. Please backup your changes, then restart the application and try again.\")},5e3);this.concernTimeouts.push(i),r&&r();const o=[];for(const e of t)o.push(this.jsonObjectForItem(e));this.postMessage(n.SaveItems,{items:o},()=>{this.concernTimeouts.forEach(e=>clearTimeout(e)),null==a||a()})}saveItems(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=arguments.length>3?arguments[3]:void 0;if(this.pendingSaveItems||(this.pendingSaveItems=[]),this.coallesedSaving&&!n){this.pendingSaveTimeout&&clearTimeout(this.pendingSaveTimeout);const n=e.map(e=>e.uuid),a=this.pendingSaveItems.filter(e=>!n.includes(e.uuid));this.pendingSaveItems=a.concat(e),this.pendingSaveParams={items:this.pendingSaveItems,presave:r,callback:t},this.pendingSaveTimeout=setTimeout(()=>{this.performSavingOfItems(this.pendingSaveParams),this.pendingSaveItems=[],this.pendingSaveTimeout=void 0,this.pendingSaveParams=null},this.coallesedSavingDelay)}else this.performSavingOfItems({items:e,presave:r,callback:t})}setSize(e,t){this.postMessage(n.SetSize,{type:\"container\",width:e,height:t})}keyDownEvent(e){this.postMessage(n.KeyDown,{keyboardModifier:e})}keyUpEvent(e){this.postMessage(n.KeyUp,{keyboardModifier:e})}mouseClickEvent(){this.postMessage(n.Click,{})}jsonObjectForItem(e){const t=Object.assign({},e);return t.children=null,t.parent=null,t}getItemAppDataValue(e,t){var n,r;return null==e||null===(n=e.content)||void 0===n||null===(r=n.appData)||void 0===r?void 0:r[\"org.standardnotes.sn\"][t]}}return t.default})()},function(e,t,n){n(286),e.exports=n(285)},function(e,t){function n(t,r){return e.exports=n=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},e.exports.__esModule=!0,e.exports.default=e.exports,n(t,r)}e.exports=n,e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t){function n(t){return e.exports=n=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&\"function\"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?\"symbol\":typeof e},e.exports.__esModule=!0,e.exports.default=e.exports,n(t)}e.exports=n,e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t,n){\"use strict\";\n/** @license React v16.14.0\n * react.production.min.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */var r=n(11),a=\"function\"==typeof Symbol&&Symbol.for,i=a?Symbol.for(\"react.element\"):60103,o=a?Symbol.for(\"react.portal\"):60106,s=a?Symbol.for(\"react.fragment\"):60107,l=a?Symbol.for(\"react.strict_mode\"):60108,c=a?Symbol.for(\"react.profiler\"):60114,d=a?Symbol.for(\"react.provider\"):60109,_=a?Symbol.for(\"react.context\"):60110,u=a?Symbol.for(\"react.forward_ref\"):60112,p=a?Symbol.for(\"react.suspense\"):60113,m=a?Symbol.for(\"react.memo\"):60115,g=a?Symbol.for(\"react.lazy\"):60116,E=\"function\"==typeof Symbol&&Symbol.iterator;function S(e){for(var t=\"https://reactjs.org/docs/error-decoder.html?invariant=\"+e,n=1;nD.length&&D.push(e)}function M(e,t,n){return null==e?0:function e(t,n,r,a){var s=typeof t;\"undefined\"!==s&&\"boolean\"!==s||(t=null);var l=!1;if(null===t)l=!0;else switch(s){case\"string\":case\"number\":l=!0;break;case\"object\":switch(t.$$typeof){case i:case o:l=!0}}if(l)return r(a,t,\"\"===n?\".\"+L(t,0):n),1;if(l=0,n=\"\"===n?\".\":n+\":\",Array.isArray(t))for(var c=0;c