import{bf as ar,aZ as oP}from"./index-7ed2d026.js";var cr={exports:{}};cr.exports;(function(Ce,Te){(function(Xn){const Qe=Xn.zh=Xn.zh||{};Qe.dictionary=Object.assign(Qe.dictionary||{},{"%0 of %1":"%0/%1",Accept:"接受","Align cell text to the bottom":"向下對齊","Align cell text to the center":"置中對齊","Align cell text to the left":"靠左對齊","Align cell text to the middle":"置中對齊","Align cell text to the right":"靠右對齊","Align cell text to the top":"向上對齊","Align table to the left":"靠左對齊","Align table to the right":"靠右對齊",Alignment:"對齊",Aquamarine:"淺綠色",Background:"背景顏色",Big:"大",Black:"黑色","Block quote":"段落引用",Blue:"藍色",Bold:"粗體",Border:"邊框","Break text":"上及下","Bulleted List":"符號清單","Bulleted list styles toolbar":"無序清單工具列",Cancel:"取消","Caption for image: %0":"影像標題:%0","Caption for the image":"影像的標題","Cell properties":"儲存格屬性","Center table":"置中對齊","Centered image":"置中圖片","Change image text alternative":"修改圖片的替代文字","Choose heading":"選取標題",Circle:"空心圓點",Clear:"清除","Click to edit block":"點擊來編輯區塊",Close:"關閉",Code:"代碼",Color:"文字顏色","Color picker":"顏色選擇",Column:"欄",Dashed:"虛線",Decimal:"數字","Decimal with leading zero":"0開頭的數字","Decrease indent":"減少縮排",Default:"預設","Delete column":"刪除欄","Delete row":"刪除列","Dim grey":"淡灰色",Dimensions:"尺寸",Disc:"實心圓點","Document colors":"文件顏色",Dotted:"點線",Double:"雙線",Downloadable:"可下載","Drag to move":"拖曳來移動","Dropdown toolbar":"下拉選單","Edit block":"編輯區塊","Edit link":"編輯連結","Editor block content toolbar":"編輯器區塊內容工具列","Editor contextual toolbar":"編輯器關聯式工具列","Editor dialog":"編輯工具對話框","Editor editing area: %0":"編輯器編輯區:%0","Editor toolbar":"編輯器工具","Enter image caption":"輸入圖片說明","Enter table caption":"輸入表標題","Font Background Color":"前景顏色","Font Color":"字體顏色","Font Family":"字型","Font Size":"字體大小","Full size image":"完整尺寸圖片",Green:"綠色",Grey:"灰色",Groove:"內凹線","Header column":"標題欄","Header row":"標題列",Heading:"標題","Heading 1":"標題 1","Heading 2":"標題 2","Heading 3":"標題 3","Heading 4":"標題 4","Heading 5":"標題 5","Heading 6":"標題 6",Height:"高度",HEX:"十六進位","Horizontal text alignment toolbar":"水平對齊",Huge:"特大","Image resize list":"圖片縮放清單","Image toolbar":"圖片工具","image widget":"圖片小工具","In line":"行中","Increase indent":"增加縮排",Insert:"插入","Insert column left":"插入左方欄","Insert column right":"插入右方欄","Insert image":"插入圖片","Insert image via URL":"使用連結插入圖片","Insert media":"插入影音","Insert paragraph after block":"在這個區塊後面插入一個段落","Insert paragraph before block":"在這個區塊前面插入一個段落","Insert row above":"插入上方列","Insert row below":"插入下方列","Insert table":"插入表格",Inset:"內邊線",Italic:"斜體","Justify cell text":"分散對齊","Left aligned image":"向左對齊圖片","Light blue":"亮藍色","Light green":"亮綠色","Light grey":"亮灰色",Link:"連結","Link image":"圖片連結","Link URL":"連結˙ URL","List properties":"清單屬性","Lower-latin":"小寫拉丁字母","Lower–roman":"小寫羅馬數字","Media toolbar":"影音工具","Media URL":"影音網址","media widget":"影音小工具","Merge cell down":"合併下方儲存格","Merge cell left":"合併左方儲存格","Merge cell right":"合併右方儲存格","Merge cell up":"合併上方儲存格","Merge cells":"合併儲存格",Next:"下一","No results found":"找不到結果","No searchable items":"沒有可搜尋的項目",None:"無","Numbered List":"有序清單","Numbered list styles toolbar":"有序清單工具列","Open in a new tab":"在新視窗開啟","Open link in new tab":"在新視窗開啟連結","Open media in new tab":"在新分頁打開媒體",Orange:"橘色",Original:"原始圖片",Outset:"外框線",Padding:"儲存格留白",Paragraph:"段落","Paste the media URL in the input.":"在輸入框貼上影音網址。","Press Enter to type after or press Shift + Enter to type before the widget":"按下 Enter 在小工具後輸入,或按下 Shift + Enter 在小工具前輸入",Previous:"上一",Purple:"紫色",Red:"紅色",Redo:"重做","Remove color":"移除顏色","Replace from computer":"從電腦替換","Replace image":"替換圖片","Replace image from computer":"從電腦替換圖片","Resize image":"縮放圖片","Resize image to %0":"縮放圖片到 %0","Resize image to the original size":"縮放圖片到原始尺寸","Restore default":"重設至預設值","Reversed order":"反轉順序","Rich Text Editor":"富文本編輯器",Ridge:"凸起線","Right aligned image":"向右對齊圖片",Row:"列",Save:"儲存","Select all":"選取全部","Select column":"選擇欄","Select row":"選擇列","Show more items":"顯示更多","Side image":"側邊圖片",Small:"小",Solid:"實線",Source:"原始碼","Split cell horizontally":"水平分割儲存格","Split cell vertically":"垂直分割儲存格",Square:"方形","Start at":"起始於","Start index must be greater than 0.":"起始索引須大於 0。",Strikethrough:"刪除線",Style:"樣式",Subscript:"下標",Superscript:"上標","Table alignment toolbar":"表格對齊","Table cell text alignment":"儲存格文字對齊","Table properties":"表格屬性","Table toolbar":"表格工具","Text alternative":"替代文字",'The color is invalid. Try "#FF0000" or "rgb(255,0,0)" or "red".':'顏色代碼錯誤。試試看 "#FF0000" 或 "rgb(255, 0, 0)" 或 "red"。',"The URL must not be empty.":"網址不能空白。",'The value is invalid. Try "10px" or "2em" or simply "2".':'尺寸代碼錯誤。試試看 "10px" 或 "2em" 或簡單寫 "2"。',"This link has no URL":"此連結沒有URL","This media URL is not supported.":"不支援此影音網址。",Tiny:"特小","Tip: Paste the URL into the content to embed faster.":"提示:在內容貼上網址更快崁入。","To-do List":"代辦清單","Toggle caption off":"關閉表標題","Toggle caption on":"開啟表標題","Toggle the circle list style":"切換為空心圓點標示","Toggle the decimal list style":"切換為數字標示","Toggle the decimal with leading zero list style":"切換為0開頭的數字標示","Toggle the disc list style":"切換為實心圓點標示","Toggle the lower–latin list style":"切換為小寫拉丁文字標示","Toggle the lower–roman list style":"切換為小寫羅馬數字標示","Toggle the square list style":"切換為方形標示","Toggle the upper–latin list style":"切換為大寫拉丁文字標示","Toggle the upper–roman list style":"切換為大寫羅馬數字標示",Turquoise:"藍綠色","Type or paste your content here.":"在此輸入或貼上你的內容。","Type your title":"輸入你的標題",Underline:"底線",Undo:"取消",Unlink:"移除連結",Update:"更新","Update image URL":"更新圖片連結","Upload failed":"上傳失敗","Upload from computer":"從電腦上傳","Upload image from computer":"從電腦上傳圖片","Upload in progress":"正在上傳","Upper-latin":"大寫拉丁字母","Upper-roman":"大寫羅馬數字","Vertical text alignment toolbar":"垂直對齊",White:"白色","Widget toolbar":"小工具",Width:"寬度","Wrap text":"文繞圖",Yellow:"黃色"}),Qe.getPluralForm=function(L){return 0}})(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));/*!
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
* For licensing, see LICENSE.md.
*/(function(Qe,L){Ce.exports=L()})(self,()=>(()=>{var Xn={8168:(C,y,h)=>{const _=h(8874),x={};for(const g of Object.keys(_))x[_[g]]=g;const k={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},lch:{channels:3,labels:"lch"},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}};C.exports=k;for(const g of Object.keys(k)){if(!("channels"in k[g]))throw new Error("missing channels property: "+g);if(!("labels"in k[g]))throw new Error("missing channel labels property: "+g);if(k[g].labels.length!==k[g].channels)throw new Error("channel and label counts mismatch: "+g);const{channels:m,labels:A}=k[g];delete k[g].channels,delete k[g].labels,Object.defineProperty(k[g],"channels",{value:m}),Object.defineProperty(k[g],"labels",{value:A})}k.rgb.hsl=function(g){const m=g[0]/255,A=g[1]/255,v=g[2]/255,E=Math.min(m,A,v),I=Math.max(m,A,v),B=I-E;let F,W;I===E?F=0:m===I?F=(A-v)/B:A===I?F=2+(v-m)/B:v===I&&(F=4+(m-A)/B),F=Math.min(F*60,360),F<0&&(F+=360);const j=(E+I)/2;return I===E?W=0:j<=.5?W=B/(I+E):W=B/(2-I-E),[F,W*100,j*100]},k.rgb.hsv=function(g){let m,A,v,E,I;const B=g[0]/255,F=g[1]/255,W=g[2]/255,j=Math.max(B,F,W),Z=j-Math.min(B,F,W),$=function(it){return(j-it)/6/Z+1/2};return Z===0?(E=0,I=0):(I=Z/j,m=$(B),A=$(F),v=$(W),B===j?E=v-A:F===j?E=.3333333333333333+m-v:W===j&&(E=.6666666666666666+A-m),E<0?E+=1:E>1&&(E-=1)),[E*360,I*100,j*100]},k.rgb.hwb=function(g){const m=g[0],A=g[1];let v=g[2];const E=k.rgb.hsl(g)[0],I=1/255*Math.min(m,Math.min(A,v));return v=1-.00392156862745098*Math.max(m,Math.max(A,v)),[E,I*100,v*100]},k.rgb.cmyk=function(g){const m=g[0]/255,A=g[1]/255,v=g[2]/255,E=Math.min(1-m,1-A,1-v),I=(1-m-E)/(1-E)||0,B=(1-A-E)/(1-E)||0,F=(1-v-E)/(1-E)||0;return[I*100,B*100,F*100,E*100]};function D(g,m){return(g[0]-m[0])**2+(g[1]-m[1])**2+(g[2]-m[2])**2}k.rgb.keyword=function(g){const m=x[g];if(m)return m;let A=1/0,v;for(const E of Object.keys(_)){const I=_[E],B=D(g,I);B.04045?((m+.055)/1.055)**2.4:m/12.92,A=A>.04045?((A+.055)/1.055)**2.4:A/12.92,v=v>.04045?((v+.055)/1.055)**2.4:v/12.92;const E=m*.4124+A*.3576+v*.1805,I=m*.2126+A*.7152+v*.0722,B=m*.0193+A*.1192+v*.9505;return[E*100,I*100,B*100]},k.rgb.lab=function(g){const m=k.rgb.xyz(g);let A=m[0],v=m[1],E=m[2];A/=95.047,v/=100,E/=108.883,A=A>.008856?A**.3333333333333333:7.787*A+.13793103448275862,v=v>.008856?v**.3333333333333333:7.787*v+.13793103448275862,E=E>.008856?E**.3333333333333333:7.787*E+.13793103448275862;const I=116*v-16,B=500*(A-v),F=200*(v-E);return[I,B,F]},k.hsl.rgb=function(g){const m=g[0]/360,A=g[1]/100,v=g[2]/100;let E,I,B;if(A===0)return B=v*255,[B,B,B];v<.5?E=v*(1+A):E=v+A-v*A;const F=2*v-E,W=[0,0,0];for(let j=0;j<3;j++)I=m+.3333333333333333*-(j-1),I<0&&I++,I>1&&I--,6*I<1?B=F+(E-F)*6*I:2*I<1?B=E:3*I<2?B=F+(E-F)*(.6666666666666666-I)*6:B=F,W[j]=B*255;return W},k.hsl.hsv=function(g){const m=g[0];let A=g[1]/100,v=g[2]/100,E=A;const I=Math.max(v,.01);v*=2,A*=v<=1?v:2-v,E*=I<=1?I:2-I;const B=(v+A)/2,F=v===0?2*E/(I+E):2*A/(v+A);return[m,F*100,B*100]},k.hsv.rgb=function(g){const m=g[0]/60,A=g[1]/100;let v=g[2]/100;const E=Math.floor(m)%6,I=m-Math.floor(m),B=255*v*(1-A),F=255*v*(1-A*I),W=255*v*(1-A*(1-I));switch(v*=255,E){case 0:return[v,W,B];case 1:return[F,v,B];case 2:return[B,v,W];case 3:return[B,F,v];case 4:return[W,B,v];case 5:return[v,B,F]}},k.hsv.hsl=function(g){const m=g[0],A=g[1]/100,v=g[2]/100,E=Math.max(v,.01);let I,B;B=(2-A)*v;const F=(2-A)*E;return I=A*E,I/=F<=1?F:2-F,I=I||0,B/=2,[m,I*100,B*100]},k.hwb.rgb=function(g){const m=g[0]/360;let A=g[1]/100,v=g[2]/100;const E=A+v;let I;E>1&&(A/=E,v/=E);const B=Math.floor(6*m),F=1-v;I=6*m-B,B&1&&(I=1-I);const W=A+I*(F-A);let j,Z,$;switch(B){default:case 6:case 0:j=F,Z=W,$=A;break;case 1:j=W,Z=F,$=A;break;case 2:j=A,Z=F,$=W;break;case 3:j=A,Z=W,$=F;break;case 4:j=W,Z=A,$=F;break;case 5:j=F,Z=A,$=W;break}return[j*255,Z*255,$*255]},k.cmyk.rgb=function(g){const m=g[0]/100,A=g[1]/100,v=g[2]/100,E=g[3]/100,I=1-Math.min(1,m*(1-E)+E),B=1-Math.min(1,A*(1-E)+E),F=1-Math.min(1,v*(1-E)+E);return[I*255,B*255,F*255]},k.xyz.rgb=function(g){const m=g[0]/100,A=g[1]/100,v=g[2]/100;let E,I,B;return E=m*3.2406+A*-1.5372+v*-.4986,I=m*-.9689+A*1.8758+v*.0415,B=m*.0557+A*-.204+v*1.057,E=E>.0031308?1.055*E**.4166666666666667-.055:E*12.92,I=I>.0031308?1.055*I**.4166666666666667-.055:I*12.92,B=B>.0031308?1.055*B**.4166666666666667-.055:B*12.92,E=Math.min(Math.max(0,E),1),I=Math.min(Math.max(0,I),1),B=Math.min(Math.max(0,B),1),[E*255,I*255,B*255]},k.xyz.lab=function(g){let m=g[0],A=g[1],v=g[2];m/=95.047,A/=100,v/=108.883,m=m>.008856?m**.3333333333333333:7.787*m+.13793103448275862,A=A>.008856?A**.3333333333333333:7.787*A+.13793103448275862,v=v>.008856?v**.3333333333333333:7.787*v+.13793103448275862;const E=116*A-16,I=500*(m-A),B=200*(A-v);return[E,I,B]},k.lab.xyz=function(g){const m=g[0],A=g[1],v=g[2];let E,I,B;I=(m+16)/116,E=A/500+I,B=I-v/200;const F=I**3,W=E**3,j=B**3;return I=F>.008856?F:(I-.13793103448275862)/7.787,E=W>.008856?W:(E-.13793103448275862)/7.787,B=j>.008856?j:(B-.13793103448275862)/7.787,E*=95.047,I*=100,B*=108.883,[E,I,B]},k.lab.lch=function(g){const m=g[0],A=g[1],v=g[2];let E;E=Math.atan2(v,A)*360/2/Math.PI,E<0&&(E+=360);const B=Math.sqrt(A*A+v*v);return[m,B,E]},k.lch.lab=function(g){const m=g[0],A=g[1],E=g[2]/360*2*Math.PI,I=A*Math.cos(E),B=A*Math.sin(E);return[m,I,B]},k.rgb.ansi16=function(g,m=null){const[A,v,E]=g;let I=m===null?k.rgb.hsv(g)[2]:m;if(I=Math.round(I/50),I===0)return 30;let B=30+(Math.round(E/255)<<2|Math.round(v/255)<<1|Math.round(A/255));return I===2&&(B+=60),B},k.hsv.ansi16=function(g){return k.rgb.ansi16(k.hsv.rgb(g),g[2])},k.rgb.ansi256=function(g){const m=g[0],A=g[1],v=g[2];return m===A&&A===v?m<8?16:m>248?231:Math.round((m-8)/247*24)+232:16+36*Math.round(m/255*5)+6*Math.round(A/255*5)+Math.round(v/255*5)},k.ansi16.rgb=function(g){let m=g%10;if(m===0||m===7)return g>50&&(m+=3.5),m=m/10.5*255,[m,m,m];const A=(~~(g>50)+1)*.5,v=(m&1)*A*255,E=(m>>1&1)*A*255,I=(m>>2&1)*A*255;return[v,E,I]},k.ansi256.rgb=function(g){if(g>=232){const I=(g-232)*10+8;return[I,I,I]}g-=16;let m;const A=Math.floor(g/36)/5*255,v=Math.floor((m=g%36)/6)/5*255,E=m%6/5*255;return[A,v,E]},k.rgb.hex=function(g){const A=(((Math.round(g[0])&255)<<16)+((Math.round(g[1])&255)<<8)+(Math.round(g[2])&255)).toString(16).toUpperCase();return"000000".substring(A.length)+A},k.hex.rgb=function(g){const m=g.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!m)return[0,0,0];let A=m[0];m[0].length===3&&(A=A.split("").map(F=>F+F).join(""));const v=parseInt(A,16),E=v>>16&255,I=v>>8&255,B=v&255;return[E,I,B]},k.rgb.hcg=function(g){const m=g[0]/255,A=g[1]/255,v=g[2]/255,E=Math.max(Math.max(m,A),v),I=Math.min(Math.min(m,A),v),B=E-I;let F,W;return B<1?F=I/(1-B):F=0,B<=0?W=0:E===m?W=(A-v)/B%6:E===A?W=2+(v-m)/B:W=4+(m-A)/B,W/=6,W%=1,[W*360,B*100,F*100]},k.hsl.hcg=function(g){const m=g[1]/100,A=g[2]/100,v=A<.5?2*m*A:2*m*(1-A);let E=0;return v<1&&(E=(A-.5*v)/(1-v)),[g[0],v*100,E*100]},k.hsv.hcg=function(g){const m=g[1]/100,A=g[2]/100,v=m*A;let E=0;return v<1&&(E=(A-v)/(1-v)),[g[0],v*100,E*100]},k.hcg.rgb=function(g){const m=g[0]/360,A=g[1]/100,v=g[2]/100;if(A===0)return[v*255,v*255,v*255];const E=[0,0,0],I=m%1*6,B=I%1,F=1-B;let W=0;switch(Math.floor(I)){case 0:E[0]=1,E[1]=B,E[2]=0;break;case 1:E[0]=F,E[1]=1,E[2]=0;break;case 2:E[0]=0,E[1]=1,E[2]=B;break;case 3:E[0]=0,E[1]=F,E[2]=1;break;case 4:E[0]=B,E[1]=0,E[2]=1;break;default:E[0]=1,E[1]=0,E[2]=F}return W=(1-A)*v,[(A*E[0]+W)*255,(A*E[1]+W)*255,(A*E[2]+W)*255]},k.hcg.hsv=function(g){const m=g[1]/100,A=g[2]/100,v=m+A*(1-m);let E=0;return v>0&&(E=m/v),[g[0],E*100,v*100]},k.hcg.hsl=function(g){const m=g[1]/100,v=g[2]/100*(1-m)+.5*m;let E=0;return v>0&&v<.5?E=m/(2*v):v>=.5&&v<1&&(E=m/(2*(1-v))),[g[0],E*100,v*100]},k.hcg.hwb=function(g){const m=g[1]/100,A=g[2]/100,v=m+A*(1-m);return[g[0],(v-m)*100,(1-v)*100]},k.hwb.hcg=function(g){const m=g[1]/100,v=1-g[2]/100,E=v-m;let I=0;return E<1&&(I=(v-E)/(1-E)),[g[0],E*100,I*100]},k.apple.rgb=function(g){return[g[0]/65535*255,g[1]/65535*255,g[2]/65535*255]},k.rgb.apple=function(g){return[g[0]/255*65535,g[1]/255*65535,g[2]/255*65535]},k.gray.rgb=function(g){return[g[0]/100*255,g[0]/100*255,g[0]/100*255]},k.gray.hsl=function(g){return[0,0,g[0]]},k.gray.hsv=k.gray.hsl,k.gray.hwb=function(g){return[0,100,g[0]]},k.gray.cmyk=function(g){return[0,0,0,g[0]]},k.gray.lab=function(g){return[g[0],0,0]},k.gray.hex=function(g){const m=Math.round(g[0]/100*255)&255,v=((m<<16)+(m<<8)+m).toString(16).toUpperCase();return"000000".substring(v.length)+v},k.rgb.gray=function(g){return[(g[0]+g[1]+g[2])/3/255*100]}},2085:(C,y,h)=>{const _=h(8168),x=h(4111),k={},D=Object.keys(_);function g(A){const v=function(...E){const I=E[0];return I==null?I:(I.length>1&&(E=I),A(E))};return"conversion"in A&&(v.conversion=A.conversion),v}function m(A){const v=function(...E){const I=E[0];if(I==null)return I;I.length>1&&(E=I);const B=A(E);if(typeof B=="object")for(let F=B.length,W=0;W
").replace(/\r?\n/g,"
").replace(/\t/g," ").replace(/^\s/," ").replace(/\s$/," ").replace(/\s\s/g," "),(o.includes("
")||o.includes("
"))&&(o=`
${o}
`),o}function JT(o){return o.replace(/(\s+)<\/span>/g,(t,e)=>e.length==1?" ":e).replace(//g,"")}const Mf=["figcaption","li"],Bf=["ol","ul"];function Nf(o){if(o.is("$text")||o.is("$textProxy"))return o.data;if(o.is("element","img")&&o.hasAttribute("alt"))return o.getAttribute("alt");if(o.is("element","br"))return` `;let t="",e=null;for(const n of o.getChildren())t+=XT(n,e)+Nf(n),e=n;return t}function XT(o,t){return t?o.is("element","li")&&!o.isEmpty&&o.getChild(0).is("containerElement")||Bf.includes(o.name)&&Bf.includes(t.name)?` `:!o.is("containerElement")&&!t.is("containerElement")?"":Mf.includes(o.name)||Mf.includes(t.name)?` `:` `:""}class we extends z{static get pluginName(){return"ClipboardPipeline"}init(){this.editor.editing.view.addObserver(jo),this._setupPasteDrop(),this._setupCopyCut()}_fireOutputTransformationEvent(t,e,n){const i=this.editor.model.getSelectedContent(e);this.fire("outputTransformation",{dataTransfer:t,content:i,method:n})}_setupPasteDrop(){const t=this.editor,e=t.model,n=t.editing.view,i=n.document;this.listenTo(i,"clipboardInput",(r,s)=>{s.method=="paste"&&!t.model.canEditAt(t.model.document.selection)&&r.stop()},{priority:"highest"}),this.listenTo(i,"clipboardInput",(r,s)=>{const a=s.dataTransfer;let c;if(s.content)c=s.content;else{let d="";a.getData("text/html")?d=JT(a.getData("text/html")):a.getData("text/plain")&&(d=QT(a.getData("text/plain"))),c=this.editor.data.htmlProcessor.toView(d)}const l=new Pt(this,"inputTransformation");this.fire(l,{content:c,dataTransfer:a,targetRanges:s.targetRanges,method:s.method}),l.stop.called&&r.stop(),n.scrollToTheSelection()},{priority:"low"}),this.listenTo(this,"inputTransformation",(r,s)=>{if(s.content.isEmpty)return;const c=this.editor.data.toModel(s.content,"$clipboardHolder");c.childCount!=0&&(r.stop(),e.change(()=>{this.fire("contentInsertion",{content:c,method:s.method,dataTransfer:s.dataTransfer,targetRanges:s.targetRanges})}))},{priority:"low"}),this.listenTo(this,"contentInsertion",(r,s)=>{s.resultRange=e.insertContent(s.content)},{priority:"low"})}_setupCopyCut(){const t=this.editor,e=t.model.document,i=t.editing.view.document,r=(s,a)=>{const c=a.dataTransfer;a.preventDefault(),this._fireOutputTransformationEvent(c,e.selection,s.name)};this.listenTo(i,"copy",r,{priority:"low"}),this.listenTo(i,"cut",(s,a)=>{t.model.canEditAt(t.model.document.selection)?r(s,a):a.preventDefault()},{priority:"low"}),this.listenTo(this,"outputTransformation",(s,a)=>{const c=t.data.toView(a.content);i.fire("clipboardOutput",{dataTransfer:a.dataTransfer,content:c,method:a.method})},{priority:"low"}),this.listenTo(i,"clipboardOutput",(s,a)=>{a.content.isEmpty||(a.dataTransfer.setData("text/html",this.editor.data.htmlProcessor.toData(a.content)),a.dataTransfer.setData("text/plain",Nf(a.content))),a.method=="cut"&&t.model.deleteContent(e.selection)},{priority:"low"})}}class tS extends lt(){constructor(){super(...arguments),this._stack=[]}add(t,e){const n=this._stack,i=n[0];this._insertDescriptor(t);const r=n[0];i!==r&&!Ba(i,r)&&this.fire("change:top",{oldDescriptor:i,newDescriptor:r,writer:e})}remove(t,e){const n=this._stack,i=n[0];this._removeDescriptor(t);const r=n[0];i!==r&&!Ba(i,r)&&this.fire("change:top",{oldDescriptor:i,newDescriptor:r,writer:e})}_insertDescriptor(t){const e=this._stack,n=e.findIndex(r=>r.id===t.id);if(Ba(t,e[n]))return;n>-1&&e.splice(n,1);let i=0;for(;e[i]&&eS(e[i],t);)i++;e.splice(i,0,t)}_removeDescriptor(t){const e=this._stack,n=e.findIndex(i=>i.id===t);n>-1&&e.splice(n,1)}}function Ba(o,t){return o&&t&&o.priority==t.priority&&Zi(o.classes)==Zi(t.classes)}function eS(o,t){return o.priority>t.priority?!0:o.priority