/* Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved. For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license */ CKEDITOR.dialog.add("cellProperties",function(t){function e(t){return{isSpacer:!0,type:"html",html:" ",requiredContent:t?t:void 0}}function o(){return{type:"vbox",padding:0,children:[]}}function i(e){return{requiredContent:"td{"+e+"}",type:"hbox",widths:["70%","30%"],children:[{type:"text",id:e,width:"100px",label:d[e],validate:s.number(c["invalid"+CKEDITOR.tools.capitalize(e)]),onLoad:function(){var t=this.getDialog().getContentElement("info",e+"Type").getElement(),o=this.getInputElement(),i=o.getAttribute("aria-labelledby");o.setAttribute("aria-labelledby",[i,t.$.id].join(" "))},setup:n(function(t){var o=parseFloat(t.getAttribute(e),10);return t=parseFloat(t.getStyle(e),10),isNaN(t)?isNaN(o)?void 0:o:t}),commit:function(t){var o=parseFloat(this.getValue(),10),i=this.getDialog().getValueOf("info",e+"Type")||r(t,e);isNaN(o)?t.removeStyle(e):t.setStyle(e,o+i),t.removeAttribute(e)},"default":""},{type:"select",id:e+"Type",label:t.lang.table[e+"Unit"],labelStyle:"visibility:hidden;display:block;width:0;overflow:hidden","default":"px",items:[[u.widthPx,"px"],[u.widthPc,"%"]],setup:n(function(t){return r(t,e)})}]}}function n(t){return function(e){for(var o=t(e[0]),i=1;i5&&(m=m.concat([e(),o()])),CKEDITOR.tools.array.forEach(h,function(t){t.isSpacer||b++,f>5&&b>=f/2?m[2].children.push(t):m[0].children.push(t)}),CKEDITOR.tools.array.forEach(m,function(t){t.isSpacer||(t=t.children,t[t.length-1].isSpacer&&t.pop())}),{title:c.title,minWidth:1===m.length?205:410,minHeight:50,contents:[{id:"info",label:c.title,accessKey:"I",elements:[{type:"hbox",widths:1===m.length?["100%"]:["40%","5%","40%"],children:m}]}],getModel:function(t){return CKEDITOR.plugins.tabletools.getSelectedCells(t.getSelection())},onShow:function(){var t=this.getModel(this.getParentEditor());this.setupContent(t)},onOk:function(){for(var t=this._.editor.getSelection(),e=t.createBookmarks(),o=this.getParentEditor(),i=this.getModel(o),n=0;n