nextcloud/core/js/dist/share_backend.js

24 lines
115 KiB
JavaScript

!function(e){var a={};function t(n){if(a[n])return a[n].exports;var s=a[n]={i:n,l:!1,exports:{}};return e[n].call(s.exports,s,s.exports,t),s.l=!0,s.exports}t.m=e,t.c=a,t.d=function(e,a,n){t.o(e,a)||Object.defineProperty(e,a,{enumerable:!0,get:n})},t.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},t.t=function(e,a){if(1&a&&(e=t(e)),8&a)return e;if(4&a&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(t.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&a&&"string"!=typeof e)for(var s in e)t.d(n,s,function(a){return e[a]}.bind(null,s));return n},t.n=function(e){var a=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(a,"a",a),a},t.o=function(e,a){return Object.prototype.hasOwnProperty.call(e,a)},t.p="",t(t.s=0)}([function(e,a,t){"use strict";t.r(a);t(1),t(2),t(3),t(4),t(5),t(6),t(7),t(8),t(9)},function(e,a){!function(){OC.Share||(OC.Share={},OC.Share.Types={});var e=OC.Backbone.Model.extend({defaults:{publicUploadEnabled:!1,enforcePasswordForPublicLink:oc_appconfig.core.enforcePasswordForPublicLink,enableLinkPasswordByDefault:oc_appconfig.core.enableLinkPasswordByDefault,isDefaultExpireDateEnforced:!0===oc_appconfig.core.defaultExpireDateEnforced,isDefaultExpireDateEnabled:!0===oc_appconfig.core.defaultExpireDateEnabled,isRemoteShareAllowed:oc_appconfig.core.remoteShareAllowed,isMailShareAllowed:void 0!==oc_appconfig.shareByMailEnabled,defaultExpireDate:oc_appconfig.core.defaultExpireDate,isResharingAllowed:oc_appconfig.core.resharingAllowed,isPasswordForMailSharesRequired:void 0!==oc_appconfig.shareByMail&&oc_appconfig.shareByMail.enforcePasswordProtection,allowGroupSharing:oc_appconfig.core.allowGroupSharing},isPublicUploadEnabled:function(){return"yes"===$("#filestable").data("allow-public-upload")},isShareWithLinkAllowed:function(){return"yes"===$("#allowShareWithLink").val()},getFederatedShareDocLink:function(){return oc_appconfig.core.federatedCloudShareDoc},getDefaultExpirationDateString:function(){var e="";if(this.get("isDefaultExpireDateEnabled")){var a=moment.utc(),t=this.get("defaultExpireDate");a.add(t,"days"),e=a.format("YYYY-MM-DD 00:00:00")}return e}});OC.Share.ShareConfigModel=e}()},function(e,a){function t(e){return(t="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})(e)}var n,s;n=Handlebars.template,(s=OC.Share.Templates=OC.Share.Templates||{}).sharedialoglinkshareview=n({1:function(e,a,t,n,s){var i,l=null!=a?a:e.nullContext||{};return'<ul class="shareWithList">\n'+(null!=(i=t.if.call(l,null!=a?a.nolinkShares:a,{name:"if",hash:{},fn:e.program(2,s,0),inverse:e.noop,data:s}))?i:"")+(null!=(i=t.each.call(l,null!=a?a.linkShares:a,{name:"each",hash:{},fn:e.program(7,s,0),inverse:e.noop,data:s}))?i:"")+"</ul>\n"},2:function(e,a,n,s,i){var l,r,o=null!=a?a:e.nullContext||{},d=n.helperMissing,h=e.escapeExpression;return'\t\t<li data-share-id="'+h("function"===t(r=null!=(r=n.newShareId||(null!=a?a.newShareId:a))?r:d)?r.call(o,{name:"newShareId",hash:{},data:i}):r)+'">\n\t\t\t<div class="avatar icon-public-white"></div>\n\t\t\t<span class="username">'+h("function"===t(r=null!=(r=n.newShareLabel||(null!=a?a.newShareLabel:a))?r:d)?r.call(o,{name:"newShareLabel",hash:{},data:i}):r)+'</span>\n\t\t\t<span class="sharingOptionsGroup">\n\t\t\t\t<div class="share-menu">\n\t\t\t\t\t<a href="#" class="icon icon-add new-share has-tooltip '+(null!=(l=n.if.call(o,null!=a?a.showPending:a,{name:"if",hash:{},fn:e.program(3,i,0),inverse:e.noop,data:i}))?l:"")+'" title="'+h("function"===t(r=null!=(r=n.newShareTitle||(null!=a?a.newShareTitle:a))?r:d)?r.call(o,{name:"newShareTitle",hash:{},data:i}):r)+'"></a>\n\t\t\t\t\t<span class="icon icon-loading-small '+(null!=(l=n.unless.call(o,null!=a?a.showPending:a,{name:"unless",hash:{},fn:e.program(3,i,0),inverse:e.noop,data:i}))?l:"")+'"></span>\n'+(null!=(l=n.if.call(o,null!=a?a.showPending:a,{name:"if",hash:{},fn:e.program(5,i,0),inverse:e.noop,data:i}))?l:"")+"\t\t\t\t</div>\n\t\t\t</span>\n\t\t</li>\n"},3:function(e,a,t,n,s){return"hidden"},5:function(e,a,t,n,s){var i,l;return"\t\t\t\t\t\t"+(null!=(i="function"==typeof(l=null!=(l=t.pendingPopoverMenu||(null!=a?a.pendingPopoverMenu:a))?l:t.helperMissing)?l.call(null!=a?a:e.nullContext||{},{name:"pendingPopoverMenu",hash:{},data:s}):l)?i:"")+"\n"},7:function(e,a,n,s,i){var l,r,o=null!=a?a:e.nullContext||{},d=n.helperMissing,h="function",c=e.escapeExpression;return'\t\t<li data-share-id="'+c(t(r=null!=(r=n.cid||(null!=a?a.cid:a))?r:d)===h?r.call(o,{name:"cid",hash:{},data:i}):r)+'">\n\t\t\t<div class="avatar icon-public-white"></div>\n\t\t\t<span class="username" title="'+c(t(r=null!=(r=n.linkShareCreationDate||(null!=a?a.linkShareCreationDate:a))?r:d)===h?r.call(o,{name:"linkShareCreationDate",hash:{},data:i}):r)+'">'+c(t(r=null!=(r=n.linkShareLabel||(null!=a?a.linkShareLabel:a))?r:d)===h?r.call(o,{name:"linkShareLabel",hash:{},data:i}):r)+'</span>\n\t\t\t\n\t\t\t<span class="sharingOptionsGroup">\n\t\t\t\t<a href="#" class="clipboard-button icon icon-clippy has-tooltip" data-clipboard-text="'+c(t(r=null!=(r=n.shareLinkURL||(null!=a?a.shareLinkURL:a))?r:d)===h?r.call(o,{name:"shareLinkURL",hash:{},data:i}):r)+'" title="'+c(t(r=null!=(r=n.copyLabel||(null!=a?a.copyLabel:a))?r:d)===h?r.call(o,{name:"copyLabel",hash:{},data:i}):r)+'"></a>\n\t\t\t\t<div class="share-menu">\n\t\t\t\t\t<a href="#" class="icon icon-more '+(null!=(l=n.if.call(o,null!=a?a.showPending:a,{name:"if",hash:{},fn:e.program(3,i,0),inverse:e.noop,data:i}))?l:"")+'"></a>\n\t\t\t\t\t<span class="icon icon-loading-small '+(null!=(l=n.unless.call(o,null!=a?a.showPending:a,{name:"unless",hash:{},fn:e.program(3,i,0),inverse:e.noop,data:i}))?l:"")+'"></span>\n'+(null!=(l=n.if.call(o,null!=a?a.showPending:a,{name:"if",hash:{},fn:e.program(5,i,0),inverse:e.program(8,i,0),data:i}))?l:"")+"\t\t\t\t</div>\n\t\t\t</span>\n\t\t</li>\n"},8:function(e,a,t,n,s){var i,l;return"\t\t\t\t\t\t"+(null!=(i="function"==typeof(l=null!=(l=t.popoverMenu||(null!=a?a.popoverMenu:a))?l:t.helperMissing)?l.call(null!=a?a:e.nullContext||{},{name:"popoverMenu",hash:{},data:s}):l)?i:"")+"\n"},10:function(e,a,t,n,s){var i;return(null!=(i=t.if.call(null!=a?a:e.nullContext||{},null!=a?a.noSharingPlaceholder:a,{name:"if",hash:{},fn:e.program(11,s,0),inverse:e.noop,data:s}))?i:"")+"\n"},11:function(e,a,n,s,i){var l,r=null!=a?a:e.nullContext||{},o=n.helperMissing,d=e.escapeExpression;return'<input id="shareWith-'+d("function"===t(l=null!=(l=n.cid||(null!=a?a.cid:a))?l:o)?l.call(r,{name:"cid",hash:{},data:i}):l)+'" class="shareWithField" type="text" placeholder="'+d("function"===t(l=null!=(l=n.noSharingPlaceholder||(null!=a?a.noSharingPlaceholder:a))?l:o)?l.call(r,{name:"noSharingPlaceholder",hash:{},data:i}):l)+'" disabled="disabled" />'},compiler:[7,">= 4.0.0"],main:function(e,a,t,n,s){var i;return null!=(i=t.if.call(null!=a?a:e.nullContext||{},null!=a?a.shareAllowed:a,{name:"if",hash:{},fn:e.program(1,s,0),inverse:e.program(10,s,0),data:s}))?i:""},useData:!0}),s.sharedialoglinkshareview_popover_menu=n({1:function(e,a,n,s,i){var l,r,o=null!=a?a:e.nullContext||{},d=n.helperMissing,h="function",c=e.escapeExpression;return'\t\t\t<li>\n\t\t\t\t<span class="menuitem">\n\t\t\t\t\t<span class="icon-loading-small hidden"></span>\n\t\t\t\t\t<input type="radio" name="publicUpload" value="'+c(t(r=null!=(r=n.publicUploadRValue||(null!=a?a.publicUploadRValue:a))?r:d)===h?r.call(o,{name:"publicUploadRValue",hash:{},data:i}):r)+'" id="sharingDialogAllowPublicUpload-r-'+c(t(r=null!=(r=n.cid||(null!=a?a.cid:a))?r:d)===h?r.call(o,{name:"cid",hash:{},data:i}):r)+'" class="radio publicUploadRadio" '+(null!=(l=t(r=null!=(r=n.publicUploadRChecked||(null!=a?a.publicUploadRChecked:a))?r:d)===h?r.call(o,{name:"publicUploadRChecked",hash:{},data:i}):r)?l:"")+' />\n\t\t\t\t\t<label for="sharingDialogAllowPublicUpload-r-'+c(t(r=null!=(r=n.cid||(null!=a?a.cid:a))?r:d)===h?r.call(o,{name:"cid",hash:{},data:i}):r)+'">'+c(t(r=null!=(r=n.publicUploadRLabel||(null!=a?a.publicUploadRLabel:a))?r:d)===h?r.call(o,{name:"publicUploadRLabel",hash:{},data:i}):r)+'</label>\n\t\t\t\t</span>\n\t\t\t</li>\n\t\t\t<li>\n\t\t\t\t<span class="menuitem">\n\t\t\t\t\t<span class="icon-loading-small hidden"></span>\n\t\t\t\t\t<input type="radio" name="publicUpload" value="'+c(t(r=null!=(r=n.publicUploadRWValue||(null!=a?a.publicUploadRWValue:a))?r:d)===h?r.call(o,{name:"publicUploadRWValue",hash:{},data:i}):r)+'" id="sharingDialogAllowPublicUpload-rw-'+c(t(r=null!=(r=n.cid||(null!=a?a.cid:a))?r:d)===h?r.call(o,{name:"cid",hash:{},data:i}):r)+'" class="radio publicUploadRadio" '+(null!=(l=t(r=null!=(r=n.publicUploadRWChecked||(null!=a?a.publicUploadRWChecked:a))?r:d)===h?r.call(o,{name:"publicUploadRWChecked",hash:{},data:i}):r)?l:"")+' />\n\t\t\t\t\t<label for="sharingDialogAllowPublicUpload-rw-'+c(t(r=null!=(r=n.cid||(null!=a?a.cid:a))?r:d)===h?r.call(o,{name:"cid",hash:{},data:i}):r)+'">'+c(t(r=null!=(r=n.publicUploadRWLabel||(null!=a?a.publicUploadRWLabel:a))?r:d)===h?r.call(o,{name:"publicUploadRWLabel",hash:{},data:i}):r)+'</label>\n\t\t\t\t</span>\n\t\t\t</li>\n\t\t\t<li>\n\t\t\t\t<span class="menuitem">\n\t\t\t\t\t<span class="icon-loading-small hidden"></span>\n\t\t\t\t\t<input type="radio" name="publicUpload" value="'+c(t(r=null!=(r=n.publicUploadWValue||(null!=a?a.publicUploadWValue:a))?r:d)===h?r.call(o,{name:"publicUploadWValue",hash:{},data:i}):r)+'" id="sharingDialogAllowPublicUpload-w-'+c(t(r=null!=(r=n.cid||(null!=a?a.cid:a))?r:d)===h?r.call(o,{name:"cid",hash:{},data:i}):r)+'" class="radio publicUploadRadio" '+(null!=(l=t(r=null!=(r=n.publicUploadWChecked||(null!=a?a.publicUploadWChecked:a))?r:d)===h?r.call(o,{name:"publicUploadWChecked",hash:{},data:i}):r)?l:"")+' />\n\t\t\t\t\t<label for="sharingDialogAllowPublicUpload-w-'+c(t(r=null!=(r=n.cid||(null!=a?a.cid:a))?r:d)===h?r.call(o,{name:"cid",hash:{},data:i}):r)+'">'+c(t(r=null!=(r=n.publicUploadWLabel||(null!=a?a.publicUploadWLabel:a))?r:d)===h?r.call(o,{name:"publicUploadWLabel",hash:{},data:i}):r)+"</label>\n\t\t\t\t</span>\n\t\t\t</li>\n"},3:function(e,a,n,s,i){var l,r,o=null!=a?a:e.nullContext||{},d=n.helperMissing,h=e.escapeExpression;return'\t\t\t<li id="allowPublicEditingWrapper">\n\t\t\t\t<span class="menuitem">\n\t\t\t\t\t<span class="icon-loading-small hidden"></span>\n\t\t\t\t\t<input type="checkbox" name="allowPublicEditing" id="sharingDialogAllowPublicEditing-'+h("function"===t(r=null!=(r=n.cid||(null!=a?a.cid:a))?r:d)?r.call(o,{name:"cid",hash:{},data:i}):r)+'" class="checkbox publicEditingCheckbox" '+(null!=(l="function"===t(r=null!=(r=n.publicEditingChecked||(null!=a?a.publicEditingChecked:a))?r:d)?r.call(o,{name:"publicEditingChecked",hash:{},data:i}):r)?l:"")+' />\n\t\t\t\t\t<label for="sharingDialogAllowPublicEditing-'+h("function"===t(r=null!=(r=n.cid||(null!=a?a.cid:a))?r:d)?r.call(o,{name:"cid",hash:{},data:i}):r)+'">'+h("function"===t(r=null!=(r=n.publicEditingLabel||(null!=a?a.publicEditingLabel:a))?r:d)?r.call(o,{name:"publicEditingLabel",hash:{},data:i}):r)+"</label>\n\t\t\t\t</span>\n\t\t\t</li>\n"},5:function(e,a,t,n,s){return'checked="checked"'},7:function(e,a,t,n,s){return'disabled="disabled"'},9:function(e,a,t,n,s){return"hidden"},11:function(e,a,n,s,i){var l,r,o=null!=a?a:e.nullContext||{},d=n.helperMissing,h=e.escapeExpression;return'\t\t\t<li>\n\t\t\t\t<span class="shareOption menuitem">\n\t\t\t\t\t<span class="icon-loading-small hidden"></span>\n\t\t\t\t\t<input type="checkbox" name="passwordByTalk" id="passwordByTalk-'+h("function"===t(r=null!=(r=n.cid||(null!=a?a.cid:a))?r:d)?r.call(o,{name:"cid",hash:{},data:i}):r)+'" class="checkbox passwordByTalkCheckbox"\n\t\t\t\t\t'+(null!=(l=n.if.call(o,null!=a?a.isPasswordByTalkSet:a,{name:"if",hash:{},fn:e.program(5,i,0),inverse:e.noop,data:i}))?l:"")+' />\n\t\t\t\t\t<label for="passwordByTalk-'+h("function"===t(r=null!=(r=n.cid||(null!=a?a.cid:a))?r:d)?r.call(o,{name:"cid",hash:{},data:i}):r)+'">'+h("function"===t(r=null!=(r=n.passwordByTalkLabel||(null!=a?a.passwordByTalkLabel:a))?r:d)?r.call(o,{name:"passwordByTalkLabel",hash:{},data:i}):r)+"</label>\n\t\t\t\t</span>\n\t\t\t</li>\n"},13:function(e,a,t,n,s){return"datepicker"},15:function(e,a,t,n,s){var i;return e.escapeExpression("function"==typeof(i=null!=(i=t.expireDate||(null!=a?a.expireDate:a))?i:t.helperMissing)?i.call(null!=a?a:e.nullContext||{},{name:"expireDate",hash:{},data:s}):i)},17:function(e,a,t,n,s){var i;return e.escapeExpression("function"==typeof(i=null!=(i=t.defaultExpireDate||(null!=a?a.defaultExpireDate:a))?i:t.helperMissing)?i.call(null!=a?a:e.nullContext||{},{name:"defaultExpireDate",hash:{},data:s}):i)},19:function(e,a,t,n,s){return"readonly"},21:function(e,a,n,s,i){var l,r=null!=a?a:e.nullContext||{},o=n.helperMissing,d=e.escapeExpression;return'\t\t\t<li>\n\t\t\t\t<a href="#" class="menuitem pop-up" data-url="'+d("function"===t(l=null!=(l=n.url||(null!=a?a.url:a))?l:o)?l.call(r,{name:"url",hash:{},data:i}):l)+'" data-window="'+d("function"===t(l=null!=(l=n.newWindow||(null!=a?a.newWindow:a))?l:o)?l.call(r,{name:"newWindow",hash:{},data:i}):l)+'">\n\t\t\t\t\t<span class="icon '+d("function"===t(l=null!=(l=n.iconClass||(null!=a?a.iconClass:a))?l:o)?l.call(r,{name:"iconClass",hash:{},data:i}):l)+'"></span>\n\t\t\t\t\t<span>'+d("function"===t(l=null!=(l=n.label||(null!=a?a.label:a))?l:o)?l.call(r,{name:"label",hash:{},data:i}):l)+"</span>\n\t\t\t\t</a>\n\t\t\t</li>\n"},compiler:[7,">= 4.0.0"],main:function(e,a,n,s,i){var l,r,o=null!=a?a:e.nullContext||{},d=n.helperMissing,h="function",c=e.escapeExpression;return'<div class="popovermenu menu">\n\t<ul>\n\t\t<li class="hidden linkTextMenu">\n\t\t\t<span class="menuitem icon-link-text">\n\t\t\t\t<input id="linkText-'+c(t(r=null!=(r=n.cid||(null!=a?a.cid:a))?r:d)===h?r.call(o,{name:"cid",hash:{},data:i}):r)+'" class="linkText" type="text" readonly="readonly" value="'+c(t(r=null!=(r=n.shareLinkURL||(null!=a?a.shareLinkURL:a))?r:d)===h?r.call(o,{name:"shareLinkURL",hash:{},data:i}):r)+'" />\n\t\t\t</span>\n\t\t</li>\n'+(null!=(l=n.if.call(o,null!=a?a.publicUpload:a,{name:"if",hash:{},fn:e.program(1,i,0),inverse:e.noop,data:i}))?l:"")+(null!=(l=n.if.call(o,null!=a?a.publicEditing:a,{name:"if",hash:{},fn:e.program(3,i,0),inverse:e.noop,data:i}))?l:"")+'\t\t\t<li>\n\t\t\t\t<span class="menuitem">\n\t\t\t\t\t<span class="icon-loading-small hidden"></span>\n\t\t\t\t\t<input type="checkbox" name="hideDownload" id="sharingDialogHideDownload-'+c(t(r=null!=(r=n.cid||(null!=a?a.cid:a))?r:d)===h?r.call(o,{name:"cid",hash:{},data:i}):r)+'" class="checkbox hideDownloadCheckbox"\n\t\t\t\t\t'+(null!=(l=n.if.call(o,null!=a?a.hideDownload:a,{name:"if",hash:{},fn:e.program(5,i,0),inverse:e.noop,data:i}))?l:"")+' />\n\t\t\t\t\t<label for="sharingDialogHideDownload-'+c(t(r=null!=(r=n.cid||(null!=a?a.cid:a))?r:d)===h?r.call(o,{name:"cid",hash:{},data:i}):r)+'">'+c(t(r=null!=(r=n.hideDownloadLabel||(null!=a?a.hideDownloadLabel:a))?r:d)===h?r.call(o,{name:"hideDownloadLabel",hash:{},data:i}):r)+'</label>\n\t\t\t\t</span>\n\t\t\t</li>\n\t\t\t<li>\n\t\t\t\t<span class="menuitem">\n\t\t\t\t\t<input type="checkbox" name="showPassword" id="showPassword-'+c(t(r=null!=(r=n.cid||(null!=a?a.cid:a))?r:d)===h?r.call(o,{name:"cid",hash:{},data:i}):r)+'" class="checkbox showPasswordCheckbox"\n\t\t\t\t\t'+(null!=(l=n.if.call(o,null!=a?a.isPasswordSet:a,{name:"if",hash:{},fn:e.program(5,i,0),inverse:e.noop,data:i}))?l:"")+" "+(null!=(l=n.if.call(o,null!=a?a.isPasswordEnforced:a,{name:"if",hash:{},fn:e.program(7,i,0),inverse:e.noop,data:i}))?l:"")+' value="1" />\n\t\t\t\t\t<label for="showPassword-'+c(t(r=null!=(r=n.cid||(null!=a?a.cid:a))?r:d)===h?r.call(o,{name:"cid",hash:{},data:i}):r)+'">'+c(t(r=null!=(r=n.enablePasswordLabel||(null!=a?a.enablePasswordLabel:a))?r:d)===h?r.call(o,{name:"enablePasswordLabel",hash:{},data:i}):r)+'</label>\n\t\t\t\t</span>\n\t\t\t</li>\n\t\t\t<li class="'+(null!=(l=n.unless.call(o,null!=a?a.isPasswordSet:a,{name:"unless",hash:{},fn:e.program(9,i,0),inverse:e.noop,data:i}))?l:"")+' linkPassMenu">\n\t\t\t\t<span class="menuitem icon-share-pass">\n\t\t\t\t\t<input id="linkPassText-'+c(t(r=null!=(r=n.cid||(null!=a?a.cid:a))?r:d)===h?r.call(o,{name:"cid",hash:{},data:i}):r)+'" class="linkPassText" type="password" placeholder="'+c(t(r=null!=(r=n.passwordPlaceholder||(null!=a?a.passwordPlaceholder:a))?r:d)===h?r.call(o,{name:"passwordPlaceholder",hash:{},data:i}):r)+'" autocomplete="new-password" />\n\t\t\t\t\t<input type="submit" class="icon-confirm share-pass-submit" value="" />\n\t\t\t\t\t<span class="icon icon-loading-small hidden"></span>\n\t\t\t\t</span>\n\t\t\t</li>\n'+(null!=(l=n.if.call(o,null!=a?a.showPasswordByTalkCheckBox:a,{name:"if",hash:{},fn:e.program(11,i,0),inverse:e.noop,data:i}))?l:"")+'\t\t<li>\n\t\t\t<span class="menuitem">\n\t\t\t\t<input id="expireDate-'+c(t(r=null!=(r=n.cid||(null!=a?a.cid:a))?r:d)===h?r.call(o,{name:"cid",hash:{},data:i}):r)+'" type="checkbox" name="expirationDate" class="expireDate checkbox"\n\t\t\t\t'+(null!=(l=n.if.call(o,null!=a?a.hasExpireDate:a,{name:"if",hash:{},fn:e.program(5,i,0),inverse:e.noop,data:i}))?l:"")+" "+(null!=(l=n.if.call(o,null!=a?a.isExpirationEnforced:a,{name:"if",hash:{},fn:e.program(7,i,0),inverse:e.noop,data:i}))?l:"")+' />\n\t\t\t\t<label for="expireDate-'+c(t(r=null!=(r=n.cid||(null!=a?a.cid:a))?r:d)===h?r.call(o,{name:"cid",hash:{},data:i}):r)+'">'+c(t(r=null!=(r=n.expireDateLabel||(null!=a?a.expireDateLabel:a))?r:d)===h?r.call(o,{name:"expireDateLabel",hash:{},data:i}):r)+'</label>\n\t\t\t</span>\n\t\t</li>\n\t\t<li class="'+(null!=(l=n.unless.call(o,null!=a?a.hasExpireDate:a,{name:"unless",hash:{},fn:e.program(9,i,0),inverse:e.noop,data:i}))?l:"")+'">\n\t\t\t<span class="menuitem icon-expiredate expirationDateContainer-'+c(t(r=null!=(r=n.cid||(null!=a?a.cid:a))?r:d)===h?r.call(o,{name:"cid",hash:{},data:i}):r)+'">\n\t\t\t\t<label for="expirationDatePicker-'+c(t(r=null!=(r=n.cid||(null!=a?a.cid:a))?r:d)===h?r.call(o,{name:"cid",hash:{},data:i}):r)+'" class="hidden-visually" value="'+c(t(r=null!=(r=n.expirationDate||(null!=a?a.expirationDate:a))?r:d)===h?r.call(o,{name:"expirationDate",hash:{},data:i}):r)+'">'+c(t(r=null!=(r=n.expirationLabel||(null!=a?a.expirationLabel:a))?r:d)===h?r.call(o,{name:"expirationLabel",hash:{},data:i}):r)+'</label>\n\t\t\t\t\x3c!-- do not use the datepicker if enforced --\x3e\n\t\t\t\t<input id="expirationDatePicker-'+c(t(r=null!=(r=n.cid||(null!=a?a.cid:a))?r:d)===h?r.call(o,{name:"cid",hash:{},data:i}):r)+'" class="'+(null!=(l=n.unless.call(o,null!=a?a.isExpirationEnforced:a,{name:"unless",hash:{},fn:e.program(13,i,0),inverse:e.noop,data:i}))?l:"")+'" type="text"\n\t\t\t\t\tplaceholder="'+c(t(r=null!=(r=n.expirationDatePlaceholder||(null!=a?a.expirationDatePlaceholder:a))?r:d)===h?r.call(o,{name:"expirationDatePlaceholder",hash:{},data:i}):r)+'" value="'+(null!=(l=n.if.call(o,null!=a?a.hasExpireDate:a,{name:"if",hash:{},fn:e.program(15,i,0),inverse:e.program(17,i,0),data:i}))?l:"")+'"\n\t\t\t\t\tdata-max-date="'+c(t(r=null!=(r=n.maxDate||(null!=a?a.maxDate:a))?r:d)===h?r.call(o,{name:"maxDate",hash:{},data:i}):r)+'" '+(null!=(l=n.if.call(o,null!=a?a.isExpirationEnforced:a,{name:"if",hash:{},fn:e.program(19,i,0),inverse:e.noop,data:i}))?l:"")+' />\n\t\t\t</span>\n\t\t\t</li>\n\t\t<li>\n\t\t\t<a href="#" class="share-add">\n\t\t\t\t<span class="icon-loading-small hidden"></span>\n\t\t\t\t<span class="icon icon-edit"></span>\n\t\t\t\t<span>'+c(t(r=null!=(r=n.addNoteLabel||(null!=a?a.addNoteLabel:a))?r:d)===h?r.call(o,{name:"addNoteLabel",hash:{},data:i}):r)+'</span>\n\t\t\t\t<input type="button" class="share-note-delete icon-delete '+(null!=(l=n.unless.call(o,null!=a?a.hasNote:a,{name:"unless",hash:{},fn:e.program(9,i,0),inverse:e.noop,data:i}))?l:"")+'">\n\t\t\t</a>\n\t\t</li>\n\t\t<li class="share-note-form share-note-link '+(null!=(l=n.unless.call(o,null!=a?a.hasNote:a,{name:"unless",hash:{},fn:e.program(9,i,0),inverse:e.noop,data:i}))?l:"")+'">\n\t\t\t<span class="menuitem icon-note">\n\t\t\t\t<textarea class="share-note">'+c(t(r=null!=(r=n.shareNote||(null!=a?a.shareNote:a))?r:d)===h?r.call(o,{name:"shareNote",hash:{},data:i}):r)+'</textarea>\n\t\t\t\t<input type="submit" class="icon-confirm share-note-submit" value="" id="add-note-'+c(t(r=null!=(r=n.shareId||(null!=a?a.shareId:a))?r:d)===h?r.call(o,{name:"shareId",hash:{},data:i}):r)+'" />\n\t\t\t</span>\n\t\t</li>\n'+(null!=(l=n.each.call(o,null!=a?a.social:a,{name:"each",hash:{},fn:e.program(21,i,0),inverse:e.noop,data:i}))?l:"")+'\t\t<li>\n\t\t\t<a href="#" class="unshare"><span class="icon-loading-small hidden"></span><span class="icon icon-delete"></span><span>'+c(t(r=null!=(r=n.unshareLinkLabel||(null!=a?a.unshareLinkLabel:a))?r:d)===h?r.call(o,{name:"unshareLinkLabel",hash:{},data:i}):r)+'</span></a>\n\t\t</li>\n\t\t<li>\n\t\t\t<a href="#" class="new-share">\n\t\t\t\t<span class="icon-loading-small hidden"></span>\n\t\t\t\t<span class="icon icon-add"></span>\n\t\t\t\t<span>'+c(t(r=null!=(r=n.newShareLabel||(null!=a?a.newShareLabel:a))?r:d)===h?r.call(o,{name:"newShareLabel",hash:{},data:i}):r)+"</span>\n\t\t\t</a>\n\t\t</li>\n\t</ul>\n</div>\n"},useData:!0}),s.sharedialoglinkshareview_popover_menu_pending=n({1:function(e,a,n,s,i){var l,r=null!=a?a:e.nullContext||{},o=n.helperMissing,d=e.escapeExpression;return'\t\t\t<li>\n\t\t\t\t<span class="menuitem icon-info">\n\t\t\t\t\t<p>'+d("function"===t(l=null!=(l=n.enforcedPasswordLabel||(null!=a?a.enforcedPasswordLabel:a))?l:o)?l.call(r,{name:"enforcedPasswordLabel",hash:{},data:i}):l)+'</p>\n\t\t\t\t</span>\n\t\t\t</li>\n\t\t\t<li class="linkPassMenu">\n\t\t\t\t<span class="menuitem">\n\t\t\t\t\t<form autocomplete="off" class="enforcedPassForm">\n\t\t\t\t\t\t<input id="enforcedPassText" required class="enforcedPassText" type="password"\n\t\t\t\t\t\t\tplaceholder="'+d("function"===t(l=null!=(l=n.passwordPlaceholder||(null!=a?a.passwordPlaceholder:a))?l:o)?l.call(r,{name:"passwordPlaceholder",hash:{},data:i}):l)+'" autocomplete="enforcedPassText" minlength="'+d("function"===t(l=null!=(l=n.minPasswordLength||(null!=a?a.minPasswordLength:a))?l:o)?l.call(r,{name:"minPasswordLength",hash:{},data:i}):l)+'" />\n\t\t\t\t\t\t<input type="submit" value=" " class="primary icon-checkmark-white">\n\t\t\t\t\t</form>\n\t\t\t\t</span>\n\t\t\t</li>\n'},compiler:[7,">= 4.0.0"],main:function(e,a,t,n,s){var i;return'<div class="popovermenu open menu pending">\n\t<ul>\n'+(null!=(i=t.if.call(null!=a?a:e.nullContext||{},null!=a?a.isPasswordEnforced:a,{name:"if",hash:{},fn:e.program(1,s,0),inverse:e.noop,data:s}))?i:"")+"\t</ul>\n</div>\n"},useData:!0}),s.sharedialogresharerinfoview=n({1:function(e,a,t,n,s){var i;return'<div class="share-note">'+e.escapeExpression("function"==typeof(i=null!=(i=t.shareNote||(null!=a?a.shareNote:a))?i:t.helperMissing)?i.call(null!=a?a:e.nullContext||{},{name:"shareNote",hash:{},data:s}):i)+"</div>"},compiler:[7,">= 4.0.0"],main:function(e,a,n,s,i){var l,r,o=null!=a?a:e.nullContext||{},d=n.helperMissing,h=e.escapeExpression;return'<span class="reshare">\n\t<div class="avatar" data-userName="'+h("function"===t(r=null!=(r=n.reshareOwner||(null!=a?a.reshareOwner:a))?r:d)?r.call(o,{name:"reshareOwner",hash:{},data:i}):r)+'"></div>\n\t'+h("function"===t(r=null!=(r=n.sharedByText||(null!=a?a.sharedByText:a))?r:d)?r.call(o,{name:"sharedByText",hash:{},data:i}):r)+"\n</span>\n"+(null!=(l=n.if.call(o,null!=a?a.hasShareNote:a,{name:"if",hash:{},fn:e.program(1,i,0),inverse:e.noop,data:i}))?l:"")+"\n"},useData:!0}),s.sharedialogshareelistview=n({1:function(e,a,t,n,s){var i;return null!=(i=t.unless.call(null!=a?a:e.nullContext||{},null!=a?a.isShareWithCurrentUser:a,{name:"unless",hash:{},fn:e.program(2,s,0),inverse:e.noop,data:s}))?i:""},2:function(e,a,n,s,i){var l,r,o=null!=a?a:e.nullContext||{},d=n.helperMissing,h="function",c=e.escapeExpression;return'\t\t<li data-share-id="'+c(t(r=null!=(r=n.shareId||(null!=a?a.shareId:a))?r:d)===h?r.call(o,{name:"shareId",hash:{},data:i}):r)+'" data-share-type="'+c(t(r=null!=(r=n.shareType||(null!=a?a.shareType:a))?r:d)===h?r.call(o,{name:"shareType",hash:{},data:i}):r)+'" data-share-with="'+c(t(r=null!=(r=n.shareWith||(null!=a?a.shareWith:a))?r:d)===h?r.call(o,{name:"shareWith",hash:{},data:i}):r)+'">\n\t\t\t<div class="avatar '+(null!=(l=n.if.call(o,null!=a?a.modSeed:a,{name:"if",hash:{},fn:e.program(3,i,0),inverse:e.noop,data:i}))?l:"")+'" data-username="'+c(t(r=null!=(r=n.shareWith||(null!=a?a.shareWith:a))?r:d)===h?r.call(o,{name:"shareWith",hash:{},data:i}):r)+'" data-avatar="'+c(t(r=null!=(r=n.shareWithAvatar||(null!=a?a.shareWithAvatar:a))?r:d)===h?r.call(o,{name:"shareWithAvatar",hash:{},data:i}):r)+'" data-displayname="'+c(t(r=null!=(r=n.shareWithDisplayName||(null!=a?a.shareWithDisplayName:a))?r:d)===h?r.call(o,{name:"shareWithDisplayName",hash:{},data:i}):r)+'" '+(null!=(l=n.if.call(o,null!=a?a.modSeed:a,{name:"if",hash:{},fn:e.program(5,i,0),inverse:e.noop,data:i}))?l:"")+'></div>\n\t\t\t<span class="username" title="'+c(t(r=null!=(r=n.shareWithTitle||(null!=a?a.shareWithTitle:a))?r:d)===h?r.call(o,{name:"shareWithTitle",hash:{},data:i}):r)+'">'+c(t(r=null!=(r=n.shareWithDisplayName||(null!=a?a.shareWithDisplayName:a))?r:d)===h?r.call(o,{name:"shareWithDisplayName",hash:{},data:i}):r)+"</span>\n"+(null!=(l=n.if.call(o,null!=a?a.canUpdateShareSettings:a,{name:"if",hash:{},fn:e.program(7,i,0),inverse:e.noop,data:i}))?l:"")+"\t\t</li>\n"},3:function(e,a,t,n,s){return"imageplaceholderseed"},5:function(e,a,n,s,i){var l,r=null!=a?a:e.nullContext||{},o=n.helperMissing,d=e.escapeExpression;return'data-seed="'+d("function"===t(l=null!=(l=n.shareWith||(null!=a?a.shareWith:a))?l:o)?l.call(r,{name:"shareWith",hash:{},data:i}):l)+" "+d("function"===t(l=null!=(l=n.shareType||(null!=a?a.shareType:a))?l:o)?l.call(r,{name:"shareType",hash:{},data:i}):l)+'"'},7:function(e,a,t,n,s){var i,l,r=null!=a?a:e.nullContext||{};return'\t\t\t<span class="sharingOptionsGroup">\n'+(null!=(i=t.if.call(r,null!=a?a.editPermissionPossible:a,{name:"if",hash:{},fn:e.program(8,s,0),inverse:e.noop,data:s}))?i:"")+'\t\t\t\t<div tabindex="0" class="share-menu"><span class="icon icon-more"></span>\n\t\t\t\t\t'+(null!=(i="function"==typeof(l=null!=(l=t.popoverMenu||(null!=a?a.popoverMenu:a))?l:t.helperMissing)?l.call(r,{name:"popoverMenu",hash:{},data:s}):l)?i:"")+"\n\t\t\t\t</div>\n\t\t\t</span>\n"},8:function(e,a,n,s,i){var l,r=null!=a?a:e.nullContext||{},o=n.helperMissing,d="function",h=e.escapeExpression;return'\t\t\t\t\t<span>\n\t\t\t\t\t\t<input id="canEdit-'+h(t(l=null!=(l=n.cid||(null!=a?a.cid:a))?l:o)===d?l.call(r,{name:"cid",hash:{},data:i}):l)+"-"+h(t(l=null!=(l=n.shareId||(null!=a?a.shareId:a))?l:o)===d?l.call(r,{name:"shareId",hash:{},data:i}):l)+'" type="checkbox" name="edit" class="permissions checkbox" />\n\t\t\t\t\t\t<label for="canEdit-'+h(t(l=null!=(l=n.cid||(null!=a?a.cid:a))?l:o)===d?l.call(r,{name:"cid",hash:{},data:i}):l)+"-"+h(t(l=null!=(l=n.shareId||(null!=a?a.shareId:a))?l:o)===d?l.call(r,{name:"shareId",hash:{},data:i}):l)+'">'+h(t(l=null!=(l=n.canEditLabel||(null!=a?a.canEditLabel:a))?l:o)===d?l.call(r,{name:"canEditLabel",hash:{},data:i}):l)+"</label>\n\t\t\t\t\t</span>\n"},10:function(e,a,n,s,i){var l,r=null!=a?a:e.nullContext||{},o=n.helperMissing,d="function",h=e.escapeExpression;return'\t\t<li data-share-id="'+h(t(l=null!=(l=n.shareId||(null!=a?a.shareId:a))?l:o)===d?l.call(r,{name:"shareId",hash:{},data:i}):l)+'" data-share-type="'+h(t(l=null!=(l=n.shareType||(null!=a?a.shareType:a))?l:o)===d?l.call(r,{name:"shareType",hash:{},data:i}):l)+'">\n\t\t\t<div class="avatar" data-username="'+h(t(l=null!=(l=n.shareInitiator||(null!=a?a.shareInitiator:a))?l:o)===d?l.call(r,{name:"shareInitiator",hash:{},data:i}):l)+'"></div>\n\t\t\t<span class="has-tooltip username" title="'+h(t(l=null!=(l=n.shareInitiator||(null!=a?a.shareInitiator:a))?l:o)===d?l.call(r,{name:"shareInitiator",hash:{},data:i}):l)+'">'+h(t(l=null!=(l=n.shareInitiatorText||(null!=a?a.shareInitiatorText:a))?l:o)===d?l.call(r,{name:"shareInitiatorText",hash:{},data:i}):l)+'</span>\n\t\t\t<span class="sharingOptionsGroup">\n\t\t\t\t<a href="#" class="unshare"><span class="icon-loading-small hidden"></span><span class="icon icon-delete"></span><span class="hidden-visually">'+h(t(l=null!=(l=n.unshareLabel||(null!=a?a.unshareLabel:a))?l:o)===d?l.call(r,{name:"unshareLabel",hash:{},data:i}):l)+"</span></a>\n\t\t\t</span>\n\t\t</li>\n"},compiler:[7,">= 4.0.0"],main:function(e,a,t,n,s){var i,l=null!=a?a:e.nullContext||{};return'<ul id="shareWithList" class="shareWithList">\n'+(null!=(i=t.each.call(l,null!=a?a.sharees:a,{name:"each",hash:{},fn:e.program(1,s,0),inverse:e.noop,data:s}))?i:"")+(null!=(i=t.each.call(l,null!=a?a.linkReshares:a,{name:"each",hash:{},fn:e.program(10,s,0),inverse:e.noop,data:s}))?i:"")+"</ul>\n"},useData:!0}),s.sharedialogshareelistview_popover_menu=n({1:function(e,a,t,n,s){var i;return" "+(null!=(i=t.if.call(null!=a?a:e.nullContext||{},null!=a?a.sharePermissionPossible:a,{name:"if",hash:{},fn:e.program(2,s,0),inverse:e.noop,data:s}))?i:"")+" "},2:function(e,a,t,n,s){var i;return" "+(null!=(i=t.unless.call(null!=a?a:e.nullContext||{},null!=a?a.isMailShare:a,{name:"unless",hash:{},fn:e.program(3,s,0),inverse:e.noop,data:s}))?i:"")+" "},3:function(e,a,n,s,i){var l,r,o=null!=a?a:e.nullContext||{},d=n.helperMissing,h="function",c=e.escapeExpression;return'\n\t\t\t<li>\n\t\t\t\t<span class="menuitem">\n\t\t\t\t\t<input id="canShare-'+c(t(r=null!=(r=n.cid||(null!=a?a.cid:a))?r:d)===h?r.call(o,{name:"cid",hash:{},data:i}):r)+"-"+c(t(r=null!=(r=n.shareId||(null!=a?a.shareId:a))?r:d)===h?r.call(o,{name:"shareId",hash:{},data:i}):r)+'" type="checkbox" name="share" class="permissions checkbox" '+(null!=(l=n.if.call(o,null!=a?a.hasSharePermission:a,{name:"if",hash:{},fn:e.program(4,i,0),inverse:e.noop,data:i}))?l:"")+' data-permissions="'+c(t(r=null!=(r=n.sharePermission||(null!=a?a.sharePermission:a))?r:d)===h?r.call(o,{name:"sharePermission",hash:{},data:i}):r)+'" />\n\t\t\t\t\t<label for="canShare-'+c(t(r=null!=(r=n.cid||(null!=a?a.cid:a))?r:d)===h?r.call(o,{name:"cid",hash:{},data:i}):r)+"-"+c(t(r=null!=(r=n.shareId||(null!=a?a.shareId:a))?r:d)===h?r.call(o,{name:"shareId",hash:{},data:i}):r)+'">'+c(t(r=null!=(r=n.canShareLabel||(null!=a?a.canShareLabel:a))?r:d)===h?r.call(o,{name:"canShareLabel",hash:{},data:i}):r)+"</label>\n\t\t\t\t</span>\n\t\t\t\t</li>\n\t\t\t"},4:function(e,a,t,n,s){return'checked="checked"'},6:function(e,a,t,n,s){var i,l=null!=a?a:e.nullContext||{};return"\t\t\t"+(null!=(i=t.if.call(l,null!=a?a.createPermissionPossible:a,{name:"if",hash:{},fn:e.program(7,s,0),inverse:e.noop,data:s}))?i:"")+"\n\t\t\t"+(null!=(i=t.if.call(l,null!=a?a.updatePermissionPossible:a,{name:"if",hash:{},fn:e.program(10,s,0),inverse:e.noop,data:s}))?i:"")+"\n\t\t\t"+(null!=(i=t.if.call(l,null!=a?a.deletePermissionPossible:a,{name:"if",hash:{},fn:e.program(13,s,0),inverse:e.noop,data:s}))?i:"")+"\n"},7:function(e,a,t,n,s){var i;return null!=(i=t.unless.call(null!=a?a:e.nullContext||{},null!=a?a.isMailShare:a,{name:"unless",hash:{},fn:e.program(8,s,0),inverse:e.noop,data:s}))?i:""},8:function(e,a,n,s,i){var l,r,o=null!=a?a:e.nullContext||{},d=n.helperMissing,h="function",c=e.escapeExpression;return'\n\t\t\t\t<li>\n\t\t\t\t\t<span class="menuitem">\n\t\t\t\t\t\t<input id="canCreate-'+c(t(r=null!=(r=n.cid||(null!=a?a.cid:a))?r:d)===h?r.call(o,{name:"cid",hash:{},data:i}):r)+"-"+c(t(r=null!=(r=n.shareId||(null!=a?a.shareId:a))?r:d)===h?r.call(o,{name:"shareId",hash:{},data:i}):r)+'" type="checkbox" name="create" class="permissions checkbox" '+(null!=(l=n.if.call(o,null!=a?a.hasCreatePermission:a,{name:"if",hash:{},fn:e.program(4,i,0),inverse:e.noop,data:i}))?l:"")+' data-permissions="'+c(t(r=null!=(r=n.createPermission||(null!=a?a.createPermission:a))?r:d)===h?r.call(o,{name:"createPermission",hash:{},data:i}):r)+'"/>\n\t\t\t\t\t\t<label for="canCreate-'+c(t(r=null!=(r=n.cid||(null!=a?a.cid:a))?r:d)===h?r.call(o,{name:"cid",hash:{},data:i}):r)+"-"+c(t(r=null!=(r=n.shareId||(null!=a?a.shareId:a))?r:d)===h?r.call(o,{name:"shareId",hash:{},data:i}):r)+'">'+c(t(r=null!=(r=n.createPermissionLabel||(null!=a?a.createPermissionLabel:a))?r:d)===h?r.call(o,{name:"createPermissionLabel",hash:{},data:i}):r)+"</label>\n\t\t\t\t\t</span>\n\t\t\t\t</li>\n\t\t\t"},10:function(e,a,t,n,s){var i;return null!=(i=t.unless.call(null!=a?a:e.nullContext||{},null!=a?a.isMailShare:a,{name:"unless",hash:{},fn:e.program(11,s,0),inverse:e.noop,data:s}))?i:""},11:function(e,a,n,s,i){var l,r,o=null!=a?a:e.nullContext||{},d=n.helperMissing,h="function",c=e.escapeExpression;return'\n\t\t\t\t<li>\n\t\t\t\t\t<span class="menuitem">\n\t\t\t\t\t\t<input id="canUpdate-'+c(t(r=null!=(r=n.cid||(null!=a?a.cid:a))?r:d)===h?r.call(o,{name:"cid",hash:{},data:i}):r)+"-"+c(t(r=null!=(r=n.shareId||(null!=a?a.shareId:a))?r:d)===h?r.call(o,{name:"shareId",hash:{},data:i}):r)+'" type="checkbox" name="update" class="permissions checkbox" '+(null!=(l=n.if.call(o,null!=a?a.hasUpdatePermission:a,{name:"if",hash:{},fn:e.program(4,i,0),inverse:e.noop,data:i}))?l:"")+' data-permissions="'+c(t(r=null!=(r=n.updatePermission||(null!=a?a.updatePermission:a))?r:d)===h?r.call(o,{name:"updatePermission",hash:{},data:i}):r)+'"/>\n\t\t\t\t\t\t<label for="canUpdate-'+c(t(r=null!=(r=n.cid||(null!=a?a.cid:a))?r:d)===h?r.call(o,{name:"cid",hash:{},data:i}):r)+"-"+c(t(r=null!=(r=n.shareId||(null!=a?a.shareId:a))?r:d)===h?r.call(o,{name:"shareId",hash:{},data:i}):r)+'">'+c(t(r=null!=(r=n.updatePermissionLabel||(null!=a?a.updatePermissionLabel:a))?r:d)===h?r.call(o,{name:"updatePermissionLabel",hash:{},data:i}):r)+"</label>\n\t\t\t\t\t</span>\n\t\t\t\t</li>\n\t\t\t\t"},13:function(e,a,t,n,s){var i;return null!=(i=t.unless.call(null!=a?a:e.nullContext||{},null!=a?a.isMailShare:a,{name:"unless",hash:{},fn:e.program(14,s,0),inverse:e.noop,data:s}))?i:""},14:function(e,a,n,s,i){var l,r,o=null!=a?a:e.nullContext||{},d=n.helperMissing,h="function",c=e.escapeExpression;return'\n\t\t\t\t<li>\n\t\t\t\t\t<span class="menuitem">\n\t\t\t\t\t\t<input id="canDelete-'+c(t(r=null!=(r=n.cid||(null!=a?a.cid:a))?r:d)===h?r.call(o,{name:"cid",hash:{},data:i}):r)+"-"+c(t(r=null!=(r=n.shareId||(null!=a?a.shareId:a))?r:d)===h?r.call(o,{name:"shareId",hash:{},data:i}):r)+'" type="checkbox" name="delete" class="permissions checkbox" '+(null!=(l=n.if.call(o,null!=a?a.hasDeletePermission:a,{name:"if",hash:{},fn:e.program(4,i,0),inverse:e.noop,data:i}))?l:"")+' data-permissions="'+c(t(r=null!=(r=n.deletePermission||(null!=a?a.deletePermission:a))?r:d)===h?r.call(o,{name:"deletePermission",hash:{},data:i}):r)+'"/>\n\t\t\t\t\t\t<label for="canDelete-'+c(t(r=null!=(r=n.cid||(null!=a?a.cid:a))?r:d)===h?r.call(o,{name:"cid",hash:{},data:i}):r)+"-"+c(t(r=null!=(r=n.shareId||(null!=a?a.shareId:a))?r:d)===h?r.call(o,{name:"shareId",hash:{},data:i}):r)+'">'+c(t(r=null!=(r=n.deletePermissionLabel||(null!=a?a.deletePermissionLabel:a))?r:d)===h?r.call(o,{name:"deletePermissionLabel",hash:{},data:i}):r)+"</label>\n\t\t\t\t\t</span>\n\t\t\t\t</li>\n\t\t\t\t"},16:function(e,a,n,s,i){var l,r,o=null!=a?a:e.nullContext||{},d=n.helperMissing,h="function",c=e.escapeExpression;return(null!=(l=n.if.call(o,null!=a?a.hasCreatePermission:a,{name:"if",hash:{},fn:e.program(17,i,0),inverse:e.noop,data:i}))?l:"")+'\t\t\t<li>\n\t\t\t\t<span class="menuitem">\n\t\t\t\t\t<input id="password-'+c(t(r=null!=(r=n.cid||(null!=a?a.cid:a))?r:d)===h?r.call(o,{name:"cid",hash:{},data:i}):r)+"-"+c(t(r=null!=(r=n.shareId||(null!=a?a.shareId:a))?r:d)===h?r.call(o,{name:"shareId",hash:{},data:i}):r)+'" type="checkbox" name="password" class="password checkbox" '+(null!=(l=n.if.call(o,null!=a?a.isPasswordSet:a,{name:"if",hash:{},fn:e.program(4,i,0),inverse:e.noop,data:i}))?l:"")+(null!=(l=n.if.call(o,null!=a?a.isPasswordSet:a,{name:"if",hash:{},fn:e.program(19,i,0),inverse:e.noop,data:i}))?l:"")+'" />\n\t\t\t\t\t<label for="password-'+c(t(r=null!=(r=n.cid||(null!=a?a.cid:a))?r:d)===h?r.call(o,{name:"cid",hash:{},data:i}):r)+"-"+c(t(r=null!=(r=n.shareId||(null!=a?a.shareId:a))?r:d)===h?r.call(o,{name:"shareId",hash:{},data:i}):r)+'">'+c(t(r=null!=(r=n.passwordLabel||(null!=a?a.passwordLabel:a))?r:d)===h?r.call(o,{name:"passwordLabel",hash:{},data:i}):r)+'</label>\n\t\t\t\t</span>\n\t\t\t</li>\n\t\t\t<li class="passwordMenu-'+c(t(r=null!=(r=n.cid||(null!=a?a.cid:a))?r:d)===h?r.call(o,{name:"cid",hash:{},data:i}):r)+"-"+c(t(r=null!=(r=n.shareId||(null!=a?a.shareId:a))?r:d)===h?r.call(o,{name:"shareId",hash:{},data:i}):r)+" "+(null!=(l=n.unless.call(o,null!=a?a.isPasswordSet:a,{name:"unless",hash:{},fn:e.program(22,i,0),inverse:e.noop,data:i}))?l:"")+'">\n\t\t\t\t<span class="passwordContainer-'+c(t(r=null!=(r=n.cid||(null!=a?a.cid:a))?r:d)===h?r.call(o,{name:"cid",hash:{},data:i}):r)+"-"+c(t(r=null!=(r=n.shareId||(null!=a?a.shareId:a))?r:d)===h?r.call(o,{name:"shareId",hash:{},data:i}):r)+' icon-passwordmail menuitem">\n\t\t\t\t\t<label for="passwordField-'+c(t(r=null!=(r=n.cid||(null!=a?a.cid:a))?r:d)===h?r.call(o,{name:"cid",hash:{},data:i}):r)+"-"+c(t(r=null!=(r=n.shareId||(null!=a?a.shareId:a))?r:d)===h?r.call(o,{name:"shareId",hash:{},data:i}):r)+'" class="hidden-visually" value="'+c(t(r=null!=(r=n.password||(null!=a?a.password:a))?r:d)===h?r.call(o,{name:"password",hash:{},data:i}):r)+'">'+c(t(r=null!=(r=n.passwordLabel||(null!=a?a.passwordLabel:a))?r:d)===h?r.call(o,{name:"passwordLabel",hash:{},data:i}):r)+'</label>\n\t\t\t\t\t<input id="passwordField-'+c(t(r=null!=(r=n.cid||(null!=a?a.cid:a))?r:d)===h?r.call(o,{name:"cid",hash:{},data:i}):r)+"-"+c(t(r=null!=(r=n.shareId||(null!=a?a.shareId:a))?r:d)===h?r.call(o,{name:"shareId",hash:{},data:i}):r)+'" class="passwordField" type="password" placeholder="'+c(t(r=null!=(r=n.passwordPlaceholder||(null!=a?a.passwordPlaceholder:a))?r:d)===h?r.call(o,{name:"passwordPlaceholder",hash:{},data:i}):r)+'" value="'+c(t(r=null!=(r=n.passwordValue||(null!=a?a.passwordValue:a))?r:d)===h?r.call(o,{name:"passwordValue",hash:{},data:i}):r)+'" autocomplete="new-password" />\n\t\t\t\t\t<span class="icon-loading-small hidden"></span>\n\t\t\t\t</span>\n\t\t\t</li>\n'+(null!=(l=n.if.call(o,null!=a?a.isTalkEnabled:a,{name:"if",hash:{},fn:e.program(24,i,0),inverse:e.noop,data:i}))?l:"")},17:function(e,a,n,s,i){var l,r,o=null!=a?a:e.nullContext||{},d=n.helperMissing,h="function",c=e.escapeExpression;return'\t\t\t\t<li>\n\t\t\t\t\t<span class="menuitem">\n\t\t\t\t\t\t<input id="secureDrop-'+c(t(r=null!=(r=n.cid||(null!=a?a.cid:a))?r:d)===h?r.call(o,{name:"cid",hash:{},data:i}):r)+"-"+c(t(r=null!=(r=n.shareId||(null!=a?a.shareId:a))?r:d)===h?r.call(o,{name:"shareId",hash:{},data:i}):r)+'" type="checkbox" name="secureDrop" class="checkbox secureDrop" '+(null!=(l=n.if.call(o,null!=a?a.secureDropMode:a,{name:"if",hash:{},fn:e.program(4,i,0),inverse:e.noop,data:i}))?l:"")+' data-permissions="'+c(t(r=null!=(r=n.readPermission||(null!=a?a.readPermission:a))?r:d)===h?r.call(o,{name:"readPermission",hash:{},data:i}):r)+'"/>\n\t\t\t\t\t\t<label for="secureDrop-'+c(t(r=null!=(r=n.cid||(null!=a?a.cid:a))?r:d)===h?r.call(o,{name:"cid",hash:{},data:i}):r)+"-"+c(t(r=null!=(r=n.shareId||(null!=a?a.shareId:a))?r:d)===h?r.call(o,{name:"shareId",hash:{},data:i}):r)+'">'+c(t(r=null!=(r=n.secureDropLabel||(null!=a?a.secureDropLabel:a))?r:d)===h?r.call(o,{name:"secureDropLabel",hash:{},data:i}):r)+"</label>\n\t\t\t\t\t</span>\n\t\t\t\t</li>\n"},19:function(e,a,t,n,s){var i;return null!=(i=t.if.call(null!=a?a:e.nullContext||{},null!=a?a.isPasswordForMailSharesRequired:a,{name:"if",hash:{},fn:e.program(20,s,0),inverse:e.noop,data:s}))?i:""},20:function(e,a,t,n,s){return'disabled=""'},22:function(e,a,t,n,s){return"hidden"},24:function(e,a,n,s,i){var l,r,o=null!=a?a:e.nullContext||{},d=n.helperMissing,h="function",c=e.escapeExpression;return'\t\t\t\t<li>\n\t\t\t\t\t<span class="menuitem">\n\t\t\t\t\t\t<input id="passwordByTalk-'+c(t(r=null!=(r=n.cid||(null!=a?a.cid:a))?r:d)===h?r.call(o,{name:"cid",hash:{},data:i}):r)+"-"+c(t(r=null!=(r=n.shareId||(null!=a?a.shareId:a))?r:d)===h?r.call(o,{name:"shareId",hash:{},data:i}):r)+'" type="checkbox" name="passwordByTalk" class="passwordByTalk checkbox" '+(null!=(l=n.if.call(o,null!=a?a.isPasswordByTalkSet:a,{name:"if",hash:{},fn:e.program(4,i,0),inverse:e.noop,data:i}))?l:"")+' />\n\t\t\t\t\t\t<label for="passwordByTalk-'+c(t(r=null!=(r=n.cid||(null!=a?a.cid:a))?r:d)===h?r.call(o,{name:"cid",hash:{},data:i}):r)+"-"+c(t(r=null!=(r=n.shareId||(null!=a?a.shareId:a))?r:d)===h?r.call(o,{name:"shareId",hash:{},data:i}):r)+'">'+c(t(r=null!=(r=n.passwordByTalkLabel||(null!=a?a.passwordByTalkLabel:a))?r:d)===h?r.call(o,{name:"passwordByTalkLabel",hash:{},data:i}):r)+'</label>\n\t\t\t\t\t</span>\n\t\t\t\t</li>\n\t\t\t\t<li class="passwordByTalkMenu-'+c(t(r=null!=(r=n.cid||(null!=a?a.cid:a))?r:d)===h?r.call(o,{name:"cid",hash:{},data:i}):r)+"-"+c(t(r=null!=(r=n.shareId||(null!=a?a.shareId:a))?r:d)===h?r.call(o,{name:"shareId",hash:{},data:i}):r)+" "+(null!=(l=n.unless.call(o,null!=a?a.isPasswordByTalkSet:a,{name:"unless",hash:{},fn:e.program(22,i,0),inverse:e.noop,data:i}))?l:"")+'">\n\t\t\t\t\t<span class="passwordByTalkContainer-'+c(t(r=null!=(r=n.cid||(null!=a?a.cid:a))?r:d)===h?r.call(o,{name:"cid",hash:{},data:i}):r)+"-"+c(t(r=null!=(r=n.shareId||(null!=a?a.shareId:a))?r:d)===h?r.call(o,{name:"shareId",hash:{},data:i}):r)+' icon-passwordtalk menuitem">\n\t\t\t\t\t\t<label for="passwordByTalkField-'+c(t(r=null!=(r=n.cid||(null!=a?a.cid:a))?r:d)===h?r.call(o,{name:"cid",hash:{},data:i}):r)+"-"+c(t(r=null!=(r=n.shareId||(null!=a?a.shareId:a))?r:d)===h?r.call(o,{name:"shareId",hash:{},data:i}):r)+'" class="hidden-visually" value="'+c(t(r=null!=(r=n.password||(null!=a?a.password:a))?r:d)===h?r.call(o,{name:"password",hash:{},data:i}):r)+'">'+c(t(r=null!=(r=n.passwordByTalkLabel||(null!=a?a.passwordByTalkLabel:a))?r:d)===h?r.call(o,{name:"passwordByTalkLabel",hash:{},data:i}):r)+'</label>\n\t\t\t\t\t\t<input id="passwordByTalkField-'+c(t(r=null!=(r=n.cid||(null!=a?a.cid:a))?r:d)===h?r.call(o,{name:"cid",hash:{},data:i}):r)+"-"+c(t(r=null!=(r=n.shareId||(null!=a?a.shareId:a))?r:d)===h?r.call(o,{name:"shareId",hash:{},data:i}):r)+'" class="passwordField" type="password" placeholder="'+c(t(r=null!=(r=n.passwordByTalkPlaceholder||(null!=a?a.passwordByTalkPlaceholder:a))?r:d)===h?r.call(o,{name:"passwordByTalkPlaceholder",hash:{},data:i}):r)+'" value="'+c(t(r=null!=(r=n.passwordValue||(null!=a?a.passwordValue:a))?r:d)===h?r.call(o,{name:"passwordValue",hash:{},data:i}):r)+'" autocomplete="new-password" />\n\t\t\t\t\t\t<span class="icon-loading-small hidden"></span>\n\t\t\t\t\t</span>\n\t\t\t\t</li>\n'},26:function(e,a,t,n,s){var i;return e.escapeExpression("function"==typeof(i=null!=(i=t.expireDate||(null!=a?a.expireDate:a))?i:t.helperMissing)?i.call(null!=a?a:e.nullContext||{},{name:"expireDate",hash:{},data:s}):i)},28:function(e,a,t,n,s){var i;return e.escapeExpression("function"==typeof(i=null!=(i=t.defaultExpireDate||(null!=a?a.defaultExpireDate:a))?i:t.helperMissing)?i.call(null!=a?a:e.nullContext||{},{name:"defaultExpireDate",hash:{},data:s}):i)},30:function(e,a,n,s,i){var l,r,o=null!=a?a:e.nullContext||{},d=n.helperMissing,h=e.escapeExpression;return'\t\t\t<li>\n\t\t\t\t<a href="#" class="share-add">\n\t\t\t\t\t<span class="icon-loading-small hidden"></span>\n\t\t\t\t\t<span class="icon icon-edit"></span>\n\t\t\t\t\t<span>'+h("function"===t(r=null!=(r=n.addNoteLabel||(null!=a?a.addNoteLabel:a))?r:d)?r.call(o,{name:"addNoteLabel",hash:{},data:i}):r)+'</span>\n\t\t\t\t\t<input type="button" class="share-note-delete icon-delete '+(null!=(l=n.unless.call(o,null!=a?a.hasNote:a,{name:"unless",hash:{},fn:e.program(22,i,0),inverse:e.noop,data:i}))?l:"")+'">\n\t\t\t\t</a>\n\t\t\t</li>\n\t\t\t<li class="share-note-form '+(null!=(l=n.unless.call(o,null!=a?a.hasNote:a,{name:"unless",hash:{},fn:e.program(22,i,0),inverse:e.noop,data:i}))?l:"")+'">\n\t\t\t\t<span class="menuitem icon-note">\n\t\t\t\t\t<textarea class="share-note">'+h("function"===t(r=null!=(r=n.shareNote||(null!=a?a.shareNote:a))?r:d)?r.call(o,{name:"shareNote",hash:{},data:i}):r)+'</textarea>\n\t\t\t\t\t<input type="submit" class="icon-confirm share-note-submit" value="" id="add-note-'+h("function"===t(r=null!=(r=n.shareId||(null!=a?a.shareId:a))?r:d)?r.call(o,{name:"shareId",hash:{},data:i}):r)+'" />\n\t\t\t\t</span>\n\t\t\t</li>\n'},compiler:[7,">= 4.0.0"],main:function(e,a,n,s,i){var l,r,o=null!=a?a:e.nullContext||{},d=n.helperMissing,h="function",c=e.escapeExpression;return'<div class="popovermenu bubble hidden menu">\n\t<ul>\n\t\t'+(null!=(l=n.if.call(o,null!=a?a.isResharingAllowed:a,{name:"if",hash:{},fn:e.program(1,i,0),inverse:e.noop,data:i}))?l:"")+"\n"+(null!=(l=n.if.call(o,null!=a?a.isFolder:a,{name:"if",hash:{},fn:e.program(6,i,0),inverse:e.noop,data:i}))?l:"")+(null!=(l=n.if.call(o,null!=a?a.isMailShare:a,{name:"if",hash:{},fn:e.program(16,i,0),inverse:e.noop,data:i}))?l:"")+'\t\t<li>\n\t\t\t<span class="menuitem">\n\t\t\t\t<input id="expireDate-'+c(t(r=null!=(r=n.cid||(null!=a?a.cid:a))?r:d)===h?r.call(o,{name:"cid",hash:{},data:i}):r)+"-"+c(t(r=null!=(r=n.shareId||(null!=a?a.shareId:a))?r:d)===h?r.call(o,{name:"shareId",hash:{},data:i}):r)+'" type="checkbox" name="expirationDate" class="expireDate checkbox" '+(null!=(l=n.if.call(o,null!=a?a.hasExpireDate:a,{name:"if",hash:{},fn:e.program(4,i,0),inverse:e.noop,data:i}))?l:"")+'" />\n\t\t\t\t<label for="expireDate-'+c(t(r=null!=(r=n.cid||(null!=a?a.cid:a))?r:d)===h?r.call(o,{name:"cid",hash:{},data:i}):r)+"-"+c(t(r=null!=(r=n.shareId||(null!=a?a.shareId:a))?r:d)===h?r.call(o,{name:"shareId",hash:{},data:i}):r)+'">'+c(t(r=null!=(r=n.expireDateLabel||(null!=a?a.expireDateLabel:a))?r:d)===h?r.call(o,{name:"expireDateLabel",hash:{},data:i}):r)+'</label>\n\t\t\t</span>\n\t\t</li>\n\t\t<li class="expirationDateMenu-'+c(t(r=null!=(r=n.cid||(null!=a?a.cid:a))?r:d)===h?r.call(o,{name:"cid",hash:{},data:i}):r)+"-"+c(t(r=null!=(r=n.shareId||(null!=a?a.shareId:a))?r:d)===h?r.call(o,{name:"shareId",hash:{},data:i}):r)+" "+(null!=(l=n.unless.call(o,null!=a?a.hasExpireDate:a,{name:"unless",hash:{},fn:e.program(22,i,0),inverse:e.noop,data:i}))?l:"")+'">\n\t\t\t<span class="expirationDateContainer-'+c(t(r=null!=(r=n.cid||(null!=a?a.cid:a))?r:d)===h?r.call(o,{name:"cid",hash:{},data:i}):r)+"-"+c(t(r=null!=(r=n.shareId||(null!=a?a.shareId:a))?r:d)===h?r.call(o,{name:"shareId",hash:{},data:i}):r)+' icon-expiredate menuitem">\n\t\t\t\t<label for="expirationDatePicker-'+c(t(r=null!=(r=n.cid||(null!=a?a.cid:a))?r:d)===h?r.call(o,{name:"cid",hash:{},data:i}):r)+"-"+c(t(r=null!=(r=n.shareId||(null!=a?a.shareId:a))?r:d)===h?r.call(o,{name:"shareId",hash:{},data:i}):r)+'" class="hidden-visually" value="'+c(t(r=null!=(r=n.expirationDate||(null!=a?a.expirationDate:a))?r:d)===h?r.call(o,{name:"expirationDate",hash:{},data:i}):r)+'">'+c(t(r=null!=(r=n.expirationLabel||(null!=a?a.expirationLabel:a))?r:d)===h?r.call(o,{name:"expirationLabel",hash:{},data:i}):r)+'</label>\n\t\t\t\t<input id="expirationDatePicker-'+c(t(r=null!=(r=n.cid||(null!=a?a.cid:a))?r:d)===h?r.call(o,{name:"cid",hash:{},data:i}):r)+"-"+c(t(r=null!=(r=n.shareId||(null!=a?a.shareId:a))?r:d)===h?r.call(o,{name:"shareId",hash:{},data:i}):r)+'" class="datepicker" type="text" placeholder="'+c(t(r=null!=(r=n.expirationDatePlaceholder||(null!=a?a.expirationDatePlaceholder:a))?r:d)===h?r.call(o,{name:"expirationDatePlaceholder",hash:{},data:i}):r)+'" value="'+(null!=(l=n.if.call(o,null!=a?a.hasExpireDate:a,{name:"if",hash:{},fn:e.program(26,i,0),inverse:e.program(28,i,0),data:i}))?l:"")+'" />\n\t\t\t</span>\n\t\t</li>\n'+(null!=(l=n.if.call(o,null!=a?a.isNoteAvailable:a,{name:"if",hash:{},fn:e.program(30,i,0),inverse:e.noop,data:i}))?l:"")+'\t\t<li>\n\t\t\t<a href="#" class="unshare"><span class="icon-loading-small hidden"></span><span class="icon icon-delete"></span><span>'+c(t(r=null!=(r=n.unshareLabel||(null!=a?a.unshareLabel:a))?r:d)===h?r.call(o,{name:"unshareLabel",hash:{},data:i}):r)+"</span></a>\n\t\t</li>\n\t</ul>\n</div>\n"},useData:!0}),s.sharedialogview=n({1:function(e,a,n,s,i){var l,r=null!=a?a:e.nullContext||{},o=n.helperMissing,d=e.escapeExpression;return'\t<label for="shareWith-'+d("function"===t(l=null!=(l=n.cid||(null!=a?a.cid:a))?l:o)?l.call(r,{name:"cid",hash:{},data:i}):l)+'" class="hidden-visually">'+d("function"===t(l=null!=(l=n.shareLabel||(null!=a?a.shareLabel:a))?l:o)?l.call(r,{name:"shareLabel",hash:{},data:i}):l)+'</label>\n\t<div class="oneline">\n\t\t<input id="shareWith-'+d("function"===t(l=null!=(l=n.cid||(null!=a?a.cid:a))?l:o)?l.call(r,{name:"cid",hash:{},data:i}):l)+'" class="shareWithField" type="text" placeholder="'+d("function"===t(l=null!=(l=n.sharePlaceholder||(null!=a?a.sharePlaceholder:a))?l:o)?l.call(r,{name:"sharePlaceholder",hash:{},data:i}):l)+'" />\n\t\t<span class="shareWithLoading icon-loading-small hidden"></span>\n\t\t<span class="shareWithConfirm icon icon-confirm"></span>\n\t</div>\n'},compiler:[7,">= 4.0.0"],main:function(e,a,t,n,s){var i;return'<div class="resharerInfoView subView"></div>\n'+(null!=(i=t.if.call(null!=a?a:e.nullContext||{},null!=a?a.isSharingAllowed:a,{name:"if",hash:{},fn:e.program(1,s,0),inverse:e.noop,data:s}))?i:"")+'<div class="linkShareView subView"></div>\n<div class="shareeListView subView"></div>\n<div class="loading hidden" style="height: 50px"></div>\n'},useData:!0})},function(e,a){!function(){OC.Share||(OC.Share={},OC.Share.Types={});var e=["id","file_parent","mail_send","file_source","item_source","permissions","storage","share_type","parent","stime"],a=OC.Backbone.Model.extend({_linkShareId:null,initialize:function(e,a){_.isUndefined(a.configModel)||(this.configModel=a.configModel),_.isUndefined(a.fileInfoModel)||(this.fileInfoModel=a.fileInfoModel),_.bindAll(this,"addShare")},defaults:{allowPublicUploadStatus:!1,permissions:0,linkShares:[]},saveLinkShare:function(e,a){a=a||{};var t,n=null;(e=_.extend({},e)).expiration&&(e.expireDate=e.expiration,delete e.expiration);var s=this.get("linkShares"),i=_.findIndex(s,function(a){return a.id===e.cid});return s.length>0&&-1!==i?(n=s[i].id,t=this.updateShare(n,e,a)):(e=_.defaults(e,{hideDownload:!1,password:"",passwordChanged:!1,sendPasswordByTalk:!1,permissions:OC.PERMISSION_READ,expireDate:this.configModel.getDefaultExpirationDateString(),shareType:OC.Share.SHARE_TYPE_LINK}),t=this.addShare(e,a)),t},addShare:function(e,a){e.shareType;e=_.extend({},e);var t=OC.getCapabilities().files_sharing.default_permissions||OC.PERMISSION_ALL,n=OC.PERMISSION_READ;return this.updatePermissionPossible()&&(n|=OC.PERMISSION_UPDATE),this.createPermissionPossible()&&(n|=OC.PERMISSION_CREATE),this.deletePermissionPossible()&&(n|=OC.PERMISSION_DELETE),this.configModel.get("isResharingAllowed")&&this.sharePermissionPossible()&&(n|=OC.PERMISSION_SHARE),e.permissions=t&n,_.isUndefined(e.path)&&(e.path=this.fileInfoModel.getFullPath()),this._addOrUpdateShare({type:"POST",url:this._getUrl("shares"),data:e,dataType:"json"},a)},updateShare:function(e,a,t){return this._addOrUpdateShare({type:"PUT",url:this._getUrl("shares/"+encodeURIComponent(e)),data:a,dataType:"json"},t)},_addOrUpdateShare:function(e,a){var n=this;return a=a||{},$.ajax(e).always(function(){_.isFunction(a.complete)&&a.complete(n)}).done(function(){n.fetch().done(function(){_.isFunction(a.success)&&a.success(n)})}).fail(function(e){var s=t("core","Error"),i=e.responseJSON;i&&i.ocs&&i.ocs.meta&&(s=i.ocs.meta.message),_.isFunction(a.error)?a.error(n,s):OC.dialogs.alert(s,t("core","Error while sharing"))})},removeShare:function(e,a){var n=this;return a=a||{},$.ajax({type:"DELETE",url:this._getUrl("shares/"+encodeURIComponent(e))}).done(function(){n.fetch({success:function(){_.isFunction(a.success)&&a.success(n)}})}).fail(function(e){var s=t("core","Error"),i=e.responseJSON;i.ocs&&i.ocs.meta&&(s=i.ocs.meta.message),_.isFunction(a.error)?a.error(n,s):OC.dialogs.alert(s,t("core","Error removing share"))})},isPublicUploadAllowed:function(){return this.get("allowPublicUploadStatus")},isPublicEditingAllowed:function(){return this.get("allowPublicEditingStatus")},isHideFileListSet:function(){return this.get("hideFileListStatus")},isFolder:function(){return"folder"===this.get("itemType")},isFile:function(){return"file"===this.get("itemType")},hasReshare:function(){var e=this.get("reshare");return _.isObject(e)&&!_.isUndefined(e.uid_owner)},hasUserShares:function(){return this.getSharesWithCurrentItem().length>0},hasLinkShares:function(){var e=this.get("linkShares");return!!(e&&e.length>0)},getReshareOwner:function(){return this.get("reshare").uid_owner},getReshareOwnerDisplayname:function(){return this.get("reshare").displayname_owner},getReshareNote:function(){return this.get("reshare").note},getReshareWith:function(){return this.get("reshare").share_with},getReshareWithDisplayName:function(){var e=this.get("reshare");return e.share_with_displayname||e.share_with},getReshareType:function(){return this.get("reshare").share_type},getExpireDate:function(e){return this._shareExpireDate(e)},getNote:function(e){return this._shareNote(e)},getSharesWithCurrentItem:function(){var e=this.get("shares")||[],a=this.fileInfoModel.get("id");return _.filter(e,function(e){return e.item_source===a})},getShareWith:function(e){var a=this.get("shares")[e];if(!_.isObject(a))throw"Unknown Share";return a.share_with},getShareWithDisplayName:function(e){var a=this.get("shares")[e];if(!_.isObject(a))throw"Unknown Share";return a.share_with_displayname},getShareWithAvatar:function(e){var a=this.get("shares")[e];if(!_.isObject(a))throw"Unknown Share";return a.share_with_avatar},getSharedBy:function(e){var a=this.get("shares")[e];if(!_.isObject(a))throw"Unknown Share";return a.uid_owner},getSharedByDisplayName:function(e){var a=this.get("shares")[e];if(!_.isObject(a))throw"Unknown Share";return a.displayname_owner},getFileOwnerUid:function(e){var a=this.get("shares")[e];if(!_.isObject(a))throw"Unknown Share";return a.uid_file_owner},findShareWithIndex:function(e){var a=this.get("shares");if(!_.isArray(a))throw"Unknown Share";for(var t=0;t<a.length;t++){if(a[t].id===e)return t}throw"Unknown Sharee"},getShareType:function(e){var a=this.get("shares")[e];if(!_.isObject(a))throw"Unknown Share";return a.share_type},_shareHasPermission:function(e,a){var t=this.get("shares")[e];if(!_.isObject(t))throw"Unknown Share";return(t.permissions&a)===a},_shareExpireDate:function(e){var a=this.get("shares")[e];if(!_.isObject(a))throw"Unknown Share";return a.expiration},_shareNote:function(e){var a=this.get("shares")[e];if(!_.isObject(a))throw"Unknown Share";return a.note},getPermissions:function(){return this.get("permissions")},sharePermissionPossible:function(){return(this.get("permissions")&OC.PERMISSION_SHARE)===OC.PERMISSION_SHARE},hasSharePermission:function(e){return this._shareHasPermission(e,OC.PERMISSION_SHARE)},createPermissionPossible:function(){return(this.get("permissions")&OC.PERMISSION_CREATE)===OC.PERMISSION_CREATE},hasCreatePermission:function(e){return this._shareHasPermission(e,OC.PERMISSION_CREATE)},updatePermissionPossible:function(){return(this.get("permissions")&OC.PERMISSION_UPDATE)===OC.PERMISSION_UPDATE},hasUpdatePermission:function(e){return this._shareHasPermission(e,OC.PERMISSION_UPDATE)},deletePermissionPossible:function(){return(this.get("permissions")&OC.PERMISSION_DELETE)===OC.PERMISSION_DELETE},hasDeletePermission:function(e){return this._shareHasPermission(e,OC.PERMISSION_DELETE)},hasReadPermission:function(e){return this._shareHasPermission(e,OC.PERMISSION_READ)},editPermissionPossible:function(){return this.createPermissionPossible()||this.updatePermissionPossible()||this.deletePermissionPossible()},editPermissionState:function(e){var a=this.hasCreatePermission(e),t=this.hasUpdatePermission(e),n=this.hasDeletePermission(e);return this.isFile()?a||t||n?"checked":"":a||t||n?this.createPermissionPossible()&&!a||this.updatePermissionPossible()&&!t||this.deletePermissionPossible()&&!n?"indeterminate":"checked":""},linkSharePermissions:function(e){var a=this.get("linkShares"),t=_.findIndex(a,function(a){return a.id===e});return this.hasLinkShares()&&a.length>0&&-1!==t?a[t].permissions:-1},_getUrl:function(e,a){return a=_.extend({format:"json"},a||{}),OC.linkToOCS("apps/files_sharing/api/v1",2)+e+"?"+OC.buildQueryString(a)},_fetchShares:function(){var e=this.fileInfoModel.getFullPath();return $.ajax({type:"GET",url:this._getUrl("shares",{path:e,reshares:!0})})},_fetchReshare:function(){if(this._reshareFetched)return $.Deferred().resolve([{ocs:{data:[this.get("reshare")]}}]);var e=this.fileInfoModel.getFullPath();return this._reshareFetched=!0,$.ajax({type:"GET",url:this._getUrl("shares",{path:e,shared_with_me:!0})})},_groupReshares:function(e){if(!e||!e.length)return!1;var a=e.shift(),t=a.permissions;return _.each(e,function(e){e.share_type===OC.Share.SHARE_TYPE_USER&&a.share_type===OC.Share.SHARE_TYPE_GROUP&&(a=e),t|=e.permissions}),a.permissions=t,a},fetch:function(e){var a=this;this.trigger("request",this);var t=$.when(this._fetchShares(),this._fetchReshare());return t.done(function(t,n){a.trigger("sync","GET",this);var s={};_.each(t[0].ocs.data,function(e){s[e.id]=e});var i=!1;n[0].ocs.data.length&&(i=a._groupReshares(n[0].ocs.data)),a.set(a.parse({shares:s,reshare:i})),!_.isUndefined(e)&&_.isFunction(e.success)&&e.success()}),t},_legacyFillCurrentShares:function(e){var a=this.fileInfoModel.get("id");if(!e||!e.length)return delete OC.Share.statuses[a],OC.Share.currentShares={},void(OC.Share.itemShares=[]);var t=OC.Share.statuses[a];t||(t={link:!1},OC.Share.statuses[a]=t),t.link=!1,OC.Share.currentShares={},OC.Share.itemShares=[],_.each(e,function(e){e.share_type===OC.Share.SHARE_TYPE_LINK?(OC.Share.itemShares[e.share_type]=!0,t.link=!0):(OC.Share.itemShares[e.share_type]||(OC.Share.itemShares[e.share_type]=[]),OC.Share.itemShares[e.share_type].push(e.share_with))})},parse:function(a){if(!1===a)return console.warn("no data was returned"),this.trigger("fetchError"),{};var t=this.fileInfoModel.get("permissions");_.isUndefined(a.reshare)||_.isUndefined(a.reshare.permissions)||a.reshare.uid_owner===OC.currentUser||(t&=a.reshare.permissions);var n=!1;_.isUndefined(a.shares)||$.each(a.shares,function(e,a){if(a.share_type===OC.Share.SHARE_TYPE_LINK)return n=!!(a.permissions&OC.PERMISSION_CREATE),!0});var s=!0;_.isUndefined(a.shares)||$.each(a.shares,function(e,a){if(a.share_type===OC.Share.SHARE_TYPE_LINK)return s=!!(a.permissions&OC.PERMISSION_UPDATE),!0});var i=!1;_.isUndefined(a.shares)||$.each(a.shares,function(e,a){if(a.share_type===OC.Share.SHARE_TYPE_LINK)return i=!(a.permissions&OC.PERMISSION_READ),!0});var l=_.map(a.shares,function(a){var t;for(t=0;t<e.length;t++){var n=e[t];_.isUndefined(a[n])||(a[n]=parseInt(a[n],10))}return a});this._legacyFillCurrentShares(l);var r=[];return l=_.reject(l,function(e){if(e.share_type===OC.Share.SHARE_TYPE_LINK&&(e.file_source===this.get("itemSource")||e.item_source===this.get("itemSource"))){if(e.uid_owner!==OC.currentUser)return;window.location.protocol,window.location.host;if(e.token)OC.generateUrl("/s/")+e.token;else{var a=this.fileInfoModel.get("path")+"/"+this.fileInfoModel.get("name"),t="/"+OC.currentUser+"/files"+a,n=this.fileInfoModel.isDirectory()?"folder":"file";OC.linkTo("","public.php")+"?service=files&"+n+"="+encodeURIComponent(t)}return r.push(_.extend({},e,{hideDownload:!!e.hide_download,password:e.share_with,sendPasswordByTalk:e.send_password_by_talk})),e}},this),{reshare:a.reshare,shares:l,linkShares:r,permissions:t,allowPublicUploadStatus:n,allowPublicEditingStatus:s,hideFileListStatus:i}},_parseTime:function(e){if(_.isString(e)){if(""===e||e.length>1&&"0"===e[0]&&"x"===e[1])return null;e=parseInt(e,10),isNaN(e)&&(e=null)}return e},getShareTypes:function(){var e;return e=_.pluck(this.getSharesWithCurrentItem(),"share_type"),this.hasLinkShares()&&e.push(OC.Share.SHARE_TYPE_LINK),_.uniq(e)}});OC.Share.ShareItemModel=a}()},function(e,a){
/**
* @copyright 2017, Roeland Jago Douma <roeland@famdouma.nl>
*
* @author Roeland Jago Douma <roeland@famdouma.nl>
*
* @license GNU AGPL version 3 or any later version
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
!function(){OC.Share||(OC.Share={}),OC.Share.Social={};var e=OC.Backbone.Model.extend({defaults:{key:null,url:null,name:null,iconClass:null,newWindow:!0}});OC.Share.Social.Model=e;var a=OC.Backbone.Collection.extend({model:OC.Share.Social.Model,comparator:"key"});OC.Share.Social.Collection=new a}()},function(e,a){!function(){OC.Share||(OC.Share={});var e=OC.Backbone.View.extend({id:"shareDialogResharerInfo",tagName:"div",className:"reshare",configModel:void 0,_template:void 0,initialize:function(e){var a=this;if(this.model.on("change:reshare",function(){a.render()}),_.isUndefined(e.configModel))throw"missing OC.Share.ShareConfigModel";this.configModel=e.configModel},render:function(){if(!this.model.hasReshare()||this.model.getReshareOwner()===OC.currentUser)return this.$el.empty(),this;var e=this.template(),a=this.model.getReshareOwnerDisplayname(),n=this.model.getReshareNote(),s="";return s=this.model.getReshareType()===OC.Share.SHARE_TYPE_GROUP?t("core","Shared with you and the group {group} by {owner}",{group:this.model.getReshareWithDisplayName(),owner:a},void 0,{escape:!1}):this.model.getReshareType()===OC.Share.SHARE_TYPE_CIRCLE?t("core","Shared with you and {circle} by {owner}",{circle:this.model.getReshareWithDisplayName(),owner:a},void 0,{escape:!1}):this.model.getReshareType()===OC.Share.SHARE_TYPE_ROOM?this.model.get("reshare").share_with_displayname?t("core","Shared with you and the conversation {conversation} by {owner}",{conversation:this.model.getReshareWithDisplayName(),owner:a},void 0,{escape:!1}):t("core","Shared with you in a conversation by {owner}",{owner:a},void 0,{escape:!1}):t("core","Shared with you by {owner}",{owner:a},void 0,{escape:!1}),this.$el.html(e({reshareOwner:this.model.getReshareOwner(),sharedByText:s,shareNote:n,hasShareNote:""!==n})),this.$el.find(".avatar").each(function(){var e=$(this);e.avatar(e.data("username"),32)}),this.$el.find(".reshare").contactsMenu(this.model.getReshareOwner(),OC.Share.SHARE_TYPE_USER,this.$el),this},template:function(){return OC.Share.Templates.sharedialogresharerinfoview}});OC.Share.ShareDialogResharerInfoView=e}()},function(e,a){!function(){OC.Share||(OC.Share={});var e=t("core","Choose a password for the public link"),a=t("core",'Choose a password for the public link or press the "Enter" key'),n=OC.Backbone.View.extend({id:"shareDialogLinkShare",configModel:void 0,showLink:!0,showPending:!1,password:"",newShareId:"new-share",events:{"click .share-menu .icon-more":"onToggleMenu","change .hideDownloadCheckbox":"onHideDownloadChange","click input.share-pass-submit":"onPasswordEntered","keyup input.linkPassText":"onPasswordKeyUp","change .showPasswordCheckbox":"onShowPasswordClick","change .passwordByTalkCheckbox":"onPasswordByTalkChange","change .publicEditingCheckbox":"onAllowPublicEditingChange","click .linkText":"onLinkTextClick","click .pop-up":"onPopUpClick","change .publicUploadRadio":"onPublicUploadChange","click .expireDate":"onExpireDateChange","change .datepicker":"onChangeExpirationDate","click .datepicker":"showDatePicker","click .share-add":"showNoteForm","click .share-note-delete":"deleteNote","click .share-note-submit":"updateNote","click .unshare":"onUnshare","click .new-share":"newShare","submit .enforcedPassForm":"enforcedPasswordSet"},initialize:function(e){var a=this;if(this.model.on("change:permissions",function(){a.render()}),this.model.on("change:itemType",function(){a.render()}),this.model.on("change:allowPublicUploadStatus",function(){a.render()}),this.model.on("change:hideFileListStatus",function(){a.render()}),this.model.on("change:linkShares",function(e,t){var n,s=e.previous("linkShares");if(s.length===t.length)for(n=0;n<t.length;n++){if(t[n].id!==s[n].id)return;if(t[n].password!==s[n].password)return void a.render()}}),_.isUndefined(e.configModel))throw"missing OC.Share.ShareConfigModel";this.configModel=e.configModel;var n=new Clipboard(".clipboard-button");n.on("success",function(e){var a=$(e.trigger);a.tooltip("hide").attr("data-original-title",t("core","Copied!")).tooltip("fixTitle").tooltip({placement:"bottom",trigger:"manual"}).tooltip("show"),_.delay(function(){a.tooltip("hide").attr("data-original-title",t("core","Copy link")).tooltip("fixTitle")},3e3)}),n.on("error",function(e){var a=$(e.trigger),n=a.next(".share-menu").find(".popovermenu"),s=n.find("li.linkTextMenu"),i=s.find(".linkText");a.closest("li[data-share-id]").data("share-id");OC.showMenu(null,n);var l="";l=/iPhone|iPad/i.test(navigator.userAgent)?t("core","Not supported!"):/Mac/i.test(navigator.userAgent)?t("core","Press ⌘-C to copy."):t("core","Press Ctrl-C to copy."),s.removeClass("hidden"),i.select(),i.tooltip("hide").attr("data-original-title",l).tooltip("fixTitle").tooltip({placement:"bottom",trigger:"manual"}).tooltip("show"),_.delay(function(){i.tooltip("hide"),i.attr("data-original-title",t("core","Copy")).tooltip("fixTitle")},3e3)})},newShare:function(e){var a=this,n=$(e.target).closest("li[data-share-id]"),s=n.data("share-id"),i=n.find(".share-menu > .icon-loading-small");if(!i.hasClass("hidden")&&""===this.password)return!1;n.find(".icon").addClass("hidden"),i.removeClass("hidden"),OC.hideMenus();var l={},r=this.configModel.get("enforcePasswordForPublicLink");if(this.configModel.get("isDefaultExpireDateEnforced")){var o=this.configModel.get("defaultExpireDate"),d=moment().add(o,"day").format("DD-MM-YYYY");l.expireDate=d}r&&""!==this.password&&(l.password=this.password);var h=!1;r&&!this.showPending&&""===this.password?(this.showPending=s,(a=this.render()).$el.find(".pending #enforcedPassText").focus()):$.when(this.model.saveLinkShare(l,{success:function(){if(i.addClass("hidden"),n.find(".icon").removeClass("hidden"),a.render(),h){var e=a.$el.find("li[data-share-id]"),t=a.$el.find('li[data-share-id="'+h+'"]');if(t&&1===e.length){var s=t.find(".popovermenu");OC.showMenu(null,s)}}},error:function(){}})).fail(function(e){if(a.password="",r&&e&&e.responseJSON&&e.responseJSON.ocs.meta&&e.responseJSON.ocs.meta.message){var s=a.$el.find(".pending #enforcedPassText");s.tooltip("destroy"),s.attr("title",e.responseJSON.ocs.meta.message),s.tooltip({placement:"bottom",trigger:"manual"}),s.tooltip("show")}else OC.Notification.showTemporary(t("core","Unable to create a link share")),i.addClass("hidden"),n.find(".icon").removeClass("hidden")}).then(function(e){h=e.ocs.data.id})},enforcedPasswordSet:function(e){e.preventDefault();var a=$(e.target).find("input.enforcedPassText");this.password=a.val(),this.showPending=!1,this.newShare(e)},onLinkTextClick:function(e){var a=$(e.target).closest("li[data-share-id]").find(".linkText");a.focus(),a.select()},onHideDownloadChange:function(e){var a=$(e.target).closest("li[data-share-id]"),n=a.data("share-id"),s=a.find(".hideDownloadCheckbox");s.siblings(".icon-loading-small").removeClass("hidden").addClass("inlineblock");var i=!1;s.is(":checked")&&(i=!0),this.model.saveLinkShare({hideDownload:i,cid:n},{success:function(){s.siblings(".icon-loading-small").addClass("hidden").removeClass("inlineblock")},error:function(e,a){OC.Notification.showTemporary(t("core","Unable to toggle this option")),s.siblings(".icon-loading-small").addClass("hidden").removeClass("inlineblock")}})},onShowPasswordClick:function(e){var a=$(e.target).closest("li[data-share-id]"),t=a.data("share-id");a.find(".linkPass").slideToggle(OC.menuSpeed),a.find(".linkPassMenu").toggleClass("hidden"),a.find(".showPasswordCheckbox").is(":checked")?OC.Util.isIE()||a.find(".linkPassText").focus():this.model.saveLinkShare({password:"",cid:t})},onPasswordKeyUp:function(e){13===e.keyCode&&this.onPasswordEntered(e)},onPasswordEntered:function(t){var n=$(t.target).closest("li[data-share-id]"),s=n.data("share-id"),i=n.find(".linkPassMenu .icon-loading-small");if(i.hasClass("hidden")){var l=n.find(".linkPassText");l.removeClass("error");var r=l.val();if(n.find(".linkPassText").attr("placeholder")===a)r===a&&(r="");else if(""===r||"**********"===r||r===e)return;i.removeClass("hidden").addClass("inlineblock"),this.model.saveLinkShare({password:r,cid:s},{complete:function(e){i.removeClass("inlineblock").addClass("hidden")},error:function(e,a){var t=l.parent();t.tooltip("destroy"),l.addClass("error"),t.attr("title",a),t.tooltip({placement:"bottom",trigger:"manual"}),t.tooltip("show")}})}},onPasswordByTalkChange:function(e){var a=$(e.target).closest("li[data-share-id]"),n=a.data("share-id"),s=a.find(".passwordByTalkCheckbox");s.siblings(".icon-loading-small").removeClass("hidden").addClass("inlineblock");var i=!1;s.is(":checked")&&(i=!0),this.model.saveLinkShare({sendPasswordByTalk:i,cid:n},{success:function(){s.siblings(".icon-loading-small").addClass("hidden").removeClass("inlineblock")},error:function(e,a){OC.Notification.showTemporary(t("core","Unable to toggle this option")),s.siblings(".icon-loading-small").addClass("hidden").removeClass("inlineblock")}})},onAllowPublicEditingChange:function(e){var a=$(e.target).closest("li[data-share-id]"),n=a.data("share-id"),s=a.find(".publicEditingCheckbox");s.siblings(".icon-loading-small").removeClass("hidden").addClass("inlineblock");var i=OC.PERMISSION_READ;s.is(":checked")&&(i=OC.PERMISSION_UPDATE|OC.PERMISSION_READ),this.model.saveLinkShare({permissions:i,cid:n},{success:function(){s.siblings(".icon-loading-small").addClass("hidden").removeClass("inlineblock")},error:function(e,a){OC.Notification.showTemporary(t("core","Unable to toggle this option")),s.siblings(".icon-loading-small").addClass("hidden").removeClass("inlineblock")}})},onPublicUploadChange:function(e){var a=$(e.target).closest("li[data-share-id]").data("share-id"),t=e.currentTarget.value;this.model.saveLinkShare({permissions:t,cid:a})},showNoteForm:function(e){e.preventDefault(),e.stopPropagation();var a=$(e.target),t=(a.closest("li[data-share-id]"),a.closest("li")),n=t.next("li.share-note-form");t.find(".share-note-delete").toggleClass("hidden"),n.toggleClass("hidden"),n.find("textarea").focus()},deleteNote:function(e){e.preventDefault(),e.stopPropagation();var a=$(e.target),t=a.closest("li[data-share-id]").data("share-id"),n=a.closest("li"),s=n.next("li.share-note-form");s.find(".share-note").val(""),s.addClass("hidden"),n.find(".share-note-delete").addClass("hidden"),this.sendNote("",t,n)},updateNote:function(e){e.preventDefault(),e.stopPropagation();var a=$(e.target),t=a.closest("li[data-share-id]").data("share-id"),n=a.closest("li.share-note-form"),s=n.prev("li"),i=n.find(".share-note").val().trim();i.length<1||this.sendNote(i,t,s)},sendNote:function(e,a,t){var n=t.next("li.share-note-form"),s=n.find("input.share-note-submit"),i=n.find("input.share-note-error");s.prop("disabled",!0),t.find(".icon-loading-small").removeClass("hidden"),t.find(".icon-edit").hide();$.ajax({method:"PUT",url:OC.linkToOCS("apps/files_sharing/api/v1/shares",2)+a+"?"+OC.buildQueryString({format:"json"}),data:{note:e},complete:function(){s.prop("disabled",!1),t.find(".icon-loading-small").addClass("hidden"),t.find(".icon-edit").show()},error:function(){i.show(),setTimeout(function(){i.hide()},3e3)}})},render:function(){this.$el.find(".has-tooltip").tooltip(),this.password="";var n=this.template(),s=this.model.sharePermissionPossible();if(!s||!this.showLink||!this.configModel.isShareWithLinkAllowed()){var i={shareAllowed:!1};return s||(i.noSharingPlaceholder=t("core","Resharing is not allowed")),this.$el.html(n(i)),this}var l=this.model.isFolder()&&this.model.createPermissionPossible()&&this.configModel.isPublicUploadEnabled(),r="";this.model.isPublicEditingAllowed()&&(r='checked="checked"');var o=this.configModel.get("enforcePasswordForPublicLink"),d=(this.configModel.get("enableLinkPasswordByDefault"),this.configModel.get("enforcePasswordForPublicLink")?e:a),h=!this.model.isFolder()&&this.model.updatePermissionPossible(),c=this.configModel.get("isDefaultExpireDateEnforced"),u=new Date;u.setDate(u.getDate()+1),$.datepicker.setDefaults({minDate:u}),this.$el.find(".datepicker").datepicker({dateFormat:"dd-mm-yy"});var p=4;oc_capabilities.password_policy&&oc_capabilities.password_policy.minLength&&(p=oc_capabilities.password_policy.minLength);var m={urlLabel:t("core","Link"),hideDownloadLabel:t("core","Hide download"),enablePasswordLabel:o?t("core","Password protection enforced"):t("core","Password protect"),passwordLabel:t("core","Password"),passwordPlaceholderInitial:d,publicUpload:l,publicEditing:h,publicEditingChecked:r,publicEditingLabel:t("core","Allow editing"),mailPrivatePlaceholder:t("core","Email link to person"),mailButtonText:t("core","Send"),publicUploadRWLabel:t("core","Allow upload and editing"),publicUploadRLabel:t("core","Read only"),publicUploadWLabel:t("core","File drop (upload only)"),publicUploadRWValue:OC.PERMISSION_UPDATE|OC.PERMISSION_CREATE|OC.PERMISSION_READ|OC.PERMISSION_DELETE,publicUploadRValue:OC.PERMISSION_READ,publicUploadWValue:OC.PERMISSION_CREATE,expireDateLabel:c?t("core","Expiration date enforced"):t("core","Set expiration date"),expirationLabel:t("core","Expiration"),expirationDatePlaceholder:t("core","Expiration date"),isExpirationEnforced:c,isPasswordEnforced:o,defaultExpireDate:moment().add(1,"day").format("DD-MM-YYYY"),addNoteLabel:t("core","Note to recipient"),unshareLabel:t("core","Unshare"),unshareLinkLabel:t("core","Delete share link"),newShareLabel:t("core","Add another link")},f={isPasswordEnforced:o,enforcedPasswordLabel:t("core","Password protection for links is mandatory"),passwordPlaceholder:d,minPasswordLength:p},g=this.pendingPopoverMenuTemplate(_.extend({},f)),v=this.getShareeList();if(_.isArray(v))for(var S=0;S<v.length;S++){var C=[];OC.Share.Social.Collection.each(function(e){var a=e.get("url");a=a.replace("{{reference}}",v[S].shareLinkURL),C.push({url:a,label:t("core","Share to {name}",{name:e.get("name")}),name:e.get("name"),iconClass:e.get("iconClass"),newWindow:e.get("newWindow")})});var w=this.getPopoverObject(v[S]);v[S].popoverMenu=this.popoverMenuTemplate(_.extend({},m,w,{social:C})),v[S].pendingPopoverMenu=g}return this.$el.html(n({linkShares:v,shareAllowed:!0,nolinkShares:0===v.length,newShareLabel:t("core","Share link"),newShareTitle:t("core","New share link"),pendingPopoverMenu:g,showPending:this.showPending===this.newShareId,newShareId:this.newShareId})),this.delegateEvents(),autosize(this.$el.find(".share-note-form .share-note")),this},onToggleMenu:function(e){e.preventDefault(),e.stopPropagation();var a=$(e.target).closest("li[data-share-id]"),t=a.find(".sharingOptionsGroup .popovermenu");a.data("share-id");OC.showMenu(null,t);var n=!0===this.configModel.get("enableLinkPasswordByDefault");!(""!==t.find(".linkPassText").val())&&n&&t.find(".linkPassText").focus()},template:function(){return OC.Share.Templates.sharedialoglinkshareview},popoverMenuTemplate:function(e){return OC.Share.Templates.sharedialoglinkshareview_popover_menu(e)},pendingPopoverMenuTemplate:function(e){return OC.Share.Templates.sharedialoglinkshareview_popover_menu_pending(e)},onPopUpClick:function(e){e.preventDefault(),e.stopPropagation();var a=$(e.currentTarget).data("url"),t=$(e.currentTarget).data("window");if($(e.currentTarget).tooltip("hide"),a)if(!0===t){var n=screen.width/2-300,s=screen.height/2-200;window.open(a,"name","width=600, height=400, top="+s+", left="+n)}else window.location.href=a},onExpireDateChange:function(e){var a=$(e.target),t=a.closest("li[data-share-id]").data("share-id"),n=$("#expirationDateContainer-"+t),s=a.prop("checked");n.toggleClass("hidden",!s),s?(a.closest("li").next("li").removeClass("hidden"),this.showDatePicker(e)):(a.closest("li").next("li").addClass("hidden"),this.setExpirationDate("",t))},showDatePicker:function(e){var a=$(e.target),t=a.closest("li[data-share-id]").data("share-id"),n=a.data("max-date"),s="#expirationDatePicker-"+t,i=this;$(s).datepicker({dateFormat:"dd-mm-yy",onSelect:function(e){i.setExpirationDate(e,t)},maxDate:n}),$(s).datepicker("show"),$(s).focus()},setExpirationDate:function(e,a){this.model.saveLinkShare({expireDate:e,cid:a})},onChangeExpirationDate:function(e){var a=$(e.target),t=a.val(),n=a.closest("li[data-share-id]").data("share-id"),s="#expirationDatePicker-"+n;this.setExpirationDate(t,n),$(s).datepicker("hide")},getShareeList:function(){var e=this.model.get("linkShares");if(!this.model.hasLinkShares())return[];for(var a=[],t=0;t<e.length;t++){var n=this.getShareeObject(t);a.push(_.extend({},n))}return a},getShareeObject:function(e){var a=this.model.get("linkShares")[e];return _.extend({},a,{cid:a.id,shareAllowed:!0,linkShareLabel:a.label?a.label:t("core","Share link"),popoverMenu:{},shareLinkURL:a.url,newShareTitle:t("core","New share link"),copyLabel:t("core","Copy link"),showPending:this.showPending===a.id,linkShareCreationDate:t("core","Created on {time}",{time:moment(1e3*a.stime).format("LLLL")})})},getPopoverObject:function(a){var n="",s="",i="";switch(this.model.linkSharePermissions(a.id)){case OC.PERMISSION_READ:s="checked";break;case OC.PERMISSION_CREATE:i="checked";break;case OC.PERMISSION_UPDATE|OC.PERMISSION_CREATE|OC.PERMISSION_READ|OC.PERMISSION_DELETE:n="checked"}var l,r=!!a.password,o=!0===this.configModel.get("enableLinkPasswordByDefault"),d=this.configModel.get("enforcePasswordForPublicLink"),h=this.configModel.get("isDefaultExpireDateEnforced"),c=this.configModel.get("defaultExpireDate"),u=!!a.expiration||h;u&&(l=moment(a.expiration,"YYYY-MM-DD").format("DD-MM-YYYY"));var p=void 0!==oc_appswebroots.spreed,m=a.sendPasswordByTalk,f=a.hideDownload,g=null;if(u&&h){var v=a.stime;_.isNumber(v)&&(v=new Date(1e3*v)),v||(v=new Date),v=OC.Util.stripTime(v).getTime(),g=new Date(v+24*c*3600*1e3)}return{cid:a.id,shareLinkURL:a.url,passwordPlaceholder:r?"**********":e,isPasswordSet:r||o||d,showPasswordByTalkCheckBox:p&&r,passwordByTalkLabel:t("core","Password protect by Talk"),isPasswordByTalkSet:m,publicUploadRWChecked:n,publicUploadRChecked:s,publicUploadWChecked:i,hasExpireDate:u,expireDate:l,shareNote:a.note,hasNote:""!==a.note,maxDate:g,hideDownload:f,isExpirationEnforced:h}},onUnshare:function(e){e.preventDefault(),e.stopPropagation();var a=this,n=$(e.target);n.is("a")||(n=n.closest("a"));var s=n.find(".icon-loading-small").eq(0);if(!s.hasClass("hidden"))return!1;s.removeClass("hidden");var i=n.closest("li[data-share-id]"),l=i.data("share-id");return a.model.removeShare(l,{success:function(){i.remove(),a.render()},error:function(){s.addClass("hidden"),OC.Notification.showTemporary(t("core","Could not unshare"))}}),!1}});OC.Share.ShareDialogLinkShareView=n}()},function(e,a){!function(){var e=t("core","Choose a password for the mail share");OC.Share||(OC.Share={});var a=OC.Backbone.View.extend({id:"shareDialogLinkShare",configModel:void 0,_menuOpen:!1,_renderPermissionChange:!1,events:{"click .unshare":"onUnshare","click .share-add":"showNoteForm","click .share-note-delete":"deleteNote","click .share-note-submit":"updateNote","click .share-menu .icon-more":"onToggleMenu","click .permissions":"onPermissionChange","click .expireDate":"onExpireDateChange","click .password":"onMailSharePasswordProtectChange","click .passwordByTalk":"onMailSharePasswordProtectByTalkChange","click .secureDrop":"onSecureDropChange","keyup input.passwordField":"onMailSharePasswordKeyUp","focusout input.passwordField":"onMailSharePasswordEntered","change .datepicker":"onChangeExpirationDate","click .datepicker":"showDatePicker"},initialize:function(e){if(_.isUndefined(e.configModel))throw"missing OC.Share.ShareConfigModel";this.configModel=e.configModel;var a=this;this.model.on("change:shares",function(){a.render()})},getShareeObject:function(a){var n=this.model.getShareWith(a),s=this.model.getShareWithDisplayName(a),i=this.model.getShareWithAvatar(a),l="",r=this.model.getShareType(a),o=this.model.getSharedBy(a),d=this.model.getSharedByDisplayName(a),h=this.model.getFileOwnerUid(a);if(r===OC.Share.SHARE_TYPE_GROUP?s=s+" ("+t("core","group")+")":r===OC.Share.SHARE_TYPE_REMOTE?s=s+" ("+t("core","remote")+")":r===OC.Share.SHARE_TYPE_REMOTE_GROUP?s=s+" ("+t("core","remote group")+")":r===OC.Share.SHARE_TYPE_EMAIL?s=s+" ("+t("core","email")+")":r===OC.Share.SHARE_TYPE_CIRCLE||r===OC.Share.SHARE_TYPE_ROOM&&(s=s+" ("+t("core","conversation")+")"),r===OC.Share.SHARE_TYPE_GROUP?l=n+" ("+t("core","group")+")":r===OC.Share.SHARE_TYPE_REMOTE?l=n+" ("+t("core","remote")+")":r===OC.Share.SHARE_TYPE_REMOTE_GROUP?l=n+" ("+t("core","remote group")+")":r===OC.Share.SHARE_TYPE_EMAIL?l=n+" ("+t("core","email")+")":r===OC.Share.SHARE_TYPE_CIRCLE&&(l=n,n="circle-"+a),o!==oc_current_user){var c=""===l;c||(l+=" ("),l+=t("core","shared by {sharer}",{sharer:d}),c||(l+=")")}var u=this.model.get("shares")[a],p=u.password,m=null!==p&&""!==p,f=u.send_password_by_talk,g=this.model.getNote(a);return _.extend({},{cid:this.cid,hasSharePermission:this.model.hasSharePermission(a),editPermissionState:this.model.editPermissionState(a),hasCreatePermission:this.model.hasCreatePermission(a),hasUpdatePermission:this.model.hasUpdatePermission(a),hasDeletePermission:this.model.hasDeletePermission(a),sharedBy:o,sharedByDisplayName:d,shareWith:n,shareWithDisplayName:s,shareWithAvatar:i,shareWithTitle:l,shareType:r,shareId:this.model.get("shares")[a].id,modSeed:i||r!==OC.Share.SHARE_TYPE_USER&&r!==OC.Share.SHARE_TYPE_CIRCLE&&r!==OC.Share.SHARE_TYPE_ROOM,owner:h,isShareWithCurrentUser:r===OC.Share.SHARE_TYPE_USER&&n===oc_current_user,canUpdateShareSettings:o===oc_current_user||h===oc_current_user,isRemoteShare:r===OC.Share.SHARE_TYPE_REMOTE,isRemoteGroupShare:r===OC.Share.SHARE_TYPE_REMOTE_GROUP,isNoteAvailable:r!==OC.Share.SHARE_TYPE_REMOTE&&r!==OC.Share.SHARE_TYPE_REMOTE_GROUP,isMailShare:r===OC.Share.SHARE_TYPE_EMAIL,isCircleShare:r===OC.Share.SHARE_TYPE_CIRCLE,isFileSharedByMail:r===OC.Share.SHARE_TYPE_EMAIL&&!this.model.isFolder(),isPasswordSet:m&&!f,isPasswordByTalkSet:m&&f,isTalkEnabled:void 0!==oc_appswebroots.spreed,secureDropMode:!this.model.hasReadPermission(a),hasExpireDate:null!==this.model.getExpireDate(a),shareNote:g,hasNote:""!==g,expireDate:moment(this.model.getExpireDate(a),"YYYY-MM-DD").format("DD-MM-YYYY"),passwordPlaceholder:m?"**********":e,passwordByTalkPlaceholder:m&&f?"**********":e})},getShareProperties:function(){return{unshareLabel:t("core","Unshare"),addNoteLabel:t("core","Note to recipient"),canShareLabel:t("core","Can reshare"),canEditLabel:t("core","Can edit"),createPermissionLabel:t("core","Can create"),updatePermissionLabel:t("core","Can change"),deletePermissionLabel:t("core","Can delete"),secureDropLabel:t("core","File drop (upload only)"),expireDateLabel:t("core","Set expiration date"),passwordLabel:t("core","Password protect"),passwordByTalkLabel:t("core","Password protect by Talk"),crudsLabel:t("core","Access control"),expirationDatePlaceholder:t("core","Expiration date"),defaultExpireDate:moment().add(1,"day").format("DD-MM-YYYY"),triangleSImage:OC.imagePath("core","actions/triangle-s"),isResharingAllowed:this.configModel.get("isResharingAllowed"),isPasswordForMailSharesRequired:this.configModel.get("isPasswordForMailSharesRequired"),sharePermissionPossible:this.model.sharePermissionPossible(),editPermissionPossible:this.model.editPermissionPossible(),createPermissionPossible:this.model.createPermissionPossible(),updatePermissionPossible:this.model.updatePermissionPossible(),deletePermissionPossible:this.model.deletePermissionPossible(),sharePermission:OC.PERMISSION_SHARE,createPermission:OC.PERMISSION_CREATE,updatePermission:OC.PERMISSION_UPDATE,deletePermission:OC.PERMISSION_DELETE,readPermission:OC.PERMISSION_READ,isFolder:this.model.isFolder()}},getShareeList:function(){var e=this.getShareProperties();if(!this.model.hasUserShares())return[];for(var a=this.model.get("shares"),t=[],n=0;n<a.length;n++){var s=this.getShareeObject(n);s.shareType!==OC.Share.SHARE_TYPE_LINK&&t.push(_.extend({},e,s))}return t},getLinkReshares:function(){var e={unshareLabel:t("core","Unshare")};if(!this.model.hasUserShares())return[];for(var a=this.model.get("shares"),n=[],s=0;s<a.length;s++){var i=this.getShareeObject(s);i.shareType===OC.Share.SHARE_TYPE_LINK&&n.push(_.extend({},e,i,{shareInitiator:a[s].uid_owner,shareInitiatorText:t("core","{shareInitiatorDisplayName} shared via link",{shareInitiatorDisplayName:a[s].displayname_owner})}))}return n},render:function(){if(this._renderPermissionChange){var e=parseInt(this._renderPermissionChange,10),a=this.model.findShareWithIndex(e),t=this.getShareeObject(a);$.extend(t,this.getShareProperties()),this.$("li[data-share-id="+e+"]").find(".sharingOptionsGroup .popovermenu").replaceWith(this.popoverMenuTemplate(t))}else this.$el.html(this.template({cid:this.cid,sharees:this.getShareeList(),linkReshares:this.getLinkReshares()})),this.$(".avatar").each(function(){var e=$(this);e.hasClass("imageplaceholderseed")?(e.css({width:32,height:32}),e.data("avatar")?(e.css("border-radius","0%"),e.css("background","url("+e.data("avatar")+") no-repeat"),e.css("background-size","31px")):e.imageplaceholder(e.data("seed"))):e.avatar(e.data("username"),32,void 0,void 0,void 0,e.data("displayname"))}),this.$(".has-tooltip").tooltip({placement:"bottom"}),this.$("ul.shareWithList > li").each(function(){var e=$(this),a=e.data("share-with"),t=e.data("share-type");e.find("div.avatar, span.username").contactsMenu(a,t,e)});var n=this;if(this.getShareeList().forEach(function(e){var a=n.$("#canEdit-"+n.cid+"-"+e.shareId);1===a.length&&(a.prop("checked","checked"===e.editPermissionState),e.isFolder&&a.prop("indeterminate","indeterminate"===e.editPermissionState))}),this.$(".popovermenu").on("afterHide",function(){n._menuOpen=!1}),this.$(".popovermenu").on("beforeHide",function(){var e=parseInt(n._menuOpen,10);if(!_.isNaN(e)){var a=".expirationDateContainer-"+n.cid+"-"+e,t="#expirationDatePicker-"+n.cid+"-"+e,s="#expireDate-"+n.cid+"-"+e;$(s).prop("checked")&&($(t).removeClass("hidden-visually"),$(a).removeClass("hasDatepicker"),$(a+" .ui-datepicker").hide())}}),!1!==this._menuOpen){var s=parseInt(this._menuOpen,10);if(!_.isNaN(s)){var i="li[data-share-id="+s+"]";OC.showMenu(null,this.$(i+" .sharingOptionsGroup .popovermenu"))}}return this._renderPermissionChange=!1,autosize(this.$el.find(".share-note-form .share-note")),this.delegateEvents(),this},template:function(e){var a=e.sharees;if(_.isArray(a))for(var t=0;t<a.length;t++)e.sharees[t].popoverMenu=this.popoverMenuTemplate(a[t]);return OC.Share.Templates.sharedialogshareelistview(e)},popoverMenuTemplate:function(e){return OC.Share.Templates.sharedialogshareelistview_popover_menu(e)},showNoteForm:function(e){e.preventDefault(),e.stopPropagation();var a=$(e.target).closest("li"),t=a.next("li.share-note-form");a.find(".share-note-delete").toggleClass("hidden"),t.toggleClass("hidden"),t.find("textarea").focus()},deleteNote:function(e){e.preventDefault(),e.stopPropagation();var a=$(e.target),t=a.closest("li[data-share-id]").data("share-id"),n=a.closest("li"),s=n.next("li.share-note-form");console.log(s.find(".share-note")),s.find(".share-note").val(""),s.addClass("hidden"),n.find(".share-note-delete").addClass("hidden"),this.sendNote("",t,n)},updateNote:function(e){e.preventDefault(),e.stopPropagation();var a=$(e.target),t=a.closest("li[data-share-id]").data("share-id"),n=a.closest("li.share-note-form"),s=n.prev("li"),i=n.find(".share-note").val().trim();i.length<1||this.sendNote(i,t,s)},sendNote:function(e,a,t){var n=t.next("li.share-note-form"),s=n.find("input.share-note-submit"),i=n.find("input.share-note-error");s.prop("disabled",!0),t.find(".icon-loading-small").removeClass("hidden"),t.find(".icon-edit").hide();$.ajax({method:"PUT",url:OC.linkToOCS("apps/files_sharing/api/v1/shares",2)+a+"?"+OC.buildQueryString({format:"json"}),data:{note:e},complete:function(){s.prop("disabled",!1),t.find(".icon-loading-small").addClass("hidden"),t.find(".icon-edit").show()},error:function(){i.show(),setTimeout(function(){i.hide()},3e3)}})},onUnshare:function(e){e.preventDefault(),e.stopPropagation();var a=$(e.target);a.is("a")||(a=a.closest("a"));var n=a.find(".icon-loading-small").eq(0);if(!n.hasClass("hidden"))return!1;n.removeClass("hidden");var s=a.closest("li[data-share-id]"),i=s.data("share-id");return this.model.removeShare(i).done(function(){s.remove()}).fail(function(){n.addClass("hidden"),OC.Notification.showTemporary(t("core","Could not unshare"))}),!1},onToggleMenu:function(e){e.preventDefault(),e.stopPropagation();var a=$(e.target).closest("li[data-share-id]"),t=a.find(".sharingOptionsGroup .popovermenu");OC.showMenu(null,t),this._menuOpen=a.data("share-id")},onExpireDateChange:function(e){var a=$(e.target),t=a.closest("li[data-share-id]").data("share-id"),n=".expirationDateContainer-"+this.cid+"-"+t,s=$(n),i=a.prop("checked");s.toggleClass("hidden",!i),i?(a.closest("li").next("li").removeClass("hidden"),this.showDatePicker(e)):(a.closest("li").next("li").addClass("hidden"),this.setExpirationDate(t,""))},showDatePicker:function(e){var a=$(e.target).closest("li[data-share-id]").data("share-id"),t="#expirationDatePicker-"+this.cid+"-"+a,n=this;$(t).datepicker({dateFormat:"dd-mm-yy",onSelect:function(e){n.setExpirationDate(a,e)}}),$(t).focus()},setExpirationDate:function(e,a){this.model.updateShare(e,{expireDate:a},{})},onMailSharePasswordProtectChange:function(a){var t=$(a.target),n=t.closest("li[data-share-id]").data("share-id"),s=".passwordMenu-"+this.cid+"-"+n,i=$(s),l=this.$el.find(s+" .icon-loading-small"),r="#passwordField-"+this.cid+"-"+n,o=$(r),d=t.prop("checked"),h=$("#passwordByTalk-"+this.cid+"-"+n),c=h.prop("checked");if(d||c){if(d){if(c){this.model.updateShare(n,{sendPasswordByTalk:!1});var u=".passwordByTalkMenu-"+this.cid+"-"+n;$(u).addClass("hidden"),h.prop("checked",!1)}i.toggleClass("hidden",!d),o="#passwordField-"+this.cid+"-"+n,this.$(o).focus()}}else this.model.updateShare(n,{password:"",sendPasswordByTalk:!1}),o.attr("value",""),o.removeClass("error"),o.tooltip("hide"),l.addClass("hidden"),o.attr("placeholder",e),i.toggleClass("hidden",!d)},onMailSharePasswordProtectByTalkChange:function(a){var t=$(a.target),n=t.closest("li[data-share-id]").data("share-id"),s=".passwordByTalkMenu-"+this.cid+"-"+n,i=$(s),l=this.$el.find(s+" .icon-loading-small"),r="#passwordByTalkField-"+this.cid+"-"+n,o=$(r),d=t.prop("checked"),h=$("#password-"+this.cid+"-"+n),c=h.prop("checked");if(d){if(d){if(c){var u=".passwordMenu-"+this.cid+"-"+n;$(u).addClass("hidden"),h.prop("checked",!1)}i.toggleClass("hidden",!d),o="#passwordByTalkField-"+this.cid+"-"+n,this.$(o).focus()}}else this.model.updateShare(n,{password:"",sendPasswordByTalk:!1}),o.attr("value",""),o.removeClass("error"),o.tooltip("hide"),l.addClass("hidden"),o.attr("placeholder",e),i.toggleClass("hidden",!d)},onMailSharePasswordKeyUp:function(e){13===e.keyCode&&this.onMailSharePasswordEntered(e)},onMailSharePasswordEntered:function(a){var t,n=$(a.target),s=n.closest("li[data-share-id]").data("share-id"),i=".passwordMenu-"+this.cid+"-"+s,l=".passwordByTalkMenu-"+this.cid+"-"+s,r=n.attr("id").startsWith("passwordByTalk");if((t=r?this.$el.find(l+" .icon-loading-small"):this.$el.find(i+" .icon-loading-small")).hasClass("hidden")){n.removeClass("error");var o=n.val();""!==o&&"**********"!==o&&o!==e&&(t.removeClass("hidden").addClass("inlineblock"),this.model.updateShare(s,{password:o,sendPasswordByTalk:r},{error:function(e,a){n.tooltip("destroy"),t.removeClass("inlineblock").addClass("hidden"),n.addClass("error"),n.attr("title",a),n.tooltip({placement:"bottom",trigger:"manual"}),n.tooltip("show")},success:function(e,a){n.blur(),n.attr("value",""),n.attr("placeholder","**********"),t.removeClass("inlineblock").addClass("hidden")}}))}},onPermissionChange:function(e){e.preventDefault(),e.stopPropagation();var a=$(e.target),n=a.closest("li[data-share-id]"),s=n.data("share-id"),i=OC.PERMISSION_READ;if(this.model.isFolder()){var l,r=$(".permissions",n).not('input[name="edit"]').not('input[name="share"]');if("edit"===a.attr("name"))l=a.is(":checked"),$(r).prop("checked",l),l&&(i|=OC.PERMISSION_CREATE|OC.PERMISSION_UPDATE|OC.PERMISSION_DELETE);else{var o=r.filter(":checked").length;l=o===r.length;var d=$('input[name="edit"]',n);d.prop("checked",l),d.prop("indeterminate",!l&&o>0)}}else"edit"===a.attr("name")&&a.is(":checked")&&(i|=OC.PERMISSION_UPDATE);$(".permissions",n).not('input[name="edit"]').filter(":checked").each(function(e,a){i|=$(a).data("permissions")}),n.find("input[type=checkbox]").prop("disabled",!0);var h=function(){n.find("input[type=checkbox]").prop("disabled",!1)};this.model.updateShare(s,{permissions:i},{error:function(e,a){OC.dialogs.alert(a,t("core","Error while sharing")),h()},success:h}),this._renderPermissionChange=s},onSecureDropChange:function(e){e.preventDefault(),e.stopPropagation();var a=$(e.target),n=a.closest("li[data-share-id]"),s=n.data("share-id"),i=OC.PERMISSION_CREATE|OC.PERMISSION_UPDATE|OC.PERMISSION_DELETE|OC.PERMISSION_READ;a.is(":checked")&&(i=OC.PERMISSION_CREATE|OC.PERMISSION_UPDATE|OC.PERMISSION_DELETE),n.find("input[type=checkbox]").prop("disabled",!0);var l=function(){n.find("input[type=checkbox]").prop("disabled",!1)};this.model.updateShare(s,{permissions:i},{error:function(e,a){OC.dialogs.alert(a,t("core","Error while sharing")),l()},success:l}),this._renderPermissionChange=s}});OC.Share.ShareDialogShareeListView=a}()},function(e,a){!function(){OC.Share||(OC.Share={});var e=OC.Backbone.View.extend({_templates:{},_showLink:!0,_lookup:!1,_lookupAllowed:!1,tagName:"div",configModel:void 0,resharerInfoView:void 0,linkShareView:void 0,shareeListView:void 0,_lastSuggestions:void 0,_lastRecommendations:void 0,_pendingOperationsCount:0,events:{"focus .shareWithField":"onShareWithFieldFocus","input .shareWithField":"onShareWithFieldChanged","click .shareWithConfirm":"_confirmShare"},initialize:function(e){var a=this;if(this.model.on("fetchError",function(){OC.Notification.showTemporary(t("core","Share details could not be loaded for this item."))}),_.isUndefined(e.configModel))throw"missing OC.Share.ShareConfigModel";this.configModel=e.configModel,this.configModel.on("change:isRemoteShareAllowed",function(){a.render()}),this.configModel.on("change:isRemoteGroupShareAllowed",function(){a.render()}),this.model.on("change:permissions",function(){a.render()}),this.model.on("request",this._onRequest,this),this.model.on("sync",this._onEndRequest,this);var n={model:this.model,configModel:this.configModel},s={resharerInfoView:"ShareDialogResharerInfoView",linkShareView:"ShareDialogLinkShareView",shareeListView:"ShareDialogShareeListView"};for(var i in s){var l=s[i];this[i]=_.isUndefined(e[i])?new OC.Share[l](n):e[i]}_.bindAll(this,"autocompleteHandler","_onSelectRecipient","onShareWithFieldChanged","onShareWithFieldFocus"),OC.Plugins.attach("OC.Share.ShareDialogView",this)},onShareWithFieldChanged:function(){var e=this.$el.find(".shareWithField");e.val().length<2&&e.removeClass("error").tooltip("hide")},onShareWithFieldFocus:function(){var e=this.$el.find(".shareWithField");e.autocomplete("search",e.val())},_getSuggestions:function(e,a,n,s){if(this._lastSuggestions&&this._lastSuggestions.searchTerm===e&&this._lastSuggestions.lookup===s&&this._lastSuggestions.perPage===a&&this._lastSuggestions.model===n)return this._lastSuggestions.promise;var i=$.Deferred(),l=this;return $.get(OC.linkToOCS("apps/files_sharing/api/v1")+"sharees",{format:"json",search:e,lookup:s,perPage:a,itemType:n.get("itemType")},function(s){if(100===s.ocs.meta.statuscode){var r=function(e,a,t,s,i,l,r){var o,d,h,c,u,p,m,f,g;for(void 0===i&&(i=[]),void 0===l&&(l=[]),void 0===r&&(r=[]),o=e.length,f=0;f<o;f++)if(e[f].value.shareWith===OC.currentUser){e.splice(f,1);break}if(n.hasReshare())for(o=e.length,f=0;f<o;f++)if(e[f].value.shareWith===n.getReshareOwner()){e.splice(f,1);break}var v=n.get("shares"),S=v.length;for(f=0;f<S;f++){var C=v[f];if(C.share_type===OC.Share.SHARE_TYPE_USER){for(o=e.length,g=0;g<o;g++)if(e[g].value.shareWith===C.share_with){e.splice(g,1);break}}else if(C.share_type===OC.Share.SHARE_TYPE_GROUP){for(d=a.length,g=0;g<d;g++)if(a[g].value.shareWith===C.share_with){a.splice(g,1);break}}else if(C.share_type===OC.Share.SHARE_TYPE_REMOTE){for(h=t.length,g=0;g<h;g++)if(t[g].value.shareWith===C.share_with){t.splice(g,1);break}}else if(C.share_type===OC.Share.SHARE_TYPE_REMOTE_GROUP){for(c=s.length,g=0;g<c;g++)if(s[g].value.shareWith===C.share_with){s.splice(g,1);break}}else if(C.share_type===OC.Share.SHARE_TYPE_EMAIL){for(u=i.length,g=0;g<u;g++)if(i[g].value.shareWith===C.share_with){i.splice(g,1);break}}else if(C.share_type===OC.Share.SHARE_TYPE_CIRCLE){for(p=l.length,g=0;g<p;g++)if(l[g].value.shareWith===C.share_with){l.splice(g,1);break}}else if(C.share_type===OC.Share.SHARE_TYPE_ROOM)for(m=r.length,g=0;g<m;g++)if(r[g].value.shareWith===C.share_with){r.splice(g,1);break}}};r(s.ocs.data.exact.users,s.ocs.data.exact.groups,s.ocs.data.exact.remotes,s.ocs.data.exact.remote_groups,s.ocs.data.exact.emails,s.ocs.data.exact.circles,s.ocs.data.exact.rooms);var o=s.ocs.data.exact.users,d=s.ocs.data.exact.groups,h=s.ocs.data.exact.remotes,c=s.ocs.data.exact.remote_groups,u=[];void 0!==s.ocs.data.emails&&(u=s.ocs.data.exact.emails);var p=[];void 0!==s.ocs.data.circles&&(p=s.ocs.data.exact.circles);var m=[];void 0!==s.ocs.data.rooms&&(m=s.ocs.data.exact.rooms);var f=o.concat(d).concat(h).concat(c).concat(u).concat(p).concat(m);r(s.ocs.data.users,s.ocs.data.groups,s.ocs.data.remotes,s.ocs.data.remote_groups,s.ocs.data.emails,s.ocs.data.circles,s.ocs.data.rooms);var g=s.ocs.data.users,v=s.ocs.data.groups,S=s.ocs.data.remotes,C=s.ocs.data.remote_groups,w=s.ocs.data.lookup,b=s.ocs.data.lookupEnabled,P=[];void 0!==s.ocs.data.emails&&(P=s.ocs.data.emails);var _=[];void 0!==s.ocs.data.circles&&(_=s.ocs.data.circles);var E=[];void 0!==s.ocs.data.rooms&&(E=s.ocs.data.rooms);for(var k=f.concat(g).concat(v).concat(S).concat(C).concat(P).concat(_).concat(E).concat(w).sort((R="uuid",function(e,a){var t="",n="";return void 0!==e[R]&&(t=e[R]),void 0!==a[R]&&(n=a[R]),t<n?-1:t>n?1:0})),O=null,x=k.length,y=(s=[],0);y<x;y++)void 0!==k[y].uuid&&k[y].uuid===O&&(k[y].merged=!0),e!==k[y].name&&void 0!==k[y].merged||s.push(k[y]),O=k[y].uuid;var T=oc_config["sharing.maxAutocompleteResults"]>0&&Math.min(a,oc_config["sharing.maxAutocompleteResults"])<=Math.max(g.length+o.length,v.length+d.length,C.length+c.length,S.length+h.length,P.length+u.length,_.length+p.length,E.length+m.length,w.length);!l._lookup&&b&&s.push({label:t("core","Search globally"),value:{},lookup:!0}),i.resolve(s,f,T,b)}else i.reject(s.ocs.meta.message);var R}).fail(function(){i.reject()}),this._lastSuggestions={searchTerm:e,lookup:s,perPage:a,model:n,promise:i.promise()},this._lastSuggestions.promise},_getRecommendations:function(e){if(this._lastRecommendations&&this._lastRecommendations.model===e)return this._lastRecommendations.promise;var a=$.Deferred();return $.get(OC.linkToOCS("apps/files_sharing/api/v1")+"sharees_recommended",{format:"json",itemType:e.get("itemType")},function(t){if(100===t.ocs.meta.statuscode){var n=function(a,t,n,s,i,l,r){var o,d,h,c,u,p,m,f,g;for(void 0===i&&(i=[]),void 0===l&&(l=[]),void 0===r&&(r=[]),o=a.length,f=0;f<o;f++)if(a[f].value.shareWith===OC.currentUser){a.splice(f,1);break}if(e.hasReshare())for(o=a.length,f=0;f<o;f++)if(a[f].value.shareWith===e.getReshareOwner()){a.splice(f,1);break}var v=e.get("shares"),S=v.length;for(f=0;f<S;f++){var C=v[f];if(C.share_type===OC.Share.SHARE_TYPE_USER){for(o=a.length,g=0;g<o;g++)if(a[g].value.shareWith===C.share_with){a.splice(g,1);break}}else if(C.share_type===OC.Share.SHARE_TYPE_GROUP){for(d=t.length,g=0;g<d;g++)if(t[g].value.shareWith===C.share_with){t.splice(g,1);break}}else if(C.share_type===OC.Share.SHARE_TYPE_REMOTE){for(h=n.length,g=0;g<h;g++)if(n[g].value.shareWith===C.share_with){n.splice(g,1);break}}else if(C.share_type===OC.Share.SHARE_TYPE_REMOTE_GROUP){for(c=s.length,g=0;g<c;g++)if(s[g].value.shareWith===C.share_with){s.splice(g,1);break}}else if(C.share_type===OC.Share.SHARE_TYPE_EMAIL){for(u=i.length,g=0;g<u;g++)if(i[g].value.shareWith===C.share_with){i.splice(g,1);break}}else if(C.share_type===OC.Share.SHARE_TYPE_CIRCLE){for(p=l.length,g=0;g<p;g++)if(l[g].value.shareWith===C.share_with){l.splice(g,1);break}}else if(C.share_type===OC.Share.SHARE_TYPE_ROOM)for(m=r.length,g=0;g<m;g++)if(r[g].value.shareWith===C.share_with){r.splice(g,1);break}}};n(t.ocs.data.exact.users,t.ocs.data.exact.groups,t.ocs.data.exact.remotes,t.ocs.data.exact.remote_groups,t.ocs.data.exact.emails,t.ocs.data.exact.circles,t.ocs.data.exact.rooms);var s=t.ocs.data.exact.users,i=t.ocs.data.exact.groups,l=t.ocs.data.exact.remotes||[],r=t.ocs.data.exact.remote_groups||[],o=[];void 0!==t.ocs.data.emails&&(o=t.ocs.data.exact.emails);var d=[];void 0!==t.ocs.data.circles&&(d=t.ocs.data.exact.circles);var h=[];void 0!==t.ocs.data.rooms&&(h=t.ocs.data.exact.rooms);var c=s.concat(i).concat(l).concat(r).concat(o).concat(d).concat(h);n(t.ocs.data.users,t.ocs.data.groups,t.ocs.data.remotes,t.ocs.data.remote_groups,t.ocs.data.emails,t.ocs.data.circles,t.ocs.data.rooms);var u=t.ocs.data.users,p=t.ocs.data.groups,m=t.ocs.data.remotes||[],f=t.ocs.data.remote_groups||[],g=t.ocs.data.lookup||[],v=[];void 0!==t.ocs.data.emails&&(v=t.ocs.data.emails);var S=[];void 0!==t.ocs.data.circles&&(S=t.ocs.data.circles);var C=[];void 0!==t.ocs.data.rooms&&(C=t.ocs.data.rooms);for(var w=c.concat(u).concat(p).concat(m).concat(f).concat(v).concat(S).concat(C).concat(g).sort((k="uuid",function(e,a){var t="",n="";return void 0!==e[k]&&(t=e[k]),void 0!==a[k]&&(n=a[k]),t<n?-1:t>n?1:0})),b=null,P=w.length,_=(t=[],0);_<P;_++)void 0!==w[_].uuid&&w[_].uuid===b&&(w[_].merged=!0),void 0===w[_].merged&&t.push(w[_]),b=w[_].uuid;var E=oc_config["sharing.maxAutocompleteResults"]>0&&Math.min(perPage,oc_config["sharing.maxAutocompleteResults"])<=Math.max(u.length+s.length,p.length+i.length,f.length+r.length,m.length+l.length,v.length+o.length,S.length+d.length,C.length+h.length,g.length);a.resolve(t,c,E)}else a.reject(t.ocs.meta.message);var k}).fail(function(){a.reject()}),this._lastRecommendations={model:e,promise:a.promise()},this._lastRecommendations.promise},recommendationHandler:function(e){var a=$(".shareWithField");this._getRecommendations(this.model).done(function(t){console.info("recommendations",t),t.length>0?(a.autocomplete("option","autoFocus",!0),e(t)):(console.info("no sharing recommendations found"),e())}).fail(function(e){console.error("could not load recommendations",e)})},autocompleteHandler:function(e,a){if(0===e.term.length)return console.info(e.term,"empty search term -> using recommendations"),void this.recommendationHandler(a);var s=$(".shareWithField"),i=this,l=this.$el.find(".shareWithLoading"),r=this.$el.find(".shareWithConfirm"),o=oc_config["sharing.minSearchStringLength"];if(e.term.trim().length<o){var d=n("core","At least {count} character is needed for autocompletion","At least {count} characters are needed for autocompletion",o,{count:o});return s.addClass("error").attr("data-original-title",d).tooltip("hide").tooltip({placement:"bottom",trigger:"manual"}).tooltip("fixTitle").tooltip("show"),void a()}l.removeClass("hidden"),l.addClass("inlineblock"),r.addClass("hidden"),this._pendingOperationsCount++,s.removeClass("error").tooltip("hide");var h=parseInt(oc_config["sharing.maxAutocompleteResults"],10)||200;this._getSuggestions(e.term.trim(),h,i.model,i._lookup).done(function(e,n,o){if(i._pendingOperationsCount--,0===i._pendingOperationsCount&&(l.addClass("hidden"),l.removeClass("inlineblock"),r.removeClass("hidden")),e.length>0){if(s.autocomplete("option","autoFocus",!0),a(e),o){var d=t("core","This list is maybe truncated - please refine your search term to see more results.");$(".ui-autocomplete").append('<li class="autocomplete-note">'+d+"</li>")}}else{var h=t("core","No users or groups found for {search}",{search:s.val()});i.configModel.get("allowGroupSharing")||(h=t("core","No users found for {search}",{search:$(".shareWithField").val()})),s.addClass("error").attr("data-original-title",h).tooltip("hide").tooltip({placement:"top",trigger:"manual"}).tooltip("fixTitle").tooltip("show"),a()}}).fail(function(e){i._pendingOperationsCount--,0===i._pendingOperationsCount&&(l.addClass("hidden"),l.removeClass("inlineblock"),r.removeClass("hidden")),e?OC.Notification.showTemporary(t("core",'An error occurred ("{message}"). Please try again',{message:e})):OC.Notification.showTemporary(t("core","An error occurred. Please try again"))})},autocompleteRenderItem:function(e,a){var n="icon-user",s=escapeHTML(a.label),i="",l="";void 0!==a.type&&null!==a.type&&(l=function(e){switch(e){case"HOME":return t("core","Home");case"WORK":return t("core","Work");case"OTHER":return t("core","Other");default:return""+e}}(a.type)+" "),void 0!==a.name&&(s=escapeHTML(a.name)),a.value.shareType===OC.Share.SHARE_TYPE_GROUP?n="icon-contacts-dark":a.value.shareType===OC.Share.SHARE_TYPE_REMOTE?(n="icon-shared",i+=a.value.shareWith):a.value.shareType===OC.Share.SHARE_TYPE_REMOTE_GROUP?(s=t("core","{sharee} (remote group)",{sharee:s},void 0,{escape:!1}),n="icon-shared",i+=a.value.shareWith):a.value.shareType===OC.Share.SHARE_TYPE_EMAIL?(n="icon-mail",i+=a.value.shareWith):a.value.shareType===OC.Share.SHARE_TYPE_CIRCLE?(s=t("core","{sharee} ({type}, {owner})",{sharee:s,type:a.value.circleInfo,owner:a.value.circleOwner},void 0,{escape:!1}),n="icon-circle"):a.value.shareType===OC.Share.SHARE_TYPE_ROOM&&(n="icon-talk");var r=$("<div class='share-autocomplete-item'/>");if(a.merged)r.addClass("merged"),s=a.value.shareWith,i=l;else if(a.lookup)s=a.label,n=!1,r.append('<span class="icon icon-search search-globally"></span>');else{var o=$("<div class='avatardiv'></div>").appendTo(r);a.value.shareType===OC.Share.SHARE_TYPE_USER||a.value.shareType===OC.Share.SHARE_TYPE_CIRCLE?o.avatar(a.value.shareWith,32,void 0,void 0,void 0,a.label):(void 0===a.uuid&&(a.uuid=s),o.imageplaceholder(a.uuid,s,32)),i=l+i}return""!==i&&r.addClass("with-description"),$("<div class='autocomplete-item-text'></div>").html(s.replace(new RegExp(this.term,"gi"),"<span class='ui-state-highlight'>$&</span>")+'<span class="autocomplete-item-details">'+i+"</span>").appendTo(r),r.attr("title",a.value.shareWith),n&&r.append('<span class="icon '+n+'" title="'+s+'"></span>'),r=$("<a>").append(r),$("<li>").addClass(a.value.shareType===OC.Share.SHARE_TYPE_GROUP?"group":"user").append(r).appendTo(e)},_onSelectRecipient:function(e,a){var t=this;if(9==e.keyCode)return e.preventDefault(),void 0!==a.item.name?e.target.value=a.item.name:e.target.value=a.item.label,setTimeout(function(){$(e.target).attr("disabled",!1).autocomplete("search",$(e.target).val())},0),!1;if(a.item.lookup){this._lookup=!0;var n=this.$el.find(".shareWithField"),s=n.val();return setTimeout(function(){console.debug("searching again, but globally. search term: "+s),n.autocomplete("search",s)},0),!1}e.preventDefault(),e.stopImmediatePropagation(),$(e.target).attr("disabled",!0).val(a.item.label);var i=this.$el.find(".shareWithLoading"),l=this.$el.find(".shareWithConfirm");i.removeClass("hidden"),i.addClass("inlineblock"),l.addClass("hidden"),this._pendingOperationsCount++,this.model.addShare(a.item.value,{success:function(){t._lastSuggestions=void 0,$(e.target).val("").attr("disabled",!1),t._pendingOperationsCount--,0===t._pendingOperationsCount&&(i.addClass("hidden"),i.removeClass("inlineblock"),l.removeClass("hidden"))},error:function(a,n){OC.Notification.showTemporary(n),$(e.target).attr("disabled",!1).autocomplete("search",$(e.target).val()),t._pendingOperationsCount--,0===t._pendingOperationsCount&&(i.addClass("hidden"),i.removeClass("inlineblock"),l.removeClass("hidden"))}})},_confirmShare:function(){var e=this,a=$(".shareWithField"),t=this.$el.find(".shareWithLoading"),n=this.$el.find(".shareWithConfirm");t.removeClass("hidden"),t.addClass("inlineblock"),n.addClass("hidden"),this._pendingOperationsCount++,a.prop("disabled",!0),a.autocomplete("close"),a.autocomplete("disable");var s=function(){e._pendingOperationsCount--,0===e._pendingOperationsCount&&(t.addClass("hidden"),t.removeClass("inlineblock"),n.removeClass("hidden")),a.prop("disabled",!1),a.focus()},i=parseInt(oc_config["sharing.maxAutocompleteResults"],10)||200;this._getSuggestions(a.val(),i,this.model,this._lookup).done(function(t,n){if(0===t.length)return s(),void a.autocomplete("enable");if(1!==n.length)return s(),void a.autocomplete("enable");e.model.addShare(n[0].value,{success:function(){e._lastSuggestions=void 0,a.val(""),s(),a.autocomplete("enable")},error:function(e,t){s(),a.autocomplete("enable"),OC.Notification.showTemporary(t)}})}).fail(function(e){s(),a.autocomplete("enable")})},_toggleLoading:function(e){this._loading=e,this.$el.find(".subView").toggleClass("hidden",e),this.$el.find(".loading").toggleClass("hidden",!e)},_onRequest:function(){this._loadingOnce||this._toggleLoading(!0)},_onEndRequest:function(){var e=this;this._toggleLoading(!1),this._loadingOnce||(this._loadingOnce=!0,OC.Util.isIE()||_.defer(function(){e.$(".shareWithField").focus()}))},render:function(){var e=this,a=OC.Share.Templates.sharedialogview;this.$el.html(a({cid:this.cid,shareLabel:t("core","Share"),sharePlaceholder:this._renderSharePlaceholderPart(),isSharingAllowed:this.model.sharePermissionPossible()}));var n=this.$el.find(".shareWithField");if(n.length){n.autocomplete({minLength:0,delay:750,focus:function(e){e.preventDefault()},source:this.autocompleteHandler,select:this._onSelectRecipient,open:function(){var e=$(this).autocomplete("widget"),a=e.find("li").size();e.removeClass("item-count-1"),e.removeClass("item-count-2"),a<=2&&e.addClass("item-count-"+a)}}).data("ui-autocomplete")._renderItem=this.autocompleteRenderItem,n.on("keydown",null,function(a){return 13!==a.keyCode||(e._confirmShare(),!1)})}return this.resharerInfoView.$el=this.$el.find(".resharerInfoView"),this.resharerInfoView.render(),this.linkShareView.$el=this.$el.find(".linkShareView"),this.linkShareView.render(),this.shareeListView.$el=this.$el.find(".shareeListView"),this.shareeListView.render(),this.$el.find(".hasTooltip").tooltip(),this},setShowLink:function(e){this._showLink="boolean"!=typeof e||e,this.linkShareView.showLink=this._showLink},_renderSharePlaceholderPart:function(){var e=this.configModel.get("isRemoteShareAllowed"),a=this.configModel.get("isMailShareAllowed");return!e&&a?t("core","Name or email address..."):e&&!a?t("core","Name or federated cloud ID..."):e&&a?t("core","Name, federated cloud ID or email address..."):t("core","Name...")}});OC.Share.ShareDialogView=e}()},function(e,a){OC.Share=_.extend(OC.Share||{},{SHARE_TYPE_USER:0,SHARE_TYPE_GROUP:1,SHARE_TYPE_LINK:3,SHARE_TYPE_EMAIL:4,SHARE_TYPE_REMOTE:6,SHARE_TYPE_CIRCLE:7,SHARE_TYPE_GUEST:8,SHARE_TYPE_REMOTE_GROUP:9,SHARE_TYPE_ROOM:10,_REMOTE_OWNER_REGEXP:new RegExp("^([^@]*)@(([^@]*)@)?([^/]*)([/](.*)?)?$"),itemShares:[],statuses:{},currentShares:{},droppedDown:!1,loadIcons:function(e,a,t){var n=a.dirInfo.path;"/"===n&&(n=""),n+="/"+a.dirInfo.name,$.get(OC.linkToOCS("apps/files_sharing/api/v1",2)+"shares",{subfiles:"true",path:n,format:"json"},function(n){n&&200===n.ocs.meta.statuscode&&(OC.Share.statuses={},$.each(n.ocs.data,function(e,a){a.item_source in OC.Share.statuses||(OC.Share.statuses[a.item_source]={link:!1}),a.share_type===OC.Share.SHARE_TYPE_LINK&&(OC.Share.statuses[a.item_source]={link:!0})}),_.isFunction(t)?t(OC.Share.statuses):OC.Share.updateIcons(e,a))})},updateIcons:function(e,a){var n,s,i;for(n in!a&&OCA.Files&&(a=OCA.Files.App.fileList),a&&(s=a.$fileList,i=a.getCurrentDirectory()),OC.Share.statuses){var l="icon-shared",r=OC.Share.statuses[n],o=r.link;if(o&&(l="icon-public"),"file"!==e&&"folder"!==e)$('a.share[data-item="'+n+'"] .icon').removeClass("icon-shared icon-public").addClass(l);else{var d,h=s.find('tr[data-id="'+n+'"]'),c=OC.imagePath("core","filetypes/folder-shared");if(h.length>0)this.markFileAsShared(h,!0,o);else{var u=i;if(u.length>1)for(var p="",m=u;m!=p;){if(m===r.path&&!r.link){var f,g=s.find('.fileactions .action[data-action="Share"]'),v=s.find(".filename");for(f=0;f<g.length;f++)(d=$(g[f]).find("img")).attr("src")!==OC.imagePath("core","actions/public")&&(d.attr("src",image),$(g[f]).addClass("permanent"),$(g[f]).html("<span> "+t("core","Shared")+"</span>").prepend(d));for(f=0;f<v.length;f++)"dir"===$(v[f]).closest("tr").data("type")&&$(v[f]).find(".thumbnail").css("background-image","url("+c+")")}p=m,m=OC.Share.dirname(m)}}}}},updateIcon:function(e,a){var t=!1,n=!1,s="";if($.each(OC.Share.itemShares,function(e){if(OC.Share.itemShares[e])if(e==OC.Share.SHARE_TYPE_LINK){if(1==OC.Share.itemShares[e])return t=!0,s="icon-public",void(n=!0)}else OC.Share.itemShares[e].length>0&&(t=!0,s="icon-shared")}),"file"!=e&&"folder"!=e)$('a.share[data-item="'+a+'"] .icon').removeClass("icon-shared icon-public").addClass(s);else{var i=$("tr").filterAttr("data-id",String(a));i.length>0&&i.each(function(){OC.Share.markFileAsShared($(this),t,n)})}t?(OC.Share.statuses[a]=OC.Share.statuses[a]||{},OC.Share.statuses[a].link=n):delete OC.Share.statuses[a]},_formatRemoteShare:function(e,a,t){var n=this._REMOTE_OWNER_REGEXP.exec(e);if(!n)return'<span class="avatar" data-username="'+escapeHTML(e)+'" title="'+t+" "+escapeHTML(a)+'"></span>'+('<span class="hidden-visually">'+t+" "+escapeHTML(a)+"</span> ");var s=n[1],i=n[3],l=n[4],r=t+" "+s;i&&(r+="@"+i),l&&(i||(i="…"),r+="@"+l);var o='<span class="remoteAddress" title="'+escapeHTML(r)+'">';return o+='<span class="username">'+escapeHTML(s)+"</span>",i&&(o+='<span class="userDomain">@'+escapeHTML(i)+"</span>"),o+="</span> "},_formatShareList:function(e){var a=this;return(e=_.toArray(e)).sort(function(e,a){return e.shareWithDisplayName.localeCompare(a.shareWithDisplayName)}),$.map(e,function(e){return a._formatRemoteShare(e.shareWith,e.shareWithDisplayName,t("core","Shared with"))})},markFileAsShared:function(e,a,n){var s,i,l,r,o=e.find('.fileactions .action[data-action="Share"]'),d=e.data("type"),h=o.find(".icon"),c=e.attr("data-share-owner-id"),u=e.attr("data-share-owner"),p="icon-shared";if(o.removeClass("shared-style"),"dir"===d&&(a||n||c))r=n?OC.MimeType.getIconUrl("dir-public"):OC.MimeType.getIconUrl("dir-shared"),e.find(".filename .thumbnail").css("background-image","url("+r+")"),e.attr("data-icon",r);else if("dir"===d){var m=e.attr("data-e2eencrypted"),f=e.attr("data-mounttype");"true"===m?(r=OC.MimeType.getIconUrl("dir-encrypted"),e.attr("data-icon",r)):f&&0===f.indexOf("external")?(r=OC.MimeType.getIconUrl("dir-external"),e.attr("data-icon",r)):(r=OC.MimeType.getIconUrl("dir"),e.removeAttr("data-icon")),e.find(".filename .thumbnail").css("background-image","url("+r+")")}a||c?(i=e.data("share-recipient-data"),o.addClass("shared-style"),l="<span>"+t("core","Shared")+"</span>",c?(s=t("core","Shared by"),l=this._formatRemoteShare(c,u,s)):i&&(l=this._formatShareList(i)),o.html(l).prepend(h),(c||i)&&(o.find(".avatar").each(function(){$(this).avatar($(this).data("username"),32)}),o.find("span[title]").tooltip({placement:"top"}))):o.html('<span class="hidden-visually">'+t("core","Shared")+"</span>").prepend(h);n&&(p="icon-public"),h.removeClass("icon-shared icon-public").addClass(p)},showDropDown:function(e,a,t,n,s,i){var l=new OC.Share.ShareConfigModel,r={itemType:e,itemSource:a,possiblePermissions:s},o=new OC.Share.ShareItemModel(r,{configModel:l}),d=new OC.Share.ShareDialogView({id:"dropdown",model:o,configModel:l,className:"drop shareDropDown",attributes:{"data-item-source-name":i,"data-item-type":e,"data-item-source":a}});d.setShowLink(n);var h=d.render().$el;h.appendTo(t),h.slideDown(OC.menuSpeed,function(){OC.Share.droppedDown=!0}),o.fetch()},hideDropDown:function(e){OC.Share.currentShares=null,$("#dropdown").slideUp(OC.menuSpeed,function(){OC.Share.droppedDown=!1,$("#dropdown").remove(),"undefined"!=typeof FileActions&&$("tr").removeClass("mouseOver"),e&&e.call()})},dirname:function(e){return e.replace(/\\/g,"/").replace(/\/[^\/]*$/,"")}}),$(document).ready(function(){if("undefined"!=typeof monthNames){var e=new Date;e.setDate(e.getDate()+1),$.datepicker.setDefaults({monthNames:monthNames,monthNamesShort:monthNamesShort,dayNames:dayNames,dayNamesMin:dayNamesMin,dayNamesShort:dayNamesShort,firstDay:firstDay,minDate:e})}$(this).click(function(e){var a=$(e.target),t=!a.is(".drop, .ui-datepicker-next, .ui-datepicker-prev, .ui-icon")&&!a.closest("#ui-datepicker-div").length&&!a.closest(".ui-autocomplete").length;OC.Share&&OC.Share.droppedDown&&t&&0===$("#dropdown").has(e.target).length&&OC.Share.hideDropDown()})})}]);
//# sourceMappingURL=share_backend.js.map