1 2/*! 3 âââ âââââââ âââââââââââââââââââââââââââââââââ âââââââ âââââââ âââââââ 4 âââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââ 5 ââââââ âââ âââ âââ ââââââ âââââââââââââââââââ ââââââ âââ 6ââ ââââââ âââ âââ âââ ââââââ âââââââââââââââ âââ ââââââ âââ 7âââââââââââââââââ âââ âââ âââââââââââ ââââââ âââââââââââââââââ 8 ââââââ âââââââ âââ âââ âââââââââââ ââââââ âââââââ âââââââ 9 10* Copyright © 2024 Two App Studio Pte. Ltd. - ALL RIGHTS RESERVED 11* Unauthorized copying of this file, via any medium is strictly prohibited 12* https://2appstudio.com 13* 14* JotterPod Version: 3.1.2 15* Built on: Thu Nov 21 2024 14:46:17 GMT+0800 (Singapore Standard Time) 16*/ 17/* */ 18 19!function(){function e(t){return e="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(t)}function t(e,t,n,r,a,o,i){try{var c=e[o](i),s=c.value}catch(u){return void n(u)}c.done?t(s):Promise.resolve(s).then(r,a)}function n(e){return function(){var n=this,r=arguments;return new Promise((function(a,o){var i=e.apply(n,r);function c(e){t(i,a,o,c,s,"next",e)}function s(e){t(i,a,o,c,s,"throw",e)}c(void 0)}))}}function r(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function a(e,t){return a=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},a(e,t)}function o(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=c(e);if(t){var a=c(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return i(this,n)}}function i(t,n){if(n&&("object"===e(n)||"function"==typeof n))return n;if(void 0!==n)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(t)}function c(e){return c=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},c(e)}System.register(["./preload-helper-legacy.a5ae5050.js","./generic-legacy.d7685b1e.js","./vendor-legacy.5f9a6ac8.js"],(function(e,t){"use strict";var i,c,s;return{setters:[function(e){i=e._},function(e){c=e.GenericCommands},function(e){s=e.aZ}],execute:function(){var u=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");Object.defineProperty(e,"prototype",{value:Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),writable:!1}),t&&a(e,t)}(x,e);var c,u,l,f,p,h,d,m,y=o(x);function x(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,x),(t=y.call(this)).export=null,t.opts=null,t.exporter=void 0,t.paperWidth=0,t.paperHeight=0,t.callback=e,t}return c=x,u=[{key:"configureViewerLook",value:function(e,t,n,r){this.callback.changeAccentColor(e),this.callback.changeTheme(t),this.callback.changeNightVision(n),this.callback.changeMargin(r||0)}},{key:"configureViewerText",value:function(e,t,n,r,a){this.callback.changeFontFamily(e),this.callback.changeBaseFontSize(t),this.callback.changeFontSize(n),this.callback.changeLineHeight(r),this.callback.changeLigatures(a)}},{key:"configurePrint",value:function(e,t,n,r){var a=Math.min(1,document.body.clientWidth/s("".concat(t,"mm")));this.callback.changePrint(e,a,t,n,r),this.paperWidth=t,this.paperHeight=n}},{key:"configureLinks",value:function(e){this.callback.configureLinks(e)}},{key:"injectCssRules",value:function(e){this.callback.overrideStyleCss(e)}},{key:"injectLinkHead",value:function(e,t,n){this.callback.injectLinkHead(e,t,n
19)}},{key:"requestSetupText",value:function(e){var t=this.sendToClientRequest("requestText");this.setupText(t||"",e,{})}},{key:"setupTextAsync",value:function(e,t){this.setupText(e,t,{})}},{key:"requestSetupTextForExport",value:function(e){var t=this.sendToClientRequest("requestText");this.setupTextForExport(t||"",e,{})}},{key:"setupTextForExportAsync",value:function(e,t){this.setupTextForExport(e,t,{})}},{key:"setupTextImpl",value:(m=n(regeneratorRuntime.mark((function e(n,r,a,o){var c,s,u,l,f,p,h,d,m,y,x,v,b,k,g,w,T,F,j,C,R,P,S,H,O,E,L,_,B,I,q,D,M,N,W,A,U,V,z,G,Z;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(c="",s=[],u={},l="",f={x:this.paperWidth,y:this.paperHeight},"html"!==r){e.next=21;break}return e.next=8,i((function(){return t.import("./html-legacy.92beba13.js")}),void 0);case 8:return p=e.sent,h=p.convert,e.next=12,h(n,a);case 12:d=e.sent,m=d.value,y=d.metadata,l="markdown",c=m||"",s=y.tocs||[],u={},e.next=79;break;case 21:if("md"!==r){e.next=38;break}return e.next=24,i((function(){return t.import("./md-legacy.920414a3.js")}),void 0);case 24:return x=e.sent,v=x.convert,e.next=28,v(n,a);case 28:b=e.sent,k=b.value,g=b.metadata,l="markdown",c=k||"",s=g.tocs||[],u=g.yaml||{},null!=o&&o.toc&&s.length&&(w=s.map((function(e){return'<li class="level'.concat(e.level,'"><a href="#').concat(e.id,'">').concat(e.text,"</a></li>")})).join(""),T="<ul class=\"toc\" data-ignore-render='docx'>".concat(w,"</ul>"),c=T+c),e.next=79;break;case 38:if("fountain"!==r){e.next=63;break}return e.next=41,i((function(){return t.import("./FountainParser-legacy.549b6dc6.js")}),void 0);case 41:return F=e.sent,j=F.FountainParser,C=new j,R=C.parse(n),P=R.metadata,S=R.root,e.next=47,i((function(){return t.import("./Decorator-legacy.312f7f82.js")}),void 0);case 47:return H=e.sent,O=H.Decorator,E=new O(a,P),null!==(L=E.getFontFamily())&&this.callback.changeFontFamily(L),e.next=54,i((function(){return t.import("./Converter-legacy.3e02ec3e.js")}),void 0);case 54:_=e.sent,B=_.Converter,I=new B,q=I.convert(S,a,P,f),l="fountain",c=q||"",u=P||{},e.next=79;break;case 63:if("fdx"!==r){e.next=79;break}return e.next=66,i((function(){return t.import("./FdxParser-legacy.faeb361b.js")}),void 0);case 66:return D=e.sent,M=D.FdxParser,N=new M,W=N.parse(n),A=W.metadata,U=W.root,e.next=72,i((function(){return t.import("./Converter-legacy.3e02ec3e.js")}),void 0);case 72:V=e.sent,z=V.Converter,G=new z,Z=G.convert(U,"edit",A,f),l="fountain",c=Z||"",u=A||{};case 79:return e.abrupt("return",{html:c,previewType:l,yaml:u,tocs:s});case 81:case"end":return e.stop()}}),e,this)}))),function(e,t,n,r){return m.apply(this,arguments)})},{key:"setupText",value:(d=n(regeneratorRuntime.mark((function e(t,n,r){var a,o,i,c,s;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.export=null,this.opts=null,e.next=4,this.setupTextImpl(t,n,"print",r);case 4:a=e.sent,o=a.html,i=a.previewType,c=a.yaml,s=a.tocs,this.callback.setupText(o,i,{tocs:s,yaml:c}
19),this.callback.textHandled(),this.sendToClientBoolean("textHandled","isHandled",!0);case 13:case"end":return e.stop()}}),e,this)}))),function(e,t,n){return d.apply(this,arguments)})},{key:"setupTextForExport",value:(h=n(regeneratorRuntime.mark((function e(t,n,r){var a,o,i,c,s;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.setupTextImpl(t,n,"view",r);case 2:this.export=e.sent,this.opts=r,a=this.export,o=a.html,i=a.previewType,c=a.yaml,s=a.tocs,this.callback.setupText(o,i,{tocs:s,yaml:c}),this.callback.textHandled(),this.sendToClientBoolean("textHandled","isHandled",!0);case 8:case"end":return e.stop()}}),e,this)}))),function(e,t,n){return h.apply(this,arguments)})},{key:"exportFile",value:(p=n(regeneratorRuntime.mark((function e(n){var r,a,o,c,s,u,l,f,p,h,d,m,y,x,v,b;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!==this.export){e.next=2;break}return e.abrupt("return");case 2:if(r=this.export,a=r.html,o=r.previewType,c=r.yaml,r.tocs,this.exporter=void 0,"docx"!==n){e.next=14;break}return e.next=7,i((function(){return t.import("./exporter-legacy.5dcf14de.js").then((function(e){return e.e}))}),void 0);case 7:u=e.sent,l=u.DocxExporter,f=new l({}),this.exporter=f,f.export(a,"markdown"===o?"word":"screenplay",!1,Boolean(null===(s=this.opts)||void 0===s?void 0:s.toc)),e.next=32;break;case 14:if("fdx"!==n){e.next=24;break}return e.next=17,i((function(){return t.import("./FdxFormatter-legacy.3c9d2925.js")}),void 0);case 17:p=e.sent,h=p.FdxFormatter,d=new h,m=d.format(a,c),this.sendToClientString("fdx","val",m),e.next=32;break;case 24:if("fountain"!==n){e.next=32;break}return e.next=27,i((function(){return t.import("./FountainFormatter-legacy.ea8426f6.js")}),void 0);case 27:y=e.sent,x=y.FountainFormatter,v=new x,b=v.format(a,c),this.sendToClientString("fountain","val",b);case 32:case"end":return e.stop()}}),e,this)}))),function(e){return p.apply(this,arguments)})},{key:"setTags",value:function(e){this.callback.changeTags(e)}},{key:"setMediaUrls",value:function(e){this.callback.changeMediaUrls(e)}},{key:"setStats",value:function(e,t,n,r,a,o){"system"===a&&(a=Number.isInteger(Number(new Intl.DateTimeFormat([],{hour:"numeric"}).format()))?"24":"12"),this.callback.changeStats(e,t,n,r,a,o)}},{key:"sendMediaClicked",value:function(){this.sendToClientBoolean("mediaClicked","clicked",!0)}},{key:"sendContentHeight",value:function(e){this.sendToClientNumber("contentHeight","height",e)}},{key:"sendInternalLinkClicked",value:function(e){this.sendToClientStringString("open","what","internalLink","val",decodeURIComponent(e||""))}},{key:"getContentHeight",value:function(){return document.body.clientHeight}},{key:"resFetched",value:function(e,t,n,r){var a;null===(a=this.exporter)||void 0===a||a.resFetched(e,t,n,r)}},{key:"testText",value:(f=n(regeneratorRuntime.mark((function e(t,n){var r,a,o,i;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r="/",a="","book"===t?(r="/test/html/book.txt",a="html"):"md"===t?(r="/test/md/all.txt",a="md"):"fountain"===t?(r="/test/fountain/test.fountain",a="fountain"):"fountain2"===t?(r="/test/fountain/big_fish.fountain",a="fountain"):"brickandsteel"===t?(r="/test/fountain/brick-and-steel.fountain",a="fountain"):["stageplay-us","stageplay-uk","screenplay-film","screenplay-tv","tv-tape-live-us-studio","tv-three-camera-us-sitcom","radio-drama-us","tv-taped-drama-bbc","tv-taped-sitcom-bbc","radio-drama-bbc-scene","radio-sitcom-bbc-cue","broadway-musical","dg-modern-musical"].includes(t)?(r="/test/fountain/".concat(t,".fountain"),a="fountain"):"fdx"===t&&(r="/test/fdx/test.fdx",a="fdx"),!r||!a){e.next=12;break}return e.next=6,fetch(r);case 6:return o=e.sent,e.next=9,o.text();case 9:i=e.sent,"print"===n?(this.configurePrint("test",210,297,!1),this.setupText(i,a,{})):"printLetter"===n?(this.configurePrint("test",216,279,!1),this.setupText(i,a,{})):this.setupTextForExport(i,a,{});case 12:case"end":return e.stop()}}),e,this)}))),function(e,t){return f.apply(this,arguments)})}],u&&r(c.prototype,u),l&&r(c,l),Object.defineProperty(c,"prototype",{writable:!1}),x}(c);e("Commands",u)}}}))}();
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.