/**
 * Minified by jsDelivr using Terser v5.48.0.
 * Original file: /npm/@univerjs/docs-hyper-link-ui@1.4.0/lib/es/index.js
 *
 * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files
 */
import{DocBackScrollRenderController,DocCanvasPopManagerService,DocEventManagerService,DocMobileElementMenuService,EMPTY_PARAGRAPH_MENU_ID,FLOAT_TOOLBAR_MENU_POSITION,INSERT_BELLOW_MENU_ID,MOBILE_DOC_ELEMENT_MENU,UniverDocsMobileUIPlugin,UniverDocsUIPlugin,getEditorRuntimeConfig,whenDocAndEditorFocused}from"@univerjs/docs-ui";import{ComponentManager,ContextMenuGroup,ContextMenuPosition,IDialogService,IMenuManagerService,IMessageService,IShortcutService,IconManager,KeyCode,MenuItemType,MetaKeys,RibbonInsertGroup,getMenuHiddenObservable,useDependency,useObservable}from"@univerjs/ui";import{BuildTextUtils,CommandType,CustomRangeType,DOCS_NORMAL_EDITOR_UNIT_ID_KEY,DependentOn,Disposable,DocumentDataModel,ICommandService,IConfigService,IPermissionService,IUniverInstanceService,Inject,Injector,LocaleService,Plugin,Tools,UniverInstanceType,generateRandomId,getBodySlice,isSafeUrl,merge}from"@univerjs/core";import{DOC_INTERCEPTOR_POINT,DOC_SELECTION_OPTION_PRESERVE_CARET,DocInterceptorService,DocSelectionManagerService,DocSkeletonManagerService,RichTextEditingMutation,SetTextSelectionsOperation,UniverDocsPlugin,addCustomRangeBySelectionFactory,canEditDocumentTargets,deleteCustomRangeFactory,getDocumentEntityParentPermissionObjectIds,getDocumentEntityPermissionObjectId,getDocumentPermissionValue,replaceSelectionFactory}from"@univerjs/docs";import{IRenderManagerService,UniverRenderEnginePlugin}from"@univerjs/engine-render";import{BehaviorSubject,Observable,debounceTime}from"rxjs";import{DocHyperLinkCommandId,UniverDocsHyperLinkPlugin}from"@univerjs/docs-hyper-link";import{Button,FormLayout,Input,MessageType,MobileActionRow,Tooltip,borderClassName,clsx}from"@univerjs/design";import{useEffect,useState}from"react";import{Fragment,jsx,jsxs}from"react/jsx-runtime";import{CopyIcon,LinkIcon,UnlinkIcon,WriteIcon}from"@univerjs/icons";import{UnitAction}from"@univerjs/protocol";const DeleteDocHyperLinkCommand={type:CommandType.COMMAND,id:DocHyperLinkCommandId.Delete,async handler(e,n){if(!n)return!1;const{unitId:i,linkId:t,segmentId:o}=n,r=e.get(ICommandService),s=deleteCustomRangeFactory(e,{unitId:i,rangeId:t,segmentId:o});return!!s&&await r.syncExecuteCommand(s.id,s.params)}},AddDocHyperLinkCommand={type:CommandType.COMMAND,id:DocHyperLinkCommandId.Add,async handler(e,n){if(!n)return!1;const{payload:i,unitId:t,selections:o}=n,r=e.get(ICommandService),s=generateRandomId(),d=addCustomRangeBySelectionFactory(e,{rangeId:s,rangeType:CustomRangeType.HYPERLINK,properties:{url:i},unitId:t,selections:o});return!!d&&r.syncExecuteCommand(d.id,d.params)}},UpdateDocHyperLinkCommand={id:DocHyperLinkCommandId.Update,type:CommandType.COMMAND,handler(e,n){var i,t,o,r,s;if(!n)return!1;const{unitId:d,payload:c,segmentId:a,linkId:l}=n,p=e.get(ICommandService),u=e.get(IUniverInstanceService),v=e.get(DocSelectionManagerService).getActiveTextRange(),m=u.getUnit(d,UniverInstanceType.UNIVER_DOC);if(!v||!m)return!1;const I=null===(i=m.getSelfOrHeaderFooterModel(a))||void 0===i?void 0:i.getBody();if(!I)return!1;const h=null===(t=I.customRanges)||void 0===t?void 0:t.find(e=>e.rangeId===l&&e.rangeType===CustomRangeType.HYPERLINK),g=null===(o=getBodySlice(I,v.startOffset,v.endOffset).textRuns)||void 0===o?void 0:o[0];g&&(g.ed=n.label.length+1);const _=replaceSelectionFactory(e,{unitId:d,body:{dataStream:`${n.label}`,customRanges:[{rangeId:l,rangeType:CustomRangeType.HYPERLINK,startIndex:0,endIndex:n.label.length+1,properties:{url:c,...(null==h||null===(r=h.properties)||void 0===r?void 0:r.textStyleMode)?{textStyleMode:h.properties.textStyleMode}:null,...(null==h||null===(s=h.properties)||void 0===s?void 0:s.textColorMode)?{textColorMode:h.properties.textColorMode}:null}}],textRuns:g?[g]:void 0},selection:{startOffset:v.startOffset,endOffset:v.endOffset,collapsed:!1,segmentId:a}});return!!_&&p.syncExecuteCommand(_.id,_.params)}};function isBlankInput(e){return 0===e.trim().length}function hasProtocol(e){return/^[a-zA-Z]+:\/\//.test(e)}function isEmail(e){return/^[\w.-]+@([\w-]+\.)+[\w-]{2,4}$/.test(e)}function transformUrl(e){return hasProtocol(e)?e:isEmail(e)?`mailto://${e}`:`https://${e}`}function useDocHyperLinkEdit(){const e=useDependency(DocHyperLinkPopupService),n=useObservable(e.editingLink$,e.editing),i=useDependency(ICommandService),t=useDependency(IUniverInstanceService),o=useDependency(DocSelectionManagerService),[r,s]=useState(""),[d,c]=useState(""),[a,l]=useState(!1),p=Tools.isLegalUrl(r),u=n?t.getUnit(n.unitId,UniverInstanceType.UNIVER_DOC):t.getCurrentUnitOfType(UniverInstanceType.UNIVER_DOC);useEffect(()=>{var e,i;const t=o.getActiveTextRange();if(!t)return;if(n){var r,d;const e=null==u||null===(r=u.getSelfOrHeaderFooterModel(n.segmentId))||void 0===r?void 0:r.getBody(),i=null==e||null===(d=e.customRanges)||void 0===d?void 0:d.find(e=>n.linkId===e.rangeId&&e.startIndex===n.startIndex&&e.endIndex===n.endIndex);var a;if(u&&i)s((null===(a=i.properties)||void 0===a?void 0:a.url)??""),c(BuildTextUtils.transform.getPlainText(getBodySlice(e,i.startIndex,i.endIndex+1).dataStream));return}const l=null==u||null===(e=u.getSelfOrHeaderFooterModel(t.segmentId))||void 0===e?void 0:e.getBody(),p=l?t:null,v=p&&(null===(i=BuildTextUtils.customRange.getCustomRangesInterestsWithSelection(p,(null==l?void 0:l.customRanges)??[]))||void 0===i?void 0:i[0]);var m;u&&v&&s((null===(m=v.properties)||void 0===m?void 0:m.url)??"")},[u,o,n]);return{doc:u,editing:n,handleCancel:()=>e.hideEditPopup(),handleConfirm:()=>{if(l(!0),!p||!u)return;const t=transformUrl(r);if(n){if(isBlankInput(d))return;i.executeCommand(UpdateDocHyperLinkCommand.id,{unitId:u.getUnitId(),payload:t,linkId:n.linkId,label:d,segmentId:n.segmentId}).catch(()=>{})}else i.executeCommand(AddDocHyperLinkCommand.id,{unitId:u.getUnitId(),payload:t}).catch(()=>{});e.hideEditPopup()},isLegal:p,label:d,link:r,setLabel:c,setLink:s,showError:a}}const DocHyperLinkEdit=()=>{const e=useDependency(LocaleService),{doc:n,editing:i,handleCancel:t,handleConfirm:o,isLegal:r,label:s,link:d,setLabel:c,setLink:a,showError:l}=useDocHyperLinkEdit();if(n)return jsxs("div",{className:clsx("univer-box-border univer-w-[328px] univer-rounded-xl univer-bg-gray-0 univer-px-6 univer-py-5 univer-shadow dark:!univer-bg-gray-900",borderClassName),children:[jsxs("div",{children:[i?jsx(FormLayout,{label:e.t("docs-hyper-link-ui.edit.label"),error:l&&isBlankInput(s)?e.t("docs-hyper-link-ui.edit.labelError"):"",children:jsx(Input,{value:s,onChange:c,autoFocus:!0,onKeyDown:e=>{e.keyCode===KeyCode.ENTER&&o()}})}):null,jsx(FormLayout,{label:e.t("docs-hyper-link-ui.edit.address"),error:l&&!r?e.t("docs-hyper-link-ui.edit.addressError"):"",children:jsx(Input,{value:d,onChange:a,autoFocus:!0,onKeyDown:e=>{e.keyCode===KeyCode.ENTER&&o()}})})]}),jsxs("div",{className:"univer-flex univer-justify-end univer-gap-3",children:[jsx(Button,{onClick:t,children:e.t("docs-hyper-link-ui.edit.cancel")}),jsx(Button,{variant:"primary",disabled:isBlankInput(d),onClick:o,children:e.t("docs-hyper-link-ui.edit.confirm")})]})]})};DocHyperLinkEdit.componentKey="docs-hyper-link-edit";const DocLinkPopup=()=>{var e,n,i,t,o;const r=useDependency(DocHyperLinkPopupService),s=useDependency(ICommandService),d=useDependency(IMessageService),c=useDependency(LocaleService),a=useObservable(r.showingLink$,r.showing),l=useDependency(IUniverInstanceService),p=useDependency(IPermissionService);if(!a)return null;const{unitId:u,linkId:v,segmentId:m,startIndex:I,endIndex:h}=a,g=l.getUnit(u,UniverInstanceType.UNIVER_DOC),_=g instanceof DocumentDataModel?null===(e=g.getSelfOrHeaderFooterModel(m))||void 0===e?void 0:e.getBody():void 0,y=null==_||null===(n=_.customRanges)||void 0===n?void 0:n.find(e=>e.rangeId===v&&e.rangeType===CustomRangeType.HYPERLINK&&e.startIndex===I&&e.endIndex===h);if(!y)return null;const f=(null===(i=y.properties)||void 0===i?void 0:i.url)??`#${(null===(t=y.properties)||void 0===t?void 0:t.bookmarkId)??(null===(o=y.properties)||void 0===o?void 0:o.headingId)??""}`,P=r.canEditLink(u,a),k=getDocumentPermissionValue(p,u,u,UnitAction.Copy);return jsxs("div",{className:clsx("univer-box-border univer-flex univer-max-w-80 univer-items-center univer-justify-between univer-overflow-hidden univer-rounded-lg univer-bg-gray-0 univer-p-3 univer-shadow dark:!univer-bg-gray-900",borderClassName),onPointerEnter:()=>{r.setInfoPopupHovered(!0)},onPointerLeave:()=>{r.setInfoPopupHovered(!1),r.scheduleHideInfoPopup()},onClick:()=>{r.hideInfoPopup()},children:[jsxs("div",{className:"univer-flex univer-h-6 univer-flex-1 univer-cursor-pointer univer-items-center univer-truncate univer-text-sm univer-leading-5 univer-text-primary-500",onClick:()=>s.executeCommand(ClickDocHyperLinkOperation.id,{unitId:u,linkId:v,segmentId:m}),children:[jsx("div",{className:"univer-mr-2 univer-flex univer-size-5 univer-flex-[0_0_auto] univer-items-center univer-justify-center univer-text-base univer-text-gray-900 dark:!univer-text-gray-0",children:jsx(LinkIcon,{})}),jsx(Tooltip,{showIfEllipsis:!0,title:f,children:jsx("span",{className:"univer-flex-1 univer-truncate",children:f})})]}),jsxs("div",{className:"univer-flex univer-h-6 univer-flex-[0_0_auto] univer-items-center univer-justify-center",children:[jsx(Button,{type:"button",variant:"text",size:"small","aria-label":c.t("docs-hyper-link-ui.info.copy"),className:"univer-ml-2 !univer-flex univer-size-6 !univer-rounded !univer-border-0 !univer-bg-transparent !univer-p-0 !univer-text-base !univer-font-normal hover:!univer-bg-transparent active:!univer-bg-transparent disabled:!univer-pointer-events-auto disabled:!univer-opacity-40",disabled:!k,onClick:()=>{navigator.clipboard.writeText(f),d.show({content:c.t("docs-hyper-link-ui.info.coped"),type:MessageType.Info})},children:jsx(Tooltip,{placement:"bottom",title:c.t("docs-hyper-link-ui.info.copy"),children:jsx(CopyIcon,{})})}),P&&jsxs(Fragment,{children:[jsx("div",{className:"univer-ml-2 univer-flex univer-size-6 univer-cursor-pointer univer-items-center univer-justify-center univer-rounded univer-text-base",onClick:()=>{s.executeCommand(ShowDocHyperLinkEditPopupOperation.id,{link:a})},children:jsx(Tooltip,{placement:"bottom",title:c.t("docs-hyper-link-ui.info.edit"),children:jsx(WriteIcon,{})})}),jsx("div",{className:"univer-ml-2 univer-flex univer-size-6 univer-cursor-pointer univer-items-center univer-justify-center univer-rounded univer-text-base",onClick:()=>{s.executeCommand(DeleteDocHyperLinkCommand.id,{unitId:u,linkId:y.rangeId,segmentId:m})},children:jsx(Tooltip,{placement:"bottom",title:c.t("docs-hyper-link-ui.info.cancel"),children:jsx(UnlinkIcon,{})})})]})]})]})};function _typeof(e){return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},_typeof(e)}function toPrimitive(e,n){if("object"!=_typeof(e)||!e)return e;var i=e[Symbol.toPrimitive];if(void 0!==i){var t=i.call(e,n||"default");if("object"!=_typeof(t))return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===n?String:Number)(e)}function toPropertyKey(e){var n=toPrimitive(e,"string");return"symbol"==_typeof(n)?n:n+""}function _defineProperty(e,n,i){return(n=toPropertyKey(n))in e?Object.defineProperty(e,n,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[n]=i,e}function __decorateParam(e,n){return function(i,t){n(i,t,e)}}function __decorate(e,n,i,t){var o,r=arguments.length,s=r<3?n:null===t?t=Object.getOwnPropertyDescriptor(n,i):t;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,n,i,t);else for(var d=e.length-1;d>=0;d--)(o=e[d])&&(s=(r<3?o(s):r>3?o(n,i,s):o(n,i))||s);return r>3&&s&&Object.defineProperty(n,i,s),s}DocLinkPopup.componentKey="univer.doc.link-info-popup";const INFO_POPUP_HIDE_DELAY=150,INFO_POPUP_REPLACEMENT_DELAY=200;function isSameLinkInfo(e,n){return(null==e?void 0:e.linkId)===n.linkId&&e.unitId===n.unitId&&(e.segmentId??"")===(n.segmentId??"")&&e.segmentPage===n.segmentPage&&e.startIndex===n.startIndex&&e.endIndex===n.endIndex}let DocHyperLinkPopupService=class extends Disposable{constructor(e,n,i,t,o,r,s,d){super(),this._docCanvasPopupManagerService=e,this._textSelectionManagerService=n,this._univerInstanceService=i,this._permissionService=t,this._renderManagerService=o,this._dialogService=r,this._localeService=s,this._commandService=d,_defineProperty(this,"_editingLink$",new BehaviorSubject(null)),_defineProperty(this,"_showingLink$",new BehaviorSubject(null)),_defineProperty(this,"editingLink$",this._editingLink$.asObservable()),_defineProperty(this,"showingLink$",this._showingLink$.asObservable()),_defineProperty(this,"_editPopup",null),_defineProperty(this,"_editPopupUnitId",null),_defineProperty(this,"_infoPopup",null),_defineProperty(this,"_infoPopupPinned",!1),_defineProperty(this,"_infoPopupHovered",!1),_defineProperty(this,"_infoPopupHideTimer",null),_defineProperty(this,"_infoPopupReplacement",null),_defineProperty(this,"_infoPopupSuppressed",!1),_defineProperty(this,"_infoPopupSuppressionTimer",null),this.disposeWithMe(()=>{this.cancelScheduledHideInfoPopup(),null!==this._infoPopupSuppressionTimer&&clearTimeout(this._infoPopupSuppressionTimer),this._editingLink$.complete(),this._showingLink$.complete()}),this.disposeWithMe(this._permissionService.permissionPointUpdate$.subscribe(()=>{const e=this.editing;e&&!this.canEditLink(e.unitId,e)&&this.hideEditPopup();const n=this.showing;n&&this._showingLink$.next({...n})})),this.disposeWithMe(this._renderManagerService.disposed$.subscribe(e=>{var n,i;(null===(n=this._infoPopupReplacement)||void 0===n?void 0:n.info.unitId)===e&&this._cancelScheduledInfoPopupReplacement(),this._editPopupUnitId===e&&this.hideEditPopup(),(null===(i=this.showing)||void 0===i?void 0:i.unitId)===e&&this.hideInfoPopup()}))}dispose(){this.hideEditPopup(),this.hideInfoPopup(),super.dispose()}get editing(){return this._editingLink$.value}get showing(){return this._showingLink$.value}get infoPopupPinned(){return this._infoPopupPinned}showEditPopup(e,n){var i;this._cancelScheduledInfoPopupReplacement();const t=this._univerInstanceService.getUnit(e,UniverInstanceType.UNIVER_DOC);if(t&&(null===(i=getEditorRuntimeConfig(t))||void 0===i?void 0:i.customHyperLinkUI))return null;if(!this.canEditLink(e,n))return null;this._editPopup&&(this._editPopup.dispose(),this._editPopup=null,this._editPopupUnitId=null),this._editingLink$.next(n);const o=this._textSelectionManagerService.getTextRanges({unitId:e,subUnitId:e});let r=null==o?void 0:o[o.length-1];if(n){const{segmentId:e,segmentPage:i,startIndex:t,endIndex:o}=n;r={collapsed:!1,startOffset:t,endOffset:o+1,segmentId:e,segmentPage:i},this._textSelectionManagerService.replaceDocRanges([{startOffset:t,endOffset:o+1}])}return r?(this._editPopup=this._openEditSurface(r,e),this._editPopupUnitId=e,this._editPopup):null}hideEditPopup(){this._editingLink$.next(null);const e=this._editPopup;this._editPopup=null,null==e||e.dispose(),this._editPopupUnitId=null}showInfoPopup(e,n){var i;const t=this._univerInstanceService.getUnit(e.unitId,UniverInstanceType.UNIVER_DOC);if(!(t instanceof DocumentDataModel)||(null===(i=getEditorRuntimeConfig(t))||void 0===i?void 0:i.customHyperLinkUI))return;if(this._cancelScheduledInfoPopupReplacement(),this.cancelScheduledHideInfoPopup(),this._infoPopupSuppressed)return;const{linkId:o,unitId:r,segmentId:s,segmentPage:d,startIndex:c,endIndex:a}=e;if(!isSameLinkInfo(this.showing,e))return this._infoPopup&&(this._infoPopup.dispose(),this._infoPopup=null),this._infoPopupPinned=(null==n?void 0:n.pinned)??!1,this._infoPopupHovered=!1,this._showingLink$.next({unitId:r,linkId:o,segmentId:s,segmentPage:d,startIndex:c,endIndex:a}),this._infoPopup=this._openInfoSurface(e),this._infoPopup;(null==n?void 0:n.pinned)&&(this._infoPopupPinned=!0)}_openEditSurface(e,n){return this._docCanvasPopupManagerService.attachPopupToRange(e,{componentKey:DocHyperLinkEdit.componentKey,direction:"bottom",offset:[0,10]},n)}_openInfoSurface(e,n=DocLinkPopup.componentKey){const{unitId:i,linkId:t,segmentId:o,segmentPage:r,startIndex:s,endIndex:d}=e;return this._docCanvasPopupManagerService.attachPopupToRange({collapsed:!1,startOffset:s,endOffset:d+1,segmentId:o,segmentPage:r},{componentKey:n,extraProps:{onEdit:()=>{this.hideInfoPopup(),this.showEditPopup(i,e)},onDelete:async()=>{await this._commandService.executeCommand(DeleteDocHyperLinkCommand.id,{unitId:i,linkId:t,segmentId:o})&&this.hideInfoPopup()}},direction:"top-center",multipleDirection:"top",offset:[0,10],onClickOutside:()=>{this.hideInfoPopup()}},i)}showInfoPopupFromHover(e){var n;if(this.cancelScheduledHideInfoPopup(),this._infoPopupPinned||this._infoPopupHovered||this._infoPopupSuppressed)return;if(!this.showing||isSameLinkInfo(this.showing,e))return void this.showInfoPopup(e);if(isSameLinkInfo((null===(n=this._infoPopupReplacement)||void 0===n?void 0:n.info)??null,e))return;this._cancelScheduledInfoPopupReplacement();const i={...e};this._infoPopupReplacement={info:i,timer:setTimeout(()=>{this._infoPopupReplacement=null,this.showInfoPopup(i)},200)}}setInfoPopupHovered(e){this._infoPopupHovered=e&&null!==this.showing,this._infoPopupHovered&&(this._cancelScheduledInfoPopupReplacement(),this.cancelScheduledHideInfoPopup())}_cancelScheduledInfoPopupReplacement(){this._infoPopupReplacement&&(clearTimeout(this._infoPopupReplacement.timer),this._infoPopupReplacement=null)}hideInfoPopup(){this._cancelScheduledInfoPopupReplacement(),this.cancelScheduledHideInfoPopup(),this._infoPopupPinned=!1,this._infoPopupHovered=!1,this._showingLink$.next(null);const e=this._infoPopup;this._infoPopup=null,null==e||e.dispose()}scheduleHideInfoPopup(){this._cancelScheduledInfoPopupReplacement(),this._infoPopupPinned||this._infoPopupHovered||!this.showing||(this.cancelScheduledHideInfoPopup(),this._infoPopupHideTimer=setTimeout(()=>{this._infoPopupHideTimer=null,this._infoPopupPinned||this.hideInfoPopup()},150))}cancelScheduledHideInfoPopup(){null!==this._infoPopupHideTimer&&(clearTimeout(this._infoPopupHideTimer),this._infoPopupHideTimer=null)}hideInfoPopupOnPointerDown(){this._infoPopupSuppressed=!0,null!==this._infoPopupSuppressionTimer&&clearTimeout(this._infoPopupSuppressionTimer),this.hideInfoPopup(),this._infoPopupSuppressionTimer=setTimeout(()=>{this._infoPopupSuppressed=!1,this._infoPopupSuppressionTimer=null},0)}canEditLink(e,n){const i=this._univerInstanceService.getUnit(e,UniverInstanceType.UNIVER_DOC);if(!(i instanceof DocumentDataModel))return!1;if(!n)return canEditDocumentTargets(this._permissionService,e,[]);const t=n.segmentId??"";return canEditDocumentTargets(this._permissionService,e,[...getDocumentEntityParentPermissionObjectIds(i,t,"custom-range",n.linkId),getDocumentEntityPermissionObjectId(t,"custom-range",n.linkId)])}};DocHyperLinkPopupService=__decorate([__decorateParam(0,Inject(DocCanvasPopManagerService)),__decorateParam(1,Inject(DocSelectionManagerService)),__decorateParam(2,IUniverInstanceService),__decorateParam(3,IPermissionService),__decorateParam(4,IRenderManagerService),__decorateParam(5,IDialogService),__decorateParam(6,Inject(LocaleService)),__decorateParam(7,ICommandService)],DocHyperLinkPopupService);const shouldDisableAddLink=e=>{const n=e.get(DocSelectionManagerService),i=e.get(IUniverInstanceService),t=n.getTextRanges();if(!(null==t?void 0:t.length))return!0;const o=t[0];return!(i.getCurrentUnitOfType(UniverInstanceType.UNIVER_DOC)&&o&&!o.collapsed)},ShowDocHyperLinkEditPopupOperation={type:CommandType.OPERATION,id:"doc.operation.show-hyper-link-edit-popup",handler(e,n){var i;const t=null==n?void 0:n.link,o=e.get(IUniverInstanceService);if(shouldDisableAddLink(e)&&!t)return!1;const r=e.get(DocHyperLinkPopupService),s=(null==t?void 0:t.unitId)||(null===(i=o.getCurrentUnitOfType(UniverInstanceType.UNIVER_DOC))||void 0===i?void 0:i.getUnitId());return!!s&&(r.showEditPopup(s,t??null),!0)}},ToggleDocHyperLinkInfoPopupOperation={type:CommandType.OPERATION,id:"doc.operation.toggle-hyper-link-info-popup",handler(e,n){const i=e.get(DocHyperLinkPopupService);return n?(n.fromHover?i.showInfoPopupFromHover(n):i.showInfoPopup(n),!0):(i.hideInfoPopup(),!0)}},ClickDocHyperLinkOperation={type:CommandType.OPERATION,id:"doc.operation.click-hyper-link",handler(e,n){var i,t;if(!n)return!1;const{unitId:o,linkId:r,segmentId:s}=n,d=e.get(IUniverInstanceService).getUnit(o,UniverInstanceType.UNIVER_DOC),c=null==d||null===(i=d.getSelfOrHeaderFooterModel(s))||void 0===i?void 0:i.getBody(),a=null==c||null===(t=c.customRanges)||void 0===t||null===(t=t.find(e=>e.rangeId===r&&e.rangeType===CustomRangeType.HYPERLINK))||void 0===t?void 0:t.properties;if((null==a?void 0:a.bookmarkId)||(null==a?void 0:a.headingId)){var l;const n=findInternalLinkTarget(null==d?void 0:d.getBody(),a.bookmarkId,a.headingId);if(null==n)return!1;const i={startOffset:n,endOffset:n,collapsed:!0},t=e.get(DocSelectionManagerService),r=()=>t.replaceDocRanges([i],{unitId:o,subUnitId:o},!1,{[DOC_SELECTION_OPTION_PRESERVE_CARET]:!0}),s=e.get(IRenderManagerService).getRenderUnitById(o),c=null==s||null===(l=s.getInjector)||void 0===l?void 0:l.call(s),p=(null==c?void 0:c.has(DocBackScrollRenderController))?null==s?void 0:s.with(DocBackScrollRenderController):null;return p?p.scrollToRange(i,r):r(),!0}return!(!(null==a?void 0:a.url)||!isSafeUrl(a.url))&&(window.open(a.url,"_blank","noopener noreferrer"),!0)}};function findInternalLinkTarget(e,n,i){if(e){if(n){var t;const i=null===(t=e.customRanges)||void 0===t?void 0:t.find(e=>{var i;return e.rangeType===CustomRangeType.BOOKMARK&&(e.rangeId===n||(null===(i=e.properties)||void 0===i?void 0:i.bookmarkId)===n)});if(i)return i.startIndex}if(i){var o;const n=(null===(o=e.paragraphs)||void 0===o?void 0:o.findIndex(e=>{var n;return(null===(n=e.paragraphStyle)||void 0===n?void 0:n.headingId)===i}))??-1;if(n>=0)return 0===n?0:e.paragraphs[n-1].startIndex+1}}}function AddHyperLinkMenuItemFactory(e){return{id:ShowDocHyperLinkEditPopupOperation.id,type:MenuItemType.BUTTON,icon:"LinkIcon",title:"docs-hyper-link-ui.menu.tooltip",tooltip:"docs-hyper-link-ui.menu.tooltip",hidden$:getMenuHiddenObservable(e,UniverInstanceType.UNIVER_DOC),disabled$:new Observable(function(n){const i=e.get(DocSelectionManagerService).textSelection$.pipe(debounceTime(16)).subscribe(()=>{n.next(shouldDisableAddLink(e))});return()=>{i.unsubscribe()}})}}const addLinkShortcut={id:ShowDocHyperLinkEditPopupOperation.id,binding:MetaKeys.CTRL_COMMAND|KeyCode.K,description:"docs-hyper-link-ui.menu.tooltip",preconditions:whenDocAndEditorFocused},menuSchema={[RibbonInsertGroup.MEDIA]:{[ShowDocHyperLinkEditPopupOperation.id]:{order:1,gridLayout:{row:1,column:5},menuItemFactory:AddHyperLinkMenuItemFactory}},[FLOAT_TOOLBAR_MENU_POSITION]:{[ShowDocHyperLinkEditPopupOperation.id]:{order:20,menuItemFactory:AddHyperLinkMenuItemFactory}},[ContextMenuPosition.MAIN_AREA]:{[ContextMenuGroup.DATA]:{[ShowDocHyperLinkEditPopupOperation.id]:{order:0,menuItemFactory:AddHyperLinkMenuItemFactory}}},[ContextMenuPosition.PARAGRAPH]:{[ContextMenuGroup.LAYOUT]:{[INSERT_BELLOW_MENU_ID]:{[ShowDocHyperLinkEditPopupOperation.id]:{order:6,menuItemFactory:AddHyperLinkMenuItemFactory}}},[EMPTY_PARAGRAPH_MENU_ID]:{[ContextMenuGroup.LAYOUT]:{[ShowDocHyperLinkEditPopupOperation.id]:{order:6,menuItemFactory:AddHyperLinkMenuItemFactory}}}}};var name="@univerjs/docs-hyper-link-ui",version="1.4.0";const DOCS_HYPER_LINK_UI_PLUGIN_CONFIG_KEY="docs-hyper-link-ui.config",configSymbol=Symbol("docs-hyper-link-ui.config"),defaultPluginConfig={};let DocHyperLinkSelectionController=class extends Disposable{constructor(e,n,i){super(),this._commandService=e,this._univerInstanceService=n,this._docHyperLinkService=i,_defineProperty(this,"_selection",null),this._initSelectionChange(),this.disposeWithMe(this._univerInstanceService.unitDisposed$.subscribe(e=>{var n;(null===(n=this._selection)||void 0===n?void 0:n.unitId)===e.getUnitId()&&(this._selection=null)}))}_initSelectionChange(){this.disposeWithMe(this._commandService.onCommandExecuted(e=>{var n;if(e.id!==RichTextEditingMutation.id){if(e.id===SetTextSelectionsOperation.id){var i;const n=e.params,{unitId:o,ranges:r,segmentId:s}=n,d=this._univerInstanceService.getUnit(o,UniverInstanceType.UNIVER_DOC),c=r[0],a=JSON.stringify([o,s??"",null==c?void 0:c.startOffset,null==c?void 0:c.endOffset,null==c?void 0:c.segmentPage]),l=a===(null===(i=this._selection)||void 0===i?void 0:i.key);this._selection={unitId:o,key:a};const p=this._docHyperLinkService.editing;if((null==p?void 0:p.unitId)===o&&(p.segmentId??"")===(s??"")&&(null==c?void 0:c.startOffset)===p.startIndex&&c.endOffset===p.endIndex+1)return;if(n.isEditing)return void this._docHyperLinkService.hideInfoPopup();if(l)return;if((null==c?void 0:c.collapsed)&&d){var t;const{startOffset:e,endOffset:n,segmentPage:i}=c,r=null===(t=d.getSelfOrHeaderFooterModel(s))||void 0===t||null===(t=t.getBody())||void 0===t?void 0:t.customRanges,a=this._docHyperLinkService.showing,l=((null==a?void 0:a.unitId)===o&&(a.segmentId??"")===s&&a.segmentPage===i&&a.endIndex===n-1?null==r?void 0:r.find(i=>i.rangeId===a.linkId&&i.rangeType===CustomRangeType.HYPERLINK&&i.startIndex<=e&&i.endIndex===n-1):void 0)??(null==r?void 0:r.find(i=>i.rangeType===CustomRangeType.HYPERLINK&&i.startIndex<=e&&i.endIndex>n-1));if(l)return void this._docHyperLinkService.showInfoPopup({unitId:o,linkId:l.rangeId,segmentId:s,segmentPage:i,startIndex:l.startIndex,endIndex:l.endIndex})}this._docHyperLinkService.hideInfoPopup(),this._docHyperLinkService.hideEditPopup()}}else e.params.unitId===(null===(n=this._docHyperLinkService.showing)||void 0===n?void 0:n.unitId)&&this._docHyperLinkService.hideInfoPopup()}))}};function MobileDocHyperLinkEdit(){const e=useDependency(LocaleService),{doc:n,editing:i,handleCancel:t,handleConfirm:o,isLegal:r,label:s,link:d,setLabel:c,setLink:a,showError:l}=useDocHyperLinkEdit();if(n)return jsxs("div",{className:"univer-box-border univer-w-full univer-bg-gray-0 univer-py-2 dark:!univer-bg-gray-900",children:[jsxs("div",{children:[i?jsx(FormLayout,{label:e.t("docs-hyper-link-ui.edit.label"),error:l&&isBlankInput(s)?e.t("docs-hyper-link-ui.edit.labelError"):"",children:jsx(Input,{value:s,onChange:c,autoFocus:!0,onKeyDown:e=>{e.keyCode===KeyCode.ENTER&&o()}})}):null,jsx(FormLayout,{label:e.t("docs-hyper-link-ui.edit.address"),error:l&&!r?e.t("docs-hyper-link-ui.edit.addressError"):"",children:jsx(Input,{value:d,onChange:a,autoFocus:!i,onKeyDown:e=>{e.keyCode===KeyCode.ENTER&&o()}})})]}),jsxs("div",{className:"univer-mt-5 univer-flex univer-gap-3",children:[jsx(Button,{className:"univer-h-12 univer-flex-1",onClick:t,children:e.t("docs-hyper-link-ui.edit.cancel")}),jsx(Button,{variant:"primary",className:"univer-h-12 univer-flex-1",disabled:isBlankInput(d),onClick:o,children:e.t("docs-hyper-link-ui.edit.confirm")})]})]})}function MobileDocLinkPopup(){var e,n,i;const t=useDependency(ICommandService),o=useDependency(DocHyperLinkPopupService),r=useDependency(LocaleService),s=useDependency(IMessageService),d=useDependency(IPermissionService),c=useDependency(IUniverInstanceService),a=useObservable(o.showingLink$,o.showing);if(!a)return null;const{unitId:l,linkId:p,segmentId:u,startIndex:v,endIndex:m}=a,I=c.getUnit(l,UniverInstanceType.UNIVER_DOC),h=I instanceof DocumentDataModel?null===(e=I.getSelfOrHeaderFooterModel(u))||void 0===e?void 0:e.getBody():void 0,g=null==h||null===(n=h.customRanges)||void 0===n?void 0:n.find(e=>e.rangeId===p&&e.rangeType===CustomRangeType.HYPERLINK&&e.startIndex===v&&e.endIndex===m);if(!g)return null;const _=null===(i=g.properties)||void 0===i?void 0:i.url,y=o.canEditLink(l,a),f=getDocumentPermissionValue(d,l,l,UnitAction.Copy);return jsxs("div",{className:"univer-flex univer-flex-col univer-gap-2 univer-py-2",children:[jsx(MobileActionRow,{title:jsx("span",{className:"univer-truncate univer-text-primary-600",children:_}),"aria-label":_,variant:"subtle",onClick:()=>window.open(_,void 0,"noopener noreferrer")}),f&&jsx(MobileActionRow,{title:r.t("docs-hyper-link-ui.info.copy"),"aria-label":r.t("docs-hyper-link-ui.info.copy"),variant:"subtle",onClick:()=>navigator.clipboard.writeText(_).then(()=>{s.show({content:r.t("docs-hyper-link-ui.info.coped"),type:MessageType.Info})}).catch(()=>{})}),y&&jsxs(Fragment,{children:[jsx(MobileActionRow,{title:r.t("docs-hyper-link-ui.info.edit"),"aria-label":r.t("docs-hyper-link-ui.info.edit"),variant:"subtle",onClick:()=>{t.executeCommand(ShowDocHyperLinkEditPopupOperation.id,{link:a}).catch(()=>{})}}),jsx(MobileActionRow,{title:r.t("docs-hyper-link-ui.info.cancel"),"aria-label":r.t("docs-hyper-link-ui.info.cancel"),variant:"subtle",onClick:()=>{t.executeCommand(DeleteDocHyperLinkCommand.id,{unitId:l,linkId:g.rangeId,segmentId:u}).catch(()=>{})}})]})]})}DocHyperLinkSelectionController=__decorate([__decorateParam(0,ICommandService),__decorateParam(1,IUniverInstanceService),__decorateParam(2,Inject(DocHyperLinkPopupService))],DocHyperLinkSelectionController),MobileDocHyperLinkEdit.componentKey="univer.doc.mobile-hyper-link-edit",MobileDocLinkPopup.componentKey="univer.doc.mobile-link-info-popup";let MobileComponentsController=class extends Disposable{constructor(e,n){super(),this._componentManager=e,this._iconManager=n,this._registerComponents(),this._registerIcons()}_registerComponents(){[[MobileDocHyperLinkEdit.componentKey,MobileDocHyperLinkEdit],[MobileDocLinkPopup.componentKey,MobileDocLinkPopup]].forEach(([e,n])=>{this.disposeWithMe(this._componentManager.register(e,n))})}_registerIcons(){this.disposeWithMe(this._iconManager.register({LinkIcon:LinkIcon}))}};MobileComponentsController=__decorate([__decorateParam(0,Inject(ComponentManager)),__decorateParam(1,Inject(IconManager))],MobileComponentsController);let MobileDocHyperLinkEventRenderController=class extends Disposable{get _skeleton(){return this._docSkeletonManagerService.getSkeleton()}constructor(e,n,i,t,o,r){super(),this._context=e,this._docEventManagerService=n,this._commandService=i,this._hyperLinkPopupService=t,this._docSkeletonManagerService=o,this._mobileElementMenuService=r,this._context.unitId!==DOCS_NORMAL_EDITOR_UNIT_ID_KEY&&(this._initPointerDown(),this._initClick())}_initPointerDown(){this.disposeWithMe(this._docEventManagerService.pointerDownCustomRanges$.subscribe(e=>{const n=e.find(e=>e.range.rangeType===CustomRangeType.HYPERLINK);if(!n)return void this._hyperLinkPopupService.hideInfoPopupOnPointerDown();const i={unitId:this._context.unitId,linkId:n.range.rangeId,segmentId:n.segmentId,segmentPage:n.segmentPageIndex,startIndex:n.range.startIndex,endIndex:n.range.endIndex},t=n.rects[0];t&&this._hyperLinkPopupService.canEditLink(i.unitId,i)&&this._mobileElementMenuService.capture({unitId:i.unitId,rect:t,onEdit:()=>this._hyperLinkPopupService.showEditPopup(i.unitId,i),onDelete:()=>this._commandService.executeCommand(DeleteDocHyperLinkCommand.id,i)})}))}_initClick(){this.disposeWithMe(this._docEventManagerService.clickCustomRanges$.subscribe(e=>{const n=e.range;n.rangeType===CustomRangeType.HYPERLINK&&(e.ctrlKey||e.metaKey?this._commandService.executeCommand(ClickDocHyperLinkOperation.id,{unitId:this._context.unitId,linkId:n.rangeId,segmentId:e.segmentId}):this._hyperLinkPopupService.showInfoPopup({unitId:this._context.unitId,linkId:n.rangeId,segmentId:e.segmentId,segmentPage:e.segmentPageIndex,startIndex:n.startIndex,endIndex:n.endIndex},{pinned:!0}))}))}};MobileDocHyperLinkEventRenderController=__decorate([__decorateParam(1,Inject(DocEventManagerService)),__decorateParam(2,ICommandService),__decorateParam(3,Inject(DocHyperLinkPopupService)),__decorateParam(4,Inject(DocSkeletonManagerService)),__decorateParam(5,Inject(DocMobileElementMenuService))],MobileDocHyperLinkEventRenderController);let DocHyperLinkRenderController=class extends Disposable{constructor(e,n,i){super(),this._docInterceptorService=n,this._hyperLinkService=i,this._init()}_init(){this._docInterceptorService.intercept(DOC_INTERCEPTOR_POINT.CUSTOM_RANGE,{handler:(e,n,i)=>{if(!e)return i(e);const{unitId:t,index:o}=n,r=this._hyperLinkService.showing;if(!r)return i({...e,active:!1});const{linkId:s,unitId:d,startIndex:c,endIndex:a}=r,l=d===t&&e.rangeId===s&&o>=c&&o<=a;return i({...e,active:l})}})}};DocHyperLinkRenderController=__decorate([__decorateParam(1,Inject(DocInterceptorService)),__decorateParam(2,Inject(DocHyperLinkPopupService))],DocHyperLinkRenderController);let DocHyperLinkUIController=class extends Disposable{constructor(e,n,i){super(),this._commandService=e,this._menuManagerService=n,this._shortcutService=i,this._initCommands(),this._initMenus(),this._initShortcut()}_initCommands(){[AddDocHyperLinkCommand,UpdateDocHyperLinkCommand,DeleteDocHyperLinkCommand,ShowDocHyperLinkEditPopupOperation,ToggleDocHyperLinkInfoPopupOperation,ClickDocHyperLinkOperation].forEach(e=>{this._commandService.registerCommand(e)})}_initShortcut(){[addLinkShortcut].forEach(e=>{this._shortcutService.registerShortcut(e)})}_initMenus(){this._menuManagerService.appendRootMenu({[FLOAT_TOOLBAR_MENU_POSITION]:{}}),this._menuManagerService.mergeMenu(menuSchema)}};DocHyperLinkUIController=__decorate([__decorateParam(0,ICommandService),__decorateParam(1,IMenuManagerService),__decorateParam(2,IShortcutService)],DocHyperLinkUIController);var MobileDocHyperLinkPopupService=class extends DocHyperLinkPopupService{_openEditSurface(e,n){return this._dialogService.open({id:"doc-mobile-hyper-link-editor",title:{title:this._localeService.t("docs-hyper-link-ui.menu.tooltip")},children:{label:MobileDocHyperLinkEdit.componentKey},maskClosable:!1,onClose:()=>this.hideEditPopup()})}_openInfoSurface(e){return this.canEditLink(e.unitId,e)?super._openInfoSurface(e,MOBILE_DOC_ELEMENT_MENU):this._dialogService.open({id:"doc-mobile-hyper-link-viewer",title:{title:this._localeService.t("docs-hyper-link-ui.menu.tooltip")},children:{label:MobileDocLinkPopup.componentKey},onClose:()=>this.hideInfoPopup()})}};const DOC_HYPER_LINK_UI_PLUGIN="DOC_HYPER_LINK_UI_PLUGIN";let UniverDocsHyperLinkMobileUIPlugin=class extends Plugin{constructor(e=defaultPluginConfig,n,i,t){super(),this._config=e,this._injector=n,this._renderManagerSrv=i,this._configService=t;const{menu:o,...r}=merge({},defaultPluginConfig,this._config);o&&this._configService.setConfig("menu",o,{merge:!0}),this._configService.setConfig("docs-hyper-link-ui.config",r)}onStarting(){[[MobileComponentsController],[DocHyperLinkPopupService,{useClass:MobileDocHyperLinkPopupService}],[DocHyperLinkUIController],[DocHyperLinkSelectionController]].forEach(e=>this._injector.add(e)),this._injector.get(MobileComponentsController),this._injector.get(DocHyperLinkUIController)}onReady(){this._injector.get(DocHyperLinkSelectionController)}onRendered(){[[DocHyperLinkRenderController],[MobileDocHyperLinkEventRenderController]].forEach(e=>{this._renderManagerSrv.registerRenderModule(UniverInstanceType.UNIVER_DOC,e)})}};_defineProperty(UniverDocsHyperLinkMobileUIPlugin,"pluginName",DOC_HYPER_LINK_UI_PLUGIN),_defineProperty(UniverDocsHyperLinkMobileUIPlugin,"packageName",name),_defineProperty(UniverDocsHyperLinkMobileUIPlugin,"version",version),_defineProperty(UniverDocsHyperLinkMobileUIPlugin,"type",UniverInstanceType.UNIVER_DOC),UniverDocsHyperLinkMobileUIPlugin=__decorate([DependentOn(UniverDocsPlugin,UniverRenderEnginePlugin,UniverDocsHyperLinkPlugin,UniverDocsMobileUIPlugin),__decorateParam(1,Inject(Injector)),__decorateParam(2,IRenderManagerService),__decorateParam(3,IConfigService)],UniverDocsHyperLinkMobileUIPlugin);let ComponentsController=class extends Disposable{constructor(e,n){super(),this._componentManager=e,this._iconManager=n,this._registerComponents(),this._registerIcons()}_registerComponents(){[[DocHyperLinkEdit.componentKey,DocHyperLinkEdit],[DocLinkPopup.componentKey,DocLinkPopup]].forEach(([e,n])=>{this.disposeWithMe(this._componentManager.register(e,n))})}_registerIcons(){this.disposeWithMe(this._iconManager.register({LinkIcon:LinkIcon}))}};ComponentsController=__decorate([__decorateParam(0,Inject(ComponentManager)),__decorateParam(1,Inject(IconManager))],ComponentsController);let DocHyperLinkEventRenderController=class extends Disposable{get _skeleton(){return this._docSkeletonManagerService.getSkeleton()}constructor(e,n,i,t,o,r){var s;super(),this._context=e,this._docEventManagerService=n,this._commandService=i,this._hyperLinkPopupService=t,this._docSkeletonManagerService=o,this._docSelectionManagerService=r,this._context.unitId===DOCS_NORMAL_EDITOR_UNIT_ID_KEY||(null===(s=getEditorRuntimeConfig(this._context.unit))||void 0===s?void 0:s.customHyperLinkUI)||(this._initPointerDown(),this._initHover(),this._initClick())}_hideInfoPopup(){this._hyperLinkPopupService.infoPopupPinned||this._hyperLinkPopupService.showing&&this._hyperLinkPopupService.scheduleHideInfoPopup()}_normalizeSegmentId(e){var n;return e?(null===(n=this._context.unit.getBody())||void 0===n||null===(n=n.tables)||void 0===n?void 0:n.some(n=>n.tableId===e))?"":e:""}_initPointerDown(){this.disposeWithMe(this._docEventManagerService.pointerDownCustomRanges$.subscribe(e=>{e.find(e=>e.range.rangeType===CustomRangeType.HYPERLINK)||this._hyperLinkPopupService.hideInfoPopupOnPointerDown()}))}_initHover(){this.disposeWithMe(this._docEventManagerService.hoverCustomRanges$.subscribe(e=>{var n;const i=e.find(e=>e.range.rangeType===CustomRangeType.HYPERLINK),t=this._docSelectionManagerService.getTextRanges(),o=null==t||null===(n=t[0])||void 0===n?void 0:n.segmentId;if(this._normalizeSegmentId(null==i?void 0:i.segmentId)===this._normalizeSegmentId(o))if(i){const e={unitId:this._context.unitId,linkId:i.range.rangeId,segmentId:i.segmentId,segmentPage:i.segmentPageIndex,startIndex:i.range.startIndex,endIndex:i.range.endIndex};this._commandService.executeCommand(ToggleDocHyperLinkInfoPopupOperation.id,{...e,fromHover:!0})}else this._hideInfoPopup();else this._hideInfoPopup()}))}_initClick(){this.disposeWithMe(this._docEventManagerService.clickCustomRanges$.subscribe(e=>{const n=e.range;n.rangeType===CustomRangeType.HYPERLINK&&(e.ctrlKey||e.metaKey?this._commandService.executeCommand(ClickDocHyperLinkOperation.id,{unitId:this._context.unitId,linkId:n.rangeId,segmentId:e.segmentId}):this._hyperLinkPopupService.showInfoPopup({unitId:this._context.unitId,linkId:n.rangeId,segmentId:e.segmentId,segmentPage:e.segmentPageIndex,startIndex:n.startIndex,endIndex:n.endIndex},{pinned:!0}))}))}};DocHyperLinkEventRenderController=__decorate([__decorateParam(1,Inject(DocEventManagerService)),__decorateParam(2,ICommandService),__decorateParam(3,Inject(DocHyperLinkPopupService)),__decorateParam(4,Inject(DocSkeletonManagerService)),__decorateParam(5,Inject(DocSelectionManagerService))],DocHyperLinkEventRenderController);let UniverDocsHyperLinkUIPlugin=class extends Plugin{constructor(e=defaultPluginConfig,n,i,t){super(),this._config=e,this._injector=n,this._renderManagerSrv=i,this._configService=t;const{menu:o,...r}=merge({},defaultPluginConfig,this._config);o&&this._configService.setConfig("menu",o,{merge:!0}),this._configService.setConfig("docs-hyper-link-ui.config",r)}onStarting(){[[ComponentsController],[DocHyperLinkPopupService],[DocHyperLinkUIController],[DocHyperLinkSelectionController]].forEach(e=>{this._injector.add(e)}),this._injector.get(ComponentsController),this._injector.get(DocHyperLinkUIController)}onReady(){this._injector.get(DocHyperLinkSelectionController)}onRendered(){this._initRenderModule()}_initRenderModule(){[[DocHyperLinkRenderController],[DocHyperLinkEventRenderController]].forEach(e=>{this._renderManagerSrv.registerRenderModule(UniverInstanceType.UNIVER_DOC,e)})}};_defineProperty(UniverDocsHyperLinkUIPlugin,"pluginName",DOC_HYPER_LINK_UI_PLUGIN),_defineProperty(UniverDocsHyperLinkUIPlugin,"packageName",name),_defineProperty(UniverDocsHyperLinkUIPlugin,"version",version),_defineProperty(UniverDocsHyperLinkUIPlugin,"type",UniverInstanceType.UNIVER_DOC),UniverDocsHyperLinkUIPlugin=__decorate([DependentOn(UniverDocsPlugin,UniverRenderEnginePlugin,UniverDocsHyperLinkPlugin,UniverDocsUIPlugin),__decorateParam(1,Inject(Injector)),__decorateParam(2,IRenderManagerService),__decorateParam(3,IConfigService)],UniverDocsHyperLinkUIPlugin);export{menuSchema as DocsHyperLinkUIMenuSchema,UniverDocsHyperLinkMobileUIPlugin,UniverDocsHyperLinkUIPlugin};
//# sourceMappingURL=/sm/83d54bf52c7541f2fe8847e3fd020bbac351c6aa78f0038864f06b263d0e25a4.map