define(["require","exports","tslib","external/react","modules/clean/datetime","modules/core/i18n","modules/clean/react/file_viewer/share_helpers","modules/clean/react_format","modules/core/exception","modules/clean/react/file_activity_stream/file_activity_stream_card","modules/clean/react/file_activity_stream/utils"],function(e,t,i,a,n,r,s,o,c,l,m){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var d=r._("link viewers can comment",{comment:"used to explain what permissions a user has on a file"}),_=r._("link viewers can view",{comment:"used to explain what permissions a user has on a file"}),u=r._("anyone with the link can access",{comment:"used to explain who has access to a file"}),p=r._("only team members can access",{comment:"used to explain who has access to a file"}),v=r._("only invited members can access",{comment:"used to explain who has access to a file"}),h=r._("anyone with the link can comment",{comment:"used to explain who has access to a file"}),f=r._("anyone with the link can view",{comment:"used to explain who has access to a file"}),w=r._("team members can comment",{comment:"used to explain who has access to a file"}),y=r._("team members can view",{comment:"used to explain who has access to a file"}),g=r._("invited members can comment",{comment:"used to explain who has access to a file"}),x=r._("invited members can view",{comment:"used to explain who has access to a file"}),k={viewer:d,viewer_no_comment:_},E={public:u,team:p,off:v},b={public:{viewer:h,viewer_no_comment:f},team:{viewer:w,viewer_no_comment:y},off:{viewer:g,viewer_no_comment:x}},A=(function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.onShareSettingsClick=function(){s.share(t.props.file,t.props.viewingUser,null,"PREVIEW_PAGE")},t}return i.__extends(t,e),Object.defineProperty(t.prototype,"message",{get:function(){var e=this.props.activity.user;return m.isCurrentViewer(e)?o.reactFormat(r._("You modified the link settings"),{strong:a.createElement("strong",null)}):o.reactFormat(r._("%(name)s modified the link settings"),{strong:a.createElement("strong",null),name:e.display_name})},enumerable:!0,configurable:!0}),t.prototype.renderAudienceAndOrAccessLevel=function(e,t){if(void 0===t&&void 0===e)return null;var i,n;return t&&e?(i=b[e][t],void 0===i&&(n="unknown audience ("+e+") and access level "+t+" combination")):t?(i=k[t],void 0===i&&(n="unknown access level ("+t+")")):e&&(i=E[e],void 0===i&&(n="unknown audience ("+e+")")),void 0!==n?(c.reportException({err:new Error(n+" for FileActivity Stream Shared Link Change card"),tags:["file-activity-stream"]}),null):a.createElement("div",{className:"file_activity_stream_card__detail_line"},i)},t.prototype.renderExpiration=function(e){if(void 0===e)return null;var t;if("remove_expiry"===e)t=r._("link no longer expires");else{if(!e.set_expiry)return null;t=o.reactFormat(r._("link expires on %(expiration)s"),{expiration:n.format_date(e.set_expiry,n.localized_date_format)})}return a.createElement("div",{className:"file_activity_stream_card__detail_line"},t)},t.prototype.renderPassword=function(e){if(void 0===e)return null;var t;if("remove_password"===e)t=r._("password removed");else{if(!e.set_password)return null;t=r._("password set")}return a.createElement("div",{className:"file_activity_stream_card__detail_line"},t)},t.prototype.render=function(){var e=this.props.activity;return a.createElement(l.FileActivityStreamCard,{user:e.user,timestamp:e.timestamp,className:"file_shared_link_change_activity_stream_card",action:{text:r._("Sharing settings"),onClick:this.onShareSettingsClick},message:this.message},a.createElement(l.FileActivityStreamCard.Detail,{placeholderClass:"file_activity_stream_card__image_placeholder"},a.createElement("div",null,this.renderAudienceAndOrAccessLevel(e.changed_audience,e.changed_access_level),this.renderExpiration(e.changed_expiration),this.renderPassword(e.changed_is_password_required))))},t})(a.Component);t.FileSharedLinkChangeActivityCard=A});
//# sourceMappingURL=file_shared_link_change_activity_card.min.js-vfl3O8iUc.map