function getTinyMCEContentOffsetShortCode(t,e){var n=getTinyMCECursorPosition(),o=t.getContent();return getShortCodeFromContentOffset(o,n,e)}function getTinyMCECursorPosition(){var t=tinyMCE.activeEditor,e=t.selection.getBookmark(0),n="[data-mce-type=bookmark]",o=t.dom.select(n);t.selection.select(o[0]),t.selection.collapse();var r="nt-tmce-bm-cursor",i='<span id="'+r+'"></span>';t.selection.setContent(i);var s=t.getContent({format:"html"}),c=s.indexOf(i);return t.dom.remove(r,!1),t.selection.moveToBookmark(e),c}function getShortCodeFromContentOffset(t,e,n){var o=t.slice(0,e),r=t.slice(e),i=o.lastIndexOf("["),s=r.indexOf("]");if(i!==-1&&s!==-1){var c=t.slice(i,e+s+1);return quix.shortcode.next(n,c)}return null}function getCurrentShortcodeItemId(){if("undefined"==typeof tinyMCE)return null;var t=getTinyMCEContentOffsetShortCode(tinyMCE.activeEditor,"quix");return t?t.shortcode.attrs.named.id:null}