/*************************************************************************
* ADOBE CONFIDENTIAL
* ___________________
*
*  Copyright 2014 Adobe Systems Incorporated
*  All Rights Reserved.
*
* NOTICE:  All information contained herein is, and remains
* the property of Adobe Systems Incorporated and its suppliers,
* if any.  The intellectual and technical concepts contained
* herein are proprietary to Adobe Systems Incorporated and its
* suppliers and are protected by all applicable intellectual property laws,
* including trade secret and or copyright laws.
* Dissemination of this information or reproduction of this material
* is strictly forbidden unless prior written permission is obtained
* from Adobe Systems Incorporated.
**************************************************************************/

/*************************************************************************
* ADOBE CONFIDENTIAL
* ___________________
*
*  Copyright 2013 Adobe Systems Incorporated
*  All Rights Reserved.
*
* NOTICE:  All information contained herein is, and remains
* the property of Adobe Systems Incorporated and its suppliers,
* if any.  The intellectual and technical concepts contained
* herein are proprietary to Adobe Systems Incorporated and its
* suppliers and are protected by all applicable intellectual property laws,
* including trade secret and or copyright laws.
* Dissemination of this information or reproduction of this material
* is strictly forbidden unless prior written permission is obtained
* from Adobe Systems Incorporated.
**************************************************************************/

/*************************************************************************
* ADOBE CONFIDENTIAL
* ___________________
*
*  Copyright 2015 Adobe Systems Incorporated
*  All Rights Reserved.
*
* NOTICE:  All information contained herein is, and remains
* the property of Adobe Systems Incorporated and its suppliers,
* if any.  The intellectual and technical concepts contained
* herein are proprietary to Adobe Systems Incorporated and its
* suppliers and are protected by all applicable intellectual property laws,
* including trade secret and or copyright laws.
* Dissemination of this information or reproduction of this material
* is strictly forbidden unless prior written permission is obtained
* from Adobe Systems Incorporated.
**************************************************************************/

/*************************************************************************
*
* ADOBE CONFIDENTIAL
* ___________________
*
*  Copyright 2014 Adobe Systems Incorporated
*  All Rights Reserved.
*
* NOTICE:  All information contained herein is, and remains
* the property of Adobe Systems Incorporated and its suppliers,
* if any.  The intellectual and technical concepts contained
* herein are proprietary to Adobe Systems Incorporated and its
* suppliers and may be covered by U.S. and Foreign Patents,
* patents in process, and are protected by trade secret or copyright law.
* Dissemination of this information or reproduction of this material
* is strictly forbidden unless prior written permission is obtained
* from Adobe Systems Incorporated.
**************************************************************************/

define("pdmplugins/desktop-connector-files/js/ac-desktop-connector-files",["plugins-common/ac-plugins"],function(e){var i=e.DesktopConnectorFiles;return i||(i=e.DesktopConnectorFiles={}),i.PLUGIN_ID||(i.PLUGIN_ID="desktop_connector_files"),i}),define("pdmplugins/desktop-connector-files-select/js/ac-desktop-connector-files-select",["plugins-common/ac-plugins"],function(e){var i=e.DesktopConnectorFilesSelect;return i||(i=e.DesktopConnectorFilesSelect={}),i.PLUGIN_ID||(i.PLUGIN_ID="desktop_connector_files_select"),i}),define("acplugins/my-files/js/ac-my-files",["plugins-common/ac-plugins"],function(e){var i=e.MyFiles;return i||(i=e.MyFiles={}),i}),define("acplugins/my-files/js/ops/plugin/initializing-plugin-op",["core/ac-core","files/ac-files","plugins-common/ac-plugins","acplugins/my-files/js/ac-my-files","core/ops/op"],function(e,i,t,n){return n.InitializingPluginOp=e.Op.extend({run:function(){var n,o,s,r,l=this.options,c=l.appApi,p=c.pluginsApi;n=e.modelFactory,o=e.uiModelFactory,s=i.uiModelFactory,_.extend(l,{fileUploadModel:n.create("FileUploadModel"),notificationModel:n.create("NotificationModel"),sessionModel:n.create("SessionModel"),collectionsUiModel:o.create("CollectionsUiModel"),dialogsUiModel:o.create("DialogsUiModel"),errorUiModel:o.create("ErrorUiModel"),fileUploadUiModel:o.create("FileUploadUiModel"),folderUiModel:o.create("FolderUiModel"),hoverPreviewUiModel:o.create("HoverPreviewUiModel"),rhpPreviewUiModel:o.create("RhpPreviewUiModel"),selectionActionsPluginsUiModel:o.create("PluginsUiModel"),keyUiModel:o.create("KeyUiModel"),menusUiModel:o.create("MenusUiModel"),sortUiModel:o.create("SortUiModel"),filesUiModel:s.create("FilesUiModel"),sharingUiModel:s.create("SharingUiModel")}),l.noFullPreviewImpl||_.extend(l,{fullPreviewUiModel:o.create("FullPreviewUiModel"),fullPreviewOverlaysUiModel:o.create("PluginsUiModel"),fullPreviewPluginsUiModel:o.create("PluginsUiModel"),fullPreviewRhpPluginsUiModel:o.create("PluginsUiModel")}),p.isInSearchResultsView()?(_.extend(l,{noSearchControl:!0,noSort:!0,noNewFolder:!0,noFilter:!0,isInSearchResultsView:!0}),l.filesUiModel.set("view",i.FilesUiModel.VIEW_SEARCH_RESULTS)):_.extend(l,{searchModel:n.create("SearchModel",{},this.options),searchUiModel:o.create("SearchUiModel"),selectionUiModel:o.create("SelectionUiModel")}),l.noSelectionActions||(r=p.getPluginTypeConfig("file_selection_actions"),_.extend(l,{actualPluginIds:[]}),_.each(r.plugin_ids,function(e){var i=p.getPluginGroupId(e);e=e+"-"+l.pluginId,l.actualPluginIds.push(e),p.registerPluginsUiModel(e,l.selectionActionsPluginsUiModel),p.addPluginsConfig(e,t.types.file_selection_actions),p.setPluginGroupId(e,i)}),p.registerPluginsUiModel(p.getPluginTypeConfig("file_selection_actions"),l.selectionActionsPluginsUiModel));var d=new $.Deferred,a=l.appApi.connectorsApi,u=a.isConnectorRemovable(a.getConnectorPluginName(l.pluginId));return u?(_.extend(l,{folderModel:n.create("FolderModel")}),d.resolve()):l.appApi.discoveryUrisApi.checkDCAPIEnabled().done(_.bind(function(){l.appApi.discoveryUrisApi.useDCApi()?_.extend(l,{folderModel:n.create("FolderModelDCAPI")}):_.extend(l,{folderModel:n.create("FolderModel")}),d.resolve()})),d.promise()}}),n.InitializingPluginOp}),define("acplugins/my-files/js/ops/plugin/running-plugin-op",["core/ac-core","files/ac-files","acplugins/my-files/js/ac-my-files","core/ops/op"],function(e,i,t){t.RunningPluginOp=e.Op.extend({run:function(){var e,t,n,o,s,r,l,c=this.options;return e=i.opFactory,t=e.create("ListeningForSelectionChangeOp",c),n=e.create("ListeningForViewEventsOp",c),s=e.create("ListeningForSearchInvalidationOp",c),o=e.create("ListeningForSearchQueriesChangeOp",c),r=c.noNotifications?this._getResolvedPromise():e.create("ListeningForCurrentFolderNotificationsOp",c).run(),l=c.noNotifications?this._getResolvedPromise():e.create("ListeningForDupErrorsOp",c).run(),$.when(t.run(),n.run(),s.run(),o.run(),r,l)}})}),define("acplugins/my-files/js/ops/plugin/starting-plugin-op",["core/ac-core","files/ac-files","acplugins/my-files/js/ac-my-files","core/utils/util","core/ops/op"],function(e,i,t,n){t.StartingPluginOp=e.Op.extend({run:function(){var o,s,r=this.options,l=r.appApi,c=i.opFactory,p=$.Deferred();return n.isCEF()||c.create("RestoringFilesPrefsOp",r).run(),c.create("InitializingAcrobatOp",r).run(),t.opFactory.create("RunningPluginOp",r).run(),r.noSelectionActions||e.opFactory.create("LoadingSelectionActionsOp",r).run(),o=r.pluginId,s=l.pluginsApi.getDefaultPluginId("file_selection_dlg"),!l.saveAsApi.isRunningInFileSaveAs()||s!==o||"root-select"!==o&&"ccloud-select"!==o?this._getResolvedPromise():(r.readerContextModel.done(_.bind(function(e){var i=e.get("rna"),t=i.get("viewData").get("fileSelectData");t.invoke("getFileAncestors",[]).done(_.bind(function(e){_.isUndefined(e)||0===e.length||(l.folderApi.setCurrentFolderId(o,e),l.saveAsApi.setCurrentFolderId(e)),p.resolve()},this))},this)),p.promise())}})}),define("acplugins/my-files/js/ops/op-factory",["core/ac-core","acplugins/my-files/js/ac-my-files","acplugins/my-files/js/ops/plugin/initializing-plugin-op","acplugins/my-files/js/ops/plugin/running-plugin-op","acplugins/my-files/js/ops/plugin/starting-plugin-op"],function(e,i){i.OpFactory=e.Op.extend({create:function(e,t){var n=i[e];return n?new n(t):void LOG(0,"AcMyFiles.OpFactory.create: Unrecognized class: "+e)}})}),define("acplugins/ac-bh",[],function(){var e=Ac.Bh;return e||(e=Ac.Bh={}),e}),define("acplugins/build-num",{pluginBuildNumber:"000001"}),define("acplugins/my-files/js/nls/ui-strings",{root:!0,"xx-xx":!0,"de-de":!0,"en-gb":!0,"es-es":!0,"fr-fr":!0,"it-it":!0,"ja-jp":!0,"da-dk":!0,"fi-fi":!0,"nb-no":!0,"nl-nl":!0,"pt-br":!0,"sv-se":!0,"zh-cn":!0,"zh-tw":!0,"ko-kr":!0,"cs-cz":!0,"hu-hu":!0,"pl-pl":!0,"ru-ru":!0,"uk-ua":!0,"tr-tr":!0,"sk-sk":!0,"sl-si":!0,"bg-bg":!0}),define("acplugins/my-files/js/nls/root/ui-strings",{FOOTER_ANCHOR:"Go to Adobe Document Cloud Website",NOTIFICATION_HEADING:"<%= cloudName %> Files",CLOUD_NAME:"Adobe cloud storage",UNSUPPORTED_CONNECTOR_MSG:"<%= actionName %> is currently not supported for files stored in <%= connectorLabel %>."}),define("acplugins/bh-plugin-view",["core/ac-core","acplugins/ac-bh","core/views/plugin-content-view"],function(e,i){return i.PluginView=e.PluginContentView.extend({getAppApiVersion:function(){return Ac.Plugins.groups.blue_heron.FRAMEWORK_VERSION}}),i.PluginView}),define("acplugins/my-files/js/views/plugin-view",["core/ac-core","files/ac-files","plugins-common/ac-plugins","acplugins/ac-bh","acplugins/my-files/js/ac-my-files","core/utils/sc-analytics","acplugins/build-num","core/utils/router-util","core/utils/action-ids","i18n!files/nls/ui-strings","i18n!core/nls/ui-strings","core/utils/file-types","core/utils/util","core/utils/string-util","i18n!acplugins/my-files/js/nls/ui-strings","acplugins/bh-plugin-view","files/views/files-container-view"],function(e,i,t,n,o,s,r,l,c,p,d,a,u,h,g){return o.PluginView=n.PluginView.extend({initialize:function(){n.PluginView.prototype.initialize.call(this),u.isCEF()&&_.extend(this.options,{noUpload:!0,noHoverPreview:!0,noNewFolder:!1,folderDeletionDisabled:!1,noDownload:!0,noShare:!1,noShareButton:!1,footerAnchorText:void 0})},render:function(){var e=this.options;e.appApi.displayApi.applyUIThemeStyles(this.$el).then(_.bind(function(){n.PluginView.prototype.render.call(this),this._renderChildViews(),this._isListeningForFileUploadEvents||(i.opFactory.create("ListeningForFileUploadEventsOp",e).run(),this._isListeningForFileUploadEvents=!0)},this)),!e.appApi.selectionApi.isRunningInFileSelection()||"root-select"!==e.pluginId&&"ccloud-select"!==e.pluginId||e.appApi.rnaApi.done(function(e){e.logAnayticsCustomOpenSave("Time_To_Show_Dialog_View_Connector_File_List")}),e.forRecentFileListing&&this.options.appApi.rnaApi.done(_.bind(function(e){e.fileApi({methodName:"getSelectedRecentFileData"}).done(_.bind(function(){},this))},this))},events:function(){return u.isCEF()?_.extend({},e.View.prototype.events,{changeNetworkStateFromFeat:"_onNetworkStateChangeFromFeat"}):void 0},initPlugin:function(){return this._initPlugin()},selectPlugin:function(t){var n,o,s,r,l,d=this.options,a=d.fullPreviewUiModel,h=d.appApi.routerApi,f=d.appApi.connectorsApi,v=d.appApi.pluginsApi,m=d.appApi.folderApi,A=d.appApi.sessionApi,w=d.appApi.networkConnectivityApi,C=d.appApi.displayApi,F=this.options.rnaRecentFilesSelect,E=u.isCEF();this.options.appApi.done(_.bind(function(){},this));var y=this.options.appApi.routerApi.parseQueryParams(window.location.href.slice(window.location.href.indexOf("?")));if(E&&(t&&(this._pluginOptions=t),d.isInSearchResultsView&&(d.searchModel=this._pluginOptions.searchModel,d.searchUiModel=this._pluginOptions.searchUiModel,d.selectionUiModel=this._pluginOptions.selectionUiModel,d.ussSearchModel=this._pluginOptions.ussSearchModel,d.selectionUiModel.set("multiple_selection",!t.singleFileSelection),d.collectionsUiModel.set("checkbox",!t.singleFileSelection),"root"===d.pluginId?(d.sortUiModel.set("order_by","modified"),d.sortUiModel.set("mru_date_order","modified")):d.sortUiModel.set("order_by","none")),d.forRecentFileListing="true"==y.forRecentFileListing?!0:!1,w.removeNetworkOnlineChangeCallback(this._onOnlineChanged),w.addNetworkOnlineChangeCallback(this._onOnlineChanged),d.appApi.rnaApi.done(_.bind(function(e){e.isFeatRunning()&&e.isASTestAllowInstantiation()&&w.addNetworkConnectivtyChangeCallback(this._onOnlineChanged)},this)),!w.isOnline()&&!F||!A.isSignedInReader()&&!F))return A.removeSignedInChangeCallback(this._onSignedInChange),A.addSignedInChangeCallback(this._onSignedInChange),this._isSelected=!0,d.isInSearchResultsView&&e.opFactory.create("LoadingSelectionActionsOp",d).run(),this.render(),this.options.appApi.displayApi.showSpinner(!1),this._getResolvedPromise();if(t=t||this.getPluginOptions(),t&&(this._setParentScContext(t.scContext),n=t.routeFolderId,o=t.routeViewType,s=t.routeFilesFilters,r=t.routeFileId),n)d.folderUiModel.set("route_folder_id",n),d.searchUiModel.removeAllFieldQueries();else if(s)d.searchUiModel.removeAllFieldQueries(),d.searchUiModel.setFieldQueriesPath(s),d.sortUiModel.setSortFromQueryParams(h.getQueryParams());else if(E&&this._isSelected)return F||(A.removeSignedInChangeCallback(this._onSignedInChange),A.addSignedInChangeCallback(this._onSignedInChange)),this.render(),this._getResolvedPromise();return this._isSelected=!0,E&&!d.isInSearchResultsView,this._startPlugin().then(function(){return F?$.Deferred().resolve().promise():A.ensureSignedIn()}).then(_.bind(function(){var n,s=t&&t.singleFileSelection,u=d.pluginId,w=v.getPluginUiModel(u),y=w.get("connector_name"),P=t&&t.selectedToolPlugin||v.getSelectedPluginId("tools"),S=c.toolIdsToActionIds[P],O=c.toolIdsToActionNames[P],I=f.getConnectorPluginLabel(u);return E&&(this.options.isInSearchResultsView||i.opFactory.create("RestoringFilesPrefsOp",d).run(),F||(A.removeSignedInChangeCallback(this._onSignedInChange),A.addSignedInChangeCallback(this._onSignedInChange)),"root"===y?f.setConnectorPluginRoot(u,m.getRootFolderId(u)):(this.options.footerAnchorText=void 0,this.options.noShare=!0,this.options.noShareButton=!0)),d.selectionUiModel.set("multiple_selection",!s),d.collectionsUiModel.set("checkbox",!s),o&&d.collectionsUiModel.set("view",o),(E||e.Features.isFeatureEnabled("no_collection_item_checkbox")&&h.hasQueryParam("no_collection_item_checkbox","1"))&&d.collectionsUiModel.set("checkbox",!1),this._initFilter(t),this._configureActions(y),this.render(),d.fileUploadUiModel.startListening(),r?(a.isFileOpen(r)||(a.close({silent:!0}),i.opFactory.create("OpeningFullPreviewOp",_.extend({},d,{id:r})).run()),void(E&&C.showSpinner(!1))):f.isConnectorPlugin(u)&&!f.getConnectorPluginRoot(u)?(h.navigate(y),E&&C.showSpinner(!1),this._getResolvedPromise()):d.noUrlUpdate&&f.isActionRestricted(y,S)?(O&&I&&(n=v.getSelectorApi(P),n&&n.getSelectorLabel&&(O=n.getSelectorLabel(),O&&""!==O||(O=c.toolIdsToActionNames[P])),l=_.template(E?g.UNSUPPORTED_CONNECTOR_MSG:p.UNSUPPORTED_CONNECTOR_MSG,{actionName:O,connectorLabel:I}),d.collectionsUiModel.set("force_empty_msg",l)),d.collectionsUiModel.set("force_empty",!0),d.sortUiModel.set("is_locked",!0),d.searchUiModel.set("is_locked",!0),E&&C.showSpinner(!1),this._getResolvedPromise()):(t&&(d=_.extend({},d,_.pick(t,"noHistoryEffect"))),this._runSearchOp(d))},this),_.bind(function(e){if(E){if(C.showSpinner(!1),e&&"NoAccessToPdfServices"===e.errorString)return A.removeSignedInChangeCallback(this._onSignedInChange),A.addSignedInChangeCallback(this._onSignedInChange),this._isSelected=!0,this.render(),this._getResolvedPromise();0===this.$el.children().length&&v.handleServerOutageFailure()}},this))},deselectPlugin:function(){var i=this.options,t=i.appApi.networkConnectivityApi;u.isCEF()&&t.removeNetworkOnlineChangeCallback(this._onOnlineChanged),e.PluginContentView.prototype.deselectPlugin.call(this),this._isSelected=!1},remove:function(){this.deselectPlugin(),e.PluginContentView.prototype.remove.call(this)},releasePlugin:function(){var e=this.options,i=this.options.appApi.folderApi;n.PluginView.prototype.releasePlugin.call(this),u.isCEF()&&(this._unsetPluginRoot(),i.setCurrentFolderId(e.pluginId,void 0),e.folderModel.unset("name"),this._pluginOptions=_.omit(this._pluginOptions,"routeFolderId","routeFilesFilters","routeFileId")),e.folderModel.unset("id"),e.searchUiModel.removeAllFieldQueries()},getSelectionUiModel:function(){return this.options.selectionUiModel},getPluginVersionList:function(){var e=[r.pluginBuildNumber],i=this.options.appApi.baseFilesUrisApi.getServerVersion();return i&&e.push(i),$.Deferred().resolve().promise(e)},getFilesFooterUrl:function(){var i=this.options,t=i.appApi.folderApi;return"root"===i.pluginId?e.opFactory.create("GettingSsoUriOp",i).run("folder/"+encodeURIComponent(t.getRootFolderId())):void 0},clickedOutsideAiCview:function(){return u.isCEF()&&(this._triggerViewEvent(e.ViewEvents.CLEAR_SELECTION),$(document.body).click()),this._getResolvedPromise()},getSiteCatalystName:function(){var e=this.options,i=e.appApi,t=e.pluginId;return i&&i.connectorsApi.isConnectorPlugin(t)?i.connectorsApi.getConnectorPluginScName(t):s.DOCUMENT_CLOUD},doesFileExists:function(e){var i,t,n,o,s,r=this.options,l=r.filesUiModel;return l.isFolderView()?i=r.folderModel.get("items"):r.filesUiModel.isSearchResultsView()&&(i=r.searchModel.get("items")),e&&i&&(e=e.toLowerCase(),s=h.getNormalizedString(e,"NFC"),_.isUndefined(s)||(e=s),n=i.models,t=_.find(n,function(i){return"file"===i.get("object_type")?(o=i.get("name").toLowerCase(),s=h.getNormalizedString(o,"NFC"),_.isUndefined(s)||(o=s),o===e):!1})),t},_runSearchOp:function(e){return this.options.isInSearchResultsView?(u.isCEF()&&this.options.appApi.displayApi.showSpinner(!1),$.Deferred().resolve().promise()):i.opFactory.create("SearchingIfAskedOp",e).run().done(_.bind(function(){if(e.noInitialViewCounts||this._seenInitialView||(this._seenInitialView=!0,this._logInitialViewCounts()),u.isCEF())if("root-select"===e.pluginId){var i=e.folderModel.get("loaded");i&&i===!0&&this.options.appApi.displayApi.showSpinner(!1)}else this.options.appApi.displayApi.showSpinner(!1)},this)).fail(_.bind(function(){u.isCEF()&&this.options.appApi.displayApi.showSpinner(!1)},this))},_onViewEvent:function(i,t){var n=this.options;return n.inFileSelectionDlg&&i===e.ViewEvents.SELECTION_COMMIT?void n.selectionUiModel.commitSelection():void this.trigger(i,t)},_renderChildViews:function(){if(this.options.forRecentFileListing){var t=_.template('<div class="files-rhp ui-theme theme-container">');this.$el.append(t()),this.$rhp=this.$(".files-rhp"),this.$cbView=this._renderChildView("_filesRhpView",i.FilesRhpView,this.$rhp,{forRecentFileList:!0,rhpPreviewUiModel:e.modelFactory.create("RhpPreviewUiModel")})}else this._renderChildView("_filesContainerView",i.FilesContainerView,this.$el)},_initPlugin:function(){var e,i,t=this._initingPluginPromise,n=this.options,s=n.pluginId,r=n.appApi.connectorsApi,l=s,c=g.CLOUD_NAME;return i=r.getConnectorUIName(s),i&&(c=i),e=_.template(g.NOTIFICATION_HEADING,{cloudName:c}),_.extend(this.options,{notificationHeading:e,notificatonCategory:l}),t||(t=this._initingPluginPromise=o.opFactory.create("InitializingPluginOp",this.options).run()),t},_startPlugin:function(){var e=this._startingPluginPromise,i=!1,t=!1;return this.options.forRecentFileListing?(this.render(),void this.options.appApi.displayApi.showSpinner(!1)):(e||(e=this._startingPluginPromise=o.opFactory.create("StartingPluginOp",this.options).run().then(_.bind(function(){this.options.noAcrobat||this._addAppApiCallbacks(),i=this.options.showFoldersInSearch===!0,t=i&&this.options.showNavigationAtRoot===!0,this.options.searchUiModel.set({should_show_folders:i,should_show_navigate_root:t},{silent:!0})},this))),e)},_configureAction:function(e,i,t){var n=this.options,o=n.appApi.connectorsApi,s=o.isActionRestricted(e,i);return s&&(n[t]=!0),s},_configureActions:function(e){var i=this.options,t=i.pluginId,n=i.appApi.connectorsApi;n.isConnectorPlugin(t)&&(this._configureAction(e,c.NEWFOLDER,"noNewFolder"),this._configureAction(e,c.UPLOAD,"noUpload"),this._configureAction(e,c.FILTER,"noFilter"),this._configureAction(e,c.SORT,"noSort")&&i.sortUiModel.set("is_locked",!0),this._configureAction(e,c.SEND,"noShare"),this._configureAction(e,c.SEND,"noShareButton"),this._configureAction(e,c.DOWNLOAD,"noDownload"),this._configureAction(e,c.DELETE,"noDelete"),this._configureAction(e,c.MOVE,"noMove"),this._configureAction(e,c.RENAME,"noRename"))},_initFilter:function(i){var t,n,o,s,r,l=e.SearchUiModel,c=this.options.searchUiModel,p=this._getResolvedPromise();return u.isCEF()&&(p=this.options.readerContextModel),p.then(_.bind(function(){return i?(t=i.filter,t&&(n=t.mimeTypes,o=t.extensions,n&&n.length>0?c.addFieldQuery({field:l.FIELD_FILE_TYPE,value:n.join(),commitQueryBox:!0,queryBoxVisible:!this.options.noVisibleFieldQueries,queryLabel:t.queryLabel,removable:!1},{silent:!0}):u.isCEF()&&o&&o.length>0&&this.options.collectionsUiModel.set("filter_by_extension",o,{silent:!0}),s=t.minSize,s&&c.addFieldQuery({field:l.FIELD_FILE_MIN_SIZE,value:s,commitQueryBox:!1,queryBoxVisible:!this.options.noVisibleFieldQueries,removable:!1},{silent:!0}),r=t.maxSize,r&&c.addFieldQuery({field:l.FIELD_FILE_MAX_SIZE,value:r,commitQueryBox:!1,queryBoxVisible:!this.options.noVisibleFieldQueries,removable:!1},{silent:!0})),t):void 0},this))},_getSiteCatalystContext:function(){var e=this.options,i=e.appApi,t=e.pluginId;return i&&i.connectorsApi.isConnectorPlugin(t)?e.selectFilesScContext?i.connectorsApi.getConnectorPluginScName(t):s.FILE_LIST:e.selectFilesScContext?s.DOCUMENT_CLOUD:s.FILE_LIST},_logInitialViewCounts:function(){var e=this.options,i=e.appApi.siteCatalystApi,t=e.folderModel,n=[this._getSiteCatalystContext(),s.INITIAL_VIEW];i.logScEvent(n.concat([s.NUM_FILES_SHOWN,s.getCountCode(t.getChildFilesCount())])),i.logScEvent(n.concat([s.NUM_FOLDERS_SHOWN,s.getCountCode(t.getChildFoldersCount())]))},_addAppApiCallbacks:function(){var e=this.options.appApi;u.isCEF()||e.sessionApi.addSignedInChangeCallback(this._onSignedInChange),e.acrobatApi.addSelectedFilterIndexChangeCallback(this._onSelectedFilterIndexChange)},_onSignedInChange:function(e,i){var t=this.options;u.isCEF()?this._isSelected?i?(this.deselectPlugin(),this.selectPlugin(this._pluginOptions)):(t.dialogsUiModel.closeAll(),t.selectionUiModel.clearSelection(!1),this.releasePlugin(),delete this._startingPluginPromise,this.render()):i||(t.selectionUiModel.clearSelection(!1),this.releasePlugin(),delete this._startingPluginPromise):i||delete this._startingPluginPromise},_onSelectedFilterIndexChange:function(e,i){var t=this.options;t.collectionsUiModel.set("filter_by_extension",t.appApi.acrobatApi.getFilterFileExtensions(i))},_onOnlineChanged:function(e,i){i?(this.deselectPlugin(),this.selectPlugin(this._pluginOptions)):(this.options.appApi.saveAsApi.setCanSave(!1),this.render())},_unsetPluginRoot:function(){var e=this.options,i=e.appApi.connectorsApi;"root"===i.getConnectorPluginName(e.pluginId)&&i.setConnectorPluginRoot(e.pluginId,void 0)},getFolderAncestorIds:function(){var e,i=[];return e=this.options.folderUiModel.get("path"),_.each(e,function(e){i.push(e.id)}),i},_onNetworkStateChangeFromFeat:function(e,i){var t=(this.options,this.options.appApi);t.rnaApi.done(_.bind(function(e){e.isFeatRunning()&&e.isASTestAllowInstantiation()&&(t.options.networkConnectivityModel.set({is_connected:i?i.state:!1}),t.networkConnectivityApi.removeNetworkConnectivtyChangeCallback(this._onOnlineChanged))},this))},_setContextBoardModel:function(e){this.$cbView&&e&&this.$cbView._setModel(e,!0)},_getSendUriTrimmed:function(){var e=this.options.appApi.baseFilesUrisApi.getSendApiUri(),i=e.lastIndexOf("api");return e=e.substring(0,i)},_onDeleteViewAsset:function(){this._triggerViewEvent(e.ViewEvents.DELETE_SHARED,{parentView:this,parcelModel:this.options.selectionUiModel.getSingleSelectedItemModel()})},_enableRefresh:function(e){this._enableRefresh=e},_refreshDcUI:function(){(void 0==this._enableRefresh||this._enableRefresh)&&this.options.appApi.folderApi.refreshCurrentFolder(this.options)},_refreshAssetSharedStatusInDC:function(e){this.options.appApi.folderApi.updateFileSharedStatus(this.options,e)},_onDeleteReviewAsset:function(i){var t=this.options,n={},o={};i.isOriginalShared?(n.Title=d.CONFIRM_DELETE_SHARED_FILE_TITLE_NO_COPY_MODEL,n.Message=d.CONFIRM_DELETE_SHARED_FILE_MSG_NO_COPY_MODEL,n.ActionButtonName=d.CONFIRM_DELETE_SHARED_FILE_BUTTON_NO_COPY_MODEL):(n.Title=d.CONFIRM_DELETE_SHARED_FILE_TITLE_COPY_MODEL,n.Message=d.CONFIRM_DELETE_SHARED_FILE_MSG_COPY_MODEL,n.ActionButtonName=d.CONFIRM_DELETE_SHARED_FILE_BUTTON_COPY_MODEL),n.RejectButtonName=d.CANCEL,o.InvitationId=i.InvitationId,t.appApi.rnaApi.done(_.bind(function(r){r._reviewAPI.invoke("EurekaAlertDialog",n).done(_.bind(function(n){n===!0&&e.opFactory.create("DeletingReviewOp",this.options).run(i.ParcelId).then(_.bind(function(){try{var e="Delete";void 0!==i.isOriginalShared&&i.isOriginalShared&&(e+=s.VIRGO_ORIGINAL_SHARE),e+=" Review",r._reviewAPI.invoke("logEurekaEventAndDataGroup",["Eureka:Review success","Success",e,"EurekaActions",i.ParcelId,i.role])}catch(n){}r._reviewAPI.invoke("deleteReview",[i.ParcelId,i.InvitationId,i.workflowType]),r._reviewAPI.invoke("AVEurekaDocClose",o),r._reviewAPI.invoke("DeleteEurekaCache",o),this._showToast(d.DELETED_STRING);var l,c=this.options.selectionUiModel.getSingleSelectedItemModel(),p=void 0;Ac.discoveryUrisModel&&(l=Ac.discoveryUrisModel.getUSSUrlsAndUserInfo()),l&&(p=l.isACPUser),t.isInSearchResultsView?p?t.searchUiModel.trigger("refresh_search_category","creative_cloud"):(t.searchUiModel.trigger("refresh_search_category","document_cloud"),t.searchUiModel.trigger("refresh_search_category","review")):(t.selectionUiModel.deselectItem(c.id,!0),t.appApi.folderApi.refreshCurrentFolder(t).then(_.bind(function(){t.selectionUiModel.triggerSelectionChange()},this)))},this))},this))},this))},_showToast:function(i){this.options.toastArgumentString=i,this.options.FadeOutTime=3e3;var t=this.$el;this.$toastPlaceholderDIV=t.find(".rhp-action-toast-placeholder"),0==this.$toastPlaceholderDIV.length&&(this.$toastPlaceholderDIV=$('<div class="rhp-action-toast-placeholder"></div>'),t.append(this.$toastPlaceholderDIV)),this._renderChildView("_rhpToast",e.RhpActionsToast,this.$toastPlaceholderDIV,{options:this.options})},_showCustomizeToast:function(i){if(!_.isUndefined(i)&&!_.isUndefined(i.argsString)){this.options.toastArgumentString=i.argsString,this.options.FadeOutTime=3e3,i.fadeTimeout&&(this.options.FadeOutTime=i.fadeTimeout);var t=this.$el;if(this.$toastPlaceholderDIV=t.find(".rhp-action-toast-placeholder"),0==this.$toastPlaceholderDIV.length&&(this.$toastPlaceholderDIV=$('<div class="rhp-action-toast-placeholder"></div>'),t.append(this.$toastPlaceholderDIV)),this._renderChildView("_rhpToast",e.RhpActionsToast,this.$toastPlaceholderDIV,{options:this.options}),i.hideIcon){var n=t.find(".toast-icon");n&&(n.hide(),this._rhpToast.$toastAction.css("display","block"))}}}}),o.PluginView}),define("acplugins/my-files/js/my-files",["acplugins/my-files/js/ac-my-files","acplugins/my-files/js/ops/op-factory","acplugins/my-files/js/views/plugin-view"],function(e){_.extend(e,{init:function(){e.opFactory=new e.OpFactory}})}),define("pdmplugins/desktop-connector-files/js/ops/plugin/changing-folder-path-op",["core/ac-core","pdmplugins/desktop-connector-files/js/ac-desktop-connector-files","core/ops/op"],function(e,i){i.ChangingFolderPathOp=e.Op.extend({run:function(){var e,i=this.options;return e=i.folderUiModel,e&&i.folderModel.getFolderPath&&e.set("path",i.folderModel.getFolderPath()),this._getResolvedPromise()}})}),define("pdmplugins/desktop-connector-files/js/views/view-events",["pdmplugins/desktop-connector-files/js/ac-desktop-connector-files"],function(e){e.ViewEvents={NAVIGATE_TO_ROOT:"desktopConnector:navigate-to-root",TRY_AGAIN_FETCH:"desktopConnector:try-again-fetch"}}),define("pdmplugins/desktop-connector-files/js/ops/plugin/listening-for-view-events-op",["core/ac-core","files/ac-files","pdmplugins/desktop-connector-files/js/ac-desktop-connector-files","core/ops/op","core/views/view-events","files/views/view-events","pdmplugins/desktop-connector-files/js/views/view-events","pdmplugins/desktop-connector-files/js/ops/op-factory"],function(e,i,t){t.ListeningForViewEventsOp=e.Op.extend({initialize:function(){e.Op.prototype.initialize.call(this),this._initEventMap()},run:function(){var e=$.Deferred();return this.options.rootView.on("all",this._onViewEvent),this._deferred=e,e.promise()},_onViewEvent:function(i,t){var n,o;n=this._eventMap[i],n&&(o=n[0].create(n[1],t)),e.ViewEvents.COLLECTION_RENDER_BEGIN===i?this.options.appApi.displayApi.showSpinner(!0):e.ViewEvents.COLLECTION_RENDER_END===i?this.options.appApi.displayApi.showSpinner(!1):e.ViewEvents.OPEN_DOC_IN_READER_START===i?this.options.appApi.displayApi.showSpinner(!0):e.ViewEvents.OPEN_DOC_IN_READER_END===i&&this.options.appApi.displayApi.showSpinner(!1),o&&o.run().then(function(){return void 0},function(){return void 0})},_mapEvent:function(e,i,t,n,o){e[i]=[t,n,o]},_initEventMap:function(){var n,o,s,r,l,c;n=this._eventMap={},o=this._mapEvent,s=t.opFactory,r=i.ViewEvents,l=e.ViewEvents,c=t.ViewEvents,o(n,r.NAVIGATE_TO_FOLDER,s,"ChangingFolderPathOp"),o(n,l.OPEN_COLLECTION_ITEM,s,"ChangingFolderPathOp"),o(n,l.OPEN_SELECTED_COLLECTION_ITEMS,s,"ChangingFolderPathOp"),o(n,l.COLLECTION_RENDER_BEGIN,s,"ChangingFolderPathOp"),o(n,c.TRY_AGAIN_FETCH,s,"TryFetchingFilesAgainOp")}})}),define("pdmplugins/desktop-connector-files/js/ops/plugin/starting-plugin-op",["core/ac-core","pdmplugins/desktop-connector-files/js/ac-desktop-connector-files","core/ops/op","pdmplugins/desktop-connector-files/js/ops/op-factory","pdmplugins/desktop-connector-files/js/views/view-events"],function(e,i){i.StartingPluginOp=e.Op.extend({run:function(){var e,i=this.options,t=i.folderModel,n=i.appApi,o=n.saveAsApi,s=$.Deferred();return i.folderModel.clearList(),n.displayApi.showSpinner(!0),o.isRunningInFileSaveAs()&&(o.setCanSave(!1),e=n.pluginsApi.getDefaultPluginId("file_selection_dlg"),_.isUndefined(t.get("curr_id"))&&e===i.pluginId)?(i.readerContextModel.done(_.bind(function(e){var i=e.get("rna"),r=i.get("viewData").get("fileSelectData");r.invoke("getFileAncestors",[]).done(_.bind(function(e){e&&t.fillFoldersProxiesAndPaths(e),t.fetch({id:t.get("curr_id"),retryFetchingRoot:!0}).done(_.bind(function(){o.setCanSave(!0)},this)).always(_.bind(function(){n.displayApi.showSpinner(!1),s.resolve()},this))},this))},this)),s.promise()):(t.fetch({id:t.get("curr_id"),retryFetchingRoot:!0}).done(_.bind(function(){o.isRunningInFileSaveAs()&&o.setCanSave(!0)},this)).always(_.bind(function(){n.displayApi.showSpinner(!1),s.resolve()},this)),s.promise())}})}),define("pdmplugins/desktop-connector-files/js/ops/plugin/try-fetching-files-again-op",["core/ac-core","plugins-common/ac-plugins","pdmplugins/desktop-connector-files/js/ac-desktop-connector-files","core/ops/op"],function(e,i,t){t.TryFetchingFilesAgainOp=e.Op.extend({run:function(){var e=this.options.appApi.pluginsApi,t=this.options.pluginId;return e.isPluginSelected(t)?(e.callPluginMethod(t,"deselectPlugin",void 0,this._getResolvedPromise(),!0),e.selectPluginIfNotSelected(i.HOME).then(function(){return e.selectPlugin(t,{},!1)})):this._getRejectedPromise()}})}),define("pdmplugins/desktop-connector-files/js/ops/op-factory",["core/ac-core","pdmplugins/desktop-connector-files/js/ac-desktop-connector-files","pdmplugins/desktop-connector-files/js/ops/plugin/changing-folder-path-op","pdmplugins/desktop-connector-files/js/ops/plugin/listening-for-view-events-op","pdmplugins/desktop-connector-files/js/ops/plugin/starting-plugin-op","pdmplugins/desktop-connector-files/js/ops/plugin/try-fetching-files-again-op","core/ops/op"],function(e,i){i.OpFactory=e.Op.extend({create:function(e,t){var n=i[e];return n?new n(t):void LOG(0,"AcDesktopConnectorFiles.OpFactory.create: Unrecognized class: "+e)}})}),define("pdmplugins/desktop-connector-files/js/templates/desktop-connector-plugin-view-template",[],function(){return'<div class="desktop-connector-plugin">        <div class="desktop-connector-files-view ui-theme theme-container"></div>        <div class="desktop-connector-error-view ui-theme theme-container"></div>        <div class="files-offline-view files-virgo-offline-view ui-theme theme-container"></div>        <div class="desktop-connector-no-access-view ui-theme theme-container"></div>   </div>'}),define("pdmplugins/desktop-connector-files/js/nls/ui-strings",{root:!0,"xx-xx":!0,"ar-ae":!0,"ca-es":!0,"cs-cz":!0,"da-dk":!0,"de-de":!0,"en-ae":!0,"en-gb":!0,"en-il":!0,"es-es":!0,"eu-es":!0,"fi-fi":!0,"fr-fr":!0,"fr-ma":!0,"he-il":!0,"hr-hr":!0,"hu-hu":!0,"it-it":!0,"ja-jp":!0,"ko-kr":!0,"nb-no":!0,"nl-nl":!0,"pl-pl":!0,"pt-br":!0,"ro-ro":!0,"ru-ru":!0,"sk-sk":!0,"sl-si":!0,"sl-sl":!0,"sv-se":!0,"tr-tr":!0,"uk-ua":!0,"zh-cn":!0,"zh-tw":!0}),define("pdmplugins/desktop-connector-files/js/nls/root/ui-strings",{SELECTOR_LABEL:"<%= connectorLabel %>  Files",GENERIC_ERROR_TITLE:"Error",GENERIC_ERROR_MSG:"An error occurred while fetching your files.",CONNECTOR_FOOTER_ANCHOR_TEXT:"Go to <%= connectorDisplayName %> Website",ACCOUNT_REMOVED_MESSAGE:"Acrobat cannot access your <%= connectorDisplayName %> account",ACCESS_REMOVED_ACTION:"Sign in to your <%= connectorDisplayName %> account to access your files.",ACCESS_REMOVED_CTA:"Sign In",CONNECTOR_NOTIFICATION_HEADING:"<%= connectorDisplayName %> Files"}),define("pdmplugins/desktop-connector-files/js/models/dc-local-item-model",["core/ac-core","pdmplugins/desktop-connector-files/js/ac-desktop-connector-files","core/utils/util","core/utils/file-types","core/collections/rna/rna-collection","core/models/rna/rna-model"],function(e,i,t,n){return i.LocalItemModel=e.RNAModel.extend({initialize:function(i,o){var s,r,l;return this.models={list:e.RNACollection},r=e.RNAModel.prototype.initialize.call(this,i,o),this.isFolder()?this.set("content_type","application/adobe.connector.folder",{localAttr:!0}):(s=t.getExtension(this.get("name"))||"",l=n.getFileMimeType(s.toLowerCase()),l=l||null,this.set("content_type",l,{localAttr:!0})),this.set("created",new Date,{localAttr:!0}),this.set("fileURI",null,{localAttr:!0}),this.set("source","desktopConnector",{localAttr:!0}),this.set("_proxy",this._proxy,{localAttr:!0}),r},get:function(i){if("items"===i)i="list";else if("id"===i)return this.id;return"fileURI"===i?void 0:e.RNAModel.prototype.get.call(this,i)},isFolder:function(){return"folder"===this.get("object_type")},isRoot:function(){return"root"===this.get("object_type")},isFile:function(){return"file"===this.get("object_type")},isSharedFile:function(){return!1},isCCFile:function(){return!1},getFolderItemsCount:function(){var e=this.get("items");return e?e.length:0},getSharingURL:function(){return""},getRenditionUrl:function(){return""},getRenameUrl:function(){return""},getPublicUrl:function(){return""},getPathUrl:function(){return void 0
},isPublic:function(){return!1},isForm:function(){return!1},isNative:function(){var e=this.get("source");return"native"===e||"native_v2"===e},isPDF:function(){var e=this.get("content_type");return this.isFile()&&"application/pdf"===e},isBlacklisted:function(e){var i;return t.isCEF()?(i=t.getExtension(this.get("name")),this.isFile()&&!this.isPDF()&&!(i&&-1===e.indexOf(i))):!1}}),i.LocalItemModel}),define("pdmplugins/desktop-connector-files/js/models/reader-folder-model",["core/ac-core-init","files/ac-files-init","pdmplugins/desktop-connector-files/js/ac-desktop-connector-files","plugins-common/ac-plugins","pdmplugins/desktop-connector-files/js/models/dc-local-item-model","core/utils/util","i18n!pdmplugins/desktop-connector-files/js/nls/ui-strings","core/models/folder-model"],function(e,i,t,n,o,s){var r=$.Deferred().resolve(),l=!1;return t.ReaderFolderModel=e.FolderModel.extend({proxyOfFolders:{},folderPath:[],initialize:function(i){this.options=i,this.rnaApi=i.rnaApi,e.Model.prototype.initialize.call(this);var t=e.collectionFactory.create("Collection",void 0,{model:o});this.set("items",t),this.set("object_type","root"),this.set("content_type","application/adobe.connector.folder")},url:function(){return""},getPathUrl:function(){return""},fetch:function(e){var i,t,n,o=$.Deferred();this.unset("name");var s=r.state();return"pending"===s&&(l=!0),r.always(_.bind(function(){l=!1,r=$.Deferred(),e=e||{};var s,c=this.attributes.connector_key;if(("googleDrive"===c||"desktop_sharepoint"===c||"onedrive"===c||"dropbox"===c||"box"===c||"onedrivebusiness"===c)&&(s=this.attributes.object_type),void 0===e.id&&"root"===s||this.get("root_id")===e.id)this._fetchRootFiles().always(_.bind(function(){this._onFetchComplete(),this.rnaApi.done(_.bind(function(e){e.invokeMethod({methodName:"connectorODSPFileOpen",methodArgs:!1})},this))},this)).done(function(){o.resolve(),r.resolve()}).fail(function(){o.reject(),r.reject()});else{var p;for(p=e.id?e:{id:this.attributes.curr_id,retryFetchingRoot:!0},i=this.proxyOfFolders[p.id]._proxy,void 0===i&&LOG(0,"AcDesktopConnectorFiles.readerFolderModel.fetch : No proxy available for navigating to the folder."),t=!1,n=0,n=0;n<this.folderPath.length;n++)if(this.folderPath[n].id===p.id){t=!0;break}this._fetchSubRootFiles(i,t,p.retryFetchingRoot).always(_.bind(function(){this._onFetchComplete()},this)).done(function(){o.resolve(),r.resolve()}).fail(function(){o.reject(),r.reject()})}},this)),o.promise()},_fetchRootFiles:function(){var e=this._makeSpinnerDefer(),i=this._takeSomeRestForShowingSpinner();return i.done(_.bind(function(){this.rnaApi.done(_.bind(function(i){i.connectorsAPI({methodName:"getDesktopConnectorRoot",methodArgs:[this.options.connector_key,this.options.folderId]}).done(_.bind(function(i){this.set("root_id",i._id),this.set("root_path",new o(void 0,{_proxy:i}).get("url")),this.folderPath=[{id:i._id,name:"..\\"}],this.proxyOfFolders[i._id]={_proxy:i,parent_id:i._id,curr_id:i._id},this._fetchSubRootFiles(i,!1).done(function(){e.resolve()}).fail(function(){e.reject()})},this)).fail(_.bind(function(i){LOG(0,"Failed to call getDesktopConnectorRoot"),this._onFailToLoadFiles(i),e.reject()},this))},this))},this)),e.promise()},_fetchSubRootFiles:function(e,i,t){var n=this._makeSpinnerDefer(),o=this._takeSomeRestForShowingSpinner(),s=1e3;this.setCurrentFolderProxy(e),this.clearList();var r=this.attributes.folderId,l="none",c="none",p=this._events;return p&&p["change:id"]&&(l=p["change:id"][0].ctx.options.sortUiModel.attributes.order_by,"none"!==l&&(c=p["change:id"][0].ctx.options.sortUiModel.attributes.order_direction[l])),o.done(_.bind(function(){this.rnaApi.done(_.bind(function(o){o.fileApi({methodName:"iterateFolder",methodArgs:[e,s,l,c,r]}).done(_.bind(function(t){this._parseFiles(t.folderItems,e._id,i,!1),this._getNextItems(t.hasNextPage,e,t.folderIteratorProxy,i,s).done(_.bind(function(){var e=this.get("items"),i=e.models;if(p&&"none"===l)if(p["change:id"]&&t.orderByKey){l=t.orderByKey,c=t.orderDirKey;var o=p["change:id"][0].ctx.options.sortUiModel;o.setOrder(l,c)}else p["change:name"]&&(l=p["change:name"][0].ctx.options.sortUiModel.attributes.order_by,c=p["change:name"][0].ctx.options.sortUiModel.attributes.order_direction[l]);if(p&&"none"===l&&p["change:id"]){var o=p["change:id"][0].ctx.options.sortUiModel;o.setOrder("name","ascending")}this._sortItems(i,l,c),e.set(i,{silent:!0,fromODM:!0}),e.trigger("add"),this.options.dcErrorUiModel.clearError(),n.resolve()},this),_.bind(function(){var e=this._events;if(e&&"none"===l){if(e["change:name"]){var i=e["change:name"][0].ctx.options.sortUiModel;i.setOrder("name","ascending")}var t=this.get("items").models;this._sortItems(t,l,c)}},this)).fail(_.bind(function(e){this._onFailToLoadFiles(e),n.reject()},this))},this)).fail(_.bind(function(e){LOG(0,"Failed to call iterateFolder"),"Not Found Error"===e&&t?this._fetchRootFiles().always(_.bind(function(){this._onFetchComplete()},this)).done(function(){n.resolve()}).fail(function(){this._onFailToLoadFiles(e),n.reject()}):(this._onFailToLoadFiles(e),n.reject())},this))},this))},this)),n.promise()},_getNextItems:function(e,i,t,n,o){var s=$.Deferred();return e&&!l?this.rnaApi.done(_.bind(function(e){var r=e.fileApi({methodName:"getNextItems",methodArgs:[t,o]});r.done(_.bind(function(e){this._parseFiles(e.folderItems,i._id,n,!0),this._getNextItems(e.hasNextPage,i,t,n,o).done(_.bind(function(){s.resolve()},this)).fail(_.bind(function(){s.reject()},this))},this)).fail(_.bind(function(){s.reject()},this))},this)):s.resolve(),s.promise()},_parseFiles:function(i,t,n,r){var l,c,p,d,a,u,h,g,f,v={members:[]},m=this.get("items"),A=m?m.model:null;if(A){for(d=0;d<i.length;d++)l=i[d],c=this.proxyOfFolders[t].curr_id,p=t,this.proxyOfFolders[l._id]={_proxy:l,parent_id:c,curr_id:p},a=new o(void 0,{_proxy:l}),a.isFile()?(u=s.getExtension(a.get("name")),h=!0,this.exts&&0<this.exts.length&&(h=_.some(this.exts,function(e){return e===u}))):a.isFolder()&&(h=!0),h&&v.members.push(new A({index:d,parent_id:c},{_proxy:l}));if(this.set("parent_id",this.proxyOfFolders[t].curr_id),this.set("curr_id",t),n===!1)t!==this.get("root_id")&&(a=new e.RNAModel(void 0,{_proxy:this.proxyOfFolders[t]._proxy}),g=!1,this.folderPath.some(function(e){return e.id===t&&(g=!0),g}),g?LOG(0,"AcDesktopConnectorFiles._parseFilesSome problem happened when moving forward with id: "+t):this.folderPath.push({id:t,name:a.get("name")}));else{for(f=this.folderPath.length,d=0;d<this.folderPath.length-1;d++)if(this.folderPath[d].id===t){this.folderPath.splice(d+1,this.folderPath.length-d-1);break}f<=this.folderPath.length&&LOG(0,"AcDesktopConnectorFiles._parseFilesSome problem happened when moving backward with id: "+t)}t!==this.get("root_id")?this.set("object_type","folder"):this.set("object_type","root")}else LOG(0,"LOG reader-folder-model.js : _parseFiles no items or Model");this.parse(v,r)},fillFoldersProxiesAndPaths:function(i){var t,n,s,r,l,c;if(!_.isUndefined(i)&&0!=i.length){for(r=i[0],this.set("root_id",r._id),this.set("root_path",new o(void 0,{_proxy:r}).get("url")),this.proxyOfFolders[r._id]={_proxy:r,parent_id:r._id,curr_id:r._id},this.folderPath.push({id:r._id,name:"..\\"}),t=1;t<i.length;t++)n=i[t],c=i[t-1]._id,l=this.proxyOfFolders[c].curr_id,this.proxyOfFolders[n._id]={_proxy:n,parent_id:l,curr_id:c},s=new e.RNAModel(void 0,{_proxy:n}),t<i.length-1&&this.folderPath.push({id:n._id,name:s.get("name")});this.set("curr_id",i[i.length-1]._id),this.setCurrentFolderProxy(i[i.length-1]),this.options.saveAsApi.setCurrentFolderProxy(i[i.length-1])}},parse:function(e,i){var t=this.get("items"),n=e.members;return i?t.length+n.length<1e4&&t.add(n,{silent:!0,fromODM:!0}):t.set(n,{silent:!0,fromODM:!0}),e},getFolderPath:function(){return this.folderPath},getProxyForId:function(e){var i=this.proxyOfFolders[e],t=i?i._proxy:void 0;return t},setExtensions:function(e){this.exts=e},clearList:function(){var e=this.get("items");e&&e.reset()},_sortItems:function(e,i,t){void 0!==e&&e.sort(_.bind(function(e,n){if(void 0===e)return void 0===n?0:-1;if(void 0===n)return 1;var o=e.isFolder(),s=n.isFolder();if(o^s)return o?-1:1;var r,l=e.get("name"),c=n.get("name"),p=e.get("size"),d=n.get("size"),a=e.get("modified"),u=n.get("modified");return o&&s?r=this._stringCompare(this._toLowerCase(l),this._toLowerCase(c),t):"size"===i?r=this._sizeCompare(p,d,t):"name"===i||"none"===i?r=this._stringCompare(this._toLowerCase(l),this._toLowerCase(c),t):"modified"===i&&(r=this._dateCompare(a,u,t)),r},this))},_sizeCompare:function(e,i,t){return"descending"===t?i>e?1:e>i?-1:0:i>e?-1:e>i?1:0},_dateCompare:function(e,i,t){var n=new Date(e),o=new Date(i);return"descending"===t?o>n?1:n>o?-1:0:o>n?-1:n>o?1:0},_stringCompare:function(e,i,t){var n,o,s,r;for(n=0,o=0;n<e.length&&o<i.length;++n,++o)if(s=e.charCodeAt(n),r=i.charCodeAt(o),"descending"===t){if(r>s)return 1;if(s>r)return-1}else{if(r>s)return-1;if(s>r)return 1}if("descending"===t){if(n===e.length)return o===i.length?0:1;if(o===i.length)return-1}else{if(n===e.length)return o===i.length?0:-1;if(o===i.length)return 1}return 0},_toLowerCase:function(e){var i,t,n="";for(i=0;i<e.length;i++)t=e.charCodeAt(i),t>=65&&90>=t&&(t+=32),n+=String.fromCharCode(t);return n},_makeSpinnerDefer:function(){var e=$.Deferred(),i=this.options.displayApi;return i.showSpinner(!0),e.always(function(){i.showSpinner(!1)}),e},_takeSomeRestForShowingSpinner:function(){var e=$.Deferred(),i=setTimeout(function(){e.resolve(),clearTimeout(i)},400);return e.promise()},_onFailToLoadFiles:function(e){this.options.dcErrorUiModel.setError(e&&"Not Found Error"!==e?e:"Generic Error")},_onFetchComplete:function(){l||this.set("name","connector.foldermodel")},getCurrentFolderProxy:function(){return this._currentFolderProxy},setCurrentFolderProxy:function(e){this._currentFolderProxy=e}}),t.ReaderFolderModel}),define("pdmplugins/desktop-connector-files/js/models/ui/dc-error-ui-model",["core/ac-core","pdmplugins/desktop-connector-files/js/ac-desktop-connector-files","core/models/ui/ui-model"],function(e,i){return i.ErrorUiModel=e.UiModel.extend({recognized:{error:{type:"string",optional:!1}},defaults:{error:void 0},setError:function(e){this.set("error",e,{silent:!0}),this.trigger("change")},getError:function(){return this.get("error")},hasError:function(){return this.has("error")},clearError:function(){this.unset("error",{silent:!0}),this.trigger("change")}}),i.ErrorUiModel}),define("pdmplugins/desktop-connector-files/js/templates/desktop-connector-error-view-template",[],function(){return'<div class="error-view ui-theme theme-container"><div class="error-title theme-text"><%= errorTitle %></div><div class="error-msg theme-text"><%= errorMsg %></div></div>'}),define("pdmplugins/desktop-connector-files/js/views/error-view",["core/ac-core","pdmplugins/desktop-connector-files/js/ac-desktop-connector-files","pdmplugins/desktop-connector-files/js/templates/desktop-connector-error-view-template","i18n!pdmplugins/desktop-connector-files/js/nls/ui-strings","pdmplugins/desktop-connector-files/js/views/view-events"],function(e,i,t,n){return i.ErrorView=e.View.extend({events:{},initialize:function(){e.View.prototype.initialize.call(this),this._template=_.template(t)},render:function(){var i,t,o=this.$el,s=this.options.dcErrorUiModel;return e.View.prototype.render.call(this),i=n.GENERIC_ERROR_TITLE,t=s.getError(),t&&"Generic Error"!==t||(t=n.GENERIC_ERROR_MSG),0===o.children().length&&o.html(this._template({errorTitle:i,errorMsg:t})),this},_onTryAgainBtnClick:function(){this._triggerViewEvent(i.ViewEvents.TRY_AGAIN_FETCH)}}),i.ErrorView}),define("pdmplugins/desktop-connector-files/js/templates/desktop-connector-no-access-view-template",[],function(){return'<div class="desktop-connector-no-access"><div class="desktop-connector-no-access-content unselectable"><img class="desktop-connector-no-access-image"></img><div class="desktop-connector-no-access-title theme-text"><%= title %></div><div class="desktop-connector-no-access-text theme-text"><%= content %></div></div><div class="desktop-connector-no-access-btns">    <input type="button"           class="control-button desktop-connector-add-acc-btn theme-button theme-button-label"           id="desktop-connector-add-acc-btn"           tabindex="1" value="<%= label %>">    </input></div></div>'}),define("pdmplugins/desktop-connector-files/js/views/no-access-view",["core/ac-core","plugins-common/ac-plugins","pdmplugins/desktop-connector-files/js/ac-desktop-connector-files","pdmplugins/desktop-connector-files/js/templates/desktop-connector-no-access-view-template","i18n!pdmplugins/desktop-connector-files/js/nls/ui-strings","core/utils/image-loader","core/utils/util","core/views/view"],function(e,i,t,n,o,s,r){return t.NoAccessView=e.View.extend({events:{"click .desktop-connector-add-acc-btn":"_onAddAccountButtonClick"},initialize:function(){e.View.prototype.initialize.call(this),this._template=_.template(n)},render:function(){var i,t,n,o=this.$el,s=this.options,r=s.pluginId,l=s.appApi,c=l.connectorsApi;return e.View.prototype.render.call(this),0===o.children().length&&(c.isConnectorPlugin(r)&&(n=c.getConnectorUIName(r)),o.html(this._template({title:this._getTitle(n),content:this._getContent(n),label:this._getButtonLabel()})),this._initWrappers(),t=this._getIcon(),i=this.$icon,t!==i.attr("src")&&this._updateIcon(t)),s.noUrlUpdate&&l.rnaApi.done(_.bind(function(e){e.isAddAccountVisibleInFileSelDlg().then(_.bind(function(e){e||this.$noAccessBtn.hide()},this))},this)),this},_initWrappers:function(){this.$icon=this.$("img.desktop-connector-no-access-image"),this.$noAccessBtn=this.$(".desktop-connector-no-access-btns")},_getIcon:function(){var e,i,t=this.options.pluginId,n=this.options.appApi.connectorsApi;return e=n.getConnectorPluginName(t),n.isDesktopConnector(e)?(i=n.getConnectorsUiHelpers(e),r.isRetina()?i.icon_lg_retina:i.icon_lg):void 0},_updateIcon:function(e){s.loadImage(this.$icon,e,void 0,!0).then(_.bind(function(){this.$icon.on("dragstart",function(e){e.preventDefault()})},this),_.bind(function(){return void 0},this))},_getTitle:function(e){return _.template(o.ACCOUNT_REMOVED_MESSAGE,{connectorDisplayName:e})},_getContent:function(e){return _.template(o.ACCESS_REMOVED_ACTION,{connectorDisplayName:e})},_getButtonLabel:function(){return o.ACCESS_REMOVED_CTA},_onAddAccountButtonClick:function(){var e=this.options,i=e.appApi,t=e.pluginId,n=i.connectorsApi,o=n.getConnectorPluginName(t),s=n.getConnectorPluginRoot(t);n.addConnector(o,void 0,{accountId:s})}}),t.NoAccessView}),define("pdmplugins/desktop-connector-files/js/views/offline-view",["files/ac-files","pdmplugins/desktop-connector-files/js/ac-desktop-connector-files"],function(e,i){return i.OfflineView=e.FilesVirgoOfflineView.extend({initialize:function(){e.FilesVirgoOfflineView.prototype.initialize.call(this)},_onOKButtonClick:function(){this.options.networkConnectivityModel;this.options.appApi.networkConnectivityApi.resetNetworkStatus({silent:!1})}}),i.OfflineView}),define("pdmplugins/desktop-connector-files/js/views/plugin-view",["files/ac-files","plugins-common/ac-plugins","acplugins/my-files/js/ac-my-files","pdmplugins/desktop-connector-files/js/ac-desktop-connector-files","pdmplugins/desktop-connector-files/js/templates/desktop-connector-plugin-view-template","core/utils/sc-analytics","i18n!pdmplugins/desktop-connector-files/js/nls/ui-strings","core/utils/action-ids","i18n!acplugins/my-files/js/nls/ui-strings","core/ac-core","pdmplugins/desktop-connector-files/js/models/reader-folder-model","acplugins/my-files/js/views/plugin-view","pdmplugins/desktop-connector-files/js/models/ui/dc-error-ui-model","pdmplugins/desktop-connector-files/js/views/error-view","pdmplugins/desktop-connector-files/js/views/no-access-view","pdmplugins/desktop-connector-files/js/views/offline-view"],function(e,i,t,n,o,s,r,l,c,p){return n.PluginView=t.PluginView.extend({initialize:function(){t.PluginView.prototype.initialize.call(this),_.extend(this.options,{noSelectionActions:!1,noUpload:!0,noRename:!0,noDelete:!0,noMove:!0,noNewFolder:!0,noUrlUpdate:!1,noNotifications:!1,noPreferences:!0,noAcrobat:!0,mutipleNonPDFsSaveDisabled:!0,folderDeletionDisabled:!0,multiFolderSelection:!0,noHoverPreview:!0,noFullPreview:!1,noFullPreviewImpl:!0,noShareButton:!0,noRightBtns:!0,selectFilesScContext:!0,noHistoryEffect:!1,noFilesHeader:!1,noFileSelection:!0,noSort:!0,shouldOpenNonPDFFile:!0,dcErrorUiModel:new n.ErrorUiModel,noScAnalytics:!0,footerAnchorText:void 0,noMultipleSelection:!1})},render:function(){return 0===this.$el.children().length&&(this.$el.html(_.template(o,{})),this._initWrappers(),this.$errorView.hide(),this.$networkErrorView.hide(),this.$noAccessView.hide(),this.options.dcErrorUiModel.on("change",this.render,this)),this._renderChildViews(),this.options.appApi.selectionApi.isRunningInFileSelection()&&this.options.appApi.rnaApi.done(function(e){e.logAnayticsCustomOpenSave("Time_To_Show_Dialog_View_Connector_File_List")}),this},initPlugin:function(){var e=this.options.appApi;return this._initPlugin().then(_.bind(function(){e.routerApi.route("desktopConnector",this._selectDesktopConnectorFilesPlugin).route("desktopConnector/*filter",this._onDesktopConnectorFilterRoute)},this))},selectPlugin:function(e){var i,t=this.options,n=t.appApi.networkConnectivityApi;return this._pluginOptions=e,n.removeNetworkOnlineChangeCallback(this._onOnlineChanged),n.addNetworkOnlineChangeCallback(this._onOnlineChanged),t.appApi.rnaApi.done(_.bind(function(e){e.isFeatRunning()&&e.isASTestAllowInstantiation()&&n.addNetworkConnectivtyChangeCallback(this._onOnlineChanged)},this)),n.isOnline()?(p.opFactory.create("ClearingSelectionOp",this.options).run(),e=e||this.getPluginOptions(),e&&(i=e.noHistoryEffect),i||t.appApi.routerApi.navigate("desktopConnector"),this._pluginOptions=e,this._startPlugin(e).done(_.bind(function(){this.options.appApi.displayApi.applyUIThemeStyles(this.$el).then(_.bind(function(){this.render(),this.options.appApi.displayApi.showSpinner(!1)},this))},this))):(this.options.appApi.displayApi.applyUIThemeStyles(this.$el).then(_.bind(function(){this.render(),this.options.appApi.displayApi.showSpinner(!1)},this)),this._getResolvedPromise())},_initWrappers:function(){this.$dcFilesView=this.$(".desktop-connector-files-view"),this.$errorView=this.$(".desktop-connector-error-view"),this.$networkErrorView=this.$(".files-virgo-offline-view"),this.$noAccessView=this.$(".desktop-connector-no-access-view")},_startPlugin:function(e){var i,o,s=this._startingPluginOpPromise,r=$.Deferred(),l=this.options;return s||(e=e||{},e.filter=e.filter||{},i=e.filter.extensions,o=_.map(i,function(e){return"."===e[0]?e.substr(1):e}),l.folderModel.setExtensions(o),s=this._startingPluginOpPromise=t.PluginView.prototype._startPlugin.call(this),this._viewListener||(this._viewListener=n.opFactory.create("ListeningForViewEventsOp",l),this._viewListener.run())),this._isConnectorSupportedForAction(e).done(_.bind(function(){n.opFactory.create("StartingPluginOp",l).run().done(_.bind(function(){r.resolve(),l.folderModel.get("curr_id")===l.folderModel.get("root_id")&&this._triggerViewEvent(n.ViewEvents.NAVIGATE_TO_ROOT,{}),l.noUrlUpdate&&l.folderModel.getFolderItemsCount()<=0?l.collectionsUiModel.set("force_empty",!0):l.collectionsUiModel.set("force_empty",!1)},this))},this)).fail(function(){r.resolve()}),$.when(s,r)},_initPlugin:function(){var e,i,o,s,l,c,p=this.options,d=p.pluginId,a=p.appApi.connectorsApi,u=this.options.appApi;return t.PluginView.prototype._initPlugin.call(this).then(_.bind(function(){a.isConnectorPlugin(d)?(i=a.getConnectorPluginName(d),e=a.getConnectorPluginRoot(d)):LOG(1,"AcDesktopConnectorFiles._initPlugin Can not get connector details."),s=a.getConnectorUIName(d),this.options.footerAnchorText&&(s&&(o=_.template(r.CONNECTOR_FOOTER_ANCHOR_TEXT,{connectorDisplayName:s})),this.options.footerAnchorText=o),s&&(l=_.template(r.CONNECTOR_NOTIFICATION_HEADING,{connectorDisplayName:s}),c="desktopConnector_"+i),_.extend(this.options,{folderModel:new n.ReaderFolderModel({rnaApi:u.rnaApi,saveAsApi:u.saveAsApi,folderId:e,pluginId:d,connector_key:i,displayApi:u.displayApi,errorApi:u.errorApi,dcErrorUiModel:p.dcErrorUiModel,networkConnectivityApi:u.networkConnectivityApi}),isDesktopConnectorPlugin:!0,notificationHeading:l,notificatonCategory:c}),this.options.collectionsUiModel.set("checkbox",!1),this.options.sortUiModel.set("order_by","none"),this.options.sortUiModel.set("mru_date_order","modified"),this.options.sortUiModel.set("is_locked",!1)},this))},_renderChildViews:function(){var i,t=!0,o=this.options.appApi.saveAsApi,s=this.options.dcErrorUiModel;this.options.appApi.networkConnectivityApi.isOnline()?s.hasError()?(i=s.getError(),"No Access Error"===i?(this._renderChildView("_dcNoAccessView",n.NoAccessView,this.$noAccessView),this.$dcFilesView.hide(),this.$errorView.hide(),this.$networkErrorView.hide(),this.$noAccessView.show()):(this._renderChildView("_dcErrorView",n.ErrorView,this.$errorView),this.$dcFilesView.hide(),this.$noAccessView.hide(),this.$noAccessView.hide(),this.$errorView.show())):(this._renderChildView("_filesContainerView",e.FilesContainerView,this.$dcFilesView),this.$errorView.hide(),this.$networkErrorView.hide(),this.$noAccessView.hide(),this.$dcFilesView.show(),t=!1):(this._renderChildView("_networkErrorView",n.OfflineView,this.$networkErrorView),this.$dcFilesView.hide(),this.$errorView.hide(),this.$noAccessView.hide(),this.$networkErrorView.show()),!t&&this.options.appApi.networkConnectivityApi.isOnline()||!o.isRunningInFileSaveAs()||o.setCanSave(!1)},_onDesktopConnectorFilterRoute:function(){this._initPlugin()},_selectDesktopConnectorFilesPlugin:function(){var e=this.options.appApi.pluginsApi,t=this.options.pluginId;return e.selectPluginIfNotSelected(i.HOME).then(function(){return e.selectPlugin(t)})},getSiteCatalystName:function(){var e=this.options,i=e.appApi,t=e.pluginId;return i&&i.connectorsApi.isConnectorPlugin(t)?i.connectorsApi.getConnectorPluginScName(t):s.DESKTOP_CONNECTOR},getFilesFooterUrl:function(){var e=$.Deferred(),i=this.options,t=i.folderModel.getCurrentFolderProxy(),n=this.options.folderModel.get("connector_key");return i.appApi.rnaApi.done(_.bind(function(i){i.connectorsAPI({methodName:"getSSOLinkUrl",methodArgs:[n,t]}).done(_.bind(function(i){e.resolve({uri:i},"success",e.promise())},this)).fail(_.bind(function(){e.reject()},this))},this)),e.promise()},deselectPlugin:function(){var e=this.options,i=e.appApi.networkConnectivityApi;return i.removeNetworkOnlineChangeCallback(this._onOnlineChanged),t.PluginView.prototype.deselectPlugin.call(this)},isFilenameValid:function(e){var i,t=$.Deferred(),n=this.options,o=n.pluginId,s=n.appApi.connectorsApi;return s.isConnectorPlugin(o)&&(i=s.getConnectorPluginName(o)),n.appApi.rnaApi.done(_.bind(function(n){n.connectorsAPI({methodName:"fileNameValid",methodArgs:[i,e]}).done(_.bind(function(){t.resolve()},this)).fail(_.bind(function(e){var i={error:{code:e}};t.reject(i)},this))},this)),t.promise()},_configureAction:function(e,i,t){var n=this.options,o=n.appApi.connectorsApi,s=o.isActionRestricted(e,i);return s&&(n[t]=!0),s},_configureActions:function(e){var i=this.options,t=i.pluginId,n=i.appApi.connectorsApi;n.isConnectorPlugin(t)&&(this._configureAction(e,l.NEWFOLDER,"noNewFolder"),this._configureAction(e,l.UPLOAD,"noUpload"),this._configureAction(e,l.FILTER,"noFilter"),this._configureAction(e,l.SORT,"noSort")&&i.sortUiModel.set("is_locked",!0),this._configureAction(e,l.SEND,"noShare"),this._configureAction(e,l.SEND,"noShareButton"),this._configureAction(e,l.DOWNLOAD,"noDownload"),this._configureAction(e,l.DELETE,"noDelete"),this._configureAction(e,l.MOVE,"noMove"),this._configureAction(e,l.RENAME,"noRename"),this._configureAction(e,l.NO_RIGHT_BUTTONS,"noRightBtns"),this._configureAction(e,l.MULTIPLE_SELECTION,"noMultipleSelection")&&i.selectionUiModel.set("multiple_selection",!1))},_onOnlineChanged:function(e,i){i?(this.deselectPlugin(),this.selectPlugin(this._pluginOptions)):this.render()},_isConnectorSupportedForAction:function(e){var i,t,n=$.Deferred(),o=this.options,s=o.appApi.pluginsApi,r=o.pluginId,p=s.getPluginUiModel(r),d=o.appApi.connectorsApi,a=p.get("connector_name"),u=e&&e.selectedToolPlugin||s.getSelectedPluginId("tools"),h=l.toolIdsToActionIds[u],g=l.toolIdsToActionNames[u],f=d.getConnectorUIName(r),v=o.appApi.displayApi;return this._configureActions(a),o.noUrlUpdate&&(e&&e.singleFileSelection&&o.selectionUiModel.set("multiple_selection",!1),d.isActionRestricted(a,h))?(g&&f&&(i=s.getSelectorApi(u),i&&i.getSelectorLabel&&(g=i.getSelectorLabel(),g&&""!==g||(g=l.toolIdsToActionNames[u])),t=_.template(c.UNSUPPORTED_CONNECTOR_MSG,{actionName:g,connectorLabel:f}),o.collectionsUiModel.set("force_empty_msg",t)),o.sortUiModel.set("is_locked",!0),o.searchUiModel.set("is_locked",!0),o.collectionsUiModel.set("force_empty",!0),v.showSpinner(!1),n.reject()):n.resolve()}}),n.PluginView}),define("pdmplugins/desktop-connector-files/js/desktop-connector-files",["acplugins/my-files/js/ac-my-files","pdmplugins/desktop-connector-files/js/ac-desktop-connector-files","pdmplugins/desktop-connector-files/js/ops/op-factory","pdmplugins/desktop-connector-files/js/views/plugin-view"],function(e,i){_.extend(i,{init:function(){e.init(),i.opFactory=new i.OpFactory}})}),define("pdmplugins/desktop-connector-files-select/js/ops/plugin/setting-current-folder-proxy",["core/ac-core","files/ac-files","pdmplugins/desktop-connector-files-select/js/ac-desktop-connector-files-select","pdmplugins/desktop-connector-files/js/ac-desktop-connector-files","core/ops/op","core/views/view-events","files/views/view-events","pdmplugins/desktop-connector-files/js/views/view-events"],function(e,i,t,n){t.SettingCurrentFolderProxy=e.Op.extend({run:function(t,o){o||(o=this.options);var s,r,l=o.appApi.saveAsApi,c=o.folderModel;return l.isRunningInFileSaveAs()?(t===e.ViewEvents.OPEN_COLLECTION_ITEM?l.isRunningInFileSaveAs()&&(r=o.itemView.model,r.isFolder()&&(s=o.itemView.model._proxy)):t===i.ViewEvents.NAVIGATE_TO_FOLDER?c.getProxyForId&&(s=c.getProxyForId(o.id)):t===n.ViewEvents.NAVIGATE_TO_ROOT&&(s=c.getProxyForId(c.get("root_id"))),s&&(l.setCurrentFolderProxy(s),c.setCurrentFolderProxy(s)),this._getResolvedPromise()):this._getRejectedPromise()}})}),define("pdmplugins/desktop-connector-files-select/js/ops/plugin/listening-for-view-events-op",["core/ac-core","files/ac-files","pdmplugins/desktop-connector-files-select/js/ac-desktop-connector-files-select","pdmplugins/desktop-connector-files/js/ac-desktop-connector-files","core/ops/op","core/views/view-events","files/views/view-events","pdmplugins/desktop-connector-files/js/views/view-events","pdmplugins/desktop-connector-files-select/js/ops/op-factory"],function(e,i,t,n){t.ListeningForViewEventsOp=e.Op.extend({initialize:function(){e.Op.prototype.initialize.call(this),this._initEventMap()},run:function(){var e=$.Deferred();return this.options.rootView.on("all",this._onViewEvent),this._deferred=e,e.promise()},_onViewEvent:function(i,t){var n,o;return i===e.ViewEvents.SELECTION_COMMIT?void this.options.selectionUiModel.commitSelection():(n=this._eventMap[i],n&&(o=n[0].create(n[1],t)),void(o&&o.run(i,t).then(function(){return void 0},function(){return void 0})))},_mapEvent:function(e,i,t,n,o){e[i]=[t,n,o]},_initEventMap:function(){var o,s,r,l,c,p;o=this._eventMap={},s=this._mapEvent,r=t.opFactory,l=i.ViewEvents,c=e.ViewEvents,p=n.ViewEvents,s(o,c.OPEN_COLLECTION_ITEM,r,"SettingCurrentFolderProxy"),s(o,l.NAVIGATE_TO_FOLDER,r,"SettingCurrentFolderProxy"),s(o,p.NAVIGATE_TO_ROOT,r,"SettingCurrentFolderProxy")}})}),define("pdmplugins/desktop-connector-files-select/js/ops/op-factory",["core/ac-core","pdmplugins/desktop-connector-files-select/js/ac-desktop-connector-files-select","pdmplugins/desktop-connector-files-select/js/ops/plugin/setting-current-folder-proxy","pdmplugins/desktop-connector-files-select/js/ops/plugin/listening-for-view-events-op","core/ops/op"],function(e,i){i.OpFactory=e.Op.extend({create:function(e,t){var n=i[e];return n?new n(t):void LOG(0,"AcDesktopConnectorFilesSelect.OpFactory.create: Unrecognized class: "+e)}})}),define("pdmplugins/desktop-connector-files-select/js/views/plugin-view",["pdmplugins/desktop-connector-files/js/ac-desktop-connector-files","pdmplugins/desktop-connector-files-select/js/ac-desktop-connector-files-select","pdmplugins/desktop-connector-files/js/views/plugin-view","pdmplugins/desktop-connector-files-select/js/ops/op-factory"],function(e,i){return i.PluginView=e.PluginView.extend({currentFolderProxy:void 0,initialize:function(){e.PluginView.prototype.initialize.call(this),_.extend(this.options,{noSelectionActions:!0,noUpload:!0,noRename:!0,noDelete:!0,noMove:!0,noUrlUpdate:!0,noNotifications:!0,noPreferences:!0,noAcrobat:!0,noFolderSelection:!0,noHoverPreview:!0,noFullPreview:!0,selectFilesScContext:!0,noInitialViewCounts:!0,noVisibleFieldQueries:!0,showFoldersInSearch:!0,noNewFolder:!0,footerAnchorText:void 0})},selectPlugin:function(i){$(".file-selection-dlg-continue-btn").show();var t=this.options.appApi.saveAsApi;return t.setCurrentFolderProxy(this.currentFolderProxy),this.options.appApi.done(_.bind(function(){this.options.appApi.displayApi.showSpinner(!1)},this)),e.PluginView.prototype.selectPlugin.call(this,i)},_initPlugin:function(){var i=this.options.appApi.saveAsApi.isRunningInFileSaveAs();return i&&_.extend(this.options,{showNavigationAtRoot:!0,noFilesHeader:!0,showNewFolderInNavigation:!1,noSelectionActions:!0}),this.options.appApi.selectionApi.isRunningInFileSelection()&&_.extend(this.options,{noFilesHeader:!0}),e.PluginView.prototype._initPlugin.call(this)},_startPlugin:function(){return this._viewEventListener||(this._viewEventListener=i.opFactory.create("ListeningForViewEventsOp",this.options),this._viewEventListener.run()),e.PluginView.prototype._startPlugin.apply(this,arguments)},deselectPlugin:function(){var i=this.options.appApi.saveAsApi,t=this.options.folderModel;return this.currentFolderProxy=t.getCurrentFolderProxy(),i.setCurrentFolderProxy(void 0),e.PluginView.prototype.deselectPlugin.call(this)}}),i.PluginView}),define("pdmplugins/desktop-connector-files-select/js/desktop-connector-files-select",["pdmplugins/desktop-connector-files/js/ac-desktop-connector-files","pdmplugins/desktop-connector-files-select/js/ac-desktop-connector-files-select","pdmplugins/desktop-connector-files-select/js/ops/op-factory","pdmplugins/desktop-connector-files-select/js/views/plugin-view"],function(e,i){_.extend(i,{init:function(){e.init(),i.opFactory=new i.OpFactory}})}),define("pdmplugins/desktop-connector-files-select/js/plugin",["core/ac-core-init","files/ac-files-init","pdmplugins/desktop-connector-files/js/ac-desktop-connector-files","pdmplugins/desktop-connector-files-select/js/ac-desktop-connector-files-select","acplugins/my-files/js/my-files","pdmplugins/desktop-connector-files/js/desktop-connector-files","pdmplugins/desktop-connector-files-select/js/desktop-connector-files-select"],function(e,i,t,n){n.init()});