a[e]?a[e]:""));return o.replace(/\?$/,"")},B=(e,t)=>{var r;const a=k.extend({},t);if(!a.source&&(k.extend(a,T(null!==(r=a.embed)&&void 0!==r?r:"",e.schema)),!a.source))return"";a.altsource||(a.altsource=""),a.poster||(a.poster=""),a.source=e.convertURL(a.source,"source"),a.altsource=e.convertURL(a.altsource,"source"),a.sourcemime=z(a.source),a.altsourcemime=z(a.altsource),a.poster=e.convertURL(a.poster,"poster");const o=(e=>{const t=L.filter((t=>t.regex.test(e)));return t.length>0?k.extend({},t[0],{url:I(t[0],e)}):null})(a.source);if(o&&(a.source=o.url,a.type=o.type,a.allowfullscreen=o.allowFullscreen,a.width=a.width||String(o.w),a.height=a.height||String(o.h)),a.embed)return E(a.embed,a,!0,e.schema);{const t=g(e),r=b(e),o=w(e);return a.width=a.width||"300",a.height=a.height||"150",k.each(a,((t,r)=>{a[r]=e.dom.encode(""+t)})),"iframe"===a.type?((e,t)=>{if(t)return t(e);{const t=e.allowfullscreen?' allowFullscreen="1"':"";return'"}})(a,o):"application/x-shockwave-flash"===a.sourcemime?(e=>{let t='",t})(a):-1!==a.sourcemime.indexOf("audio")?((e,t)=>t?t(e):'")(a,t):"script"===a.type?(e=>' ';
+ const directionality = editor.getBody().dir;
+ const dirAttr = directionality ? ' dir="' + encode(directionality) + '"' : '';
+ const previewHtml = '' + '' + '' + headHtml + '' + '' + editor.getContent() + preventClicksOnLinksScript + '' + '';
+ return previewHtml;
+ };
+
+ const open = editor => {
+ const content = getPreviewHtml(editor);
+ const dataApi = editor.windowManager.open({
+ title: 'Preview',
+ size: 'large',
+ body: {
+ type: 'panel',
+ items: [{
+ name: 'preview',
+ type: 'iframe',
+ sandboxed: true,
+ transparent: false
+ }]
+ },
+ buttons: [{
+ type: 'cancel',
+ name: 'close',
+ text: 'Close',
+ primary: true
+ }],
+ initialData: { preview: content }
+ });
+ dataApi.focus('close');
+ };
+
+ const register$1 = editor => {
+ editor.addCommand('mcePreview', () => {
+ open(editor);
+ });
+ };
+
+ const register = editor => {
+ const onAction = () => editor.execCommand('mcePreview');
+ editor.ui.registry.addButton('preview', {
+ icon: 'preview',
+ tooltip: 'Preview',
+ onAction
+ });
+ editor.ui.registry.addMenuItem('preview', {
+ icon: 'preview',
+ text: 'Preview',
+ onAction
+ });
+ };
+
+ var Plugin = () => {
+ global$2.add('preview', editor => {
+ register$1(editor);
+ register(editor);
+ });
+ };
+
+ Plugin();
+
+})();
diff --git a/pandora_console/vendor/tinymce/tinymce/plugins/preview/plugin.min.js b/pandora_console/vendor/tinymce/tinymce/plugins/preview/plugin.min.js
new file mode 100644
index 0000000000..81d853d70f
--- /dev/null
+++ b/pandora_console/vendor/tinymce/tinymce/plugins/preview/plugin.min.js
@@ -0,0 +1,4 @@
+/**
+ * TinyMCE version 6.4.1 (2023-03-29)
+ */
+!function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager"),t=tinymce.util.Tools.resolve("tinymce.Env"),o=tinymce.util.Tools.resolve("tinymce.util.Tools");const n=e=>t=>t.options.get(e),i=n("content_style"),s=n("content_css_cors"),c=n("body_class"),r=n("body_id");e.add("preview",(e=>{(e=>{e.addCommand("mcePreview",(()=>{(e=>{const n=(e=>{var n;let l="";const a=e.dom.encode,d=null!==(n=i(e))&&void 0!==n?n:"";l+='';const m=s(e)?' crossorigin="anonymous"':"";o.each(e.contentCSS,(t=>{l+='"})),d&&(l+='");const y=r(e),u=c(e),v=' ';
+ const directionality = editor.getBody().dir;
+ const dirAttr = directionality ? ' dir="' + encode(directionality) + '"' : '';
+ html = '' + '' + '' + '' + contentCssEntries + preventClicksOnLinksScript + '' + '' + parseAndSerialize(editor, html) + '' + '';
+ }
+ return replaceTemplateValues(html, getPreviewReplaceValues(editor));
+ };
+ const open = (editor, templateList) => {
+ const createTemplates = () => {
+ if (!templateList || templateList.length === 0) {
+ const message = editor.translate('No templates defined.');
+ editor.notificationManager.open({
+ text: message,
+ type: 'info'
+ });
+ return Optional.none();
+ }
+ return Optional.from(global$2.map(templateList, (template, index) => {
+ const isUrlTemplate = t => t.url !== undefined;
+ return {
+ selected: index === 0,
+ text: template.title,
+ value: {
+ url: isUrlTemplate(template) ? Optional.from(template.url) : Optional.none(),
+ content: !isUrlTemplate(template) ? Optional.from(template.content) : Optional.none(),
+ description: template.description
+ }
+ };
+ }));
+ };
+ const createSelectBoxItems = templates => map(templates, t => ({
+ text: t.text,
+ value: t.text
+ }));
+ const findTemplate = (templates, templateTitle) => find(templates, t => t.text === templateTitle);
+ const loadFailedAlert = api => {
+ editor.windowManager.alert('Could not load the specified template.', () => api.focus('template'));
+ };
+ const getTemplateContent = t => t.value.url.fold(() => Promise.resolve(t.value.content.getOr('')), url => fetch(url).then(res => res.ok ? res.text() : Promise.reject()));
+ const onChange = (templates, updateDialog) => (api, change) => {
+ if (change.name === 'template') {
+ const newTemplateTitle = api.getData().template;
+ findTemplate(templates, newTemplateTitle).each(t => {
+ api.block('Loading...');
+ getTemplateContent(t).then(previewHtml => {
+ updateDialog(api, t, previewHtml);
+ }).catch(() => {
+ updateDialog(api, t, '');
+ api.setEnabled('save', false);
+ loadFailedAlert(api);
+ });
+ });
+ }
+ };
+ const onSubmit = templates => api => {
+ const data = api.getData();
+ findTemplate(templates, data.template).each(t => {
+ getTemplateContent(t).then(previewHtml => {
+ editor.execCommand('mceInsertTemplate', false, previewHtml);
+ api.close();
+ }).catch(() => {
+ api.setEnabled('save', false);
+ loadFailedAlert(api);
+ });
+ });
+ };
+ const openDialog = templates => {
+ const selectBoxItems = createSelectBoxItems(templates);
+ const buildDialogSpec = (bodyItems, initialData) => ({
+ title: 'Insert Template',
+ size: 'large',
+ body: {
+ type: 'panel',
+ items: bodyItems
+ },
+ initialData,
+ buttons: [
+ {
+ type: 'cancel',
+ name: 'cancel',
+ text: 'Cancel'
+ },
+ {
+ type: 'submit',
+ name: 'save',
+ text: 'Save',
+ primary: true
+ }
+ ],
+ onSubmit: onSubmit(templates),
+ onChange: onChange(templates, updateDialog)
+ });
+ const updateDialog = (dialogApi, template, previewHtml) => {
+ const content = getPreviewContent(editor, previewHtml);
+ const bodyItems = [
+ {
+ type: 'selectbox',
+ name: 'template',
+ label: 'Templates',
+ items: selectBoxItems
+ },
+ {
+ type: 'htmlpanel',
+ html: `${ htmlEscape(template.value.description) }
`
+ },
+ {
+ label: 'Preview',
+ type: 'iframe',
+ name: 'preview',
+ sandboxed: false,
+ transparent: false
+ }
+ ];
+ const initialData = {
+ template: template.text,
+ preview: content
+ };
+ dialogApi.unblock();
+ dialogApi.redial(buildDialogSpec(bodyItems, initialData));
+ dialogApi.focus('template');
+ };
+ const dialogApi = editor.windowManager.open(buildDialogSpec([], {
+ template: '',
+ preview: ''
+ }));
+ dialogApi.block('Loading...');
+ getTemplateContent(templates[0]).then(previewHtml => {
+ updateDialog(dialogApi, templates[0], previewHtml);
+ }).catch(() => {
+ updateDialog(dialogApi, templates[0], '');
+ dialogApi.setEnabled('save', false);
+ loadFailedAlert(dialogApi);
+ });
+ };
+ const optTemplates = createTemplates();
+ optTemplates.each(openDialog);
+ };
+
+ const showDialog = editor => templates => {
+ open(editor, templates);
+ };
+ const register$1 = editor => {
+ editor.addCommand('mceInsertTemplate', curry(insertTemplate, editor));
+ editor.addCommand('mceTemplate', createTemplateList(editor, showDialog(editor)));
+ };
+
+ const setup = editor => {
+ editor.on('PreProcess', o => {
+ const dom = editor.dom, dateFormat = getMdateFormat(editor);
+ global$2.each(dom.select('div', o.node), e => {
+ if (dom.hasClass(e, 'mceTmpl')) {
+ global$2.each(dom.select('*', e), e => {
+ if (hasAnyClasses(dom, e, getModificationDateClasses(editor))) {
+ e.innerHTML = getDateTime(editor, dateFormat);
+ }
+ });
+ replaceVals(editor, e);
+ }
+ });
+ });
+ };
+
+ const register = editor => {
+ const onAction = () => editor.execCommand('mceTemplate');
+ editor.ui.registry.addButton('template', {
+ icon: 'template',
+ tooltip: 'Insert template',
+ onAction
+ });
+ editor.ui.registry.addMenuItem('template', {
+ icon: 'template',
+ text: 'Insert template...',
+ onAction
+ });
+ };
+
+ var Plugin = () => {
+ global$3.add('template', editor => {
+ register$2(editor);
+ register(editor);
+ register$1(editor);
+ setup(editor);
+ });
+ };
+
+ Plugin();
+
+})();
diff --git a/pandora_console/vendor/tinymce/tinymce/plugins/template/plugin.min.js b/pandora_console/vendor/tinymce/tinymce/plugins/template/plugin.min.js
new file mode 100644
index 0000000000..b97aaf72cc
--- /dev/null
+++ b/pandora_console/vendor/tinymce/tinymce/plugins/template/plugin.min.js
@@ -0,0 +1,4 @@
+/**
+ * TinyMCE version 6.4.1 (2023-03-29)
+ */
+!function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager");const t=e=>t=>(e=>{const t=typeof e;return null===e?"null":"object"===t&&Array.isArray(e)?"array":"object"===t&&(a=n=e,(r=String).prototype.isPrototypeOf(a)||(null===(s=n.constructor)||void 0===s?void 0:s.name)===r.name)?"string":t;var a,n,r,s})(t)===e,a=t("string"),n=t("object"),r=t("array"),s=("function",e=>"function"==typeof e);const l=(!1,()=>false);var o=tinymce.util.Tools.resolve("tinymce.util.Tools");const c=e=>t=>t.options.get(e),i=c("template_cdate_classes"),u=c("template_mdate_classes"),m=c("template_selected_content_classes"),p=c("template_preview_replace_values"),d=c("template_replace_values"),h=c("templates"),g=c("template_cdate_format"),v=c("template_mdate_format"),y=c("content_style"),f=c("content_css_cors"),_=c("body_class"),b=(e,t)=>{if((e=""+e).length{const n="Sun Mon Tue Wed Thu Fri Sat Sun".split(" "),r="Sunday Monday Tuesday Wednesday Thursday Friday Saturday Sunday".split(" "),s="Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec".split(" "),l="January February March April May June July August September October November December".split(" ");return(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=t.replace("%D","%m/%d/%Y")).replace("%r","%I:%M:%S %p")).replace("%Y",""+a.getFullYear())).replace("%y",""+a.getYear())).replace("%m",b(a.getMonth()+1,2))).replace("%d",b(a.getDate(),2))).replace("%H",""+b(a.getHours(),2))).replace("%M",""+b(a.getMinutes(),2))).replace("%S",""+b(a.getSeconds(),2))).replace("%I",""+((a.getHours()+11)%12+1))).replace("%p",a.getHours()<12?"AM":"PM")).replace("%B",""+e.translate(l[a.getMonth()]))).replace("%b",""+e.translate(s[a.getMonth()]))).replace("%A",""+e.translate(r[a.getDay()]))).replace("%a",""+e.translate(n[a.getDay()]))).replace("%%","%")};class T{constructor(e,t){this.tag=e,this.value=t}static some(e){return new T(!0,e)}static none(){return T.singletonNone}fold(e,t){return this.tag?t(this.value):e()}isSome(){return this.tag}isNone(){return!this.tag}map(e){return this.tag?T.some(e(this.value)):T.none()}bind(e){return this.tag?e(this.value):T.none()}exists(e){return this.tag&&e(this.value)}forall(e){return!this.tag||e(this.value)}filter(e){return!this.tag||e(this.value)?this:T.none()}getOr(e){return this.tag?this.value:e}or(e){return this.tag?this:e}getOrThunk(e){return this.tag?this.value:e()}orThunk(e){return this.tag?this:e()}getOrDie(e){if(this.tag)return this.value;throw new Error(null!=e?e:"Called getOrDie on None")}static from(e){return null==e?T.none():T.some(e)}getOrNull(){return this.tag?this.value:null}getOrUndefined(){return this.value}each(e){this.tag&&e(this.value)}toArray(){return this.tag?[this.value]:[]}toString(){return this.tag?`some(${this.value})`:"none()"}}T.singletonNone=new T(!1);const x=Object.hasOwnProperty;var S=tinymce.util.Tools.resolve("tinymce.html.Serializer");const w={'"':""","<":"<",">":">","&":"&","'":"'"},C=e=>e.replace(/["'<>&]/g,(e=>{return(t=w,a=e,((e,t)=>x.call(e,t))(t,a)?T.from(t[a]):T.none()).getOr(e);var t,a})),O=(e,t,a)=>((a,n)=>{for(let n=0,s=a.length;nS({validate:!0},e.schema).serialize(e.parser.parse(t,{insert:!0})),D=(e,t)=>(o.each(t,((t,a)=>{s(t)&&(t=t(a)),e=e.replace(new RegExp("\\{\\$"+a.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")+"\\}","g"),t)})),e),I=(e,t)=>{const a=e.dom,n=d(e);o.each(a.select("*",t),(e=>{o.each(n,((t,n)=>{a.hasClass(e,n)&&s(t)&&t(e)}))}))},N=(e,t,a)=>{const n=e.dom,r=e.selection.getContent();a=D(a,d(e));let s=n.create("div",{},A(e,a));const l=n.select(".mceTmpl",s);l&&l.length>0&&(s=n.create("div"),s.appendChild(l[0].cloneNode(!0))),o.each(n.select("*",s),(t=>{O(n,t,i(e))&&(t.innerHTML=M(e,g(e))),O(n,t,u(e))&&(t.innerHTML=M(e,v(e))),O(n,t,m(e))&&(t.innerHTML=r)})),I(e,s),e.execCommand("mceInsertContent",!1,s.innerHTML),e.addVisual()};var k=tinymce.util.Tools.resolve("tinymce.Env");const P=(e,t)=>{const a=(e,t)=>((e,t,a)=>{for(let n=0,r=e.length;ne.text===t),l),n=t=>{e.windowManager.alert("Could not load the specified template.",(()=>t.focus("template")))},r=e=>e.value.url.fold((()=>Promise.resolve(e.value.content.getOr(""))),(e=>fetch(e).then((e=>e.ok?e.text():Promise.reject())))),s=(e,t)=>(s,l)=>{if("template"===l.name){const l=s.getData().template;a(e,l).each((e=>{s.block("Loading..."),r(e).then((a=>{t(s,e,a)})).catch((()=>{t(s,e,""),s.setEnabled("save",!1),n(s)}))}))}},c=t=>s=>{const l=s.getData();a(t,l.template).each((t=>{r(t).then((t=>{e.execCommand("mceInsertTemplate",!1,t),s.close()})).catch((()=>{s.setEnabled("save",!1),n(s)}))}))};(()=>{if(!t||0===t.length){const t=e.translate("No templates defined.");return e.notificationManager.open({text:t,type:"info"}),T.none()}return T.from(o.map(t,((e,t)=>{const a=e=>void 0!==e.url;return{selected:0===t,text:e.title,value:{url:a(e)?T.from(e.url):T.none(),content:a(e)?T.none():T.from(e.content),description:e.description}}})))})().each((t=>{const a=(e=>((e,t)=>{const a=e.length,n=new Array(a);for(let t=0;t({title:"Insert Template",size:"large",body:{type:"panel",items:e},initialData:a,buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],onSubmit:c(t),onChange:s(t,i)}),i=(t,n,r)=>{const s=((e,t)=>{var a;if(-1===t.indexOf("")){let n="";const r=null!==(a=y(e))&&void 0!==a?a:"",s=f(e)?' crossorigin="anonymous"':"";o.each(e.contentCSS,(t=>{n+='"})),r&&(n+='");const l=_(e),c=e.dom.encode,i='