1var M=Object.defineProperty;var K=Object.getOwnPropertyDescriptor;var Q=Object.getOwnPropertyNames;var Y=Object.prototype.hasOwnProperty;var Z=(t,e)=>{for(var n in e)M(t,n,{get:e[n],enumerable:!0})},w=(t,e,n,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of Q(e))!Y.call(t,i)&&i!==n&&M(t,i,{get:()=>e[i],enumerable:!(s=K(e,i))||s.enumerable});return t},b=(t,e,n)=>(w(t,e,"default"),n&&w(n,e,"default"));var E={};Z(E,{PasteFromOffice:()=>C,PasteFromOfficeGoogleDocsNormalizer:()=>I,PasteFromOfficeGoogleSheetsNormalizer:()=>P,PasteFromOfficeMSWordNormalizer:()=>S,_convertHexToBase64:()=>N,_convertPasteOfficeCssLengthToPx:()=>O,_isPasteOfficePxValue:()=>L,_normalizePasteOfficeSpaceRunSpans:()=>U,_normalizePasteOfficeSpacing:()=>X,_removePasteGoogleOfficeSheetsTag:()=>G,_removePasteMSOfficeAttributes:()=>z,_removePasteOfficeBoldWrapper:()=>F,_removePasteOfficeInvalidTableWidths:()=>_,_removePasteOfficeStyleBlock:()=>q,_removePasteOfficeXmlnsAttributes:()=>H,_replacePasteOfficeImagesSourceWithBase64:()=>D,_toPasteOfficePxValue:()=>h,_transformPasteOfficeBlockBrsToParagraphs:()=>j,_transformPasteOfficeBookmarks:()=>R,_transformPasteOfficeListItemLikeElementsIntoLists:()=>W,_transformPasteOfficeTables:()=>V,_unwrapPasteOfficeParagraphInListItem:()=>$,parsePasteOfficeHtml:()=>J});var v={};b(v,Le);import*as Le from"../../../frontend-editor-ckeditor-web/__liferay__/exports/@ckeditor$ckeditor5-core$dist$index.js.js";var x={};b(x,Ce);import*as Ce from"../../../frontend-editor-ckeditor-web/__liferay__/exports/@ckeditor$ckeditor5-clipboard$dist$index.js.js";var f={};b(f,Oe);import*as Oe from"../../../frontend-editor-ckeditor-web/__liferay__/exports/@ckeditor$ckeditor5-engine$dist$index.js.js";function R(t,e){let n=[];for(let s of e.createRangeIn(t)){let i=s.item;i.is("element","a")&&!i.hasAttribute("href")&&(i.hasAttribute("id")||i.hasAttribute("name"))&&n.push(i)}for(let s of n){let i=s.parent.getChildIndex(s)+1,r=s.getChildren();e.insertChild(i,r,s.parent)}}function O(t){let e=parseFloat(t);return t.endsWith("pt")?h(e*96/72):t.endsWith("pc")?h(e*12*96/72):t.endsWith("in")?h(e*96):t.endsWith("cm")?h(e*96/2.54):t.endsWith("mm")?h(e/10*96/2.54):t}function L(t){return t!==void 0&&t.endsWith("px")}function h(t){return Math.round(t)+"px"}function W(t,e,n){if(!t.childCount)return;let s=new f.ViewUpcastWriter(t.document),i=ee(t,s);if(!i.length)return;let r={},l=[];for(let o of i)if(o.indent!==void 0){te(o)||(l.length=0);let c=`${o.id}:${o.indent}`,a=Math.min(o.indent-1,l.length);if(a<l.length&&l[a].id!==o.id&&(l.length=a),a<l.length-1)l.length=a+1;else{let m=ne(o,e);if(a>l.length-1||l[a].listElement.name!=m.type){a==0&&m.type=="ol"&&o.id!==void 0&&r[c]&&(m.startIndex=r[c]);let p=re(m,s,n);if(L(o.marginLeft)&&(a==0||L(l[a-1].marginLeft))){let d=o.marginLeft;a>0&&(d=h(parseFloat(d)-parseFloat(l[a-1].marginLeft))),s.setStyle("padding-left",d,p)}if(l.length==0){let d=o.element.parent,g=d.getChildIndex(o.element)+1;s.insertChild(g,p,d)}else{let d=l[a-1].listItemElements;s.appendChild(p,d[d.length-1])}l[a]={...o,listElement:p,listItemElements:[]},a==0&&o.id!==void 0&&(r[c]=m.startIndex||1)}}let u=o.element.name=="li"?o.element:s.createElement("li");s.appendChild(u,l[a].listElement),l[a].listItemElements.push(u),a==0&&o.id!==void 0&&r[c]++,o.element!=u&&s.appendChild(o.element,u),ae(o.element,s),s.removeStyle("text-indent",o.element),s.removeStyle("margin-left",o.element)}else{let c=l.find(a=>a.marginLeft==o.marginLeft);if(c){let a=c.listItemElements;s.appendChild(o.element,a[a.length-1]),s.removeStyle("margin-left",o.element)}else l.length=0}}function $(t,e){for(let n of e.createRangeIn(t)){let s=n.item;if(s.is("element","li")){let i=s.getChild(0);i&&i.is("element","p")&&e.unwrapElement(i)}}}function ee(t,e){let n=e.createRangeIn(t),s=[],i=new Set;for(let r of n.getItems()){if(!r.is("element")||!r.name.match(/^(p|h\d+|li|div)$/))continue;let l=ce(r);if(l!==void 0&&parseFloat(l)==0&&!Array.from(r.getClassNames()).find(o=>o.startsWith("MsoList"))&&(l=void 0),r.hasStyle("mso-list")||l!==void 0&&i.has(l)){let o=le(r);s.push({element:r,id:o.id,order:o.order,indent:o.indent,marginLeft:l}),l!==void 0&&i.add(l)}else i.clear()}return s}function te(t){let e=t.element.previousSibling;if(!e){let n=t.element.parent;return A(n)&&(!n.previousSibling||A(n.previousSibling))}return A(e)}function A(t){return t.is("element","ol")||t.is("element","ul")}function ne(t,e){let n=new RegExp(`@list l${t.id}:level${t.indent}\\s*({[^}]*)`,"gi"),s=/mso-level-number-format:([^;]{0,100});/gi,i=/mso-level-start-at:\s{0,100}([0-9]{0,10})\s{0,100};/gi,r=new RegExp(`@list\\s+l${t.id}:level\\d\\s*{[^{]*mso-level-text:"%\\d\\\\.`,"gi"),l=new RegExp(`@list l${t.id}:level\\d\\s*{[^{]*mso-level-number-format:`,"gi"),o=r.exec(e),c=l.exec(e),a=o&&!c,u=n.exec(e),m="decimal",p="ol",d=null;if(u&&u[1]){let g=s.exec(u[1]);if(g&&g[1]&&(m=g[1].trim(),p=m!=="bullet"&&m!=="image"?"ol":"ul"),m==="bullet"){let y=se(t.element);y&&(m=y)}else{let y=i.exec(u[1]);y&&y[1]&&(d=parseInt(y[1]))}a&&(p="ol")}return{type:p,startIndex:d,style:oe(m),isLegalStyleList:a}}function se(t){if(t.name=="li"&&t.parent.name=="ul"&&t.parent.hasAttribute("type"))return t.parent.getAttribute("type");let e=ie(t);if(!e)return null;let n=e._data;return n==="o"?"circle":n==="\xB7"?"disc":n==="\xA7"?"square":null}function ie(t){if(t.getChild(0).is("$text"))return null;for(let e of t.getChildren()){if(!e.is("element","span"))continue;let n=e.getChild(0);if(n)return n.is("$text")?n:n.getChild(0)}return null}function oe(t){if(t.startsWith("arabic-leading-zero"))return"decimal-leading-zero";switch(t){case"alpha-upper":return"upper-alpha";case"alpha-lower":return"lower-alpha";case"roman-upper":return"upper-roman";case"roman-lower":return"lower-roman";case"circle":case"disc":case"square":return t;default:return null}}function re(t,e,n){let s=e.createElement(t.type);return t.style&&e.setStyle("list-style-type",t.style,s),t.startIndex&&t.startIndex>1&&e.setAttribute("start",t.startIndex,s),t.isLegalStyleList&&n&&e.addClass("legal-list",s),s}function le(t){let e=t.getStyle("mso-list");if(e===void 0)return{};let n=e.match(/(^|\s{1,100})l(\d+)/i),s=e.match(/\s{0,100}lfo(\d+)/i),i=e.match(/\s{0,100}level(\d+)/i);return n&&s&&i?{id:n[2],order:s[1],indent:parseInt(i[1])}:{indent:1}}function ae(t,e){let n=new f.Matcher({name:"span",styles:{"mso-list":"Ignore"}}),s=e.createRangeIn(t);for(let i of s)i.type==="elementStart"&&n.match(i.item)&&e.remove(i.item)}function ce(t){let e=t.getStyle("margin-left");return e===void 0||e.endsWith("px")?e:O(e)}function D(t,e){if(!t.childCount)return;let n=new f.ViewUpcastWriter(t.document),s=fe(t,n);me(s,t,n),de(s,t,n),ue(t,n);let i=pe(t,n);i.length&&he(i,ge(e),n)}function N(t){return btoa(t.match(/\w{2}/g).map(e=>String.fromCharCode(parseInt(e,16))).join(""))}function fe(t,e){let n=e.createRangeIn(t),s=new f.Matcher({name:/v:(.+)/}),i=[];for(let r of n){if(r.type!="elementStart")continue;
1let l=r.item,o=l.previousSibling,c=o&&o.is("element")?o.name:null,a=["Chart"],u=s.match(l),m=l.getAttribute("o:gfxdata"),p=c==="v:shapetype",d=m&&a.some(g=>l.getAttribute("id").includes(g));u&&m&&!p&&!d&&i.push(r.item.getAttribute("id"))}return i}function me(t,e,n){let s=n.createRangeIn(e),i=new f.Matcher({name:"img"}),r=[];for(let l of s)if(l.item.is("element")&&i.match(l.item)){let o=l.item,c=o.getAttribute("v:shapes")?o.getAttribute("v:shapes").split(" "):[];c.length&&c.every(a=>t.indexOf(a)>-1)?r.push(o):o.getAttribute("src")||r.push(o)}for(let l of r)n.remove(l)}function ue(t,e){let n=e.createRangeIn(t),s=new f.Matcher({name:/v:(.+)/}),i=[];for(let r of n)r.type=="elementStart"&&s.match(r.item)&&i.push(r.item);for(let r of i)e.remove(r)}function de(t,e,n){let s=n.createRangeIn(e),i=[];for(let o of s)if(o.type=="elementStart"&&o.item.is("element","v:shape")){let c=o.item.getAttribute("id");if(t.includes(c))continue;r(o.item.parent.getChildren(),c)||i.push(o.item)}for(let o of i){let c={src:l(o)};o.hasAttribute("alt")&&(c.alt=o.getAttribute("alt"));let a=n.createElement("img",c);n.insertChild(o.index+1,a,o.parent)}function r(o,c){for(let a of o){if(a.is("element")&&(a.name=="img"&&a.getAttribute("v:shapes")==c||r(a.getChildren(),c)))return!0}return!1}function l(o){for(let c of o.getChildren()){if(c.is("element")&&c.getAttribute("src"))return c.getAttribute("src")}}}function pe(t,e){let n=e.createRangeIn(t),s=new f.Matcher({name:"img"}),i=[],r=0;for(let l of n)l.item.is("element")&&s.match(l.item)&&(l.item.getAttribute("src").startsWith("file://")&&i.push({element:l.item,imageIndex:r}),r++);return i}function ge(t){if(!t)return[];let e=/{\\pict[\s\S]+?\\bliptag-?\d+(\\blipupi-?\d+)?({\\\*\\blipuid\s?[\da-fA-F]+)?[\s}]*?/,n=new RegExp("(?:("+e.source+"))([\\da-fA-F\\s]+)\\}","g"),s=t.match(n),i=[];if(s)for(let r of s){let l=!1;r.includes("\\pngblip")?l="image/png":r.includes("\\jpegblip")&&(l="image/jpeg"),l&&i.push({hex:r.replace(e,"").replace(/[^\da-fA-F]/g,""),type:l})}return i}function he(t,e,n){for(let s=0;s<t.length;s++){let{element:i,imageIndex:r}=t[s],l=e[r];if(l){let o=`data:${l.type};base64,${N(l.hex)}`;n.setAttribute("src",o,i)}}}function z(t){let e=[],n=new f.ViewUpcastWriter(t.document);for(let{item:s}of n.createRangeIn(t))if(s.is("element")){for(let i of s.getClassNames())/\bmso/gi.exec(i)&&n.removeClass(i,s);for(let i of s.getStyleNames())/\bmso/gi.exec(i)&&n.removeStyle(i,s);(s.is("element","w:sdt")||s.is("element","w:sdtpr")&&s.isEmpty||s.is("element","o:p")&&s.isEmpty)&&e.push(s)}for(let s of e){let i=s.parent,r=i.getChildIndex(s);n.insertChild(r,s.getChildren(),i),n.remove(s)}}function V(t,e){for(let n of e.createRangeIn(t).getItems()){if(!n.is("element","table")&&!n.is("element","td")&&!n.is("element","th"))continue;let s=["left","top","right","bottom"];if(s.every(r=>!n.hasStyle(`border-${r}-style`)))e.setStyle("border-style","none",n);else for(let r of s)n.hasStyle(`border-${r}-style`)||e.setStyle(`border-${r}-style`,"none",n);let i=["width","height",...s.map(r=>`border-${r}-width`),...s.map(r=>`padding-${r}`)];for(let r of i)n.hasStyle(r)&&e.setStyle(r,O(n.getStyle(r)),n)}}function _(t,e){for(let n of e.createRangeIn(t).getItems())n.is("element","table")&&(n.getStyle("width")==="0px"&&e.removeStyle("width",n),n.getAttribute("width")==="0"&&e.removeAttribute("width",n))}var ye=/<meta\s*name="?generator"?\s*content="?microsoft\s*word\s*\d+"?\/?>/i,be=/xmlns:o="urn:schemas-microsoft-com/i,S=class{document;hasMultiLevelListPlugin;constructor(e,n=!1){this.document=e,this.hasMultiLevelListPlugin=n}isActive(e){return ye.test(e)||be.test(e)}execute(e){let n=new f.ViewUpcastWriter(this.document),{body:s,stylesString:i}=e._parsedData;R(s,n),W(s,i,this.hasMultiLevelListPlugin),D(s,e.dataTransfer.getData("text/rtf")),V(s,n),_(s,n),z(s),e.content=s}};function F(t,e){for(let n of t.getChildren())if(n.is("element","b")&&n.getStyle("font-weight")==="normal"){let s=t.getChildIndex(n);e.remove(n),e.insertChild(s,n.getChildren(),t)}}function j(t,e){let n=new f.ViewDocument(e.document.stylesProcessor),s=new f.ViewDomConverter(n,{renderingMode:"data"}),i=s.blockElements,r=s.inlineObjectElements,l=[];for(let o of e.createRangeIn(t)){let c=o.item;if(c.is("element","br")){let a=T(c,"forward",e,{blockElements:i,inlineObjectElements:r}),u=T(c,"backward",e,{blockElements:i,inlineObjectElements:r}),m=B(a,i);(B(u,i)||m)&&l.push(c)}}for(let o of l)o.hasClass("Apple-interchange-newline")?e.remove(o):e.replace(o,e.createElement("p"))}function T(t,e,n,{blockElements:s,inlineObjectElements:i}){let r=n.createPositionAt(t,e=="forward"?"after":"before");return r=r.getLastMatchingPosition(({item:l})=>l.is("element")&&!s.includes(l.name)&&!i.includes(l.name),{direction:e}),e=="forward"?r.nodeAfter:r.nodeBefore}function B(t,e){return!!t&&t.is("element")&&e.includes(t.name)}var ve=/id=("|')docs-internal-guid-[-0-9a-f]+("|')/i,I=class{document;constructor(e){this.document=e}isActive(e){return ve.test(e)}execute(e){let n=new f.ViewUpcastWriter(this.document),{body:s}=e._parsedData;F(s,n),$(s,n),j(s,n),e.content=s}};function H(t,e){for(let n of t.getChildren())n.is("element","table")&&n.hasAttribute("xmlns")&&e.removeAttribute("xmlns",n)}function G(t,e){for(let n of t.getChildren())if(n.is("element","google-sheets-html-origin")){let s=t.getChildIndex(n);e.remove(n),e.insertChild(s,n.getChildren(),t)}}function q(t,e){for(let n of Array.from(t.getChildren()))n.is("element","style")&&e.remove(n)}var xe=/<google-sheets-html-origin/i,P=class{document;constructor(e){this.document=e}isActive(e){return xe.test(e)}execute(e){let n=new f.ViewUpcastWriter(this.document),{body:s}=e._parsedData;G(s,n),H(s,n),_(s,n),q(s,n),e.content=s}};function X(t){return k(k(t)).replace(/(<span\s+style=['"]mso-spacerun:yes['"]>[^\S\r\n]*?)[\r\n]+([^\S\r\n]*<\/span>)/g,"$1$2").replace(/<span\s+style=['"]mso-spacerun:yes['"]><\/span>/g,"").replace(/(<span\s+style=['"]letter-spacing:[^'"]+?['"]>)[\r\n]+(<\/span>)/g,"$1 $2").replace(/ <\//g,"\xA0</").replace(/ <o:p><\/o:p>/g,"\xA0<o:p></o:p>").replace(/<o:p>( |\u00A0)<\/o:p>/g,"").replace(/>([^\S\r\n]*[\r\n]\s*)</g,"><")}function U(t){t.querySelectorAll("span[style*=spacerun]").forEach(e
1=>{let n=e,s=n.innerText.length||0;n.innerText=Array(s+1).join("\xA0 ").substr(0,s)})}function k(t){return t.replace(/<span(?: class="Apple-converted-space"|)>(\s+)<\/span>/g,(e,n)=>n.length===1?" ":Array(n.length+1).join("\xA0 ").substr(0,n.length))}function J(t,e){let n=new DOMParser;t=t.replace(/<!--\[if gte vml 1]>/g,""),t=t.replace(/<o:SmartTagType(?:\s+[^\s>=]+(?:="[^"]*")?)*\s*\/?>/gi,"");let s=X(Pe(t)),i=n.parseFromString(s,"text/html");U(i);let r=i.body.innerHTML,l=Se(i,e),o=Ie(i);return{body:l,bodyString:r,styles:o.styles,stylesString:o.stylesString}}function Se(t,e){let n=new f.ViewDocument(e),s=new f.ViewDomConverter(n,{renderingMode:"data"}),i=t.createDocumentFragment(),r=t.body.childNodes;for(;r.length>0;)i.appendChild(r[0]);return s.domToView(i,{skipComments:!0})}function Ie(t){let e=[],n=[],s=Array.from(t.getElementsByTagName("style"));for(let i of s)i.sheet&&i.sheet.cssRules&&i.sheet.cssRules.length&&(e.push(i.sheet),n.push(i.innerHTML));return{styles:e,stylesString:n.join(" ")}}function Pe(t){let e="</body>",n="</html>",s=t.indexOf(e);if(s<0)return t;let i=t.indexOf(n,s+e.length);return t.substring(0,s+e.length)+(i>=0?t.substring(i):"")}var C=class extends v.Plugin{static get pluginName(){return"PasteFromOffice"}static get isOfficialPlugin(){return!0}static get requires(){return[x.ClipboardPipeline]}init(){let e=this.editor,n=e.plugins.get("ClipboardPipeline"),s=e.editing.view.document,i=[],r=this.editor.plugins.has("MultiLevelList");i.push(new S(s,r)),i.push(new I(s)),i.push(new P(s)),n.on("inputTransformation",(l,o)=>{if(o._isTransformedWithPasteFromOffice||e.model.document.selection.getFirstPosition().parent.is("element","codeBlock"))return;let a=o.dataTransfer.getData("text/html"),u=i.find(m=>m.isActive(a));u&&(o._parsedData||(o._parsedData=J(a,s.stylesProcessor)),u.execute(o),o._isTransformedWithPasteFromOffice=!0)},{priority:"high"})}};var{PasteFromOffice:Me,PasteFromOfficeGoogleDocsNormalizer:Te,PasteFromOfficeGoogleSheetsNormalizer:Be,PasteFromOfficeMSWordNormalizer:ke,_convertHexToBase64:Re,_convertPasteOfficeCssLengthToPx:We,_isPasteOfficePxValue:$e,_normalizePasteOfficeSpaceRunSpans:De,_normalizePasteOfficeSpacing:Ne,_removePasteGoogleOfficeSheetsTag:ze,_removePasteMSOfficeAttributes:Ve,_removePasteOfficeBoldWrapper:Fe,_removePasteOfficeInvalidTableWidths:je,_removePasteOfficeStyleBlock:He,_removePasteOfficeXmlnsAttributes:Ge,_replacePasteOfficeImagesSourceWithBase64:qe,_toPasteOfficePxValue:Xe,_transformPasteOfficeBlockBrsToParagraphs:Ue,_transformPasteOfficeBookmarks:Je,_transformPasteOfficeListItemLikeElementsIntoLists:Ke,_transformPasteOfficeTables:Qe,_unwrapPasteOfficeParagraphInListItem:Ye,parsePasteOfficeHtml:Ze,__esModule:et}=E;export{Me as PasteFromOffice,Te as PasteFromOfficeGoogleDocsNormalizer,Be as PasteFromOfficeGoogleSheetsNormalizer,ke as PasteFromOfficeMSWordNormalizer,et as __esModule,Re as _convertHexToBase64,We as _convertPasteOfficeCssLengthToPx,$e as _isPasteOfficePxValue,De as _normalizePasteOfficeSpaceRunSpans,Ne as _normalizePasteOfficeSpacing,ze as _removePasteGoogleOfficeSheetsTag,Ve as _removePasteMSOfficeAttributes,Fe as _removePasteOfficeBoldWrapper,je as _removePasteOfficeInvalidTableWidths,He as _removePasteOfficeStyleBlock,Ge as _removePasteOfficeXmlnsAttributes,qe as _replacePasteOfficeImagesSourceWithBase64,Xe as _toPasteOfficePxValue,Ue as _transformPasteOfficeBlockBrsToParagraphs,Je as _transformPasteOfficeBookmarks,Ke as _transformPasteOfficeListItemLikeElementsIntoLists,Qe as _transformPasteOfficeTables,Ye as _unwrapPasteOfficeParagraphInListItem,Ze as parsePasteOfficeHtml}; 2/*! Bundled license information: 3 4@ckeditor/ckeditor5-paste-from-office/dist/index.js: 5 (** 6 * @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved. 7 * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options 8 *) 9 (* istanbul ignore next -- @preserve *) 10 (* istanbul ignore else -- @preserve *) 11*/ 12//# sourceMappingURL=@ckeditor$ckeditor5-paste-from-office$dist$index.js.js.map
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.