-
-
Notifications
You must be signed in to change notification settings - Fork 162
/
Copy pathmain.js
1 lines (1 loc) · 32 KB
/
main.js
1
module.exports=function(e){var t={};function n(a){if(t[a])return t[a].exports;var i=t[a]={i:a,l:!1,exports:{}};return e[a].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,a){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:a})},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 a=Object.create(null);if(n.r(a),Object.defineProperty(a,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(a,i,function(t){return e[t]}.bind(null,i));return a},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=12)}([function(e,t){e.exports=require("scenegraph")},function(e,t,n){e.exports=function(e){var t={};function n(a){if(t[a])return t[a].exports;var i=t[a]={i:a,l:!1,exports:{}};return e[a].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,a){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:a})},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 a=Object.create(null);if(n.r(a),Object.defineProperty(a,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(a,i,function(t){return e[t]}.bind(null,i));return a},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=0)}([function(e,t,n){const a=n(1).storage,i=a.localFileSystem;let o,r=void 0,l=void 0;class s{static get lang(){return o}static get hasTranslation(){return void 0!==l}static unload(){o=void 0,r=void 0,l=void 0}static async load(e,t){s.unload(),o=n(2).appLanguage,e=e||"lang";let u=Object.assign({overrideLanguage:null},t||{});o=u.overrideLanguage?u.overrideLanguage:o;try{const t=await i.getPluginFolder();if(!(await t.getEntries()).find(t=>t.name===e))throw"translationFolderLocation '"+e+"' doesn't exist";const n=await t.getEntry(e);if(n.isFolder){const t=await n.getEntries();if(!t.find(e=>"default.json"===e.name))throw"required default.json file not available in the translation folder '"+e+"'...";{const e=await n.getEntry("default.json");r=JSON.parse((await e.read({format:a.formats.utf8})).toString())}if(t.find(e=>e.name===o+".json")){const e=await n.getEntry(o+".json");l=JSON.parse((await e.read({format:a.formats.utf8})).toString())}return!0}throw"translationFolderLocation '"+e+"' is not a folder"}catch(e){throw"Localization helper: Translations didn't load successfully: "+e}}static getNamespaced(e,t){if(Object.prototype.hasOwnProperty.call(e,t))return e[t];for(let n=1;n<=t.split(".").length+1;n++){let a=t.split(".",n).join(".");if(Object.prototype.hasOwnProperty.call(e,a))return this.getNamespaced(e[a],t.substring(a.length+1,t.length))}return!1}static get(e){if(l&&this.getNamespaced(l,e))return this.getNamespaced(l,e);if(r){if(this.getNamespaced(r,e))return this.getNamespaced(r,e);throw"Localization helper: String was not found, key: '"+e+"'"}throw"Localization helper: The library wasn't initialized. Please use 'await LocalizationHelper.load()' before getting a string."}}e.exports=s},function(e,t){e.exports=n(6)},function(e,t){e.exports=n(14)}])},function(e,t){class n{static shouldDebug(){return!1}static log(...e){if(n.shouldDebug()){e.unshift("Lorem Ipsum Plugin: ");const t=Array.prototype.slice.call(e.map(e=>e instanceof Object?JSON.stringify(e):e)),n=t.shift();console.log.apply(console,[n,...t])}}}e.exports=n},function(e,t,n){const a=n(6).storage,i=a.localFileSystem;let o;e.exports=class{static async init(){let e=await i.getDataFolder();try{let t=await e.getEntry("storage.json");return o=JSON.parse((await t.read({format:a.formats.utf8})).toString()),t}catch(t){const n=await e.createEntry("storage.json",{type:a.types.file,overwrite:!0});if(n.isFile)return await n.write("{}",{append:!1}),o={},n;throw new Error("Storage file storage.json was not a file.")}}static async get(e,t){if(!o){const e=await this.init();o=JSON.parse((await e.read({format:a.formats.utf8})).toString())}return void 0===o[e]?(await this.set(e,t),t):o[e]}static async set(e,t){const n=await this.init();return o[e]=t,await n.write(JSON.stringify(o),{append:!1,format:a.formats.utf8})}static async delete(e){return await this.set(e,void 0)}static async reset(){const e=await this.init();return await e.write("{}",{append:!1,format:a.formats.utf8})}}},function(e,t){e.exports=function(e){var t={};function n(a){if(t[a])return t[a].exports;var i=t[a]={i:a,l:!1,exports:{}};return e[a].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,a){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:a})},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 a=Object.create(null);if(n.r(a),Object.defineProperty(a,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(a,i,function(t){return e[t]}.bind(null,i));return a},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=0)}([function(e,t,n){const a=n(1),i=n(10);e.exports={types:a,showDialog:async function(e,t,n=[],a={}){const o=document.createElement("dialog");o.id=`${e}-dialog`,o.innerHTML=`\n<style>\n form {\n width: ${a.width||360}px;\n }\n\n div, main > *, label, input:not([type="checkbox"]), select, textarea {\n display: block;\n width: 100%;\n }\n\t\t\n main > * + * {\n margin-top: 1em;\n }\n\t\t\n .checkbox-wrapper {\n display: flex;\n }\n\t\t\n .checkbox-wrapper span, .checkbox-wrapper input{\n display: block;\n width: auto;\n }\n\t\t\n ${a.css||""}\n</style>\n<form method="dialog">\n<h1>${t}</h1><hr>\n<main></main>\n<footer>\n<button id="${e}-dialogHelperBtnCancel" uxp-variant="primary">${a.cancelButtonText||"Cancel"}</button>\n<button id="${e}-dialogHelperBtnOk" type="submit" uxp-variant="cta">${a.okButtonText||"Ok"}</button>\n</footer>\n</form>\n `;const r=o.querySelector("main"),l=o.querySelector("form"),s=o.querySelector(`#${e}-dialogHelperBtnOk`),u=o.querySelector(`#${e}-dialogHelperBtnCancel`);let c=[],d=[];const p={close:()=>{s.disabled||o.close(JSON.stringify(p.values()))},cancel:()=>{o.close(0)},values:()=>{let e={};for(let t of d)e[t.props.id]=t.type.value(t);return e},change:()=>{s.disabled=!i(d,p.values(),a.onValidate)},registerContentElement:e=>{c.push(e)}};s.addEventListener("click",e=>{e.preventDefault(),p.close()}),l.onsubmit=p.close,u.addEventListener("click",p.cancel);const m=n.map(t=>{let n=t.type.render(e,t,p);return n.props=t,n.type=t.type,n});for(let e of m)r.appendChild(e.wrapper);d.push(...m),d.push(...c),document.body.innerHTML="",document.body.appendChild(o),a.onBeforeShow&&await a.onBeforeShow(o,d,p),p.change();const h=await o.showModal();if(0===h)throw new Error("reasonCanceled");return JSON.parse(h)},...a}},function(e,t,n){e.exports={CHECKBOX:n(2),HEADER:n(3),HR:n(4),SELECT:n(5),SLIDER:n(6),TEXT:n(7),TEXT_AREA:n(8),TEXT_INPUT:n(9)}},function(e,t){const n={render:(e,t,a)=>{const i=document.createElement("label");i.id=`${e}-${t.id}`+"-wrapper",i.className="checkbox-wrapper",Object.assign(i.style,{flexDirection:"row",alignItems:"center"});const o=document.createElement("input");o.type="checkbox",o.id=`${e}-${t.id}`,o.placeholder=t.label,i.appendChild(o);const r=document.createElement("span");if(r.id=`${e}-${t.id}`+"-label",r.innerHTML=t.label,i.appendChild(r),t.htmlAttributes)for(let e in t.htmlAttributes)o.setAttribute(e,t.htmlAttributes[e]);return void 0!==t.value&&(o.value=t.value,o.checked=!0===t.value),o.addEventListener("change",()=>{a.change()}),{wrapper:i,input:o,type:n,props:t}},valid:e=>!e.props.required||n.value(e),value:e=>e.input.checked,type:"Input"};e.exports=n},function(e,t){const n={render:(e,t)=>{const a=document.createElement("h2");if(a.innerHTML=t.label,t.htmlAttributes)for(let e in t.htmlAttributes)a.setAttribute(e,t.htmlAttributes[e]);return a.id=`${e}-${t.id}`,{wrapper:a,type:n,input:void 0,props:t}},valid:()=>!0,value:()=>void 0,type:"Header"};e.exports=n},function(e,t){const n={render:(e,t)=>{const a=document.createElement("hr");if(t.htmlAttributes)for(let e in t.htmlAttributes)a.setAttribute(e,t.htmlAttributes[e]);return a.id=`${e}-${t.id}`,{wrapper:a,type:n,props:t,input:void 0}},valid:()=>!0,value:()=>void 0,type:"Horizontal Rule"};e.exports=n},function(e,t){const n={render:(e,t,a)=>{if(void 0===t.options)return console.error("A select box must have an `options` parameter passed in the props."),null;const i=document.createElement("label");i.id=`${e}-${t.id}`+"-wrapper";const o=document.createElement("span");o.id=`${e}-${t.id}`+"-label",o.innerHTML=t.label,i.appendChild(o);const r=document.createElement("select");r.id=`${e}-${t.id}`;for(let e of t.options){let t=document.createElement("option");t.value=e.value,t.innerHTML=e.label,r.appendChild(t)}if(i.appendChild(r),t.htmlAttributes)for(let e in t.htmlAttributes)r.setAttribute(e,t.htmlAttributes[e]);return void 0!==t.value&&(r.value=t.value),r.addEventListener("change",()=>{a.change()}),{wrapper:i,input:r,type:n,props:t}},valid:()=>!0,value:e=>e.input.value,type:"Select"};e.exports=n},function(e,t){const n={render:(e,t,a)=>{if(void 0===t.htmlAttributes||void 0===t.value||void 0===t.htmlAttributes.min||void 0===t.htmlAttributes.max)return console.error("A slider must have a min, max and value parameter specified in its `htmlAttributes` (value can also be specified outside the `htmlAttributes`)."),null;const i=document.createElement("label");i.id=`${e}-${t.id}`+"-wrapper";const o=document.createElement("span");o.textContent=t.label,o.id=`${e}-${t.id}`+"-label";const r=document.createElement("span");r.id=`${e}-${t.id}-value-label`,r.textContent=(t.htmlAttributes.value||t.value)+(t.unit||"");const l=document.createElement("div");l.className="row",l.style.justifyContent="space-between",l.appendChild(o),l.appendChild(r);const s=document.createElement("input");s.id=`${e}-${t.id}`,s.setAttribute("type","range"),s.addEventListener("input",()=>{a.change(),r.textContent=Math.round(Number.parseFloat(s.value))+(t.unit||"")}),i.appendChild(l),i.appendChild(s);for(let e in t.htmlAttributes)s.setAttribute(e,t.htmlAttributes[e]);return s.value=t.value,{wrapper:i,input:s,type:n,props:t}},valid:()=>!0,value:e=>Number.parseFloat(e.input.value),type:"Slider"};e.exports=n},function(e,t){const n={render:(e,t)=>{const a=document.createElement("p");if(a.innerHTML=t.label,t.htmlAttributes)for(let e in t.htmlAttributes)a.setAttribute(e,t.htmlAttributes[e]);return a.id=`${e}-${t.id}`,{wrapper:a,type:n,props:t,input:void 0}},valid:()=>!0,value:()=>void 0,type:"Text"};e.exports=n},function(e,t){const n={render:(e,t,a)=>{let i=document.createElement("label");i.id=`${e}-${t.id}`+"-wrapper";const o=document.createElement("textarea");o.id=`${e}-${t.id}`,o.placeholder=t.label;const r=document.createElement("span");if(r.id=`${e}-${t.id}`+"-label",r.innerHTML=t.label+"",i.appendChild(r),i.appendChild(o),t.htmlAttributes)for(let e in t.htmlAttributes)o.setAttribute(e,t.htmlAttributes[e]);return void 0!==t.value&&(o.value=t.value),o.addEventListener("input",()=>{a.change()}),{wrapper:i,input:o,type:n,props:t}},valid:e=>!e.props.required||n.value(e).length>0,value:e=>e.input.value,type:"Textarea"};e.exports=n},function(e,t){const n={render:(e,t,a)=>{let i=document.createElement("label");i.id=`${e}-${t.id}`+"-wrapper";const o=document.createElement("input");o.id=`${e}-${t.id}`,o.placeholder=t.label;const r=document.createElement("span");if(r.id=`${e}-${t.id}`+"-label",r.innerHTML=t.label+"",i.appendChild(r),i.appendChild(o),t.htmlAttributes)for(let e in t.htmlAttributes)o.setAttribute(e,t.htmlAttributes[e]);return void 0!==t.value&&(o.value=t.value),o.addEventListener("input",()=>{a.change()}),{wrapper:i,input:o,type:n,props:t}},valid:e=>!e.props.required||n.value(e).length>0,value:e=>e.input.value,type:"Input"};e.exports=n},function(e,t){e.exports=function(e,t,n){if(n&&!n(t))return!1;for(let t of e)if(!t.type.valid(t))return!1;return!0}}])},function(e,t,n){const a=n(4),i=n(1),o=n(2);class r{static async handleErrors(e){let t;try{await e(),t=!0}catch(e){o.log(e);try{await r.showErrorDialog(i.get("error.general.title"),`${i.get("error.general.description")}<br><code>${e.message}</code>`)}finally{t=!1}}return t}static async showErrorDialog(e,t){await a.showDialog("lorem-error-dialog",e,[{type:a.types.TEXT,label:t,id:"message",value:!0,htmlAttributes:{}}],{width:360,css:"\n header {\n background: #2D4E64;\n height: 16px;\n position: absolute;\n left: 0;\n top: 0;\n right: 0;\n }",onBeforeShow:e=>{e.appendChild(document.createElement("header"));const t=document.querySelector("lorem-error-dialog-dialogHelperBtnCancel");t&&t.remove()}})}}e.exports=r},function(e,t){e.exports=require("uxp")},function(e,t,n){const a=n(3),i=n(4);e.exports=class{static async send(e,t){let n=new XMLHttpRequest;n.open("POST","https://xdplugins.pabloklaschka.de/_api/submit"),n.send(JSON.stringify({plugin_name:"Lorem Ipsum",feature:e,options:t}))}static async verifyAcceptance(e){if(await a.get("analytics-accepted",!1))return!0;{let t={pluginName:"My plugin",privacyPolicyLink:"https://www.mysite.com/privacy",color:"#2D4E64"};if(Object.assign(t,e),await this.dialog(t))return await a.set("analytics-accepted",!0),!0;throw new Error("Privacy policy wasn't accepted")}}static async dialog(e){try{return(await i.showDialog("analytics-agreement","Analytics",[{id:"description",type:i.types.TEXT,label:`\n<p>To enhance your experience when using the plugin, completely anonymous data regarding your usage will get submitted to (secure) servers in Germany. The submitted data doesn't include any user id or similar means of identifying specific users. Since data gets submitted to our servers in the form of HTTP requests, you'll have to accept the privacy policy <a href="${e.privacyPolicyLink}">${e.privacyPolicyLink}</a>to use the plugin.\n</p>\n<h2>Data that gets submitted:</h2>\n<p>Data that's technically required to perform an HTTP request, a timestamp (current date and time), the plugin that gets used (i.e. ${e.pluginName}), the feature that gets used (e.g., which menu item selected) and the options that get used (e.g., categorical settings you set in dialogs).\n</p>\n<h2>Data that explicitly won't get submitted:</h2>\n<p>Any data identifying you (e.g., user ids or similar), any data regarding your document, files on your computer or similar, any data that I didn't list above in "Data that gets submitted"\n</p>\n `,htmlAttributes:{}},{type:i.types.CHECKBOX,htmlAttributes:{},required:!0,label:`I have read and accepted the privacy policy (${e.privacyPolicyLink})`,id:"accepted"}],{width:640,okButtonText:"Accept",css:`\n header {\n background: ${e.color};\n height: 16px;\n position: absolute;\n left: 0;\n top: 0;\n right: 0;\n }\n \n main {\n overflow-y: auto;\n }\n `,onBeforeShow:e=>{e.appendChild(document.createElement("header"))}})).accepted}catch(e){return!1}}}},function(e,t,n){const{Text:a,Rectangle:i}=n(0),o=n(2),r=n(7),l=n(15),s=n(18),u=n(19),c=n(5).showErrorDialog,d=n(1);e.exports=function(e){const t=n(0).selection;o.log("Lorem ipsum with options ",e);let p="n/a"===e.terminationString?"":e.terminationString;try{for(let n of t.items)n instanceof i?l(u(n),e,p):n instanceof a&&n.areaBox?l(n,e,p):n instanceof a?s(n,e,p):o.log("Node",n,"is not a text layer.")}catch(e){c(d.get("error.general.title"),d.get("error.general.description")+"<br>"+e.message)}r.verifyAcceptance({pluginName:"Lorem Ipsum",privacyPolicyLink:"https://xdplugins.pabloklaschka.de/privacy-policy",color:"#2D4E64"}).then(()=>{r.send("lorem",e)})}},function(e,t,n){const a=n(16);e.exports=function(e,t,n){let i=function(e,t,n){for(;e.split(" ").length<t;)e=n?e+"\n"+e:e+" "+e;return e.split(" ").splice(0,t).join(" ")}(a[t],e,n).trim();return(i.endsWith(".")||i.endsWith(",")||i.endsWith("?")||i.endsWith(";")||i.endsWith(":")||i.endsWith("-")||i.endsWith("–")||i.endsWith("!"))&&(i=i.substr(0,i.length-1)),i}},function(e,t,n){const{RepeatGrid:a}=n(0);e.exports=function(e,t){let n;e.parent&&e.parent.parent&&e.parent.parent instanceof a&&(n=e.parent.parent),n?n.attachTextDataSeries(e,[t]):e.text=t}},function(e,t,n){const a=n(2);e.exports=function e(t,n,i){if(a.log("Checking between ",t," and ",n),Math.abs(t-n)<2)return n;let o=Math.floor((t+n)/2);return i(o)?e(o,n,i):e(t,o,i)}},function(e,t,n){const a=n(13),i=n(8),o=n(20),r=n(21),l=n(23),{handleErrors:s}=n(5);e.exports={commands:{lorem:async function(e){await s(async()=>{await r(e)?await a():await o()})},quickLorem:async function(e){await s(async()=>{await r(e)?await i(await l()):await o()})},loremPreconfigured:async function(e){await s(async()=>{await r(e)?await i({includeLineBreaks:!0,trim:!1,terminationString:"n/a",text:"lorem-lat"}):await o()})},loremPreconfiguredTrim:async function(e){await s(async()=>{await r(e)?await i({includeLineBreaks:!0,trim:!0,terminationString:".",text:"lorem-lat"}):await o()})}}}},function(e,t,n){const a=n(3),i=n(2),o=n(1),r=n(7),l=n(4);e.exports=async function(){try{await r.verifyAcceptance({pluginName:"Lorem Ipsum",privacyPolicyLink:"https://xdplugins.pabloklaschka.de/privacy-policy",color:"#2D4E64"})}catch(e){return!1}let e;i.log("Showing Lorem Ipsum modal");try{e=await async function(){const e=await a.get("loremOptions",{text:"lorem-lat",terminationString:"n/a",includeLineBreaks:!0,trim:!1});try{const t=await l.showDialog("lorem-main","Lorem Ipsum",[{id:"description",type:l.types.TEXT,label:o.get("modal.lorem.description"),htmlAttributes:{}},{type:l.types.SELECT,options:[{value:"lorem-lat",label:"Lorem Ipsum (Latin, Standard)"},{value:"cicero-lat",label:"Cicero (Latin)"},{value:"cicero-en",label:"Cicero (English)"},{value:"pangram-en",label:"Pangram (English)"},{value:"pangram-de",label:"Pangram (German)"},{value:"pangram-es",label:"Pangram (Espagnol)"},{value:"pangram-fr",label:"Pangram (Français)"}],id:"text",label:o.get("modal.lorem.text.label"),value:e.text,htmlAttributes:{}},{type:l.types.SELECT,id:"terminationString",label:o.get("modal.lorem.terminate.label"),options:[{value:"n/a",label:o.get("modal.lorem.terminate.none")},{value:".",label:o.get("modal.lorem.terminate.period")},{value:"…",label:o.get("modal.lorem.terminate.ellipsis")}],htmlAttributes:{},value:e.terminationString},{type:l.types.CHECKBOX,id:"includeLineBreaks",label:o.get("modal.lorem.includeLineBreaks.label"),htmlAttributes:{},value:e.includeLineBreaks},{type:l.types.CHECKBOX,id:"trim",label:o.get("modal.lorem.trim.label"),htmlAttributes:{},value:e.trim}],{okButtonText:o.get("modal.lorem.btn.ok"),cancelButtonText:o.get("modal.lorem.btn.cancel"),width:400,css:'\n header {\n background: #2D4E64;\n height: 16px;\n position: absolute;\n left: 0;\n top: 0;\n right: 0;\n }\n input[type="checkbox"] {\n width: 18px;\n }',onBeforeShow:(e,t,n)=>{e.appendChild(document.createElement("header"));const a=document.getElementById("lorem-main-dialogHelperBtnOk");if(!a)throw new Error("Ok button was not found and could therefore not get selected!");a.addEventListener("keydown",e=>{"Enter"===e.key&&(e.stopPropagation(),e.preventDefault(),n.close())}),a.setAttribute("autofocus","autofocus"),setTimeout(()=>{a.focus()},200)}});return await a.set("loremOptions",t),i.log("Lorem Ipsum"),t}catch(e){throw new Error("User canceled dialog")}}()}catch(e){return!1}const t=n(8);return await t(e),!0}},function(e,t){e.exports=require("application")},function(e,t,n){const a=n(2),i=n(9),o=n(10),r=n(17),l=n(11);e.exports=function(e,t,n){let s=1;a.log("Propagating forward");do{s*=2,o(e,i(s,t.text,t.includeLineBreaks)+n)}while(!e.clippedByArea&&s<1e5);a.log("Propagating backwards from ",s);const u=l(s,s/2,a=>(o(e,i(a,t.text,t.includeLineBreaks)+n),e.clippedByArea));o(e,i(u,t.text,t.includeLineBreaks)+n),a.log("Completed at ",u),t.trim&&r(e)}},function(e){e.exports=JSON.parse('{"lorem-lat":"Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.","cicero-lat":"Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo. Nemo enim ipsam voluptatem quia voluptas sit aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos qui ratione voluptatem sequi nesciunt. Neque porro quisquam est, qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit, sed quia non numquam eius modi tempora incidunt ut labore et dolore magnam aliquam quaerat voluptatem. Ut enim ad minima veniam, quis nostrum exercitationem ullam corporis suscipit laboriosam, nisi ut aliquid ex ea commodi consequatur? Quis autem vel eum iure reprehenderit qui in ea voluptate velit esse quam nihil molestiae consequatur, vel illum qui dolorem eum fugiat quo voluptas nulla pariatur? At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis praesentium voluptatum deleniti atque corrupti quos dolores et quas molestias excepturi sint occaecati cupiditate non provident, similique sunt in culpa qui officia deserunt mollitia animi, id est laborum et dolorum fuga. Et harum quidem rerum facilis est et expedita distinctio.","cicero-en":"But I must explain to you how all this mistaken idea of denouncing pleasure and praising pain was born and I will give you a complete account of the system, and expound the actual teachings of the great explorer of the truth, the master-builder of human happiness. No one rejects, dislikes, or avoids pleasure itself, because it is pleasure, but because those who do not know how to pursue pleasure rationally encounter consequences that are extremely painful. Nor again is there anyone who loves or pursues or desires to obtain pain of itself, because it is pain, but because occasionally circumstances occur in which toil and pain can procure him some great pleasure. To take a trivial example, which of us ever undertakes laborious physical exercise, except to obtain some advantage from it? But who has any right to find fault with a man who chooses to enjoy a pleasure that has no annoying consequences, or one who avoids a pain that produces no resultant pleasure? On the other hand, we denounce with righteous indignation and dislike men who are so beguiled and demoralized by the charms of pleasure of the moment, so blinded by desire, that they cannot foresee the pain and trouble that are bound to ensue; and equal blame belongs to those who fail in their duty through weakness of will, which is the same as saying through shrinking from toil and pain.","pangram-en":"The quick, brown fox jumps over a lazy dog. DJs flock by when MTV ax quiz prog. Junk MTV quiz graced by fox whelps. Bawds jog, flick quartz, vex nymphs. Waltz, bad nymph, for quick jigs vex! Fox nymphs grab quick-jived waltz. Brick quiz whangs jumpy veldt fox. Bright vixens jump; dozy fowl quack. Quick wafting zephyrs vex bold Jim. Quick zephyrs blow, vexing daft Jim. Sex-charged fop blew my junk TV quiz. How quickly daft jumping zebras vex. Two driven jocks help fax my big quiz. Quick, Baz, get my woven flax jodhpurs! \\"Now fax quiz Jack!\\" my brave ghost pled. Five quacking zephyrs jolt my wax bed. Flummoxed by job, kvetching W. zaps Iraq. Cozy sphinx waves quart jug of bad milk. A very bad quack might jinx zippy fowls. Few quips galvanized the mock jury box. Quick brown dogs jump over the lazy fox. The jay, pig, fox, zebra, and my wolves quack! Blowzy red vixens fight for a quick jump. Joaquin Phoenix was gazed by MTV for luck. A wizard’s job is to vex chumps quickly in fog. Watch \\"Jeopardy!\\", Alex Trebek\\"s fun TV quiz game.","pangram-de":"Zwei flinke Boxer jagen die quirlige Eva und ihren Mops durch Sylt. Franz jagt im komplett verwahrlosten Taxi quer durch Bayern. Zwölf Boxkämpfer jagen Viktor quer über den großen Sylter Deich. Vogel Quax zwickt Johnys Pferd Bim. Sylvia wagt quick den Jux bei Pforzheim. Polyfon zwitschernd aßen Mäxchens Vögel Rüben, Joghurt und Quark. \\"Fix, Schwyz!\\" quäkt Jürgen blöd vom Paß. Victor jagt zwölf Boxkämpfer quer über den großen Sylter Deich. Falsches Üben von Xylophonmusik quält jeden größeren Zwerg. Heizölrückstoßabdämpfung. Zwei flinke Boxer jagen die quirlige Eva und ihren Mops durch Sylt. Franz jagt im komplett verwahrlosten Taxi quer durch Bayern. Zwölf Boxkämpfer jagen Viktor quer über den großen Sylter Deich. Vogel Quax zwickt Johnys Pferd Bim. Sylvia wagt quick den Jux bei Pforzheim. Polyfon zwitschernd aßen Mäxchens Vögel Rüben, Joghurt und Quark. \\"Fix, Schwyz!\\" quäkt Jürgen blöd vom Paß. Victor jagt zwölf Boxkämpfer quer über den großen Sylter Deich. Falsches Üben von Xylophonmusik quält jeden größeren Zwerg. Heizölrückstoßabdämpfung.Zwei flinke Boxer jagen die quirlige Eva und ihren Mops durch Sylt. Franz jagt im komplett verwahrlosten Taxi quer durch Bayern. Zwölf Boxkämpfer jagen Viktor quer über den großen Sylter Deich. Vogel Quax zwickt Johnys Pferd Bim.","pangram-es":"Quiere la boca exhausta vid, kiwi, piña y fugaz jamón. Fabio me exige, sin tapujos, que añada cerveza al whisky. Jovencillo emponzoñado de whisky, ¡qué figurota exhibes! La cigüeña tocaba cada vez mejor el saxofón y el búho pedía kiwi y queso. El jefe buscó el éxtasis en un imprevisto baño de whisky y gozó como un duque. Exhíbanse politiquillos zafios, con orejas kilométricas y uñas de gavilán. El cadáver de Wamba, rey godo de España, fue exhumado y trasladado en una caja de zinc que pesó un kilo. El pingüino Wenceslao hizo kilómetros bajo exhaustiva lluvia y frío, añoraba a su querido cachorro. El veloz murciélago hindú comía feliz cardillo y kiwi. La cigüeña tocaba el saxofón detrás del palenque de paja. Quiere la boca exhausta vid, kiwi, piña y fugaz jamón. Fabio me exige, sin tapujos, que añada cerveza al whisky. Jovencillo emponzoñado de whisky, ¡qué figurota exhibes! La cigüeña tocaba cada vez mejor el saxofón y el búho pedía kiwi y queso. El jefe buscó el éxtasis en un imprevisto baño de whisky y gozó como un duque. Exhíbanse politiquillos zafios, con orejas kilométricas y uñas de gavilán. El cadáver de Wamba, rey godo de España, fue exhumado y trasladado en una caja de zinc que pesó un kilo. El pingüino Wenceslao hizo kilómetros bajo exhaustiva lluvia y frío, añoraba a su querido cachorro. El veloz murciélago hindú comía feliz cardillo y kiwi. La cigüeña tocaba el saxofón detrás del palenque de paja.Quiere la boca exhausta vid, kiwi, piña y fugaz jamón. Fabio me exige, sin tapujos, que añada cerveza al whisky. Jovencillo emponzoñado de whisky, ¡qué figurota exhibes! La cigüeña tocaba cada vez mejor el saxofón y el búho pedía kiwi y queso.","pangram-fr":"Voyez ce jeu exquis wallon, de graphie en kit mais bref. Portez ce vieux whisky au juge blond qui fume sur son île intérieure, à côté de l\\"alcôve ovoïde, où les bûches se consument dans l\\"âtre, ce qui lui permet de penser à la cænogenèse de l\\"être dont il est question dans la cause ambiguë entendue à Moÿ, dans un capharnaüm qui, pense-t-il, diminue çà et là la qualité de son œuvre. Prouvez, beau juge, que le fameux sandwich au yak tue. L\\"île exiguë, Où l\\"obèse jury mûr Fête l\\"haï volapük, Âne ex æquo au whist, Ôtez ce vœu déçu. Vieux pelage que je modifie : breitschwanz ou yak ? Dès Noël où un zéphyr haï me vêt de glaçons würmiens, je dîne d’exquis rôtis de bœuf au kir à l’aÿ d’âge mûr & cætera ! Fougueux, j\\"enivre la squaw au pack de beau zythum. Ketch, yawl, jonque flambant neuve… jugez des prix ! Voyez le brick géant que j\\"examine près du wharf. Portez ce vieux whisky au juge blond qui fume. Bâchez la queue du wagon-taxi avec les pyjamas du fakir. Voix ambiguë d\\"un cœur qui, au zéphyr, préfère les jattes de kiwis. Mon pauvre zébu ankylosé choque deux fois ton wagon jaune. Perchez dix, vingt woks. Qu\\"y flambé-je ? Le moujik équipé de faux breitschwanz voyage. Kiwi fade, aptéryx, quel jambon vous gâchez ! Jugez qu\\"un vieux whisky blond pur malt fonce. Faux kwachas ? Quel projet de voyage zambien ! Fripon, mixez l\\"abject whisky qui vidange. Vif juge, trempez ce blond whisky aqueux. Vif P-DG mentor, exhibez la squaw jockey."}')},function(e,t,n){const a=n(11);e.exports=function(e){e.resize(e.localBounds.width,a(0,e.localBounds.height,t=>(e.resize(e.localBounds.width,t),e.clippedByArea)))}},function(e,t,n){const a=n(9),i=n(10);e.exports=function(e,t,n){i(e,a(2,t.text,!1)+n)}},function(e,t,n){const{Text:a,Color:i,selection:o}=n(0),r=n(1);e.exports=function(e){const t=new a;t.text="a",t.areaBox={width:10,height:10},t.fill=new i("black");const n=e.parent;if(null===(l=n)||!l.isContainer)throw new Error(r.get("error.messages.incompatibleParentNode"));{n.addChildAfter(t,e);const{x:a,y:i}=e.topLeftInParent,{width:o,height:r}=e.localBounds,l=e.rotation;t.rotateAround(l,t.localCenterPoint),t.placeInParentCoordinates({x:0,y:0},{x:a,y:i}),t.resize(o,r),e.removeFromParent()}var l;const s=[...o.items];return s.splice(s.indexOf(e),1,t),o.items=s,t}},function(e,t,n){const a=n(5),i=n(1);e.exports=async function(){try{await a.showErrorDialog(i.get("error.selection.title"),i.get("error.selection.description"))}catch(e){}}},function(e,t,n){const a=n(1),i=n(22);e.exports=async function(e){await a.load();let t=new i(e);return t.oneOrMore("Text")||t.oneOrMore("Rectangle")}},function(e,t,n){class a{constructor(e){this.selection=e}oneOrMore(...e){return this.count.apply(this,e)>0}nOrMore(e,...t){return this.count.apply(this,t)>=e}nOrLess(e,...t){return this.count.apply(this,t)<=e}exactlyN(e,...t){return this.count.apply(this,t)<=e}exactlyOne(...e){return 1===this.count.apply(this,e)}no(...e){return this.count.apply(this,e)<1}count(...e){return this.selection.items.reduce((t,n)=>{let i=!1;for(let t of e)if(a.checkForType(n,t)){i=!0;break}return t+(i?1:0)},0)}static checkForType(e,t){return!!i[t]&&i[t](e)}}const i={Text:e=>{const{Text:t}=n(0);return e instanceof t},AreaText:e=>{const{Text:t}=n(0);return e instanceof t&&void 0!==e.areaBox},PointText:e=>{const{Text:t}=n(0);return e instanceof t&&null===e.areaBox},Rectangle:e=>{const{Rectangle:t}=n(0);return e instanceof t},Artboard:e=>{const{Artboard:t}=n(0);return e instanceof t},Group:e=>{const{Group:t}=n(0);return e instanceof t},BooleanGroup:e=>{const{BooleanGroup:t}=n(0);return e instanceof t},Ellipse:e=>{const{Ellipse:t}=n(0);return e instanceof t},GraphicNode:e=>{const{GraphicNode:t}=n(0);return e instanceof t},Line:e=>{const{Line:t}=n(0);return e instanceof t},LinkedGraphic:e=>{const{LinkedGraphic:t}=n(0);return e instanceof t},Path:e=>{const{Path:t}=n(0);return e instanceof t},RepeatGrid:e=>{const{RepeatGrid:t}=n(0);return e instanceof t},SymbolInstance:e=>{const{SymbolInstance:t}=n(0);return e instanceof t}};e.exports=a},function(e,t,n){const a=n(3);e.exports=async function(){return await a.get("loremOptions",{text:"lorem-lat",terminationString:".",includeLineBreaks:!0,trim:!1})}}]);