Repository: hzcforever/nowcoder-project Branch: master Commit: aaf6d36983d7 Files: 250 Total size: 5.7 MB Directory structure: gitextract_xieu8nyq/ ├── README.md ├── wenda/ │ ├── .idea/ │ │ ├── compiler.xml │ │ ├── encodings.xml │ │ ├── inspectionProfiles/ │ │ │ └── Project_Default.xml │ │ ├── libraries/ │ │ │ ├── Maven__antlr_antlr_2_7_7.xml │ │ │ ├── Maven__aopalliance_aopalliance_1_0.xml │ │ │ ├── Maven__ch_qos_logback_logback_classic_1_1_7.xml │ │ │ ├── Maven__ch_qos_logback_logback_core_1_1_7.xml │ │ │ ├── Maven__com_alibaba_fastjson_1_2_13.xml │ │ │ ├── Maven__com_fasterxml_classmate_1_1_0.xml │ │ │ ├── Maven__com_fasterxml_jackson_core_jackson_annotations_2_6_7.xml │ │ │ ├── Maven__com_fasterxml_jackson_core_jackson_core_2_6_7.xml │ │ │ ├── Maven__com_fasterxml_jackson_core_jackson_databind_2_6_7.xml │ │ │ ├── Maven__com_google_protobuf_protobuf_java_2_6_0.xml │ │ │ ├── Maven__commons_beanutils_commons_beanutils_1_9_2.xml │ │ │ ├── Maven__commons_chain_commons_chain_1_1.xml │ │ │ ├── Maven__commons_collections_commons_collections_3_2_2.xml │ │ │ ├── Maven__commons_digester_commons_digester_2_1.xml │ │ │ ├── Maven__commons_lang_commons_lang_2_4.xml │ │ │ ├── Maven__commons_validator_commons_validator_1_3_1.xml │ │ │ ├── Maven__dom4j_dom4j_1_1.xml │ │ │ ├── Maven__javax_activation_activation_1_1.xml │ │ │ ├── Maven__javax_mail_mail_1_4_7.xml │ │ │ ├── Maven__javax_validation_validation_api_1_1_0_Final.xml │ │ │ ├── Maven__junit_junit_4_12.xml │ │ │ ├── Maven__mysql_mysql_connector_java_8_0_12.xml │ │ │ ├── Maven__org_apache_commons_commons_pool2_2_4_2.xml │ │ │ ├── Maven__org_apache_struts_struts_core_1_3_8.xml │ │ │ ├── Maven__org_apache_struts_struts_taglib_1_3_8.xml │ │ │ ├── Maven__org_apache_struts_struts_tiles_1_3_8.xml │ │ │ ├── Maven__org_apache_tomcat_embed_tomcat_embed_core_8_0_36.xml │ │ │ ├── Maven__org_apache_tomcat_embed_tomcat_embed_el_8_0_36.xml │ │ │ ├── Maven__org_apache_tomcat_embed_tomcat_embed_logging_juli_8_0_36.xml │ │ │ ├── Maven__org_apache_tomcat_embed_tomcat_embed_websocket_8_0_36.xml │ │ │ ├── Maven__org_apache_tomcat_tomcat_jdbc_8_0_36.xml │ │ │ ├── Maven__org_apache_tomcat_tomcat_juli_8_0_36.xml │ │ │ ├── Maven__org_apache_velocity_velocity_1_7.xml │ │ │ ├── Maven__org_apache_velocity_velocity_tools_2_0.xml │ │ │ ├── Maven__org_aspectj_aspectjweaver_1_8_9.xml │ │ │ ├── Maven__org_hamcrest_hamcrest_core_1_3.xml │ │ │ ├── Maven__org_hamcrest_hamcrest_library_1_3.xml │ │ │ ├── Maven__org_hibernate_hibernate_validator_5_2_4_Final.xml │ │ │ ├── Maven__org_jboss_logging_jboss_logging_3_3_0_Final.xml │ │ │ ├── Maven__org_mockito_mockito_core_1_10_19.xml │ │ │ ├── Maven__org_mybatis_mybatis_3_4_0.xml │ │ │ ├── Maven__org_mybatis_mybatis_spring_1_3_0.xml │ │ │ ├── Maven__org_mybatis_spring_boot_mybatis_spring_boot_autoconfigure_1_1_1.xml │ │ │ ├── Maven__org_mybatis_spring_boot_mybatis_spring_boot_starter_1_1_1.xml │ │ │ ├── Maven__org_objenesis_objenesis_2_1.xml │ │ │ ├── Maven__org_slf4j_jcl_over_slf4j_1_7_21.xml │ │ │ ├── Maven__org_slf4j_jul_to_slf4j_1_7_21.xml │ │ │ ├── Maven__org_slf4j_log4j_over_slf4j_1_7_21.xml │ │ │ ├── Maven__org_slf4j_slf4j_api_1_7_21.xml │ │ │ ├── Maven__org_springframework_boot_spring_boot_1_3_6_RELEASE.xml │ │ │ ├── Maven__org_springframework_boot_spring_boot_autoconfigure_1_3_6_RELEASE.xml │ │ │ ├── Maven__org_springframework_boot_spring_boot_devtools_1_3_6_RELEASE.xml │ │ │ ├── Maven__org_springframework_boot_spring_boot_starter_1_3_6_RELEASE.xml │ │ │ ├── Maven__org_springframework_boot_spring_boot_starter_aop_1_3_6_RELEASE.xml │ │ │ ├── Maven__org_springframework_boot_spring_boot_starter_jdbc_1_3_6_RELEASE.xml │ │ │ ├── Maven__org_springframework_boot_spring_boot_starter_logging_1_3_6_RELEASE.xml │ │ │ ├── Maven__org_springframework_boot_spring_boot_starter_test_1_3_6_RELEASE.xml │ │ │ ├── Maven__org_springframework_boot_spring_boot_starter_tomcat_1_3_6_RELEASE.xml │ │ │ ├── Maven__org_springframework_boot_spring_boot_starter_validation_1_3_6_RELEASE.xml │ │ │ ├── Maven__org_springframework_boot_spring_boot_starter_velocity_1_3_6_RELEASE.xml │ │ │ ├── Maven__org_springframework_boot_spring_boot_starter_web_1_3_6_RELEASE.xml │ │ │ ├── Maven__org_springframework_spring_aop_4_2_7_RELEASE.xml │ │ │ ├── Maven__org_springframework_spring_beans_4_2_7_RELEASE.xml │ │ │ ├── Maven__org_springframework_spring_context_4_2_7_RELEASE.xml │ │ │ ├── Maven__org_springframework_spring_context_support_4_2_7_RELEASE.xml │ │ │ ├── Maven__org_springframework_spring_core_4_2_7_RELEASE.xml │ │ │ ├── Maven__org_springframework_spring_expression_4_2_7_RELEASE.xml │ │ │ ├── Maven__org_springframework_spring_jdbc_4_2_7_RELEASE.xml │ │ │ ├── Maven__org_springframework_spring_test_4_2_7_RELEASE.xml │ │ │ ├── Maven__org_springframework_spring_tx_4_2_7_RELEASE.xml │ │ │ ├── Maven__org_springframework_spring_web_4_2_7_RELEASE.xml │ │ │ ├── Maven__org_springframework_spring_webmvc_4_2_7_RELEASE.xml │ │ │ ├── Maven__org_yaml_snakeyaml_1_16.xml │ │ │ ├── Maven__oro_oro_2_0_8.xml │ │ │ ├── Maven__redis_clients_jedis_2_9_0.xml │ │ │ └── Maven__sslext_sslext_1_2_0.xml │ │ ├── misc.xml │ │ ├── modules.xml │ │ └── workspace.xml │ ├── .mvn/ │ │ └── wrapper/ │ │ ├── maven-wrapper.jar │ │ └── maven-wrapper.properties │ ├── mvnw │ ├── mvnw.cmd │ ├── pom.xml │ ├── pyspider/ │ │ ├── conf.json │ │ └── data/ │ │ ├── scheduler.1d │ │ ├── scheduler.1h │ │ └── scheduler.all │ ├── src/ │ │ ├── main/ │ │ │ ├── java/ │ │ │ │ └── com/ │ │ │ │ └── nowcoder/ │ │ │ │ ├── WendaApplication.java │ │ │ │ ├── aspect/ │ │ │ │ │ └── LogAspect.java │ │ │ │ ├── async/ │ │ │ │ │ ├── EventConsumer.java │ │ │ │ │ ├── EventHandler.java │ │ │ │ │ ├── EventModel.java │ │ │ │ │ ├── EventProducer.java │ │ │ │ │ ├── EventType.java │ │ │ │ │ └── handler/ │ │ │ │ │ ├── FeedHandler.java │ │ │ │ │ ├── FollowHandler.java │ │ │ │ │ ├── LikeHandler.java │ │ │ │ │ └── LoginExceptionHandler.java │ │ │ │ ├── configuration/ │ │ │ │ │ └── WendaWebConfiguration.java │ │ │ │ ├── controller/ │ │ │ │ │ ├── CommentController.java │ │ │ │ │ ├── FeedController.java │ │ │ │ │ ├── FollowController.java │ │ │ │ │ ├── HomeController.java │ │ │ │ │ ├── IndexController.java │ │ │ │ │ ├── LikeController.java │ │ │ │ │ ├── LoginController.java │ │ │ │ │ ├── MessageController.java │ │ │ │ │ ├── QuestionController.java │ │ │ │ │ └── SettingController.java │ │ │ │ ├── dao/ │ │ │ │ │ ├── CommentDAO.java │ │ │ │ │ ├── FeedDAO.java │ │ │ │ │ ├── LoginTicketDAO.java │ │ │ │ │ ├── MessageDAO.java │ │ │ │ │ ├── QuestionDAO.java │ │ │ │ │ └── UserDAO.java │ │ │ │ ├── interceptor/ │ │ │ │ │ ├── LoginRequredInterceptor.java │ │ │ │ │ └── PassportInterceptor.java │ │ │ │ ├── model/ │ │ │ │ │ ├── Comment.java │ │ │ │ │ ├── EntityType.java │ │ │ │ │ ├── Feed.java │ │ │ │ │ ├── HostHolder.java │ │ │ │ │ ├── LoginTicket.java │ │ │ │ │ ├── Message.java │ │ │ │ │ ├── Question.java │ │ │ │ │ ├── User.java │ │ │ │ │ └── ViewObject.java │ │ │ │ ├── service/ │ │ │ │ │ ├── CommentService.java │ │ │ │ │ ├── FeedService.java │ │ │ │ │ ├── FollowService.java │ │ │ │ │ ├── LikeService.java │ │ │ │ │ ├── LoginTicketService.java │ │ │ │ │ ├── MessageService.java │ │ │ │ │ ├── QuestionService.java │ │ │ │ │ ├── SensitiveService.java │ │ │ │ │ ├── UserService.java │ │ │ │ │ └── WendaService.java │ │ │ │ └── util/ │ │ │ │ ├── JedisAdapter.java │ │ │ │ ├── MailSender.java │ │ │ │ ├── RedisKeyUtil.java │ │ │ │ └── WendaUtil.java │ │ │ └── resources/ │ │ │ ├── SensitiveWords.txt │ │ │ ├── application.properties │ │ │ ├── com/ │ │ │ │ └── nowcoder/ │ │ │ │ └── dao/ │ │ │ │ ├── FeedDAO.xml │ │ │ │ └── QuestionDAO.xml │ │ │ ├── mybatis-config.xml │ │ │ ├── static/ │ │ │ │ ├── scripts/ │ │ │ │ │ ├── base.fb262f0e.js │ │ │ │ │ ├── common.fed5411f.js │ │ │ │ │ ├── ga.js │ │ │ │ │ ├── instant.e7a17de6.js │ │ │ │ │ ├── main/ │ │ │ │ │ │ ├── base/ │ │ │ │ │ │ │ ├── base.js │ │ │ │ │ │ │ ├── event.js │ │ │ │ │ │ │ └── util.js │ │ │ │ │ │ ├── component/ │ │ │ │ │ │ │ ├── component.js │ │ │ │ │ │ │ ├── popup.js │ │ │ │ │ │ │ ├── popupAdd.js │ │ │ │ │ │ │ └── popupMsg.js │ │ │ │ │ │ ├── jquery.js │ │ │ │ │ │ ├── site/ │ │ │ │ │ │ │ ├── detail.js │ │ │ │ │ │ │ ├── follow.js │ │ │ │ │ │ │ ├── home.js │ │ │ │ │ │ │ └── profile.js │ │ │ │ │ │ └── util/ │ │ │ │ │ │ ├── action.js │ │ │ │ │ │ └── business.js │ │ │ │ │ ├── page-index.d7b54ac7.js │ │ │ │ │ ├── page-main.5d4c554d.js │ │ │ │ │ ├── richtexteditor.aa0a4005.js │ │ │ │ │ └── vendor.ff76fbae.js │ │ │ │ └── styles/ │ │ │ │ ├── detail.css │ │ │ │ ├── index.css │ │ │ │ ├── letter.css │ │ │ │ ├── login.css │ │ │ │ └── result.css │ │ │ ├── templates/ │ │ │ │ ├── detail.html │ │ │ │ ├── error.html │ │ │ │ ├── feeds.html │ │ │ │ ├── followees.html │ │ │ │ ├── followers.html │ │ │ │ ├── footer.html │ │ │ │ ├── header.html │ │ │ │ ├── home.html │ │ │ │ ├── index.html │ │ │ │ ├── js.html │ │ │ │ ├── letter.html │ │ │ │ ├── letterDetail.html │ │ │ │ ├── login.html │ │ │ │ ├── mails/ │ │ │ │ │ └── login_exception.html │ │ │ │ ├── profile.html │ │ │ │ └── result.html │ │ │ └── toolbox.xml │ │ └── test/ │ │ ├── java/ │ │ │ └── com/ │ │ │ └── nowcoder/ │ │ │ ├── InitDatabaseTests.java │ │ │ ├── ThreadTest.java │ │ │ └── WendaApplicationTests.java │ │ └── resources/ │ │ └── init-schema.sql │ ├── target/ │ │ ├── classes/ │ │ │ ├── SensitiveWords.txt │ │ │ ├── application.properties │ │ │ ├── com/ │ │ │ │ └── nowcoder/ │ │ │ │ └── dao/ │ │ │ │ ├── FeedDAO.xml │ │ │ │ └── QuestionDAO.xml │ │ │ ├── mybatis-config.xml │ │ │ ├── static/ │ │ │ │ ├── scripts/ │ │ │ │ │ ├── base.fb262f0e.js │ │ │ │ │ ├── common.fed5411f.js │ │ │ │ │ ├── ga.js │ │ │ │ │ ├── instant.e7a17de6.js │ │ │ │ │ ├── main/ │ │ │ │ │ │ ├── base/ │ │ │ │ │ │ │ ├── base.js │ │ │ │ │ │ │ ├── event.js │ │ │ │ │ │ │ └── util.js │ │ │ │ │ │ ├── component/ │ │ │ │ │ │ │ ├── component.js │ │ │ │ │ │ │ ├── popup.js │ │ │ │ │ │ │ ├── popupAdd.js │ │ │ │ │ │ │ └── popupMsg.js │ │ │ │ │ │ ├── jquery.js │ │ │ │ │ │ ├── site/ │ │ │ │ │ │ │ ├── detail.js │ │ │ │ │ │ │ ├── follow.js │ │ │ │ │ │ │ ├── home.js │ │ │ │ │ │ │ └── profile.js │ │ │ │ │ │ └── util/ │ │ │ │ │ │ ├── action.js │ │ │ │ │ │ └── business.js │ │ │ │ │ ├── page-index.d7b54ac7.js │ │ │ │ │ ├── page-main.5d4c554d.js │ │ │ │ │ ├── richtexteditor.aa0a4005.js │ │ │ │ │ └── vendor.ff76fbae.js │ │ │ │ └── styles/ │ │ │ │ ├── detail.css │ │ │ │ ├── index.css │ │ │ │ ├── letter.css │ │ │ │ ├── login.css │ │ │ │ └── result.css │ │ │ ├── templates/ │ │ │ │ ├── detail.html │ │ │ │ ├── error.html │ │ │ │ ├── feeds.html │ │ │ │ ├── followees.html │ │ │ │ ├── followers.html │ │ │ │ ├── footer.html │ │ │ │ ├── header.html │ │ │ │ ├── home.html │ │ │ │ ├── index.html │ │ │ │ ├── js.html │ │ │ │ ├── letter.html │ │ │ │ ├── letterDetail.html │ │ │ │ ├── login.html │ │ │ │ ├── mails/ │ │ │ │ │ └── login_exception.html │ │ │ │ ├── profile.html │ │ │ │ └── result.html │ │ │ └── toolbox.xml │ │ └── test-classes/ │ │ └── init-schema.sql │ └── wenda.iml └── wenda.sql ================================================ FILE CONTENTS ================================================ ================================================ FILE: README.md ================================================ # nowcoder问答平台 **本项目是一个基于 SpringBoot 的问答平台。数据库使用了 redis 和 mysql,实现注册登录、点赞点踩、评论站内信、Timeline 事件流等功能,同时通过一个异步消息框架来实现事件的异步处理,并使用爬虫对网站进行数据填充。** ## 目录 - [项目的基本框架及配置](#项目的基本框架及配置) - [AOP 和 IOC](#AOP-和-IOC) - [MySQL 和 MyBatis](#MySQL-和-MyBatis) - [注册与登录的实现](#注册与登录的实现) - [发表问题和敏感词过滤](#发表问题和敏感词过滤) - [发表评论和站内信](#发表评论和站内信) - [Redis 实现点赞和点踩功能](#Redis-实现点赞和点踩功能) - [异步消息机制](#异步消息机制) - [关注和粉丝列表的实现](#关注和粉丝列表的实现) - [推拉模式下的 Feed 流](#推拉模式下的-Feed-流) - [使用爬虫对网站进行数据填充](#使用爬虫对网站进行数据填充) - [将项目部署到 Linux 虚拟机](#将项目部署到-Linux-虚拟机) - [功能扩展](#功能扩展) ## 项目的基本框架及配置 ## 创建 git 仓库,本地配置 IDEA 并测试 pull 和 push。 创建 SpringBoot 工程,导入 web,velocity 和 aop 的包。 生成 maven 项目,pom.xml 包含上述依赖。 Controller 中使用注解配置,requestmapping,responsebody 基本可以解决请求转发以及响应内容的渲染。responsebody 自动选择 viewresolver 进行解析。 使用 pathvariable 和 requestparam 传递参数,使用 velocity 编写页面模板,注意其中的语法使用。常用 $!{} 和 ${}。 使用 HTTP 规范下的 httpservletrequest 和 httpservletresponse 来封装请求和相响应,使用封装好的 session 和 cookie 对象。 使用重定向的 redirectview 和统一异常处理器 exceptionhandler。 ## AOP 和 IOC ## IOC 解决对象实例化以及依赖传递问题,解耦。 AOP 解决纵向切面问题,主要实现日志和权限控制功能。 Aspect 实现切面,并且使用 logger 来记录日志,用该切面的切面方法来监听 Controller。 有关 Spring 框架中 IOC 容器和 AOP 动态代理的相关知识可参见 [simple-spring](https://github.com/hzcforever/simple-spring)。 ## MySQL 和 MyBatis ## 使用 MySQL 创建数据库和表。 加入 MyBatis和 MySQL 的 maven 仓库,注意,由于现在版本的 SpringBoot 不再支持 velocity 进而导致我使用较早版本的 SpringBoot,所以这里提供一可以正常运行的版本设置。 SpringBoot 使用1.4.0,mybatis-spring-boot-starter 使用1.2.1,mysql-connector-java 使用8.0.12。 注意 MyBatis 的注解语法以及 xml 的配置要求,xml 要求放在 resource 中并且与 DAO 接口在相同的包路径下。 application.properties 增加 Spring 配置数据库链接地址。 两个小工具: - ViewObject:方便传递任何数据到 - VelocityDateTool:velocity 自带工具类 写好静态文件 html、css 和 js,并且注意配置。 - spring.velocity.suffix=.html 保证跳转请求转发到 html 上 - spring.velocity.toolbox-config-location=toolbox.xml ## 注册与登录的实现 ## 新建数据表 login_ticket 用来存储 ticket 字段。该字段在用户登录成功时被生成并存入数据库,并被设置为 Cookie,下次用户登录时会带上这个 ticket,ticket 是随机的 UUID 字符串,有过期时间以及有效状态。 使用拦截器 interceptor 来拦截所有用户请求,判断请求中是否存在有效的 ticket,如果有就将用户信息写入 Threadlocal。所有线程的 threadlocal 都被存在一个叫做 hostholder 的实例中,根据该实例就可以在全局任意位置获取用户的信息。 该 ticket 的功能类似 Session,也是通过 Cookie 写回浏览器,浏览器请求时再通过 Cookie 传递,区别是该字段是存在数据库中的,并且可以用于移动端。 通过用户访问权限拦截器来拦截用户的越界访问,比如用户没有管理员权限就不能访问管理员页面。 数据安全性的保障手段:HTTPS 使用公钥加密私钥解密,比如支付宝的密码加密,单点登录验证,验证码机制等。 ## 发表问题和敏感词过滤 ## 发布问题时检查标题和内容,防止 xss 注入,并且过滤敏感词。 防止 xss 注入直接使用 HTMLutils 的方法即可实现。 过滤敏感词首先需要建立一个字典树,并且读取一份保存敏感词的文本文件,然后初始化字典树。最后将过滤器作为一个服务,让需要过滤敏感词的服务进行调用即可。 ## 发表评论和站内信 ## 首先建立表 comment 和 message 分别代表评论和站内信。 评论的逻辑是每一个问题下面都有评论,显示评论数量,具体内容,评论人等信息。 消息的逻辑是,两个用户之间发送一条消息,有一个唯一的会话 id,这个会话里可以有多条这两个用户的交互信息。通过一个用户 id 获取该用户的会话列表,再根据会话 id 再获取具体的会话内的多条消息。 逻辑清楚之后,再加上一些附加功能,比如显示未读消息数量,根据时间顺序排列会话和消息。 本节内容基本就是业务逻辑的开发,没有新增什么技术点,主要是前后端交互的逻辑比较复杂,前端的开发量也比较大。 ## Redis 实现点赞和点踩功能 ## 首先了解一下 Redis 的基础知识,数据结构,Jedis 使用等。 编写list,string,hashmap,set,sortset的测试用例,熟悉 Jedis API。 开发点踩和点赞功能,在此之前根据业务封装好 Jedis 的增删改查操作,放在 util 包中。 根据需求确定 key 字段,格式是——like:实体类型:实体id 和 dislike:实体类型:实体 id。这样可以将喜欢一条新闻的人存在一个集合,不喜欢的存在另一个集合。通过统计数量可以获得点赞和点踩数。 一般点赞点踩操作是先修改 Redis 的值并获取返回值,然后再异步修改 MySQL 数据库的 likecount 数值。这样既可以保证点赞操作快速完成,也可保证数据一致性。 ## 异步消息机制 ## 在之前的功能中有一些不需要实时执行的操作或者任务,我们可以把它们改造成异步消息来进行发送。 具体操作就是使用 Redis 来实现异步消息队列。代码中使用事件 Event 来包装一个事件,事件需要记录事件实体的各种信息:一个异步工具类(事件生产者 + 事件消费者 + EventHandler 接口),让以后各种事件的实现类来实现这个接口。 事件生产者一般作为一个服务,由 Controller 中的业务逻辑调用并产生一个事件,将事件序列化存入 Redis 队列中,事件消费者则通过一个线程循环获取队列里的事件,并且寻找对应的 handler 进行处理。 整个异步事件的框架开发完成,后面新加入的登录,点赞等事件都可以这么实现。 ## 关注和粉丝列表的实现 ## 新增关注功能,使用 Redis 实现每一个关注对象的粉丝列表以及每一个用户的关注对象列表。通过该列表的 crud 操作可以对应获取粉丝列表和关注列表,并且实现关注和取关功能。 由于关注成功和添加粉丝成功时同一个事务里的两个操作,可以使用 Redis 的事务 multi 来包装事务并进行提交。 除此之外,关注成功或者被关注还可以通过事件机制来生成发送邮件的事件,由异步的队列处理器来完成事件响应,同样是根据 Redis 来实现。 对于粉丝列表,除了显示粉丝的基本信息之外,还要显示当前用户是否关注了这个粉丝,以便前端显示。 对于关注列表来说,如果被关注对象是用户的话,除了显示用户的基本信息之外,还要显示当前用户是被这个用户关注,以便前端显示。 ## 推拉模式下的 Feed 流 ## 微博的新鲜事功能介绍:关注好友的动态(好友的点赞和发表的问题等),关注了某个问题,这些都是 feed 流的一部分。 在知乎中的 feed 流主要体现于:关注用户的评论行为,关注用户的关注问题行为。 feed 流主要分为两种,推模式和拉模式。推模式主要是把新鲜事推送给关注该用户的粉丝,本例使用 Redis 来存储某个用户接受的新鲜事 id 列表,这个信息流又称为 timeline,根据用户的唯一 key 来存储;拉模式主要是用户直接找寻自己所有关注的人,并且到数据库去查找这些关注对象的新鲜事,直接返回。 推模式主要适合粉丝较少的小用户,因为他们的粉丝量少,使用推模式产生的冗余副本也比较少,并且可以减少用户访问的压力。 拉模式主要适合大v,因为很多僵尸粉和非活跃用户根本不需要推送信息,用推模式发给这些僵尸粉或者非活跃用户就是浪费资源。所以让用户通过拉模式请求,只需要一个数据副本即可。同时如果是热点信息,这些信息也可以放在缓存,让用户首先拉取这些信息,提高查询效率。 使用 feedhandler 异步处理上述的两个事件,当事件发生时,根据事件实体进行重新包装,构造一个新鲜事,因为所有新鲜事的格式是一样的。需要包括:日期,新鲜事类型,发起者,新鲜事内容,然后把该数据存入数据库,以便用户使用 pull 模式拉出。 为了适配推送模式,此时也要把新鲜事放到该用户所有粉丝的 timeline 里,这样的话就同时实现了推和拉的操作了。 ## 使用爬虫对网站进行数据填充 ## 安装 Python3.x 并且配置环境变量。同时安装 PyCharm ,安装 pip。 安装好以后,先熟悉 Python 的语法,写一些例子,比如数据类型,操作符,方法调用,以及面向对象的技术。 因为数据是要导入数据库的,所以这里安装 MySQLdb 的一个库,并且写一下连接数据库的代码,写一下简单的crud进行测试。 使用 requests 库作为解析 HTTP 请求的工具,使用 beautifulsoup 作为解析 html 代码的工具,请求之后直接使用 css 选择器匹配。即可获得内容。 当然现在我们有更方便的工具 pyspider,可以方便解析请求并且可以设置代理,伪装身份等,直接传入 url 并且写好多级的解析函数,程序便会迭代执行,直到把所有页面的内容解析出来。这里我们直接启动 pyspider 的 web 应用并且写好 Python 代码,就可以执行爬虫了。 知乎:先找到问题,再把问题下所有的回答进行爬取,最后把问题和评论一起处理。 ## 将项目部署到 Linux 虚拟机 因为该项目只是个练手的 demo,没有必要买服务器,所以就打算直接部署到虚拟机上,把整个软件开发的流程过一遍。安装的是 VMware,下载的镜像是 CentOS 7 x86_64,依次安装了 JDK 1.8、Tomcat 8、MySQL 8.0 和 Redis(所有的配置过程网上博客都写得很详细,这里不加赘述)。
通过 Xshell 6 连接虚拟机。 把从 IDEA 编译导出的 jar 包发到虚拟机的文件夹,通过 `java -jar 文件名.jar` 将项目部署到 CentOS 上,当看到下面两个红色矩形框中的信息时,说明部署成功。

在主机上通过虚拟机的 ip 和对应的端口访问网页(相关功能请自行 fork 后导入 IDEA 并启动,在这里简要贴出几张效果图以便参考):


## 功能扩展 ## - 用户注册,邮箱激活流程 - 管理员后台管理 - timeline 推拉结合 - 个性化首页,timeline 更多事件 - 搜索结果排序打分 - 通过 MQ 实现解耦、异步和削峰 ...... ================================================ FILE: wenda/.idea/compiler.xml ================================================ ================================================ FILE: wenda/.idea/encodings.xml ================================================ ================================================ FILE: wenda/.idea/inspectionProfiles/Project_Default.xml ================================================ ================================================ FILE: wenda/.idea/libraries/Maven__antlr_antlr_2_7_7.xml ================================================ ================================================ FILE: wenda/.idea/libraries/Maven__aopalliance_aopalliance_1_0.xml ================================================ ================================================ FILE: wenda/.idea/libraries/Maven__ch_qos_logback_logback_classic_1_1_7.xml ================================================ ================================================ FILE: wenda/.idea/libraries/Maven__ch_qos_logback_logback_core_1_1_7.xml ================================================ ================================================ FILE: wenda/.idea/libraries/Maven__com_alibaba_fastjson_1_2_13.xml ================================================ ================================================ FILE: wenda/.idea/libraries/Maven__com_fasterxml_classmate_1_1_0.xml ================================================ ================================================ FILE: wenda/.idea/libraries/Maven__com_fasterxml_jackson_core_jackson_annotations_2_6_7.xml ================================================ ================================================ FILE: wenda/.idea/libraries/Maven__com_fasterxml_jackson_core_jackson_core_2_6_7.xml ================================================ ================================================ FILE: wenda/.idea/libraries/Maven__com_fasterxml_jackson_core_jackson_databind_2_6_7.xml ================================================ ================================================ FILE: wenda/.idea/libraries/Maven__com_google_protobuf_protobuf_java_2_6_0.xml ================================================ ================================================ FILE: wenda/.idea/libraries/Maven__commons_beanutils_commons_beanutils_1_9_2.xml ================================================ ================================================ FILE: wenda/.idea/libraries/Maven__commons_chain_commons_chain_1_1.xml ================================================ ================================================ FILE: wenda/.idea/libraries/Maven__commons_collections_commons_collections_3_2_2.xml ================================================ ================================================ FILE: wenda/.idea/libraries/Maven__commons_digester_commons_digester_2_1.xml ================================================ ================================================ FILE: wenda/.idea/libraries/Maven__commons_lang_commons_lang_2_4.xml ================================================ ================================================ FILE: wenda/.idea/libraries/Maven__commons_validator_commons_validator_1_3_1.xml ================================================ ================================================ FILE: wenda/.idea/libraries/Maven__dom4j_dom4j_1_1.xml ================================================ ================================================ FILE: wenda/.idea/libraries/Maven__javax_activation_activation_1_1.xml ================================================ ================================================ FILE: wenda/.idea/libraries/Maven__javax_mail_mail_1_4_7.xml ================================================ ================================================ FILE: wenda/.idea/libraries/Maven__javax_validation_validation_api_1_1_0_Final.xml ================================================ ================================================ FILE: wenda/.idea/libraries/Maven__junit_junit_4_12.xml ================================================ ================================================ FILE: wenda/.idea/libraries/Maven__mysql_mysql_connector_java_8_0_12.xml ================================================ ================================================ FILE: wenda/.idea/libraries/Maven__org_apache_commons_commons_pool2_2_4_2.xml ================================================ ================================================ FILE: wenda/.idea/libraries/Maven__org_apache_struts_struts_core_1_3_8.xml ================================================ ================================================ FILE: wenda/.idea/libraries/Maven__org_apache_struts_struts_taglib_1_3_8.xml ================================================ ================================================ FILE: wenda/.idea/libraries/Maven__org_apache_struts_struts_tiles_1_3_8.xml ================================================ ================================================ FILE: wenda/.idea/libraries/Maven__org_apache_tomcat_embed_tomcat_embed_core_8_0_36.xml ================================================ ================================================ FILE: wenda/.idea/libraries/Maven__org_apache_tomcat_embed_tomcat_embed_el_8_0_36.xml ================================================ ================================================ FILE: wenda/.idea/libraries/Maven__org_apache_tomcat_embed_tomcat_embed_logging_juli_8_0_36.xml ================================================ ================================================ FILE: wenda/.idea/libraries/Maven__org_apache_tomcat_embed_tomcat_embed_websocket_8_0_36.xml ================================================ ================================================ FILE: wenda/.idea/libraries/Maven__org_apache_tomcat_tomcat_jdbc_8_0_36.xml ================================================ ================================================ FILE: wenda/.idea/libraries/Maven__org_apache_tomcat_tomcat_juli_8_0_36.xml ================================================ ================================================ FILE: wenda/.idea/libraries/Maven__org_apache_velocity_velocity_1_7.xml ================================================ ================================================ FILE: wenda/.idea/libraries/Maven__org_apache_velocity_velocity_tools_2_0.xml ================================================ ================================================ FILE: wenda/.idea/libraries/Maven__org_aspectj_aspectjweaver_1_8_9.xml ================================================ ================================================ FILE: wenda/.idea/libraries/Maven__org_hamcrest_hamcrest_core_1_3.xml ================================================ ================================================ FILE: wenda/.idea/libraries/Maven__org_hamcrest_hamcrest_library_1_3.xml ================================================ ================================================ FILE: wenda/.idea/libraries/Maven__org_hibernate_hibernate_validator_5_2_4_Final.xml ================================================ ================================================ FILE: wenda/.idea/libraries/Maven__org_jboss_logging_jboss_logging_3_3_0_Final.xml ================================================ ================================================ FILE: wenda/.idea/libraries/Maven__org_mockito_mockito_core_1_10_19.xml ================================================ ================================================ FILE: wenda/.idea/libraries/Maven__org_mybatis_mybatis_3_4_0.xml ================================================ ================================================ FILE: wenda/.idea/libraries/Maven__org_mybatis_mybatis_spring_1_3_0.xml ================================================ ================================================ FILE: wenda/.idea/libraries/Maven__org_mybatis_spring_boot_mybatis_spring_boot_autoconfigure_1_1_1.xml ================================================ ================================================ FILE: wenda/.idea/libraries/Maven__org_mybatis_spring_boot_mybatis_spring_boot_starter_1_1_1.xml ================================================ ================================================ FILE: wenda/.idea/libraries/Maven__org_objenesis_objenesis_2_1.xml ================================================ ================================================ FILE: wenda/.idea/libraries/Maven__org_slf4j_jcl_over_slf4j_1_7_21.xml ================================================ ================================================ FILE: wenda/.idea/libraries/Maven__org_slf4j_jul_to_slf4j_1_7_21.xml ================================================ ================================================ FILE: wenda/.idea/libraries/Maven__org_slf4j_log4j_over_slf4j_1_7_21.xml ================================================ ================================================ FILE: wenda/.idea/libraries/Maven__org_slf4j_slf4j_api_1_7_21.xml ================================================ ================================================ FILE: wenda/.idea/libraries/Maven__org_springframework_boot_spring_boot_1_3_6_RELEASE.xml ================================================ ================================================ FILE: wenda/.idea/libraries/Maven__org_springframework_boot_spring_boot_autoconfigure_1_3_6_RELEASE.xml ================================================ ================================================ FILE: wenda/.idea/libraries/Maven__org_springframework_boot_spring_boot_devtools_1_3_6_RELEASE.xml ================================================ ================================================ FILE: wenda/.idea/libraries/Maven__org_springframework_boot_spring_boot_starter_1_3_6_RELEASE.xml ================================================ ================================================ FILE: wenda/.idea/libraries/Maven__org_springframework_boot_spring_boot_starter_aop_1_3_6_RELEASE.xml ================================================ ================================================ FILE: wenda/.idea/libraries/Maven__org_springframework_boot_spring_boot_starter_jdbc_1_3_6_RELEASE.xml ================================================ ================================================ FILE: wenda/.idea/libraries/Maven__org_springframework_boot_spring_boot_starter_logging_1_3_6_RELEASE.xml ================================================ ================================================ FILE: wenda/.idea/libraries/Maven__org_springframework_boot_spring_boot_starter_test_1_3_6_RELEASE.xml ================================================ ================================================ FILE: wenda/.idea/libraries/Maven__org_springframework_boot_spring_boot_starter_tomcat_1_3_6_RELEASE.xml ================================================ ================================================ FILE: wenda/.idea/libraries/Maven__org_springframework_boot_spring_boot_starter_validation_1_3_6_RELEASE.xml ================================================ ================================================ FILE: wenda/.idea/libraries/Maven__org_springframework_boot_spring_boot_starter_velocity_1_3_6_RELEASE.xml ================================================ ================================================ FILE: wenda/.idea/libraries/Maven__org_springframework_boot_spring_boot_starter_web_1_3_6_RELEASE.xml ================================================ ================================================ FILE: wenda/.idea/libraries/Maven__org_springframework_spring_aop_4_2_7_RELEASE.xml ================================================ ================================================ FILE: wenda/.idea/libraries/Maven__org_springframework_spring_beans_4_2_7_RELEASE.xml ================================================ ================================================ FILE: wenda/.idea/libraries/Maven__org_springframework_spring_context_4_2_7_RELEASE.xml ================================================ ================================================ FILE: wenda/.idea/libraries/Maven__org_springframework_spring_context_support_4_2_7_RELEASE.xml ================================================ ================================================ FILE: wenda/.idea/libraries/Maven__org_springframework_spring_core_4_2_7_RELEASE.xml ================================================ ================================================ FILE: wenda/.idea/libraries/Maven__org_springframework_spring_expression_4_2_7_RELEASE.xml ================================================ ================================================ FILE: wenda/.idea/libraries/Maven__org_springframework_spring_jdbc_4_2_7_RELEASE.xml ================================================ ================================================ FILE: wenda/.idea/libraries/Maven__org_springframework_spring_test_4_2_7_RELEASE.xml ================================================ ================================================ FILE: wenda/.idea/libraries/Maven__org_springframework_spring_tx_4_2_7_RELEASE.xml ================================================ ================================================ FILE: wenda/.idea/libraries/Maven__org_springframework_spring_web_4_2_7_RELEASE.xml ================================================ ================================================ FILE: wenda/.idea/libraries/Maven__org_springframework_spring_webmvc_4_2_7_RELEASE.xml ================================================ ================================================ FILE: wenda/.idea/libraries/Maven__org_yaml_snakeyaml_1_16.xml ================================================ ================================================ FILE: wenda/.idea/libraries/Maven__oro_oro_2_0_8.xml ================================================ ================================================ FILE: wenda/.idea/libraries/Maven__redis_clients_jedis_2_9_0.xml ================================================ ================================================ FILE: wenda/.idea/libraries/Maven__sslext_sslext_1_2_0.xml ================================================ ================================================ FILE: wenda/.idea/misc.xml ================================================ ================================================ FILE: wenda/.idea/modules.xml ================================================ ================================================ FILE: wenda/.idea/workspace.xml ================================================ head 注册 top-nav next 提问 login reglo reglog wrap 人赞同 评论 format data. followUsers true DEFINITION_ORDER General Duplicates SELECT FROM WHERE id < #{maxId} AND user_id in #{item} ORDER BY id DESC LIMIT #{count} ================================================ FILE: wenda/src/main/resources/com/nowcoder/dao/QuestionDAO.xml ================================================ question id, title, content, comment_count,created_date,user_id ================================================ FILE: wenda/src/main/resources/mybatis-config.xml ================================================ ================================================ FILE: wenda/src/main/resources/static/scripts/base.fb262f0e.js ================================================ PLOVR_MODULE_INFO={"page-index":["common"],"common":["base"],"page-settings":["common"],"page-main":["common"],"page-profile":["common"],"base":[],"richtexteditor":["common"],"page-mobile-live":["base"],"page-org-settings":["common"],"page-roundtable":["common"],"page-misc":["common"],"page-org-signup":["common"],"page-mobile-question":["base"]}; PLOVR_MODULE_URIS={"page-index":"/static/revved/-/js/closure/page-index.d7b54ac7.js","common":"/static/revved/-/js/closure/common.fed5411f.js","page-settings":"/static/revved/-/js/closure/page-settings.77dc9147.js","page-main":"/static/revved/-/js/closure/page-main.5d4c554d.js","page-profile":"/static/revved/-/js/closure/page-profile.9a5922d2.js","base":"/static/revved/-/js/closure/base.fb262f0e.js","richtexteditor":"/static/revved/-/js/closure/richtexteditor.aa0a4005.js","page-mobile-live":"/static/revved/-/js/closure/page-mobile-live.f6651ab4.js","page-org-settings":"/static/revved/-/js/closure/page-org-settings.a386be78.js","page-roundtable":"/static/revved/-/js/closure/page-roundtable.0eb5c155.js","page-misc":"/static/revved/-/js/closure/page-misc.ceecaa58.js","page-org-signup":"/static/revved/-/js/closure/page-org-signup.e2c637c5.js","page-mobile-question":"/static/revved/-/js/closure/page-mobile-question.2aa3a79d.js"}; PLOVR_MODULE_USE_DEBUG_MODE=false; var __z_z__={};(function(z){ var ea,ga,wa,Ea;z.aa=function(a){return function(){return z.ba[a].apply(this,arguments)}};var da=function(){ea.Symbol||(ea.Symbol=fa);da=function(){}};var fa=function(a){return"jscomp_symbol_"+a+ga++};var ha=function(){da();ea.Symbol.iterator||(ea.Symbol.iterator=ea.Symbol("iterator"));ha=function(){}}; z.ia=function(a){ha();if(a[ea.Symbol.iterator])return a[ea.Symbol.iterator]();if(!(a instanceof Array||"string"==typeof a||a instanceof String))throw new TypeError(a+" is not iterable");var b=0;return{next:function(){return b==a.length?{done:!0}:{done:!1,value:a[b++]}}}};var ja=function(a){if(!(a instanceof Array)){a=z.ia(a);for(var b,c=[];!(b=a.next()).done;)c.push(b.value);a=c}return a}; z.l=function(a,b){function c(){}c.prototype=b.prototype;a.prototype=new c;a.prototype.constructor=a;for(var d in b)if(ea.Object.defineProperties){var f=ea.Object.getOwnPropertyDescriptor(b,d);void 0!==f&&ea.Object.defineProperty(a,d,f)}else a[d]=b[d]};z.ka=function(a){return void 0!==a};z.p=function(){};z.la=function(a){a.ba=function(){return a.Tj?a.Tj:a.Tj=new a}}; z.ma=function(a){var b=typeof a;if("object"==b)if(a){if(a instanceof Array)return"array";if(a instanceof Object)return b;var c=Object.prototype.toString.call(a);if("[object Window]"==c)return"object";if("[object Array]"==c||"number"==typeof a.length&&"undefined"!=typeof a.splice&&"undefined"!=typeof a.propertyIsEnumerable&&!a.propertyIsEnumerable("splice"))return"array";if("[object Function]"==c||"undefined"!=typeof a.call&&"undefined"!=typeof a.propertyIsEnumerable&&!a.propertyIsEnumerable("call"))return"function"}else return"null"; else if("function"==b&&"undefined"==typeof a.call)return"object";return b};z.na=function(a){return"array"==z.ma(a)};z.oa=function(a){var b=z.ma(a);return"array"==b||"object"==b&&"number"==typeof a.length};z.pa=function(a){return"string"==typeof a};z.qa=function(a){return"number"==typeof a};z.sa=function(a){return"function"==z.ma(a)};z.ta=function(a){var b=typeof a;return"object"==b&&null!=a||"function"==b};z.ua=function(a){return a[z.va]||(a[z.va]=++wa)}; var ya=function(a,b,c){return a.call.apply(a.bind,arguments)};var Aa=function(a,b,c){if(!a)throw Error();if(2b?1:0};z.db=function(a){return String(a).replace(/\-([a-z])/g,function(a,c){return c.toUpperCase()})};var eb=function(a){var b=z.pa(void 0)?z.Wa(void 0):"\\s";return a.replace(new RegExp("(^"+(b?"|["+b+"]+":"")+")([a-z])","g"),function(a,b,f){return b+f.toUpperCase()})};var fb=function(a,b,c){this.NR=c;this.SN=a;this.Ep=b;this.Ht=0;this.Es=null};var gb=function(){this.hv=this.Rm=null};var hb=function(){this.next=this.scope=this.fn=null};z.ib=function(a){return function(){return a}}; var jb=function(a){return function(){throw Error(a);}};z.kb=function(a){return a[a.length-1]};z.lb=function(a,b){return Array.prototype.indexOf.call(a,b,void 0)};z.y=function(a,b,c){Array.prototype.forEach.call(a,b,c)};z.mb=function(a,b,c){return Array.prototype.filter.call(a,b,c)};z.nb=function(a,b,c){return Array.prototype.map.call(a,b,c)};z.ob=function(a,b,c){return Array.prototype.reduce.call(a,b,c)};z.pb=function(a,b,c){return Array.prototype.some.call(a,b,c)}; z.qb=function(a,b){var c=z.rb(a,b,void 0);return 0>c?null:z.pa(a)?a.charAt(c):a[c]};z.rb=function(a,b,c){for(var d=a.length,f=z.pa(a)?a.split(""):a,g=0;g=arguments.length?Array.prototype.slice.call(a,b):Array.prototype.slice.call(a,b,c)}; var zb=function(a,b){for(var c=b||a,d={},f=0,g=0;gf.keyCode||void 0!=f.returnValue)){a:{var g=!1;if(0==f.keyCode)try{f.keyCode=-1;break a}catch(m){g=!0}if(g||void 0==f.returnValue)f.returnValue=!0}f=[];for(g=c.currentTarget;g;g=g.parentNode)f.push(g);for(var g=a.type,h=f.length-1;!c.rk&&0<=h;h--){c.currentTarget=f[h];var k=z.pd(f[h],g,!0,c),d=d&&k}for(h= 0;!c.rk&&h=a.length)throw z.Od;if(b in a)return a[b++];b++}};return c}throw Error("Not implemented");}; z.Pd=function(a,b,c){if(z.oa(a))try{z.y(a,b,c)}catch(d){if(d!==z.Od)throw d;}else{a=z.Nd(a);try{for(;;)b.call(c,a.next(),void 0,a)}catch(d){if(d!==z.Od)throw d;}}};z.Qd=function(a){if(z.oa(a))return z.vb(a);a=z.Nd(a);var b=[];z.Pd(a,function(a){b.push(a)});return b};z.Rd=function(a,b){this.Ib={};this.Za=[];this.xq=this.Ja=0;var c=arguments.length;if(1d)return null;f=a.indexOf("\x26",d);if(0>f||f>c)f=c;d+=b.length+1;return(0,window.decodeURIComponent)(a.substr(d,f-d).replace(/\+/g," "))}; z.de=function(a){z.G.call(this);this.headers=new z.Rd;this.jv=a||null;this.Jh=!1;this.iv=this.ea=null;this.ct=this.vz="";this.Oj=this.Ky=this.Ls=this.sx=!1;this.Su=0;this.Ru=null;this.rJ=ee;this.fC=this.wU=this.aX=!1};var fe=function(a){return z.C&&z.E(9)&&z.qa(a.timeout)&&z.ka(a.ontimeout)};var ge=function(a){return"content-type"==a.toLowerCase()};var he=function(a){a.sx||(a.sx=!0,a.dispatchEvent("complete"),a.dispatchEvent("error"))}; var ie=function(a){if(a.Jh&&"undefined"!=typeof z.je&&(!a.iv[1]||4!=ke(a)||2!=me(a)))if(a.Ls&&4==ke(a))z.vd(a.vI,0,a);else if(a.dispatchEvent("readystatechange"),a.Ge()){a.Jh=!1;try{if(ne(a))a.dispatchEvent("complete"),a.dispatchEvent("success");else{var b;try{b=2this.DH)throw Error("[goog.structs.SimplePool] Initial cannot be greater than max");for(var c=0;ca&&(b=" ");100>a&&(b=" ");10>a&&(b=" ");return b+a}; var Wf=function(a){a=Math.round(a);return String(100+a/1E3%60).substring(1,3)+"."+String(1E3+a%1E3).substring(1,4)};var Xf=function(){z.xc.call(this)};var Yf=function(a,b){this.es=a;this.ga=b};var Zf=function(a,b){z.xc.call(this);this.BE=a;this.pb=b;this.gA=[];this.$z=[];this.RE=[]};var $f=function(a,b){a.ku(a.$z,b,void 0)};var ag=function(a,b){for(var c=[],d=0;db)throw Error("Bad port number "+b);a.lm=b}else a.lm=null};var th=function(a,b,c){z.rh(a);b instanceof z.vh?(a.he=b,a.he.eB(a.Ce)):(c||(b=wh(b,xh)),a.he=new z.vh(b,0,a.Ce));return a}; z.rh=function(a){if(a.yR)throw Error("Tried to modify a read-only Uri");};var yh=function(){var a=window.location;return a instanceof z.ph?a.clone():new z.ph(a,void 0)};var uh=function(a,b){return a?b?(0,window.decodeURI)(a.replace(/%25/g,"%2525")):(0,window.decodeURIComponent)(a):""};var wh=function(a,b,c){return z.pa(a)?(a=(0,window.encodeURI)(a).replace(b,Ah),c&&(a=a.replace(/%25([0-9a-fA-F]{2})/g,"%$1")),a):null};var Ah=function(a){a=a.charCodeAt(0);return"%"+(a>>4&15).toString(16)+(a&15).toString(16)}; z.vh=function(a,b,c){this.Ja=this.Lb=null;this.Yd=a||null;this.Ce=!!c};var Bh=function(a){a.Lb||(a.Lb=new z.Rd,a.Ja=0,a.Yd&&ae(a.Yd,function(b,c){a.add((0,window.decodeURIComponent)(b.replace(/\+/g," ")),c)}))};var Ch=function(a,b){var c=String(b);a.Ce&&(c=c.toLowerCase());return c};var Dh=function(){};var Eh=function(){};var Fh=function(a){this.Nc=a};var Gh=function(){var a=null;try{a=window.localStorage||null}catch(b){}this.Nc=a}; var Hh=function(){var a=null;try{a=window.sessionStorage||null}catch(b){}this.Nc=a};var Ih=function(a,b){this.eK=a;this.xd=null;if(z.C&&!(9<=z.Tg)){Jh||(Jh=new z.Rd);this.xd=Jh.get(a);this.xd||(b?this.xd=window.document.getElementById(b):(this.xd=window.document.createElement("userdata"),this.xd.addBehavior("#default#userData"),window.document.body.appendChild(this.xd)),Jh.set(a,this.xd));try{this.xd.load(this.eK)}catch(c){this.xd=null}}}; var Kh=function(a){return"_"+(0,window.encodeURIComponent)(a).replace(/[.!~*'()%]/g,function(a){return Lh[a]})};var Mh=function(a){try{a.xd.save(a.eK)}catch(b){throw"Storage mechanism: Quota exceeded";}};var Nh=function(a){return a.xd.XMLDocument.documentElement};var Oh=function(a,b){this.To=a;this.mm=b+"::"};var Ph=function(a,b){this.nz="continuation:"+a;this.Nc=b||z.Qh;this.mG=[]};var Rh=function(a,b){var c=a.gb();c.push(b);try{a.Nc.set(a.nz,JSON.stringify(c))}catch(d){}}; var Sh=function(a,b,c,d,f,g){z.pa(a)?(this.Ud=a==Th?b:0,this.Ld=a==Uh?b:0,this.Ed=a==Vh?b:0,this.od=a==Wh?b:0,this.rd=a==Xh?b:0,this.vd=a==Yh?b:0):(this.Ud=a||0,this.Ld=b||0,this.Ed=c||0,this.od=d||0,this.rd=f||0,this.vd=g||0)}; var Zh=function(a,b,c){z.qa(a)?(this.fa=$h(a,b||0,c||1),ai(this,c||1)):z.ta(a)?(this.fa=$h(a.getFullYear(),a.getMonth(),a.getDate()),ai(this,a.getDate())):(this.fa=new Date((0,z.I)()),a=this.fa.getDate(),this.fa.setHours(0),this.fa.setMinutes(0),this.fa.setSeconds(0),this.fa.setMilliseconds(0),ai(this,a))};var $h=function(a,b,c){b=new Date(a,b,c);0<=a&&100>a&&b.setFullYear(b.getFullYear()-1900);return b}; var bi=function(a){a=a.getTimezoneOffset();if(0==a)a="Z";else{var b=Math.abs(a)/60,c=Math.floor(b),b=60*(b-c);a=(0c?"-":"+"];c=Math.abs(c);d.push(Math.floor(c/60)%100);c%=60;0!=c&&d.push(":",Ya(c,2));c=d.join("")}b.KB=c;c=a;0==c?c="UTC":(d=["UTC",0>c?"+":"-"],c=Math.abs(c),d.push(Math.floor(c/60)%100),c%=60,0!=c&&d.push(":",c),c=d.join(""));a=fi(a);b.UB=[c,c];b.Fk={VX:a,MC:a};b.$u=[];return b}b=new di;b.KB=a.id;b.Ju=-a.std_offset;b.UB=a.names;b.Fk=a.names_ext;b.$u=a.transitions;return b}; var fi=function(a){var b=["GMT"];b.push(0>=a?"+":"-");a=Math.abs(a);b.push(Ya(Math.floor(a/60)%100,2),":",Ya(a%60,2));return b.join("")};var gi=function(a,b){for(var c=Date.UTC(b.getUTCFullYear(),b.getUTCMonth(),b.getUTCDate(),b.getUTCHours(),b.getUTCMinutes())/36E5,d=0;d=a.$u[d];)d+=2;return 0==d?0:a.$u[d-1]};var ii=function(a,b){this.Ut=[];this.zb=b||ji;"number"==typeof a?ki(this,a):li(this,a)}; var li=function(a,b){for(mi&&(b=b.replace(/\u200f/g,""));b;)for(var c=0;cb)c=a.zb.IC[b];else if(8>b)c=a.zb.NC[b-4];else if(12>b)c=a.zb.EL[b-8],c=c.replace("{1}",a.zb.IC[b-8]),c=c.replace("{0}",a.zb.NC[b-8]);else{ki(a,10);return}li(a,c)}; var oi=function(a,b){var c;c=String(b);var d=a.zb||ji;if(void 0!==d.iM){for(var f=[],g=0;g=h?String.fromCharCode(d.iM+h-48):c.charAt(g))}c=f.join("")}return c};var pi=function(a){if(!(a.getHours&&a.getSeconds&&a.getMinutes))throw Error("The date to format has no time (probably a goog.date.Date). Use Date or goog.date.DateTime, or use a pattern without time fields.");}; var qi=function(a,b,c,d,f,g){var h=b.length;switch(b.charAt(0)){case "G":return c=0c&&(c=-c),2==h&&(c%=100),oi(a,Ya(c,h));case "M":a:switch(c=d.getMonth(),h){case 5:h=a.zb.KL[c];break a;case 4:h=a.zb.IL[c];break a;case 3:h=a.zb.QL[c];break a;default:h=oi(a,Ya(c+1,h))}return h;case "k":return pi(f),oi(a,Ya(f.getHours()||24,h));case "S":return oi(a,(f.getTime()%1E3/1E3).toFixed(Math.min(3,h)).substr(2)+(3h?1:0];case "h":return pi(f),oi(a,Ya(f.getHours()%12||12,h));case "K":return pi(f),oi(a,Ya(f.getHours()%12,h));case "H":return pi(f),oi(a,Ya(f.getHours(),h));case "c":a:switch(c=d.getDay(),h){case 5:h=a.zb.XL[c];break a;case 4:h=a.zb.$L[c];break a;case 3:h=a.zb.ZL[c];break a;default:h=oi(a,Ya(c,1))}return h;case "L":a:switch(c=d.getMonth(),h){case 5:h=a.zb.WL[c];break a;case 4:h=a.zb.VL[c]; break a;case 3:h=a.zb.YL[c];break a;default:h=oi(a,Ya(c+1,h))}return h;case "Q":return c=Math.floor(d.getMonth()/3),4>h?a.zb.RL[c]:a.zb.LL[c];case "d":return oi(a,Ya(d.getDate(),h));case "m":return pi(f),oi(a,Ya(f.getMinutes(),h));case "s":return pi(f),oi(a,Ya(f.getSeconds(),h));case "v":return h=g||ei(c.getTimezoneOffset()),h.KB;case "V":return a=g||ei(c.getTimezoneOffset()),2>=h?a.KB:0h?a.UB[0h?(h=-(f.Ju-gi(f,c)),a=[0>h?"-":"+"],h=Math.abs(h),a.push(Ya(Math.floor(h/60)%100,2),Ya(h%60,2)),h=a.join("")):h=oi(a, fi(f.Ju-gi(f,c))),h;default:return""}}; var ri=function(a){var b;if("string"===typeof a){b=new ci(2E3);a=(0,z.ab)(a);a=a.split(-1==a.indexOf("T")?" ":"T");var c;var d=a[0].match(si);if(d){var f=Number(d[2]),g=Number(d[3]),h=Number(d[4]);c=Number(d[5]);var k=Number(d[6])||1;b.setFullYear(Number(d[1]));h?(b.setDate(1),b.setMonth(0),b.add(new Sh(Vh,h-1))):c?(b.setMonth(0),b.setDate(1),d=b.getDay()||7,b.add(new Sh(Vh,(4>=d?1-d:8-d)+(Number(k)+7*(Number(c)-1))-1))):(f&&(b.setDate(1),b.setMonth(f-1)),g&&b.setDate(g));c=!0}else c=!1;c&&!(c=2> a.length)&&(a=a[1],c=a.match(ti),k=0,c&&("Z"!=c[0]&&(k=60*c[2]+Number(c[3]),k*="-"==c[1]?1:-1),k-=b.getTimezoneOffset(),a=a.substr(0,a.length-c[0].length)),(c=a.match(ui))?(b.setHours(Number(c[1])),b.setMinutes(Number(c[2])||0),b.setSeconds(Number(c[3])||0),b.setMilliseconds(c[4]?1E3*c[4]:0),0!=k&&b.setTime(b.getTime()+6E4*k),c=!0):c=!1);b=(c?b:null).fa}else b=new Date(a);return b}; z.vi=function(a,b){a=void 0===a?new Date:a;b=void 0===b?new Date:b;a=ri(a);b=ri(b);var c=(b-a)/1E3;if(60>c)return"刚刚";c=(0,window.parseInt)(c/60);if(60>c)return c+" 分钟前";c=(0,window.parseInt)(c/60);if(24>c)return c+" 小时前";var c=b.getFullYear()-a.getFullYear(),d=b.getMonth()-a.getMonth(),f=b.getDate()-a.getDate();return 0===c&&0===d?f+" 天前":0===c&&1===d||1===c&&-11===d?0>f?(new Date(a.getFullYear(),a.getMonth()+1,0)).getDate()+f+" 天前":"1 月前":2>c?1===c&&0<=d?"1 年前":12*c+d+" 月前":c+" 年前"}; var wi=function(a,b){return(new ii(void 0===b?"yyyy-MM-dd HH:mm:ss":b)).format(new Date(a))};z.xi=function(a){if(window.za.collect&&z.ta(a)&&a.action){var b={eventAction:a.action,eventCategory:a.category,eventLabel:a.label,eventValue:a.value&&(0,window.parseInt)(a.value,10),eventAttributes:a.attributes,nonInteractionType:!!a.bI};a.wc?Rh(yi,b):window.za.collect("event",b)}};z.zi=function(a,b,c,d,f){z.xi({category:a,action:b,label:c,value:d,bI:f,attributes:void 0})}; z.Ai=function(a,b,c,d,f){z.xi({wc:!0,category:a,action:b,label:c,value:d,bI:f,attributes:void 0})};var Bi=function(){(0,window.$)(window.document).on("click","a[data-za-a]",function(a){var b=(0,window.$)(a.target);if(a=b.data("za-a")){var c=b.data("za-c"),d=b.data("za-l"),b=b.data("za-v");z.Ai(c,a,d,b)}})}; var Ci=function(a){return function(b){for(var c=[],d=0;d(0,z.I)()-c&&(window.location=Wi.jY)},400)};z.Xi=function(a){this.Ka=a}; z.Yi=function(a){a=(a.Ka.cookie||"").split(Zi);for(var b=[],c=[],d,f,g=0;f=a[g];g++)d=f.indexOf("\x3d"),-1==d?(b.push(""),c.push(f)):(b.push(f.substring(0,d)),c.push(f.substring(d+1)));return{keys:b,values:c}};var $i=function(){z.aj.remove("actioncontinuationhash","/")};z.bj=function(a,b){b?a.setAttribute("role",b):a.removeAttribute("role")}; z.cj=function(a,b,c){z.na(c)&&(c=c.join(" "));var d="aria-"+b;""===c||void 0==c?(dj||(dj={atomic:!1,autocomplete:"none",dropeffect:"none",haspopup:!1,live:"off",multiline:!1,multiselectable:!1,orientation:"vertical",readonly:!1,relevant:"additions text",required:!1,sort:"none",busy:!1,disabled:!1,hidden:!1,invalid:"false"}),c=dj,b in c?a.setAttribute(d,c[b]):a.removeAttribute(d)):a.setAttribute(d,c)};z.ej=function(a,b){var c=a.getAttribute("aria-"+b);return null==c||void 0==c?"":String(c)}; z.fj=function(a){if(a.classList)return a.classList;a=a.className;return z.pa(a)&&a.match(/\S+/g)||[]};z.gj=function(a,b){return a.classList?a.classList.contains(b):z.A(z.fj(a),b)};z.hj=function(a,b){a.classList?a.classList.add(b):z.gj(a,b)||(a.className+=0d?b=0:0>b&&(b=d));a.dispatchEvent({data:{index:b,size:c},type:"action"});0>b||b>d||(a.Pj=b,a.fp(zl(a)))}};var zl=function(a){return a.items()[a.index()]};z.Al=function(a){xl.call(this,a);this.xL=(0,window.$)("html, body")}; var Bl=function(a){return{k:{action:a.prev,Vb:{group:"导航",name:"上一条目"}},j:{action:a.next,Vb:{group:"导航",name:"下一条目"}},"g g":{action:a.first,Vb:{group:"导航",name:"第一个条目"}},"shift+g":{action:a.last,Vb:{group:"导航",name:"最后一个条目"}},"shift+k":{action:a.pV,Vb:{group:"导航",name:"屏幕上移"}},"shift+j":{action:a.kV,Vb:{group:"导航",name:"屏幕下移"}}}};z.Cl=function(a){z.al.call(this,a)};z.ba=[];ea="undefined"!=typeof window&&window===this?this:"undefined"!=typeof window.global?window.global:this;ga=0;z.je=z.je||{}; z.t=this;z.va="closure_uid_"+(1E9*Math.random()>>>0);wa=0;z.I=Date.now||function(){return+new Date};Ea=null;var Ke;z.x(Ia,Error);Ia.prototype.name="CustomError";var Pa,Qa,Ra,Sa,Ta,Ua,Oa,Za;z.ab=String.prototype.trim?function(a){return a.trim()}:function(a){return a.replace(/^[\s\xa0]+|[\s\xa0]+$/g,"")};Pa=/&/g;Qa=//g;Sa=/"/g;Ta=/'/g;Ua=/\x00/g;Oa=/[\x00&<>"']/;Za=String.prototype.repeat?function(a,b){return a.repeat(b)}:function(a,b){return Array(b+1).join(a)};z.Dl=2147483648*Math.random()|0;fb.prototype.get=function(){var a;0(0,window.parseFloat)(a))?String(b):a}();Ic={};Ml=z.t.document;z.Tg=Ml&&z.C?Hc()||("CSS1Compat"==Ml.compatMode?(0,window.parseInt)(z.Jc,10):5):void 0;var Rc=!z.C||9<=z.Tg,kd=!z.C||9<=z.Tg,Nl=z.C&&!z.E("9");!z.D||z.E("528");z.B&&z.E("1.9b")||z.C&&z.E("8")||z.ug&&z.E("9.5")||z.D&&z.E("528");z.B&&!z.E("8")||z.C&&z.E("9");Kc.prototype.toString=function(){return this.id};z.Lc.prototype.stopPropagation=function(){this.rk=!0};z.Lc.prototype.preventDefault=function(){this.defaultPrevented=!0;this.wJ=!1};z.Ol=z.C?"focusin":"DOMFocusIn";Nc[" "]=z.p;z.x(z.Pc,z.Lc);var Sc=[1,4,2]; z.Pc.prototype.init=function(a,b){var c=this.type=a.type,d=a.changedTouches?a.changedTouches[0]:null;this.target=a.target||a.srcElement;this.currentTarget=b;var f=a.relatedTarget;f?z.B&&(z.Oc(f,"nodeName")||(f=null)):"mouseover"==c?f=a.fromElement:"mouseout"==c&&(f=a.toElement);this.relatedTarget=f;null===d?(this.offsetX=z.D||void 0!==a.offsetX?a.offsetX:a.layerX,this.offsetY=z.D||void 0!==a.offsetY?a.offsetY:a.layerY,this.clientX=void 0!==a.clientX?a.clientX:a.pageX,this.clientY=void 0!==a.clientY? a.clientY:a.pageY,this.screenX=a.screenX||0,this.screenY=a.screenY||0):(this.clientX=void 0!==d.clientX?d.clientX:d.pageX,this.clientY=void 0!==d.clientY?d.clientY:d.pageY,this.screenX=d.screenX||0,this.screenY=d.screenY||0);this.button=a.button;this.keyCode=a.keyCode||0;this.charCode=a.charCode||("keypress"==c?a.keyCode:0);this.ctrlKey=a.ctrlKey;this.altKey=a.altKey;this.shiftKey=a.shiftKey;this.metaKey=a.metaKey;this.wA=z.Uc?a.metaKey:a.ctrlKey;this.state=a.state;this.gc=a;a.defaultPrevented&&this.preventDefault()}; z.Pc.prototype.stopPropagation=function(){z.Pc.o.stopPropagation.call(this);this.gc.stopPropagation?this.gc.stopPropagation():this.gc.cancelBubble=!0};z.Pc.prototype.preventDefault=function(){z.Pc.o.preventDefault.call(this);var a=this.gc;if(a.preventDefault)a.preventDefault();else if(a.returnValue=!1,Nl)try{if(a.ctrlKey||112<=a.keyCode&&123>=a.keyCode)a.keyCode=-1}catch(b){}};z.Pc.prototype.wF=z.aa(0);var Wc="closure_listenable_"+(1E6*Math.random()|0),Yc=0;z.e=z.$c.prototype;z.e.add=function(a,b,c,d,f){var g=a.toString();a=this.ic[g];a||(a=this.ic[g]=[],this.pq++);var h=bd(a,b,d,f);-1>>0);z.x(z.G,z.xc);z.G.prototype[Wc]=!0;z.e=z.G.prototype;z.e.ji=function(){return this.pA};z.e.Db=function(a){this.pA=a};z.e.addEventListener=function(a,b,c,d){z.F(this,a,b,c,d)};z.e.removeEventListener=function(a,b,c,d){z.md(this,a,b,c,d)}; z.e.dispatchEvent=function(a){var b,c=this.ji();if(c)for(b=[];c;c=c.ji())b.push(c);var c=this.nM,d=a.type||a;if(z.pa(a))a=new z.Lc(a,c);else if(a instanceof z.Lc)a.target=a.target||c;else{var f=a;a=new z.Lc(d,c);z.Mb(a,f)}var f=!0,g;if(b)for(var h=b.length-1;!a.rk&&0<=h;h--)g=a.currentTarget=b[h],f=z.sd(g,d,!0,a)&&f;a.rk||(g=a.currentTarget=c,f=z.sd(g,d,!0,a)&&f,a.rk||(f=z.sd(g,d,!1,a)&&f));if(b)for(h=0;!a.rk&&ha?-1:a};z.Od="StopIteration"in z.t?z.t.StopIteration:{message:"StopIteration",stack:""};z.Ld.prototype.next=function(){throw z.Od;};z.Ld.prototype.gd=function(){return this};z.e=z.Rd.prototype;z.e.kb=function(){return this.Ja};z.e.Wc=function(){z.Td(this);for(var a=[],b=0;b2*this.Ja&&z.Td(this),!0):!1};z.e.get=function(a,b){return z.Ud(this.Ib,a)?this.Ib[a]:b};z.e.set=function(a,b){z.Ud(this.Ib,a)||(this.Ja++,this.Za.push(a),this.xq++);this.Ib[a]=b};z.e.addAll=function(a){var b;a instanceof z.Rd?(b=a.ld(),a=a.Wc()):(b=z.Hb(a),a=z.Gb(a));for(var c=0;c=d.Za.length)throw z.Od;var f=d.Za[b++];return a?f:d.Ib[f]};return f};z.x(Vd,z.xc);Vd.prototype.$x=function(){return this.qu};Vd.prototype.D=function(){Vd.o.D.call(this);this.qu=this.Gk=null};z.Rl=/\uffff/.test("￿")?/[\\\"\x00-\x1f\x7f-\uffff]/g:/[\\\"\x00-\x1f\x7f-\xff]/g;Wd.prototype.ED=null;var Sl;z.x(Zd,Wd);Sl=new Zd;var ce;z.re=/^(?:([^:/?#.]+):)?(?:\/\/(?:([^/?#]*)@)?([^/#?]*?)(?::([0-9]+))?(?=[/#?]|$))?([^?#]+)?(?:\?([^#]*))?(?:#(.*))?$/;ce=/#|$/;z.x(z.de,z.G);var ee="",se=/^https?$/i,Tl=["POST","PUT"];z.e=z.de.prototype; z.e.send=function(a,b,c,d){if(this.ea)throw Error("[goog.net.XhrIo] Object is active with another request\x3d"+this.vz+"; newUri\x3d"+a);b=b?b.toUpperCase():"GET";this.vz=a;this.ct="";this.sx=!1;this.Jh=!0;this.ea=this.jv?$d(this.jv):$d(Sl);this.iv=this.jv?Xd(this.jv):Xd(Sl);this.ea.onreadystatechange=(0,z.q)(this.vI,this);this.wU&&"onprogress"in this.ea&&(this.ea.onprogress=(0,z.q)(function(a){this.uI(a,!0)},this),this.ea.upload&&(this.ea.upload.onprogress=(0,z.q)(this.uI,this)));try{this.Ky=!0, this.ea.open(b,String(a),!0),this.Ky=!1}catch(g){this.Tr(5,g);return}a=c||"";var f=this.headers.clone();d&&Kd(d,function(a,b){f.set(b,a)});d=z.qb(f.ld(),ge);c=z.t.FormData&&a instanceof z.t.FormData;!z.A(Tl,b)||d||c||f.set("Content-Type","application/x-www-form-urlencoded;charset\x3dutf-8");f.forEach(function(a,b){this.ea.setRequestHeader(b,a)},this);this.rJ&&(this.ea.responseType=this.rJ);Ib(this.ea,"withCredentials")&&(this.ea.withCredentials=this.aX);try{qe(this),0=b.rw&&b.cancel())}this.gI?this.gI.call(this.zE,this):this.oB=!0;this.ei||ye(this,new Ee(this))}};z.e.gE=function(a,b){this.mw=!1;we(this,a,b)};z.e.Th=function(){if(this.ei){if(!this.oB)throw new De(this);this.oB=!1}};z.e.Rh=function(a){this.Th();we(this,!0,a)}; z.e.then=function(a,b,c){var d,f,g=new ec(function(a,b){d=a;f=b});ze(this,d,function(a){a instanceof Ee?g.cancel():f(a)});return g.then(a,b,c)};Fa(ve);z.x(De,Ia);De.prototype.message="Deferred has already fired";De.prototype.name="AlreadyCalledError";z.x(Ee,Ia);Ee.prototype.message="Deferred was canceled";Ee.prototype.name="CanceledError";Ce.prototype.kW=function(){delete Be[this.pb];throw this.Tr;};var Be={};var Te,ff,pf;Te=!z.C||9<=z.Tg;ff=!z.B&&!z.C||z.C&&9<=z.Tg||z.B&&z.E("1.9.1");pf=z.C&&!z.E("9");z.Ul=z.C&&!(9<=z.Tg);z.e=z.Ge.prototype;z.e.clone=function(){return new z.Ge(this.x,this.y)};z.e.ceil=function(){this.x=Math.ceil(this.x);this.y=Math.ceil(this.y);return this};z.e.floor=function(){this.x=Math.floor(this.x);this.y=Math.floor(this.y);return this};z.e.round=function(){this.x=Math.round(this.x);this.y=Math.round(this.y);return this};z.e.translate=function(a,b){a instanceof z.Ge?(this.x+=a.x,this.y+=a.y):(this.x+=a,z.qa(b)&&(this.y+=b));return this}; z.e.scale=function(a,b){var c=z.qa(b)?b:a;this.x*=a;this.y*=c;return this};z.e=z.He.prototype;z.e.clone=function(){return new z.He(this.width,this.height)};z.e.RM=function(){return this.width*this.height};z.e.Zg=function(){return!this.RM()};z.e.ceil=function(){this.width=Math.ceil(this.width);this.height=Math.ceil(this.height);return this};z.e.floor=function(){this.width=Math.floor(this.width);this.height=Math.floor(this.height);return this};z.e.round=function(){this.width=Math.round(this.width);this.height=Math.round(this.height);return this}; z.e.scale=function(a,b){var c=z.qa(b)?b:a;this.width*=a;this.height*=c;return this};var Ne={cellpadding:"cellPadding",cellspacing:"cellSpacing",colspan:"colSpan",frameborder:"frameBorder",height:"height",maxlength:"maxLength",role:"role",rowspan:"rowSpan",type:"type",usemap:"useMap",valign:"vAlign",width:"width"},rf={SCRIPT:1,STYLE:1,HEAD:1,IFRAME:1,OBJECT:1},sf={IMG:" ",BR:"\n"};z.e=z.Ie.prototype;z.e.K=z.J;z.e.ua=function(){return this.Ka};z.e.m=function(a){return z.pa(a)?this.Ka.getElementById(a):a};z.e.$=z.Ie.prototype.m;z.e.Yf=z.aa(8); z.e.B=function(a,b,c){return Se(this.Ka,arguments)};z.e.createElement=function(a){return this.Ka.createElement(a)};z.e.createTextNode=function(a){return this.Ka.createTextNode(String(a))};z.e.Mw=z.aa(9);z.e.Va=function(){var a=this.Ka;return a.parentWindow||a.defaultView};z.e.zl=z.aa(10);z.e.appendChild=function(a,b){a.appendChild(b)};z.e.append=z.Ze;z.e.canHaveChildren=z.Ye;z.e.zp=z.$e;z.e.Us=z.af;z.e.bz=z.bf;z.e.removeNode=z.P;z.e.GO=z.df;z.e.UO=z.ef;z.e.EF=z.gf;z.e.isElement=z.jf; z.e.isWindow=kf;z.e.contains=z.lf;z.e.bg=z.aa(12);z.e.SO=z.tf;var xf=[],Df=0,Cf=1;z.x(Bf,Ia);z.Vl=Rb();z.Ui=z.Ec()||z.Ab("iPod");z.Vj=z.Ab("iPad");z.Wl=z.Ab("Android")&&!(Sb()||Rb()||Pb()||z.Ab("Silk"));z.If=Sb();z.Xl=z.Ab("Safari")&&!(Sb()||z.Ab("Coast")||Pb()||z.Ab("Edge")||z.Ab("Silk")||z.Ab("Android"))&&!(z.Ec()||z.Ab("iPad")||z.Ab("iPod"));z.x(Ff,z.G);z.e=Ff.prototype;z.e.Ir=!1;z.e.YJ=!1;z.e.VR=function(a,b,c,d){var f=this.hh[a]||new Of;f.xH=!0;f.CB=c||null;f.tx=d||null;if(this.hh[a])null!=f.PA&&Gf(this,a);else{this.hh[a]=f;c=[];for(d=0;d=this.left&&a.right<=this.right&&a.top>=this.top&&a.bottom<=this.bottom:a.x>=this.left&&a.x<=this.right&&a.y>=this.top&&a.y<=this.bottom:!1};z.e.expand=function(a,b,c,d){z.ta(a)?(this.top-=a.top,this.right+=a.right,this.bottom+=a.bottom,this.left-=a.left):(this.top-=a,this.right+=b,this.bottom+=c,this.left-=d);return this}; z.e.ceil=function(){this.top=Math.ceil(this.top);this.right=Math.ceil(this.right);this.bottom=Math.ceil(this.bottom);this.left=Math.ceil(this.left);return this};z.e.floor=function(){this.top=Math.floor(this.top);this.right=Math.floor(this.right);this.bottom=Math.floor(this.bottom);this.left=Math.floor(this.left);return this};z.e.round=function(){this.top=Math.round(this.top);this.right=Math.round(this.right);this.bottom=Math.round(this.bottom);this.left=Math.round(this.left);return this}; z.e.translate=function(a,b){a instanceof z.Ge?(this.left+=a.x,this.right+=a.x,this.top+=a.y,this.bottom+=a.y):(this.left+=a,this.right+=a,z.qa(b)&&(this.top+=b,this.bottom+=b));return this};z.e.scale=function(a,b){var c=z.qa(b)?b:a;this.left*=a;this.right*=a;this.top*=c;this.bottom*=c;return this};z.e=z.qg.prototype;z.e.clone=function(){return new z.qg(this.left,this.top,this.width,this.height)};z.e.cz=z.aa(14);z.e.contains=function(a){return a instanceof z.qg?this.left<=a.left&&this.left+this.width>=a.left+a.width&&this.top<=a.top&&this.top+this.height>=a.top+a.height:a.x>=this.left&&a.x<=this.left+this.width&&a.y>=this.top&&a.y<=this.top+this.height};z.e.Rg=z.aa(15); z.e.ceil=function(){this.left=Math.ceil(this.left);this.top=Math.ceil(this.top);this.width=Math.ceil(this.width);this.height=Math.ceil(this.height);return this};z.e.floor=function(){this.left=Math.floor(this.left);this.top=Math.floor(this.top);this.width=Math.floor(this.width);this.height=Math.floor(this.height);return this};z.e.round=function(){this.left=Math.round(this.left);this.top=Math.round(this.top);this.width=Math.round(this.width);this.height=Math.round(this.height);return this}; z.e.translate=function(a,b){a instanceof z.Ge?(this.left+=a.x,this.top+=a.y):(this.left+=a,z.qa(b)&&(this.top+=b));return this};z.e.scale=function(a,b){var c=z.qa(b)?b:a;this.left*=a;this.width*=a;this.top*=c;this.height*=c;return this};var tg,Rg;tg={};z.dm=z.B?"MozUserSelect":z.D||z.Gc?"WebkitUserSelect":null;Rg={thin:2,medium:4,thick:6};z.la(z.Vg);z.Vg.prototype.Sz=0;z.x(z.R,z.G);z.R.prototype.NQ=z.Vg.ba();var Xg=null;z.e=z.R.prototype;z.e.de=function(){return this.pb||(this.pb=z.Wg(this.NQ))};z.e.m=function(){return this.h};z.e.Yf=z.aa(7);z.e.v=function(){this.mi||(this.mi=new z.xd(this));return this.mi};z.e.getParent=function(){return this.Ra};z.e.Db=function(a){if(this.Ra&&this.Ra!=a)throw Error("Method not supported");z.R.o.Db.call(this,a)};z.e.K=function(){return this.da};z.e.B=function(){this.h=this.da.createElement("DIV")};z.e.render=function(a){this.Ap(a)}; z.e.Ap=function(a,b){if(this.wa)throw Error("Component already rendered");this.h||this.B();a?a.insertBefore(this.h,b||null):this.da.ua().body.appendChild(this.h);this.Ra&&!this.Ra.wa||this.C()};z.e.w=function(a){if(this.wa)throw Error("Component already rendered");if(a&&this.Ob(a)){this.YK=!0;var b=z.Je(a);this.da&&this.da.ua()==b||(this.da=z.J(a));this.Y(a);this.C()}else throw Error("Invalid element to decorate");};z.e.Ob=function(){return!0};z.e.Y=function(a){this.h=a}; z.e.C=function(){this.wa=!0;z.bh(this,function(a){!a.wa&&a.m()&&a.C()})};z.e.Hb=function(){z.bh(this,function(a){a.wa&&a.Hb()});this.mi&&this.mi.removeAll();this.wa=!1};z.e.D=function(){this.wa&&this.Hb();this.mi&&(this.mi.H(),delete this.mi);z.bh(this,function(a){a.H()});!this.YK&&this.h&&z.P(this.h);this.Ra=this.Nz=this.h=this.Xe=this.Qc=null;z.R.o.D.call(this)};z.e.L=function(a,b){this.Rk(a,z.$g(this),b)}; z.e.Rk=function(a,b,c){if(a.wa&&(c||!this.wa))throw Error("Component already rendered");if(0>b||b>z.$g(this))throw Error("Child component index out of bounds");this.Xe&&this.Qc||(this.Xe={},this.Qc=[]);if(a.getParent()==this){var d=a.de();this.Xe[d]=a;z.tb(this.Qc,a)}else z.Lb(this.Xe,a.de(),a);z.Yg(a,this);z.xb(this.Qc,b,0,a);a.wa&&this.wa&&a.getParent()==this?(c=this.S(),b=c.childNodes[b]||null,b!=a.m()&&c.insertBefore(a.m(),b)):c?(this.h||this.B(),b=z.ah(this,b+1),a.Ap(this.S(),b?b.h:null)):this.wa&& !a.wa&&a.h&&a.h.parentNode&&1==a.h.parentNode.nodeType&&a.C()};z.e.S=function(){return this.h};z.e.qd=z.aa(16);z.e.uh=z.aa(17);z.e.removeChild=function(a,b){if(a){var c=z.pa(a)?a:a.de();a=z.Zg(this,c);c&&a&&(z.Kb(this.Xe,c),z.tb(this.Qc,a),b&&(a.Hb(),a.h&&z.P(a.h)),z.Yg(a,null))}if(!a)throw Error("Child is not in parent component");return a};z.e.zp=z.aa(11);var em; (function(a){em="div[contenteditable];.ac-row;.ac-row *;.goog-menu *;.goog-menu-button *;.goog-toolbar-button *;.goog-link-button *;.ee-menu-palette-cell *;.ee-palette-cell *".split(";");if(a){var b=a.prototype.needsClick,c;if(window.HTMLElement){var d=z.qb(["matchesSelector","webkitMatchesSelector","mozMatchesSelector","msMatchesSelector"],function(a){return window.HTMLElement.prototype[a]});c=d&&window.HTMLElement.prototype[d]}var f=c?function(a,b){return c.call(a,b)}:function(a,b){return(0,window.$)(a).is(b)};a.prototype.needsClick= function(a){return z.pb(em,function(b){return f(a,b)})?!0:b.call(this,a)}}})(window.FastClick);z.fm="/update";z.Mi=!1;var jh,oh,nm,om;z.gm={};z.rm={};z.sm=z.ob((0,window.$)("script.json-inline"),function(a,b){var c=(0,window.$)(b).data("name");a[c]=JSON.parse(b.text);return a},{}); (function(a){z.T=[];z.T.Fb=function(){return!1};z.T.be=function(){return""};z.Hk=!1;z.Db(a,function(a,c){switch(c){case "redirect_to":z.hm=a;break;case "current_user":z.T=a;z.T.tF=a[0];z.T.Fb=function(){return"-1"!==z.T.fg};z.T.rD=a[2];z.T.fg=a[3];z.T.pG=a[4];z.T.qe=a[7];z.T.Ln=a[8];z.T.GY=a[9];z.T.CY=a[10];z.T.Rz=a[11];z.T.Ds=a[12];z.T.BY=a[13];z.T.be=function(a){var b=z.T.rD;return a?b.replace("_s","_"+a):b};z.T.XH=a[14];z.T.Jd=a[15];break;case "user_status":z.im=a;z.im.YE=a[0];z.im.lw=a[1];break; case "env":z.Mb(z.rm,{yJ:a[0],vn:("https:"===window.document.location.protocol?"https://":"http://")+a[1],Ab:a[2],MG:a[3],wB:("https:"===window.document.location.protocol?"https://static.":"http://static.")+a[0]+"/static",tq:("https:"===window.document.location.protocol?"https://upload.":"http://upload.")+a[0]+":"+window.location.port,dH:!1,wR:a[4]});break;case "current_question":z.S={pa:a.qid,bb:a.urlToken,status:a.status,iz:a.isLocked,cn:a.askAboutMember,pO:a.editPermission,qb:a.isAnon,QV:a.showInvitePanel, rY:a.detailEditReasonRequired,Eo:a.isEditLocked,Jd:a.isOrg,te:0,sr:0,Lm:null,oY:0,EY:!1,YY:!0,mh:[],iY:[]};break;case "current_question_bio":z.jm=a;break;case "my_answer":z.km=a;break;case "current_question_owner":z.T.mh=a;break;case "current_answer":jh=a;break;case "bio":z.lm=a;break;case "current_topic":z.nh=a;break;case "current_people":z.lh=a;z.lh.tF=a[0];z.lh.bb=a[1];z.lh.id=a[3];break;case "current_roundtable":z.mh=a;break;case "current_list":z.kh=a;z.kh.bb=a[2];break;case "current_live":oh= a;break;case "block_topic":z.mm=a;break;case "draft":z.gm.Wd=a.length?a:null;break;case "disabled_components":nm=a;break;case "comet_path":z.fm=a;break;case "is_org_page":z.Hk=!!a;break;case "permissions":om=a,z.pm=function(a){return z.A(om,a)}}});z.S&&(z.S.SG=!1);z.qm=function(a){return!!nm&&z.A(nm,a)};window.navigator.userAgent.match(/iPad/i)&&(z.rm.dH=!0,z.rm.Ab=!0);if(z.rm.yJ)try{window.document.domain=z.rm.yJ}catch(b){window.console&&window.console.warn(b)}z.rm.vn&&(z.fm=z.rm.vn+z.fm)})(z.sm);var Si,Ri,bk;z.tm=/iPad|iPhone/.test(window.navigator.userAgent);z.um=z.rm.wR;Si=/Android/.test(window.navigator.userAgent);z.vm=z.rm.Ab;z.eh=/MicroMessenger/.test(window.navigator.userAgent);Ri=/Weibo/.test(window.navigator.userAgent);z.wm=/UCBrowser/.test(window.navigator.userAgent);bk=/Mobile/.test(window.navigator.userAgent)&&/CriOS/.test(window.navigator.userAgent);z.xm=z.tm&&!!window.indexedDB;var ih={title:window.document.title,desc:"与世界分享你的知识、经验和见解",link:window.location.href,imgUrl:window.location.protocol+"//"+window.location.hostname+"/static/revved/img/wechat-share-image.6e8f6318.png",type:"link"};z.e=z.ph.prototype;z.e.toString=function(){var a=[],b=this.Ei;b&&a.push(wh(b,ym,!0),":");var c=this.Kg;if(c||"file"==b)a.push("//"),(b=this.ke)&&a.push(wh(b,ym,!0),"@"),a.push((0,window.encodeURIComponent)(String(c)).replace(/%25([0-9a-fA-F]{2})/g,"%$1")),c=this.lm,null!=c&&a.push(":",String(c));if(c=this.Me)this.Kg&&"/"!=c.charAt(0)&&a.push("/"),a.push(wh(c,"/"==c.charAt(0)?zm:Am,!0));(c=this.he.toString())&&a.push("?",c);(c=this.wj)&&a.push("#",wh(c,Bm));return a.join("")}; z.e.resolve=function(a){var b=this.clone(),c=!!a.Ei;c?qh(b,a.Ei):c=!!a.ke;if(c){var d=a.ke;z.rh(b);b.ke=d}else c=!!a.Kg;c?(d=a.Kg,z.rh(b),b.Kg=d):c=null!=a.lm;d=a.Me;if(c)sh(b,a.lm);else if(c=!!a.Me){if("/"!=d.charAt(0))if(this.Kg&&!this.Me)d="/"+d;else{var f=b.Me.lastIndexOf("/");-1!=f&&(d=b.Me.substr(0,f+1)+d)}f=d;if(".."==f||"."==f)d="";else if(z.Va(f,"./")||z.Va(f,"/.")){for(var d=z.Ja(f,"/"),f=f.split("/"),g=[],h=0;h=c.length)throw z.Od;var d=c.key(b++);if(a)return d;d=c.getItem(d);if(!z.pa(d))throw"Storage mechanism: Invalid value was encountered";return d};return d};z.e.clear=function(){this.Nc.clear()};z.e.key=function(a){return this.Nc.key(a)};z.x(Gh,Fh);z.x(Hh,Fh);z.x(Ih,Eh);var Lh={".":".2E","!":".21","~":".7E","*":".2A","'":".27","(":".28",")":".29","%":"."},Jh=null;z.e=Ih.prototype;z.e.Wl=function(){return!!this.xd};z.e.set=function(a,b){this.xd.setAttribute(Kh(a),b);Mh(this)};z.e.get=function(a){a=this.xd.getAttribute(Kh(a));if(!z.pa(a)&&null!==a)throw"Storage mechanism: Invalid value was encountered";return a};z.e.remove=function(a){this.xd.removeAttribute(Kh(a));Mh(this)};z.e.kb=function(){return Nh(this).attributes.length}; z.e.gd=function(a){var b=0,c=Nh(this).attributes,d=new z.Ld;d.next=function(){if(b>=c.length)throw z.Od;var d=c[b++];if(a)return(0,window.decodeURIComponent)(d.nodeName.replace(/\./g,"%")).substr(1);d=d.nodeValue;if(!z.pa(d))throw"Storage mechanism: Invalid value was encountered";return d};return d};z.e.clear=function(){for(var a=Nh(this),b=a.attributes.length;0b&&0b&&c.push("-");c.push("P");(this.Ud||a)&&c.push(Math.abs(this.Ud)+"Y");(this.Ld||a)&&c.push(Math.abs(this.Ld)+"M");(this.Ed||a)&&c.push(Math.abs(this.Ed)+"D");if(this.od||this.rd||this.vd||a)c.push("T"),(this.od||a)&&c.push(Math.abs(this.od)+"H"),(this.rd||a)&&c.push(Math.abs(this.rd)+"M"), (this.vd||a)&&c.push(Math.abs(this.vd)+"S");return c.join("")};Sh.prototype.equals=function(a){return a.Ud==this.Ud&&a.Ld==this.Ld&&a.Ed==this.Ed&&a.od==this.od&&a.rd==this.rd&&a.vd==this.vd};Sh.prototype.clone=function(){return new Sh(this.Ud,this.Ld,this.Ed,this.od,this.rd,this.vd)};var Th="y",Uh="m",Vh="d",Wh="h",Xh="n",Yh="s";Sh.prototype.oW=function(a){return new Sh(this.Ud*a,this.Ld*a,this.Ed*a,this.od*a,this.rd*a,this.vd*a)}; Sh.prototype.add=function(a){this.Ud+=a.Ud;this.Ld+=a.Ld;this.Ed+=a.Ed;this.od+=a.od;this.rd+=a.rd;this.vd+=a.vd};z.e=Zh.prototype;z.e.cs=ji.JC;z.e.ds=ji.KC;z.e.clone=function(){var a=new Zh(this.fa);a.cs=this.cs;a.ds=this.ds;return a};z.e.getFullYear=function(){return this.fa.getFullYear()};z.e.getYear=function(){return this.getFullYear()};z.e.getMonth=function(){return this.fa.getMonth()};z.e.getDate=function(){return this.fa.getDate()};z.e.getTime=function(){return this.fa.getTime()}; z.e.getDay=function(){return this.fa.getDay()};z.e.getUTCFullYear=function(){return this.fa.getUTCFullYear()};z.e.getUTCMonth=function(){return this.fa.getUTCMonth()};z.e.getUTCDate=function(){return this.fa.getUTCDate()};z.e.getUTCDay=function(){return this.fa.getDay()};z.e.getUTCHours=function(){return this.fa.getUTCHours()};z.e.getUTCMinutes=function(){return this.fa.getUTCMinutes()};z.e.getTimezoneOffset=function(){return this.fa.getTimezoneOffset()}; z.e.set=function(a){this.fa=new Date(a.getFullYear(),a.getMonth(),a.getDate())};z.e.setFullYear=function(a){this.fa.setFullYear(a)};z.e.setYear=function(a){this.setFullYear(a)};z.e.setMonth=function(a){this.fa.setMonth(a)};z.e.setDate=function(a){this.fa.setDate(a)};z.e.setTime=function(a){this.fa.setTime(a)};z.e.setUTCFullYear=function(a){this.fa.setUTCFullYear(a)};z.e.setUTCMonth=function(a){this.fa.setUTCMonth(a)};z.e.setUTCDate=function(a){this.fa.setUTCDate(a)}; z.e.add=function(a){if(a.Ud||a.Ld){var b=this.getMonth()+a.Ld+12*a.Ud,c=this.getYear()+Math.floor(b/12),b=b%12;0>b&&(b+=12);var d;a:{switch(b){case 1:d=0!=c%4||0==c%100&&0!=c%400?28:29;break a;case 5:case 8:case 10:case 3:d=30;break a}d=31}d=Math.min(d,this.getDate());this.setDate(1);this.setFullYear(c);this.setMonth(b);this.setDate(d)}a.Ed&&(a=new Date((new Date(this.getYear(),this.getMonth(),this.getDate(),12)).getTime()+864E5*a.Ed),this.setDate(1),this.setFullYear(a.getFullYear()),this.setMonth(a.getMonth()), this.setDate(a.getDate()),ai(this,a.getDate()))};z.e.iq=function(a,b){return[this.getFullYear(),Ya(this.getMonth()+1,2),Ya(this.getDate(),2)].join(a?"-":"")+(b?bi(this):"")};z.e.equals=function(a){return!(!a||this.getYear()!=a.getYear()||this.getMonth()!=a.getMonth()||this.getDate()!=a.getDate())};z.e.toString=function(){return this.iq()};z.e.valueOf=function(){return this.fa.valueOf()};z.x(ci,Zh);z.e=ci.prototype;z.e.getHours=function(){return this.fa.getHours()};z.e.getMinutes=function(){return this.fa.getMinutes()}; z.e.getSeconds=function(){return this.fa.getSeconds()};z.e.getMilliseconds=function(){return this.fa.getMilliseconds()};z.e.getUTCDay=function(){return this.fa.getUTCDay()};z.e.getUTCHours=function(){return this.fa.getUTCHours()};z.e.getUTCMinutes=function(){return this.fa.getUTCMinutes()};z.e.getUTCSeconds=function(){return this.fa.getUTCSeconds()};z.e.getUTCMilliseconds=function(){return this.fa.getUTCMilliseconds()};z.e.setHours=function(a){this.fa.setHours(a)};z.e.setMinutes=function(a){this.fa.setMinutes(a)}; z.e.setSeconds=function(a){this.fa.setSeconds(a)};z.e.setMilliseconds=function(a){this.fa.setMilliseconds(a)};z.e.setUTCHours=function(a){this.fa.setUTCHours(a)};z.e.setUTCMinutes=function(a){this.fa.setUTCMinutes(a)};z.e.setUTCSeconds=function(a){this.fa.setUTCSeconds(a)};z.e.setUTCMilliseconds=function(a){this.fa.setUTCMilliseconds(a)}; z.e.add=function(a){Zh.prototype.add.call(this,a);a.od&&this.setUTCHours(this.fa.getUTCHours()+a.od);a.rd&&this.setUTCMinutes(this.fa.getUTCMinutes()+a.rd);a.vd&&this.setUTCSeconds(this.fa.getUTCSeconds()+a.vd)};z.e.iq=function(a,b){var c=Zh.prototype.iq.call(this,a);return a?c+" "+Ya(this.getHours(),2)+":"+Ya(this.getMinutes(),2)+":"+Ya(this.getSeconds(),2)+(b?bi(this):""):c+"T"+Ya(this.getHours(),2)+Ya(this.getMinutes(),2)+Ya(this.getSeconds(),2)+(b?bi(this):"")}; z.e.equals=function(a){return this.getTime()==a.getTime()};z.e.toString=function(){return this.iq()};z.e.clone=function(){var a=new ci(this.fa);a.cs=this.cs;a.ds=this.ds;return a};var ni=[/^\'(?:[^\']|\'\')*\'/,/^(?:G+|y+|M+|k+|S+|E+|a+|h+|K+|H+|c+|L+|Q+|d+|m+|s+|v+|V+|w+|z+|Z+)/,/^[^\'GyMkSEahKHcLQdmsvVwzZ]+/]; ii.prototype.format=function(a,b){if(!a)throw Error("The date to format must be non-null.");var c=b?6E4*(a.getTimezoneOffset()-(b.Ju-gi(b,a))):0,d=c?new Date(a.getTime()+c):a,f=d;b&&d.getTimezoneOffset()!=a.getTimezoneOffset()&&(d=new Date(d.getTime()+6E4*(d.getTimezoneOffset()-a.getTimezoneOffset())),f=new Date(a.getTime()+(c+(0=(0,window.parseInt)(b[1],10)?"nweb":"zhihu_web",3])};Li.FV=function(){var a=window._gaq;a.push(["_setAccount","UA-20961733-1"]);a.push(["_setDomainName",".zhihu.com"]);Li.rV();Li.oM()};Li.Qq=function(){var a=window.document.createElement("script");a.async=!0;a.src=("https:"===window.document.location.protocol?"https://ssl":"http://www")+".google-analytics.com/ga.js";var b=window.document.getElementsByTagName("script")[0];b.parentNode.insertBefore(a,b)}; Li.init=function(){Li.FV();Li.yV();Li.xW();Li.Qq()};var Fm;window.za=window.za||[];var yi=new Ph("za");yi.g(function(a){z.y(a,function(a){window.za.collect("event",a)})}); Fm=function(){var a=window.za=window.za||[];if(a.pR)return void(window.console&&window.console.error&&window.console.error("Zhihu Analytics snippet included twice."));a.pR=!0;a.methods=["init","collect","set","get"];a.factory=function(b){return function(){var c=Array.prototype.slice.call(arguments);return c.unshift(b),a.push(c),a}};for(var b=0;bc?"":0==c?";expires\x3d"+(new Date(1970,1,1)).toUTCString():";expires\x3d"+(new Date((0,z.I)()+1E3*c)).toUTCString();this.Ka.cookie=a+"\x3d"+b+f+d+c+g}; z.e.get=function(a,b){for(var c=a+"\x3d",d=(this.Ka.cookie||"").split(Zi),f=0,g;g=d[f];f++){if(0==g.lastIndexOf(c,0))return g.substr(c.length);if(g==a)return""}return b};z.e.remove=function(a,b,c){var d=this.Of(a);this.set(a,"",0,b,c);return d};z.e.ld=function(){return z.Yi(this).keys};z.e.Wc=function(){return z.Yi(this).values};z.e.Zg=function(){return!this.Ka.cookie};z.e.kb=function(){return this.Ka.cookie?(this.Ka.cookie||"").split(Zi).length:0};z.e.Of=function(a){return z.ka(this.get(a))}; z.e.Xh=z.aa(4);z.e.clear=function(){for(var a=z.Yi(this).keys,b=a.length-1;0<=b;b--)this.remove(a[b])};z.aj=new z.Xi(window.document);z.aj.KX=3950;$i();z.W={set:function(a,b){a.className=b},get:function(a){a=a.className;return z.pa(a)&&a.match(/\S+/g)||[]},add:function(a,b){var c=z.W.get(a),d=z.yb(arguments,1),f=c.length+d.length;z.W.Qq(c,d);z.W.set(a,c.join(" "));return c.length==f},remove:function(a,b){var c=z.W.get(a),d=z.yb(arguments,1),f=z.W.CF(c,d);z.W.set(a,f.join(" "));return f.length==c.length-d.length},Qq:function(a,b){for(var c=0;cthis.Ay)if(this.dispatchEvent(new uj("start",this,a.clientX,a.clientY,a)))this.mj=!0;else{this.Fd||this.Sr(a);return}}c=qj(this,b,c);b=c.x;c=c.y;this.mj&&this.dispatchEvent(new uj("beforedrag",this,a.clientX,a.clientY,a,b,c))&& (tj(this,a,b,c),a.preventDefault())}};z.e.Mt=function(a){var b=qj(this,0,0);a.clientX=this.clientX;a.clientY=this.clientY;tj(this,a,b.x,b.y)};z.e.Xw=function(a,b){this.Qi&&pj(this)?this.target.style.right=a+"px":this.target.style.left=a+"px";this.target.style.top=b+"px"};z.x(uj,z.Lc);var Im=z.C?'javascript:""':"about:blank";z.x(z.vj,z.G);z.vj.prototype.handleEvent=function(a){var b=new z.Pc(a.gc);b.type="focusin"==a.type||"focus"==a.type?"focusin":"focusout";this.dispatchEvent(b)};z.vj.prototype.D=function(){z.vj.o.D.call(this);z.nd(this.RR);z.nd(this.SR);delete this.h};z.x(xj,z.R);z.e=xj.prototype;z.e.Hx=null;z.e.sb=!1;z.e.Pc=null;z.e.zc=null;z.e.Pe=null;z.e.gw=!1;z.e.U=function(){return"goog-modalpopup"};z.e.zj=function(){return this.Pc};z.e.B=function(){xj.o.B.call(this);var a=this.m(),b=(0,z.ab)(this.U()).split(" ");z.ij(a,b);z.nf(a,!0);z.Q(a,!1);this.Fz();yj(this)}; z.e.Fz=function(){this.QW&&!this.zc&&(this.zc=this.K().B("iframe",{frameborder:0,style:"border:0;vertical-align:bottom;"+(z.pa(void 0)?(new z.Bd).wo(void 0).Sg():""),src:Im}),this.zc.className=this.U()+"-bg",z.Q(this.zc,!1),z.Jg(this.zc,0));this.Pc||(this.Pc=this.K().B("DIV",this.U()+"-bg"),z.Q(this.Pc,!1))};z.e.qJ=function(){this.gw=!1};z.e.Ob=function(a){return!!a&&"DIV"==a.tagName}; z.e.Y=function(a){xj.o.Y.call(this,a);a=(0,z.ab)(this.U()).split(" ");z.ij(this.m(),a);this.Fz();yj(this);z.nf(this.m(),!0);z.Q(this.m(),!1)};z.e.C=function(){this.zc&&z.af(this.zc,this.m());z.af(this.Pc,this.m());xj.o.C.call(this);z.bf(this.Pe,this.m());this.Hx=new z.vj(this.K().ua());this.v().g(this.Hx,"focusin",this.fp);zj(this,!1)};z.e.Hb=function(){this.V()&&this.G(!1);z.Cc(this.Hx);xj.o.Hb.call(this);z.P(this.zc);z.P(this.Pc);z.P(this.Pe)}; z.e.G=function(a){a!=this.sb&&(this.pk&&this.pk.stop(),this.Yk&&this.Yk.stop(),this.nk&&this.nk.stop(),this.Xk&&this.Xk.stop(),this.wa&&zj(this,a),a?this.mB():this.Rl())};z.e.NJ=function(a,b,c,d){this.pk=a;this.nk=b;this.Yk=c;this.Xk=d}; z.e.mB=function(){if(this.dispatchEvent("beforeshow")){try{this.Zl=this.K().ua().activeElement}catch(a){}this.OA();this.ha();this.v().g(this.K().Va(),"resize",this.OA);Aj(this,!0);this.focus();this.sb=!0;this.pk&&this.Yk?(z.ld(this.pk,"end",this.jg,!1,this),this.Yk.play(),this.pk.play()):this.jg()}}; z.e.Rl=function(){this.dispatchEvent("beforehide")&&(this.v().qa(this.K().Va(),"resize",this.OA),this.sb=!1,this.nk&&this.Xk?(z.ld(this.nk,"end",this.fm,!1,this),this.Xk.play(),this.nk.play()):this.fm(),this.uJ())};z.e.uJ=function(){try{var a=this.K(),b=a.ua().body,c=a.ua().activeElement||b;if(!this.Zl||this.Zl==b){this.Zl=null;return}(c==b||a.contains(this.m(),c))&&this.Zl.focus()}catch(d){}this.Zl=null};z.e.jg=function(){this.dispatchEvent("show")};z.e.fm=function(){Aj(this,!1);this.dispatchEvent("hide")}; z.e.V=function(){return this.sb};z.e.focus=function(){this.lF()};z.e.OA=function(){this.zc&&z.Q(this.zc,!1);this.Pc&&z.Q(this.Pc,!1);var a=this.K().ua(),b=z.Oe(z.Re(a)||window),c=Math.max(b.width,Math.max(a.body.scrollWidth,a.documentElement.scrollWidth)),a=Math.max(b.height,Math.max(a.body.scrollHeight,a.documentElement.scrollHeight));this.zc&&(z.Q(this.zc,!0),z.Fg(this.zc,c,a));this.Pc&&(z.Q(this.Pc,!0),z.Fg(this.Pc,c,a))}; z.e.ha=function(){var a=this.K().ua(),b=z.Re(a)||window;if("fixed"==z.yg(this.m()))var c=a=0;else c=z.vf(this.K()),a=c.x,c=c.y;var d=z.Hg(this.m()),b=z.Oe(b),a=Math.max(a+b.width/2-d.width/2,0),c=Math.max(c+b.height/2-d.height/2,0);z.zg(this.m(),a,c);z.zg(this.Pe,a,c)};z.e.fp=function(a){this.gw?this.qJ():a.target==this.Pe&&z.vd(this.lF,0,this)};z.e.lF=function(){try{z.C&&this.K().ua().body.focus(),this.m().focus()}catch(a){}}; z.e.D=function(){z.Cc(this.pk);this.pk=null;z.Cc(this.nk);this.nk=null;z.Cc(this.Yk);this.Yk=null;z.Cc(this.Xk);this.Xk=null;xj.o.D.call(this)};var ok,Mm,Nm,Om,Pm,Qm,Rm,Jm,Sm,Pj;z.x(z.Bj,xj);z.e=z.Bj.prototype;z.e.cF=!0;z.e.zy=!0;z.e.cm=!0;z.e.ix=!0;z.e.fr=.5;z.e.NB="";z.e.rc=null;z.e.Jb=null;z.e.ME=!1;z.e.zd=null;z.e.dd=null;z.e.Uu=null;z.e.yd=null;z.e.Ye=null;z.e.oc=null;z.e.qp="dialog";z.e.U=function(){return this.Rc};z.e.Na=function(a){this.NB=a;this.dd&&z.mf(this.dd,a)};z.e.ia=function(a){this.rc=a=z.Hd(a,null);this.Ye&&z.Fe(this.Ye,a)};z.e.Ua=z.aa(21);z.e.ki=function(){return this.qp};z.e.Du=z.aa(22);z.e.S=function(){z.Dj(this);return this.Ye}; z.e.gs=z.aa(24);z.e.fi=function(){z.Dj(this);return this.m()};z.e.zj=function(){z.Dj(this);return z.Bj.o.zj.call(this)};z.e.Op=function(a){a!=this.cm&&Hj(this,a)}; z.e.B=function(){z.Bj.o.B.call(this);var a=this.m(),b=this.K();this.zd=b.B("DIV",this.Rc+"-title",this.dd=b.B("SPAN",{className:this.Rc+"-title-text",id:this.de()},this.NB),this.yd=b.B("SPAN",this.Rc+"-title-close"));z.Ze(a,this.zd,this.Ye=b.B("DIV",this.Rc+"-content"),this.oc=b.B("DIV",this.Rc+"-buttons"));z.bj(this.dd,"heading");z.bj(this.yd,"button");z.nf(this.yd,!0);z.cj(this.yd,"label",Jm);this.Uu=this.dd.id;z.bj(a,this.ki());z.cj(a,"labelledby",this.Uu||"");this.rc&&z.Fe(this.Ye,this.rc);z.Q(this.yd, this.zy);this.pc&&(a=this.pc,a.h=this.oc,a.render());z.Q(this.oc,!!this.pc);Gj(this,this.fr)}; z.e.Y=function(a){z.Bj.o.Y.call(this,a);a=this.m();var b=this.Rc+"-content";this.Ye=z.Le(window.document,null,b,a)[0];this.Ye||(this.Ye=this.K().B("DIV",b),this.rc&&z.Fe(this.Ye,this.rc),a.appendChild(this.Ye));var b=this.Rc+"-title",c=this.Rc+"-title-text",d=this.Rc+"-title-close";(this.zd=z.Le(window.document,null,b,a)[0])?(this.dd=z.Le(window.document,null,c,this.zd)[0],this.yd=z.Le(window.document,null,d,this.zd)[0]):(this.zd=this.K().B("DIV",b),a.insertBefore(this.zd,this.Ye));this.dd?(this.NB= z.of(this.dd),this.dd.id||(this.dd.id=this.de())):(this.dd=z.O("SPAN",{className:c,id:this.de()}),this.zd.appendChild(this.dd));this.Uu=this.dd.id;z.cj(a,"labelledby",this.Uu||"");this.yd||(this.yd=this.K().B("SPAN",d),this.zd.appendChild(this.yd));z.Q(this.yd,this.zy);b=this.Rc+"-buttons";(this.oc=z.Le(window.document,null,b,a)[0])?(this.pc=new z.Oj(this.K()),this.pc.w(this.oc)):(this.oc=this.K().B("DIV",b),a.appendChild(this.oc),this.pc&&(a=this.pc,a.h=this.oc,a.render()),z.Q(this.oc,!!this.pc)); Gj(this,this.fr)};z.e.C=function(){z.Bj.o.C.call(this);this.v().g(this.m(),"keydown",this.jp).g(this.m(),"keypress",this.jp);this.v().g(this.oc,"click",this.GS);Ij(this,this.ix);this.v().g(this.yd,"click",this.AT);var a=this.m();z.bj(a,this.ki());""!==this.dd.id&&z.cj(a,"labelledby",this.dd.id);this.cm||Hj(this,!1)};z.e.Hb=function(){this.V()&&this.G(!1);Ij(this,!1);z.Bj.o.Hb.call(this)};z.e.G=function(a){a!=this.V()&&(this.wa||this.render(),z.Bj.o.G.call(this,a))}; z.e.jg=function(){z.Bj.o.jg.call(this);this.dispatchEvent(ok)};z.e.fm=function(){z.Bj.o.fm.call(this);this.dispatchEvent(z.pk);this.ME&&this.H()}; z.e.DV=function(){var a=this.K().ua(),b=z.Oe(z.Re(a)||window),c=Math.max(a.body.scrollWidth,b.width),a=Math.max(a.body.scrollHeight,b.height),d=z.Hg(this.m());"fixed"==z.yg(this.m())?this.Jb.lt=new z.qg(0,0,Math.max(0,b.width-d.width),Math.max(0,b.height-d.height))||new z.qg(window.NaN,window.NaN,window.NaN,window.NaN):this.Jb.lt=new z.qg(0,0,c-d.width,a-d.height)||new z.qg(window.NaN,window.NaN,window.NaN,window.NaN)};z.e.AT=function(){Jj(this)};z.e.Bf=function(a){this.ME=a}; z.e.D=function(){this.oc=this.yd=null;z.Bj.o.D.call(this)};z.e.GS=function(a){a:{for(a=a.target;null!=a&&a!=this.oc;){if("BUTTON"==a.tagName)break a;a=a.parentNode}a=null}if(a&&!a.disabled){a=a.name;var b=this.pc.get(a);this.dispatchEvent(new Kj(a,b))&&this.G(!1)}}; z.e.jp=function(a){var b=!1,c=!1,d=this.pc,f=a.target;if("keydown"==a.type)if(this.cF&&27==a.keyCode){var g=d&&d.yw,f="SELECT"==f.tagName&&!f.disabled;g&&!f?(c=!0,b=d.get(g),b=this.dispatchEvent(new Kj(g,b))):f||(b=!0)}else{if(9==a.keyCode&&a.shiftKey&&f==this.m()){this.gw=!0;try{this.Pe.focus()}catch(m){}z.vd(this.qJ,0,this)}}else if(13==a.keyCode){if("BUTTON"==f.tagName&&!f.disabled)g=f.name;else if(f==this.yd)Jj(this);else if(d){var h=d.Yw,k=h&&d.kf(h),f=("TEXTAREA"==f.tagName||"SELECT"==f.tagName|| "A"==f.tagName)&&!f.disabled;!k||k.disabled||f||(g=h)}g&&d&&(c=!0,b=this.dispatchEvent(new Kj(g,String(d.get(g)))))}else f==this.yd&&32==a.keyCode&&Jj(this);if(b||c)a.stopPropagation(),a.preventDefault();b&&this.G(!1)};z.x(Kj,z.Lc);z.Nj="dialogselect";z.pk="afterhide";ok="aftershow";z.x(z.Oj,z.Rd);z.e=z.Oj.prototype;z.e.Rc="goog-buttonset";z.e.Yw=null;z.e.h=null;z.e.yw=null;z.e.set=function(a,b,c,d){z.Rd.prototype.set.call(this,a,b);c&&(this.Yw=a);d&&(this.yw=a);return this}; z.e.Bd=function(a,b,c){return this.set(a.key,a.caption,b,c)};z.e.render=function(){if(this.h){z.Fe(this.h,Mj);var a=z.J(this.h);this.forEach(function(b,c){var d=a.B("BUTTON",{name:c},b);c==this.Yw&&(d.className=this.Rc+"-default");this.h.appendChild(d)},this)}};z.e.w=function(a){if(a&&1==a.nodeType){this.h=a;a=this.h.getElementsByTagName("BUTTON");for(var b=0,c,d,f;c=a[b];b++)if(d=c.name||c.id,f=z.of(c)||c.value,d){var g=0==b;this.set(d,f,g,c.name==z.Km);g&&z.hj(c,this.Rc+"-default")}}};z.e.m=function(){return this.h}; z.e.K=function(){return this.da};z.e.kf=function(a){for(var b=this.h.getElementsByTagName("BUTTON"),c=0,d;d=b[c];c++)if(d.name==a||d.id==a)return d;return null};z.Km="cancel";z.Lm={yg:"ok",Te:z.Km,Ag:"yes",Ih:"no",$i:"save",Zi:"continue"};Mm=z.u("OK");Nm=z.u("Cancel");Om=z.u("Yes");Pm=z.u("No");Qm=z.u("Save");Rm=z.u("Continue");Jm=z.u("Close");Sm={yg:Mm,Te:Nm,Ag:Om,Ih:Pm,$i:Qm,Zi:Rm}; Pj={yg:{key:"ok",caption:Sm.yg},Te:{key:z.Km,caption:Sm.Te},Ag:{key:"yes",caption:Sm.Ag},Ih:{key:"no",caption:Sm.Ih},$i:{key:"save",caption:Sm.$i},Zi:{key:"continue",caption:Sm.Zi}};"undefined"!=typeof window.document&&((new z.Oj).Bd(Pj.yg,!0,!0),z.Cj(),(new z.Oj).Bd(Pj.Ag,!0).Bd(Pj.Ih,!1,!0),(new z.Oj).Bd(Pj.Ag).Bd(Pj.Ih,!0).Bd(Pj.Te,!1,!0),(new z.Oj).Bd(Pj.Zi).Bd(Pj.$i).Bd(Pj.Te,!0,!0));(function(){var a=z.Ui||z.Vj,b=a&&window.navigator.userAgent.match(/OS\s(\w+)/)[1].slice(0,3).replace(/_/g,".");z.Tm="contentEditable"in window.document.documentElement&&!(a&&5>b)&&!(z.Wl&&3>window.navigator.userAgent.match(/Android (\d)/)[1]);var c=(0,window.$)(window.document.documentElement);z.Um="ontouchstart"in window;c.addClass(z.Uj?"mobile":"no-mobile");z.Vm=a&&6<=b||!z.Uj;"orientation"in window&&(a=function(){var a={0:"portrait",90:"landscape landscape-left","-90":"landscape landscape-right"}, b=a[window.orientation]||"";c.removeClass(z.Gb(a).join(" ")).addClass(b)},(0,window.$)(window).on("orientationchange",a),a())})();Sm={yg:"确定",Te:"取消",Ag:"是",Ih:"否",$i:"保存",Zi:"继续"};Pj={yg:{key:"ok",caption:Sm.yg},Te:{key:z.Km,caption:Sm.Te},Ag:{key:"yes",caption:Sm.Ag},Ih:{key:"no",caption:Sm.Ih},$i:{key:"save",caption:Sm.$i},Zi:{key:"continue",caption:Sm.Zi}};z.Cj=function(){return(new z.Oj).Bd(Pj.Te,!1,!0).Bd(Pj.yg,!0)};z.x(z.V,z.Bj);z.v("ZH.ui.Dialog",z.V);z.e=z.V.prototype;z.e.aL=null;z.e.C=function(){var a=!z.Um;this.ix=a;Ij(this,a&&this.wa);z.V.o.C.call(this);this.Wk&&z.Sj(this);z.Tj(this,this.aL)}; z.e.mR=z.Qj(function(){var a=z.Ug(),b=a/2,a=z.Ka("html.modal-open {overflow:hidden}html.modal-doc-overflow {margin-right:%spx}html.modal-doc-overflow .modal-translate-shifting.sticky {transition-property:none; transform:translateX(-%spx)}html.modal-doc-overflow .modal-shifting {position:relative; right:%spx}",a,b,b);z.Lg(a)});z.e.vm=z.aa(25); z.e.ha=function(){if(!this.cm||!window.Modernizr.flexbox)if(z.V.o.ha.call(this),!this.oF){var a=(0,window.$)(this.m()),b=(0,window.$)(window).scrollTop();if(!z.Uj||z.Vj)var c=(0,window.parseInt)(a.css("top").slice(0,-2)),b="-\x3d"+Math.min(c-b,60)+"px";a.add(this.Pe).css("top",b)}};z.e.focus=function(){z.Uj&&!z.Vj||z.V.o.focus.call(this)};z.V.prototype.setTitle=z.V.prototype.Na;z.V.prototype.setModal=z.V.prototype.Op;z.V.prototype.setDisposeOnHide=z.V.prototype.Bf;z.V.prototype.setVisible=z.V.prototype.G; z.V.prototype.getContentElement=z.V.prototype.S;z.V.prototype.getDialogElement=z.V.prototype.fi;z.V.prototype.listen=z.V.prototype.g;z.v("ZH.dialog",z.X);z.X.confirm=Wj(function(a,b,c,d){var f={buttons:{yes:"确认",cancel:"取消"}},g=void 0;z.ta(a)?(g=a,c=b):g={title:a,content:b};window.$.extend(!0,f,g);return z.X(f,(c||z.p).bind(d))});z.X.confirm=z.X.confirm;z.X.alert=Wj(function(a,b){var c={title:"提示信息",buttons:{yes:"确定"}};z.ta(a)?Object.assign(c,a):c.content=a;return z.X(c,b)});z.X.alert=z.X.alert; z.X.message=Wj(function(a,b,c){if(a){var d=z.X({title:c||"提示信息",content:z.Ma(a),buttons:{}});(0,window.setTimeout)(function(){d.G(!1)},b||2E3);return d}});z.X.async=function(a){var b=window.$.extend({},{title:"信息",ZJ:"加载中",buttons:{},onload:z.p},a),c=z.O("div",{className:"modal-dialog-async-loading",innerHTML:(b.ZJ||"加载中")+'\x3ci class\x3d"spinner-gray"\x3e\x3c/i\x3e'}),d=z.X(b);d.S().appendChild(c);b.Iw&&b.Iw.then(function(a){z.P(c);d.Fd||(a&&d.ia(a),d.ha(),b.onload(d.S(),d))});return d};z.x(z.Xj,z.G);z.Xj.prototype.v=function(){return this.pf||(this.pf=new z.xd(this))};z.Xj.prototype.Pg=z.aa(26);z.x(Yj,z.Xj);Yj.prototype.init=function(){if(this.h=z.L("zh-global-message"))this.UH=z.N("zu-global-notify-msg",this.h),this.v().g(this.h,"click",this.Qa)};Yj.prototype.Qa=function(a){a.target&&a.target.name&&z.Q(this.h,!1)};Yj.prototype.fireEvent=function(a){this.dispatchEvent(a)};z.x(z.Zj,z.Lc);z.Y=new Yj;z.Y.init();z.v("ZH.i",function(a){z.Y.dispatchEvent(new z.Zj("iframe_data",a))});z.v("ZH.cm",function(a,b){z.Y.dispatchEvent(new z.Zj(a,b))});z.x(z.dk,z.R);z.e=z.dk.prototype;z.e.Y=function(a){z.dk.o.Y.call(this,a);this.Da=(0,window.$)(a).parents("form")}; z.e.C=function(){z.dk.o.C.call(this);this.W=(0,window.$)(this.m());this.Kk=(0,window.$)("img",this.W);this.Xi=(0,window.$)('input[name\x3d"captcha"]',this.W);this.mL=(0,window.$)(".Captcha-imageConatiner",this.W);this.tL=(0,window.$)(".Captcha-prompt",this.W);this.Nm="cn"===this.W.data("type");fk(this);this.W.on("click",".js-refreshCaptcha",this.ju.bind(this,!0));this.XJ=!this.Nm;this.Nm&&(this.Kk.on("click",this.aS.bind(this)),this.W.on("click",".Captcha-mark",this.GW.bind(this)),this.qG=this.GQ.bind(this), this.Da.on("input","input",this.qG))}; z.e.aS=function(a){this.trackEvent("Select","Icon");if(7===(0,window.$)(".Captcha-mark",this.W).length)this.Da.data("validator").showErrors({captcha:"最多只能选择 7 个点"});else{gk(this);var b=this.Kk.offset(),c=a.pageX-b.left-this.Hz;a=a.pageY-b.top-this.Hz;(0,window.$)("\x3cspan /\x3e",{"class":"Captcha-mark sprite-index-icon-delete"}).css({left:c,top:a}).appendTo(this.mL).mouseenter(function(){(0,window.$)(this).addClass("sprite-index-icon-delete").removeClass("sprite-index-icon-mark")}).mouseleave(function(){(0,window.$)(this).addClass("sprite-index-icon-mark").removeClass("sprite-index-icon-delete")});ek(this)}}; z.e.GW=function(a){this.trackEvent("Unselect","Icon");gk(this);(0,window.$)(a.target).remove();ek(this)};z.e.ju=function(a){a&&this.trackEvent("Click","Button");this.trackEvent("Refresh","Image");this.pb=(0,z.I)().toString();a=(new z.vh).add("r",this.pb);"login"===this.Xb&&a.add("type","login");this.Nm&&a.add("lang","cn");var b=th(new z.ph(this.$B),a);fk(this);this.Kk.fadeOut(200,function(){(0,window.$)(this).attr("src",b.toString()).fadeIn(200)})}; z.e.GQ=function(){this.Nm&&0===this.Da.serializeArray().filter(function(a){return"captcha"!==a.name&&""===window.$.trim(a.value)}).length&&(this.Da.off("input","input",this.qG),this.XJ=!0,z.hk(this))};z.e.info=function(){return"1"===z.aj.get("login"===this.Xb?"l_n_c":"n_c")?{captcha:{type:this.Nm?"Chinese":"English",id:this.pb}}:{}};z.e.trackEvent=function(a,b){var c=this.info();"show"===a?(0,z.Gm)(this,{element:b},c):(0,z.Gi)(this,{action:a,element:b},c)};var kk="closure_memoize_cache_";var Wm=(0,z.q)(window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.msRequestAnimationFrame||function(a){return window.setTimeout(a,1E3/60)},window);window.$.easing.easeOutCubic=function(a,b,c,d,f){return d*((b=b/f-1)*b*b+1)+c}; (function(a){window.$.fn.onTransitionEnd=function(b,c){(0,window.$)(this).one(a,b).emulateTransitionEnd(c);return this};window.$.fn.emulateTransitionEnd=function(b){var c=!1,d=this;(0,window.$)(this).one(a,function(){c=!0});(0,window.setTimeout)(function(){c||(0,window.$)(d).trigger(a)},b);return this}})({WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd",msTransition:"MSTransitionEnd",transition:"transitionend"}[window.Modernizr.prefixed("transition")|| "transition"]); (function(a){window.$.fn.onAnimationEnd=function(b,c){(0,window.$)(this).one(a,b).emulateAnimationEnd(c);return this};window.$.fn.emulateAnimationEnd=function(b){var c=!1,d=this;(0,window.$)(this).one(a,function(){c=!0});(0,window.setTimeout)(function(){c||(0,window.$)(d).trigger(a)},b);return this}})({WebkitAnimation:"webkitAnimationEnd",MozAnimation:"mozAnimationEnd",OAnimation:"oanimationend",msAnimation:"MSAnimationEnd",animation:"animationend"}[window.Modernizr.prefixed("animation")||"animation"]); window.$.fn.ie=function(){var a={},b=this.serializeArray();window.$.each(b,function(){a[this.name]?(a[this.name].push||(a[this.name]=[a[this.name]]),a[this.name].push(this.value||"")):a[this.name]=this.value||""});return a};z.x(lk,z.G);lk.prototype.play=function(){var a=this;Wm(function(){a.W.toggleClass(a.tW)});if(window.Modernizr.csstransitions)a.W.onTransitionEnd(function(){a.dispatchEvent("end")},a.duration);else a.dispatchEvent("end")};lk.prototype.stop=z.p;z.l(mk,z.V);z.e=mk.prototype;z.e.B=function(){z.V.prototype.B.call(this);z.Dj(this);this.Se=(0,window.$)(this.zd);this.Oc=(0,window.$)(this.S());(0,window.$)(z.Fj(this)).addClass("z-ico-close");this.zq=(0,window.$)('\x3cspan class\x3d"mutiview-dialog-title-back z-ico-left"\x3e\x3c/span\x3e').appendTo(this.Se)}; z.e.C=function(){z.V.prototype.C.call(this);this.zq.click(window.$.proxy(this.RV,this));var a=this.m(),b=this.zj();(0,window.$)(a).addClass(this.RT);this.NJ(new lk(a,"show",300),new lk(a,"show",300),new lk(b,"show",300),new lk(b,"show",300))}; z.e.ia=function(a,b){z.V.prototype.ia.call(this,a);(0,window.$)(".title",this.Oc).replaceAll(Ej(this));var c=(0,window.$)(".title",this.Se).addClass("right"),d=(0,window.$)(".view",this.Oc).addClass("right");b?(this.Jk=(0,window.$)(".title."+b,this.Se),this.Ui=(0,window.$)(".view."+b,this.Oc)):(this.Jk=c.first(),this.Ui=d.first());this.Jk.removeClass("right");this.Ui.removeClass("right")}; z.e.RV=function(){var a=this.Ui,b=this.Jk,c=this.VI.pop(),d=this.UI.pop();c.length&&d.length&&(rk(this),c.css("visibility","visible").removeClass(" left"),d.css("visibility","visible").removeClass("left"),a.addClass("right").onTransitionEnd(function(){a.css("visibility","hidden")},300),b.addClass("right").onTransitionEnd(function(){b.css("visibility","hidden")},300),this.Ui=c,this.Jk=d,sk(this,this.sD.pop()),this.Pt())};z.e.Pt=function(){};window.$.fn.placeholder=function(a){return this.each(function(){var b=(0,window.$)(this),c=b.data("placeholder");c||b.data("placeholder",c=new z.vk(this,a));c.check()})};z.xk="placeholder"in window.document.createElement("input");z.e=z.vk.prototype;z.e.defaults={text:"",offsetParent:null,pD:!1};z.e.kN=["paddingBottom","paddingTop","paddingLeft","paddingRight"]; z.e.wk=function(a){var b=this.input,c=this.J;c.text=a||"";z.xk?(Ak(b)||z.cj(b,"label",c.text),b.setAttribute("placeholder",c.text)):z.mf(this.label,c.text)};z.e.H=function(){this.Tg&&(this.Tg.removeAll(),this.Tg.H());z.P(this.label);this.label=null};z.e.offsetParent=function(){return this.J.offsetParent||this.input.offsetParent}; z.e.check=function(){if(!z.xk)if(this.Zg()&&z.Kg(this.input)){this.show();var a=this.input,b=z.Sg(a),c=this.label,d=z.Cg(a,this.offsetParent());z.rg(c,{left:d.x+b.left+"px",top:d.y+b.top+"px",width:Bk(a,"width"),fontSize:Bk(a,"fontSize"),lineHeight:Bk(a,"lineHeight"),fontFamily:Bk(a,"fontFamily")});this.offsetParent().appendChild(c)}else this.hide()};z.e.show=function(){this.label&&z.Q(this.label,!0)};z.e.hide=function(){this.label&&z.Q(this.label,!1)};z.e.Zg=function(){return!this.input.value}; z.e.position=function(){z.y(this.kN,function(a){this.label.style[a]=Bk(this.input,a)},this)};z.Ym={EG:function(){var a=this,b=this.m(),c=(0,window.$)(".js-show-sns-buttons",b);c.click(function(){c.onTransitionEnd(function(){c.css("visibility","hidden")},250).removeClass("is-visible").next(".sns-buttons").addClass("is-visible")});(0,window.$)("button.weibo",b).click(function(){a.na({category:"sign_in_or_sign_up",action:"click_sign_with_weibo_start"});z.ak("sina")});(0,window.$)("button.qq",b).click(function(){a.na({category:"sign_in_or_sign_up",action:"click_sign_with_qq_start"});z.ak("qq")}); (0,window.$)("button.wechat",b).click(function(){a.na({category:"sign_in_or_sign_up",action:"click_sign_with_wechat_start"});z.ak("wechat")})},na:function(a){this.Hf&&!a.label&&(a.label=this.Hf);this.dispatchEvent(window.$.extend({type:"trackRequested"},a))&&z.xi(a)},mI:function(a){var b=(0,window.$)("form",this.m());(0,window.$)(":submit",b).click(function(){a(b.ie())});(0,window.$)("keydown",b).click(function(c){13===c.keyCode&&a(b.ie())})},De:function(a,b){var c=(0,window.$)(".submit",a);a.validate(window.$.extend({}, z.Xm,{submitHandler:z.uk(c,window.$.proxy(b,this))}));this.Da=a},getData:function(){return this.Da.ie()},showErrors:function(a){this.Da.data("validator").showErrors(a)},Ss:function(a){a=(0,window.$)(".input-wrapper.toggle-password",a);var b=(0,window.$)("input",a),c=(0,window.$)(".z-ico-show-password",a);c.click(function(){"password"===b.prop("type")?(c.addClass("z-ico-hide-password"),b.prop("type","text")):(c.removeClass("z-ico-hide-password"),b.prop("type","password"))})},Rs:function(a,b){var c= z.tk(a,60,function(a){return a?"%s 秒后重发":"重发验证码"},window.$.proxy(b,this),!0);z.Ac(this,c);return c},sl:function(){var a=this;z.xk||(0,window.setTimeout)(function(){(0,window.$)("input[placeholder]:visible",a.Oc).placeholder()},10)},Od:function(){this.dispatchEvent("beforeredirect");var a=(new z.ph(window.location.href)).ze().get("next");a?window.location.href=a:window.location.reload()},rf:function(a){return!/^\+?[0-9]+$/.test(a)},wb:function(a,b,c){a[b]&&(a[c]=a[b],delete a[b])},bd:function(a){this.Hf= a},oq:function(a){var b=[this.getParent(),this].find(function(a){return a instanceof mk});b?nk(b,a):a.G(!0)}}; z.Xm={ignore:".is-ignoreValidation",onkeyup:!1,onfocusout:!1,validClass:"",focusInvalid:!1,highlight:z.p,messages:{fullname:{required:"请填写姓名"},invitation_code:{required:"请填写邀请码"},account:{required:z.Hk?"请填写邮箱":"请填写手机号或邮箱"},agreement:{required:"请勾选并同意协议"},phone_num:{required:"请填写手机号"},email:{required:"请填写邮箱"},password:{required:"请填写密码"},verification_code:{required:"请填写验证码"}},errorPlacement:function(a,b){if(!b.next(".error").length){var c=b.prop("name");"captcha"===c&&Wm(function(){b.nextAll(".Captcha-prompt").addClass("is-hidden")}); "agreement"===c?b.parents(".agreement").find(".error").remove().end().append('\n \x3cdiv class\x3d"error"\x3e'+a.text()+"\x3c/div\x3e\n ").find("input").focus():a.insertAfter(b).click(function(){a.prev("input").focus()});Wm(function(){a.addClass("is-visible")});b.one("focus",function(){a.onTransitionEnd(function(){a.remove()},300).removeClass("is-visible")});if("password"===b.prop("name"))b.one("focus",function(){"password"===b.prop("type")&&(b.select(),b.off("mousedown mouseup").one("mouseup", function(a){a.preventDefault()}).one("mousedown",function(){b.off("mouseup")}))})}},showErrors:function(a,b){var c=(0,window.$)("label.error",this.currentForm);c.addClass("highlighted");(0,window.setTimeout)(function(){c.removeClass("highlighted")},30);var d=this;b.length&&window.$.each(b,function(a,b){var c=(0,window.$)(b.element),k=b.message,m=(0,window.$)('\x3clabel class\x3d"error"\x3e'+k+"\x3c/label\x3e");"该邮箱已注册"!==k&&"该手机号已注册"!==k||(0,window.$)('\x3cspan\x3e · \x3c/span\x3e\x3ca class\x3d"switch-to-login" href\x3d"javascript:;"\x3e直接登录\x3c/a\x3e').appendTo(m); Wm(function(){d.settings.errorPlacement(m,c)})})}};z.l(z.Ck,mk);z.Ck.prototype.C=function(){mk.prototype.C.call(this);this.sl()};z.Ck.prototype.show=function(){var a=this;Zm().then(function(){a.G(!0)})};z.Ck.prototype.Pt=function(){mk.prototype.Pt.call(this);this.sl()};var Zm=z.ik(function(){if(z.T.Fb())throw Error("Logged in user should not call ZH.ui.SignDialog.prefetchTemplate");return window.$.get("/node/Register",{params:{is_org_page:z.Hk}})});z.Ca(z.Ck.prototype,z.Ym);(0,window.$)(function(){z.T.Fb()||Zm().then(function(a){(0,window.$)(a).appendTo("body")})});z.l(z.Dk,z.Ck);z.Dk.prototype.B=function(){z.Ck.prototype.B.call(this);this.ia((0,window.$)(".login-sms-verification-template").html())};z.Dk.prototype.C=function(){z.Ck.prototype.C.call(this);this.De((0,window.$)("form",this.h),this.submit);var a=this.options.data.phone_num;(0,window.$)('input[name\x3d"phone_num"]',this.h).val(a.slice(0,-8)+"****"+a.slice(-4));Ek(this)}; z.Dk.prototype.submit=function(){var a=this,b=Object.assign({},this.options.data,this.getData());return window.$.post("/login/two_step_verification/sms",b,function(b){b.r?(b=b.data,b.password?a.options.Um?(b=new a.options.Um({data:{account:a.options.data.phone_num,password:a.options.data.password},bF:b}),b.Db(a),a.oq(b)):(a.options.hT(b),a.G(!1)):a.showErrors(b)):(a.na({wc:!0,category:"sign_in",action:"sign_in_success_phone"}),a.Od())})};z.Ca(z.Dk.prototype,z.Ym);z.x(z.Fk,z.Ck);z.e=z.Fk.prototype;z.e.B=function(){z.Fk.o.B.call(this);this.ia((0,window.$)(".unable-login-template").html())}; z.e.C=function(){z.Fk.o.C.call(this);this.yv=(0,window.$)(".view.reset-password-verification",this.Oc);this.CC=(0,window.$)(".title.reset-password-verification",this.Se);var a=(0,window.$)("form",this.yv);this.De(a,this.mT);this.fw&&(0,window.$)('input[name\x3d"account"]',a).val(this.fw);a=(0,window.$)(".captcha-module",a).get(0);this.pu=new z.dk;this.pu.w(a);Ik(this);this.lv=(0,window.$)(".view.sms-login-verification",this.Oc);this.jL=(0,window.$)(".title.sms-login-verification",this.Se);a=(0,window.$)("form", this.lv);this.De(a,this.oT);(0,window.$)('input[name\x3d"phone_num"]',a).val(this.fw);a=(0,window.$)(".captcha-module",this.lv).get(0);this.Iv=new z.dk;this.Iv.w(a);Jk(this);Gk(this)}; z.e.mT=function(a){var b=this,c=(0,window.$)(a);a=c.ie();(0,window.$)('input[name\x3d"account"]',this.Jq).val(a.account);var d=this.rf(a.account),f=d?"/send_login_verification_code/email":"/send_login_verification_code/sms";d?this.wb(a,"account","email"):this.wb(a,"account","phone_num");a.is_org_page=z.Hk;(0,window.$)('input[name\x3d"verification_code"]',this.Jq).attr("placeholder",d?"邮箱收到的 6 位数验证码":"手机收到的 6 位数验证码");return window.$.get(f,a,function(a){a.r?200001===a.errcode?(a='机构帐号\x3cspan\x3e · \x3c/span\x3e\x3ca href\x3d"/org/signin"\x3e点此找回\x3c/a\x3e', z.Hk&&(a='用户帐号\x3cspan\x3e · \x3c/span\x3e\x3ca href\x3d"/signin"\x3e点此找回\x3c/a\x3e'),c.data("validator").showErrors({account:a})):(z.hk(b.pu),c.data("validator").showErrors(a.data)):(qk(b,!0,this.Jq,this.wL),b.WU.start())})}; z.e.nT=function(a){var b=this,c=(0,window.$)(a);a=c.ie();var d=this.rf(a.account),f=d?"/reset_password/email":"/reset_password/phone_num";d?this.wb(a,"account","email"):this.wb(a,"account","phone_num");return window.$.post(f,a,function(a){a.r?c.data("validator").showErrors(a.data):b.Od()})}; z.e.oT=function(a){var b=this,c=(0,window.$)(a);return window.$.get("/send_login_verification_code/sms",c.serialize(),function(a){a.r?(z.hk(b.Iv),a=a.data,b.wb(a,"account","phone_num"),c.data("validator").showErrors(a)):(a=(0,window.$)('input[name\x3d"phone_num"]',c).val(),(0,window.$)('input[name\x3d"phone_num"]',this.mv).val(a),qk(b,!0,this.mv,this.iL),b.TL.start())})}; z.e.pT=function(a){var b=this,c=(0,window.$)(a);return window.$.post("/login/sms_code",c.serialize(),function(a){a.r?(a=a.data,b.wb(a,"account","phone_num"),c.data("validator").showErrors(a)):b.Od()})};z.x(z.Kk,z.Ck);z.Kk.prototype.B=function(){z.Kk.o.B.call(this);var a=(0,window.$)(".oauth-register-template").html(),b=this.wh.status;"bound"===b?this.ia(a,"bound"):"registered"===b?this.ia(a,"registered"):this.ia(a,"register")};z.Kk.prototype.C=function(){z.Kk.o.C.call(this);Lk(this);Mk(this);Nk(this);Ok(this);var a=this;this.Oc.on("click","button.bind-login",function(){qk(a,!0,a.nv,a.kL)}).on("click","button.register",function(){qk(a,!0,a.Kf,a.uL)})}; z.Kk.prototype.lp=function(a){var b=this,c=(0,window.$)(a);b.na({wc:!0,category:"sign_up",action:"sign_up_front_end_pass_"+Pk(b)});return window.$.post("/register/sns",c.serialize(),function(a){a.r?(z.hk(b.Bc),c.data("validator").showErrors(a.data)):(b.na({wc:!0,category:"sign_up",action:"sign_up_success_"+Pk(b)}),b.Od())})}; z.Kk.prototype.ES=function(a){var b=this,c=(0,window.$)(a);b.na({wc:!0,category:"sign_in",action:"sign_in_front_end_pass_"+Pk(b)});return window.$.post("/login/bind",c.serialize(),function(a){a.r?c.data("validator").showErrors(a.data):(b.na({wc:!0,category:"sign_in",action:"sign_in_success_"+Pk(b)}),b.Od())})};z.l(z.Qk,z.R);z.e=z.Qk.prototype;z.e.C=function(){z.R.prototype.C.call(this);this.hc();this.so()}; z.e.hc=function(){var a=this.m(),b=this.Da=(0,window.$)("form",a);this.De(b,this.bA);this.Ss(b);this.EG();var c=(0,window.$)(".captcha-module",a).get(0);this.Bc=new z.dk("login");this.Bc.w(c);z.hk(this.Bc);var d=this,f=(0,window.$)("input.account",b);(0,window.$)("button.unable-login",a).click(function(){var a=new z.Fk(f.val());d.oq(a)});this.options.data&&(a=this.options.data.account,c=this.options.data.password,a&&f.val(a),c&&(0,window.$)("[name\x3dpassword]",b).val(c));this.options.bF&&this.showErrors(this.options.bF); this.mI(function(a){a=a.account;var b=d.rf(a);d.na({category:"sign_in",action:a?"click_sign_in_submit_"+(b?"email":"phone"):"click_sign_in_submit_no_channel"})})}; z.e.bA=function(){var a=this,b=this.getData(),c=this.rf(b.account);this.na({wc:!0,category:"sign_in",action:"sign_in_front_end_pass_"+(c?"email":"phone")});var d=c?"/login/email":"/login/phone_num";c?this.wb(b,"account","email"):this.wb(b,"account","phone_num");return window.$.post(d,b,function(d){if(d&&d.r){var g=d.errcode;1991831===g?(d=new z.Dk({data:{phone_num:b.phone_num,password:b.password},Um:a.options.Um}),d.Db(a),a.oq(d)):200001===g?(d='机构帐号\x3cspan\x3e · \x3c/span\x3e\x3ca href\x3d"/org/signin"\x3e点此登录\x3c/a\x3e', z.Hk&&(d='个人帐号\x3cspan\x3e · \x3c/span\x3e\x3ca href\x3d"/signin"\x3e点此登录\x3c/a\x3e'),a.showErrors({account:d})):(z.hk(a.Bc),a.showErrors(d.data))}else a.na({wc:!0,category:"sign_in",action:"sign_in_success_"+(c?"email":"phone")}),a.Od()})};z.e.so=function(){z.ck(this.v(),this.Uz)};z.e.Uz=function(a){a=a.xf;1===a.login?this.Od():(a=new z.Kk(a),a.bd(this.Hf),this.oq(a))};z.Ca(z.Qk.prototype,z.Ym);z.l(z.Rk,z.Ck);z.Rk.prototype.B=function(){z.Ck.prototype.B.call(this);this.ia((0,window.$)(".login-template").html())};z.Rk.prototype.C=function(){z.Ck.prototype.C.call(this);var a=new z.Qk(Object.assign({Um:z.Rk},this.options));this.L(a);a.bd(this.Hf);a.w(this.S());this.na({category:"sign_in",action:"popup_sign_in_box_appear"})};z.Ca(z.Rk.prototype,z.Ym);z.x(z.Sk,z.xc); z.Sk.prototype.start=function(){if(!this.Io){this.Io=!0;this.ke={};var a=z.Oe();this.ke.viewport=[a.width,a.height,(0,z.I)()];var b=[],c=0,d=0;(0,window.$)(window.document).on("mousemove.recording",function(a){c=a.clientX;d=a.clientY});var f=this,g=function(){(0,window.setTimeout)(function(){150<=b.length&&b.shift();b.push([c,d,(0,z.I)()]);f.Io&&g()},500)};g();this.ke.trace=b;var h={};this.tv.on("keydown.recording keyup.recording mouseenter.recording mouseleave.recording click.recording","input", function(a){var b=a.target.name,c=h[b];c||(c=h[b]={mouse:[],keyborad:[]});"mouseenter"===a.type||"mouseleave"===a.type||"click"===a.type?c.mouse.push([a.type,a.offsetX,a.offsetY,(0,z.I)()]):"password"===b?c.keyborad.push([a.type,(0,z.I)()]):c.keyborad.push([a.type,a.keyCode,(0,z.I)()])});h.submit=[];this.tv.on("mousedown.recording mouseenter.recording mouseleave.recording",":submit",function(a){h.submit.push([a.type,a.offsetX,a.offsetY,(0,z.I)()])});this.ke.register=h}}; z.Sk.prototype.stop=function(){this.Io&&(this.Io=!1,(0,window.$)(window.document).off(".recording"),this.tv.off(".recording"));return this.ke};z.Sk.prototype.D=function(){z.Sk.o.D.call(this);this.stop();this.ke=null};z.l(z.Tk,z.R);z.e=z.Tk.prototype;z.e.C=function(){z.R.prototype.C.call(this);this.We();this.so()}; z.e.We=function(){var a=this.m(),b=(0,window.$)("form",a);this.xh=!(0,window.$)('input[name\x3d"phone_num"]',b).length;this.De(b,this.lp);this.Ss(b);this.EG();a=(0,window.$)(".captcha-module",a).get(0);this.Bc=new z.dk;this.Bc.w(a);z.hk(this.Bc);this.Mm=new z.Sk(b);this.Mm.start();z.Ac(this,this.Mm);var c=this;this.mI(function(a){a=a.phone_num||a.account;var b=c.xh?c.rf(a):!1;c.na({category:"sign_up",action:a||!c.xh?"click_sign_up_submit_"+(b?"email":"phone"):"click_sign_up_submit_no_channel"})})}; z.e.lp=function(a){var b=this;a=(0,window.$)(a);var c=a.data("validator"),d=a.ie();a=b.xh?this.rf(d.account):!1;b.na({wc:!0,category:"sign_up",action:"sign_up_front_end_pass_"+(a?"email":"phone")});var f=a?"/register/email":"/register/phone_num/validation";a?this.wb(d,"account","email"):this.wb(d,"account","phone_num");var g=this.Mm.stop();d.userInfo=JSON.stringify(g);return a?window.$.post(f,d,function(a){a.r?(z.hk(b.Bc),c.showErrors(a.data)):(b.na({wc:!0,category:"sign_up",action:"sign_up_success_email"}), b.qg&&Li.Im("sign_up","sign_up_success",b.qg),b.Od())}):window.$.post(f,d,function(a){a.r?(z.hk(b.Bc),b.xh||b.wb(a.data,"account","phone_num"),c.showErrors(a.data)):b.dispatchEvent({type:"success",data:d})})};z.e.so=function(){z.ck(this.v(),this.Uz)};z.e.Uz=function(a){a=a.xf;var b={qqconn:"qq",wechat:"wechat",sina:"weibo"}[a.type];1===a.login?(this.na({wc:!0,category:"sign_in",action:"sign_in_success_"+b}),this.Od()):(a=new z.Kk(a),a.Db(this),a.bd(this.Hf),this.oq(a))};z.Ca(z.Tk.prototype,z.Ym);z.l(z.Uk,z.R);z.Uk.prototype.C=function(){z.R.prototype.C.call(this);this.We();this.v().g(this,"hide",this.RD)}; z.Uk.prototype.We=function(){var a=(0,window.$)("form",this.m());this.De(a,this.iT);var b=(0,window.$)(".send-code",a),c=(0,window.$)('input[name\x3d"phone_num"]',a);this.ma=this.Rs(b,function(){var b=c.val(),f=this;window.$.get("/send_register_verification_code/sms",window.$.param({phone_num:b}),function(b){b.r&&(b=b.data,f.wb(b,"account","phone_num"),a.data("validator").showErrors(b))})});c.val(this.Sn.phone_num);window.$.get("/send_register_verification_code/sms",{phone_num:this.Sn.phone_num}); this.ma.start()};z.Uk.prototype.iT=function(a){var b=this,c=(0,window.$)(a);a=window.$.extend({},this.Sn,c.ie());return window.$.post("/register/phone_num",a,function(a){a.r?(a=a.data,b.wb(a,"account","phone_num"),c.data("validator").showErrors(a)):(b.na({wc:!0,category:"sign_up",action:"sign_up_success_phone"}),b.qg&&Li.Im("sign_up","sign_up_success",b.qg),b.Od())})};z.Ca(z.Uk.prototype,z.Ym);z.l(z.Vk,z.Ck);z.e=z.Vk.prototype;z.e.B=function(){z.Ck.prototype.B.call(this);this.ia((0,window.$)(".register-template").html()+(0,window.$)(".phone-verification-template").html())};z.e.C=function(){z.Ck.prototype.C.call(this);Wk(this);this.v().g(this,"hide",this.RD);this.v().g(this,"beforeredirect",this.CU);this.na({category:"sign_up",action:"popup_sign_up_box_appear"});this.qg&&Li.track("sign_up","show_sign_up_dialog",this.qg)};z.e.Lp=z.aa(27);z.e.RD=function(){this.hj="";$i()}; z.e.CU=function(){var a=this.hj;a?z.aj.set("actioncontinuationhash",(0,window.encodeURIComponent)(a),60,"/"):$i()};z.Ca(z.Vk.prototype,z.Ym);z.x(Xk,z.G);var Zk={};Xk.prototype.defaults={};Xk.prototype.v=function(){return this.Tg||(this.Tg=new z.xd(this))};Xk.prototype.init=function(){};Xk.prototype.D=function(){Xk.o.D.call(this);this.view&&(z.Kb(this.view.Rb,this.name),this.view=null);this.Tg&&(this.Tg.H(),this.Tg=null)};z.x(z.al,z.R);z.e=z.al.prototype;z.e.defaults={source:null,use:["autoload","shortcut"],Ef:!0,qn:"zg-btn-white zu-button-more"};z.e.use=function(a,b){var c=$k(a,b);c.view=this;this.wa?c.init(this):this.v().g(this,"initialized",function(){c.init(this)});this.Rb[a]=c;return this};z.e.Zh=function(){!this.Ac&&this.J.Ef&&(this.Ac=this.pn(),z.bf(this.Ac,this.h),this.v().g(this.Ac,"click",this.ti))};z.e.C=function(){z.al.o.C.call(this);this.Zh();z.y(this.gb(),this.Br,this);z.y(this.J.use,this.use,this);this.dispatchEvent("initialized")}; z.e.D=function(){z.Db(this.Rb,function(a){a.H()});this.Rb=null;this.Ac&&(z.P(this.Ac),this.Ac=null);z.al.o.D.call(this)};z.e.gb=function(){return z.ef(this.h)};z.e.Br=function(a,b){this.Kt(a,b);this.dispatchEvent({type:"itemcreated",item:a,index:b})};z.e.Kt=z.p;z.e.YS=function(a){if(a){var b=a.results,c=!b||!b.length;c||this.render(b);this.dispatchEvent("next");(c||!1===a.next)&&cl(this)}}; z.e.render=function(a,b){a=window.$.isArray(a)?a.join(""):a;var c=z.We(a+" ");z.y(window.$.makeArray(z.ef(c)),this.Br,this);z.cf(this.h,c,b)};z.e.ti=function(){if(!1!==this.dispatchEvent("beforeloadnext")&&!this.Ho())return this.Hu(!0),this.promise=this.source().done((0,z.q)(this.YS,this)).always((0,z.q)(z.Ba(this.Hu,!1),this))};z.e.Ho=function(){return this.promise&&"pending"===this.promise.state()};z.e.kf=function(){return this.Ac}; z.e.pn=function(){return z.O("a",{"aria-role":"button","class":this.J.qn},"更多")};z.e.Hu=function(a){this.Ac&&(this.Ac.innerHTML=a?'\x3ci class\x3d"spinner-gray"\x3e\x3c/i\x3e 加载中':"更多",z.W.enable(this.Ac,"loading",a))};var el={s:function(a,b,c){return(0,window.isNaN)(c)||""==c||a.length>=c?a:a=-1a?"-":0<=b.indexOf("+")?"+":0<=b.indexOf(" ")?" ":"";0<=a&&(d=g+d);if((0,window.isNaN)(c)||d.length>=c)return d;d=(0,window.isNaN)(f)?Math.abs(a).toString():Math.abs(a).toFixed(f);a=c-d.length-g.length;return d=0<=b.indexOf("-",0)?g+d+Za(" ",a):g+ Za(0<=b.indexOf("0",0)?"0":" ",a)+d},d:function(a,b,c,d,f,g,h,k){return el.f((0,window.parseInt)(a,10),b,c,d,0,g,h,k)}};el.i=el.d;el.u=el.d;Yk("activeSource",{defaults:{pN:"%d 条新动态",qn:"zu-main-feed-fresh-button",VY:z.p},init:function(a){this.data=[];this.button=this.pn();z.af(this.button,a.m());this.v().g(this.button,"click",function(){a.render(this.data,0);this.setData([])});var b=this,c=this.options.source(function(a){a&&a.length&&b.setData(a.concat(b.data))},function(){return b.data});if(!c||!z.sa(c.H))throw Error("Source must return a disposable object.");this.kO=c},setData:function(a){this.data=a;this.NS()},NS:function(){var a= this.data.length;z.mf(this.button,z.dl(this.options.pN,a));z.Q(this.button,!!a)},pn:function(){return z.O("a",{href:"javascript:;",style:"display:none","class":this.options.qn})},H:function(){Xk.prototype.H.call(this);z.Cc(this.kO);this.options=null;this.button&&(z.P(this.button),this.button=null)}});z.x(z.fl,z.xc);z.e=z.fl.prototype;z.e.Fu=!1;z.e.tA=0;z.e.ma=null;z.e.fire=function(a){this.dw=arguments;this.ma||this.tA?this.Fu=!0:this.Jg()};z.e.stop=function(){this.ma&&(z.wd(this.ma),this.ma=null,this.Fu=!1,this.dw=[])};z.e.pause=function(){this.tA++};z.e.D=function(){z.fl.o.D.call(this);this.stop()};z.e.zT=function(){this.ma=null;this.Fu&&!this.tA&&(this.Fu=!1,this.Jg())};z.e.Jg=function(){this.ma=z.vd(this.cl,this.Yg);this.$j.apply(null,this.dw)};z.x(z.gl,z.G);z.gl.prototype.hc=function(){var a=this.gq=new z.fl(this.update,this.cO,this);this.ga.g(this.viewport,["scroll","resize"],function(){a.fire()})};z.gl.prototype.v=function(){return this.ga};z.gl.prototype.D=function(){z.gl.o.D.call(this);this.ga.H();this.ga=null;this.gq.H();this.gq=null};z.gl.prototype.update=function(){this.size=(kf(this.viewport)?z.Oe:Gg)(this.viewport);this.dispatchEvent("update")};z.$m=new z.gl;(0,window.$)(function(){z.$m.update()});Yk("autoload",{defaults:{cr:!0,viewport:window,UY:function(){return!0}},init:function(a){if(a.kf()&&(!this.options.cr||z.T.Fb())){var b=this.options.viewport,c=new z.gl(b);z.Ac(this,c);hl(c,this,function(c){return z.Kg(a.kf())?400>=(kf(b)?a.kf().getBoundingClientRect().top-c.height:b.scrollHeight-b.scrollTop-c.height):!1});this.v().g(a,"complete",this.H).g(a,"next",function(){this.enable()});this.enable()}},enable:function(){this.v().ya(this,"nearbottom",function(){this.view.ti()})}});Yk("childConstructor",{defaults:{$h:null,factory:null},init:function(a){z.sa(this.options.$h)&&bl(a,this.LN,this);z.sa(this.options.factory)&&bl(a,this.vU,this)},LN:function(a){var b=new this.options.$h;this.view.L(b);b.w(a)},vU:function(a){var b=this.options.factory(a);this.view.L(b);b.w(a)}});Yk("dataPagingSource",{defaults:{ND:!0},init:function(a){var b=(0,window.$)(a.m()).data("paging").next;b||cl(a);a.source=function(){return window.$.get(b).then(function(a){b=a.paging.next;return{results:a.htmls,next:!!b}})}}});Yk("expandLimit",{defaults:{oW:3},init:function(a){z.T.Fb()||this.v().g(a,"beforeloadnext",function(){var a=new z.Vk;a.bd("expand");a.show();return!1})}});Yk("locationSource",{defaults:{kt:20,param:null,rA:!1,offset:function(a){return a.length}},init:function(a){function b(a){return{start:c.rA?z.kb(a).id.split("-")[1]:0,offset:c.offset(a)}}var c=this.options,d=c.url||window.location.href,f=a.gb().length;(!f||f=b.data.size&&a.kf()&&z.Kg(a.kf())&&a.kf().click()}))},H:function(){Xk.prototype.H.call(this);this.Yo&&(this.Yo.H(),this.Yo=null)}});z.x(z.Cl,z.al);}).call(this, __z_z__); ================================================ FILE: wenda/src/main/resources/static/scripts/common.fed5411f.js ================================================ (function(z){ var xn=function(a){a=a.tabIndex;return z.qa(a)&&0<=a&&32768>a};var yn=function(a){a=a.getAttributeNode("tabindex");return null!=a&&a.specified};var zn=function(a,b){return z.pb(a.mD||[],function(a){return b===a||z.lf(a,b)})};var An=function(a){if(a.Xj)throw Error("Can not change this state of the popup while showing.");};var Bn=function(a){return a.xj.length?a.xj.pop():a.Bn()};var Cn=function(a){try{return a&&a.activeElement}catch(b){}return null};var Dn=function(a){return yn(a)&&xn(a)}; var En=function(a){a=String(a);if(/^\s*$/.test(a)?0:/^[\],:{}\s\u2028\u2029]*$/.test(a.replace(/\\["\\\/bfnrtu]/g,"@").replace(/"[^"\\\n\r\u2028\u2029\x00-\x08\x0a-\x1f]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:[\s\u2028\u2029]*\[)+/g,"")))try{return eval("("+a+")")}catch(b){}throw Error("Invalid JSON string: "+a);};z.Fn=function(a,b){return z.ba[a]=b}; z.Gn=function(a,b,c){var d=z.$m;d.ga.g(d,"update",function g(){a.getBoundingClientRect().bottoma.size.height?!1:!0};var In=function(a){z.xk?z.W.enable(a.input,"placeholder-hilight",!1):z.W.enable(a.label,"placeholder-label-hilight",!1)};z.Jn=function(a){var b=z.Y;b.UH?(b.UH.innerHTML=a,z.Q(b.h,!0)):z.X.message(a)}; var Kn=function(a,b){b&&b.length&&z.y(b,function(a){this.dispatchEvent(new z.Zj(a[0],a[1]))},a)};z.Ln=function(a,b){z.G.call(this);this.ga=new z.xd(this);this.sh(a||null);b&&(this.Xb=b)};z.Mn=function(a,b){return a.he.get(b)};var Nn=function(a,b){return a.Qc&&b?z.lb(a.Qc,b):-1};var On=function(a,b){a.Ra&&a.Ra.Xe&&(z.Kb(a.Ra.Xe,a.pb),z.Lb(a.Ra.Xe,b,a));a.pb=b};var Pn=function(a){return new z.pg(a.top,a.left+a.width,a.top+a.height,a.left)};var Qn=function(a){return"CSS1Compat"==a.Ka.compatMode}; z.Rn=function(a){if(a.ea)return En(a.ea.responseText)};var Sn=function(a){z.Td(a);for(var b={},c=0;c=a||96<=a&&106>=a||65<=a&&90>=a||(z.D||z.Gc)&&0==a)return!0;switch(a){case 32:case 43:case 63:case 64:case 107:case 109:case 110:case 111:case 186:case 59:case 189:case 187:case 61:case 188:case 190:case 191:case 192:case 222:case 219:case 220:case 221:return!0;default:return!1}};z.fo=function(a){return new z.He(a.offsetWidth,a.offsetHeight)}; var go=function(a){if(z.C&&!(8<=z.Tg))return a.offsetParent;var b=z.Je(a),c=z.xg(a,"position"),d="fixed"==c||"absolute"==c;for(a=a.parentNode;a&&a!=b;a=a.parentNode)if(11==a.nodeType&&a.host&&(a=a.host),c=z.xg(a,"position"),d=d&&"static"==c&&a!=b.documentElement&&a!=b.body,!d&&(a.scrollWidth>a.clientWidth||a.scrollHeight>a.clientHeight||"fixed"==c||"absolute"==c||"relative"==c))return a;return null}; var ho=function(a,b,c,d){if(null!=a)for(a=a.firstChild;a;){if(b(a)&&(c.push(a),d)||ho(a,b,c,d))return!0;a=a.nextSibling}return!1};var io=function(a,b){var c=a.parentNode;if(c==b)return-1;for(var d=b;d.parentNode!=c;)d=d.parentNode;return Xn(d,a)};var jo=function(a,b){return new z.Ge(a.x-b.x,a.y-b.y)};var ko=function(a){this.ou=a}; var lo=function(a,b,c){if(null==b)c.push("null");else{if("object"==typeof b){if(z.na(b)){a.serializeArray(b,c);return}if(b instanceof String||b instanceof Number||b instanceof Boolean)b=b.valueOf();else{c.push("{");var d="",f;for(f in b)if(Object.prototype.hasOwnProperty.call(b,f)){var g=b[f];"function"!=typeof g&&(c.push(d),mo(f,c),c.push(":"),lo(a,a.ou?a.ou.call(b,f,g):g,c),d=",")}c.push("}");return}}switch(typeof b){case "string":mo(b,c);break;case "number":c.push((0,window.isFinite)(b)&&!(0,window.isNaN)(b)? String(b):"null");break;case "boolean":c.push(String(b));break;case "function":c.push("null");break;default:throw Error("Unknown type: "+typeof b);}}};var mo=function(a,b){b.push('"',a.replace(z.Rl,function(a){var b=no[a];b||(b="\\u"+(a.charCodeAt(0)|65536).toString(16).substr(1),no[a]=b);return b}),'"')};var oo=function(a){var b=typeof a;return"object"==b&&a||"function"==b?"o"+z.ua(a):b.substr(0,1)+a}; var po=function(a,b){if("function"==typeof a.every)return a.every(b,void 0);if(z.oa(a)||z.pa(a))return z.$n(a,b,void 0);for(var c=z.Jd(a),d=z.Id(a),f=d.length,g=0;g=a.keyCode)return!1;switch(a.keyCode){case 18:case 20:case 93:case 17:case 40:case 35:case 27:case 36:case 45:case 37:case 224:case 91:case 144:case 12:case 34:case 33:case 19:case 255:case 44:case 39:case 145:case 16:case 38:case 252:case 224:case 92:return!1;case 0:return!z.B;default:return 166>a.keyCode||183b.top&&b.right>b.left?b:null};var Eo=function(a){var b=a.body;a=a.documentElement;return new z.Ge(b.scrollLeft||a.scrollLeft,b.scrollTop||a.scrollTop)};var Fo=function(a,b){var c=a.style[z.db(b)];return"undefined"!==typeof c?c:a.style[z.sg(a,b)]||""}; var Go=function(a,b){var c=b.xa.right?b.x-a.right:0,d=b.ya.bottom?b.y-a.bottom:0;return Math.sqrt(c*c+d*d)};z.Ho=function(a,b){return z.tf(a,null,b,void 0)};z.Io=function(a){var b=[];z.qf(a,b,!1);return b.join("")};z.Jo=function(a,b){var c=[];ho(a,b,c,!1);return c};z.Ko=function(a){if("outerHTML"in a)return a.outerHTML;var b=z.Je(a).createElement("DIV");b.appendChild(a.cloneNode(!0));return b.innerHTML}; var Lo=function(a){var b,c=arguments.length;if(!c)return null;if(1==c)return arguments[0];var d=[],f=window.Infinity;for(b=0;bb?a[1]="?":b==c.length-1&&(a[1]=void 0));return a.join("")}; var To=function(a,b){return(new ko(b)).serialize(a)};var Uo=function(a){return eval("("+a+")")};var Vo=function(a){this.Ib=new z.Rd;a&&this.addAll(a)};var Wo=function(a,b){var c=qo(b);if(a.kb()>c)return!1;!(b instanceof Vo)&&5=f.size.height)return c=a,!0}),d={"1page-down .5page-up":z.fp(d,b(function(){return c-window.pageYOffset>=f.size.height/2})),"1page-down inview":z.fp(d,function(){return Hn(f,k[0])})},f=new z.gl,g=d[a]||d["1page-down .5page-up"];f.v().g(f,"update",function(){g()&&(f.H(),w())})};var K=function(){var a=new z.gl; a.v().g(a,"update",function(){m.parent().length?Hn(a,m[0])||(H(),a.H()):a.H()})};(0,window.$)(".dismiss",m).click(function(){H();return!1});(0,window.$)(".skip-all",m).click(function(){window.$.post("/node/Guide2",{method:"skip_popover",params:{category:b}});H(!0);return!1});g?a(g):w()}}};var Ip=function(){var a=(0,window.$)("#guidersv2-page-banner");(0,window.$)(".js-close",a).click(function(){a.remove()})}; var Jp=function(a){function b(a){window.$.post("/node/Guide2",{method:"dismiss_editor",params:{key:a}})}function c(a){z.xi(Object.assign({category:"popup_guide",label:{bio:"popup_guide_personal_introduction",topic:"popup_guide_topic_recommendation"}[h]},a))}function d(a){k||(k=new z.V,k.Bf(!0),k.cF=!1,z.W.add(k.fi(),"Guide"));k.ia(a);k.G(!0)}var f=window.$.Deferred(),g=a.vr.editor;if(!g||!g.length)return f.reject();var g=g.slice(),h,k,m={},n={bio:function(a){var f=(0,window.$)("#tmpl-Guide-BioEditor").html(); if(!f)return window.console&&window.console.warn("Cannot find template"),a();var g=z.gp(a,function(){b("bio")});d(f);(function(a){a=(0,window.$)(a).off();var b=(0,window.$)(".js-submit",a),d=(0,window.$)('input[name\x3d"bio"]',a);b.click(function(){var a=m.jw=window.$.trim(d.val());a?(window.$.post("/node/Guide2",{method:"add_headline",params:{headline:a}}),c({action:"click_edit_personal_introduction_submit",attributes:{personal_introduction:a}})):c({action:"click_edit_personal_introduction_skip"}); g()})})(k.S());c({action:"popup_edit_personal_introduction_appear"})},topic:function(a){function f(){z.Cp.dispatchEvent("guider2:topicselected")}window.$.get("/node/GuideTopicList",function(a){(0,window.$)(".Guide-topicsLoading").remove();(0,window.$)(a).appendTo(".Guide-content")});var g=(0,window.$)("#tmpl-Guide-Topics").html();if(g){var h=z.gp(a,function(){b("topic")});d(g);(function(a){var b=(0,window.$)(a).off();a=(0,window.$)(".js-submit",b);b.on("click",".Guide-TopicsItem",function(){var a= (0,window.$)(this);a.toggleClass("is-checked");var b=(0,window.$)(".template-relatedTopics",a);if(b.length){var c=b.html();b.remove();(0,window.$)(c).insertAfter(a)}});a.click(function(){var a=m.Lm=[],d={};(0,window.$)(".Guide-TopicsItem",b).filter(".is-checked").each(function(){var b=(0,window.$)(this),c=b.data("id"),f=b.index(),b=b.find(".name").text();a.push(c);d[c]={topic:b,row:Math.ceil((f+1)/3),column:f%3+1}});a.length?(window.$.post("/topics/follow",{follow_ids:a.join(",")},f),c({action:"click_popup_guide_topic_recommendation_submit", attributes:{selected_topic:d}})):(f(),c({action:"click_popup_guide_topic_recommendation_skip"}));h()})})(k.S());c({action:"popup_guide_topic_recommendation_appear"})}else window.console&&window.console.warn("Cannot find template"),a(),f()}};(0,window.$)(window).on("beforeunload.guide2",function(){k&&k.V()&&c({wc:!0,action:{bio:"click_edit_personal_introduction_close",topic:"click_guide_topic_recommendation_close"}[h]})});Ep(g,function(a,b,c){if(n[a]){h=a;var d=b===g.length-1,M=function(a){if(k)if(window.Modernizr.cssanimations)var b= (0,window.$)(k.fi()).addClass("fx-hide").onAnimationEnd(function(){b.removeClass("fx-hide");a()},400);else a()};n[a](function(){d?M(function(){k.G(!1);f.resolve(m);(0,window.$)(window).off(".guide2");"/topic"===window.location.pathname&&window.location.reload()}):M(c)})}});return f.promise()};var Kp=function(a,b){z.G.call(this);a&&this.attach(a,b)};var Lp=function(a,b,c,d){z.Pc.call(this,d);this.type="key";this.keyCode=a;this.charCode=b;this.repeat=c};var Mp=function(){}; var Np=function(a,b,c){if(a=c||a.jf())c=b.getAttribute("role")||null,a!=c&&z.bj(b,a)};var Op=function(a,b,c){var d=b.iD;null!=d&&a.ZA(c,d);b.V()||z.cj(c,"hidden",!b.V());b.isEnabled()||a.ug(c,1,!b.isEnabled());Pp(b,8)&&a.ug(c,8,!!(b.N&8));Pp(b,16)&&a.ug(c,16,b.qf());Pp(b,64)&&a.ug(c,64,b.ub())};var Qp=function(a,b){var c=[];b&&(a=a.concat([b]));z.y([],function(d){!z.$n(d,z.Ba(z.A,a))||b&&!z.A(d,b)||c.push(d.join("_"))});return c}; var Rp=function(a){var b=a.U();b.replace(/\xa0|\s/g," ");a.pr={1:b+"-disabled",2:b+"-hover",4:b+"-active",8:b+"-selected",16:b+"-checked",32:b+"-focused",64:b+"-open"}};z.Sp=function(){};z.Tp=function(a,b){if(!a)throw Error("Invalid class name "+a);if(!z.sa(b))throw Error("Invalid decorator function "+b);Up[a]=b}; var Vp=function(a,b,c){z.R.call(this,c);if(!b){b=this.constructor;for(var d;b;){d=z.ua(b);if(d=Wp[d])break;b=b.o?b.o.constructor:null}b=d?z.sa(d.ba)?d.ba():new d:null}this.M=b;this.wm(z.ka(a)?a:null);this.iD=null}; var Xp=function(a,b){var c=a.v(),d=a.m();b?(c.g(d,"mouseover",a.nd).g(d,"mousedown",a.fe).g(d,"mouseup",a.of).g(d,"mouseout",a.Kl),a.ho!=z.p&&c.g(d,"contextmenu",a.ho),z.C&&(c.g(d,"dblclick",a.PF),a.qo||(a.qo=new Yp(a),z.Ac(a,a.qo)))):(c.qa(d,"mouseover",a.nd).qa(d,"mousedown",a.fe).qa(d,"mouseup",a.of).qa(d,"mouseout",a.Kl),a.ho!=z.p&&c.qa(d,"contextmenu",a.ho),z.C&&(c.qa(d,"dblclick",a.PF),z.Cc(a.qo),a.qo=null))};var Pp=function(a,b){return!!(a.bq&b)}; var Zp=function(a,b){return!!(a.cj&b)&&Pp(a,b)};var $p=function(a,b,c){return Pp(a,b)&&!!(a.N&b)!=c&&(!(a.yk&b)||a.dispatchEvent(yo(b,c)))&&!a.Fd};var Yp=function(a){z.xc.call(this);this.zr=a;this.qr=!1;this.ga=new z.xd(this);z.Ac(this,this.ga);a=this.zr.h;this.ga.g(a,"mousedown",this.Il).g(a,"mouseup",this.xs).g(a,"click",this.Hl)};var aq=function(){};z.bq=function(a,b,c){Vp.call(this,a,b||aq.ba(),c)};var cq=function(){}; var dq=function(a,b,c){if(b){var d=eq(a,c);z.gj(b,d)||(z.Db(fq,function(a){a=eq(this,a);z.uo(b,a,a==d)},a),z.cj(b,"checked",c==gq?"mixed":c==hq?"true":"false"))}};var eq=function(a,b){var c=a.U();if(b==hq)return c+"-checked";if(b==iq)return c+"-unchecked";if(b==gq)return c+"-undetermined";throw Error("Invalid checkbox state: "+b);};var jq=function(a,b,c){c=c||cq.ba();Vp.call(this,null,c,b);this.Uh=z.ka(a)?a:iq};z.kq=function(){};var lq=function(){}; z.mq=function(a,b,c,d,f){function g(a){a&&(a.tabIndex=0,z.bj(a,h.jf()),z.hj(a,"goog-zippy-header"),nq(h,a),a&&h.fH.g(a,"keydown",h.VS))}z.G.call(this);this.da=f||z.J();this.Rf=this.da.m(a)||null;this.qj=this.da.m(d||null);this.rl=(this.gt=z.sa(b)?b:null)||!b?null:this.da.m(b);this.ob=1==c;z.ka(c)||this.gt||(this.qj?this.ob=z.Kg(this.qj):this.Rf&&(this.ob=z.gj(this.Rf,"goog-zippy-expanded")));this.fH=new z.xd(this);this.Pz=new z.xd(this);var h=this;g(this.Rf);g(this.qj);this.Lc(this.ob)}; var oq=function(a){var b=a.qj;return b&&z.Kg(b)?b:a.Rf};var nq=function(a,b){b&&a.Pz.g(b,"click",a.US)};var pq=function(a,b,c){z.Lc.call(this,a,b);this.Og=c};z.qq=function(){z.V.call(this);this.Bf(!0)};var rq=function(a){var b=(0,window.$)(".resend-activation-email",a.xC);sq(a,b,10,function(){window.$.post("/reactive")})}; var tq=function(a){window.$.get("/settings/account/request_unlock");var b=(0,window.$)("form.send-code",a.oC),c=a.lC=(0,window.$)("form.activate",a.oC),d=(0,window.$)(".submit",b);b.validate(window.$.extend({},uq,{submitHandler:z.uk(d,window.$.proxy(a.vT,a))}));b=(0,window.$)(".submit",c);c.validate(window.$.extend({},uq,{submitHandler:z.uk(b,window.$.proxy(a.wS,a))}));b=(0,window.$)("button.resend-code",c);sq(a,b,60,function(){var a=(0,window.$)('input[name\x3d"account"]',c).val();if(""===a)return c.data("validator").showErrors({account:"请填写手机号或邮箱"}), !1;var b=this.rf(a),d;b?(a={email:a},d="/settings/account/send_new_email_digits"):(a={phone_no:a},d="/settings/account/send_new_phone_digits");var k=this;window.$.post(d,a,function(a){a.success?vq(k,b):(a=a.payload.fields,b?k.wb(a,"email","account"):k.wb(a,"phone_no","account"),c.data("validator").showErrors(a))})})};var vq=function(a,b){a.Cv||(a.Cv=(0,window.$)(".tip",a.Ad));b?a.Cv.html("验证码已发送至你的邮箱,请查收。"):a.Cv.html("验证码已发送至你的手机,请查收。")}; var sq=function(a,b,c,d){var f=b.text();b=z.tk(b,c,function(a){return a?"%s 秒后即可重发":f},window.$.proxy(d,a));z.Ac(a,b)}; var wq=function(a){function b(){(0,window.clearTimeout)(g);g=null;try{delete window[d]}catch(a){window[d]=null}}"string"===window.$.type(a)&&(a={url:a});a=a||{};var c=window.$.Deferred(),d="zh"+(0,z.I)()+Un(),f=window.$.extend({},a.data||{},{callback:d}),g=null;a.timeout&&(g=(0,window.setTimeout)(function(){window[d]&&(window[d]=b,c.reject("timeout"))},a.timeout));window[d]=c.resolve;a=a.url+(-1===a.url.indexOf("?")?"?":"\x26")+window.$.param(f);z.ch(a).fail(c.reject).always(b);return c.promise()}; var xq=function(a,b){b=void 0===b?0:b;z.G.call(this);this.EM=Object.assign({},yq,a);this.iU=b;this.su=1E3;this.GH=3E4;this.SQ=1.5};z.zq=function(a,b){a=void 0===a?z.p:a;b=void 0===b?!1:b;z.R.call(this);this.AI=a;this.MV=b};var Aq=function(a){window.$.get("/antispam/get_token").then(function(b){a.je=b.token;a.timeout=b.ttl;a.startTime=Date.now();(0,window.$)(".js-token",a.h).text(a.je);(0,window.$)(".js-timeout",a.h).text((0,window.parseInt)(a.timeout/60))})}; var Bq=function(a){var b=(0,window.$)(".js-sent",a.h);b.click(z.uk(b,function(){if(Date.now()>a.startTime+1E3*a.timeout)return Aq(a),Cq(a,"短信超时,请重新发送");Dq(a);a.Lk.show();return window.$.get("/antispam/is_send_sms").then(function(b){b.is_send_sms?Eq(a,"unblock"):Cq(a,"没收到正确的短信,请重新发送");a.Lk.hide()},function(){a.Lk.hide()})}))}; var Fq=function(a){var b=(0,window.$)(".js-verify",a.h);b.click(z.uk(b,function(){var b=a.Bc.Xi.val();if(!b)return Cq(a,"请填写验证码");Dq(a);a.Lk.show();return window.$.post("/antispam/create_appeal",{captcha:b}).then(function(b){0===b.errcode?Eq(a,"appeal"):(a.Bc.ju(),Cq(a,b.msg),a.Lk.hide())},function(){a.Lk.hide()})}))}; var Gq=function(a){(0,window.$)(".js-appeal",a.h).click(function(){a.AI("向管理员申诉解封");a.Fv.hide();(0,window.$)(".unblock-dialog-appeal",a.h).show();a.Bc.ju();Dq(a)});(0,window.$)(".js-message",a.h).click(function(){a.AI("帐号解封");a.Fv.hide();(0,window.$)(".unblock-dialog-message",a.h).show();Dq(a)})};var Hq=function(a){a.Zt=new xq({url:"/antispam/is_send_sms"},1E3);z.Ac(a,a.Zt);a.Zt.g("message",function(b){b.data.is_send_sms&&Eq(a,"unblock")});a.Zt.Yt()}; var Eq=function(a,b){a.Zt.H();var c;"unblock"===b?c="成功自助解封":"appeal"===b&&(c="成功提交申诉\x3cbr\x3e申诉成功后会以邮件或私信方式通知你");(0,window.$)(".unblock-dialog-success-text",a.h).html(c);a.Fv.hide();(0,window.$)(".unblock-dialog-success",a.h).show();if(a.MV){var d=(0,window.$)(".js-count-down",a.h);d.show();var f=5,g;"unblock"===b?g="刷新":"appeal"===b&&(g="关闭");var h=function(){0>=f?"unblock"===b?window.location.reload():"appeal"===b&&a.dispatchEvent("complete"):(d.text(f--+" 秒后自动"+g),(0,window.setTimeout)(h,1E3))}; h()}};var Cq=function(a,b){a.rC.text(b).addClass("is-visible")};var Dq=function(a){a.rC.removeClass("is-visible")};var Iq=function(a){z.V.apply(this,arguments)}; z.Jq=function(a,b,c){function d(a){return a&&a.preventDefault?a.preventDefault():!1}return function(f){var g={Fb:!0,qe:!1,Gt:!1,gJ:!1};z.na(b)?(!0===b[0]&&(g=ap(g,function(){return!0})),z.Mb(g,b[1])):!0===b?g=ap(g,function(){return!0}):(z.sa(b)&&(b=b.apply(this,arguments)),z.Mb(g,b||{}));var h=z.sa(c)?c.apply(this,arguments):c;if(!z.T.Fb()&&g.Fb){var k=new z.Vk;k.Lp(h);k.show();return d(f)}return!z.T.qe&&g.qe?((new z.qq).G(!0),window.$.post("/continuation/record",{url:window.location.pathname+window.location.search+ (h||"")}),d(f)):z.im.YE&&g.gJ?(h=z.im.YE,"warning"===h?k='您的知乎用户名不符合 \x3ca href\x3d"/question/19791408"\x3e知乎用户名规范\x3c/a\x3e,请您 \x3ca href\x3d"/settings/profile"\x3e修改\x3c/a\x3e。':"pending"===h&&(k="您提交的用户名修改正在审核中,帐号暂时锁定。"),k&&z.X.message(k,4E3),d(f)):z.im.lw&&g.Gt?(z.im.lw.by_antispam?(new Iq).G(!0):z.X.message(z.im.lw.message),d(f)):a.apply(this,arguments)}};var Kq=function(){z.G.call(this);this.N=Lq;this.endTime=this.startTime=null}; var Mq=function(a,b,c){z.xc.call(this);this.$j=a;this.Yg=b||0;this.ga=c;this.cl=(0,z.q)(this.Jg,this)};var Nq=function(a){a.tc()&&a.fire()};var Oq=function(a){a=z.ua(a);delete Pq[a];z.Jb(Pq)&&Qq&&Qq.stop()};var Rq=function(){Qq||(Qq=new Mq(function(){Sq()},20));var a=Qq;a.tc()||a.start()};var Sq=function(){var a=(0,z.I)();z.Db(Pq,function(b){Tq(b,a)});z.Jb(Pq)||Rq()}; var Uq=function(a,b,c,d){Kq.call(this);if(!z.na(a)||!z.na(b))throw Error("Start and end parameters must be arrays");if(a.length!=b.length)throw Error("Start and end points must be the same length");this.Yp=a;this.yO=b;this.duration=c;this.PC=d;this.coords=[];this.Qi=!1;this.progress=0};var Tq=function(a,b){a.progress=(b-a.startTime)/(a.endTime-a.startTime);1<=a.progress&&(a.progress=1);Vq(a,a.progress);1==a.progress?(a.N=Lq,Oq(a),a.jd("finish"),a.ig()):1==a.N&&a.Vz()}; var Vq=function(a,b){z.sa(a.PC)&&(b=a.PC(b));a.coords=Array(a.Yp.length);for(var c=0;cd||255a||255c||255=a&&0<=c&&255>=c&&0<=b&&255>=b)return[a,c,b]}return[]};var ar=function(a){return 1==a.length?"0"+a:a};var er=function(a,b,c,d,f){Uq.call(this,b,c,d,f);this.element=a}; var fr=function(a,b,c,d,f){if(2!=b.length||2!=c.length)throw Error("Start and end points must be 2D");er.apply(this,arguments)};var gr=function(a,b,c,d,f){if(2!=b.length||2!=c.length)throw Error("Start and end points must be 2D");er.apply(this,arguments)};var hr=function(a,b,c,d,f){er.call(this,a,[b],[c],d,f)};var ir=function(a,b,c,d,f){er.call(this,a,[b],[c],d,f)}; var jr=function(a,b,c,d,f){z.qa(b)&&(b=[b]);z.qa(c)&&(c=[c]);er.call(this,a,b,c,d,f);if(1!=b.length||1!=c.length)throw Error("Start and end points must be 1D");this.et=kr};var lr=function(a,b,c){jr.call(this,a,1,0,b,c)};var mr=function(a,b,c){jr.call(this,a,0,1,b,c)};var nr=function(a,b,c,d,f){if(3!=b.length||3!=c.length)throw Error("Start and end points must be 3D");er.apply(this,arguments)};var or=function(){return window.$.Deferred(function(a){(0,window.setTimeout)(a.resolve,2E3)}).promise()}; var pr=function(a,b){var c=z.Jo(a,function(a){return 3===a.nodeType&&!z.pp(a.nodeValue)})[0];c&&(c.nodeValue=b)};z.qr=function(a,b){var c=new lr(a,500);b&&z.F(c,"finish",(0,z.q)(function(){z.P(this)},a));c.play()};z.rr=function(a,b,c,d){"bottom"===d&&(d="b");var f="";!1!==c&&(f='data-tip\x3d"t$'+(d||"t")+"$"+a[1]+'"');return["\x3ca ",f,' class\x3d"',b||"zm-item-tag",'" href\x3d"/topic/',a[1],'"\x3e',a[0],"\x3c/a\x3e"].join("")};z.sr=function(a){return a?a.replace(/^\s+/,"").replace(/\s+$/,""):""}; var tr=function(a){return a?a.replace(/<[^>]+>/g,""):""};var ur=function(){return'\x3ca href\x3d"javascript:;" class\x3d"zu-edit-button" name\x3d"edit"\x3e\x3ci class\x3d"zu-edit-button-icon"\x3e\x3c/i\x3e修改\x3c/a\x3e'};z.vr=function(a,b){z.Q(a,!0);z.Q(b,!1)}; var wr=function(a,b,c){var d;a&&(b=(0,window.$)(a).data("animation")||new nr(a,[255,255,150],b||[255,255,255],c||2E3),(0,window.$)(a).data("animation",b),1==b.N&&b.stop(!0),d=a.style.backgroundColor,z.ld(b,"end",function(){z.rg(this.element,"background-color",d)},!1,b),b.play())};z.xr=function(a,b,c){a&&(yr&&window.document[zr]?z.F(window.document,Ar,function f(){window.document[zr]||(wr(a,b,c),z.md(window.document,Ar,f))}):wr(a,b,c))}; var Br=function(a){var b=0,c=0;do c=a.indexOf("?",c),-1!==c&&(b++,c+=1);while(-1!==c);return b}; var Cr=function(a,b,c){b=z.yb(a.data,1);if("topic"===a.data[0]){a=(b[2]?'\x3cimg class\x3d"zm-item-img-avatar zg-left" src\x3d"'+b[2]+'"\x3e':"")+'\x3cspan class\x3d"zu-autocomplete-row-name'+(b[3]?"":" zu-autocomplete-row-name-info")+'" title\x3d"'+b[0]+'"\x3e'+b[0]+"\x3c/span\x3e";var d=5(0,window.$)(window).height())||c.all&&(d.top(0,window.$)(window).height())?!1:!0}; z.Nr=function(a,b){if(a){"number"===window.$.type(b)&&(b={offsetTop:b});var c=window.$.extend({hC:z.Mr},Or,b||{});if(!c.hC(a,c)){var d=(0,window.$)(a).offset().top-c.paddingTop-c.offsetTop||0;c.aw?(0,window.$)(window.document.documentElement).add(window.document.body).animate({scrollTop:d}):(0,window.$)(window).scrollTop(d)}}};var Pr=function(a){(0,window.$)(a.target.M.h).off("click.disable-a").on("click.disable-a","a",function(a){a.preventDefault()})}; z.Qr=function(a,b){var c=null;return function(){var d=this,f=arguments;(0,window.clearTimeout)(c);c=(0,window.setTimeout)(function(){b.apply(d,f)},a)}};var Rr=function(a,b){var c=a.getBoundingClientRect(),d=z.Pg(window.document.body).top;if(0a?c-1:a},0)};var es=function(a){cs(a,function(a,c){return(a+1)%c},a.Ta)}; var fs=function(a){cs(a,function(a,c){a--;return 0>a?c-1:a},a.Ta)};var cs=function(a,b,c){c=0>c?Nn(a,a.jc):c;var d=z.$g(a);c=b.call(a,c,d);for(var f=0;f<=d;){var g=z.ah(a,c);if(g&&a.FD(g)){a.xb(c);break}f++;c=b.call(a,c,d)}};var gs=function(){z.R.call(this);this.kv=[]};z.hs=function(a,b){this.Sa=a||[];this.eC=!b};var is=function(a,b,c){var d=[];if(""!=a){a=z.Wa(a);a=new RegExp("(^|\\W+)"+a,"i");for(var f=0;fr?(r=K-r-1,r>w-5&&(r=w-5),m+=r,r=K):(m+=w,w+=5);m<6*h.length&&d.push({ZV:g,CJ:m,index:f})}d.sort(function(a,b){var c=a.CJ-b.CJ;return 0!=c?c:a.index-b.index});a=[];for(H=0;H=a.Uc&&ca.Uc)c--;else if(a.aD&&c==a.Uc){a.ag(-1);break}else if(!a.eL||-1!=c&&c!=a.Uc)break;else c=b;if(a.ag(c))break}};z.rs=function(a){a.zG()||window.setTimeout((0,z.q)(a.zG,a),10)};var ss=function(a,b){var c=b-a.Uc;return 0>c||c>=a.Sa.length?-1:c}; z.ts=function(a){var b=0,c=0;if(us(a))b=a.selectionStart,c=-1;else if(z.C){var d=vs(a),f=d[0],d=d[1];if(f.inRange(d)){f.setEndPoint("EndToStart",d);if("textarea"==a.type){d.duplicate();b=a=f.text;for(c=!1;!c;)0==f.compareEndPoints("StartToEnd",f)?c=!0:(f.moveEnd("character",-1),f.text==a?b+="\r\n":c=!0);f=[b.length,-1];return f}b=f.text.length;c=-1}}return[b,c]}; z.ws=function(a,b){if(us(a))a.selectionStart=b,a.selectionEnd=b;else if(z.C){b=xs(a,b);var c=a.createTextRange();c.collapse(!0);c.move("character",b);c.select()}};var vs=function(a){var b=a.ownerDocument||a.document,c=b.selection.createRange();"textarea"==a.type?(b=b.body.createTextRange(),b.moveToElementText(a)):b=a.createTextRange();return[b,c]};var xs=function(a,b){"textarea"==a.type&&(b=z.La(a.value.substring(0,b)).length);return b};var us=function(a){try{return"number"==typeof a.selectionStart}catch(b){return!1}}; z.ys=function(a,b,c,d){z.xc.call(this);d=d||150;this.dm=null!=c?c:!0;this.Hp=a||",;";this.bO=this.Hp.substring(0,1);a=this.dm?"[\\s"+this.Hp+"]+":"[\\s]+";this.yK=new RegExp("^"+a+"|"+a+"$","g");this.AV=new RegExp("\\s*["+this.Hp+"]$");this.tH=b||"";this.sU=!1;this.rU=this.dm;this.ma=0=f.right)&&(g&=-2);132==(g&132)&&(d.y=f.bottom)&&(g&=-5);d.xf.right&&(k.width=Math.min(f.right-d.x,n+k.width-f.left), k.width=Math.max(k.width,0),m|=4)}d.x+k.width>f.right&&g&1&&(d.x=Math.max(f.right-k.width,f.left),m|=1);g&2&&(m=m|(d.xf.right?32:0));d.yf.bottom&&(k.height=Math.min(f.bottom-d.y,n+k.height-f.top),k.height=Math.max(k.height,0),m|=8));d.y+k.height>f.bottom&&g&4&&(d.y=Math.max(f.bottom-k.height,f.top),m|=2);g&8&&(m=m|(d.yf.bottom?128:0));f=m}else f=256;m=f}g=new z.qg(0, 0,0,0);g.left=a.x;g.top=a.y;g.width=h.width;g.height=h.height;f=m;if(f&496)return f;z.zg(b,new z.Ge(g.left,g.top));h=g.Rg();z.Ro(c,h)||(c=h,a=Qn(z.J(z.Je(b))),!z.C||z.E("10")||a&&z.E("8")?(b=b.style,z.B?b.MozBoxSizing="border-box":z.D?b.WebkitBoxSizing="border-box":b.boxSizing="border-box",b.width=Math.max(c.width,0)+"px",b.height=Math.max(c.height,0)+"px"):(h=b.style,a?(a=z.Pg(b),b=z.Sg(b),h.pixelWidth=c.width-b.left-a.left-a.right-b.right,h.pixelHeight=c.height-b.top-a.top-a.bottom-b.bottom):(h.pixelWidth= c.width,h.pixelHeight=c.height)));return f};var Js=function(a,b){return(b&4&&z.Mg(a)?b^2:b)&-5};z.Ls=function(a,b,c,d){z.G.call(this);this.Ra=a||window.document.body;this.da=z.J(this.Ra);this.Bp=!a;this.h=null;this.Wb="";this.Sa=[];this.zf=[];this.aK=this.Sl=-1;this.sb=!1;this.className="ac-renderer";this.ph="ac-row";this.pH="active";this.Lv="ac-active";this.JQ="ac-highlighted";this.ll=b||null;this.NK=null!=d?d:!0;this.dS=!0;this.oo=!1;this.cV=!!c;this.Wu=!1;this.Vo=0;this.WJ=!1}; var Ms=function(a,b){a.xc&&(z.cj(a.xc,"haspopup",b),z.cj(a.h,"expanded",b),b?z.cj(a.xc,"owns",a.h.id):(a.xc.removeAttribute("aria-owns"),wo(a.xc,null)))};var Ns=function(a,b){var c=0<=b&&b=a.length&&a[1]===z.Ka("创建 %s 话题",a[2])})}var g=(0,z.q)(function(){return z.qb(this.data,function(a){return a[0]===c})},a);z.T.Ds?!a.UC||b.length&&(f()||d())||g()||b.push(["topic",z.Ka("创建 %s 话题",c),c]):(a=f())&&(1=a.ut;a.ef&&z.Q(a.ef,!b);a.vt&&z.Q(a.vt,b)};var st=function(a){var b=[];a.data=z.mb(a.data,function(a){if(z.A(b,a[1]))return!1;b.push(a[1]);return!0})};z.tt=function(a,b,c){z.lt.call(this,a,0,c?"添加父话题":"添加子话题");this.jz=c;this.Gf=b;this.Ns="";this.mJ="/topic/parent/remove"};var ut=function(a){z.lt.call(this);this.Ns="";this.Fe=a||"";this.ut=this.Le=5;this.Iq=(0,window.$)("#zh-question-suggest-title-content")}; var vt=function(a){var b;b=a.$p?z.mb(a.$p,function(a){return!this.zx(a)},a):[];a.Kq.show();b&&0!==b.length||a.Kq.hide();var c="";b=z.nb(b,function(a){return"\x3ca href\x3d'javascript:;' name\x3d'add' data-id\x3d'"+a[4]+"' data-text\x3d'"+a[1]+"' class\x3d'zg-r3px zm-item-tag'\x3e\x3cspan\x3e"+a[1]+"\x3c/span\x3e\x3c/a\x3e"});c+=b.join("");a.zL.html(c);a.Av.hide()};z.wt=function(a){z.lt.call(this,a,0);this.Ns="";this.yD="/topic/ignore"};var xt=function(){z.xc.call(this)}; z.yt=function(a){z.xc.call(this);this.$J=z.jp();this.XE=z.jp();this.QA=a.$g();this.da=z.J(a.ua());a.cq(this.da.B("SPAN",{id:this.$J}),this.da.B("SPAN",{id:this.XE}))};z.zt=function(a,b){return a.da.m(b?a.$J:a.XE)};z.At=function(a,b,c,d,f){this.Jc=!!b;this.node=null;this.Ub=0;this.xk=!1;this.xr=!c;a&&this.setPosition(a,d);this.depth=void 0!=f?f:this.Ub||0;this.Jc&&(this.depth*=-1)};var Bt=function(){}; var Ct=function(a){if(a.getSelection)return a.getSelection();a=a.document;var b=a.selection;if(b){try{var c=b.createRange();if(c.parentElement){if(c.parentElement().document!=a)return null}else if(!c.length||c.item(0).document!=a)return null}catch(d){return null}return b}return null};z.Dt=function(a){for(var b=[],c=0,d=a.Fj();c=a.we(h,1,0):a.O.inRange(h))return Vt(a,g)}}return b}; var Wt=function(a,b,c){c=c||a.sc();if(!c||!c.firstChild)return c;for(var d=1==b,f=0,g=c.childNodes.length;fa.we(n,1,0)&&0Br(z.sr(a.Gc.value).replace("?","?"))?(c.ye="您还没有给问题添加问号",c.level=3,c.name="noquestionmark"):1a?(b.level=3,b.ye="问题字数太少了吧",b.name="tooshort"):40=a?(b.level=1,b.ye='还可以输入 \x3cspan class\x3d"warning"\x3e'+(51-a)+"\x3c/span\x3e 字",b.name="buffer"):51("number"===typeof d.EJ?d.EJ:h.scrollHeight-h.offsetHeight-h.scrollTop)&&a.zz(c).then(function(a){a||z.nd(b[c])},window.$.noop)}),c=a.KK?a.contents:a.pg,b=z.nb(c,function(a,b){return z.F(a,"scroll",(0,z.q)(d,void 0,b))})};var Yx=function(a,b){a.pg&&z.y(a.pg,function(a,d){b===d?a.enter():a.qx&&(a.v().removeAll(),a.Qd&&a.Qd.stop(),a.qx=!1)})};var $x=function(a){a=z.cp(a.Pf,Tn);return-1===a?0:a}; var ay=function(a){if(!z.vm){var b=by(a.Td);a=by(a.AG);var c="";b&&a?c="("+a+" 封私信 / "+b+" 条消息) ":b?c="("+b+" 条消息) ":a&&(c="("+a+" 封私信) ");window.document.title=c+window.document.title.replace(/^(\(|\uff08)(\d)*(\+)?( )?(\u5c01\u79c1\u4fe1)?( \/ )?(\d)*(\+)?( )?(\u6761\u6d88\u606f)?(\)|\uff09)( )?/g,"")}};var cy=function(a,b){a.Td-=a.Pf[b];a.wv.eq(b).removeClass("withdot");0>a.Td&&(a.Td=0);z.Q(a.zn,!!a.Td);a.zn.innerHTML=a.Td}; var Xx=function(a,b){a.VE?a.visible&&(a.cache[b]?("$$used$$"!==a.cache[b]&&(a.Jw[b].innerHTML=a.cache[b],a.cache[b]="$$used$$"),a.Pf[b]&&dy(a.types[b]),cy(a,b),a.pg&&a.pg[b].update().scrollTop(),a.Td||z.Qh.set("noti7-tab",b)):(a.Cm[b]=!0,a.Fl(b))):a.cache[b]?("$$used$$"!==a.cache[b]&&(a.Jw[b].innerHTML=a.cache[b],a.cache[b]="$$used$$"),a.Pf[b]&&dy(a.types[b]),cy(a,b)):(a.Cm[b]=!0,a.Fl(b),dy(a.types[b]))}; var ey=function(a,b){b?a.AC.fadeIn(50):a.AC.fadeOut(50);a.visible=b;z.W.enable(a.Ai,"open",a.visible);z.W.enable(a.jq,"open",a.visible);if(b){a.Ai.focus();z.y(a.cache,function(a,b){a||this.Fl(b)},a);a.v().g(window.document,"click",a.rs);var c;a.Td?(c=$x(a),a.tab.select(c),a.Cm[c]=!0):(c=fy(),a.Nw||(a.tab.select(c),a.Cm[c]=!0));Yx(a,c);z.Y.tb({type:"ga_click_top_nav_noti",data:{tab:a.sE,CK:+(a.Td||0)}})}else a.v().qa(window.document,"click",a.rs),Yx(a,-1)}; var dy=function(a){(new z.Z(!1)).ajax("/noti7/readall","tab\x3d"+a,"POST")};var fy=function(){var a=z.Qh.get("noti7-tab");return a?+a:0};var by=function(a){return 99=d?b=0:-1>=b&&(b=d-1);c=c.eq(b);a.ed.attr("aria-activedescendant",c.attr("id"));c.focus();a.index=b}; var jy=function(a){z.R.apply(this,arguments)};var ky=function(a,b){if(!a.metaKey)try{z.Qh.set("query",a.ca.Wb)}catch(c){b+="?q\x3d"+(0,window.encodeURIComponent)(a.ca.Wb)}return b};var ly=function(){z.G.call(this)}; var my=function(){var a=(0,window.$)("#js-top-nav-link-profile"),b=(0,window.$)("#mobile-top-nav-profile-popup");if(z.Uj&&b.length&&b.children("ul").length){var c=function(c){c=c.target;b[0].contains(c)||c.contains(a[0])||d()},d=function(){a.parent().removeClass("open");b.hide();(0,window.$)(window.document.body).off("mousedown",c)};a.click(function(f){f.preventDefault();b.is(":visible")?d():(a.parent().addClass("open"),b.show(),(0,window.$)(window.document.body).mousedown(c))}).attr("href","javascript:;"); b.find(".slide-up").click(d)}};var ny=function(){z.R.call(this)};var oy=function(){z.Bj.call(this,null,!1);this.zD="zh-lightbox-showing";this.lW="zh-lightbox-thumb";this.hc()};var Ir=function(){if(window.console){var a=Array.from(arguments);a.unshift("["+(new Date).toLocaleTimeString()+"]:\t");window.console.log.apply?window.console.log.apply(window.console,a):window.console.log(a[0],a.slice(1).join(","))}}; z.py=function(a){a=void 0===a?{}:a;z.R.call(this);if(void 0===typeof a.Da)throw Error("$form option is required.");var b=Object.assign({Ko:"FormItem",iw:function(){return window.Promise.resolve()},Tq:window.$.noop,JK:!0,zF:{},validator:function(a){return z.qy(b.Da,a)}},a);this.wf=b;this.Da=b.Da;this.w(b.Da[0])}; var ry=function(a,b){var c=a.wf,d=c.Da,f=c.Ko;b&&(z.ta(b)?Object.entries(b).forEach(function(a){var b=z.ia(a);a=b.next().value;var b=b.next().value,c=d.find("[name\x3d"+a+"]").first().addClass("is-error");a='\x3cp class\x3d"'+f+'-error"\x3e'+b+"\x3c/p\x3e";b=c.parents("\n ."+f+", ."+f+"-section,\n ."+f+"-uploader, ."+f+"-radio-group\n ").first().addClass("is-error");c=b.find("."+f+"-error-container");c.length?c.html(a):(b.hasClass(""+f)&&(b=b.find("."+f+"-content")),b.append(a))}): d.find('[type\x3d"submit"]').after('\x3cspan class\x3d"'+f+'-error is-inline"\x3e\n '+(b||"服务器错误,请稍后重试...")+"\n \x3c/span\x3e").parents("."+f).addClass("is-error"))}; z.qy=function(a,b){b=void 0===b?{}:b;for(var c=window.$.unique(a.find("input, select").filter(function(){return(0,window.$)(this).data("required")}).map(function(){return(0,window.$)(this).attr("name")}).get()),d={},c=z.ia(c),f=c.next();!f.done;f=c.next()){var f=f.value,g=b[f];if(z.na(g)&&0===g.length||!g){d[f]="必填项";var g=a.find("[name\x3d"+f+"]"),h=g.data("empty-tip");h&&(d[f]="placeholder"===h?g.attr("placeholder"):h)}}return window.$.isEmptyObject(d)?null:d}; var sy=function(a,b){function c(a){a=a.val();d.cH&&(a=window.$.trim(a));d.CR&&window.$.isNumeric(a)&&(a=Number(a));return a}var d=Object.assign({cH:!1,CR:!1,VO:function(a){return a.attr("name")}},b),f={};a.find("select, textarea, input").not("\n input[type\x3dcheckbox]:not(:checkbox),\n input[type\x3dradio]:not(:checked),\n input[name^\x3d_]\n ").each(function(){var b=(0,window.$)(this);if(!b.is(":disabled")&&b.parents("form").first().is(a)){var h=d.VO(b);if(h)if(b.is('[type\x3d"checkbox"]'))"undefined"=== typeof f[h]&&(f[h]=[]),f[h].push(c(b));else if(b.is('[type\x3d"file"]')){if("undefined"===typeof f[h]&&(f[h]=[]),b=b.data("file")||b.val()){try{b=JSON.parse(b)}catch(k){}f[h].push(b)}}else f[h]=c(b)}});return f};var ty=function(a,b){z.G.call(this);this.h=a;var c=z.jf(this.h)?this.h:this.h?this.h.body:null;this.zR=!!c&&z.Mg(c);this.sH=z.F(this.h,z.B?"DOMMouseScroll":"mousewheel",this,b)};var uy=function(a,b){return z.D&&(z.Uc||z.Kl)&&0!=a%b?a:a/b}; var vy=function(a,b,c,d){z.Pc.call(this,b);this.type="mousewheel";this.detail=a;this.deltaX=c;this.deltaY=d};var wy=function(){z.G.call(this)};var xy=function(a,b){return null==a.Ak?b:a.Wo+Math.round((b-a.Wo)/a.Ak)*a.Ak};var yy=function(a,b){z.R.call(this,a);this.WC=null;this.Bb=new wy;this.IR=b||z.Gl;z.F(this.Bb,"change",this.bG,!1,this)}; var zy=function(a,b){b?(a.v().g(a.le,"beforedrag",a.ps).g(a.Uf,"beforedrag",a.ps).g(a.le,["start","end"],a.As).g(a.Uf,["start","end"],a.As).g(a.vb,"key",a.mf).g(a.m(),"click",a.ws).g(a.m(),"mousedown",a.ws),a.QG&&Ay(a,!0)):(a.v().qa(a.le,"beforedrag",a.ps).qa(a.Uf,"beforedrag",a.ps).qa(a.le,["start","end"],a.As).qa(a.Uf,["start","end"],a.As).qa(a.vb,"key",a.mf).qa(a.m(),"click",a.ws).qa(a.m(),"mousedown",a.ws),a.QG&&Ay(a,!1))}; var By=function(a,b){var c=z.Cg(b,a.m());return"vertical"==a.Nb?c.y:a.ae&&a.qd()?a.m().clientWidth-c.x:c.x};var Cy=function(a,b){var c=a.Ec(),d=a.Vc();if("vertical"==a.Nb){var f=a.cb.offsetHeight,g=a.m().clientHeight-f,f=By(a,b)-f/2;return(d-c)*(g-f)/g+c}f=a.cb.offsetWidth;g=a.m().clientWidth-f;f=By(a,b)-f/2;return(d-c)*f/g+c};var Dy=function(a,b){if(b==a.cb)return a.Bb.X();if(b==a.Gd)return a.Bb.X()+a.Bb.hi();throw Error("Illegal thumb element. Neither minThumb nor maxThumb");}; var Ey=function(a,b){Math.abs(b)=a.Ec()&&b>=c+a.zt&&a.Vc()>=b&&Fy(a,c,b-c)};var Fy=function(a,b,c){a.Ec()<=b&&b<=a.Vc()-c&&a.zt<=c&&c<=a.Vc()-b&&(b!=a.X()||c!=a.hi())&&(a.Bb.Ct=!0,a.Bb.Bu(0),a.Bb.Ea(b),a.Bb.Bu(c),a.Bb.Ct=!1,a.bG())}; var Hy=function(a,b){return b<=a.Bb.X()+a.Bb.hi()/2?a.cb:a.Gd};var Iy=function(a){if(a.cb&&!a.Bo){var b=Jy(a,Dy(a,a.cb)),c=Jy(a,Dy(a,a.Gd));if("vertical"==a.Nb)a.cb.style.top=b.y+"px",a.Gd.style.top=c.y+"px",a.Sb&&(b=Ky(c.y,b.y,a.cb.offsetHeight),a.Sb.style.top=b.offset+"px",a.Sb.style.height=b.size+"px");else{var d=a.ae&&a.qd()?"right":"left";a.cb.style[d]=b.x+"px";a.Gd.style[d]=c.x+"px";a.Sb&&(b=Ky(b.x,c.x,a.cb.offsetWidth),a.Sb.style[d]=b.offset+"px",a.Sb.style.width=b.size+"px")}}}; var Ky=function(a,b,c){var d=Math.ceil(c/2);return{offset:a+d,size:Math.max(b-a+c-2*d,0)}};var Jy=function(a,b){var c=new z.Ge;if(a.cb){var d=a.Ec(),f=a.Vc(),f=b==d&&d==f?0:(b-d)/(f-d);"vertical"==a.Nb?(d=a.m().clientHeight-a.cb.offsetHeight,f=Math.round(f*d),c.x=Ly(a,a.cb),c.y=d-f):(c.x=Math.round(f*(a.m().clientWidth-a.cb.offsetWidth)),c.y=a.cb.offsetTop)}return c}; var My=function(a,b){b=Zo(b,a.Ec(),a.Vc());a.Bo&&(a.En.stop(!0),a.En.H());var c=new Uw,d,f=Hy(a,b),g=a.X(),h=a.hi(),k=Dy(a,f),m=Jy(a,k);d=a.$n();Math.abs(b-k)k?d:-d),a.Ec(),a.Vc()));Gy(a,f,b);k=Jy(a,Dy(a,f));d="vertical"==a.Nb?[Ly(a,f),k.y]:[k.x,f.offsetTop];m=new fr(f,[m.x,m.y],d,100);m.Lg(a.ae);c.add(m);a.Sb&&Ny(a,f,g,h,k,c);a.WC&&(f=a.WC.pY(g,b,100),z.y(f,function(a){c.add(a)}));a.En=c;a.v().g(c,"end",a.xO);a.Bo=!0;c.play(!1)}; var Ny=function(a,b,c,d,f,g){var h=Jy(a,c),k=Jy(a,c+d);c=h;d=k;b==a.cb?c=f:d=f;"vertical"==a.Nb?(b=Ky(k.y,h.y,a.cb.offsetHeight),h=Ky(d.y,c.y,a.cb.offsetHeight),f=new fr(a.Sb,[Ly(a,a.Sb),b.offset],[Ly(a,a.Sb),h.offset],100),b=new ir(a.Sb,b.size,h.size,100)):(b=Ky(h.x,k.x,a.cb.offsetWidth),h=Ky(c.x,d.x,a.cb.offsetWidth),f=new fr(a.Sb,[b.offset,a.Sb.offsetTop],[h.offset,a.Sb.offsetTop],100),b=new hr(a.Sb,b.size,h.size,100));f.Lg(a.ae);b.Lg(a.ae);g.add(f);g.add(b)}; var Oy=function(a){var b=a.m();b&&(z.cj(b,"valuemin",a.Ec()),z.cj(b,"valuemax",a.Vc()),z.cj(b,"valuenow",a.X()),z.cj(b,"valuetext",a.IR(a.X())||""))};var Ay=function(a,b){b?(a.dk||(a.dk=new ty(a.m())),a.v().g(a.dk,"mousewheel",a.YF)):a.v().qa(a.dk,"mousewheel",a.YF)};var Ly=function(a,b){return a.ae?z.nj(b):b.offsetLeft};var Py=function(a,b){yy.call(this,a,b);this.Bb.Bu(0)};var Qy=function(a){z.R.call(this);this.options=window.$.extend({},this.defaults,a)}; var Ry=function(a,b){a.zoom=b;Sy(a,a.Je.yq/2+a.Je.x,a.Je.ao/2+a.Je.y)};var Sy=function(a,b,c){var d=a.zoom;a.Je={yq:a.options.wg/d,ao:a.options.vg/d,x:b-a.options.wg/d/2,y:c-a.options.vg/d/2};Ty(a)};var Ty=function(a){var b=a.zoom,c=Zo(a.options.Pm-a.Je.x*b,a.options.wg+a.options.Pm-a.Is*b,a.options.Pm),d=Zo(a.options.Qm-a.Je.y*b,a.options.vg+a.options.Qm-a.Hs*b,a.options.Qm),f={width:b*a.Is,height:b*a.Hs,left:c,top:d};a.Fq.css(f);a.uv.css(f);a.Je.x=(a.options.Pm-c)/b;a.Je.y=(a.options.Qm-d)/b}; z.Uy=function(a,b,c){z.R.call(this);this.er=a||z.Vy;this.aF=b;this.vJ=c||"l"};var Wy=function(){return!!window.FileReader}; var Xy=function(a){a.Tl=a.Hy=a.Mj="";if(a.dialog)a.dialog.ha();else{a.dialog=new z.V(null);a.dialog.Na("修改图片");var b=z.Lm.Te,c=z.Lm.Ag,d=new z.Oj;d.set(b,"取消",!1,!0).set(c,"确定",!0);z.Lj(a.dialog,d);a.v().g(a.dialog,z.Nj,function(a){if(a.key===c){if(Wy()){var b=this.Ow;a=(0,window.$)("\x3ccanvas\x3e\x3c/canvas\x3e");a.attr("width",b.options.wg);a.attr("height",b.options.vg);var d=a[0];(0,window.$)(window.document.body).append(d);var k=a[0].getContext("2d"),m=b.Je;k.drawImage(b.Js,m.x,m.y,m.yq,m.ao, 0,0,b.options.wg,b.options.vg);b=d.toDataURL("image/png");a.remove();a=b}else a=this.Ow.Je;this.Mj=a;Yy(this);this.dialog.G(!1);return!1}})}Zy(a.dialog.S());a.dialog.G(!0);z.W.add(a.dialog.h,"avatar-edit-dialog")};var $y=function(a){var b=a.input.cloneNode();z.Po(b,a.input);a.input=b;a.v().g(a.input,"change",a.Hc)}; var Yy=function(a){if(a.Mj&&(Wy()||a.Hy)){a.dispatchEvent("beforepost");var b={type:a.er,dest_id:a.er===z.Vy?z.T[3]:a.aF,return_size:a.vJ};if(Wy()){var c=new window.FormData;c.append("handle_mode","upload");c.append("picture",az(a.Mj.replace(/data\:image\/\w{3,4};base64,/,"")),a.file.name);window.$.each(b,function(a,b){c.append(a,b)});window.$.ajax({url:a.ZB,data:c,method:"post",processData:!1,contentType:!1,success:window.$.proxy(a.lE,a),dataType:"json",xhrFields:{withCredentials:!0},crossDomain:!0})}else{var b= window.$.extend(b,{handle_mode:"resize",x:Math.round(a.Mj.x),y:Math.round(a.Mj.y),height:Math.round(a.Mj.ao),width:Math.round(a.Mj.yq),hashval:a.Hy}),d='\x3cform target\x3d"av_up_frame" style\x3d"display:none;" method\x3d"post" action\x3d"'+a.ZB+'"\x3e';window.$.each(b,function(a,b){d+='\x3cinput type\x3d"hidden" name\x3d"'+a+'" value\x3d"'+b+'" /\x3e'});d+="\x3c/form\x3e";b=(0,window.$)(d);b.appendTo(a.h);b[0].submit()}}}; var Zy=function(a){var b=(0,window.$)("\x3cdiv class\x3d'new-avatar-editor-loading'\x3e\x3cdiv\x3e\x3cspan\x3e\x3c/span\x3e\x3c/div\x3e\x3cdiv\x3e正在上传...\x3c/div\x3e\x3c/div\x3e");a=(0,window.$)(a);a.html("");a.append(b)};var az=function(a){var b,c;c="image/png";b=b||512;a=(0,window.atob)(a);for(var d=[],f=0;f=(0,z.I)()-a.Hr[b]}; z.bB=function(a){a.ue&&Nq(a.ue);Nq(a.Jr)};var dB=function(a){z.tf(a.target,"A")&&a.preventDefault()};z.eB=function(a){var b=a.m();if(b){var c=z.Du(b);b==c?z.zu(b,0).select():z.Qu(c,!0);z.$A(a)}};var fB=function(a){if(!z.ka(a.hz)&&(a.hz=!1,z.C&&a.nc())){for(var b=a.im.Va();b!=b.parent;)try{b=b.parent}catch(c){break}b=b.location;a.hz="https:"==b.protocol&&-1==b.search.indexOf("nocheckhttps")}return a.hz};z.gB=function(a,b){DA.call(this,a,b)}; var hB=function(a){if(a.Tp?0:a.Tp=!0){var b=YA(a),c=a.m(),d=!1;if(b&&c){var f,g=b.parentNode,h=g.offsetWidth;(0,window.parseInt)(Fo(b,"width"),10)!=h&&(f=z.Pg(c),b.style.width=h+"px",c.style.width=h-f.left-f.right+"px",d=!0);g=g.offsetHeight;a.Fo()&&(0,window.parseInt)(Fo(b,"height"),10)!=g&&(f||(f=z.Pg(c)),b.style.height=g+"px",c.style.height=g-f.top-f.bottom+"px",d=!0)}a.Tp=!1;d&&a.dispatchEvent("ifrsz")}};var iB=function(a){a.m()&&(hB(a),a.Fo()||a.pB())}; z.jB=function(a,b){var c=a.split("!");this.type=c[0]+"!";this.namespace=c[1];this.yc=new kB(b)};var kB=function(a){this.category=a.category;this.action=a.action;this.label=a.label;this.value=a.value};var lB=function(){z.G.call(this)};z.mB=function(){z.G.call(this)};var nB=function(a,b,c){window.$.post(a,b).done(function(a){if(a.r)z.X.message(a.msg);else{var b=a.msg;(b=b&&b.redirect)?window.location.href=b:(z.X.message("操作成功!"),c&&c(a))}})}; var oB=function(a,b){var c=window.$.extend({action:"get_member_info",reason:b.value},a.zO);return window.$.post("/manage",c).then(function(a){return z.Ka("用户已被警告 %s 次,禁言 %s 次",a.warn_num,a.ban_num)})};z.pB=function(a){a=void 0===a?{}:a;"post"===a.type&&(a.type="article");this.type=a.type;this.id=a.id;this.submit=z.Jq(this.submit.bind(this),!0);this.render=z.Jq(this.render.bind(this),!0)}; var qB=function(a){if(a){var b=z.X({title:"举报成功",content:'\x3cp\x3e您的举报正在等待人工审核,我们会在 24 小时内审核完成\x3cbr\x3e处理完成后会「私信」通知您\x3cbr\x3e您也可以进入 \x3ca href\x3d"/community/report"\x3e社区服务中心\x3c/a\x3e 查看实时处理进度\x3c/p\x3e\x3cp style\x3d"margin-top: 1em"\x3e\x3clabel\x3e\x3cinput type\x3d"checkbox" name\x3d"neverRemind"\x3e不再提醒\x3c/label\x3e\x3c/p\x3e',modal:!0,ha:!0,buttons:{yes:"知道了"}});b.g(z.pk,function(){b.fi().querySelector("[name\x3dneverRemind]").checked&&window.$.post("/community/report/noti",{cancel:!0})})}else{var c= z.X({title:"举报成功",content:"您的举报正在等待人工审核,我们会在 24 小时内审核完成",modal:!0,buttons:{}});(0,window.setTimeout)(function(){return c.G(!1)},4E3)}};var rB=function(a){z.R.call(this);z.Mb(this.J={},this.defaults,a||{});this.Xm=new z.Rd;this.re=null};var sB=function(a,b){var c=a.J,d=new z.xx(c.trigger,!1,null,b);d.Sp=c.OV;d.no=c.HQ;d.sh(a.dj);z.F(d,"trigger",function(a){d.setPosition(new z.ex(a.anchor,1))});z.F(d,"beforeshow",function(a){this.re=a.target.anchor;this.render()},!1,a);d.className=c.lM;a.MQ=d}; var tB=function(a,b){var c=a.J.ER,d=z.ef(a.dj),f=z.qb(d,function(a){return a.getAttribute("data-action")===b});if(!f||z.W.has(f,c))return!1;z.y(d,function(a){z.W.remove(a,c)});z.W.add(f,c);return!0};var uB=function(a,b,c,d){a.Xm.set(b,{name:b,R:c,Rh:d||z.p})};z.vB=function(a){z.R.call(this);z.Mb(this.J={},this.defaults,a||{})};var wB=function(a){var b=a.J,c=a.h;xB(c);b=yB(c,b.lG);b.length&&(a.dispatchEvent("willScrape"),window.$.when.apply(window.$,b).always(function(){a.dispatchEvent("didScrape")}))}; var zB=function(a,b,c){for(;a&&a!==b;){if(c(a))return a;a=a.parentNode}};var AB=function(a,b){return zB(a,b,function(a){return BB(a)||"CODE"===a.nodeName||"PRE"===a.nodeName})};var BB=function(a){return"A"===a.nodeName};var xB=function(a){var b=z.Jo(a,function(b){return 3===b.nodeType&&!AB(b,a)}),c,d=z.vu(),f=d&&z.Et(d);z.y(b,function(a){var b=a.nodeValue,d=CB(b);d!==b&&(b=z.We(d),f===a&&(c=b.lastChild),z.Po(b,a))});c&&z.Qu(c)}; var yB=function(a,b){var c=z.mb(a.getElementsByTagName("A"),function(a){var b=a.getAttribute("href");if(b=!(!b||"#"===b)&&!a.getAttribute("data-editable")&&z.A(DB,a.protocol))b=z.of(a),z.Ja(a.href,b)?a=void 0:(a.setAttribute("data-editable",!0),a.setAttribute("data-title",b),a=!0),b=!a;return b});return z.nb(c,function(c){return EB(c.href).done(function(f){FB(a,c,f,b)})})}; var FB=function(a,b,c,d){if(c&&a.contains(b)){d=d||{};var f=function(a,b,c){var d=z.vu();if(d){var f=d.Z(),r=d.va(),w=d.la(),H=d.La();z.lf(b,f)&&(f=a,r=0);z.lf(b,w)&&(w=a,H=0);c(function(){f===a&&w===a?z.Qu(a):z.gu(f,r,w,H).select()})}else c(z.p)};a={link:function(a,b){a.setAttribute("data-editable",!0);b.title===a.href?a.setAttribute("data-title",GB(a.hostname)):(a.setAttribute("data-title",b.title),f(a,a,function(c){z.mf(a,b.title);c()}))},image:function(a,b){var c=window.document.createElement("img"); c.src=b.src;c.setAttribute("data-rawwidth",b.width);c.setAttribute("data-rawheight",b.height);f(c,a,function(b){z.Po(c,a);b()})}};(d=d[c.type]||a[c.type])&&d(b,c)}};var GB=function(a){return a.split(".").slice(/(.com|.edu|.gov|.net|.org)$/.test(a)?-2:-3).join(".").replace(/^www\./,"")+" 的页面"};var CB=function(a){return a.replace(HB,function(a){z.Ja(a,"http")||(a="http://"+a);return a.link(a)})}; var IB=function(a){var b=new rB({});uB(b,"link","链接",function(a){z.mf(a,a.href)});uB(b,"text","文本",function(a){z.mf(a,a.getAttribute("data-title"))});b.w(a);var c=b.Xx();z.hx(c,new z.pg(2,0,0,0));z.ux(c,new z.pg(2,0,0,0));var d=b.v();d.g(c,"beforeshow",function(a){a=a.target.anchor;var c=z.of(a);c===a.href?tB(b,"link"):(c!==a.getAttribute("data-title")&&a.setAttribute("data-title",c),tB(b,"text"))}).g(c,"beforehide",function(b){if((b=b.target)&&a.contains(b)&&BB(b))return!1});var f;d.g(c,"show",function(a){f= a.target.anchor;z.W.add(f,"hover")}).g(c,"hide",function(){f&&(z.W.remove(f,"hover"),f=null)});return b}; z.JB=function(a,b,c){z.R.call(this);this.id=a;this.type=b;this.Ha=null;this.Og=this.Wt=!1;this.kc="写下你的评论…";this.placeholder='\x3cp style\x3d"color:#999"\x3e'+this.kc+"\x3c/p\x3e";this.Yj="";this.Ja=-1;this.Az=window.$.Deferred().resolve();this.AA=this.pt=null;this.QD="zm-comment-box";this.Rd=null;a=KB[b];if(!a)throw Error("API not found");this.Dg=window.$.extend({},KB._default_,a);this.hj="";z.Mb(this.J={},this.defaults,c||{})};var LB=function(a){return z.Jq(a,!0,function(){return this.hj})}; var MB=function(a,b,c){if(!z.jf(a)||"TEXTAREA"===a.nodeName)return function(){};var d=new z.vB({lG:{image:z.p}});d.w(a);b=(new z.vh).add("type",b+"_comment").add("resource_id",c);var f=new sv(a,{Vm:{source:"/people/autocomplete?"+b.toString()},mk:z.N("zu-main")||window.document.body});new lv(a,{NA:Cv});return function(){d.H();f.H()}};z.NB=function(a,b,c){var d=z.N(a.QD,b);c&&(a.Rd=c);d?a.w(d):(a.Wt=!0,a.render(b))}; var OB=function(a){z.Db({$C:".load-more",xn:".zm-comment-list",YD:".zm-comment-form",Ha:".zm-comment-editable"},function(a,c){this[c]=(0,window.$)(a,this.h)[0]},a)}; var PB=function(a){a.Ha&&a.Ha.setAttribute("aria-label",a.kc);if(z.Tm){var b=a.Ha;b.setAttribute("contentEditable",!0);var c=a.oj={m:function(){return b},Al:function(){return Kr(b)?"":b.innerHTML},Pd:function(a,c){b.innerHTML=c},Wf:function(){z.Pu(b)}};z.Bc(a,MB(c.m(),a.type,a.id))}else QB(a);a.v().g(a.Ha,["change","keyup"],function(a){27!==a.keyCode&&(z.Hu(this.Ha)?this.Yj="":this.Yj=this.Ua())}).g(a.oj.m(),"focus",function(){this.na({action:"click_add_[type]_comment_box"})});RB(a)}; var QB=function(a){var b=z.O("textarea",{placeholder:a.kc,"class":"zm-comment-textarea"});z.Po(b,a.Ha);new z.Sr(b);a.Ha=b;a.oj={m:function(){return b},Al:function(){return b.value},Pd:function(){b.value="";b.style.height=z.Ag(22,!0)},Wf:function(){b.focus()}}}; var SB=function(a){var b=a.oj,c=b.m();if(b.Al()!==a.placeholder){b.Pd(!1,a.placeholder);var d=["click","focus","keydown"],f=function(){b.Pd(!1,this.Yj||"");this.Ha.lastChild?z.Qu(this.Ha.lastChild):b.Wf();z.md(c,d,f,!1,this)};z.F(c,d,f,!1,a);var g;window.getSelection?(g=window.getSelection(),g.anchorNode&&z.lf(a.Ha,g.anchorNode)&&g.removeAllRanges()):window.document.selection&&a.Ha.blur()}};var TB=function(a){a.focus();a=z.yu(a);a.collapse();a.select()}; var UB=function(a){var b;(b=z.N("zm-comment-reply-hack"))?(b=z.We(z.Ko(b)),z.W.Rv(b,"zm-comment-reply-hack","zm-comment-reply-hacked"),z.bf(b,a)):(b="",z.T.Fb()&&(b='\x3cimg class\x3d"avatar" src\x3d"'+z.T.be("is")+'"\x3e'),b=z.We('\x3cdiv class\x3d"zm-comment-form expanded"\x3e\x3cdiv class\x3d"zm-comment-editable-wrap"\x3e'+b+'\x3cdiv class\x3d"zm-comment-editable" aria-label\x3d"写下你的回复"\x3e\x3c/div\x3e\x3c/div\x3e\x3cdiv class\x3d"zm-command zg-clear"\x3e\x3ca href\x3d"javascript:;" class\x3d"zm-comment-submit zg-right zg-btn-blue"\x3e评论\x3c/a\x3e\x3ca href\x3d"javascript:;" class\x3d"zm-comment-close zm-command-cancel"\x3e取消\x3c/a\x3e\x3c/div\x3e\x3c/div\x3e'), a.appendChild(b));return b};var VB=function(a,b){return z.qb(WB(a),function(a){return a.getAttribute("data-id")===b})};var WB=function(a){return(0,window.$)(a.xn).children(".zm-item-comment").get()}; var XB=function(a){a.v().g(a.h,"click",a.Qa).g(a.Ha,"keydown",a.WS).g(z.Cp,"anon_change",a.Gj).g(a.oj.m(),["click","focus"],z.Ba(a.Gu,!0)).g(a.oj.m(),"focus",z.Ba(a.Mi,"add_comment_start"));a.Ja=Number(a.h.getAttribute("data-count"));(0,window.$)(a.h).on("focusin focusout","."+a.J.uf,function(a){(0,window.$)(this).toggleClass("focusin","focusin"===a.type)});!z.Uj&&a.$C&&(a.AA=or().then(window.$.proxy(a.vH,a)))};var YB=function(a){0k){g.preventDefault();(0,window.$)(".user-image",f).attr("src",b);g=h.by();var h=h.Tx(),k=z.Wn(window).y,m=z.Oe(window).height,n=Zo(k+45+15,Math.min(g.y,h.y)+k,k+m-15),r=Zo(k+45+15,Math.max(g.y,h.y)+k,k+m-15);z.rm.Ab?(m=(z.Oe(window).width-265)/2,g=z.Ll?h.y>g.y?h.y+k+10:g.y+k-10:-1!== d?d+3:n+(r-n)/2-15):(m=-1!==c?c+3:a.offset().left+a.width()/2-15,g=-1!==d?d+3:n+(r-n)/2-15);f.css({position:"absolute",left:m,top:g}).finish().fadeIn(300).delay(2E3).fadeOut(300)}d=c=-1})}; var JC=function(a,b,c){function d(a,b,c){a=["作者:"+b,"链接:"+a,"来源:知乎","著作权归作者所有。商业转载请联系作者获得授权,非商业转载请注明出处。"];b=["",""];return a=c?a.concat(b):b.concat(a)}function f(a,b,c,f){b=d(b,c,f).join("\x3cbr /\x3e");return"\x3cdiv\x3e"+(f?b+a:a+b)+"\x3c/div\x3e"}function g(a,b,c,f){b=d(b,c,f).join("\n");return f?b+a:a+b}function h(){var a="";window.getSelection?a=window.getSelection().toString():window.document.selection&&"Control"!==window.document.selection.type&&(a=window.document.selection.createRange().text); return a}function k(a){var d=z.vu(),k=d&&(0,z.ab)(d.Id());if(k&&!(128>k.length)){k=512<=k.length;if("object"===typeof a.originalEvent.clipboardData&&(a.originalEvent.clipboardData.setData("text/html",f(d.$f(),b,c,k)),a.originalEvent.clipboardData.setData("text/plain",g(h(),b,c,k)),0b;b++){var c="\"'".charAt(b);if(a.charAt(0)==c&&a.charAt(a.length-1)==c){a=a.substring(1,a.length-1);break a}}return a};var QE=function(a,b){z.y(b,function(b){var d=b.value,f=PE(d);b=new z.oD(b.caption,d,a.K());On(b,f);a.Fa(b);b.S().style.fontFamily=d})}; var RE=function(a){z.y(SE,function(b){var c=b.value;b=new z.oD(b.caption,c,a.K());a.Fa(b);b=b.S();b.style.fontSize=(TE[c]||10)+"px";b.firstChild.style.height="1.1em"})};var UE=function(a){z.y(VE,function(b){var c=b.caption;b=b.Aa;var d=a.K(),c=new z.oD(d.B("DIV",null,c),b,d);On(c,b);a.Fa(c)})};z.WE=function(a,b,c,d,f,g){c=new z.sE(XE(c,d,g),f,g);On(c,a);c.wd(b);return c};z.YE=function(a,b,c,d,f,g){a=z.WE(a,b,c,d,f,g);a.Tb(16,!0);return a}; var ZE=function(a,b,c,d,f,g){f=new OE(null,null,f,g);d&&z.y(d.split(/\s+/),f.Kh,f);f.Kh("goog-toolbar-select");HE(f,c);On(f,a);f.wd(b);return f};var $E=function(a,b,c,d,f,g){c=new EE(XE(c,d,g),null,f,g);On(c,a);c.wd(b);return c};var XE=function(a,b,c){a&&""!=a||!z.B||z.E("1.9a")||(a=" ");return(c||z.J()).B("DIV",b?{"class":b}:null,a)};var aF=function(a){var b="en-us".replace(/_/,"-").toLowerCase(),c=[];b in bF&&(c=bF[b]);c.length&&QE(a,c);QE(a,cF)}; var dF=function(a,b,c,d,f,g){var h=z.WE(a,b,c,d,f,g);h.Pi=function(a){h.Wa(a)};return h};var eF=function(a,b){var c=b;try{if(z.C)var d="000000"+c.toString(16),f=d.substr(d.length-6,6),c="#"+f.substring(4,6)+f.substring(2,4)+f.substring(0,2);c!=a.X()&&a.Ea(c)}catch(g){}};z.fF=function(a){z.wA.call(this);this.ga=new z.xd(this);this.tG=z.O("div",{style:"display:none"});this.h=this.rc=null;this.J={};z.Mb(this.J,this.defaults,a||{})}; var gF=function(a){a.dispatchEvent("willEnterFullScreen")&&(a.$E||(a.KQ=window.history.length),a.$E=!0,hF(a,"writing"),a.cL=z.vf(z.J((z.t||window).document)),z.Po(a.tG,a.J.Ek),a.rc.appendChild(a.J.Ek),z.W.add(window.document.body,a.J.Tn),a.Eb=z.N(a.J.uW,a.h),a.Eb.appendChild(a.kq),iF(a),(0,z.ab)(z.of(a.F.Ha))||a.F.Wf(),a.dispatchEvent("enterFullScreen"))}; var jF=function(a){!z.Vj&&a.$E&&a.KQ!==window.history.length?window.history.back():hF(a,"");a.Eb.removeChild(a.kq);a.MJ(!1);a.h.onscroll=null;a.ga.qa(window.document,"keydown",a.ip);z.Po(a.J.Ek,a.tG);z.W.remove(window.document.body,a.J.Tn);window.scrollTo(a.cL.x,a.cL.y);a.dispatchEvent("exitFullScreen")};var hF=function(a,b){a.ga.qa(window,"hashchange",a.nI);window.location.hash=b||"";(0,window.setTimeout)((0,z.q)(function(){this.ga.g(window,"hashchange",this.nI)},a))}; var iF=function(a){var b=a.h;b.scrollTop=0;var c=a.Eb.getBoundingClientRect().top;b.onscroll=z.hp((0,z.q)(a.MJ,a),function(){return b.scrollTop>c});a.ga.g(window.document,"keydown",a.ip)};z.kF=function(){this.Lx=["zg-btn-follow","zg-btn-unfollow"];this.Mx="people"};z.Vk.prototype.Lp=z.Fn(27,function(a){this.hj=a});z.Xj.prototype.Pg=z.Fn(26,function(a,b){if(!this.h)return null;for(var c=b||"A",d=a;null!=d&&d!==this.h;){if(d.tagName===c)return d;d=d.parentNode}return null}); z.V.prototype.vm=z.Fn(25,function(a){this.Wk=a;this.wa&&z.Sj(this)});z.Bj.prototype.Du=z.Fn(22,function(a){this.qp=a});z.Bj.prototype.Ua=z.Fn(21,function(){return null!=this.rc?z.Gd(this.rc):""});z.oj.prototype.Wa=z.Fn(20,function(a){this.ec=a});z.oj.prototype.Lg=z.Fn(18,function(a){this.Qi=a});z.R.prototype.uh=z.Fn(17,function(a){if(this.wa)throw Error("Component already rendered");this.og=a});z.R.prototype.qd=z.Fn(16,function(){null==this.og&&(this.og=z.Mg(this.wa?this.h:this.da.ua().body));return this.og}); z.qg.prototype.Rg=z.Fn(15,function(){return new z.He(this.width,this.height)});z.qg.prototype.cz=z.Fn(14,function(a){var b=Math.max(this.left,a.left),c=Math.min(this.left+this.width,a.left+a.width);if(b<=c){var d=Math.max(this.top,a.top);a=Math.min(this.top+this.height,a.top+a.height);if(d<=a)return this.left=b,this.top=d,this.width=c-b,this.height=a-d,!0}return!1}); z.Rf.prototype.Pq=z.Fn(13,function(a,b,c){var d=(0,z.I)(),f=c?c:d,g=Bn(this.Ur);g.Wr=2;g.Vr=f;g.type=b;g.XD=a;a=(a=this.vY)&&a.isTracing()?a.totalVarAlloc:-1;g.qK=a;this.Gw++;if(c){c=this.Sf.length;for(a=0;af){z.xb(this.Sf,a,0,g);break}a==c&&this.Sf.push(g)}else this.Sf.push(g);if(f=g.type)g=this.zk.get(f),g||(g=Bn(this.vB),g.type=f,this.zk.set(f,g)),g.count++;this.Xu+=(0,z.I)()-d}); z.Ie.prototype.bg=z.Fn(12,function(a){var b;(b="A"==a.tagName||"INPUT"==a.tagName||"TEXTAREA"==a.tagName||"SELECT"==a.tagName||"BUTTON"==a.tagName?!a.disabled&&(!yn(a)||xn(a)):Dn(a))&&z.C?(a=z.sa(a.getBoundingClientRect)?a.getBoundingClientRect():{height:a.offsetHeight,width:a.offsetWidth},a=null!=a&&0(0,z.I)()-this.rz};z.e.G=function(a){this.Em&&this.Em.stop();this.Ql&&this.Ql.stop();a?this.mB():this.Rl()};z.e.ha=z.p; z.e.mB=function(){if(!this.Xj&&this.bp()){if(!this.h)throw Error("Caller must call setElement before trying to show the popup");this.ha();var a=z.Je(this.h);this.rG&&this.ga.g(a,"keydown",this.PS,!0);if(this.Wk)if(this.ga.g(a,"mousedown",this.lI,!0),z.C){var b;try{b=a.activeElement}catch(d){}for(;b&&"IFRAME"==b.nodeName;){try{var c=b.contentDocument||b.contentWindow.document}catch(d){break}a=c;b=a.activeElement}this.ga.g(a,"mousedown",this.lI,!0);this.ga.g(a,"deactivate",this.jI)}else this.ga.g(a, "blur",this.jI);"toggle_display"==this.Xb?(this.h.style.visibility="visible",z.Q(this.h,!0)):"move_offscreen"==this.Xb&&this.ha();this.Xj=!0;this.uz=(0,z.I)();this.rz=-1;this.Em?(z.ld(this.Em,"end",this.lk,!1,this),this.Em.play()):this.lk()}};z.e.Rl=function(a){if(!this.Xj||!this.dispatchEvent({type:"beforehide",target:a}))return!1;this.ga&&this.ga.removeAll();this.Xj=!1;this.rz=(0,z.I)();this.Ql?(z.ld(this.Ql,"end",z.Ba(this.fE,a),!1,this),this.Ql.play()):this.fE(a);return!0}; z.e.fE=function(a){"toggle_display"==this.Xb?this.HV?z.vd(this.sG,0,this):this.sG():"move_offscreen"==this.Xb&&(this.h.style.top="-10000px");this.kk(a)};z.e.sG=function(){this.h.style.visibility="hidden";z.Q(this.h,!1)};z.e.bp=function(){return this.dispatchEvent("beforeshow")};z.e.lk=function(){this.dispatchEvent("show")};z.e.kk=function(a){this.dispatchEvent({type:"hide",target:a})};z.e.lI=function(a){a=a.target;z.lf(this.h,a)||zn(this,a)||this.nD&&!z.lf(this.nD,a)||150>(0,z.I)()-this.uz||this.Rl(a)}; z.e.PS=function(a){27==a.keyCode&&this.Rl(a.target)&&(a.preventDefault(),a.stopPropagation())};z.e.jI=function(a){if(this.wO){var b=z.Je(this.h);if("undefined"!=typeof window.document.activeElement){if(a=b.activeElement,!a||z.lf(this.h,a)||"BODY"==a.tagName)return}else if(a.target!=b)return;150>(0,z.I)()-this.uz||this.Rl()}};z.e.D=function(){z.Ln.o.D.call(this);this.ga.H();z.Cc(this.Em);z.Cc(this.Ql);delete this.h;delete this.ga;delete this.mD}; var co=/&([^;\s<&]+);?/g,no={'"':'\\"',"\\":"\\\\","/":"\\/","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r","\t":"\\t","\x0B":"\\u000b"},lF=/[^\d]+$/;ko.prototype.serialize=function(a){var b=[];lo(this,a,b);return b.join("")};ko.prototype.serializeArray=function(a,b){var c=a.length;b.push("[");for(var d="",f=0;fb.charCode&&z.eo(c)?b.charCode:0):z.ug&&!z.D?(c=this.ri,d=z.eo(c)?b.keyCode:0):(c=b.keyCode||this.ri,d=b.charCode||0,qF&&(f=this.Yv),z.Uc&&63==d&&224==c&&(c=191));var g=c=z.lj(c),h=b.keyIdentifier;c?63232<=c&&c in nF?g=nF[c]:25==c&&a.shiftKey&&(g=9):h&&h in oF&&(g=oF[h]);a=g==this.ge;this.ge=g;b=new Lp(g,d,a,b);b.altKey= f;this.dispatchEvent(b)};z.e.m=function(){return this.h};z.e.attach=function(a,b){this.at&&this.detach();this.h=a;this.$s=z.F(this.h,"keypress",this,b);this.lz=z.F(this.h,"keydown",this.mf,b,this);this.at=z.F(this.h,"keyup",this.VP,b,this)};z.e.detach=function(){this.$s&&(z.nd(this.$s),z.nd(this.lz),z.nd(this.at),this.at=this.lz=this.$s=null);this.h=null;this.ri=this.ge=-1};z.e.D=function(){Kp.o.D.call(this);this.detach()};z.x(Lp,z.Pc);var rF;z.la(Mp);var sF={button:"pressed",checkbox:"checked",menuitem:"selected",menuitemcheckbox:"checked",menuitemradio:"checked",radio:"checked",tab:"selected",treeitem:"selected"};z.e=Mp.prototype;z.e.jf=function(){};z.e.B=function(a){return a.K().B("DIV",this.Xf(a).join(" "),a.Ua())};z.e.S=function(a){return a};z.e.rj=function(a,b,c){if(a=a.m?a.m():a){var d=[b];z.C&&!z.E("7")&&(d=Qp(z.fj(a),b),d.push(b));(c?z.ij:z.kj)(a,d)}};z.e.Ob=function(){return!0}; z.e.w=function(a,b){b.id&&On(a,b.id);var c=this.S(b);c&&c.firstChild?a.wm(c.firstChild.nextSibling?z.vb(c.childNodes):c.firstChild):a.wm(null);var d=0,f=this.U(),g=this.U(),h=!1,k=!1,m=!1,n=z.vb(z.fj(b));z.y(n,function(a){h||a!=f?k||a!=g?d|=this.ns(a):k=!0:(h=!0,g==f&&(k=!0));1==this.ns(a)&&Dn(c)&&z.nf(c,!1)},this);a.N=d;h||(n.push(f),g==f&&(k=!0));k||n.push(g);var r=a.hf;r&&n.push.apply(n,r);if(z.C&&!z.E("7")){var w=Qp(n);0=uF&&(z.Jg(this.element,a),this.et=a)};z.e.hg=function(){this.et=kr;jr.o.hg.call(this)};z.e.ig=function(){this.et=kr;jr.o.ig.call(this)};z.e.show=function(){this.element.style.display=""};z.e.hide=function(){this.element.style.display="none"};z.x(lr,jr);lr.prototype.hg=function(){this.show();lr.o.hg.call(this)}; lr.prototype.ig=function(){this.hide();lr.o.ig.call(this)};z.x(mr,jr);mr.prototype.hg=function(){this.show();mr.o.hg.call(this)};z.x(nr,er);nr.prototype.Dh=function(){for(var a=[],b=0;b/g,nR:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g},escape:function(a){return(""+a).replace(/&/g,"\x26amp;").replace(//g,"\x26gt;").replace(/"/g,"\x26quot;").replace(/'/g,"\x26#x27;").replace(/\//g,"\x26#x2F;")}},c=/.^/;return function(d,f){var g=b.fW,g="var __p\x3d[],print\x3dfunction(){__p.push.apply(__p,arguments);};with(data||{}){__p.push('"+d.replace(/\\/g, "\\\\").replace(/'/g,"\\'").replace(g.escape||c,function(b,c){return"',_.escape("+a(c)+"),'"}).replace(g.nR||c,function(b,c){return"',"+a(c)+",'"}).replace(g.evaluate||c,function(b,c){return"');"+a(c).replace(/[\r\n\t]/g," ")+";__p.push('"}).replace(/\r/g,"\\r").replace(/\n/g,"\\n").replace(/\t/g,"\\t")+"');}return __p.join('');",h=new Function("data","_",g);return f?h(f,b):function(a){return h.call(this,a,b)}}}();z.Mr.defaults={paddingTop:0};var Or={offsetTop:0,paddingTop:0,aw:!1}; (0,window.$)(function(){Or.paddingTop=z.Pg(window.document.body).top});z.yF=z.Qj(function(){return(+new Date).toString(32).slice(-5)+Math.random().toString(32).slice(-3)});z.x(z.Sr,z.Xj);z.Sr.prototype.FK=function(){return Tr(this)};z.la(Vr);z.e=Vr.prototype;z.e.jf=function(){return this.ew};z.e.B=function(a){return a.K().B("DIV",this.Xf(a).join(" "))};z.e.S=function(a){return a};z.e.Ob=function(a){return"DIV"==a.tagName};z.e.w=function(a,b){b.id&&On(a,b.id);var c=this.U(),d=!1,f=z.fj(b);f&&z.y(f,function(b){b==c?d=!0:b&&(b==c+"-disabled"?a.Wa(!1):b==c+"-horizontal"?a.setOrientation(z.zF):b==c+"-vertical"&&a.setOrientation(rz))},this);d||z.hj(b,c);Xr(this,a,this.S(b));return b}; z.e.Wn=function(a){a:{var b;a=z.fj(a);for(var c=0,d=a.length;cthis.Ta&&b<=this.Ta?this.Ta++:athis.Ta&&this.Ta--}; z.e.removeChild=function(a,b){if(a=z.pa(a)?z.Zg(this,a):a){var c=Nn(this,a);-1!=c&&(c==this.Ta?(a.Mc(!1),this.Ta=-1):c(0,z.I)()-this.aK)&&this.dispatchEvent({type:ls,Di:this.Sa[a].id})};z.x(z.Us,z.ks);z.Us.prototype.vh=function(a){this.M.vh(a)};z.Us.prototype.fB=function(a){this.Kd.fB(a)};z.Us.prototype.ia=function(a){this.Kd.ia(a)};z.x(z.Vs,z.Us);z.Vs.prototype.defaults={source:"",Le:10,SW:!1,filter:null,format:null,az:null,delay:300,separator:null,dO:null,multiple:!1,vk:null,RY:null,placeholder:"",td:null,render:null};z.Vs.prototype.defaults.format=function(a){return function(b,c){return(0,z.ab)(c)&&z.na(b)?z.na(b[0])?z.nb(b[0].slice(1),a,this):b:[]}}(function(a){var b;return(b=BF[this.J.source])||(b=BF[CF][a[0]])?b(a):a});var CF="/autocomplete",BF={}; BF[CF]={topic:function(a){return{type:a[0],name:a[1],url_token:a[2],avatar:a[3],id:a[4],answers:a[6],alias:a[7],raw:a,value:a[4],label:a[1]}},question:function(a){return{type:a[0],title:a[1],id:a[2],url_token:a[3],answers:a[4],is_star:!!a[5],raw:a,label:a[1],value:a[2]}},people:function(a){return{type:a[0],fullname:a[1],url_token:a[2],avatar:a[3],id:a[4],headline:a[5],raw:a,label:a[1],value:a[4]}},search_link:function(a){return{type:a[0],raw:a,label:a[1],value:a[1]}}}; BF["/topic/autocomplete"]=function(a){return{type:a[0],name:a[1],url_token:a[2],avatar:a[3],id:a[4],followers:a[5],alias:a[6],label:a[1]}};BF["/question/autocomplete"]=function(a){return{type:a[0],title:a[1],id:a[2],url_token:a[3],is_duplicated:Boolean(+a[4]),answer_count:a[5],raw:a,label:a[1],value:a[2]}};z.x(Ws,z.ys);Ws.prototype.Xc=z.p;Ws.prototype.Zb=z.p;Ws.prototype.Gi=function(){return!1};var Zs;z.x(z.Xs,z.R);z.e=z.Xs.prototype;z.e.Vf=null;z.e.KR=10;z.e.Ml=!1;z.e.B=function(){this.h=this.K().B("INPUT",{type:"text"})};z.e.Y=function(a){z.Xs.o.Y.call(this,a);this.Mb||(this.Mb=a.getAttribute("label")||"");Cn(z.Je(a))==a&&(this.Ml=!0,z.jj(this.m(),this.Lo));Ys()&&(this.m().placeholder=this.Mb);z.cj(this.m(),"label",this.Mb)}; z.e.C=function(){z.Xs.o.C.call(this);var a=new z.xd(this);a.g(this.m(),"focus",this.UF);a.g(this.m(),"blur",this.ey);Ys()?this.T=a:(z.B&&a.g(this.m(),["keypress","keydown","keyup"],this.HP),a.g(z.Re(z.Je(this.m())),"load",this.zQ),this.T=a,$s(this));this.Th();this.m().JR=this};z.e.Hb=function(){z.Xs.o.Hb.call(this);this.T&&(this.T.H(),this.T=null);this.m().JR=null};z.e.D=function(){z.Xs.o.D.call(this);this.T&&(this.T.H(),this.T=null)};z.e.Lo="label-input-label"; z.e.UF=function(){this.Ml=!0;z.jj(this.m(),this.Lo);if(!Ys()&&!at(this)&&!this.RQ){var a=this,b=function(){a.m()&&(a.m().value="")};z.C?z.vd(b,10):b()}};z.e.ey=function(){Ys()||(this.T.qa(this.m(),"click",this.UF),this.Vf=null);this.Ml=!1;this.Th()};z.e.HP=function(a){27==a.keyCode&&("keydown"==a.type?this.Vf=this.m().value:"keypress"==a.type?this.m().value=this.Vf:"keyup"==a.type&&(this.Vf=null),a.preventDefault())};z.e.LP=function(){at(this)||(this.m().value="",z.vd(this.hP,10,this))}; z.e.hP=function(){at(this)||(this.m().value=this.Mb)};z.e.zQ=function(){this.Th()};z.e.hasFocus=function(){return this.Ml};z.e.clear=function(){this.m().value="";null!=this.Vf&&(this.Vf="")};z.e.reset=function(){at(this)&&(this.clear(),this.Th())};z.e.Ea=function(a){null!=this.Vf&&(this.Vf=a);this.m().value=a;this.Th()};z.e.X=function(){return null!=this.Vf?this.Vf:at(this)?this.m().value:""}; z.e.Th=function(){var a=this.m();Ys()?this.m().placeholder!=this.Mb&&(this.m().placeholder=this.Mb):$s(this);z.cj(a,"label",this.Mb);at(this)?(a=this.m(),z.jj(a,this.Lo)):(this.RQ||this.Ml||(a=this.m(),z.hj(a,this.Lo)),Ys()||z.vd(this.YU,this.KR,this))};z.e.Wa=function(a){this.m().disabled=!a;z.uo(this.m(),this.Lo+"-disabled",!a)};z.e.isEnabled=function(){return!this.m().disabled};z.e.YU=function(){!this.m()||at(this)||this.Ml||(this.m().value=this.Mb)};var ZC={LF:function(a,b){return window.$.get(b?"/node/AnswerFullVoteInfoV2":"/node/AnswerVoteInfoV2",{params:{answer_id:a}})},jC:function(a,b){return window.$.post("/node/AnswerVoteBarV2",{method:b,params:{answer_id:a}},function(a){a&&a.r&&z.X.alert("\x3cp\x3e"+a.msg+"\x3c/p\x3e")})},aB:function(a,b){return window.$.post("/node/AnswerMetaV2",{method:"set_copyright",params:{answer_id:a,is_copyable:Number(b)}})}};z.x(gt,z.ys);gt.prototype.Gi=function(a){var b=gt.o.Gi.call(this,a);a.select(this.aa.cy());return b};z.x(ht,z.Gs);ht.prototype.uU=["根话题","未归类话题"];ht.prototype.Pp=function(a){this.RA=a};ht.prototype.Ci=function(a,b,c){var d=(0,z.q)(function(a,b){for(var d=[],k,m=0;m=a.length?!1:z.$n(this.data,function(d){return d[1]===a[2]?b===a[1]?(a[0]="plain_text",a[1]='"'+b+'"已在现有列表中',!0):!1:!0})},this)},this)}; z.e.Ue=function(a,b){this.fh||(this.fh=!0,this.xhr=new z.Z(!0),this.v().ya(this.xhr,"complete",this.Tv),a||(a=-1),this.jz?this.xhr.ajax("/topic/add","tid\x3d"+this.Gf+"\x26pid\x3d"+a+"\x26topic_text\x3d"+(0,window.encodeURIComponent)(b)):this.xhr.ajax("/topic/add","tid\x3d"+this.Gf+"\x26cid\x3d"+a+"\x26topic_text\x3d"+(0,window.encodeURIComponent)(b)))};z.e.sF=function(a){return'\x3ca class\x3d"nor" href\x3d"/topic/'+a[1]+'/organize"\x3e'+a[0]+"\x3c/a\x3e"}; z.e.mp=function(a){if(!this.ea||!this.ea.tc()){var b=new z.Z(!0);this.v().g(b,"success",function(){var c=z.Rn(b);c.r?z.X.message(c.msg):(ot(this),this.Ne(),this.dispatchEvent({type:"remove_tag",data:{id:a}}))});this.jz?b.ajax(this.mJ,"cid\x3d"+this.Gf+"\x26pid\x3d"+a):b.ajax(this.mJ,"pid\x3d"+this.Gf+"\x26cid\x3d"+a);this.ea=b}};z.x(ut,z.lt);z.e=ut.prototype; z.e.w=function(a){ut.o.w.call(this,a);this.Ke(!0);z.y(z.Le(window.document,"a",null,a),function(a){z.Q(a,!1)});this.v().g(this.rb,"focus",function(){this.Iq.val()&&!this.WE&&(this.WE=!0,this.bv());this.placeholder&&(this.placeholder.wk("搜索话题"),In(this.placeholder))});this.eH=new Kp;this.eH.attach(this.rb);this.v().g(this.eH,"key",function(a){8===a.keyCode&&(1===this.rb.value.length&&(this.uD=!0,this.bN=(0,window.setTimeout)((0,z.q)(function(){this.uD=!1;(0,window.clearTimeout)(this.bN)},this))),this.rb.value.length|| this.uD||(this.data.pop(),this.Ne(),this.dispatchEvent("remove_tag")))});this.$V=new z.fl(this.bv,2E3,this);this.v().g(this.Iq[0],"keyup",function(){var a=this.Iq.val();this.Nu!==a&&(this.$V.fire(),this.Nu=a)});this.v().g(this,["remove_tag","add_tag"],function(){vt(this);0this.data.length?this.Ue((0,window.$)(a).attr("data-id"),(0,window.$)(a).attr("data-text")):this.Dq.addClass("light")},this)),this.zv=(0,window.$)('\x3clabel for\x3d"topic" class\x3d"zg-icon icon-magnify"\x3e\x3c/label\x3e'),(0,window.$)(this.ef).prepend(this.zv),this.placeholder=new z.vk(this.rb,{text:"搜索话题",pD:!0}),(0,window.$)(this.ef).append(this.Dq= (0,window.$)("\x3clabel class\x3d'err-tip' style\x3d'display:none;'\x3e最多添加五个话题\x3c/label\x3e")),this.v().g(this.Tc,"click",this.yW))};z.e.yW=function(a){z.Er(this.h,a.target)||(a=z.N("zu-question-suggest-topic-input",this.Tc),z.Kg(a)&&a.focus())}; z.e.bv=function(){this.WE&&(this.Nu=this.Iq.val(),8>this.Nu.length?(this.$p=[],vt(this)):(this.aq&&this.aq.abort(),this.aq=new z.Z(!1),this.v().g(this.aq,"success",this.xT),this.aq.ajax("/topic-question/autocomplete?token\x3d"+this.Nu+"\x26max_matches\x3d5\x26use_similar\x3d0","GET"),this.Av.attr("src",this.Av.attr("data-src")).show()))};z.e.xT=function(){this.$p=z.Rn(this.aq)[0].slice(1);vt(this)}; z.e.Ne=function(){var a=[];z.y(this.data,function(b){a.push(['\x3cdiv class\x3d"zm-tag-editor-edit-item"\x3e\x3cspan\x3e',b[0],'\x3c/span\x3e\x3ca id\x3d"rmid-',b[3],'" href\x3d"#" class\x3d"zg-r3px zm-tag-editor-remove-button" name\x3d"remove"\x3e\x3c/a\x3e\x3c/div\x3e'].join(""))},this);this.Kn.innerHTML=a.join("")};z.e.reset=function(){this.data=[];ot(this);this.Ne()}; z.e.wI=function(a){var b=a.id.split("-")[1],c=z.No(a).innerHTML;this.data=z.mb(this.data,function(a){return b?String(a[3])!==b:a[1]!==c});this.mp(b)};z.e.Ue=function(a,b){var c=[b,b,"",a];this.GJ=c;this.data.push(c);ot(this);this.Ne();this.rb.value="";this.dispatchEvent("select");this.dispatchEvent("add_tag")};z.e.Wa=function(a){this.rb&&z.Q(this.rb,a)}; z.e.trackEvent=function(){if(this.$p){var a=0,b=this.data.length;z.y(this.data,function(b){z.y(this.$p,function(d){b[1]===d[1]&&a++},this)},this);z.Y.tb({type:"ga_click_add_question",data:{Ou:a,total:b}})}};z.x(z.wt,z.tt);z.wt.prototype.Ue=function(a){this.fh||(this.fh=!0,this.xhr=new z.Z(!0),this.v().ya(this.xhr,"complete",this.Tv),this.xhr.ajax(this.yD,"tid\x3d"+a+"\x26method\x3dadd"))}; z.wt.prototype.mp=function(a){this.fh||(this.fh=!0,this.xhr=new z.Z(!0),this.v().g(this.xhr,"complete",function(){ot(this);this.Ne();this.fh=!1}),this.xhr.ajax(this.yD,"tid\x3d"+a+"\x26method\x3ddel"))};z.x(xt,z.xc);xt.prototype.restore=function(a){var b=this.ru();a||this.H();return b};z.x(z.yt,xt);z.yt.prototype.yp=function(a){z.P(z.zt(this,!0));z.P(z.zt(this,!1));return a};z.yt.prototype.ru=function(){var a=null,b=z.zt(this,!this.QA),c=z.zt(this,this.QA);if(b&&c){var a=b.parentNode,b=z.lb(a.childNodes,b),d=c.parentNode,c=z.lb(d.childNodes,c);d==a&&(this.QA?b--:c--);a=z.gu(a,b,d,c);a=this.yp(a);a.select()}else this.yp();return a};z.yt.prototype.D=function(){this.yp();this.da=null};z.x(z.At,z.Ld);z.e=z.At.prototype;z.e.setPosition=function(a,b,c){if(this.node=a)this.Ub=z.qa(b)?b:1!=this.node.nodeType?0:this.Jc?-1:1;z.qa(c)&&(this.depth=c)};z.e.Gg=function(a){this.node=a.node;this.Ub=a.Ub;this.depth=a.depth;this.Jc=a.Jc;this.xr=a.xr};z.e.clone=function(){return new z.At(this.node,this.Jc,!this.xr,this.Ub,this.depth)};z.e.Vp=z.aa(31); z.e.next=function(){var a;if(this.xk){if(!this.node||this.xr&&0==this.depth)throw z.Od;a=this.node;var b=this.Jc?-1:1;if(this.Ub==b){var c=this.Jc?a.lastChild:a.firstChild;c?this.setPosition(c):this.setPosition(a,-1*b)}else(c=this.Jc?a.previousSibling:a.nextSibling)?this.setPosition(c):this.setPosition(a.parentNode,-1*b);this.depth+=this.Ub*(this.Jc?-1:1)}else this.xk=!0;a=this.node;if(!this.node)throw z.Od;return a};z.e.Yl=function(){return this.xk}; z.e.equals=function(a){return a.node==this.node&&(!this.node||a.Ub==this.Ub)};z.e.splice=function(a){var b=this.node,c=this.Jc?1:-1;this.Ub==c&&(this.Ub=-1*c,this.depth+=this.Ub*(this.Jc?-1:1));this.Jc=!this.Jc;z.At.prototype.next.call(this);this.Jc=!this.Jc;for(var c=z.oa(arguments[0])?arguments[0]:arguments,d=c.length-1;0<=d;d--)z.bf(c[d],b);z.P(b)};z.e=Bt.prototype;z.e.Qb=function(){var a=this.sc();return 1==a.nodeType?a:a.parentNode};z.e.$g=function(){return!1};z.e.ua=function(){return z.Je(z.C?this.sc():this.Z())};z.e.Va=function(){return z.Re(this.ua())};z.e.containsNode=function(a,b){return this.Fg(z.yu(a),b)};z.e.Bi=function(a){this.isCollapsed()||this.yf();return this.insertNode(a,!0)};z.x(It,z.At);z.x(Jt,Bt);Jt.prototype.Fg=function(a,b){var c=z.Dt(this),d=z.Dt(a);return(b?z.pb:z.$n)(d,function(a){return z.pb(c,function(c){return c.Fg(a,b)})})};Jt.prototype.insertNode=function(a,b){b?z.af(a,this.Z()):z.bf(a,this.la());return a};Jt.prototype.cq=function(a,b){this.insertNode(a,!0);this.insertNode(b,!1)};z.x(z.Kt,It);z.e=z.Kt.prototype;z.e.ms=function(){return 3!=this.node.nodeType?-1:this.node==this.xa?this.Ca:0};z.e.hs=function(){return 3!=this.node.nodeType?-1:this.node==this.ta?this.Ba:this.node.nodeValue.length};z.e.Z=function(){return this.xa};z.e.la=function(){return this.ta};z.e.Go=function(){return this.Yl()&&this.node==this.ta&&(!this.Ba||1!=this.Ub)};z.e.next=function(){if(this.Go())throw z.Od;return z.Kt.o.next.call(this)};z.e.Vp=z.aa(30); z.e.Gg=function(a){this.xa=a.xa;this.ta=a.ta;this.Ca=a.Ca;this.Ba=a.Ba;this.sf=a.sf;z.Kt.o.Gg.call(this,a)};z.e.clone=function(){var a=new z.Kt(this.xa,this.Ca,this.ta,this.Ba,this.sf);a.Gg(this);return a};z.e=Lt.prototype;z.e.ej="";z.e.set=function(a){this.ej=""+a};z.e.append=function(a,b,c){this.ej+=a;if(null!=b)for(var d=1;d=this.we(d,1,0):0<=this.we(d,0,0)&&0>=this.we(d,1,1)}catch(f){if(!z.C)throw f;return!1}};z.e.containsNode=function(a,b){return this.Fg(Xt(a),b)}; z.e.Xn=function(){var a=new Lt;z.Pd(this,function(b,c,d){3==b.nodeType?a.append(z.Na(b.nodeValue.substring(d.ms(),d.hs()))):1==b.nodeType&&(-1==d.Ub?z.Ye(b)&&a.append("\x3c/"+b.tagName+"\x3e"):(c=b.cloneNode(!1),c=z.Ko(c),z.C&&"LI"==b.tagName?a.append(c):(b=c.lastIndexOf("\x3c"),a.append(b?c.substr(0,b):c))))},this);return a.toString()};z.e.gd=function(){return new z.Kt(this.Z(),this.va(),this.la(),this.La())};z.x(Ot,Mt);z.e=Ot.prototype;z.e.clone=function(){return new this.constructor(this.O.cloneRange())};z.e.sc=function(){return this.O.commonAncestorContainer};z.e.Z=function(){return this.O.startContainer};z.e.va=function(){return this.O.startOffset};z.e.la=function(){return this.O.endContainer};z.e.La=function(){return this.O.endOffset}; z.e.we=function(a,b,c){return this.O.compareBoundaryPoints(1==c?1==b?z.t.Range.START_TO_START:z.t.Range.START_TO_END:1==b?z.t.Range.END_TO_START:z.t.Range.END_TO_END,a)};z.e.isCollapsed=function(){return this.O.collapsed};z.e.Id=function(){return this.O.toString()}; z.e.$f=function(){var a=z.J(this.O.startContainer).B("DIV");a.appendChild(this.O.cloneContents());a=a.innerHTML;if(z.Ja(a,"\x3c")||!this.isCollapsed()&&!z.Va(a,"\x3c"))return a;var b=this.sc(),b=1==b.nodeType?b:b.parentNode;return z.Ko(b.cloneNode(!1)).replace("\x3e","\x3e"+a)};z.e.select=function(a){var b=z.Re(z.Je(this.Z()));this.Gp(b.getSelection(),a)};z.e.Gp=function(a){a.removeAllRanges();a.addRange(this.O)}; z.e.yf=function(){var a=this.O;a.extractContents();if(a.startContainer.hasChildNodes()){var b=a.startContainer.childNodes[a.startOffset];if(b){var c=b.previousSibling;""==z.Io(b)&&z.P(b);c&&""==z.Io(c)&&z.P(c)}}if(z.Jl){var b=this.Z(),c=this.va(),d=this.la(),f=this.La(),g=b.nextSibling;b==d&&b.parentNode&&3==b.nodeType&&g&&3==g.nodeType&&(b.nodeValue+=g.nodeValue,z.P(g),a.setStart(b,c),a.setEnd(d,f))}};z.e.surroundContents=function(a){this.O.surroundContents(a);return a}; z.e.insertNode=function(a,b){var c=this.O.cloneRange();c.collapse(b);c.insertNode(a);c.detach();return a}; z.e.cq=function(a,b){var c=z.Re(z.Je(this.Z()));if(c=z.vu(c))var d=c.Z(),f=c.la(),g=c.va(),h=c.La();var k=this.O.cloneRange(),m=this.O.cloneRange();k.collapse(!1);m.collapse(!0);k.insertNode(b);m.insertNode(a);k.detach();m.detach();if(c){if(3==d.nodeType)for(;g>d.length;){g-=d.length;do d=d.nextSibling;while(d==a||d==b)}if(3==f.nodeType)for(;h>f.length;){h-=f.length;do f=f.nextSibling;while(f==a||f==b)}z.gu(d,g,f,h).select()}};z.e.collapse=function(a){this.O.collapse(a)};z.x(St,Ot);St.prototype.Gp=function(a,b){!b||this.isCollapsed()?St.o.Gp.call(this,a,b):(a.collapse(this.la(),this.La()),a.extend(this.Z(),this.va()))};z.x(z.Tt,Mt);z.e=z.Tt.prototype;z.e.clone=function(){var a=new z.Tt(this.O.duplicate(),this.Or);a.mg=this.mg;a.xa=this.xa;a.ta=this.ta;return a};z.e.Dd=function(){this.mg=this.xa=this.ta=null;this.Ca=this.Ba=-1}; z.e.sc=function(){if(!this.mg){var a=this.O.text,b=this.O.duplicate(),c=a.replace(/ +$/,"");(c=a.length-c.length)&&b.moveEnd("character",-c);c=b.parentElement();b=z.np(b.htmlText).length;if(this.isCollapsed()&&0z.np(c.outerHTML).length;)c=c.parentNode;for(;1==c.childNodes.length&&c.innerText==Zt(c.firstChild)&&Qt(c.firstChild);)c=c.firstChild;0==a.length&&(c=Vt(this,c));this.mg=c}return this.mg}; z.e.Z=function(){this.xa||(this.xa=Wt(this,1),this.isCollapsed()&&(this.ta=this.xa));return this.xa};z.e.va=function(){0>this.Ca&&(this.Ca=Yt(this,1),this.isCollapsed()&&(this.Ba=this.Ca));return this.Ca};z.e.la=function(){if(this.isCollapsed())return this.Z();this.ta||(this.ta=Wt(this,0));return this.ta};z.e.La=function(){if(this.isCollapsed())return this.va();0>this.Ba&&(this.Ba=Yt(this,0),this.isCollapsed()&&(this.Ca=this.Ba));return this.Ba}; z.e.we=function(a,b,c){return this.O.compareEndPoints((1==b?"Start":"End")+"To"+(1==c?"Start":"End"),a)};z.e.cg=z.aa(35);z.e.isCollapsed=function(){return 0==this.O.compareEndPoints("StartToEnd",this.O)};z.e.Id=function(){return this.O.text};z.e.$f=function(){return this.O.htmlText};z.e.select=function(){this.O.select()}; z.e.yf=function(){if(!this.isCollapsed()&&this.O.htmlText){var a=this.Z(),b=this.la(),c=this.O.text,d=this.O.duplicate();d.moveStart("character",1);d.moveStart("character",-1);d.text==c&&(this.O=d);this.O.text="";this.Dd();c=this.Z();d=this.va();try{var f=a.nextSibling;a==b&&a.parentNode&&3==a.nodeType&&f&&3==f.nodeType&&(a.nodeValue+=f.nodeValue,z.P(f),this.O=Ut(c),this.O.move("character",d),this.Dd())}catch(g){}}}; z.e.surroundContents=function(a){z.P(a);a.innerHTML=this.O.htmlText;(a=$t(this.O,a))&&this.O.moveToElementText(a);this.Dd();return a};z.e.insertNode=function(a,b){var c=au(this.O.duplicate(),a,b);this.Dd();return c};z.e.cq=function(a,b){var c=this.O.duplicate(),d=this.O.duplicate();au(c,a,!0);au(d,b,!1);this.Dd()};z.e.collapse=function(a){this.O.collapse(a);a?(this.ta=this.xa,this.Ba=this.Ca):(this.xa=this.ta,this.Ca=this.Ba)};z.x(bu,Ot);bu.prototype.Gp=function(a){a.collapse(this.Z(),this.va());this.la()==this.Z()&&this.La()==this.va()||a.extend(this.la(),this.La());0==a.rangeCount&&a.addRange(this.O)};z.x(cu,Ot);cu.prototype.we=function(a,b,c){return z.E("528")?cu.o.we.call(this,a,b,c):this.O.compareBoundaryPoints(1==c?1==b?z.t.Range.START_TO_START:z.t.Range.END_TO_START:1==b?z.t.Range.START_TO_END:z.t.Range.END_TO_END,a)};cu.prototype.Gp=function(a,b){b?a.setBaseAndExtent(this.la(),this.La(),this.Z(),this.va()):a.setBaseAndExtent(this.Z(),this.va(),this.la(),this.La())};z.x(z.eu,Bt);z.e=z.eu.prototype;z.e.clone=function(){var a=new z.eu;a.Ph=this.Ph&&this.Ph.clone();a.xa=this.xa;a.Ca=this.Ca;a.ta=this.ta;a.Ba=this.Ba;a.sf=this.sf;return a};z.e.li=function(){return"text"};z.e.ce=function(){return z.iu(this).O};z.e.Dd=function(){this.xa=this.Ca=this.ta=this.Ba=null};z.e.Fj=function(){return 1};z.e.Be=function(){return this};z.e.sc=function(){return z.iu(this).sc()};z.e.Z=function(){return this.xa||(this.xa=z.iu(this).Z())}; z.e.va=function(){return null!=this.Ca?this.Ca:this.Ca=z.iu(this).va()};z.e.by=function(){return z.iu(this).by()};z.e.la=function(){return this.ta||(this.ta=z.iu(this).la())};z.e.La=function(){return null!=this.Ba?this.Ba:this.Ba=z.iu(this).La()};z.e.Tx=function(){return z.iu(this).Tx()};z.e.$g=function(){return this.sf};z.e.Fg=function(a,b){var c=a.li();return"text"==c?z.iu(this).Fg(z.iu(a),b):"control"==c?(c=a.gi(),(b?z.pb:z.$n)(c,function(a){return this.containsNode(a,b)},this)):!1};z.e.cg=z.aa(34); z.e.isCollapsed=function(){return z.iu(this).isCollapsed()};z.e.Id=function(){return z.iu(this).Id()};z.e.Xn=function(){return z.iu(this).Xn()};z.e.$f=function(){return z.iu(this).$f()};z.e.gd=function(){return new z.Kt(this.Z(),this.va(),this.la(),this.La())};z.e.select=function(){z.iu(this).select(this.sf)};z.e.yf=function(){z.iu(this).yf();this.Dd()};z.e.surroundContents=function(a){a=z.iu(this).surroundContents(a);this.Dd();return a}; z.e.insertNode=function(a,b){var c=z.iu(this).insertNode(a,b);this.Dd();return c};z.e.cq=function(a,b){z.iu(this).cq(a,b);this.Dd()};z.e.TA=function(){return new ju(this)};z.e.collapse=function(a){a=this.$g()?!a:a;this.Ph&&this.Ph.collapse(a);a?(this.ta=this.xa,this.Ba=this.Ca):(this.xa=this.ta,this.Ca=this.Ba);this.sf=!1};z.x(ju,xt);ju.prototype.ru=function(){return z.gu(this.dD,this.KM,this.mF,this.JO)};ju.prototype.D=function(){ju.o.D.call(this);this.mF=this.dD=null};z.x(z.ku,Jt);z.e=z.ku.prototype;z.e.Dd=function(){this.Wp=this.fb=null};z.e.clone=function(){return mu.apply(this,this.gi())};z.e.li=function(){return"control"};z.e.ce=function(){return this.O||window.document.body.createControlRange()};z.e.Fj=function(){return this.O?this.O.length:0};z.e.Be=function(a){a=this.O.item(a);return fu(Xt(a),void 0)};z.e.sc=function(){return Lo.apply(null,this.gi())};z.e.Z=function(){return nu(this)[0]};z.e.va=function(){return 0}; z.e.la=function(){var a=nu(this),b=z.kb(a);return z.qb(a,function(a){return z.lf(a,b)})};z.e.La=function(){return this.la().childNodes.length};z.e.gi=function(){if(!this.fb&&(this.fb=[],this.O))for(var a=0;athis.St?fv(this):z.ev(this))}; z.e.Bp=function(){var a=this.m(),b=this.nw;!this.gz&&0c?fv(this):z.ev(this)}};z.la(kv);kv.prototype.$e=function(a,b,c){z.og("richtexteditor",function(){var d=window.ZH.createRichTextEditor(a,b),f=d[0],d=d[1];c&&c(f,d)})};lv.prototype.defaults={VU:[],NA:[],AN:!0};var nv="data-tip class style id bgcolor color size width height".split(" ");lv.prototype.Bg=function(){var a=this;if(this.J.AN)this.W.on("paste",function(){(0,window.setTimeout)(function(){ov(a.W,pv(a))})})};z.x(qv,z.G);z.e=qv.prototype;z.e.defaults={Vm:{Le:6,content:"",method:"GET",source:"/people/autocomplete"},jU:"mention-popup",mk:window.document.body,TC:"activated"};z.e.D=function(){this.Gr();z.P(this.h);this.h=null;qv.o.D.call(this)};z.e.uw=function(){var a=this.h=z.We(this.zW);this.tp=a.getElementsByTagName("input")[0];a.className=this.J.jU;a.style.display="none";this.J.mk.appendChild(a)};z.e.sc=function(){return this.J.mk};z.e.zW='\x3cdiv\x3e\x3cdiv class\x3d"writing-bg"\x3e\x3cinput\x3e\x3c/div\x3e\x3cdiv class\x3d"tip"\x3e想用 @ 提到谁?\x3c/div\x3e\x3c/div\x3e'; z.e.template=(0,z.Rv)('\x3c% if (data.id) { %\x3e\x3cimg class\x3d"avatar" src\x3d"\x3c%\x3davatar%\x3e"\x3e\x3cdiv class\x3d"body"\x3e\x3cspan class\x3d"name"\x3e\x3c%\x3dlabel%\x3e\x3c/span\x3e\x3cspan class\x3d"bio"\x3e\x3c%\x3dheadline%\x3e\x3c/span\x3e\x3c/div\x3e\x3c% } %\x3e');z.e.ub=function(){return z.Kg(this.h)};z.e.open=function(){this.ub()||(z.Q(this.h,!0),this.tp.focus(),this.Bg(),this.dispatchEvent("open"))}; z.e.close=function(){this.ub()&&(z.Q(this.h,!1),z.W.remove(this.h,this.J.TC),this.tp.value="",this.tp.blur(),this.Gr(),this.dispatchEvent("close"))};z.e.kI=function(a){this.ub()&&!z.lf(this.h,a.target)&&rv(this,a)};z.e.ip=function(a){var b=a.keyCode,c=this.tp;if(27===b||c===a.target&&""===c.value&&(8===b||32===b))rv(this,a),a.preventDefault(),a.stopPropagation()};z.e.Bg=function(){z.F(window.document,"click",this.kI,!1,this);z.F(this.h,"keydown",this.ip,!1,this)}; z.e.Gr=function(){z.md(window.document,"click",this.kI,!1,this);z.md(this.h,"keydown",this.ip,!1,this)}; z.e.Xg=function(){var a=this,b=this.J.Vm,c=new z.Vs(this.tp,{vk:this.h,Le:b.Le,source:b.source,select:function(b){(0,window.setTimeout)(function(){a.close();a.dispatchEvent({type:"select",data:{hU:b}})});return""},td:function(b,c,g){g.innerHTML=a.template(b.data)}});c.fB(b.method);c.ia(b.content);c.addEventListener("suggestionsupdate",function(){z.W.enable(this.h,this.J.TC,c.ub())},!1,this);this.aa=c};z.e.position=function(a){z.zg(this.h,a)};z.x(sv,z.G);var vv=!!window.getSelection;sv.prototype.defaults={Vm:{},mk:window.document.body,Po:"member_mention",Gs:"mention-holder",position:function(a,b){a.x+=b.width+7;a.y-=5;z.C&&7/g,"\n").replace(/
/g,"\n")).replace(//g,"$1");a.value=b}};z.e.DF=function(){var a=[];this.disabled||a.push('\x3ca href\x3d"javascript:;" class\x3d"zu-edit-button" name\x3d"edit"\x3e\x3ci class\x3d"zu-edit-button-icon"\x3e\x3c/i\x3e修改\x3c/a\x3e');return a.join("")}; z.e.Ex=function(){this.$r||(this.$r=!0,z.sp(this.XU+"?id\x3d"+this.Fp,(0,z.q)(function(a){this.$r=!1;a=z.Rn(a.target);a.r?z.X.message(a.msg):this.Cu(a.msg)},this),"GET"))};z.e.Cu=function(a){this.Ma.value=a};z.x(z.Hv,z.Dv);z.e=z.Hv.prototype;z.e.Cu=function(a){this.Hd?z.Hv.o.Cu.call(this,a):(a||(a=z.B?"":"\x3cdiv\x3e\x3c/div\x3e"),this.Ma.Pd(!1,a,!0))};z.e.Mp=function(){this.ready(function(){this.Fp?this.Ex():this.Hd?z.Hv.o.Mp.call(this):this.content?this.Ma.Pd(!1,this.content,!1,!0):this.Ma.Pd(!1,z.D?"\x3cdiv\x3e\x3cbr\x3e\x3c/div\x3e":"\x3cdiv\x3e\x3c/div\x3e",!1,!0)})};z.e.D=function(){z.Cc(this.Ma);z.P(this.Kb);this.Cq=this.FC=this.gg=this.ql=this.PB=this.pj=this.Kb=null;z.Hv.o.D.call(this)}; z.e.$e=function(){if(this.Hd)z.Hv.o.$e.call(this);else{var a=this.K();this.Kb=a.B("div","zm-editable-editor-wrap",this.pj=a.B("div","zm-editable-editor-outer",[this.PB=a.B("div","zm-editable-toolbar-container"),this.ql=a.B("div","zm-editable-editor-field-wrap",this.gg=a.B("div",{id:this.mS,className:"zm-editable-editor-field-element"}))]));this.FC=(0,window.$)(this.PB);this.Cq=(0,window.$)(this.Kb);this.Cq.hide();a.bz(this.Kb,this.hd);this.Fp||(this.gg.innerHTML=this.content);a={loremIpsum_:this.Dz, enableFullScreen:this.mx,content:this.content,useScraper_:this.RW,canUploadMedia_:this.ww,useRemoveFormat_:this.LK};this.hl();kv.ba().$e(this.Kb,a,(0,z.q)(this.ep,this));z.Uj||(this.tg=new iv(null,this.pj),this.tg.w(this.PB),z.dv(this.tg,!1),z.ev(this.tg),z.Ac(this,this.tg))}};z.e.ep=function(a,b){if(this.Hd)z.Hv.o.ep.call(this);else{this.Ma=a;this.Cq.show();z.Hv.o.ep.call(this);Iv(this,a,b);var c=a.Rb.CodePlugin;c&&(c.EV(b),c.Bg())}}; z.e.rg=function(){z.Hv.o.rg.call(this);this.ready(function(){this.Hd||this.sO||(this.sO=!0,z.ld(this.Ma,"load",function(){var a=this.Ma,b=a.Rb.FullScreenPlugin;z.B&&(a=a.Ha);z.F(a,["focus","blur"],function(a){b&&z.W.has(window.document.body,b.J.Tn)||Jv(this,"focus"===a.type)},!1,this)},!1,this),this.Ma.Ke())})};z.e.Zf=function(){if(this.Hd)return z.Hv.o.Zf.call(this);var a=this.Ma;return Kr(a.m(),!0)?"":a.Al()};z.e.ve=function(){z.Hv.o.ve.call(this);this.tg&&z.dv(this.tg,"editing"===this.status)};z.x(z.Lv,z.V);z.la(z.Lv); var bG='\x3cdiv class\x3d"zh-add-question-form"\x3e\n \x3cdiv class\x3d"js-add-question-splash add-question-splash-page" \x3e\n \x3cp\x3e\n 知乎是一个真诚、友善、认真、互助的社区\x3cbr\x3e\n 我们希望每一个疑惑都有解答,好的问题更容易得到好答案 \x3ca href\x3d"//www.zhihu.com/question/19555761"\x3e如何提一个好问题?\x3c/a\x3e\n \x3c/p\x3e\n \x3cp\x3e\n \x3cb\x3e提问应遵循真实、客观、简洁、明确、规范的原则\x3c/b\x3e\x3cbr\x3e\n 1、提问应尽可能简洁明了,避免「请问」「有谁知道」「谢谢!」等与问题本身无关的附加语。\x3cbr\x3e\n 2、应避免使用「为神马」「童鞋」「肿么办」等网络用语。\x3cbr\x3e\n 3、基于个人判断或传言的问题,在提问时应在补充说明里详细说明原由\x3cbr\x3e\n 4、避免太宽泛问题,如调查性的问题容易变成每个人都可以发表观点,但对其他人没有价值。\x3cbr\x3e\n \x3c/p\x3e\n \x3cp\x3e\n \x3cb\x3e知乎禁止这些提问\x3c/b\x3e\x3cbr\x3e\n 1、和已有问题完全重复的问题,\x3cb\x3e为避免重复,提问前可以先进行搜索\x3c/b\x3e\x3cbr\x3e\n 2、招聘 / 求职、交易 / 合作、寻人 / 征友、召集 / 赠送、求码类内容\x3cbr\x3e\n 3、投票类问题。例如:你支持方舟子还是韩寒?\x3cbr\x3e\n 4、作业或其他希望代为完成个人任务类的内容,以及针对个人具体病情的求医问药类问题\x3cbr\x3e\n 完整的提问建议可查看 \x3ca href\x3d"//www.zhihu.com/question/19806261"\x3e知乎的提问规范有哪些?\x3c/a\x3e\x3cbr\x3e\n \x3c/p\x3e\n \x3cdiv class\x3d"before-ask-form"\x3e\n \x3cb\x3e提问前请先搜索\x3c/b\x3e\n \x3cdiv style\x3d"position:relative;margin-top:18px;"\x3e\n \x3cinput type\x3d"text" class\x3d"zg-form-text-input" id\x3d"js-before-ask" placeholder\x3d"请输入你的问题"\x3e\n \x3c/div\x3e\n \x3c/div\x3e\n \x3c/div\x3e\n \x3cform class\x3d"js-add-question-form"\x3e\n \x3cdiv class\x3d"zg-section-big clearfix"\x3e\n \x3cdiv id\x3d"zm-modal-dialog-info-wrapper"\x3e\x3c/div\x3e\n \x3cdiv style\x3d"display: none;position: relative;" id\x3d"zm-modal-dialog-warnmsg-wrapper"\x3e\x3cdiv class\x3d"zm-modal-dialog-warnmsg zm-modal-dialog-guide-warn-message zg-r5px"\x3e\x3c/div\x3e\n \x3ca name\x3d"close" title\x3d"关闭" href\x3d"javascript:;" class\x3d"zu-global-notify-close" style\x3d"display:none"\x3ex\x3c/a\x3e\n \x3cspan class\x3d"zm-modal-dialog-guide-title-msg"\x3e\x3c/span\x3e\n \x3c/div\x3e\n \x3cdiv class\x3d"zg-form-text-input add-question-title-form" style\x3d"position: relative;"\x3e\n \x3ctextarea rows\x3d"1" class\x3d"zg-editor-input" title\x3d"在这里输入问题" id\x3d"zh-question-suggest-title-content"\x3e\x3c/textarea\x3e\n \x3c/div\x3e\n \x3cspan id\x3d"js-title-length-err-msg" class\x3d"title-length-err-msg zg-right"\x3e\x3c/span\x3e\n \x3cdiv id\x3d"zh-question-suggest-ac-wrap" class\x3d"question-suggest-ac-wrap"\x3e\x3c/div\x3e\n \x3c/div\x3e\n \x3cdiv class\x3d"zg-section-big"\x3e\n \x3cdiv style\x3d"display: none;position: relative;" class\x3d"zm-modal-dialog-warnmsg-wrapper"\x3e\n \x3cdiv class\x3d"zm-modal-dialog-warnmsg zm-modal-dialog-guide-warn-message zg-r5px"\x3e\x3c/div\x3e\n \x3ca name\x3d"close" title\x3d"关闭" href\x3d"javascript:;" class\x3d"zu-global-notify-close" style\x3d"display:none"\x3ex\x3c/a\x3e\n \x3cspan class\x3d"zm-modal-dialog-guide-title-msg"\x3e\x3c/span\x3e\n \x3c/div\x3e\n \x3cdiv class\x3d"add-question-section-title"\x3e\n \x3cspan class\x3d"zg-right extra-editor-toolbar hidden-phone"\x3e\n \x3cdiv class\x3d"js-toggle-editor-toolbar"\x3e\x3ci class\x3d"tr-inline-icon z-ico-textedit"\x3e\x3c/i\x3e\x3c/div\x3e\n \x3cdiv class\x3d"js-editor-add-pic"\x3e\x3ci class\x3d"tr-inline-icon tr-image"\x3e\x3c/i\x3e\x3c/div\x3e\n \x3cdiv class\x3d"js-editor-add-video"\x3e\x3ci class\x3d"tr-inline-icon tr-video"\x3e\x3c/i\x3e\x3c/div\x3e\n \x3c/span\x3e\n 问题说明(可选):\n \x3cspan id\x3d"zh-question-form-detail-err"\x3e\x3c/span\x3e\n \x3c/div\x3e\n \x3cdiv id\x3d"zh-question-suggest-detail-container"\x3e\n \x3cdiv class\x3d"zm-editable-content" data-disabled\x3d"1"\x3e\x3c/div\x3e\n \x3c/div\x3e\n \x3c/div\x3e\n \x3cdiv class\x3d"zm-add-question-form-topic-wrap"\x3e\n \x3cdiv class\x3d"add-question-section-title"\x3e\n \x3cspan class\x3d"zg-gray zg-right hidden-phone"\x3e话题越精准,越容易让相关领域专业人士看到你的问题\x3c/span\x3e\n 选择话题:\n \x3cspan id\x3d"zh-question-form-tag-err"\x3e\x3c/span\x3e\n \x3c/div\x3e\n \x3cdiv id\x3d"zh-question-suggest-topic-container" class\x3d"zm-tag-editor zg-section"\x3e\n \x3cdiv class\x3d"zm-tag-editor-labels"\x3e\x3c/div\x3e\n \x3cdiv id\x3d"zh-question-suggest-autocomplete-container"\x3e\x3c/div\x3e\n \x3c/div\x3e\n \x3c/div\x3e\n \x3cdiv class\x3d"zm-command"\x3e\n '+(z.T.Jd? "":'\x3clabel class\x3d"zm-question-form-hide-in-about-question-el zg-left"\x3e\n \x3cinput type\x3d"checkbox" value\x3d"1" class\x3d"zg-addq-isanon"\x3e匿名\n \x3c/label\x3e')+'\n \x3ca href\x3d"javascript:;" name\x3d"cancel" class\x3d"zm-command-cancel"\x3e取消\x3c/a\x3e\n \x3ca href\x3d"javascript:;" name\x3d"addq" class\x3d"zg-r5px zu-question-form-add zg-btn-blue"\x3e发布\x3c/a\x3e\n \x3ca name\x3d"jumpq" class\x3d"zg-r5px zg-btn-blue zu-question-form-jump" style\x3d"display:none;"\x3e查看问题\x3c/a\x3e\n \x3c/div\x3e\n \x3c/form\x3e\n\x3c/div\x3e', Ov=z.Dm.create("AddQuestionForm"+z.T.fg);z.e=z.Lv.prototype; z.e.C=function(){z.Lv.o.C.call(this);var a=z.We((0,z.ab)(bG));this.S().appendChild(a);this.Gc=z.Qo("zg-editor-input",this.h)[0];this.al=z.N("zu-question-form-add",this.h);this.mn=z.N("zu-question-form-jump",this.h);this.ek=z.L("zm-modal-dialog-warnmsg-wrapper");this.ht=z.L("js-title-length-err-msg");this.FA=z.N("zm-modal-dialog-warnmsg-wrapper",this.h);this.CE=z.L("zh-question-form-detail-err");this.EB=z.L("zh-question-form-tag-err");this.EN=z.N("zu-global-notify-close",this.ek);this.wW=z.N("zu-global-notify-close", this.FA);this.UQ=z.L("zm-modal-dialog-info-wrapper");this.Bt=z.N("zm-modal-dialog-warnmsg",this.ek);z.N("zm-modal-dialog-warnmsg",this.FA);this.KD=z.N("zg-addq-isanon",this.h);this.qW=z.N("js-toggle-editor-toolbar",this.h);this.qM=z.N("js-editor-add-pic",this.h);this.rM=z.N("js-editor-add-video",this.h);this.VV=z.N("js-add-question-splash",this.h);this.AH=z.N("js-add-question-form",this.h);this.wD=z.L("js-before-ask");this.fO=z.L("zh-question-suggest-detail-container");this.vW=z.L("zh-question-suggest-topic-container"); this.Oy();this.Rz?(Sv(this,!0),this.My()):(this.to(),Sv(this,!1));z.T.Jd&&fw(this)};z.e.show=z.Jq(function(a){this.J=window.$.extend({Lm:null,hk:null},a||{});this.G(!0)},!0,"#ask");z.e.fm=function(){z.Lv.o.fm.call(this);this.J={}};z.e.Oy=function(){this.Na("提问");z.Tj(this,550);z.Lj(this,null);this.W=(0,window.$)(this.h);this.W.addClass("absolute-position");this.G(!0);this.ha()};z.e.to=z.Qj(function(){Uv(this);this.cc();Nv(this)});z.e.mq={};z.e.mq.bJ='\x3c% forEach(questions, function(q, i) { q \x3d q.data; %\x3e\x3cdiv class\x3d"ac-row" data-url_token\x3d"\x3c%\x3dq.url_token%\x3e" data-answer_count\x3d"\x3c%\x3dq.answer_count%\x3e"\x3e\x3c% if (q.is_star) { %\x3e\x3ca class\x3d"zg-star" data-tip\x3d"s$b$优质问答" href\x3d"/question/\x3c%\x3dq.url_token%\x3e"\x3e\x3c/a\x3e\x3c% } %\x3e\x3ca class\x3d"zippy-indicator"\x3e\x3ci\x3e\x3c/i\x3e\x3c/a\x3e\x3ca style\x3d"color:#222" href\x3d"/question/\x3c%\x3dq.url_token%\x3e?q\x3d\x3c%\x3d token %\x3e"\x3e\x3c%\x3dq.title%\x3e\x3c/a\x3e \x3cspan class\x3d"zm-ac-gray"\x3e\x3c%\x3d parseInt(q.answer_count) \x3e 0 ? q.answer_count + " 个回答" : "还没有回答" %\x3e \x3c/span\x3e\x3c/div\x3e\x3c% }) %\x3e'; z.e.mq.QM='\x3c% forEach(answers, function(a, i) { %\x3e\x3cdiv class\x3d"zippy-row"\x3e\x3cdiv class\x3d"summary-item"\x3e\x3ca class\x3d"inline-block zm-item-vote-count" href\x3d"/question/\x3c%\x3dquestion_url_token%\x3e/answer/\x3c%\x3da.url_token%\x3e"\x3e\x3c%\x3da.vote_count%\x3e\x3c/a\x3e\x3c% if (a.author.url_token) { %\x3e\x3ca class\x3d"inline-block" href\x3d"/people/\x3c%\x3da.author.url_token%\x3e"\x3e\x3cspan class\x3d"author"\x3e\x3c%-a.author.name%\x3e\x3c/span\x3e \x3c/a\x3e\x3c% } else { %\x3e\x3cspan class\x3d"inline-block anon-author"\x3e\x3c%-a.author.name%\x3e\x3c/span\x3e \x3c% } %\x3e\x3cspan class\x3d"inline-block summary ellipsis"\x3e\x3c%\x3da.summary_text%\x3e\x3c/span\x3e\x3ca class\x3d"inline-block" href\x3d"/question/\x3c%\x3dquestion_url_token%\x3e/answer/\x3c%\x3da.url_token%\x3e"\x3e阅读全部 »\x3c/a\x3e\x3c/div\x3e\x3c/div\x3e\x3c% }) %\x3e'; z.e.My=function(){function a(){Sv(b,!1);b.Gc.value=d.value}var b=this,c=(0,z.Rv)(this.mq.bJ),d=this.wD,f=new Ws;this.jM=new z.Vs(d,{source:"/question/autocomplete",vk:d.offsetParent,td:function(){},render:function(b,f,k){b=(0,window.$)(b.m());b.html(c({forEach:z.y,questions:k,token:(0,window.encodeURIComponent)(this.Wb)}));0this.Oa.data.length?(a=!0,this.EB.innerHTML="至少添加一个话题"):5=a.data.size&&c.is(":visible")&&c[0].click()})}});z.Cp.on("init",function(){(0,window.$)(window.document).on("click",'a[href\x3d"#"]',function(a){a.preventDefault()})}); z.Cp.on("postinit",function(){var a=window.location.pathname;(z.T.Fb()&&"/"===a||/^\/(question|explore|collection|topic|people|search|roundtable\/)/.test(a))&&z.Ow("CommentApp")}); z.Cp.on("postinit",function(){(0,window.$)(".js-openProfilePage").on("click",function(){var a=(0,window.$)(this).attr("data-url"),a=(0,window.$)("\x3cform target\x3d'_blank' method\x3d'POST' style\x3d'display:none;'\x3e\x3c/form\x3e").attr({action:a}).appendTo(window.document.body);(0,window.$)('\x3cinput type\x3d"hidden" /\x3e').attr({name:"content",value:(0,window.$)("#performance-profile-data").text()}).appendTo(a);a.submit();a.remove()})}); z.Cp.on("init",function(){var a=z.aj.get("d_c0",""),b=new z.Z(!0);""===a&&b.ajax("/udid","","POST")});z.x(Tw,Kq);Tw.prototype.add=function(a){z.A(this.queue,a)||(this.queue.push(a),z.F(a,"finish",this.eI,!1,this))};Tw.prototype.remove=function(a){z.tb(this.queue,a)&&z.md(a,"finish",this.eI,!1,this)};Tw.prototype.D=function(){z.y(this.queue,function(a){a.H()});this.queue.length=0;Tw.o.D.call(this)};z.x(Uw,Tw); Uw.prototype.play=function(a){if(0==this.queue.length)return!1;if(a||this.N==Lq)this.Fx=0,this.hg();else if(1==this.N)return!1;this.jd("play");-1==this.N&&this.jd("resume");var b=-1==this.N&&!a;this.startTime=(0,z.I)();this.endTime=null;this.N=1;z.y(this.queue,function(c){b&&-1!=c.N||c.play(a)});return!0};Uw.prototype.pause=function(){1==this.N&&(z.y(this.queue,function(a){1==a.N&&a.pause()}),this.N=-1,this.jd("pause"))}; Uw.prototype.stop=function(a){z.y(this.queue,function(b){b.N==Lq||b.stop(a)});this.N=Lq;this.endTime=(0,z.I)();this.jd("stop");this.ig()};Uw.prototype.eI=function(){this.Fx++;this.Fx==this.queue.length&&(this.endTime=(0,z.I)(),this.N=Lq,this.jd("finish"),this.ig())};z.x(Yw,z.Xj);z.e=Yw.prototype;z.e.init=function(){if(!z.qm("back_to_top")){this.h=z.We(this.gW);window.document.body.appendChild(this.h);var a=new z.fl(this.Mt,this.jW,this);this.lK=(0,z.q)(a.fire,a);this.v().g(window,"resize",this.CI);this.CI()}};z.e.start=function(){this.xk||(this.xk=!0,this.v().g(window,"scroll",this.lK).g(this.h,"click",this.tD),this.Mt())};z.e.stop=function(){this.xk&&(this.xk=!1,this.v().qa(window,"scroll",this.lK).qa(this.h,"click",this.tD),this.hide())}; z.e.CI=function(){z.Oe().width>=this.lS?this.start():this.stop()};z.e.gW='\x3cdiv class\x3d"zh-backtotop" style\x3d"display:none"\x3e\x3ca data-action\x3d"backtotop" data-tip\x3d"s$r$回到顶部" href\x3d"javascript:;" class\x3d"btn-backtotop btn-action"\x3e\x3cdiv class\x3d"arrow"\x3e\x3c/div\x3e\x3cdiv class\x3d"stick"\x3e\x3c/div\x3e\x3c/a\x3e\x3c/div\x3e'; z.e.tD=function(){var a=z.Qe(window.document),b=z.Pe(window.document),c=b.x,b=b.y,d=new Uw,f=this.v();d.add(new gr(a,[c,b],[0,0],this.lV,Xw));d.add(new lr(this.h,this.Cx,Ww));f.g(d,"finish",this.RS);f.g(d,"begin",this.DS);d.play();z.Y.tb("ga_click_back_to_top");(0,z.Gi)(this,{action:"BackToTop",element:"Button"})};z.e.DS=function(){this.bw=this.mo=!0};z.e.RS=function(){this.bw=!1};z.e.show=function(){(new mr(this.h,this.Cx,Vw)).play();this.mo=!1}; z.e.hide=function(){(new lr(this.h,this.Cx,Ww)).play();this.mo=!0};z.e.Mt=function(){this.bw||(1200<=z.Pe(window.document).y?this.mo&&this.show():this.mo||this.hide())};Zw.prototype.link="想来知乎工作?请发送邮件到 jobs@zhihu.com";Zw.prototype.TM=" _____ _____ _____ _____ \n /\\ \\ /\\ \\ /\\ \\ /\\ \\ \n /::\\____\\ /::\\ \\ /::\\ \\ /::\\ \\ \n /:::/ / \\:::\\ \\ /::::\\ \\ /::::\\ \\ \n /:::/ / \\:::\\ \\ /::::::\\ \\ /::::::\\ \\ \n /:::/ / \\:::\\ \\ /:::/\\:::\\ \\ /:::/\\:::\\ \\ \n /:::/____/ \\:::\\ \\ /:::/__\\:::\\ \\ /:::/__\\:::\\ \\ \n /::::\\ \\ /::::\\ \\ /::::\\ \\:::\\ \\ /::::\\ \\:::\\ \\ \n /::::::\\ \\ _____ ____ /::::::\\ \\ /::::::\\ \\:::\\ \\ /::::::\\ \\:::\\ \\ \n /:::/\\:::\\ \\ /\\ \\ /\\ \\ /:::/\\:::\\ \\ /:::/\\:::\\ \\:::\\____\\ /:::/\\:::\\ \\:::\\ \\ \n/:::/ \\:::\\ /::\\____\\/::\\ \\/:::/ \\:::\\____\\/:::/ \\:::\\ \\:::| |/:::/__\\:::\\ \\:::\\____\\\n\\::/ \\:::\\ /:::/ /\\:::\\ /:::/ \\::/ /\\::/ |::::\\ /:::|____|\\:::\\ \\:::\\ \\::/ /\n \\/____/ \\:::\\/:::/ / \\:::\\/:::/ / \\/____/ \\/____|:::::\\/:::/ / \\:::\\ \\:::\\ \\/____/ \n \\::::::/ / \\::::::/ / |:::::::::/ / \\:::\\ \\:::\\ \\ \n \\::::/ / \\::::/____/ |::|\\::::/ / \\:::\\ \\:::\\____\\ \n /:::/ / \\:::\\ \\ |::| \\::/____/ \\:::\\ \\::/ / \n /:::/ / \\:::\\ \\ |::| ~| \\:::\\ \\/____/ \n /:::/ / \\:::\\ \\ |::| | \\:::\\ \\ \n /:::/ / \\:::\\____\\ \\::| | \\:::\\____\\ \n \\::/ / \\::/ / \\:| | \\::/ / \n \\/____/ \\/____/ \\|___| \\/____/ \n";z.x($w,z.Xj);z.fG=null;$w.prototype.init=function(){z.fG=this;z.ax(this)};$w.prototype.gT=function(){var a=z.Rn(this.gk);a&&!a.r&&Kn(z.Y,[a])};var cx=window.localStorage&&!z.Qh.Wl()||z.tm&&(!z.xm||z.wm);dx.prototype.ha=function(){};z.x(z.ex,dx);z.ex.prototype.ha=function(a,b,c){z.Hs(this.element,this.Ze,a,b,void 0,c,this.ZT)};z.x(fx,dx);fx.prototype.ha=function(a,b,c,d){z.Hs(Vn(a),0,a,b,this.Yh,c,null,d)};z.x(gx,z.Ln);gx.prototype.setPosition=function(a){this.au=a||void 0;this.V()&&this.ha()};gx.prototype.ha=function(){if(this.au){var a=!this.V()&&"move_offscreen"!=this.li(),b=this.m();a&&(b.style.visibility="hidden",z.Q(b,!0));this.au.ha(b,this.zA,this.Gz);a&&z.Q(b,!1)}};z.x(z.ix,gx);var qx=[];z.e=z.ix.prototype;z.e.bc=null;z.e.className="goog-tooltip";z.e.Sp=500;z.e.no=0;z.e.K=function(){return this.da};z.e.attach=function(a){a=z.L(a);this.fb.add(a);z.F(a,"mouseover",this.nd,!1,this);z.F(a,"mouseout",this.Ll,!1,this);z.F(a,"mousemove",this.Jl,!1,this);z.F(a,"focus",this.ee,!1,this);z.F(a,"blur",this.Ll,!1,this)};z.e.detach=function(a){if(a)a=z.L(a),jx(this,a),this.fb.remove(a);else{for(var b=this.fb.Wc(),c=0;a=b[c];c++)jx(this,a);this.fb.clear()}};z.e.Wx=function(){return this.no}; z.e.Pd=function(a){a=z.Hd(a,null);var b=this.m();b&&z.Fe(b,a)};z.e.sh=function(a){var b=this.m();b&&z.P(b);z.ix.o.sh.call(this,a);a?(b=this.da.ua().body,b.insertBefore(a,b.lastChild),z.Cc(this.Dk),this.Dk=new z.vj(this.m()),z.Ac(this,this.Dk),z.F(this.Dk,"focusin",this.gj,void 0,this),z.F(this.Dk,"focusout",this.Xp,void 0,this)):(z.Cc(this.Dk),this.Dk=null)};z.e.Id=function(){return z.of(this.m())};z.e.Yx=z.aa(37);z.e.getState=function(){return this.Dm?this.V()?4:1:this.Pl?3:this.V()?2:0}; z.e.Vs=function(a){if(!this.V())return!1;var b=z.Wn(this.m()),c=z.Hg(this.m());return b.x<=a.x&&a.x<=b.x+c.width&&b.y<=a.y&&a.y<=b.y+c.height};z.e.bp=function(){if(!z.Ln.prototype.bp.call(this))return!1;if(this.anchor)for(var a,b=0;a=qx[b];b++)z.lf(a.m(),this.anchor)||a.G(!1);z.sb(qx,this);a=this.m();a.className=this.className;this.gj();z.F(a,"mouseover",this.vy,!1,this);z.F(a,"mouseout",this.gG,!1,this);sx(this);return!0}; z.e.kk=function(){z.tb(qx,this);for(var a=this.m(),b,c=0;b=qx[c];c++)b.anchor&&z.lf(a,b.anchor)&&b.G(!1);this.OI&&this.OI.Xp();z.md(a,"mouseover",this.vy,!1,this);z.md(a,"mouseout",this.gG,!1,this);this.anchor=void 0;0==this.getState()&&(this.xu=!1);z.Ln.prototype.kk.call(this)};z.e.Iz=function(a,b){this.anchor==a&&this.fb.contains(this.anchor)&&(this.xu||!this.SY?(this.G(!1),this.V()||(this.anchor=a,this.setPosition(b||mx(this,0)),this.G(!0))):this.anchor=void 0);this.Dm=void 0};z.e.gi=function(){return this.fb}; z.e.zl=function(){return this.bc};z.e.HH=function(a){this.Pl=void 0;if(a==this.anchor){a=this.K();var b=a.zl();a=b&&this.m()&&a.contains(this.m(),b);null!=this.bc&&(this.bc==this.m()||this.fb.contains(this.bc))||a||this.fl&&this.fl.bc||this.G(!1)}};z.e.nd=function(a){var b=lx(this,a.target);this.bc=b;this.gj();b!=this.anchor&&(this.anchor=b,rx(this,b),px(this),kx(this,a))};z.e.Jl=function(a){kx(this,a);this.xu=!0}; z.e.ee=function(a){this.bc=a=lx(this,a.target);this.xu=!0;if(this.anchor!=a){this.anchor=a;var b=mx(this,1);this.gj();rx(this,a,b);px(this)}};z.e.Ll=function(a){var b=lx(this,a.target),c=lx(this,a.relatedTarget);b!=c&&(b==this.bc&&(this.bc=null),sx(this),this.xu=!1,!this.V()||a.relatedTarget&&z.lf(this.m(),a.relatedTarget)?this.anchor=void 0:this.Xp())};z.e.vy=function(){var a=this.m();this.bc!=a&&(this.gj(),this.bc=a)}; z.e.gG=function(a){var b=this.m();this.bc!=b||a.relatedTarget&&z.lf(b,a.relatedTarget)||(this.bc=null,this.Xp())};z.e.Xp=function(){2==this.getState()&&(this.Pl=z.vd((0,z.q)(this.HH,this,this.anchor),this.Wx()))};z.e.gj=function(){this.Pl&&(z.wd(this.Pl),this.Pl=void 0)};z.e.D=function(){this.G(!1);sx(this);this.detach();this.m()&&z.P(this.m());this.bc=null;delete this.da;z.ix.o.D.call(this)};z.x(nx,fx); nx.prototype.ha=function(a,b,c){b=Vn(a);b=Do(b);c=c?new z.pg(c.top+10,c.right,c.bottom,c.left+10):new z.pg(10,0,0,10);Ks(this.Yh,a,4,c,b,9)&496&&Ks(this.Yh,a,4,c,b,5)};z.x(ox,z.ex);ox.prototype.ha=function(a,b,c){var d=new z.Ge(10,0);z.Hs(this.element,this.Ze,a,b,d,c,9)&496&&z.Hs(this.element,2,a,1,d,c,5)};z.x(tx,z.ix);z.e=tx.prototype;z.e.XN=!1;z.e.WN=100;z.e.nq=!1;z.e.lk=function(){tx.o.lk.call(this);this.lr=Pn(z.Ao(this.m()));this.anchor&&(this.$v=Pn(z.Ao(this.anchor)));this.nq=this.XN;z.F(this.K().ua(),"mousemove",this.Jl,!1,this)};z.e.kk=function(){z.md(this.K().ua(),"mousemove",this.Jl,!1,this);this.$v=this.lr=null;this.nq=!1;tx.o.kk.call(this)}; z.e.Vs=function(a){if(this.po){var b=z.Wn(this.m()),c=z.Hg(this.m());return b.x-this.po.left<=a.x&&a.x<=b.x+c.width+this.po.right&&b.y-this.po.top<=a.y&&a.y<=b.y+c.height+this.po.bottom}return tx.o.Vs.call(this,a)};z.e.HH=function(a){this.Pl=void 0;a!=this.anchor||vx(this,this.ij)||this.zl()||this.fl&&this.fl.bc||z.B&&0==this.ij.x&&0==this.ij.y||this.G(!1)}; z.e.Jl=function(a){var b=this.V();if(this.lr){var c=z.vf(this.K()),c=new z.Ge(a.clientX+c.x,a.clientY+c.y);vx(this,c)?b=!1:this.nq&&(b=Go(this.lr,c)>=Go(this.lr,this.ij))}if(b){if(this.Xp(),this.bc=null,b=this.fl)b.bc=null}else 3==this.getState()&&this.gj();tx.o.Jl.call(this,a)};z.e.vy=function(){this.zl()!=this.m()&&(this.nq=!1,this.bc=this.m())};z.e.Wx=function(){return this.nq?this.WN:tx.o.Wx.call(this)};z.x(z.xx,tx);z.e=z.xx.prototype;z.e.D=function(){z.xx.o.D.call(this);z.md(this.Ka,"mouseover",this.iG,!1,this)};z.e.ez=function(a){return a.tagName in this.eD&&!!a.getAttribute(this.eD[a.tagName])};z.e.iG=function(a){if(a=a.target)this.ez(a)?(this.setPosition(null),yx(this,a)):this.rN&&(a=z.uf(a,(0,z.q)(this.ez,this),!1,this.HY))&&(this.setPosition(null),yx(this,a))};z.e.fA=function(a){return this.dispatchEvent(a)};z.e.Un=function(){return this.Qf||this.anchor}; z.e.kk=function(){z.xx.o.kk.call(this);null!=this.Qf&&Bx(this,this.Qf);this.Qf=null};z.e.nd=function(a){var b=lx(this,a.target);b&&b!=this.anchor?yx(this,b):z.xx.o.nd.call(this,a)};z.e.Ll=function(a){var b=this.anchor,c=this.getState();z.xx.o.Ll.call(this,a);c==this.getState()||1!=c&&4!=c||(this.anchor=b,zx(this))};z.e.Iz=function(a,b){z.xx.o.Iz.call(this,a,b);this.V()?(a!=this.Qf&&Bx(this,this.Qf),this.Qf=a):(sx(this),zx(this))};z.x(Ax,z.Lc);z.x(Cx,z.ex);Cx.prototype.Yn=function(){return 5}; Cx.prototype.ha=function(a,b,c,d){var f={"1-4":"bottom","0-4":"top","0-5":"top","1-5":"bottom","2-5":"top","3-5":"bottom","3-4":"bottom","2-6":"left","2-4":"right"},g;if(this.XC){g=z.Hs(this.element,this.Ze,a,b,null,c,10,d);var h=Dx(g,this.Ze),k=Dx(g,b);g&496&&(g=z.Hs(this.element,h,a,k,null,c,10,d),g&496&&(h=Dx(g,h),k=Dx(g,k),this.XC?z.Hs(this.element,h,a,k,null,c,this.Yn(),d):z.Hs(this.element,h,a,k,null,c,0,d)));this.$t&&(a=(z.ka(h)?h:this.Ze)+"-"+(z.ka(b)?b:k),this.$t(f[a],a))}else z.Hs(this.element, this.Ze,a,b,void 0,c),this.$t&&(a=this.Ze+"-"+b,this.$t(f[a],a))};z.x(z.Ex,z.Xj);z.e=z.Ex.prototype;z.e.defaults={fU:"pm",lu:!1,Vk:!0};z.e.sh=function(a){this.h=a};z.e.m=function(){return this.h};z.e.Oy=function(){this.Ia=new z.V(null);this.Ia.Na("发送私信");z.Lj(this.Ia,null);this.Ia.Bf(!0);this.Ia.G(!0);this.h=this.Ia.S()};z.e.focus=function(){this.init();this.pd.focus()}; z.e.init=function(){this.CQ||(this.CQ=!0,this.vq&&(this.Ia||this.Oy(),this.h.innerHTML='\x3cdiv class\x3d"zm-pm-wrap"\x3e\x3cdl class\x3d"zm-form-table zm-form-table-medium"\x3e\x3cdt class\x3d"zm-form-table-head zm-form-table-head-align-middle"\x3e\x3clabel class\x3d"zg-medium-gray"\x3e发给:\x3c/label\x3e\x3c/dt\x3e\x3cdd class\x3d"zm-form-table-field"\x3e\x3cdiv class\x3d"zm-pm-selector-wrap"\x3e\x3cdiv class\x3d"zg-user-name" style\x3d"display:none;padding:4px 0 0 0"\x3e\x3c/div\x3e\x3cinput class\x3d"zg-form-text-input zm-pm-user-selector" type\x3d"text" /\x3e\x3c/div\x3e\x3c/dd\x3e\x3cdt class\x3d"zm-form-table-head zm-form-table-head-align-middle"\x3e\x3clabel class\x3d"zg-medium-gray"\x3e内容:\x3c/label\x3e\x3c/dt\x3e\x3cdd class\x3d"zm-form-table-field zm-form-table-field-last"\x3e\x3cdiv class\x3d"zg-editor-simple-wrap zg-form-text-input"\x3e\x3ctextarea class\x3d"zg-editor-input" style\x3d"font-weight:normal"\x3e\x3c/textarea\x3e\x3c/div\x3e\x3c/dd\x3e\x3c/dl\x3e\x3cdiv class\x3d"zh-pm-warnmsg" style\x3d"display:none;text-align:right;color:#C3412F;"\x3e\x3c/div\x3e\x3cdiv class\x3d"zm-command zg-clear"\x3e\x3cdiv class\x3d"zm-item-meta zg-left" style\x3d"margin: 0 0 0 57px;"\x3e\x3cspan class\x3d"zg-text-counter" style\x3d"display:none"\x3e还可以输入 500 字\x3c/span\x3e\x3cspan class\x3d"additional-info" \x3e\x3c/span\x3e\x3c/div\x3e\x3ca name\x3d"cancel" href\x3d"javascript:;" class\x3d"zm-command-cancel"\x3e取消\x3c/a\x3e\x3ca name\x3d"send" href\x3d"javascript:;" class\x3d"zg-btn-blue zg-r3px" id\x3d"zh-question-pm-send-button"\x3e发送\x3c/a\x3e\x3c/div\x3e\x3c/div\x3e'),this.Eh= z.N("zg-user-name",this.h),this.pd=z.N("zg-editor-input",this.h),this.$c=z.N("zm-pm-user-selector",this.h),this.wn=z.N("zm-command",this.h),z.N("zg-text-counter",this.h),this.Bt=z.N("zh-pm-warnmsg",this.h),(0,window.$)(".additional-info",(0,window.$)(this.h)),new z.Sr(this.pd),this.v().g(this.wn,"click",this.Qa).g(this.Eh,"click",this.Qa).g(this.pd,"keydown",this.QP),this.$c&&((new z.Xs("搜索用户")).w(this.$c),this.v().g(this.$c,"blur",this.sN),this.ca=new z.kt("/people/autocomplete?type\x3d"+this.J.fU, this.$c,null,null,z.N("zm-pm-wrap",this.h),!0),this.ca.vh(!0),this.v().g(this.ca,"select",this.sT)),z.T.qe||Hx(this,"未激活用户,不能发送私信。请先激活邮箱。"))};z.e.QP=function(a){13===a.keyCode&&(a.ctrlKey||a.metaKey)&&(this.zs(),a.preventDefault())};z.e.sN=function(){this.OD&&(0,window.clearTimeout)(this.OD);this.OD=(0,window.setTimeout)((0,z.q)(this.tN,this),200)};z.e.tN=function(){var a=z.sr(this.$c.value);-1===this.Km&&a&&"搜索用户"!==a&&Hx(this,"请输入对方姓名,从下拉菜单里选择收件人")};z.e.Eu=function(a){this.zV=a}; z.e.show=function(){this.init();this.vq&&(this.Ia.G(!0),this.Ia.ha())};z.e.sT=function(){var a=z.yb(this.ca.Ej(),1);z.Gx(this,a[3],a[0],!0)};z.e.zs=function(){if(!this.ai||"pending"!==this.ai.state())if(-1===this.Km)Hx(this,"请填写收信人。");else{var a=this.pd.value;(0,z.ab)(a)?(a=-1!==this.fq?window.$.post("/inbox/reply",{message_id:this.fq,content:a,type:this.HB}):window.$.post("/inbox/post",{member_id:this.Km,content:a,token:this.zV}),a.done((0,z.q)(this.uT,this)),this.ai=a):Hx(this,"请填写私信内容。")}}; z.e.Qa=function(a){if(a=(a=this.Pg(a.target))&&a.name)switch(a){case "edit":this.Km=-1;z.vr(this.$c,this.Eh);break;case "cancel":this.vq&&this.Ia.G(!1);break;case "send":this.zs()}};z.e.uT=function(a){Hr("message","send_message");if(!a)return z.X.message("网络异常");if(a.r)return Hx(this,a.msg);this.vq&&this.Ia.G(!1);this.J.lu?window.location.reload():z.X.message("发送成功")};z.x(Ix,z.Xj);var Nx={p:"MemberProfileCardV2",t:"TopicProfileCardV2",c:"ColumnProfileCardV2",r:"RoundtableProfileCardV2"};z.e=Ix.prototype;z.e.LQ={t:0,r:2,b:1,l:2}; z.e.init=function(){if(!z.rm.Ab&&!z.qm("tooltiop")){var a=this.R=new z.xx({A:"data-tip",SPAN:"data-tip",BUTTON:"data-tip",I:"data-tip",DIV:"data-tip",INPUT:"data-tip",IMG:"data-tip"}),b=z.O("div",{id:"zh-tooltip"});window.document.body.appendChild(b);this.R.sh(b);this.R.Sp=this.PV;this.R.no=this.IQ;this.v().g(this.R,"trigger",this.fA);var c=(0,window.$)(b),d=null;a.on("show",function(a){(0,window.clearTimeout)(d);c.addClass("in");z.Y.tb({type:"ga_hover_hovercard",target:a.target.Un()})}).on("hide", function(){c.css({display:"block",visibility:"visible"}).removeClass("in").addClass("out");d=(0,window.setTimeout)(function(){c.removeClass("out").css({display:"none",visibility:"hidden"})},1E3)});this.v().g(this.R,"beforeshow",this.bp).g(this.R,"show",this.jg).g(this.R,"beforehide",this.CS);(0,window.$)(a.m()).on("click",".member-profile-card-pm",function(b){b.preventDefault();var c=(0,window.$)(this);a.G(!1);z.Jq(function(){var a=new z.Ex({Vk:!1});a.show();z.Gx(a,c.data("pmHash"),c.data("pmName")); z.Fx(a,c.attr("href"));a.pd.focus()},!0)()})}};z.e.CS=function(){"s"!==this.bf&&(this.Qh[this.bf]&&this.Qh[this.bf][this.Gn]&&(this.Qh[this.bf][this.Gn]=(0,window.$)(this.R.m()).find(".popover-content").html()),this.bf in Nx&&(0,z.Gi)(this.R.m(),{action:"Hide",element:"Card"},{link:{url:this.R.Un().href}}))}; z.e.bp=function(){var a=this.R.Un(),b=a.getAttribute("data-tip");this.uE=a;b=b.split("$");this.bf=b[0];this.Gn=b[2];this.kl=b[1];this.R.m().setAttribute("data-theme",a.getAttribute("data-theme")||"");"s"===this.bf?(a=this.Gn,b=[],b.push('\x3cdiv class\x3d"tooltip-arrow"\x3e\x3c/div\x3e'),b.push('\x3cdiv class\x3d"tooltip-inner content-prewrap"\x3e'),b.push(ro(a)),b.push("\x3c/div\x3e"),Mx(this,b.join(""))):Lx(this,this.bf,this.Gn,this.kl);Kx(this);a=this.R.Un();this.bf in Nx&&a&&(!(b=a.getAttribute("href"))|| b.startsWith("#")||"http:"!==a.protocol&&"https:"!==a.protocol||(b=(0,window.$)("img",a).length?"Image":"Link",(0,z.Gi)(a,{action:"Hover",element:b},{link:{url:a.href}})))};z.e.jg=function(){var a=this.bf in Nx;a&&(z.xo(this.R,{module:a?"HoverCard":null}),(0,z.Gm)(this.R,{element:"Card"}))};z.e.tw=function(){return Jx('\x3cdiv class\x3d"zh-hovercard-spinner"\x3e\x3c/div\x3e',!0)}; z.e.fA=function(a){var b=a.anchor,c=b&&b.getAttribute("data-tip"),d=c.split("$"),f=null;a="s"!==d[0];z.Ho(b,"no-hovercard")&&a?(a=this.R,sx(a),zx(a)):c&&1z.Dg(b).y?"t"===f&&(f="b",b.setAttribute("data-tip",c.replace("$t$","$b$"))):(f="t",b.setAttribute("data-tip",c.replace("$b$","$t$")))),this.TN=f=new Cx(b,this.LQ[f],"b"===f||"t"===f),b=(0,z.q)(this.wT,this),f.$t=b,this.R.className= a?"goog-hovercard popover":"tooltip"):(a=this.R,sx(a),zx(a))}; z.e.wT=function(a,b){var c=this.R.m();z.W.remove(c,"top","bottom","left","right");z.W.add(c,a);var d=z.fo(c),f=z.fo(this.uE),g=new z.Ge(c.offsetLeft,c.offsetTop);if("t"===this.kl||"b"===this.kl){var d=(d.width-f.width)/2,h=g.x-d;if("s"===this.bf)z.rg(c,"left",h+"px");else{var h=z.A(["2-5","3-5","3-4","2-4"],b),k=(0,window.$)(".zh-hovercard-spinner",c)[0],m=z.N("arrow",c),n=z.N("arrow2",c);k?z.rg(c,"left",g.x-d+"px"):h?z.rg(c,"left",g.x+83+"px"):z.rg(c,"left",g.x-70+"px");var r=f.width/2;m&&n&&(k|| (h?z.y([m,n],function(a){z.rg(a,"left","auto");z.rg(a,"right",r+70+"px")}):z.y([m,n],function(a){z.rg(a,"left",r+70+"px")})))}}else z.rg(c,"top",g.y-(d.height-f.height)/2+"px"),"l"===this.kl&&z.zg(c,g.x-f.width)};z.x(Px,z.R);z.e=Px.prototype; z.e.Y=function(a){this.h=a;this.W=(0,window.$)(this.h);this.W.addClass("zh-scroller").css({position:"relative",overflow:"hidden"}).wrapInner('\x3cdiv class\x3d"zh-scroller-content"\x3e\x3c/div\x3e');this.W.wrapInner('\x3cdiv class\x3d"zh-scroller-inner"\x3e\x3c/div\x3e');this.W.append("\x3cdiv class\x3d'zh-scroller-bar-container'\x3e\x3cdiv\x3e");this.W.append('\x3cdiv class\x3d"zh-scroller-bar"\x3e\x3c/div\x3e');this.fd=this.W.children(".zh-scroller-inner");this.Hk=this.W.children(".zh-scroller-bar-container");this.ne= this.W.children(".zh-scroller-bar");this.Re=this.fd.children(".zh-scroller-content");this.gr=this.ne[0];this.bR=this.fd[0];this.content=this.Re[0];this.ir=this.Hk[0];this.fd.css({height:"100%",width:"150%",overflow:"auto"});this.ne.css({position:"absolute",right:this.options.right,top:this.options.top,opacity:this.options.hw,background:this.options.cN,width:this.options.width,"border-radius":3,cursor:"default"});this.Hk.css({position:"absolute",right:this.options.right-1,top:0,height:"100%",width:this.options.width, background:this.options.IN,border:"1px solid #444",opacity:0,cursor:"default","border-radius":"2px"});this.Ji(this.gr,!1);this.Ji(this.ir,!1);this.update()};z.e.C=function(){Px.o.C.call(this);this.IB=new z.fl(this.dA,50,this);this.options.stopPropagation&&this.fd.bind("mousewheel DOMMouseScroll",function(a){var b=null;"mousewheel"===a.type?b=-1*a.originalEvent.wheelDelta:"DOMMouseScroll"===a.type&&(b=40*a.originalEvent.detail);b&&(a.preventDefault(),(0,window.$)(this).scrollTop(b+(0,window.$)(this).scrollTop()))})}; z.e.enter=function(){this.qx||(this.v().g(this.bR,"scroll",function(){this.IB.fire()}),z.C||(this.v().g(this.ir,"click",this.BS),this.v().g(window.document,"mousedown",this.cT),this.v().g(window.document,"mouseup",this.eT),this.v().g(window.document,"mousemove",this.dT)),this.options.$M?(this.Qd=new z.td(200),this.v().g(this.Qd,"tick",function(){2===this.Qz||1===this.Qz?(Qx(this),this.Bm&&this.Hk.css({opacity:this.options.ZD})):this.Rr||this.gn||(Rx(this,1E3),this.Hk.css({opacity:0}))})):(this.ne.css({opacity:this.options.hw}), this.Hk.css({opacity:this.options.ZD})),this.Qd&&this.Qd.start(),Rx(this),this.qx=!0)};z.e.cT=function(a){a.target===this.gr&&(this.Rr=!0,this.dN=a.clientY,this.eN=(0,window.parseInt)(this.ne.css("top"),10));a.target!==this.gr&&a.target!==this.ir||this.Ji(window.document.body,!1)};z.e.eT=function(){this.Rr=!1;this.Ji(window.document.body,!0)};z.e.dT=function(a){if(this.Rr){var b=Sx(this,this.eN+(a.clientY-this.dN));this.fd.scrollTop(b)}this.Qz=a.target===this.gr?2:a.target===this.ir?1:0}; z.e.dA=function(){var a=this.fd.scrollTop(),b=this.Re.height(),c=this.fd.height(),d=a/b*(c-2*this.options.top);Qx(this);this.ne.css({top:d+this.options.top});this.dispatchEvent(new Tx(this,a,b-a-c))};z.e.update=function(){var a=this.Rg(this.fd).height,b=this.Rg(this.Re).height;a>=b?(this.Bm=!1,this.ne.hide()):(this.Bm=!0,this.ne.show());this.ne.css({height:a/b*(a-2*this.options.top)});this.Hk.css({height:a-2});this.Re.css({overflow:"hidden",width:this.W.width(),"min-height":"100%"});return this}; z.e.Rg=function(a){var b={height:a.height(),width:a.width()};if(!b.height){var c=a.css("display"),d=a.css("position"),f=a.css("visibility");a.css({position:"absolute",display:"block",visibility:"hidden"});b={height:a.height(),width:a.width()};a.css({position:d,display:c,visibility:f})}return b};z.e.BS=function(a){this.scrollTo(Sx(this,a.offsetY-this.ne.height()/2))};z.e.scrollTop=function(a){this.Bm&&(a=a||200,Qx(this),this.fd.stop().animate({scrollTop:0},a));return this}; z.e.Ji=function(a,b){z.zo(a,!b)};z.e.scrollBy=function(a,b){if(this.Bm){Qx(this);var c=b||this.Rg(this.fd).height,c=Math.abs(c),c=this.fd.scrollTop()+(a?-1:1)*c;this.fd.stop().animate({scrollTop:c},200)}};z.e.scrollTo=function(a){this.Bm&&(Qx(this),this.fd.stop().animate({scrollTop:a},200));return this};z.x(Tx,z.Lc);z.x(z.Ux,z.R);z.Ux.prototype.defaults={VH:".tab-nav",NI:".tab-panel",Cg:"active"};z.Ux.prototype.Y=function(a){if(a){this.h=a;var b=this,c=this.J;this.Ok=(0,window.$)(c.VH,a);this.Sm=(0,window.$)(c.NI,a);this.Pj=this.Ok.index("."+c.Cg);this.Ok.on("click",function(){b.select(b.Ok.index(this))});this.Ok.attr("role","tab").parent().attr("role","tablist")}}; z.Ux.prototype.select=function(a){if(!(0>a||a>this.Ok.size())&&(this.dispatchEvent({type:"action",data:{index:a}}),a!==this.Pj)){this.Pj=a;var b=this.J;this.Ok.eq(a).addClass(b.Cg).attr("aria-selected","true").siblings().removeClass(b.Cg).attr("aria-selected","false");b=this.Sm.eq(a);this.Sm.not(b.show()).hide();this.dispatchEvent({type:"select",data:{index:a}})}};z.Ux.prototype.index=function(){return this.Pj};z.l(Vx,z.Xj);z.e=Vx.prototype; z.e.init=function(){this.Ai=z.L("zh-top-nav-live-new");this.AC=(0,window.$)(this.Ai);this.jq=z.L("zh-top-nav-count-wrap");this.zn=z.O("span",{id:"zh-top-nav-count",className:"zu-top-nav-count zg-noti-number",style:"display:none"});this.contents=z.Qo("zm-noti7-content",this.Ai);this.Jw=z.Qo("zm-noti7-content-body",this.Ai);this.jq.appendChild(this.zn);this.v().g(this.jq,"click",this.oK).g(this.jq,"keypress",function(a){32===a.keyCode&&(a.preventDefault(),this.oK())});this.v().g(z.Y,"notification", this.cQ);this.v().g(this.Ai,"click",function(a){a=a.target;a.href&&/group_id=/.test(a.href+"")&&(0,window.$)(a).parent(".unread").removeClass("unread")});this.wv=(0,window.$)(".zm-noti7-popup-tab-container .icon");Wx(this);this.KK||(this.pg=z.nb(this.contents,function(a){var b=new Px;b.w(a);return b}));Zx(this);this.km=z.L("zh-top-nav-pm-count");this.km||(this.km=z.O("span"));this.em=z.L("zh-top-nav-new-pm");this.em||(this.em=z.O("span"));this.AG=(0,window.parseInt)((0,window.$)(this.em).attr("data-count")|| (0,window.$)(this.km).attr("data-count"),10)||0;this.v().g(z.Y,"inbox",this.PP)};z.e.cQ=function(a){this.dI=this.Pf;this.Pf=a.xf;this.Td=this.Pf[0]+this.Pf[1]+this.Pf[2];z.Q(this.zn,!!this.Td);this.zn.innerHTML=by(this.Td);z.y(this.Pf,function(a,c){a?(this.wv.eq(c).addClass("withdot"),this.cache[c]=!1):this.wv.eq(c).removeClass("withdot");this.VE&&0b.height-80?d.style.marginTop="40px":c.style.lineHeight=b.height+"px";d.style.width=g>b.width-80?b.width-80+"px":g+"px";z.Y.tb({type:"ga_click_enlarge_image",target:a})}}};z.e.ha=z.p;z.e.focus=z.p;z.e.uJ=z.Gl;z.e.MP=function(){this.G(!1);z.W.remove(window.document.body,this.zD)}; z.e.jg=function(){oy.o.jg.call(this);z.W.add(window.document.body,this.zD);this.v().ya(window.document,"click",this.MP)};z.e.B=function(){oy.o.B.call(this);z.W.add(this.m(),"zm-light-box")};z.e.Fz=function(){this.Pc=this.K().B("div",this.Rc+"-bg zm-light-box-background");z.Q(this.Pc,!1)};oy.ba();z.jg("common");window.console||(window.console={info:z.p,log:z.p,warning:z.p,error:z.p});z.gG.on(["click!","show!","visit!"],function(a){var b=a.yc;b.category&&b.action&&z.U(b.category,a.type.replace("!","")+"_"+b.action,b.label,b.value)});z.ud=window; (function(){function a(a){return(0,z.Ii)({responseId:a.getResponseHeader("X-Za-Response-Id")})}z.Uj=z.rm.Ab;window.$.ajaxPrefilter(function(a,c,d){var f;!1!==c.processData&&"get"!==a.type.toLowerCase()&&(f=z.aj.get("_xsrf"))&&d.setRequestHeader("X-Xsrftoken",f)});window.$.ajaxPrefilter(function(b,c,d){return d.always(function(){return a(d)})});tp("*",function(b,c){return a(c)});(new ly).init()})();z.Cp.dispatchEvent("init");(0,window.$)(function(){z.Cp.dispatchEvent("postinit")}); z.T.Fb()?(tp("json",function(a){(a=a.profile_result)&&(0,window.$)(a).css("border-top","1px solid #eee").appendTo(window.document.body)}),z.rm.Ab&&(window.$.fx.off=!0),(0,window.$)(function(){(new $w).init()})):(0,window.$)("body").addClass("no-auth");z.Va(window.location.host,"zhihu.com")||(z.Mi=!0);(0,window.$)(window.document.body).children("div.zu-main").attr("role","main");window.document.addEventListener&&window.document.addEventListener("touchstart",z.p,!1); z.Vj&&(0,window.$)('meta[name\x3d"viewport"]').attr("content","width\x3ddevice-width, initial-scale\x3d1.0");(0,window.$)(function(){window.znonce&&window.znonce.evalScripts();(new Yw).init();new Ix;var a=new Zw;window.console&&window.console.info&&window.console.info(a.TM+"\n\n"+a.link);bx();z.U.init()});z.l(z.py,z.R);z.e=z.py.prototype; z.e.C=function(){var a=this;z.R.prototype.C.call(this);var b=this.wf,c=b.Da,d=b.validator,f=b.iw,g=b.Tq,h=this.LU.bind(this),k=this.KU.bind(this);c.on("change keyup",".is-error",function(){h((0,window.$)(this))}).submit(function(){if(c.hasClass("form-submitting"))return!1;k();var b=d(a.getData());if(b)return ry(a,b),!1;f.call(c).then(function(){c.addClass("form-submitting");a.submit().then(function(b){b=void 0===b?{}:b;c.removeClass("form-submitting");if(!b.r)return g.call(c,b);ry(a,b.msg)}).catch(function(){c.removeClass("form-submitting")})}); return!1}).find('[type\x3d"submit"]').attr("disabled",!1)};z.e.LU=function(a){a.removeClass("is-error").find("."+this.wf.Ko+"-error").remove()};z.e.KU=function(){this.Da.removeClass("is-error").find("."+this.wf.Ko+"-error").remove()}; z.e.submit=function(){var a=this.wf,b=a.Da,a=a.JK,c=b.attr("contentType")||"application/json",d={url:b.attr("action"),type:b.attr("method")||"POST"};if(a)Object.assign(d,{data:new window.FormData(b[0]),async:!1,cache:!1,contentType:!1,processData:!1});else{var f=this;Object.assign(d,{data:function(){var a=f.getData();"application/json"===c&&(a=JSON.stringify(a));return a}(),contentType:c})}return new window.Promise(function(a,b){window.$.ajax(d).done(a).fail(b)})}; z.e.getData=function(){return sy(this.Da,this.wf.zF)};z.x(ty,z.G);ty.prototype.handleEvent=function(a){var b=0,c=0,d=0;a=a.gc;if("mousewheel"==a.type){c=1;if(z.C||z.D&&(z.ll||z.E("532.0")))c=40;d=uy(-a.wheelDelta,c);z.ka(a.wheelDeltaX)?(b=uy(-a.wheelDeltaX,c),c=uy(-a.wheelDeltaY,c)):c=d}else d=a.detail,100d&&(d=-3),z.ka(a.axis)&&a.axis===a.HORIZONTAL_AXIS?b=d:c=d;z.qa(this.EH)&&(b=Zo(b,-this.EH,this.EH));z.qa(this.FH)&&(c=Zo(c,-this.FH,this.FH));this.zR&&(b=-b);b=new vy(d,a,b,c);this.dispatchEvent(b)}; ty.prototype.D=function(){ty.o.D.call(this);z.nd(this.sH);this.sH=null};z.x(vy,z.Pc);z.x(wy,z.G);z.e=wy.prototype;z.e.me=0;z.e.Wo=0;z.e.So=100;z.e.Nn=0;z.e.Ak=1;z.e.NG=!1;z.e.Ct=!1;z.e.Ea=function(a){a=xy(this,a);this.me!=a&&(this.me=a+this.Nn>this.So?this.So-this.Nn:aa?0:this.me+a>this.So?this.So-this.me:a,this.NG||this.Ct||this.dispatchEvent("change"))}; z.e.hi=function(){var a=this.Nn;return null==this.Ak?a:Math.round(a/this.Ak)*this.Ak};z.e.Ec=function(){return xy(this,this.Wo)};z.e.Vc=function(){return xy(this,this.So)};z.e.$n=function(){return this.Ak};z.x(yy,z.R);z.e=yy.prototype;z.e.Nb="horizontal";z.e.Bo=!1;z.e.qS=!1;z.e.Lf=10;z.e.zt=0;z.e.QG=!0;z.e.SH=0;z.e.JL=1E3;z.e.ec=!0;z.e.ae=!1;z.e.B=function(){yy.o.B.call(this);var a=this.K().B("DIV",this.U(this.Nb));this.Y(a)};z.e.Y=function(a){yy.o.Y.call(this,a);z.hj(a,this.U(this.Nb));a=this.m();var b=z.Le(window.document,null,"goog-slider-thumb",a)[0];b||(b=this.K().B("DIV","goog-slider-thumb"),z.bj(b,"button"),a.appendChild(b));this.cb=this.Gd=b;z.bj(this.m(),"slider");Oy(this)}; z.e.C=function(){yy.o.C.call(this);this.le=new z.oj(this.cb);this.Uf=new z.oj(this.Gd);this.le.Lg(this.ae);this.Uf.Lg(this.ae);this.le.Xw=this.Uf.Xw=z.p;this.vb=new Kp(this.m());zy(this,!0);this.m().tabIndex=0;Iy(this)};z.e.Hb=function(){yy.o.Hb.call(this);z.Dc(this.le,this.Uf,this.vb,this.dk)}; z.e.ps=function(a){var b=a.Qr==this.le?this.cb:this.Gd,c;"vertical"==this.Nb?(c=this.m().clientHeight-b.offsetHeight,c=(c-a.top)/c*(this.Vc()-this.Ec())+this.Ec()):c=a.left/(this.m().clientWidth-b.offsetWidth)*(this.Vc()-this.Ec())+this.Ec();c=a.Qr==this.le?Math.min(Math.max(c,this.Ec()),this.X()+this.hi()):Math.min(Math.max(c,this.X()),this.Vc());Gy(this,b,c)}; z.e.As=function(a){var b="start"==a.type;z.uo(this.m(),"goog-slider-dragging",b);z.uo(a.target.handle,"goog-slider-thumb-dragging",b);a=a.Qr==this.le;b?(this.dispatchEvent("h"),this.dispatchEvent(a?"d":"f")):(this.dispatchEvent("i"),this.dispatchEvent(a?"e":"g"))}; z.e.mf=function(a){var b=!0;switch(a.keyCode){case 36:My(this,this.Ec());break;case 35:My(this,this.Vc());break;case 33:Ey(this,this.Lf);break;case 34:Ey(this,-this.Lf);break;case 37:var c=this.ae&&this.qd()?1:-1;Ey(this,a.shiftKey?c*this.Lf:c*this.rq);break;case 40:Ey(this,a.shiftKey?-this.Lf:-this.rq);break;case 39:c=this.ae&&this.qd()?-1:1;Ey(this,a.shiftKey?c*this.Lf:c*this.rq);break;case 38:Ey(this,a.shiftKey?this.Lf:this.rq);break;default:b=!1}b&&a.preventDefault()}; z.e.ws=function(a){this.m().focus&&this.m().focus();var b=a.target;z.lf(this.cb,b)||z.lf(this.Gd,b)||(b="click"==a.type,b&&(0,z.I)()Ly(this,this.Qe)+this.Qe.offsetWidth,a=z.Je(this.m()),this.v().g(a,"mouseup",this.zB,!0).g(this.m(),"mousemove",this.AB),this.ni||(this.ni=new z.td(200),this.v().g(this.ni,"tick",this.eG)),this.eG(), this.ni.start())))};z.e.YF=function(a){Ey(this,(0c+this.Qe.offsetHeight&&(a=Dy(this,this.Qe)-this.Lf)}else b=this.dt,c=Ly(this,this.Qe),this.BG?b>c+this.Qe.offsetWidth&&(a=Dy(this,this.Qe)+this.Lf):ba?b:a;this.eX=this.hL*this.options.fS;this.Je={ao:this.options.wg/a,yq:this.options.vg/a,x:0,y:0};Ry(this,a);Sy(this,this.Is/2,this.Hs/2);this.YQ=!0};z.e.Hm=function(a){this.Lu=a.clientX;this.Mu=a.clientY;this.HG=this.uv.position();this.Fq.position()}; z.e.support=function(){return"getContext"in window.document.createElement("canvas")};z.x(z.Uy,z.R);z.Vy=1;z.e=z.Uy.prototype;z.e.Y=function(a){this.h=a;this.B()}; z.e.B=function(){this.ZB=z.rm.tq+"/upload_avatar";this.Da=(0,window.$)((0,z.Rv)('\x3cform target\x3d"av_up_frame" style\x3d"display:none;" method\x3d"post" enctype\x3d"multipart/form-data" action\x3d"\x3c%\x3duploadAction%\x3e"\x3e\x3clabel for\x3d"avt_file"\x3e\x3c/label\x3e\x3cinput type\x3d"file" accept\x3d"image/*" name\x3d"picture" id\x3d"avt_file" /\x3e\x3cinput type\x3d"hidden" name\x3d"handle_mode" value\x3d"upload" /\x3e\x3cinput type\x3d"hidden" name\x3d"type" value\x3d"\x3c%\x3dtype%\x3e" /\x3e\x3cinput type\x3d"hidden" name\x3d"dest_id" value\x3d"\x3c%\x3ddest_id%\x3e" /\x3e\x3cinput type\x3d"hidden" name\x3d"return_size" value\x3d"\x3c%\x3dreturn_size%\x3e" /\x3e\x3c/form\x3e',{uploadAction:this.ZB, type:this.er,dest_id:this.er===z.Vy?z.T[3]:this.aF,return_size:this.vJ}));this.qL=(0,window.$)('\x3ciframe id\x3d"av_up_frame" name\x3d"av_up_frame" style\x3d"position: absolute; height: 0px; width: 0px; left: -9000px;"\x3e\x3c/iframe\x3e');this.qL.appendTo(window.document.body);this.input=this.Da.find("input[type\x3dfile]")[0];z.C?(this.Da.find("label").html((0,window.$)(this.h).html()),this.h.innerHTML="",(0,window.$)(this.h).append(this.Da),this.Da.addClass("avatar-editor-form-ie")):(this.Da.insertAfter(this.h), (0,window.$)(this.h).click(window.$.proxy(function(){this.input.click()},this)));this.v().g(this.input,"change",this.Hc).g(this.input,"click",function(a){!1===this.dispatchEvent("beforeopen")&&a.preventDefault()});this.v().g(z.Y,"iframe_data",function(a){(a=a.xf)&&!a.r?"upload"===a.handle_mode?(this.Tl=a.url,this.Hy=a.id,Wy()||this.kp()):"resize"===a.handle_mode&&((0,window.$)(this.h).find("form").remove(),this.lE(a)):z.X.message(a.msg)})}; z.e.Hc=function(a){Xy(this);a=this.input=a.target;if(Wy()){if(a.files&&a.files[0]){this.file=a=a.files[0];var b=new window.FileReader;b.onload=(0,z.q)(function(a){this.Tl=a.target.result;this.kp()},this);b.readAsDataURL(a)}}else this.Da[0].submit();$y(this)};z.e.kp=function(){var a=this.dialog.S();this.Gy=new window.Image;this.Gy.src=this.Tl;a=(0,window.$)(a);a.html("");a.append(this.Gy);this.Ow=new Qy;this.Ow.w(this.Gy)}; z.e.lE=function(a){a&&!a.r?this.data=a:z.X.message(a.msg);this.dispatchEvent({type:"success",src:this.data});this.dialog.G(!1)};z.e.getData=function(){return this.data||null};z.e.be=function(a){return this.data?this.data.url.replace(/(\.\w+)$/,"_"+a+"$1"):""};z.l(z.bz,z.R);z.bz.prototype.C=function(){z.R.prototype.C.call(this);var a=this.WT,b=this.m(),c=new z.Uy(z.Vy);c.w(b);var d=(0,window.$)(".Avatar",b),f=(0,window.$)(".Spinner",b);this.v().g(c,"beforepost",function(){f.show()}).g(c,"success",function(){var b={method:"save",params:{data:{avatar_path:c.getData().id}}};window.$.post("/node/ProfileHeaderV2",b,function(b){f.hide();b&&b.r?z.X.message("更新失败"):(d.add(".top-nav-profile .Avatar").attr({src:c.be("l"),srcset:c.be("xl")+" 2x"}),a.xi(b))})})};z.hG=function(a,b){var c=[],d=[].slice,f=z.Qr(a,function(){c.length&&(b(c),c=[])});return function(){c.push(d.call(arguments));f()}}(550,function(a){z.T.Fb()&&(a={items:JSON.stringify(a)},window.$.post("/lastread/touch",a))});z.x(z.cz,z.ex);z.cz.prototype.Yn=function(){return this.Mo};z.cz.prototype.xm=function(a){this.Mo=a};z.cz.prototype.ha=function(a,b,c,d){var f=z.Hs(this.element,this.Ze,a,b,null,c,10,d,this.mA);if(f&496){var g=dz(f,this.Ze);b=dz(f,b);f=z.Hs(this.element,g,a,b,null,c,10,d,this.mA);f&496&&(g=dz(f,g),b=dz(f,b),z.Hs(this.element,g,a,b,null,c,this.Yn(),d,this.mA))}};z.x(ez,Mp);z.la(ez);ez.prototype.U=function(){return"goog-menuheader"};z.x(fz,Vp);z.Tp("goog-menuheader",function(){return new fz(null)});z.x(gz,Mp);z.la(gz);z.e=gz.prototype;z.e.jf=function(){return"menuitem"};z.e.B=function(a){var b=a.K().B("DIV",this.Xf(a).join(" "),iz(this,a.Ua(),a.K()));kz(this,a,b,Pp(a,8)||Pp(a,16));return b};z.e.S=function(a){return a&&a.firstChild};z.e.w=function(a,b){var c=z.gf(b),d=hz(this,2);c&&z.gj(c,d)||b.appendChild(iz(this,b.childNodes,a.K()));z.gj(b,"goog-option")&&(a.Kp(!0),this.Kp(a,b,!0));return gz.o.w.call(this,a,b)}; z.e.ia=function(a,b){var c=this.S(a),d=jz(this,a)?c.firstChild:null;gz.o.ia.call(this,a,b);d&&!jz(this,a)&&c.insertBefore(d,c.firstChild||null)};z.e.Ji=function(a,b,c){a&&b&&kz(this,a,b,c)};z.e.Kp=function(a,b,c){a&&b&&kz(this,a,b,c)};z.e.Vn=function(a){switch(a){case 2:return hz(this,0);case 16:case 8:return"goog-option-selected";default:return gz.o.Vn.call(this,a)}}; z.e.ns=function(a){var b=hz(this,0);switch(a){case "goog-option-selected":return 16;case b:return 2;default:return gz.o.ns.call(this,a)}};z.e.U=function(){return"goog-menuitem"};z.x(z.lz,Vp);z.e=z.lz.prototype;z.e.X=function(){var a=this.Nz;return null!=a?a:this.Qg()};z.e.Ea=function(a){this.Nz=a};z.e.Tb=function(a,b){z.lz.o.Tb.call(this,a,b);switch(a){case 8:this.qf()&&!b&&this.Kc(!1);var c=this.m();c&&this.M.Ji(this,c,b);break;case 16:(c=this.m())&&this.M.Kp(this,c,b)}};z.e.Ji=function(a){this.Tb(8,a)};z.e.Kp=function(a){this.Tb(16,a)}; z.e.Qg=function(){var a=this.Ua();return z.na(a)?(a=z.nb(a,function(a){return z.jf(a)&&(z.gj(a,"goog-menuitem-accel")||z.gj(a,"goog-menuitem-mnemonic-separator"))?"":z.Io(a)}).join(""),mp(a)):z.lz.o.Qg.call(this)};z.e.of=function(a){var b=this.getParent();if(b){var c=b.EI;b.EI=null;if(b=c&&z.qa(a.clientX))b=new z.Ge(a.clientX,a.clientY),b=c==b?!0:c&&b?c.x==b.x&&c.y==b.y:!1;if(b)return}z.lz.o.of.call(this,a)};z.e.nf=function(a){return a.keyCode==this.Mz&&this.Nd(a)?!0:z.lz.o.nf.call(this,a)}; z.e.WO=function(){return this.Mz};z.Tp("goog-menuitem",function(){return new z.lz(null)});z.lz.prototype.ki=function(){return Pp(this,16)?"menuitemcheckbox":Pp(this,8)?"menuitemradio":z.lz.o.ki.call(this)};z.lz.prototype.getParent=function(){return Vp.prototype.getParent.call(this)};z.lz.prototype.ji=function(){return Vp.prototype.ji.call(this)};z.x(mz,Mp);z.la(mz);mz.prototype.B=function(a){return a.K().B("DIV",this.U())};mz.prototype.w=function(a,b){b.id&&On(a,b.id);if("HR"==b.tagName){var c=b;b=this.B(a);z.af(b,c);z.P(c)}else z.hj(b,this.U());return b};mz.prototype.ia=function(){};mz.prototype.U=function(){return"goog-menuseparator"};z.x(z.nz,Vp);z.nz.prototype.C=function(){z.nz.o.C.call(this);z.bj(this.m(),"separator")};z.Tp("goog-menuseparator",function(){return new z.nz});z.x(oz,Vr);z.la(oz);z.e=oz.prototype;z.e.Ob=function(a){return"UL"==a.tagName||oz.o.Ob.call(this,a)};z.e.Wn=function(a){return"HR"==a.tagName?new z.nz:oz.o.Wn.call(this,a)};z.e.Nf=function(a,b){return z.lf(a.m(),b)};z.e.U=function(){return"goog-menu"};z.e.Ee=function(a){oz.o.Ee.call(this,a);z.cj(a.m(),"haspopup","true")};z.x(z.pz,z.nz);z.Tp("goog-menuseparator",function(){return new z.nz});z.x(z.qz,z.Yr);z.e=z.qz.prototype;z.e.$m=!0;z.e.HM=!1;z.e.U=function(){return this.M.U()};z.e.Nf=function(a){if(this.M.Nf(this,a))return!0;for(var b=0,c=z.$g(this);b(0,z.I)()-this.iH};z.e.vS=function(){this.hide()};z.e.zI=function(a){Iz(this,a)};z.e.yT=function(a){32!=a.keyCode&&13!=a.keyCode&&40!=a.keyCode||Iz(this,a);40==a.keyCode&&z.bs(this)};z.e.iI=function(a){this.V()&&!this.Nf(a.target)&&this.hide()};z.e.Xc=function(a){z.Gz.o.Xc.call(this,a);this.hide()};z.e.D=function(){z.Gz.o.D.call(this);this.Ff&&(this.Ff.clear(),delete this.Ff)};z.x(Jz,gz);z.la(Jz);Jz.prototype.B=function(a){var b=Jz.o.B.call(this,a);z.hj(b,"goog-submenu");Kz(this,a,b);return b};Jz.prototype.w=function(a,b){b=Jz.o.w.call(this,a,b);z.hj(b,"goog-submenu");Kz(this,a,b);var c=z.Le(window.document,"DIV","goog-menu",b);if(c.length){var d=new z.qz(a.K()),c=c[0];z.Q(c,!1);a.K().ua().body.appendChild(c);d.w(c);a.th(d,!0)}return b}; Jz.prototype.ia=function(a,b){var c=this.S(a),d=c&&c.lastChild;Jz.o.ia.call(this,a,b);d&&c.lastChild!=d&&z.gj(d,"goog-submenu-arrow")&&c.appendChild(d)};Jz.prototype.Ee=function(a){Jz.o.Ee.call(this,a);var b=a.S(),c=a.K(),c=z.Le(c.Ka,"SPAN","goog-submenu-arrow",b)[0];Lz(a,c);c!=b.lastChild&&b.appendChild(c);z.cj(a.m(),"haspopup","true")};z.x(Mz,z.lz);var eD=218;z.e=Mz.prototype;z.e.Xd=null;z.e.lB=null;z.e.Jz=!1;z.e.mc=null;z.e.Zr=!1;z.e.Uq=!0;z.e.xR=!1;z.e.C=function(){Mz.o.C.call(this);this.v().g(this.getParent(),"hide",this.tI);this.mc&&Qz(this,this.mc,!0)};z.e.Hb=function(){this.v().qa(this.getParent(),"hide",this.tI);this.mc&&(Qz(this,this.mc,!1),this.Zr||(this.mc.Hb(),z.P(this.mc.m())));Mz.o.Hb.call(this)};z.e.D=function(){this.mc&&!this.Zr&&this.mc.H();this.mc=null;Mz.o.D.call(this)}; z.e.Mc=function(a,b){Mz.o.Mc.call(this,a);b&&(this.Ya().vf=!0);a||(this.Xd&&z.wd(this.Xd),this.Xd=z.vd(this.Ig,eD,this))};z.e.Iu=function(){var a=this.getParent();a&&as(a)==this&&(Pz(this,!0),Oz(this))};z.e.Ig=function(){var a=this.mc;a&&a.getParent()==this&&(Pz(this,!1),z.bh(a,function(a){"function"==typeof a.Ig&&a.Ig()}))};z.e.G=function(a,b){var c=Mz.o.G.call(this,a,b);c&&!this.V()&&this.Ig();return c}; z.e.Zb=function(a){var b=a.keyCode,c=this.qd()?37:39,d=this.qd()?39:37;if(!this.Jz){if(!this.isEnabled()||b!=c&&b!=this.Mz)return!1;this.Iu();z.bs(this.Ya());Nz(this)}else if(!this.Ya().Zb(a))if(b==d)this.Ig();else return!1;a.preventDefault();return!0};z.e.KS=function(){this.mc.getParent()==this&&(Nz(this),this.ji().Mc(this),Oz(this))};z.e.tI=function(a){a.target==this.ji()&&(this.Ig(),Nz(this))};z.e.nd=function(a){this.isEnabled()&&(Nz(this),this.lB=z.vd(this.Iu,eD,this));Mz.o.nd.call(this,a)}; z.e.Nd=function(a){Nz(this);if(Pp(this,8)||Pp(this,16))return Mz.o.Nd.call(this,a);this.Iu();return!0};z.e.Fa=function(a){this.Ya().L(a,!0)};z.e.bj=function(a,b){this.Ya().Rk(a,b,!0)};z.e.removeItem=function(a){(a=this.Ya().removeChild(a,!0))&&a.H()};z.e.ii=function(a){return z.ah(this.Ya(),a)};z.e.Dl=function(){return z.$g(this.Ya())};z.e.gb=function(){return this.Ya().gb()}; z.e.Ya=function(){this.mc?this.Zr&&this.mc.getParent()!=this&&z.Yg(this.mc,this):this.th(new z.qz(this.K()),!0);this.mc.m()||this.mc.B();return this.mc};z.e.th=function(a,b){var c=this.mc;a!=c&&(c&&(this.Ig(),this.wa&&Qz(this,c,!1)),this.mc=a,this.Zr=!b,a&&(z.Yg(a,this),a.G(!1,!0),a.$m=!1,a.Oe(!1),this.wa&&Qz(this,a,!0)))};z.e.Nf=function(a){return this.Ya().Nf(a)};z.Tp("goog-submenu",function(){return new Mz(null)});z.x(z.Rz,z.Xj);z.la(z.Rz);z.e=z.Rz.prototype; z.e.B=function(){this.lO=!0;this.h=z.O("div",null,[this.PR=z.O("div",null,[this.dh=z.O("div","zm-favo-list-content"),this.VC=z.O("div","zh-favo-add-new-wrap zm-command",this.WV=z.O("a",{"class":"zm-favo-dialog-create zg-left",href:"javascript:;"},"+ 创建收藏夹"),this.Ew=z.O("a",{href:"javascript:;","class":"zg-btn-blue"},"关闭")),this.Qv=z.O("div","zh-favo-add-new-wrap zm-command",this.DN=z.O("a",{href:"javascript:;","class":""},"取消"),this.XV=z.O("a",{"class":"zm-favo-dialog-create zg-btn-blue",href:"javascript:;"}, "创建收藏夹"))]),this.Ox=z.O("div",{"class":"zh-favo-add-form",style:"display:none"},[z.O("div",null,["标题",this.LB=z.O("span",{"class":"zh-favo-add-title-error"},"请填写标题")]),z.O("div","zg-section",this.si=z.O("input",{"class":"zg-form-text-input"})),z.O("div",null,"描述(可选)"),z.O("div",{"class":"zg-section zg-form-text-input"},this.Zj=z.O("textarea",{"class":"zg-editor-input",style:"height:66px"})),this.$I=z.O("label",null,[this.ZG=z.O("input",{type:"radio",checked:"checked",value:"public",name:"mode"}), z.O("strong",null," 公开 "),z.O("span","zg-gray-normal","公开后不能设置为私密")]),this.gH=z.O("br"),this.YI=z.O("label",null,[this.YG=z.O("input",{type:"radio",value:"private",name:"mode"}),z.O("strong",null," 私密 "),z.O("span","zg-gray-normal","只有你可以查看这个收藏夹")]),z.O("div","zm-command",[this.rx=z.O("label",{href:"javascript:;","class":"zh-favo-error-message-label zg-left"},""),this.xB=z.O("a",{href:"javascript:;","class":"zg-mr10"},"取消"),this.rr=z.O("a",{href:"javascript:;","class":"zg-mr10"},"完成"),this.Ov=z.O("a", {"class":"zg-btn-blue"},"确认创建")])])]);z.Q(this.LB,!1);z.Q(this.Qv,!1);(new z.Xs(this.MB)).w(this.si);(new z.Xs(this.bx)).w(this.Zj);z.y(this.xz,function(a){Tz(this,a)},this);this.xz.length||(this.dh.innerHTML='\x3cdiv id\x3d"zh-fav-list-item-place-holder" class\x3d"zg-r5px zm-fav-list-item-place-holder"\x3e你可以创建多个收藏夹,将答案分类收藏\x3c/div\x3e ',z.Q(this.Qv,!0),z.Q(this.VC,!1));Sz(this);this.sa.S().innerHTML="";this.sa.S().appendChild(this.h);this.sa.ha()}; z.e.cc=function(){this.jN||(this.jN=!0,this.v().g(this.xB,"click",function(){this.Xa?Xz(this,0):$z(this);dA("click_add_collection_cancel")}).g(this.WV,"click",function(){z.Y.tb({type:"ga_click_add_collection"});Xz(this,1);z.zi("collect","click_add_collection_start","collect_answer_box")}).g(this.Ew,"click",function(){dA("click_add_collection_close");$z(this)}).g(this.XV,"click",function(){z.Y.tb({type:"ga_click_add_collection"});Xz(this,1)}).g(this.DN,"click",function(){$z(this)}).g(this.rr,"click", function(){$z(this)}).g(this.Ov,"click",function(){var a=this.Zj.value,b=this.si.value;a&&dA("click_add_collection_discription",a);b&&dA("click_add_collection_title",b);this.jh()}).g(this.dh,"click",this.rT).g(this.si,"change",function(){z.Q(this.LB,!1)}).g(this.ZG,"click",function(){dA("click_add_collection_public")}).g(this.YG,"click",function(){dA("click_add_collection_private")}))}; z.e.rT=function(a){var b=z.tf(a.target,"A");if(b&&!this.locked){a=b.getAttribute("data-lid");var c=!1;z.W.has(b,"zm-favo-list-item-link-active")?(c=!0,this.rE=a):this.oE=a;b=new z.Fr;b.add("answer_id",this.Xa);b.add("favlist_id",a);this.VA=new z.Z(!0);this.locked=!0;this.v().ya(this.VA,"complete",this.CM);this.VA.ajax(c?"/collection/remove":"/collection/add",b.ze())}}; z.e.CM=function(){this.locked=!1;this.Ew.innerHTML="关闭";var a=z.Rn(this.VA);a&&!a.r?(a=z.Qo("zm-favo-list-item-link",this.dh),z.y(a,function(a){var c=a.getAttribute("data-lid"),d=z.N("num",a),f=(0,window.parseInt)(d.innerHTML,10);c===this.rE?(d.innerHTML=f-1+"",z.W.remove(a,"zm-favo-list-item-link-active")):c===this.oE&&(d.innerHTML=f+1+"",z.W.add(a,"zm-favo-list-item-link-active"))},this),this.oE=this.rE=null,Hr("Favorite","add_favorite")):z.X.message("添加失败: "+a.msg)}; z.e.lk=function(){this.cc();this.Ew.innerHTML="关闭";this.Xa?(z.Q(this.rr,!1),Xz(this,0)):(Xz(this,1),z.Q(this.xB,!1),this.rr.innerHTML="取消")};z.e.show=function(a){a?(Wz(this),this.sa.G(!0),this.lk()):(Sz(this,"添加到收藏夹",'\x3cdiv style\x3d"text-align: center; color: #999;"\x3e收藏夹加载中\x3ci class\x3d"spinner-gray"\x3e\x3c/i\x3e\x3c/div\x3e'),this.sa.G(!0),this.ls())};z.e.ls=function(){this.Xa&&window.$.get("/collections/json",{answer_id:this.Xa}).done((0,z.q)(this.bT,this))}; z.e.bT=function(a){a&&!a.r&&(this.xz=a.msg[0],this.mt=a.msg[1],Wz(this),this.lk())}; z.e.jh=function(){if(!this.xhr||!this.xhr.tc()){(0,window.$)(this.rx).text("").hide();var a=z.sr(this.si.value);if(a&&a!==this.MB){a=Yz(this);this.Xa&&a.add("answer_id",this.Xa);if(this.Xl){if(this.ZQ.ze()===a.ze()){$z(this);return}a.add("favlist_id",this.qE[0])}this.xhr=new z.Z(!0);bA(this,this.xhr,this.Ov,this.Xl);this.v().ya(this.xhr,"complete",this.uM);this.xhr.ajax(this.Xl?"/collection/update":"/collection/create",a.ze())}else z.Q(this.LB,!0)}}; z.e.uM=function(){var a=z.Rn(this.xhr);a&&!a.r?this.Xl?($z(this),z.X.message("编辑成功"),(0,window.setTimeout)(function(){window.location.reload()},1E3),this.Xl=!1):this.Xa?(z.Q(this.Qv,!1),z.Q(this.VC,!0),Xz(this,0),this.mt.push(a.msg[0]),Tz(this,a.msg,!0),this.si.value="",this.Zj.value=""):($z(this),z.X.message("创建成功"),(0,window.setTimeout)(function(){window.location.href="/collections/mine"},1E3)):cA(this.rx,this.Xl,a.msg)};z.e.V=function(){return this.sa.V()};var aA="close"; z.Rz.prototype.Mg=function(){(0,window.$)(window).on("beforeunload.FavoDiag",(0,z.q)(function(){return"你对收藏夹的修改还未保存,确认离开该页面吗?"},this))};z.Rz.prototype.bi=function(){(0,window.$)(window).off("beforeunload.FavoDiag")};z.x(z.eA,z.lz);z.Tp("goog-checkbox-menuitem",function(){return new z.eA(null)});z.l(fA,z.R);fA.prototype.Y=function(a){z.R.prototype.Y.call(this,a);var b=(0,window.$)(a).data(),c=new z.qz,d=new z.eA("禁止转载");d.Kc(!b.copyable);c.Fa(d);c.Fa(new z.pz);gA(this,c);c.Fa(new z.pz);c.Fa(new z.lz("删除"));this.v().g(c,"action",this.ty).ya(c,"show",this.DO);z.W.add(c.m(),"zg-gray-normal");(0,window.$)(c.m()).addClass("setting-menu");b=new z.xz("comment",c);b.uk=!0;z.zz(b);yz(b);b.Ob=z.Fl;b.w(a);this.ka=c}; fA.prototype.DO=function(){var a=this;window.$.get("/answer/comment_permission",{answer_id:this.Mh.jb}).then(function(b){if(b&&!b.r){var c=b.msg;a.vA.forEach(function(a){a.X()===c&&a.Kc(!0)});a.gl=c}else z.X.message(b.msg)})};fA.prototype.aB=function(a){ZC.aB(this.Mh.jb,a);(0,window.$)(".copyright",FC(this.Mh)).text(a?"作者保留权利":"禁止转载").attr("href",a?"/terms#sec-licence-1":"/terms#sec-licence-6")}; fA.prototype.ty=function(a){a=a.target;var b=a.X();if("禁止转载"===b)this.aB(!a.qf());else if("删除"===b)iA(this);else if(b in hA)if(this.gl===b)jA(this);else if("review_comment"===this.gl){var c=this;a=void 0;var d;"all_can_comment"===b?(a="确认开放评论吗?",d="开放评论后,评论提交即公开显示。\x3cbr/\x3e当前所有待审核评论不会公开,为您自动保存,若切换回预审评论可以继续审核。"):"nobody_can_comment"===b&&(a="确认关闭评论吗?",d="关闭评论后,所有人无法提交评论。\x3cbr/\x3e当前所有待审核评论不会公开,为您自动保存,若切换回预审评论可以继续审核。");z.X.confirm(a,d,function(a){a&&kA(c,b)});jA(this)}else kA(this,b)}; var hA=z.T.Jd?{all_can_comment:"开放评论",review_comment:"预审评论",nobody_can_comment:"关闭评论"}:{all_can_comment:"允许任何人评论",followee_can_comment:"允许我关注的人评论",nobody_can_comment:"关闭评论"},lA="set_permission";var iG=/a(:(link|visited|active|hover))?/;oA.prototype.clone=function(){var a=new oA;a.rh=this.rh.concat();a.Jn=this.Jn;return a};var jG=/(^|;|{)\s*color:([^;]+);/g,sA={},vA={},kG={},lG="color visibility quotes list-style-type list-style-image list-style-position list-style page-break-inside orphans widows font-family font-style font-variant font-weight text-indent text-align text-transform white-space caption-side border-collapse border-spacing empty-cells cursor".split(" "),mG="font-family font-size font-weight font-variant font-style color text-align text-decoration text-indent text-transform letter-spacing white-space word-spacing".split(" ");var nG;z.x(z.wA,z.G);z.e=z.wA.prototype;z.e.F=null;z.e.ZM=!0;z.e.DK=function(){this.F&&(this.disable(this.F),this.F=null)};z.e.enable=function(a){this.F==a&&(this.ec=!0)};z.e.disable=function(a){this.F==a&&(this.ec=!1)};z.e.isEnabled=function(a){return this.F==a?this.ec:!1};z.e.Oq=z.El;z.e.aH=z.El;z.e.D=function(){this.F&&this.DK(this.F);z.wA.o.D.call(this)};z.EA=z.$o({py:1,SP:2,us:3,Kj:4,vs:5,execCommand:6,queryCommandValue:7,TI:8,yN:10,xN:11});nG={8:!0,10:!0,11:!0}; z.wA.prototype.execCommand=function(a,b){var c=this.aH(a);c||(z.B&&z.aB(this.F,!0,!0),this.F.ci());try{var d=this.gf.apply(this,arguments)}finally{c||(this.F.df(),z.$A(this.F))}return d};z.wA.prototype.He=function(){return!1};var FA,IA;z.x(DA,z.G);DA.prototype.Ha=null;DA.prototype.Ic=null;FA="change";z.GA="delayedchange";IA={pX:"cvc",JX:"load",dY:"unload",hX:"beforechange",nX:FA,rX:z.GA,iX:"beforefocus",uX:"focus",lX:"blur",kX:"beforetab",BX:"ifrsz",jX:"beforeselectionchange",SX:"selectionchange"};z.KA=0;z.oG=null;z.e=DA.prototype;z.e.Wg=!1;z.e.OK=!1;z.e.fv=!1;z.e.m=function(){return this.Ha}; z.e.addListener=function(a,b,c,d){var f=this.m();LF&&f&&this.nc()&&(f=f.ownerDocument);d?z.yd(this.fc,f,a,b,c,d):this.fc.g(f,a,b,c)};var JA=15,HA=250;DA.prototype.nc=z.Fl;DA.prototype.Fo=z.Fl;DA.prototype.SJ=z.El;var NA={46:!0,8:!0};z.C||(NA[9]=!0);var OA={86:!0,88:!0};z.ll&&!z.B&&(NA[229]=!0); DA.prototype.Dw=function(){this.fc&&this.fc.removeAll();if((z.Ui||z.Vj)&&this.nc()&&this.SJ()){try{var a=this.ib.Va();a.removeEventListener("keydown",this.ln,!1);a.removeEventListener("touchend",this.ln,!1)}catch(b){}delete this.ln}if(z.ug&&this.nc()){try{a=this.ib.Va(),a.removeEventListener("focus",this.pw,!1),a.removeEventListener("blur",this.ow,!1)}catch(b){}delete this.pw;delete this.ow}this.ue&&this.ue.stop();this.Jr.stop()}; DA.prototype.D=function(){this.Ho()||this.uc();this.Ic&&this.execCommand("clearlorem");this.$l=z.KA;for(var a in this.Rb){var b=this.Rb[a];b.Oq()||b.disable(this)}this.ib=this.Ha=null;this.Dw();this.tl&&(z.nd(this.tl),this.tl=null);this.im=null;this.fc&&(this.fc.H(),this.fc=null);for(;a=this.cX.pop();)a.H();z.oG==this.id&&(z.oG=null);for(var c in this.Rb)a=this.Rb[c],a.ZM&&a.H();delete this.Rb;DA.o.D.call(this)}; var pG=["DOMNodeInserted","DOMNodeRemoved","DOMNodeRemovedFromDocument","DOMNodeInsertedIntoDocument","DOMCharacterDataModified"];DA.prototype.hB=function(){if(IF||!this.nc())this.fc.g(this.m(),"DOMSubtreeModified",this.qy);else{var a=this.ib.ua();this.fc.g(a,pG,this.qy,!0);this.fc.g(a,"DOMAttrModified",(0,z.q)(this.RF,this,this.qy),!0)}};var UA={8:1,9:1,13:1,33:1,34:1,35:1,36:1,37:1,38:1,39:1,40:1,46:1},VA={65:!0,86:!0,88:!0},XA={8:1,9:1,13:1,27:1,33:1,34:1,37:1,38:1,39:1,40:1};z.e=DA.prototype; z.e.zo=function(a,b){for(var c=this.Qj[a],d=z.yb(arguments,1),f=0;f=f).attr("data-tip","s$r$"+f+" 人觉得这个很赞");d.text(f);b.toggleClass("liked",c);pr(b[0],c?"取消赞":"赞")});z.e.expand=function(){this.Lc(!0)};z.e.collapse=function(){this.Lc(!1)}; z.e.Yc=function(){return this.Og};z.e.Lc=function(a){if(a!==this.Og){a&&(this.$(this.jD).hide(),this.Mg());this.Og=a;this.dispatchEvent(a?"beforeexpand":"beforecollapse");z.Q(this.h,this.Og);var b=(0,z.q)(function(){a&&ZB(this);this.dispatchEvent(a?"expand":"collapse");this.vl&&!a&&(z.ev(this.vl),z.Nr(this.vl.h))},this),c;a&&this.Wt?(c=$B(this))&&c.done(b):(0,window.setTimeout)(b);this.Rd&&(a?(this.YT=z.of(this.Rd),pr(this.Rd,"收起评论")):pr(this.Rd,0>this.Ja?this.YT:this.Ja?this.Ja+" 条评论":"添加评论"))}}; z.e.Ch=function(){this.Lc(!this.Og)};z.e.vH=function(){return this.Dg.Bj(this.id)};z.e.Lp=function(a){this.hj=a};z.e.NU=function(a){a=z.We((0,z.ab)(a));z.Q(a,this.Og);z.y((0,window.$)("."+this.J.uf,a).get(),this.Jt,this);this.Wt=!1;this.Hb();z.Po(a,this.h);this.h=a;bC(this)};z.e.Rn=function(){this.Ha.focus()};z.e.Ua=function(){var a=(0,z.ab)(this.oj.Al());return a===this.placeholder?"":a}; z.e.Pq=LB(function(){var a=this.Ua(),b=(0,z.ab)(z.of(this.Ha));a&&"TEXTAREA"===this.Ha.tagName&&b||a?dC(this,a):(z.X.message("请填写内容"),this.Rn())});z.e.kb=function(){return this.Ja};z.e.fP=function(a){if(!a)return z.X.message("网络异常");if(a.r)return z.X.alert(a.msg);this.Dg.js(a.msg).done(window.$.proxy(this.OU,this));this.oj.Pd("");SB(this);this.Gu(!1)}; z.e.Jt=function(a){if(z.pm("auth_f_manage")&&"favlist"!==this.type&&!(0,window.$)(".del, .op.remove",a).length){var b=a.getAttribute("data-id");(0,window.$)("\x3ca\x3e",{href:"#",name:"admin_delcomment","class":"del zm-comment-op-link op needsfocus",html:'\x3ci class\x3d"zg-icon zg-icon-comment-del"\x3e\x3c/i\x3e删除',"data-op":"remove-comment","data-action":"/manage?"+window.$.param({comment_id:b,action:"remove_comment2"})}).appendTo((0,window.$)(".zm-comment-ft, .actions",a))}this.vo(a)}; z.e.vo=function(a){(0,window.$)("a[name\x3dreport], button.report",a).on("click",function(){(new z.pB({type:"comment",id:a.getAttribute("data-id")})).render()})};z.e.OU=function(a){this.Yj="";a=z.We(a);this.xn.appendChild(a);this.Jt(a);this.Ja+=1;cC(this)};z.e.iy=function(a){var b=z.Ho(a,this.J.uf),c=b.getAttribute("data-id");z.X.confirm("删除评论","你确定要删除这条评论吗?",function(a){a&&hC(this,c,z.Ba(z.P,b))},this)}; z.e.Mg=function(){(0,window.$)(window).on("beforeunload.CommentForm",(0,z.q)(function(){if(this.Yj)return"你的评论还未保存,确认离开该页面吗?"},this))};z.e.bi=function(){(0,window.$)(window).off("beforeunload.CommentForm")};z.e.na=function(a){this.dispatchEvent({type:"trackRequested",category:"comment",action:a.action.replace("[type]",this.type)})};z.l(jC,z.R);z.e=jC.prototype;z.e.Yc=function(){return this.Vj};z.e.Lc=function(a){a!==this.Vj&&(this.dispatchEvent(a?"beforeexpand":"beforecollapse"),this.Vj=a,z.Q(this.h,a),oC(this),pC(this),this.dispatchEvent(a?"expand":"collapse"),this.wl&&!a&&(z.ev(this.wl),z.Nr(this.wl.m())))};z.e.Ch=function(){this.Lc(!this.Vj)};z.e.Mi=function(){};z.e.Rn=function(){(0,window.$)("[data-input-box]",this.m()).focus()};z.e.reload=function(){qC(this,"reloadComments")};z.e.Lp=function(a){this.hj=a}; z.e.We=function(){var a=this;oC(this);pC(this);mC(this);this.v().g(z.Cp,"anon_change",function(){a.Vj&&a.reload()});(0,window.$)(this.m()).on("click",'button[data-key\x3d"cancel"]',function(b){0===lC(a)&&(b.preventDefault(),a.Lc(!1))})};z.e.B=function(){this.h=z.O("div","comment-app-holder");z.Q(this.h,!1)}; z.e.render=function(a,b){b=void 0===b?{}:b;var c=this;z.R.prototype.render.call(this,a);var d=this.entryType,f=this.jb,g={},h=Object.assign((g.entry={id:f,type:d},g.useContentEditable=z.Tm,g.createItemActions=function(a){var b=[],d=a.id,f=a.own;!f&&z.rm.MG&&b.push({key:"adminremove",label:"删除",icon:"zg-icon zg-icon-comment-del",onClick:function(){var a={op:"remove-comment",action:"/manage?comment_id\x3d"+d+"\x26action\x3dremove_comment2"},b={id:d,type:"comment"};(new z.mB).open(a,b,function(){qC(c, "RemoveComment",{id:d})})}});f||b.push({key:"report",label:"举报",icon:"zg-icon zg-icon-comment-report",onClick:function(){(new z.pB({type:"comment",id:a.id})).render()}});return b},g.onEditorCreated=function(a){return MB(a,d,f)},g.onRequestHighlight=function(a){z.xr(a);z.Nr(a,{offsetTop:45});a.focus()},g),b),g=z.ia(window.location.hash.match(/#comment-(\d+)/)||[]);g.next();(g=g.next().value)&&(h.query={bycomment:g});var k=Object.assign({},Qw(),{authRequired:function(a){return z.Jq(a,!0,function(){return c.hj})}}), m=z.Qj(function(){return c.qD&&kC(c)});z.Ow("CommentApp").then(function(b){a.appendChild(c.h);c.Zq=b.render(c.h,h,k);c.We();c.Zq.store.subscribe(function(){(0,window.setTimeout)(function(){oC(c);pC(c);m()})})})};z.sG={fG:function(a){this.Vu();var b=this.Ga.Yc();(0,window.$)(".zm-meta-panel",this.m()).toggleClass("focusin",b);b&&(a=(0,window.parseInt)(z.of(a.currentTarget),10)||0,this.Ga.Mi("view_comments",a));(0,z.Gi)(this,{action:b?"CommentIntent":"EndCommentIntent",element:"Button"})},Vu:function(){this.ZE();this.Ga.Ch()},wY:function(){return this.Ga},JP:function(){this.Ga?this.Ga.Rn():this.Vu()},ZE:function(){if(!this.Ga){var a=(0,window.$)(".toggle-comment, .js-toggleCommentBox",this.h)[0],b=this.yF(); if(b===jC)this.Ga=new b(this.jb,this.entryType),this.L(this.Ga),this.Ga.render(this.Rx(),{embedded:/^\/roundtable/.test(window.location.pathname)}),nC(this.Ga,a);else if(this.Ga=new b(this.jb,this.entryType),this.L(this.Ga),z.NB(this.Ga,this.Rx(),a),a=this.Ga,!a.vl&&!z.rm.Ab&&(b=z.Ho(a.h,"zm-item-meta"))){var c=z.N("zm-meta-panel",b);c&&(a.vl=new iv(null,b),a.vl.tag="comment",a.vl.w(c))}this.Sx&&this.Ga.Lp(this.Sx())}},yF:function(){return z.JB}};z.x(rC,z.R);var sC={Cg:"is-sticky",top:null,bottom:null,Gb:null,LM:!1,xI:z.p,Lt:z.p};z.e=rC.prototype;z.e.D=function(){this.stop();rC.o.D.call(this)};z.e.start=function(){this.state.Yl||(this.state.Yl=!0,(0,window.$)(window).on("scroll resize",this.mK).trigger("scroll"))};z.e.stop=function(){this.state.Yl&&(this.state.Yl=!1,(0,window.$)(window).off("scroll resize",this.mK),this.restore(),this.state.Ws=!1,this.state.Ys=!0,(0,window.setTimeout)(function(){(0,window.$)(window).trigger("scroll")}))}; z.e.update=function(){if(this.state.Ao)this.state.uA=!0;else{var a=this.options.top,b=this.options.bottom,c=this.state.Ws,d=this.state.Ys,f,g,h=(this.kc||this.h).getBoundingClientRect(),k=this.options.Gb.getBoundingClientRect(),m=(0,window.$)(window).height();h.height||(h.height=h.bottom-h.top);null!==a?(f=h.top>a,g=k.bottom>a+h.height):null!==b&&(f=h.bottom>m-b,g=k.top>m-h.height-b);this.state.Ws=f;this.state.Ys=g;if((c&&!d)===(f&&!g))f&&!g&&this.ha();else{if(d&&!g)return uC(this);if(!d&&g)return wC(this); this.options.LM?f?uC(this):wC(this):f?tC(this):this.restore()}}};z.e.ha=function(){var a=(this.kc||this.h).getBoundingClientRect().left,b=this.options.top,c=this.options.bottom;(0,window.$)(this.h).css({left:a+"px",top:b?b+"px":"auto",bottom:c?c+"px":"auto"})};z.e.restore=function(){this.kc&&((0,window.$)(this.h).removeClass(this.options.Cg).css({left:"",top:"",bottom:""}),(0,window.$)(this.kc).remove(),this.kc=null,this.options.Lt.call(this))}; z.e.onAnimationEnd=function(){this.state.Ao=!1;this.state.uA&&(this.state.uA=!1,this.update())};z.x(z.xC,z.R);z.Ca(z.xC.prototype,z.sG);z.e=z.xC.prototype;z.e.Yr="zm-item-expanded";z.e.mM="zm-item-meta, .js-contentActions";z.e.Po=null;z.e.$w="z-icon-fold";z.e.yB="sprite-global-icon-fold-white";z.e.C=function(){z.xC.o.C.call(this);BC(this);this.jn();this.Lh();zC(this);if(this.ob)this.Ps();else{var a=this;this.g("expand",function(){return a.Ps()})}};z.e.JF=function(){return DC(this)}; z.e.Sx=function(){var a=this.entryType+"-"+this.jb;return(0,window.$)('a[name\x3d"'+a+'"]',this.h).length&&"#"+a};z.e.jn=function(a){var b={".js-expand":this.expand,".js-collapse":this.collapse,".js-report":this.lQ,".column[data-entry-url]":this.OF};z.Mb(b,a||{});z.Db(b,function(a,b){if(z.sa(a))(0,window.$)(this.h).on("click",b,window.$.proxy(a,this))},this);(0,window.$)(".js-toggleCommentBox",this.h).on("click",this.fG.bind(this))};z.e.st=function(){(0,z.hG)(this.entryType,this.tj,"read")}; z.e.CH=function(){(0,z.hG)(this.entryType,this.tj,"touch")};z.e.expand=function(a){this.ob||(this.ob=!0,z.W.add(this.h,this.Yr),this.dispatchEvent("expand"),a=a&&z.jf(a.target)&&z.gj(a.target,"js-vote-count"),this.Zu(a),(0,z.Gi)(this,{action:"Expand",element:"Button"}))};z.e.collapse=function(){this.ob&&(this.ob=!1,this.Yu(),Rr(this.h,(0,z.q)(function(){z.W.remove(this.h,this.Yr);this.dispatchEvent("collapse")},this)),(0,z.Gi)(this,{action:"Collapse",element:"Button"}))};z.e.Yc=function(){return this.ob}; z.e.Ch=function(){this.ob?this.collapse():this.expand()};z.e.RJ=function(){return!z.vm}; z.e.Ps=function(){if(this.ob&&this.RJ()&&!this.hO){this.hO=!0;var a=(0,window.$)(".js-collapse-body",this.h)[0];if(a){var b=this,c=(0,window.$)(".js-collapse",this.h)[0];if(!c){if("answer"!==this.entryType)return;c=(0,window.$)(".zm-meta-panel",this.h);if(!c.length)return;c=(0,window.$)('\x3cbutton class\x3d"item-collapse js-collapse"\x3e\x3ci class\x3d"sprite-global-icon-fold-white"\x3e\x3c/i\x3e收起\x3c/button\x3e').appendTo(c).on("click",(0,z.q)(this.collapse,this)).get(0)}var d=this.dK=new rC(0, {bottom:12,Gb:a,xI:function(){(0,window.$)("i",this.h).removeClass(b.$w).addClass(b.yB)},Lt:function(){(0,window.$)("i",this.h).removeClass(b.yB).addClass(b.$w)}});z.Ac(this,d);d.w(c);this.g("expand",function(a){a.target===a.currentTarget&&d.start()});this.g("collapse",function(a){a.target===a.currentTarget&&d.stop()});d.start()}}}; z.e.Zu=function(a){var b="view_answer",c=DC(this);a=a?"vote_up_count":"expand_answer";var d=(0,window.$)(this.h).index()+1;if("feed"!==c)z.zi(b,"click_expand_answer",c+"_"+a,d);else{var c=CC(this),f=EC(this);-1a?a.toString():1E6>a?(0,window.parseInt)(a/1E3)+"K":1E9>a?(0,window.parseInt)(a/1E6)+"M":(0,window.parseInt)(a/1E9)+"G")};z.e.kb=function(){return this.Bq.text()}; z.e.cW=function(){var a={};a[z.VC.zg]="vote_up";a[z.VC.Qk]="vote_down";a[z.VC.Mq]="vote_neutral";return this.ai=(0,{post:YC.jC,answer:ZC.jC,promotion:SC}[this.entryType])(this.jb,a[this.N])};z.e.OB=function(){this.lc(this.N===z.VC.Qk?z.VC.zg:this.N^z.VC.zg);(0,z.Gi)(this,{action:this.N===z.VC.Mq?"UnUpvote":"Upvote",element:"Button"})};z.e.pK=function(){this.lc(this.N===z.VC.zg?z.VC.Qk:this.N^z.VC.Qk);(0,z.Gi)(this,{action:this.N===z.VC.Mq?"UnDownvote":"Downvote",element:"Button"})};z.e.Hc=function(){this.dispatchEvent("change")};z.x(XC,z.R);z.e=XC.prototype;z.e.kb=function(){return this.nb.data("votecount")};z.e.bB=function(a){this.nb.data("votecount",a);this.Hc()};z.e.Hc=function(){this.dispatchEvent("change")};z.e.Ap=function(a){if(a=(0,z.ab)(a))a=(0,window.$)(a),this.nb.replaceWith(a),this.nb=a,this.cc(),this.Hc()}; z.e.cc=function(){function a(a,d){var f=z.O("div","zm-voters");a.appendChild(f);var g=z.O("div","listview");f.appendChild(g);var h=("post"===b.entryType?"/post/":"/answer/")+b.jb+"/voters_profile",k=new z.Cl({use:[],source:function(){return window.$.get(h).then(function(a){var c=a.paging;c&&(c.total&&b.bB(c.total),h=c.next);return{results:a.payload,next:!!h}})}});k.w(g);k.kf().setAttribute("hidden","true");z.Ac(d,k);k.v().ya(k,"next",function(){k.gb().length?(k.kf().removeAttribute("hidden"),k.use("autoload", {cr:!1,viewport:f})):(k.H(),f.innerHTML='\x3cdiv class\x3d"empty-results"\x3e还没有人赞同\x3c/div\x3e')});return k.ti()}var b=this;(0,window.$)("a.more",this.nb).click(function(){var c=z.X.async({modal:!0,title:b.kb()+" 人赞同",className:"zm-voters-dialog",Iw:window.$.Deferred(function(b){(0,window.setTimeout)(function(){a(c.S(),c).then(function(){b.resolve(null)})})}).promise()});c.v().g(b,"change",function(){c.Na(b.kb()+" 人赞同")})})};z.e.C=function(){this.nb=(0,window.$)(this.h);this.cc();z.xo(this,{module:"VoteInfo"})};z.x(aD,z.R);z.e=aD.prototype;z.e.Y=function(a){aD.o.Y.call(this,a);this.v().g(a,"click",this.QT)};z.e.eO=function(){var a=this.ev;z.Po(a.m(),this.VK);z.kj(a.m(),[this.UK,this.WK])};z.e.MM='\x3cdiv class\x3d"text zg-clear"\x3e\x3clabel class\x3d"zg-left"\x3e赞同\x3c/label\x3e\x3clabel class\x3d"zg-right"\x3e反对\x3c/label\x3e\x3c/div\x3e';z.e.mU='\x3cdiv class\x3d"text zg-clear votebar-text-post"\x3e\n \x3clabel\x3e赞\x3c/label\x3e\n\x3c/div\x3e'; z.e.QT=z.Jq(function(){this.Ia&&this.Ia.H();var a=new z.V(null);a.Bf(!0);a.vm(!0);a.oF=!0;bD(this);this.v().ya(a,"hide",this.eO);var b=["post","promotion"].includes(this.ev.entryType)?this.mU:this.MM,c=a.S();c.appendChild(this.ev.m());c.appendChild(z.We(b));z.W.add(a.m(),this.dx);a.G(!0);this.Ia=a;z.Ac(this,a)},!0);z.tG={Yy:function(){function a(){var a=c.Yc();if(a&&(b(),f)){var d=f,h=d.nb;h.data("async-voters")&&(h.removeData("async-voters"),z.$C(d))}g&&z.dv(g,a)}function b(){if(!g){var a=!z.Uj,b=z.N("js-collapse-body",c.m());a&&h&&(0,window.$)(h).is(":visible")&&b&&230<(0,window.$)(b).height()&&(g=c.$Y=new iv(null,b),c.L(g),g.tag="votebar",g.KI=50,g.w(h))}}var c=this,d=void 0,f=void 0,g=void 0,h=(0,window.$)(".votebar, .zm-votebar",this.m())[0];if(h){d=this.Ri=new TC(this.jb,this.entryType);this.L(d);d.w(h); var k=(0,window.$)(".js-openVoteDialog",this.m())[0];k&&(new aD(d)).w(k)}if(k=(0,window.$)(".zm-item-vote-info",this.m())[0])f=this.XK=new XC(this.jb,this.entryType),this.L(f),f.w(k);d&&(this.v().g(d,"change",function(){f?z.$C(f):(0,window.$)("[data-bind-votecount]",this.m()).text(d.kb())}),f&&this.v().g(f,"change",function(){(0,window.$)("[data-bind-votecount]",this.m()).text(f.kb());d.bB(f.kb())}));this.v().g(this,["expand","collapse"],a);(0,window.$)(this.m()).on("contentchange",b);(0,window.setTimeout)(a)}};z.x(z.cD,z.xC);z.e=z.cD.prototype;z.e.C=function(){var a=this;z.cD.o.C.call(this);z.xo(this,{module:"AnswerItem"},function(){return{card:{card_type:"Content",content:{type:"Answer",id:a.jb}}}})}; z.e.jn=function(){var a=this;z.cD.o.jn.call(this,{".js-collect":this.NF,".js-thank":this.dG,".js-noHelp":this.bQ,".js-administer":this.TJ,".js-orgCollapse":this.fQ,".js-expandQuestionDetail":this.LJ.bind(this,!0)});this.Yy();this.Ty();this.oi();iD(this);this.Sj();this.Uy();this.v().g(this,"collapse",function(b){b.target===a&&a.LJ(!1)});if(this.ob)this.Ul();else{var b=this;this.ya("expand",function(){return b.Ul()})}}; z.e.Lh=function(){var a=this;z.cD.o.Lh.call(this);z.wl(z.wl(z.wl(z.wl(this.Df.register("v",function(){a.Ri&&a.Ri.OB()}),{group:"操作",name:"赞同"}).register("d",function(){a.Ri&&a.Ri.pK()}),{group:"操作",name:"反对"}).register("t",this.dG,this),{group:"操作",name:"感谢"}).register("s c",this.NF,this),{group:"操作",name:"收藏"});if(z.rm.MG&&(0,window.$)(".js-administer",FC(this))[0]){var b=this,c=z.Uc?"⌘":"ctrl",d=function(){b.TJ();b.Rq.xb(0)};z.wl(z.wl(this.Df.register("meta+.",d),{group:"管理",name:"展开菜单",key:c+"+."}).register("meta+k", function(){d();var a=b.Rq.ii(0);a.Ya&&a.Ya()&&(a.Iu(),a.Ya().xb(0))}),{group:"管理",name:"展开折叠子菜单 (Kill)",key:c+"+k"})}};z.e.Sj=function(){var a=(0,window.$)(".js-share",this.m()).get(0),b=this.Ng.url;a&&b&&(a=z.LC(a,"answer",this.tj,b),z.Ac(this,a),a.Db(this))}; z.e.oi=function(a){var b=new z.PC(a);this.L(b);b.w(this.h);this.g("expandRequest",(0,z.q)(this.expand,this));this.g("expand",function(a){a.target===a.currentTarget&&b.expand()});this.g("collapse",function(a){a.target===a.currentTarget&&b.collapse()});b.$G&&this.v().ya(b,"expand",this.st)}; z.e.Ty=function(){var a=(0,window.$)(".phone-actions",this.m());if(a.length){var b=new z.qz;b.w((0,window.$)(".menu",a)[0]);b=new z.xz("operation",b);b.uk=!0;z.zz(b);yz(b);b.Ob=z.Fl;b.w((0,window.$)(".menubutton",a)[0])}}; z.e.dG=yC(function(a){if(a=a.target){var b="true"===a.getAttribute("data-thanked");b?(pr(a,"感谢"),a.setAttribute("data-thanked",!1),window.$.post("/answer/cancel_thanks",{aid:this.jb})):(pr(a,"取消感谢"),a.setAttribute("data-thanked",!0),window.$.post("/answer/thanks",{aid:this.jb}));(0,z.Gi)(a,{action:b?"UnThank":"Thank",element:"Button"})}},{Fb:"question_answer_thank"}); z.e.bQ=yC(function(a){a=a.target;var b=!!a.m;z.Y.tb({type:"ga_click_answer_not_helpful",target:b?a.m():a});this.cx&&"pending"===this.cx.state()&&this.cx.abort();var c=-1<(b?a.Qg():a.innerHTML).indexOf("撤销"),d=c?"没有帮助":"撤销没有帮助";b?a.Jp(d):a.innerHTML=d;d=c?"/answer/helpful":"/answer/not_helpful";b||z.xr(a);this.cx=window.$.post(d,{aid:this.jb});(0,z.Gi)(this,{action:c?"UnNoHelp":"NoHelp",element:"Button"})},!0); z.e.NF=yC(function(){var a=z.Rz.ba();Uz(a,this.jb);a.show();(0,z.Gi)(this,{action:"CollectIntent",element:"Button"})},{Fb:"question_answer_collect",qe:!0});z.e.Uy=function(){var a=(0,window.$)(".js-settings",FC(this))[0];if(a){var b=this;this.gD=new fA(this);this.gD.w(a);this.v().g(this.gD,lA,function(){if(b.Ga){var a=b.Ga.Yc();b.removeChild(b.Ga,!0);b.Ga.H();b.Ga=null;b.ZE();a&&b.Ga.Ch()}})}}; z.e.TJ=function(){if(this.Rq)return this.Rq.G(!0);var a=dD(this);a&&(z.Hz(a,new z.cz(this.tM,1,!0),0,new z.pg(5,0,5,0)),gD(this,a),this.Rq=a)};z.e.fQ=function(){var a=this,b=void 0,c,d;this.pi?(b="取消隐藏回答",c="确认取消隐藏?",d="cancel_collapse"):(b="隐藏回答",c="隐藏后该回答将不展示也不流通,是否确认隐藏?",d="collapse");z.X.confirm(b,c,function(b){b&&window.$.post("/answer/"+a.tj+"/org_"+d).then(function(a){a.r?z.X.message(a.msg):(z.X.message("操作成功!"),window.location.reload())})})}; z.e.Ul=function(){(0,window.$)("img.lazy:not([data-lazyloaded])",this.m()).attr("data-lazyloaded","").lazyload({load:function(){(0,window.$)(this).trigger("contentchange")},data_attribute:"actualsrc",event:"scroll updatelazy",threshold:400})};z.e.Fc=z.aa(40);z.e.LJ=function(a){(0,window.$)(".feed-question-detail-item",this.h).toggleClass("question-detail-expanded",a)};z.Ca(z.cD.prototype,z.tG);z.x(z.jD,z.xC);z.e=z.jD.prototype;z.e.Po="post-link";z.e.C=function(){var a=this;z.jD.o.C.call(this);this.Yy();this.oi();this.Ty();this.Sj();lD(this);kD(this);z.xo(this,{module:"PostItem"},function(){return{card:{card_type:"Content",content:{type:"Post",id:a.jb}}}})};z.e.JF=function(){return"feed_article_"+EC(this)+(this.Yc()?"_expand":"")}; z.e.Sj=function(){var a=(0,window.$)("a[name\x3dshare], .js-share",this.h).get(0),b=(0,window.$)(".post-link, .js-title-link",this.h).get(0);a&&b&&z.LC(a,"post",this.tj,b.href).Db(this)};z.e.Fc=z.aa(39);z.e.xy=z.aa(41);z.e.oy=z.aa(42); z.e.oi=function(a){var b=new z.PC(a);this.L(b);b.w(this.h);this.fK=b;this.g("expandRequest",(0,z.q)(this.expand,this));this.g("expand",function(a){a.target===a.currentTarget&&b.expand()});this.g("collapse",function(a){a.target===a.currentTarget&&b.collapse()});b.$G&&this.v().ya(b,"expand",this.st)};z.e.Lh=function(){var a=this;z.jD.o.Lh.call(this);z.wl(this.Df.register("v",function(){a.Ri&&a.Ri.OB()}),{group:"操作",name:"赞同"})}; z.e.Ty=function(){var a=(0,window.$)(".phone-actions",this.m());if(a.length){var b=new z.qz;b.w((0,window.$)(".menu",a)[0]);b=new z.xz("operation",b);b.uk=!0;z.zz(b);yz(b);b.Ob=z.Fl;b.w((0,window.$)(".menubutton",a)[0])}};z.Ca(z.jD.prototype,z.tG);z.l(z.mD,z.xC);z.mD.prototype.Fc=z.aa(38);z.x(z.oD,z.lz);z.oD.prototype.Nd=function(){return this.dispatchEvent("action")};z.Tp("goog-option",function(){return new z.oD(null)});z.x(z.pD,z.R);z.e=z.pD.prototype;z.e.cC=!z.Uj;z.e.aC=!z.Uj;z.e.wH=!1;z.e.Ii=function(a){this.ah=a};z.e.init=function(){this.Md=z.L("zh-load-more");this.w(this.uO)}; z.e.C=function(){z.pD.o.C.call(this);this.en=1;tD(this);this.Nk=(0,window.$)(this.Md);this.Md&&(rD(this),this.v().g(this.Md,"click",function(){this.Co=!0;this.Hh&&"pending"===this.Hh.state()&&1===this.en?(this.Hh.done((0,z.q)(this.ik,this)),this.jB=!0,z.qD(this,!0)):this.cC&&this.bu?(this.ik(this.bu),this.bu=null):(z.qD(this,!0),this.eh())}),this.cC&&(this.IB=new z.fl(this.dA,100,this),this.v().g(window,"scroll",function(){this.IB.fire()})));uD(this,this.gb())};z.e.ti=function(){this.eh(!0)}; z.e.dA=function(){var a=this.Md;a&&z.Kg(a)&&1E3>=a.getBoundingClientRect().top-z.Oe().height&&!(this.bu||this.Hh&&"pending"===this.Hh.state())&&(this.aC&&(3!==this.en||this.wH?(this.Co=!1,this.en++,this.jB=!0):(this.en=1,this.jB=!1)),this.eh())}; z.e.eh=function(a,b,c){b=b||z.p;if(!this.Hh||"pending"!==this.Hh.state()){var d=this.BA(window.$.extend(this.params,{offset:this.offset,start:this.Ku}));z.Y.tb({type:"topstory_feed_more"});(0,z.Gi)(this,{action:this.Co?"LoadMore":"RollForMore",element:"Button"});this.Hh=window.$.post(this.url,d).done(b).done(window.$.proxy(function(b){if(c)return c.call(this,b);this.cC&&!a?this.jB?this.ik(b):(this.bu=b,z.qD(this,!1)):this.ik(b)},this));1!==this.en&&z.qD(this,!0);return this.Hh}};z.e.BA=function(a){return a}; z.e.ik=function(a){if(a&&!a.r){var b=a.msg,c=b[0],d=b[1],f;2c);z.Q(this.Md,b);z.qD(this,!1);z.sD(this)}};z.e.gb=function(){return z.Qo(this.ah,this.h)};z.e.sA=function(a){return a.id.replace(/^\w+-/,"")}; z.e.$q=function(a,b){var c=z.na(a)?a.join(""):a,c=z.We(c+" "),d=z.Qo(this.ah,c);uD(this,d);"prepend"===b?z.af(c,this.h.firstChild):this.h.appendChild(c);tD(this)};z.e.Kt=z.p;z.x(z.vD,z.G);z.vD.prototype.handleEvent=function(a){if("input"==a.type)z.C&&z.E(10)&&0==a.keyCode&&0==a.charCode||(wD(this),this.dispatchEvent(xD(a)));else if("keydown"!=a.type||to(a)){var b="keydown"==a.type?this.h.value:null;z.C&&229==a.keyCode&&(b=null);var c=xD(a);wD(this);this.ma=z.vd(function(){this.ma=null;this.h.value!=b&&this.dispatchEvent(c)},0,this)}};z.vD.prototype.D=function(){z.vD.o.D.call(this);this.T.H();wD(this);delete this.h};z.x(yD,z.G);var zD=0;yD.prototype.Yz=function(){this.el()};yD.prototype.el=function(){var a=this.di.value.length;if(a>this.wt){var b=this.di.scrollTop,c=this.di.scrollLeft;this.di.value=this.di.value.substring(0,this.wt);a=this.wt;this.di.scrollTop=b;this.di.scrollLeft=c}this.TE&&z.mf(this.TE,String(1==this.jO?a:this.wt-a))};yD.prototype.D=function(){yD.o.D.call(this);delete this.di;this.$y.H();this.$y=null};var FD;z.x(z.AD,z.Xj);z.e=z.AD.prototype;z.e.init=function(){this.Ts||(this.Ts=!0,this.B(),this.cc())};z.e.cc=function(){z.C||(new z.Xs("搜索问题")).w(this.$c);this.ca=new z.kt("/redirect-question/autocomplete",this.$c,null,null,z.L("zh-question-redirect-diag-content"),!1);this.ca.dn=!1;this.ca.vh(!0);this.v().g(this.ca,"suggestionsupdate",Pr);this.v().g(this.ca,"select",this.tT).g(this.lN,"click",function(){this.sa.G(!1)})}; z.e.tT=function(){var a=this.ca.Ej();if("search_link"===a[0])window.open("/search?q\x3d"+(0,window.encodeURIComponent)(a[1])+"\x26type\x3dquestion");else{this.$c.value="";var b=a[3],a=a[1];this.sa.G(!1);this.$c.value="";this.xhr=new z.Z(!0);this.v().ya(this.xhr,"complete",this.DM);this.xhr.ajax("/question/redirect","qid\x3d"+this.pa+"\x26rqid\x3d"+b);this.tu=b;this.aJ=a}}; z.e.DM=function(){var a=z.Rn(this.xhr);a&&(a.r?z.X.message(a.msg):this.aj?(this.aj.innerHTML="已经重定向",this.aj.setAttribute("data-disabled",1)):this.dispatchEvent("change"))}; z.e.B=function(){this.h=z.O("div",{id:"zh-question-redirect-diag"},["将问题跳转至",z.O("div",{id:"zh-question-redirect-diag-content"},this.$c=z.O("input",{type:"text","class":"zg-form-text-input"})),z.O("div","zm-command",this.lN=z.O("a",{href:"javascript:;","class":"zm-command-cancel",name:"cancel"},"放弃操作"))]);this.sa=new z.V(null);this.sa.Na("问题重定向");z.Lj(this.sa,null);this.sa.S().appendChild(this.h)};z.e.show=function(){this.init();this.sa.G(!0)};var uG={},uG=function(){z.G.call(this)};z.x(uG,z.Xj);uG.Hv=[["需要详细阐述","答案过于简短或表述不清晰,请完善答案。"],["答非所问","没有正面或直接回答问题,请修改答案。"],["应作为问题的评论","该内容是对问题本身的评论而不是回答,请改为发布到评论。"],["应作为答案的评论","该内容是对另外一个答案的评论或回应,而不是回答问题,请改为发布到评论。"],["内容重复","与已有答案重复,请修改答案。"],["内容已过期","答案的时效性已过,请更新答案。"],["需要注明关联利益","有广告、推销嫌疑,请注明作者与利益方的关系。"]];uG.Tj=null;uG.ba=function(){uG.Tj||(uG.Tj=new uG,uG.Tj.init());return uG.Tj};z.e=uG.prototype; z.e.init=function(){if(!this.h){this.B();this.cc();var a=new gx(this.h);An(a);a.rG=!0;a.vm(!0);a.G(!1);a.zA=0;a.V()&&a.ha();z.hx(a,new z.pg(13,0,0,-22));this.yA=a}};z.e.cc=function(){this.v().g(this.h,"click",this.qT)};z.e.qT=function(a){"A"===a.target.tagName&&(a=a.target.getAttribute("data-index"),this.UN.tY(a),this.yA.G(!1))}; z.e.B=function(){var a=z.O("div",{id:"zh-answer-flag-popup","class":"zg-r5px zu-hovercard-wrap"},[z.O("div","zg-r5px zu-hovercard-inner",[z.O("div",{id:"zh-answer-flag-popup-header"},[z.O("a",{"class":"zg-right",href:"/question/19867017",target:"_blank"},"这是什么?"),"选择一个理由:"]),this.GI=z.O("div",{id:"zh-answer-flog-options-wrap"})]),z.O("div","zu-hovercard-spin-top")]);z.y(uG.Hv,function(a,c){var d=z.O("a",{href:"javascript:;","class":"zm-menu-item-link"},a[0]);d.setAttribute("data-index",c);this.GI.appendChild(d)}, this);window.document.body.appendChild(a);this.h=a};z.e.show=function(a,b){this.yA.setPosition(new z.ex(a,1));BD(this,b.xY());this.yA.G(!0);this.UN=b};var ED;z.x(CD,z.Xj);CD.prototype.init=function(){this.B();this.hn()}; CD.prototype.B=function(){this.h=z.O("div",null,[z.O("div","zg-section",[z.O("div",null,"标记:"),this.ul=z.O("select")]),z.O("div",null,[z.O("div",null,"原因"),this.GA=z.O("textarea",{style:"width:96%;border:solid 1px #666;height:66px;padding:5px"})]),this.wn=z.O("div","zm-command",[z.O("a",{"class":"zg-mr10",href:"javascript:void(0);",name:"cancel"},"取消"),z.O("a",{"class":"zg-btn-blue",href:"javascript:void(0);",name:"confirm"},"确定")])]);this.ul.appendChild(z.O("option",{value:"no"},"选择标记原因"));z.y(uG.Hv, function(a,b){this.ul.appendChild(z.O("option",{value:b},a[0]))},this);this.sa=new z.V(null);this.sa.Na("标记答案");z.Lj(this.sa,null);this.sa.S().appendChild(this.h)}; CD.prototype.hn=function(){this.v().g(this.ul,"change",function(){var a=this.ul.value;this.GA.value="no"===a?"":uG.Hv[+a][1]}).g(this.wn,"click",function(a){"cancel"===a.target.name?this.sa.G(!1):this.GA.value&&"no"!==this.ul.value&&(this.Gx=new z.Z(!0),this.v().g(this.Gx,"complete",function(){var a=z.Rn(this.Gx);a&&!a.r?(this.aj.innerHTML="已经标记",this.sa.G(!1)):z.X.message(a.msg)}),a=z.sr(this.GA.value),this.Gx.ajax("/answer/flag","answer_id\x3d"+this.kM+"\x26flag\x3d"+this.ul.value+"\x26reason\x3d"+ (0,window.encodeURIComponent)(a)))})};CD.prototype.show=function(){this.sa.G(!0)};z.LD={digits:{required:"请填写数字验证码"},password:{required:"请填写密码"},password_repeat:{required:"请填写密码"},email:{required:"请填写邮箱"},phone_no:{required:"请填写手机号"}};z.v("ZH.m",z.ND);z.x(z.OD,z.G);z.OD.prototype.show=function(){this.cf||(this.cf=this.Lw(),this.cf.g("hide",this.gP,!1,this));this.cf.G(!0)};z.OD.prototype.hide=function(){this.cf&&this.cf.G(!1)};z.OD.prototype.ub=function(){return!!this.cf&&this.cf.V()};z.PD.prototype.Na=function(a){this.Ti.Na(a);return this};z.PD.prototype.Bd=function(a,b,c){c=c||z.jp();this.sn.set(c,a);this.rn[c]=b;return this};z.PD.prototype.Kh=function(a){z.hj(this.Ti.fi(),a);return this}; z.PD.prototype.ia=function(a){this.Ti.S().appendChild(a);return this};z.e=z.OD.prototype;z.e.gs=z.aa(23);z.e.dQ=function(a){return(a=this.Cn(a))?this.dispatchEvent(a):!1};z.e.eo=function(){return this.dispatchEvent("cancel")};z.e.D=function(){this.cf&&(this.hide(),this.cf.H(),this.cf=null);z.OD.o.D.call(this)};z.e.gP=function(){this.dispatchEvent("afterhide")};z.x(z.TD,z.wA);z.e=z.TD.prototype;z.e.He=function(a){return a==this.GN};z.e.execCommand=function(a,b){return this.gf.apply(this,arguments)};z.e.BF=function(){return this.Ia};z.e.gf=function(a,b){this.xJ||VD(this);this.Ia||(this.Ia=this.Kw(z.J(this.F.Tk),b));var c=z.ZA(this.F);this.sJ=yA(this);this.BJ=c&&new z.av(c);Au(this.F.ib.Va());z.ld(this.Ia,"afterhide",this.co,!1,this);this.F.Wg=!0;this.Ia.show();this.dispatchEvent("dialogOpened");z.$A(this.F);return!0}; z.e.co=function(){this.F.Wg=!1;z.UD(this);this.sJ();this.xJ||VD(this);this.dispatchEvent("dialogClosed");z.$A(this.F);this.F.Hr.selectionchange=(0,z.I)()};z.e.D=function(){VD(this);z.TD.o.D.call(this)};z.e.xJ=!1;z.e.fz=!1;z.x(WD,z.OD);z.x(XD,z.Lc);z.e=WD.prototype;z.e.template=(0,z.Rv)('\x3cdiv class\x3d"zm-img-uploader"\x3e\x3ciframe src\x3d"about:blank" name\x3d"av_up_frame" style\x3d"position: absolute; height: 0; width: 0; left: -9000px; "\x3e\x3c/iframe\x3e\x3cdiv class\x3d"zg-section zm-img-uploader-tab"\x3e\x3ca href\x3d"javascript:;" class\x3d"tab-nav selected"\x3e上传图片\x3c/a\x3e 或 \x3ca href\x3d"javascript:;" class\x3d"tab-nav"\x3e引用站外图片\x3c/a\x3e\x3c/div\x3e\x3cform class\x3d"zg-clear" target\x3d"av_up_frame" method\x3d"POST" enctype\x3d"multipart/form-data" action\x3d"\x3c%\x3d uploadURL %\x3e"\x3e\x3cdiv class\x3d"tab-content selected \x3c% if (canStylize) { %\x3einline\x3c% } %\x3e"\x3e\x3c% if (canStylize) { %\x3e\x3cinput type\x3d"file" name\x3d"upload_file" style\x3d"opacity:0;height:0;width:0;font-size:0;position:absolute;"\x3e\x3ca href\x3d"javascript:;" class\x3d"browser zg-btn-blue"\x3e选择图片\x3c/a\x3e\x3c% } else { %\x3e\x3cinput type\x3d"file" name\x3d"upload_file"\x3e\x3c% } %\x3e\x3c/div\x3e\x3cdiv class\x3d"tab-content"\x3e\x3cinput type\x3d"text" autocomplete\x3d"off" name\x3d"upload_file_url" class\x3d"zm-editable-editor-input zg-form-text-input"\x3e\x3ca href\x3d"javascript:;" class\x3d"insert zg-btn-blue zm-uploader-button-fix"\x3e确认\x3c/a\x3e\x3c/div\x3e\x3cspan style\x3d"display: none; " class\x3d"zm-img-uploader-loading"\x3e正在上传\x3c/span\x3e\x3cspan style\x3d"display: none; " class\x3d"zm-img-uploader-error"\x3e上传图片失败,请稍后重试\x3c/span\x3e\x3c/form\x3e\x3cdiv class\x3d"zg-gray"\x3e请不要上传与回答问题无关的图片,详细请看 \x3ca href\x3d"/question/20064580" target\x3d"_blank"\x3e知乎图片使用规范\x3c/a\x3e\x3c/div\x3e\x3cdiv class\x3d"zm-command"\x3e\x3ca class\x3d"cancel" href\x3d"javascript:;"\x3e取消\x3c/a\x3e\x3c/div\x3e\x3c/div\x3e'); z.e.Lw=function(){var a=z.We(this.template({uploadURL:this.uq,canStylize:this.qN}));z.Db({form:"form",DB:".zm-img-uploader-tab",gh:".zm-img-uploader-loading",ff:".zm-img-uploader-error",kK:"input[type\x3dtext]",Qn:"input[type\x3dfile]",AD:".browser",xw:".cancel",jR:".insert"},function(b,d){this[d]=(0,window.$)(b,a).get(0)},this);this.T.g(z.Y,"iframe_data",this.Uv).g(this.Qn,"change",this.nU).g(this.jR,"click",this.kR).g(this.xw,"click",function(){this.eo();this.hide()}).g(this.DB,"click",function(a){a= (0,window.$)(a.target);a.is("a")&&!a.is(".selected")&&YD(this,a.index())});this.cE=a;z.Vm||(YD(this,1),(0,window.$)(this.DB).replaceWith("\x3cstrong\x3e输入站外图片地址:\x3c/strong\x3e"));this.AD&&this.T.g(this.AD,"click",function(){this.Qn.click()});var b=new z.PD(this);b.Na("插入图片").ia(this.cE);b=z.SD(b);z.Lj(b,null);return b};z.e.nU=function(){this.Qn.value&&(Jr(this.Qn.value)?(this.kK.value="",z.Q(this.gh,!0),z.Q(this.ff,!1),this.form.submit()):ZD(this,"图片不是 .jpg 或 .png 格式无法上传"))}; z.e.kR=function(){var a=z.sr(this.kK.value);a?z.Ja(a,"http://")?(this.Qn.value="",z.Q(this.gh,!0),z.Q(this.ff,!1),this.form.submit()):ZD(this,"我们目前不支持该协议。"):ZD(this,"请填写图片地址。")};z.e.Uv=function(a){z.Q(this.gh,!1);this.ym(a.xf)};z.e.ym=function(a){a&&!a.r?(this.dispatchEvent(this.Cn(a.msg)),this.hide()):ZD(this,a.msg)};z.e.Cn=function(a){return new XD(a)};z.e.D=function(){this.T.H();this.T=null;WD.o.D.call(this)};z.x(z.$D,z.TD);z.e=z.$D.prototype;z.e.md=z.ib("ImageDialogPlugin"); z.e.gf=function(a,b){var c=this.F;return c.tf||(c.Wf(),c.tf)?z.$D.o.gf.call(this,a,b):!1};z.e.Kj=function(a){if(a&&"mouseup"===a.type){var b=a.target;b&&"IMG"===b.nodeName&&(a=z.Gu(b),a||(a=window.document.createElement("br"),z.bf(a,b)),z.Pu(a))}};z.e.co=function(a){z.$D.o.co.call(this,a)};z.e.Kw=function(a){a=new WD(a);this.T.g(a,"ok",this.jo).g(a,"cancel",this.fy);return a};z.e.D=function(){z.$D.o.D.call(this);this.T.H()}; z.e.jo=function(a){z.UD(this);var b=z.xA(this),c;c=a.II?b.B("IMG",{"class":"origin_image zh-lightbox-thumb","data-original":a.II,title:"点击查看原图",src:a.Tl}):b.B("IMG",{"class":"content_image",src:a.Tl});a.eJ&&c.setAttribute("data-rawwidth",a.eJ);a.dJ&&c.setAttribute("data-rawheight",a.dJ);a=z.ZA(this.F);if(z.Zu(a))a.Bi(c),z.C||(z.Qu(c,!1),b.Va().focus()),z.$A(this.F),this.F.df();else return null;this.T.removeAll()};z.e.fy=function(){this.T.removeAll()};var vG=z.u("Link");z.u("Edit Link");z.u("Text to display:");z.wG=z.u("Link to:");z.u("Web address");z.u("Link to a page or file somewhere else on the web");z.u("Test this link"); z.u("{$startBold}Not sure what to put in the box?{$endBold} First, find the page on the web that you want to link to. (A {$searchEngineLink}search engine{$endLink} might be useful.) Then, copy the web address from the box in your browser's address bar, and paste it into the box above.",{startBold:"\x3cb\x3e",endBold:"\x3c/b\x3e",searchEngineLink:"\x3ca href\x3d'http://www.google.com/' target\x3d'_new'\x3e",endLink:"\x3c/a\x3e"});z.u("To what URL should this link go?");z.u("Email address");z.u("Link to an email address"); z.u("Invalid email address");z.u("To what email address should this link?");z.u("{$preb}Be careful.{$postb} Remember that any time you include an email address on a web page, nasty spammers can find it too.",{preb:"\x3cb\x3e",postb:"\x3c/b\x3e"});z.u("Open this link in a new window");z.u("Image");z.x(aE,z.At);aE.prototype.next=function(){do aE.o.next.call(this);while(-1==this.Ub);return this.node};z.x(z.bE,Mp);z.la(z.bE);var fE=0;z.e=z.bE.prototype;z.e.B=function(a){var b=this.Xf(a);a=a.K().B("DIV",b?b.join(" "):null,cE(this,a.Ua(),a.Rg(),a.K()));z.bj(a,"grid");return a};z.e.Mw=function(a,b){var c=b.B("TABLE",this.U()+"-table",b.B("TBODY",this.U()+"-body",a));c.cellSpacing=0;c.cellPadding=0;return c};z.e.Ob=function(){return!1};z.e.w=function(){return null}; z.e.ia=function(a,b){if(a){var c=z.Le(window.document,"TBODY",this.U()+"-body",a)[0];if(c){var d=0;z.y(c.rows,function(a){z.y(a.cells,function(a){z.$e(a);if(b){var c=b[d++];c&&a.appendChild(c)}})});if(dthis.Ta?this.Dj():this.Ta;switch(a.keyCode){case 37:if(-1==d||0==d)d=b;this.xb(d-1);a.preventDefault();return!0;case 39:return d==b-1&&(d=-1),this.xb(d+1),a.preventDefault(),!0;case 38:-1==d&&(d=b+c-1);if(d>=c)return this.xb(d-c),a.preventDefault(),!0;break;case 40:if(-1== d&&(d=-c),da.split("/")[0].indexOf(":")&&(a=k+f[2].substring(0,f[2].lastIndexOf("/"))+ "/"+a):a=k+f[2]+(a||Be);d.href=a;e=c(d);return{protocol:(d.protocol||"").toLowerCase(),host:e[0],port:e[1],path:e[2],Oa:d.search||"",url:a||""}}function Na(a,b){function c(b,c){a.contains(b)||a.set(b,[]);a.get(b).push(c)}for(var d=Da(b).split("&"),e=0;ef?c(d[e],"1"):c(d[e].substring(0,f),d[e].substring(f+1))}} function Pa(a,b){if(F(a)||"["==a.charAt(0)&&"]"==a.charAt(a.length-1))return"-";var c=J.domain;return a.indexOf(c+(b&&"/"!=b?b:""))==(0==a.indexOf("http://")?7:0==a.indexOf("https://")?8:0)?"0":a};var Qa=0;function Ra(a,b,c){1<=Qa||1<=100*Math.random()||ld()||(a=["utmt=error","utmerr="+a,"utmwv=5.6.7","utmn="+Ea(),"utmsp=1"],b&&a.push("api="+b),c&&a.push("msg="+G(c.substring(0,100))),M.w&&a.push("aip=1"),Sa(a.join("&")),Qa++)};var Ta=0,Ua={};function N(a){return Va("x"+Ta++,a)}function Va(a,b){Ua[a]=!!b;return a} var Wa=N(),Xa=Va("anonymizeIp"),Ya=N(),$a=N(),ab=N(),bb=N(),O=N(),P=N(),cb=N(),db=N(),eb=N(),fb=N(),gb=N(),hb=N(),ib=N(),jb=N(),kb=N(),lb=N(),nb=N(),ob=N(),pb=N(),qb=N(),rb=N(),sb=N(),tb=N(),ub=N(),vb=N(),wb=N(),xb=N(),yb=N(),zb=N(),Ab=N(),Bb=N(),Cb=N(),Db=N(),Eb=N(),Fb=N(!0),Gb=Va("currencyCode"),Hb=Va("page"),Ib=Va("title"),Jb=N(),Kb=N(),Lb=N(),Mb=N(),Nb=N(),Ob=N(),Pb=N(),Qb=N(),Rb=N(),Q=N(!0),Sb=N(!0),Tb=N(!0),Ub=N(!0),Vb=N(!0),Wb=N(!0),Zb=N(!0),$b=N(!0),ac=N(!0),bc=N(!0),cc=N(!0),R=N(!0),dc=N(!0), ec=N(!0),fc=N(!0),gc=N(!0),hc=N(!0),ic=N(!0),jc=N(!0),S=N(!0),kc=N(!0),lc=N(!0),mc=N(!0),nc=N(!0),oc=N(!0),pc=N(!0),qc=N(!0),rc=Va("campaignParams"),sc=N(),tc=Va("hitCallback"),uc=N();N();var vc=N(),wc=N(),xc=N(),yc=N(),zc=N(),Ac=N(),Bc=N(),Cc=N(),Dc=N(),Ec=N(),Fc=N(),Gc=N(),Hc=N(),Ic=N();N();var Mc=N(),Nc=N(),Yb=N(),Jc=N(),Kc=N(),Lc=Va("utmtCookieName"),Cd=Va("displayFeatures"),Oc=N(),of=Va("gtmid"),Oe=Va("uaName"),Pe=Va("uaDomain"),Qe=Va("uaPath"),pf=Va("linkid");var Re=function(){function a(a,c,d){T(qf.prototype,a,c,d)}a("_createTracker",qf.prototype.hb,55);a("_getTracker",qf.prototype.oa,0);a("_getTrackerByName",qf.prototype.u,51);a("_getTrackers",qf.prototype.pa,130);a("_anonymizeIp",qf.prototype.aa,16);a("_forceSSL",qf.prototype.la,125);a("_getPlugin",Pc,120)},Se=function(){function a(a,c,d){T(U.prototype,a,c,d)}Qc("_getName",$a,58);Qc("_getAccount",Wa,64);Qc("_visitCode",Q,54);Qc("_getClientInfo",ib,53,1);Qc("_getDetectTitle",lb,56,1);Qc("_getDetectFlash", jb,65,1);Qc("_getLocalGifPath",wb,57);Qc("_getServiceMode",xb,59);V("_setClientInfo",ib,66,2);V("_setAccount",Wa,3);V("_setNamespace",Ya,48);V("_setAllowLinker",fb,11,2);V("_setDetectFlash",jb,61,2);V("_setDetectTitle",lb,62,2);V("_setLocalGifPath",wb,46,0);V("_setLocalServerMode",xb,92,void 0,0);V("_setRemoteServerMode",xb,63,void 0,1);V("_setLocalRemoteServerMode",xb,47,void 0,2);V("_setSampleRate",vb,45,1);V("_setCampaignTrack",kb,36,2);V("_setAllowAnchor",gb,7,2);V("_setCampNameKey",ob,41);V("_setCampContentKey", tb,38);V("_setCampIdKey",nb,39);V("_setCampMediumKey",rb,40);V("_setCampNOKey",ub,42);V("_setCampSourceKey",qb,43);V("_setCampTermKey",sb,44);V("_setCampCIdKey",pb,37);V("_setCookiePath",P,9,0);V("_setMaxCustomVariables",yb,0,1);V("_setVisitorCookieTimeout",cb,28,1);V("_setSessionCookieTimeout",db,26,1);V("_setCampaignCookieTimeout",eb,29,1);V("_setReferrerOverride",Jb,49);V("_setSiteSpeedSampleRate",Dc,132);a("_trackPageview",U.prototype.Fa,1);a("_trackEvent",U.prototype.F,4);a("_trackPageLoadTime", U.prototype.Ea,100);a("_trackSocial",U.prototype.Ga,104);a("_trackTrans",U.prototype.Ia,18);a("_sendXEvent",U.prototype.ib,78);a("_createEventTracker",U.prototype.ia,74);a("_getVersion",U.prototype.qa,60);a("_setDomainName",U.prototype.B,6);a("_setAllowHash",U.prototype.va,8);a("_getLinkerUrl",U.prototype.na,52);a("_link",U.prototype.link,101);a("_linkByPost",U.prototype.ua,102);a("_setTrans",U.prototype.za,20);a("_addTrans",U.prototype.$,21);a("_addItem",U.prototype.Y,19);a("_clearTrans",U.prototype.ea, 105);a("_setTransactionDelim",U.prototype.Aa,82);a("_setCustomVar",U.prototype.wa,10);a("_deleteCustomVar",U.prototype.ka,35);a("_getVisitorCustomVar",U.prototype.ra,50);a("_setXKey",U.prototype.Ca,83);a("_setXValue",U.prototype.Da,84);a("_getXKey",U.prototype.sa,76);a("_getXValue",U.prototype.ta,77);a("_clearXKey",U.prototype.fa,72);a("_clearXValue",U.prototype.ga,73);a("_createXObj",U.prototype.ja,75);a("_addIgnoredOrganic",U.prototype.W,15);a("_clearIgnoredOrganic",U.prototype.ba,97);a("_addIgnoredRef", U.prototype.X,31);a("_clearIgnoredRef",U.prototype.ca,32);a("_addOrganic",U.prototype.Z,14);a("_clearOrganic",U.prototype.da,70);a("_cookiePathCopy",U.prototype.ha,30);a("_get",U.prototype.ma,106);a("_set",U.prototype.xa,107);a("_addEventListener",U.prototype.addEventListener,108);a("_removeEventListener",U.prototype.removeEventListener,109);a("_addDevId",U.prototype.V);a("_getPlugin",Pc,122);a("_setPageGroup",U.prototype.ya,126);a("_trackTiming",U.prototype.Ha,124);a("_initData",U.prototype.initData, 2);a("_setVar",U.prototype.Ba,22);V("_setSessionTimeout",db,27,3);V("_setCookieTimeout",eb,25,3);V("_setCookiePersistence",cb,24,1);a("_setAutoTrackOutbound",Fa,79);a("_setTrackOutboundSubdomains",Fa,81);a("_setHrefExamineLimit",Fa,80)};function Pc(a){var b=this.plugins_;if(b)return b.get(a)} var T=function(a,b,c,d){a[b]=function(){try{return void 0!=d&&H(d),c.apply(this,arguments)}catch(a){throw Ra("exc",b,a&&a.name),a;}}},Qc=function(a,b,c,d){U.prototype[a]=function(){try{return H(c),Aa(this.a.get(b),d)}catch(e){throw Ra("exc",a,e&&e.name),e;}}},V=function(a,b,c,d,e){U.prototype[a]=function(f){try{H(c),void 0==e?this.a.set(b,Aa(f,d)):this.a.set(b,e)}catch(Be){throw Ra("exc",a,Be&&Be.name),Be;}}},Te=function(a,b){return{type:b,target:a,stopPropagation:function(){throw"aborted";}}};var Rc=new RegExp(/(^|\.)doubleclick\.net$/i),Sc=function(a,b){return Rc.test(J.location.hostname)?!0:"/"!==b?!1:0!=a.indexOf("www.google.")&&0!=a.indexOf(".google.")&&0!=a.indexOf("google.")||-1b.length||ad(b[0],c))return!1;b=b.slice(1).join(".").split("|"); 0=b.length)return!0;b=b[1].split(-1==b[1].indexOf(",")?"^":",");for(c=0;cb.length||ad(b[0],c))return a.set(ec,void 0),a.set(fc,void 0),a.set(gc,void 0),a.set(ic,void 0),a.set(jc,void 0),a.set(nc,void 0),a.set(oc,void 0),a.set(pc,void 0),a.set(qc,void 0),a.set(S,void 0),a.set(kc,void 0),a.set(lc,void 0),a.set(mc,void 0),!1;a.set(ec,1*b[1]);a.set(fc,1*b[2]);a.set(gc,1*b[3]); Ve(a,b.slice(4).join("."));return!0},Ve=function(a,b){function c(a){return(a=b.match(a+"=(.*?)(?:\\|utm|$)"))&&2==a.length?a[1]:void 0}function d(b,c){c?(c=e?I(c):c.split("%20").join(" "),a.set(b,c)):a.set(b,void 0)}-1==b.indexOf("=")&&(b=I(b));var e="2"==c("utmcvr");d(ic,c("utmcid"));d(jc,c("utmccn"));d(nc,c("utmcsr"));d(oc,c("utmcmd"));d(pc,c("utmctr"));d(qc,c("utmcct"));d(S,c("utmgclid"));d(kc,c("utmgclsrc"));d(lc,c("utmdclid"));d(mc,c("utmdsid"))},ad=function(a,b){return b?a!=b:!/^\d+$/.test(a)};var Uc=function(){this.filters=[]};Uc.prototype.add=function(a,b){this.filters.push({name:a,s:b})};Uc.prototype.cb=function(a){try{for(var b=0;b=100*a.get(vb)&&a.stopPropagation()}function kd(a){ld(a.get(Wa))&&a.stopPropagation()}function md(a){"file:"==J.location.protocol&&a.stopPropagation()}function Ge(a){He()&&a.stopPropagation()} function nd(a){a.get(Ib)||a.set(Ib,J.title,!0);a.get(Hb)||a.set(Hb,J.location.pathname+J.location.search,!0)}function lf(a){a.get(Wa)&&"UA-XXXXX-X"!=a.get(Wa)||a.stopPropagation()};var od=new function(){var a=[];this.set=function(b){a[b]=!0};this.encode=function(){for(var b=[],c=0;c=b[0]||0>=b[1]?"":b.join("x");a.Wa=d}catch(k){H(135)}qd=a}},td=function(){sd();for(var a=qd,b=W.navigator,a=b.appName+b.version+a.language+b.platform+b.userAgent+a.javaEnabled+a.jb+a.P+(J.cookie?J.cookie:"")+(J.referrer?J.referrer:""),b=a.length,c=W.history.length;0d?(this.i=b.substring(0,d),this.l=b.substring(d+1,c),this.h=b.substring(c+1)):(this.i=b.substring(0,d),this.h=b.substring(d+1));this.Xa=a.slice(1);this.Ma=!this.l&&"_require"==this.h;this.J=!this.i&&!this.l&&"_provide"==this.h}},Y=function(){T(Y.prototype, "push",Y.prototype.push,5);T(Y.prototype,"_getPlugin",Pc,121);T(Y.prototype,"_createAsyncTracker",Y.prototype.Sa,33);T(Y.prototype,"_getAsyncTracker",Y.prototype.Ta,34);this.I=new nf;this.eb=[]};E=Y.prototype;E.Na=function(a,b,c){var d=this.I.get(a);if(!Ba(d))return!1;b.plugins_=b.plugins_||new nf;b.plugins_.set(a,new d(b,c||{}));return!0};E.push=function(a){var b=Z.Va.apply(this,arguments),b=Z.eb.concat(b);for(Z.eb=[];0e?b+"#"+d:b+"&"+d;c="";f=b.indexOf("?");0f?b+"?"+d+c:b+"&"+d+c},$d=function(a,b,c,d){for(var e=0;3>e;e++){for(var f= 0;3>f;f++){if(d==Yc(a+b+c))return H(127),[b,c];var Be=b.replace(/ /g,"%20"),k=c.replace(/ /g,"%20");if(d==Yc(a+Be+k))return H(128),[Be,k];Be=Be.replace(/\+/g,"%20");k=k.replace(/\+/g,"%20");if(d==Yc(a+Be+k))return H(129),[Be,k];try{var Ja=b.match("utmctr=(.*?)(?:\\|utm|$)");if(Ja&&2==Ja.length&&(Be=b.replace(Ja[1],G(I(Ja[1]))),d==Yc(a+Be+c)))return H(139),[Be,c]}catch(t){}b=I(b)}c=I(c)}};var de="|",fe=function(a,b,c,d,e,f,Be,k,Ja){var t=ee(a,b);t||(t={},a.get(Cb).push(t));t.id_=b;t.affiliation_=c;t.total_=d;t.tax_=e;t.shipping_=f;t.city_=Be;t.state_=k;t.country_=Ja;t.items_=t.items_||[];return t},ge=function(a,b,c,d,e,f,Be){a=ee(a,b)||fe(a,b,"",0,0,0,"","","");var k;a:{if(a&&a.items_){k=a.items_;for(var Ja=0;Jab.length||!/^\d+$/.test(b[0])||(b[0]=""+c,Fd(a,"__utmx",b.join("."),void 0))},be=function(a,b){var c=$c(a.get(O),pd("__utmx"));"-"==c&&(c="");return b?G(c):c},Ye=function(a){try{var b=La(J.location.href,!1),c=decodeURIComponent(L(b.R.get("utm_referrer")))||"";c&&a.set(Jb,c);var d=decodeURIComponent(K(b.R.get("utm_expid")))||"";d&&(d=d.split(".")[0],a.set(Oc,""+d))}catch(e){H(146)}},l=function(a){var b=W.gaData&&W.gaData.expId;b&&a.set(Oc, ""+b)};var ke=function(a,b){var c=Math.min(a.b(Dc,0),100);if(a.b(Q,0)%100>=c)return!1;c=Ze()||$e();if(void 0==c)return!1;var d=c[0];if(void 0==d||Infinity==d||isNaN(d))return!1;0a[b])return!1;return!0},le=function(a){return isNaN(a)||0>a?0:5E3>a?10*Math.floor(a/10):5E4>a?100*Math.floor(a/100):41E5>a?1E3*Math.floor(a/1E3):41E5},je=function(a){for(var b=new yd,c=0;cc.length)){for(var d=[],e=0;e=f)return!1;c=1*(""+c);if(""==a||!wd(a)||""==b||!wd(b)||!xd(c)||isNaN(c)||0>c||0>f||100=a||a>e.get(yb))a=!1;else if(!b||!c||128=a&&Ca(b)&&""!=b){var c=this.get(Fc)||[];c[a]=b;this.set(Fc,c)}};E.V=function(a){a=""+a;if(a.match(/^[A-Za-z0-9]{1,5}$/)){var b=this.get(Ic)||[];b.push(a);this.set(Ic,b)}};E.initData=function(){this.a.load()}; E.Ba=function(a){a&&""!=a&&(this.set(Tb,a),this.a.j("var"))};var ne=function(a){"trans"!==a.get(sc)&&500<=a.b(cc,0)&&a.stopPropagation();if("event"===a.get(sc)){var b=(new Date).getTime(),c=a.b(dc,0),d=a.b(Zb,0),c=Math.floor((b-(c!=d?c:1E3*c))/1E3*1);0=a.b(R,0)&&a.stopPropagation()}},pe=function(a){"event"===a.get(sc)&&a.set(R,Math.max(0,a.b(R,10)-1))};var qe=function(){var a=[];this.add=function(b,c,d){d&&(c=G(""+c));a.push(b+"="+c)};this.toString=function(){return a.join("&")}},re=function(a,b){(b||2!=a.get(xb))&&a.Za(cc)},se=function(a,b){b.add("utmwv","5.6.7");b.add("utms",a.get(cc));b.add("utmn",Ea());var c=J.location.hostname;F(c)||b.add("utmhn",c,!0);c=a.get(vb);100!=c&&b.add("utmsp",c,!0)},te=function(a,b){b.add("utmht",(new Date).getTime());b.add("utmac",Da(a.get(Wa)));a.get(Oc)&&b.add("utmxkey",a.get(Oc),!0);a.get(vc)&&b.add("utmni",1); a.get(of)&&b.add("utmgtm",a.get(of),!0);var c=a.get(Ic);c&&0=a.length)gf(a,b,c);else if(8192>=a.length){if(0<=W.navigator.userAgent.indexOf("Firefox")&&![].reduce)throw new De(a.length);df(a,b)||ef(a,b)||Ee(a,b)||b()}else throw new Ce(a.length);},gf=function(a,b,c){c=c||Ne()+"/__utm.gif?"; var d=new Image(1,1);d.src=c+a;d.onload=function(){d.onload=null;d.onerror=null;b()};d.onerror=function(){d.onload=null;d.onerror=null;b()}},ef=function(a,b){if(0!=Ne().indexOf(J.location.protocol))return!1;var c;c=W.XDomainRequest;if(!c)return!1;c=new c;c.open("POST",Ne()+"/p/__utm.gif");c.onerror=function(){b()};c.onload=b;c.send(a);return!0},df=function(a,b){var c=W.XMLHttpRequest;if(!c)return!1;var d=new c;if(!("withCredentials"in d))return!1;d.open("POST",Ne()+"/p/__utm.gif",!0);d.withCredentials= !0;d.setRequestHeader("Content-Type","text/plain");d.onreadystatechange=function(){4==d.readyState&&(b(),d=null)};d.send(a);return!0},Ee=function(a,b){if(!J.body)return We(function(){Ee(a,b)},100),!0;a=encodeURIComponent(a);try{var c=J.createElement('')}catch(d){c=J.createElement("iframe"),c.name=a}c.height="0";c.width="0";c.style.display="none";c.style.visibility="hidden";var e=Ne()+"/u/post_iframe.html";Ga(W,"beforeunload",function(){c.src="";c.parentNode&&c.parentNode.removeChild(c)}); setTimeout(b,1E3);J.body.appendChild(c);c.src=e;return!0};var qf=function(){this.G=this.w=!1;0==Ea()%1E4&&(H(142),this.G=!0);this.C={};this.D=[];this.U=0;this.S=[["www.google-analytics.com","","/plugins/"]];this._gasoCPath=this._gasoDomain=this.bb=void 0;Re();Se()};E=qf.prototype;E.oa=function(a,b){return this.hb(a,void 0,b)};E.hb=function(a,b,c){b&&H(23);c&&H(67);void 0==b&&(b="~"+M.U++);a=new U(b,a,c);M.C[b]=a;M.D.push(a);return a};E.u=function(a){a=a||"";return M.C[a]||M.hb(void 0,a)};E.pa=function(){return M.D.slice(0)};E.ab=function(){return M.D.length}; E.aa=function(){this.w=!0};E.la=function(){this.G=!0};var Fe=function(a){if("prerender"==J.visibilityState)return!1;a();return!0};var M=new qf;var Ha=W._gat;Ha&&Ba(Ha._getTracker)?M=Ha:W._gat=M;var Z=new Y;(function(a){if(!Fe(a)){H(123);var b=!1,c=function(){if(!b&&Fe(a)){b=!0;var d=J,e=c;d.removeEventListener?d.removeEventListener("visibilitychange",e,!1):d.detachEvent&&d.detachEvent("onvisibilitychange",e)}};Ga(J,"visibilitychange",c)}})(function(){var a=W._gaq,b=!1;if(a&&Ba(a.push)&&(b="[object Array]"==Object.prototype.toString.call(Object(a)),!b)){Z=a;return}W._gaq=Z;b&&Z.push.apply(Z,a)});function Yc(a){var b=1,c=0,d;if(a)for(b=0,d=a.length-1;0<=d;d--)c=a.charCodeAt(d),b=(b<<6&268435455)+c+(c<<14),c=b&266338304,b=0!=c?b^c>>21:b;return b};})(); ================================================ FILE: wenda/src/main/resources/static/scripts/instant.e7a17de6.js ================================================ !function(){var a=document.cookie.match(/actioncontinuationhash=([^;]+)/),b=a&&a[1];b&&(location.hash=decodeURIComponent(b))}(this),function(a,b){function c(a){function b(a,b){var c;return window.getComputedStyle?c=window.getComputedStyle(a,null).getPropertyValue(b):a.currentStyle&&(c=a.currentStyle[b]),c}for(var c=a.parentNode;"inline"===b(c,"display");)c=c.parentNode;return c}function d(a){var b=+a.getAttribute("data-rawwidth"),d=+a.getAttribute("data-rawheight");if(b&&d&&!a.style.width&&!a.style.height){var e=c(a).clientWidth,f=b,g=d;b>e&&(f=e,g=f*(d/b)),a.style.width=f+"px",a.style.height=g+"px"}}function e(){var a=b.querySelectorAll;if(a)return a.call(b,"img.lazy");var c=[];return f(document.images,function(a){/\blazy\b/.test(a.className)&&c.push(a)}),c}function f(a,b){for(var c=a.length-1;c>=0;c--)b(a[c])}a.stretchLazyImageHolders=function(){f(e(),d)}}(this,document),function(a,b){a.instant={apply:function(){for(var a;a=b.shift();)a()}}}(this,[function(){window.stretchLazyImageHolders()}]),function(){var a=window.document.documentElement,b=window.localStorage;if(b){var c=/^\/(signup|signin)?$/.test(location.pathname);if((c||"true"!==b.getItem("hideAppPromotionBar"))&&(a.className+=" is-AppPromotionBarVisible"),"#showWechatShareTip"===location.hash&&"true"!==b.getItem("hideWechatShareTip"))try{a.className+=" show-wechat-share-tip",b.setItem("hideWechatShareTip","true")}catch(d){}}}(this),function(a,b,c){function d(a,b){return typeof a===b}function e(){var a,b,c,e,f,g,h;for(var i in s)if(s.hasOwnProperty(i)){if(a=[],b=s[i],b.name&&(a.push(b.name.toLowerCase()),b.options&&b.options.aliases&&b.options.aliases.length))for(c=0;cn;n++)if(p=a[n],q=D.style[p],g(p,"-")&&(p=m(p)),D.style[p]!==c){if(f||d(e,"undefined"))return i(),"pfx"==b?p:!0;try{D.style[p]=e}catch(s){}if(D.style[p]!=q)return i(),"pfx"==b?p:!0}return i(),!1}function o(a,b){return function(){return a.apply(b,arguments)}}function p(a,b,c){var e;for(var f in a)if(a[f]in b)return c===!1?a[f]:(e=b[a[f]],d(e,"function")?o(e,c||b):e);return!1}function q(a,b,c,e,f){var g=a.charAt(0).toUpperCase()+a.slice(1),h=(a+" "+B.join(g+" ")+g).split(" ");return d(b,"string")||d(b,"undefined")?n(h,b,e,f):(h=(a+" "+z.join(g+" ")+g).split(" "),p(h,b,c))}function r(a,b,d){return q(a,c,c,b,d)}var s=[],t={_version:"3.3.0",_config:{classPrefix:"",enableClasses:!0,enableJSClass:!0,usePrefixes:!0},_q:[],on:function(a,b){var c=this;setTimeout(function(){b(c[a])},0)},addTest:function(a,b,c){s.push({name:a,fn:b,options:c})},addAsyncTest:function(a){s.push({name:null,fn:a})}},u=function(){};u.prototype=t,u=new u;var v=[],w=b.documentElement,x="svg"===w.nodeName.toLowerCase(),y="Moz O ms Webkit",z=t._config.usePrefixes?y.toLowerCase().split(" "):[];t._domPrefixes=z;var A=t._config.usePrefixes?" -webkit- -moz- -o- -ms- ".split(" "):[];t._prefixes=A;var B=t._config.usePrefixes?y.split(" "):[];t._cssomPrefixes=B;var C={elem:h("modernizr")};u._q.push(function(){delete C.elem});var D={style:C.elem.style};u._q.unshift(function(){delete D.style}),t.testAllProps=q;var E=function(b){var d,e=A.length,f=a.CSSRule;if("undefined"==typeof f)return c;if(!b)return!1;if(b=b.replace(/^@/,""),d=b.replace(/-/g,"_").toUpperCase()+"_RULE",d in f)return"@"+b;for(var g=0;e>g;g++){var h=A[g],i=h.toUpperCase()+"_"+d;if(i in f)return"@-"+h.toLowerCase()+"-"+b}return!1};t.atRule=E;t.prefixed=function(a,b,c){return 0===a.indexOf("@")?E(a):(-1!=a.indexOf("-")&&(a=m(a)),b?q(a,b,c):q(a,"pfx"))};t.testAllProps=r;var F=(t.testProp=function(a,b,d){return n([a],c,b,d)},t.testStyles=j);u.addTest("cssanimations",r("animationName","a",!0)),u.addTest("csstransforms",function(){return-1===navigator.userAgent.indexOf("Android 2.")&&r("transform","scale(1)",!0)}),u.addTest("csstransitions",r("transition","all",!0)),u.addTest("flexbox",r("flexBasis","1px",!0)),u.addTest("touchevents",function(){var c;if("ontouchstart"in a||a.DocumentTouch&&b instanceof DocumentTouch)c=!0;else{var d=["@media (",A.join("touch-enabled),("),"heartz",")","{#modernizr{top:9px;position:absolute}}"].join("");F(d,function(a){c=9===a.offsetTop})}return c}),e(),f(v),delete t.addTest,delete t.addAsyncTest;for(var G=0;G= 0; i--) { if (aCb[i] === fCb) { aCb.splice(i, 1); } } aCb.length === 0 && (delete oPoll[sName]); } function fUnbindAll() { var that = this; var oPoll = that._cep; $.each(oPoll, function (sKey) { delete oPoll[sKey]; }); } })(window); ================================================ FILE: wenda/src/main/resources/static/scripts/main/base/util.js ================================================ (function (window, undefined) { var Util = Base.createClass('main.base.Util'); $.extend(Util, { isEmail: fIsEmail }); function fIsEmail(sEmail) { sEmail = $.trim(sEmail); return sEmail && /^([a-zA-Z0-9_\.\-\+])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/.test(sEmail); } })(window); ================================================ FILE: wenda/src/main/resources/static/scripts/main/component/component.js ================================================ (function (window, undefined) { var Component = Base.createClass('main.component.Component'); var Event = Base.getClass('main.base.Event'); $.extend(Component, { _cIndex: 1, _domQueue: [], _tpl: '
', setEvents: fStaticSetEvents }); $.extend(Component.prototype, Event, { initialize: fInitialize, render: fRender, getEl: fGetEl, html: fHtml, destroy: fDestroy, getData: fGetData, // 禁止滚动 forbidScroll: fForbidScroll, // 重写emit emit: fEmit, // 内部方法 _setCustomEvent: _fSetCustomEvent, _setDomEvent: _fSetDomEvent }); function fStaticSetEvents() { var that = this; var aQueue = Component._domQueue; var oQueue; while (aQueue.length) { oQueue = aQueue.shift(); oQueue._setDomEvent(); oQueue.emit('render'); } } function fInitialize(oConf) { var that = this; that.rawConfig = oConf; that.domId = 'jsCpn' + (Component._cIndex++); that._setCustomEvent(); Component._domQueue.push(that); oConf.renderTo && that.render(); } function fRender() { var that = this; var oConf = that.rawConfig; var oRenderTo = $(oConf.renderTo); var sRenderBy = oConf.renderBy || 'append'; var oEl = that.getEl(); oRenderTo[sRenderBy](oEl); that._setDomEvent(); that.emit('render'); } function fGetEl() { var that = this; if (that.$el) { return that.$el; } var oEl = $('#' + that.domId); if (oEl.get(0)) { that.$el = oEl; return oEl; } var sHtml = that.html(); that.$el = $(sHtml); return that.$el; } function fHtml() { var that = this; var oConf = that.rawConfig; var oConstructor = that.constructor; var sTpl = oConstructor._tpl || Component._tpl; var oData = that.getData(that.rawConfig); var sHtml = Base.tpl(sTpl, oData); // id 和 class /* jshint ignore:start */ sHtml = sHtml.replace(/^(\<\w+)([ \>])/, '$1' + ' id="' + that.domId + '"$2'); /* jshint ignore:end */ sHtml = sHtml.replace('class="', 'class="' + (oConf.cls || '') + ' '); return sHtml; } function fDestroy() { var that = this; var oEl = that.getEl(); oEl.remove(); that.emit('destroy'); that.unbindAll(); } function fGetData(oConf) { return oConf; } function fForbidScroll(oEl, bForbid) { $(oEl).css('overflow', bForbid === false ? 'auto' : 'hidden'); } function fEmit(sName) { var that = this; if (sName === 'render') { if (that.rendered) { return; } that.rendered = true; } Event.emit.apply(that, arguments); } function _fSetCustomEvent() { var that = this; if (that._setedCustomEvent) { return; } that._setedCustomEvent = true; var oConf = that.rawConfig; var oConstructor = that.constructor; $.each(oConstructor.listeners, function (_, oEvent) { oEvent.type === 'custom' && oEvent.name && oEvent.handler && that.on(oEvent.name, oEvent.handler); }); $.each(oConf.listeners, function (sName, fCb) { Base.isFunction(fCb) && that.on(sName, fCb); }); } function _fSetDomEvent() { var that = this; if (that._setedDomEvent) { return; } that._setedDomEvent = true; var oConf = that.rawConfig; var oEl = that.getEl(); var oConstructor = that.constructor; // 构造器上的事件 $.each(oConstructor.listeners, function (_, oEvent) { oEvent.type !== 'custom' && _fBind(oEvent.name, oEvent); }); // 配置上面的事件 $.each(oConf.listeners, function (sName, oEvent) { Base.isObject(oEvent) && _fBind(sName, oEvent); }); // 删除dom事件队列 for (var i = Component._domQueue.length - 1; i >= 0; i--) { if (Component._domQueue[i] === that) { Component._domQueue.splice(i, 1); } } function _fBind(sName, oEvent) { var aMatch = sName.match(/^(\S+)\s*(.*)$/); var sEvent = $.trim(aMatch[1]); var sSelector = $.trim(aMatch[2]); var fHandler = oEvent.handler; if (Base.isFunction(fHandler)) { if (sSelector) { oEvent.type === 'bind' && oEl.find(sSelector).on(sEvent, Base.bind(fHandler, that)); oEvent.type !== 'bind' && oEl.on(sEvent, sSelector, Base.bind(fHandler, that)); } else { oEl.on(sEvent, Base.bind(fHandler, that)); } } } } })(window); ================================================ FILE: wenda/src/main/resources/static/scripts/main/component/popup.js ================================================ /** var oPopup = new Popup({ title: String, 标题 content: String, 内容 width: Number, 宽度 close: Function, 关闭的回调 cancel: Function, 取消的回调 ok: Function, 确定的回调 hasNoHeader: Boolean, true 没有头部 hasNoFooter: Boolean, true 没有底部 cancelTxt: 取消文案 okTxt: 确认文案 }); */ (function (window, undefined) { var Popup = Base.createClass('main.component.Popup'); var Component = Base.getClass('main.component.Component'); Base.mix(Popup, Component, { zIndex: 100, _tpl: [ ''].join(''), listeners: [{ name: 'render', type: 'custom', handler: function () { var that = this; var oConf = that.rawConfig; var oEl = that.getEl(); // 常用元素 that.titleEl = oEl.find('span.js-title'); that.contentEl = oEl.find('div.js-content'); that.tipsEl = oEl.find('span.js-error'); // 调整大小 oEl.outerWidth(oConf.width || 520); oConf.height && that.contentEl.outerHeight(oConf.height); // 禁止body滚动 that.forbidScroll(document.body); // 创建遮罩层 that.initMask(); // 调整z-index oEl.css('zIndex', Popup.zIndex++); // 去掉头部 oConf.hasNoHeader && oEl.find('div.js-head').remove(); // 去掉底部 oConf.hasNoFooter && oEl.find('div.js-footer').remove(); // 位置居中 that.fixPosition(); // 绑定窗口变化事件 that.resizeCb = Base.bind(that.fixPosition, that); $(window).resize(that.resizeCb); } }, { name: 'destroy', type: 'custom', handler: function () { var that = this; // 启动滚动 !that.isForbidScroll && that.forbidScroll(document.body, false); // 移除遮罩层 that.maskEl && that.maskEl.remove(); // 取消窗口变化事件 $(window).unbind('resize', that.resizeCb); } }, { name: 'click .js-close', handler: function () { var that = this; that.close(); } }, { name: 'click .js-cancel', handler: function () { var that = this; var oConf = that.rawConfig; oConf.cancel && oConf.cancel.call(that); that.close(true); } }, { name: 'click .js-ok', handler: function () { var that = this; var oConf = that.rawConfig; // 禁止返回 if (oConf.ok && oConf.ok.call(that) === true) { return; } that.close(true); } }] }, { initialize: fInitialize, initMask: fInitMask, fixPosition: fFixPosition, close: fClose, error: fError, getData: fGetData }); function fInitialize(oConf) { var that = this; var oBody = $(document.body); oConf.renderTo = oBody; that.isForbidScroll = oBody.css('overflow-y') === 'hidden'; Popup.superClass.initialize.apply(that, arguments); } function fInitMask() { var that = this; var oConf = that.rawConfig; if (!that.maskEl) { that.maskEl = $('
'); oConf.renderTo.append(that.maskEl); } } function fFixPosition() { var that = this; var oEl = that.getEl(); var oWin = $(window); var oDoc = $(document); var nElWidth = oEl.width(); var nElHeight = oEl.height(); var nWinWidth = oWin.width(); var nWinHeight = oWin.height(); var nScrollTop = Math.max(oWin.scrollTop() || oDoc.scrollTop()); // 调整元素大小 oEl.css({ left: nWinWidth > nElWidth ? (nWinWidth - nElWidth) / 2 : 0, top: (nWinHeight > nElHeight ? (nWinHeight - nElHeight) / 2 : 0) + nScrollTop }); // 调整遮罩层大小 that.maskEl.css({ width: '100%', height: nWinHeight, top: nScrollTop }); } function fClose(bNoEmit) { var that = this; !bNoEmit && that.emit('close'); that.destroy(); } function fError(sContent) { var that = this; sContent = $.trim(sContent); that.tipsEl.html(sContent); that.tipsEl[sContent ? 'show' : 'hide'](); } function fGetData(oConf) { var that = this; return { title: oConf.title || '提示', content: oConf.content, cancelTxt: oConf.cancelTxt || '取消', okTxt: oConf.okTxt || '确定' }; } })(window); ================================================ FILE: wenda/src/main/resources/static/scripts/main/component/popupAdd.js ================================================ /** var oPopupAdd = new PopupAdd({ data: 初始数据 ok: Function, 发布成功后的回调 }); */ (function (window) { var PopupAdd = Base.createClass('main.component.PopupAdd'); var Popup = Base.getClass('main.component.Popup'); var Component = Base.getClass('main.component.Component'); var Util = Base.getClass('main.base.Util'); Base.mix(PopupAdd, Component, { _tpl: [ '
', '
', '
', '', '
', '
', '
', '
问题说明(可选):
', '
', '
', '
', '
', '', '
', '
', '
', '
', '
', '
'].join(''), listeners: [{ name: 'render', type: 'custom', handler: function () { var that = this; var oConf = that.rawConfig; var oEl = that.getEl(); that.titleIpt = oEl.find('.js-title'); that.contentIpt = oEl.find('.js-content'); // 还原值 oConf.data && that.val(oConf.data); } }], show: fStaticShow }, { initialize: fInitialize, val: fVal }); function fStaticShow(oConf) { var that = this; var oAdd = new PopupAdd(oConf); var bSubmit = false; var oPopup = new Popup({ width: 540, title: '提问', okTxt: '发布', content: oAdd.html(), ok: function () { var that = this; var oData = oAdd.val(); if (!oData.title) { that.error('请填写标题'); return true; } // 避免重复提交 if (bSubmit) { return true; } bSubmit = true; // 提交内容 $.ajax({ url: '/question/add', type: 'post', data: oData, dataType: 'json' }).done(function (oResult) { // 未登陆,跳转到登陆页面 if (oResult.code === 999) { window.location.href = '/reglogin?next=' + window.encodeURIComponent(window.location.href); } else { oConf.ok && oConf.ok.call(that); oAdd.emit('ok'); } }).fail(function () { alert('出现错误,请重试'); }).always(function () { bSubmit = false; }); // 先不关闭 return true; }, listeners: { destroy: function () { oAdd.destroy(); } } }); oAdd._popup = oPopup; Component.setEvents(); } function fInitialize(oConf) { var that = this; delete oConf.renderTo; PopupAdd.superClass.initialize.apply(that, arguments); } function fVal(oData) { var that = this; if (arguments.length === 0) { return { title: $.trim(that.titleIpt.val()), content: $.trim(that.contentIpt.val()) }; } else { oData = oData || {}; that.titleIpt.val($.tirm(oData.title)); that.contentIpt.val($.trim(oData.content)); } } })(window); ================================================ FILE: wenda/src/main/resources/static/scripts/main/component/popupMsg.js ================================================ /** var oPopupAdd = new PopupAdd({ data: 初始数据 toName: String, 姓名 content: String, 内容 }); */ (function (window) { var PopupMsg = Base.createClass('main.component.PopupMsg'); var Popup = Base.getClass('main.component.Popup'); var Component = Base.getClass('main.component.Component'); var Util = Base.getClass('main.base.Util'); Base.mix(PopupMsg, Component, { _tpl: [ '
', '
', '
发给:
', '
', '', '
', '
', '
', '
内容:
', '
', '
', '
', '
', '', '
', '
', '
', '
', '
', '
'].join(''), listeners: [{ name: 'render', type: 'custom', handler: function () { var that = this; var oConf = that.rawConfig; var oEl = that.getEl(); that.nameIpt = oEl.find('.js-name'); that.contentIpt = oEl.find('.js-content'); // 还原值 oConf.data && that.val(oConf.data); } }], show: fStaticShow }, { initialize: fInitialize, val: fVal }); function fStaticShow(oConf) { var that = this; var oAdd = new PopupMsg(oConf); var bSubmit = false; var oPopup = new Popup({ width: 540, title: '发送私信', okTxt: '发送', content: oAdd.html(), ok: function () { var that = this; var oData = oAdd.val(); if (!oData.toName) { that.error('请填写姓名'); return true; } if (!oData.content) { that.error('请填写私信内容'); return true; } // 避免重复提交 if (bSubmit) { return true; } bSubmit = true; // 提交内容 $.ajax({ url: '/msg/addMessage', type: 'post', data: oData, dataType: 'json' }).done(function (oResult) { // 未登陆,跳转到登陆页面 if (oResult.code === 999) { window.location.href = '/reglogin?next=' + window.encodeURIComponent(window.location.href); } else if (oResult.code !== 0) { that.error(oResult.msg || '出现错误,请重试'); } else { oConf.ok && oConf.ok.call(that); oAdd.emit('ok'); } }).fail(function () { alert('出现错误,请重试'); }).always(function () { bSubmit = false; }); // 先不关闭 return true; }, listeners: { destroy: function () { oAdd.destroy(); } } }); oAdd._popup = oPopup; Component.setEvents(); } function fInitialize(oConf) { var that = this; delete oConf.renderTo; PopupMsg.superClass.initialize.apply(that, arguments); } function fVal(oData) { var that = this; if (arguments.length === 0) { return { toName: $.trim(that.nameIpt.val()), content: $.trim(that.contentIpt.val()) }; } else { oData = oData || {}; that.nameIpt.val($.tirm(oData.toName)); that.contentIpt.val($.trim(oData.content)); } } })(window); ================================================ FILE: wenda/src/main/resources/static/scripts/main/jquery.js ================================================ /*! * jQuery JavaScript Library v3.0.0 * https://jquery.com/ * * Includes Sizzle.js * https://sizzlejs.com/ * * Copyright jQuery Foundation and other contributors * Released under the MIT license * https://jquery.org/license * * Date: 2016-06-09T18:02Z */ ( function( global, factory ) { "use strict"; if ( typeof module === "object" && typeof module.exports === "object" ) { // For CommonJS and CommonJS-like environments where a proper `window` // is present, execute the factory and get jQuery. // For environments that do not have a `window` with a `document` // (such as Node.js), expose a factory as module.exports. // This accentuates the need for the creation of a real `window`. // e.g. var jQuery = require("jquery")(window); // See ticket #14549 for more info. module.exports = global.document ? factory( global, true ) : function( w ) { if ( !w.document ) { throw new Error( "jQuery requires a window with a document" ); } return factory( w ); }; } else { factory( global ); } // Pass this if window is not defined yet }( typeof window !== "undefined" ? window : this, function( window, noGlobal ) { // Edge <= 12 - 13+, Firefox <=18 - 45+, IE 10 - 11, Safari 5.1 - 9+, iOS 6 - 9.1 // throw exceptions when non-strict code (e.g., ASP.NET 4.5) accesses strict mode // arguments.callee.caller (trac-13335). But as of jQuery 3.0 (2016), strict mode should be common // enough that all such attempts are guarded in a try block. "use strict"; var arr = []; var document = window.document; var getProto = Object.getPrototypeOf; var slice = arr.slice; var concat = arr.concat; var push = arr.push; var indexOf = arr.indexOf; var class2type = {}; var toString = class2type.toString; var hasOwn = class2type.hasOwnProperty; var fnToString = hasOwn.toString; var ObjectFunctionString = fnToString.call( Object ); var support = {}; function DOMEval( code, doc ) { doc = doc || document; var script = doc.createElement( "script" ); script.text = code; doc.head.appendChild( script ).parentNode.removeChild( script ); } var version = "3.0.0", // Define a local copy of jQuery jQuery = function( selector, context ) { // The jQuery object is actually just the init constructor 'enhanced' // Need init if jQuery is called (just allow error to be thrown if not included) return new jQuery.fn.init( selector, context ); }, // Support: Android <=4.0 only // Make sure we trim BOM and NBSP rtrim = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, // Matches dashed string for camelizing rmsPrefix = /^-ms-/, rdashAlpha = /-([a-z])/g, // Used by jQuery.camelCase as callback to replace() fcamelCase = function( all, letter ) { return letter.toUpperCase(); }; jQuery.fn = jQuery.prototype = { // The current version of jQuery being used jquery: version, constructor: jQuery, // The default length of a jQuery object is 0 length: 0, toArray: function() { return slice.call( this ); }, // Get the Nth element in the matched element set OR // Get the whole matched element set as a clean array get: function( num ) { return num != null ? // Return just the one element from the set ( num < 0 ? this[ num + this.length ] : this[ num ] ) : // Return all the elements in a clean array slice.call( this ); }, // Take an array of elements and push it onto the stack // (returning the new matched element set) pushStack: function( elems ) { // Build a new jQuery matched element set var ret = jQuery.merge( this.constructor(), elems ); // Add the old object onto the stack (as a reference) ret.prevObject = this; // Return the newly-formed element set return ret; }, // Execute a callback for every element in the matched set. each: function( callback ) { return jQuery.each( this, callback ); }, map: function( callback ) { return this.pushStack( jQuery.map( this, function( elem, i ) { return callback.call( elem, i, elem ); } ) ); }, slice: function() { return this.pushStack( slice.apply( this, arguments ) ); }, first: function() { return this.eq( 0 ); }, last: function() { return this.eq( -1 ); }, eq: function( i ) { var len = this.length, j = +i + ( i < 0 ? len : 0 ); return this.pushStack( j >= 0 && j < len ? [ this[ j ] ] : [] ); }, end: function() { return this.prevObject || this.constructor(); }, // For internal use only. // Behaves like an Array's method, not like a jQuery method. push: push, sort: arr.sort, splice: arr.splice }; jQuery.extend = jQuery.fn.extend = function() { var options, name, src, copy, copyIsArray, clone, target = arguments[ 0 ] || {}, i = 1, length = arguments.length, deep = false; // Handle a deep copy situation if ( typeof target === "boolean" ) { deep = target; // Skip the boolean and the target target = arguments[ i ] || {}; i++; } // Handle case when target is a string or something (possible in deep copy) if ( typeof target !== "object" && !jQuery.isFunction( target ) ) { target = {}; } // Extend jQuery itself if only one argument is passed if ( i === length ) { target = this; i--; } for ( ; i < length; i++ ) { // Only deal with non-null/undefined values if ( ( options = arguments[ i ] ) != null ) { // Extend the base object for ( name in options ) { src = target[ name ]; copy = options[ name ]; // Prevent never-ending loop if ( target === copy ) { continue; } // Recurse if we're merging plain objects or arrays if ( deep && copy && ( jQuery.isPlainObject( copy ) || ( copyIsArray = jQuery.isArray( copy ) ) ) ) { if ( copyIsArray ) { copyIsArray = false; clone = src && jQuery.isArray( src ) ? src : []; } else { clone = src && jQuery.isPlainObject( src ) ? src : {}; } // Never move original objects, clone them target[ name ] = jQuery.extend( deep, clone, copy ); // Don't bring in undefined values } else if ( copy !== undefined ) { target[ name ] = copy; } } } } // Return the modified object return target; }; jQuery.extend( { // Unique for each copy of jQuery on the page expando: "jQuery" + ( version + Math.random() ).replace( /\D/g, "" ), // Assume jQuery is ready without the ready module isReady: true, error: function( msg ) { throw new Error( msg ); }, noop: function() {}, isFunction: function( obj ) { return jQuery.type( obj ) === "function"; }, isArray: Array.isArray, isWindow: function( obj ) { return obj != null && obj === obj.window; }, isNumeric: function( obj ) { // As of jQuery 3.0, isNumeric is limited to // strings and numbers (primitives or objects) // that can be coerced to finite numbers (gh-2662) var type = jQuery.type( obj ); return ( type === "number" || type === "string" ) && // parseFloat NaNs numeric-cast false positives ("") // ...but misinterprets leading-number strings, particularly hex literals ("0x...") // subtraction forces infinities to NaN !isNaN( obj - parseFloat( obj ) ); }, isPlainObject: function( obj ) { var proto, Ctor; // Detect obvious negatives // Use toString instead of jQuery.type to catch host objects if ( !obj || toString.call( obj ) !== "[object Object]" ) { return false; } proto = getProto( obj ); // Objects with no prototype (e.g., `Object.create( null )`) are plain if ( !proto ) { return true; } // Objects with prototype are plain iff they were constructed by a global Object function Ctor = hasOwn.call( proto, "constructor" ) && proto.constructor; return typeof Ctor === "function" && fnToString.call( Ctor ) === ObjectFunctionString; }, isEmptyObject: function( obj ) { var name; for ( name in obj ) { return false; } return true; }, type: function( obj ) { if ( obj == null ) { return obj + ""; } // Support: Android <=2.3 only (functionish RegExp) return typeof obj === "object" || typeof obj === "function" ? class2type[ toString.call( obj ) ] || "object" : typeof obj; }, // Evaluates a script in a global context globalEval: function( code ) { DOMEval( code ); }, // Convert dashed to camelCase; used by the css and data modules // Support: IE <=9 - 11, Edge 12 - 13 // Microsoft forgot to hump their vendor prefix (#9572) camelCase: function( string ) { return string.replace( rmsPrefix, "ms-" ).replace( rdashAlpha, fcamelCase ); }, nodeName: function( elem, name ) { return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase(); }, each: function( obj, callback ) { var length, i = 0; if ( isArrayLike( obj ) ) { length = obj.length; for ( ; i < length; i++ ) { if ( callback.call( obj[ i ], i, obj[ i ] ) === false ) { break; } } } else { for ( i in obj ) { if ( callback.call( obj[ i ], i, obj[ i ] ) === false ) { break; } } } return obj; }, // Support: Android <=4.0 only trim: function( text ) { return text == null ? "" : ( text + "" ).replace( rtrim, "" ); }, // results is for internal usage only makeArray: function( arr, results ) { var ret = results || []; if ( arr != null ) { if ( isArrayLike( Object( arr ) ) ) { jQuery.merge( ret, typeof arr === "string" ? [ arr ] : arr ); } else { push.call( ret, arr ); } } return ret; }, inArray: function( elem, arr, i ) { return arr == null ? -1 : indexOf.call( arr, elem, i ); }, // Support: Android <=4.0 only, PhantomJS 1 only // push.apply(_, arraylike) throws on ancient WebKit merge: function( first, second ) { var len = +second.length, j = 0, i = first.length; for ( ; j < len; j++ ) { first[ i++ ] = second[ j ]; } first.length = i; return first; }, grep: function( elems, callback, invert ) { var callbackInverse, matches = [], i = 0, length = elems.length, callbackExpect = !invert; // Go through the array, only saving the items // that pass the validator function for ( ; i < length; i++ ) { callbackInverse = !callback( elems[ i ], i ); if ( callbackInverse !== callbackExpect ) { matches.push( elems[ i ] ); } } return matches; }, // arg is for internal usage only map: function( elems, callback, arg ) { var length, value, i = 0, ret = []; // Go through the array, translating each of the items to their new values if ( isArrayLike( elems ) ) { length = elems.length; for ( ; i < length; i++ ) { value = callback( elems[ i ], i, arg ); if ( value != null ) { ret.push( value ); } } // Go through every key on the object, } else { for ( i in elems ) { value = callback( elems[ i ], i, arg ); if ( value != null ) { ret.push( value ); } } } // Flatten any nested arrays return concat.apply( [], ret ); }, // A global GUID counter for objects guid: 1, // Bind a function to a context, optionally partially applying any // arguments. proxy: function( fn, context ) { var tmp, args, proxy; if ( typeof context === "string" ) { tmp = fn[ context ]; context = fn; fn = tmp; } // Quick check to determine if target is callable, in the spec // this throws a TypeError, but we will just return undefined. if ( !jQuery.isFunction( fn ) ) { return undefined; } // Simulated bind args = slice.call( arguments, 2 ); proxy = function() { return fn.apply( context || this, args.concat( slice.call( arguments ) ) ); }; // Set the guid of unique handler to the same of original handler, so it can be removed proxy.guid = fn.guid = fn.guid || jQuery.guid++; return proxy; }, now: Date.now, // jQuery.support is not used in Core but other projects attach their // properties to it so it needs to exist. support: support } ); // JSHint would error on this code due to the Symbol not being defined in ES5. // Defining this global in .jshintrc would create a danger of using the global // unguarded in another place, it seems safer to just disable JSHint for these // three lines. /* jshint ignore: start */ if ( typeof Symbol === "function" ) { jQuery.fn[ Symbol.iterator ] = arr[ Symbol.iterator ]; } /* jshint ignore: end */ // Populate the class2type map jQuery.each( "Boolean Number String Function Array Date RegExp Object Error Symbol".split( " " ), function( i, name ) { class2type[ "[object " + name + "]" ] = name.toLowerCase(); } ); function isArrayLike( obj ) { // Support: real iOS 8.2 only (not reproducible in simulator) // `in` check used to prevent JIT error (gh-2145) // hasOwn isn't used here due to false negatives // regarding Nodelist length in IE var length = !!obj && "length" in obj && obj.length, type = jQuery.type( obj ); if ( type === "function" || jQuery.isWindow( obj ) ) { return false; } return type === "array" || length === 0 || typeof length === "number" && length > 0 && ( length - 1 ) in obj; } var Sizzle = /*! * Sizzle CSS Selector Engine v2.3.0 * https://sizzlejs.com/ * * Copyright jQuery Foundation and other contributors * Released under the MIT license * http://jquery.org/license * * Date: 2016-01-04 */ (function( window ) { var i, support, Expr, getText, isXML, tokenize, compile, select, outermostContext, sortInput, hasDuplicate, // Local document vars setDocument, document, docElem, documentIsHTML, rbuggyQSA, rbuggyMatches, matches, contains, // Instance-specific data expando = "sizzle" + 1 * new Date(), preferredDoc = window.document, dirruns = 0, done = 0, classCache = createCache(), tokenCache = createCache(), compilerCache = createCache(), sortOrder = function( a, b ) { if ( a === b ) { hasDuplicate = true; } return 0; }, // Instance methods hasOwn = ({}).hasOwnProperty, arr = [], pop = arr.pop, push_native = arr.push, push = arr.push, slice = arr.slice, // Use a stripped-down indexOf as it's faster than native // https://jsperf.com/thor-indexof-vs-for/5 indexOf = function( list, elem ) { var i = 0, len = list.length; for ( ; i < len; i++ ) { if ( list[i] === elem ) { return i; } } return -1; }, booleans = "checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped", // Regular expressions // http://www.w3.org/TR/css3-selectors/#whitespace whitespace = "[\\x20\\t\\r\\n\\f]", // http://www.w3.org/TR/CSS21/syndata.html#value-def-identifier identifier = "(?:\\\\.|[\\w-]|[^\0-\\xa0])+", // Attribute selectors: http://www.w3.org/TR/selectors/#attribute-selectors attributes = "\\[" + whitespace + "*(" + identifier + ")(?:" + whitespace + // Operator (capture 2) "*([*^$|!~]?=)" + whitespace + // "Attribute values must be CSS identifiers [capture 5] or strings [capture 3 or capture 4]" "*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|(" + identifier + "))|)" + whitespace + "*\\]", pseudos = ":(" + identifier + ")(?:\\((" + // To reduce the number of selectors needing tokenize in the preFilter, prefer arguments: // 1. quoted (capture 3; capture 4 or capture 5) "('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|" + // 2. simple (capture 6) "((?:\\\\.|[^\\\\()[\\]]|" + attributes + ")*)|" + // 3. anything else (capture 2) ".*" + ")\\)|)", // Leading and non-escaped trailing whitespace, capturing some non-whitespace characters preceding the latter rwhitespace = new RegExp( whitespace + "+", "g" ), rtrim = new RegExp( "^" + whitespace + "+|((?:^|[^\\\\])(?:\\\\.)*)" + whitespace + "+$", "g" ), rcomma = new RegExp( "^" + whitespace + "*," + whitespace + "*" ), rcombinators = new RegExp( "^" + whitespace + "*([>+~]|" + whitespace + ")" + whitespace + "*" ), rattributeQuotes = new RegExp( "=" + whitespace + "*([^\\]'\"]*?)" + whitespace + "*\\]", "g" ), rpseudo = new RegExp( pseudos ), ridentifier = new RegExp( "^" + identifier + "$" ), matchExpr = { "ID": new RegExp( "^#(" + identifier + ")" ), "CLASS": new RegExp( "^\\.(" + identifier + ")" ), "TAG": new RegExp( "^(" + identifier + "|[*])" ), "ATTR": new RegExp( "^" + attributes ), "PSEUDO": new RegExp( "^" + pseudos ), "CHILD": new RegExp( "^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" + whitespace + "*(even|odd|(([+-]|)(\\d*)n|)" + whitespace + "*(?:([+-]|)" + whitespace + "*(\\d+)|))" + whitespace + "*\\)|)", "i" ), "bool": new RegExp( "^(?:" + booleans + ")$", "i" ), // For use in libraries implementing .is() // We use this for POS matching in `select` "needsContext": new RegExp( "^" + whitespace + "*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(" + whitespace + "*((?:-\\d)?\\d*)" + whitespace + "*\\)|)(?=[^-]|$)", "i" ) }, rinputs = /^(?:input|select|textarea|button)$/i, rheader = /^h\d$/i, rnative = /^[^{]+\{\s*\[native \w/, // Easily-parseable/retrievable ID or TAG or CLASS selectors rquickExpr = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/, rsibling = /[+~]/, // CSS escapes // http://www.w3.org/TR/CSS21/syndata.html#escaped-characters runescape = new RegExp( "\\\\([\\da-f]{1,6}" + whitespace + "?|(" + whitespace + ")|.)", "ig" ), funescape = function( _, escaped, escapedWhitespace ) { var high = "0x" + escaped - 0x10000; // NaN means non-codepoint // Support: Firefox<24 // Workaround erroneous numeric interpretation of +"0x" return high !== high || escapedWhitespace ? escaped : high < 0 ? // BMP codepoint String.fromCharCode( high + 0x10000 ) : // Supplemental Plane codepoint (surrogate pair) String.fromCharCode( high >> 10 | 0xD800, high & 0x3FF | 0xDC00 ); }, // CSS string/identifier serialization // https://drafts.csswg.org/cssom/#common-serializing-idioms rcssescape = /([\0-\x1f\x7f]|^-?\d)|^-$|[^\x80-\uFFFF\w-]/g, fcssescape = function( ch, asCodePoint ) { if ( asCodePoint ) { // U+0000 NULL becomes U+FFFD REPLACEMENT CHARACTER if ( ch === "\0" ) { return "\uFFFD"; } // Control characters and (dependent upon position) numbers get escaped as code points return ch.slice( 0, -1 ) + "\\" + ch.charCodeAt( ch.length - 1 ).toString( 16 ) + " "; } // Other potentially-special ASCII characters get backslash-escaped return "\\" + ch; }, // Used for iframes // See setDocument() // Removing the function wrapper causes a "Permission Denied" // error in IE unloadHandler = function() { setDocument(); }, disabledAncestor = addCombinator( function( elem ) { return elem.disabled === true; }, { dir: "parentNode", next: "legend" } ); // Optimize for push.apply( _, NodeList ) try { push.apply( (arr = slice.call( preferredDoc.childNodes )), preferredDoc.childNodes ); // Support: Android<4.0 // Detect silently failing push.apply arr[ preferredDoc.childNodes.length ].nodeType; } catch ( e ) { push = { apply: arr.length ? // Leverage slice if possible function( target, els ) { push_native.apply( target, slice.call(els) ); } : // Support: IE<9 // Otherwise append directly function( target, els ) { var j = target.length, i = 0; // Can't trust NodeList.length while ( (target[j++] = els[i++]) ) {} target.length = j - 1; } }; } function Sizzle( selector, context, results, seed ) { var m, i, elem, nid, match, groups, newSelector, newContext = context && context.ownerDocument, // nodeType defaults to 9, since context defaults to document nodeType = context ? context.nodeType : 9; results = results || []; // Return early from calls with invalid selector or context if ( typeof selector !== "string" || !selector || nodeType !== 1 && nodeType !== 9 && nodeType !== 11 ) { return results; } // Try to shortcut find operations (as opposed to filters) in HTML documents if ( !seed ) { if ( ( context ? context.ownerDocument || context : preferredDoc ) !== document ) { setDocument( context ); } context = context || document; if ( documentIsHTML ) { // If the selector is sufficiently simple, try using a "get*By*" DOM method // (excepting DocumentFragment context, where the methods don't exist) if ( nodeType !== 11 && (match = rquickExpr.exec( selector )) ) { // ID selector if ( (m = match[1]) ) { // Document context if ( nodeType === 9 ) { if ( (elem = context.getElementById( m )) ) { // Support: IE, Opera, Webkit // TODO: identify versions // getElementById can match elements by name instead of ID if ( elem.id === m ) { results.push( elem ); return results; } } else { return results; } // Element context } else { // Support: IE, Opera, Webkit // TODO: identify versions // getElementById can match elements by name instead of ID if ( newContext && (elem = newContext.getElementById( m )) && contains( context, elem ) && elem.id === m ) { results.push( elem ); return results; } } // Type selector } else if ( match[2] ) { push.apply( results, context.getElementsByTagName( selector ) ); return results; // Class selector } else if ( (m = match[3]) && support.getElementsByClassName && context.getElementsByClassName ) { push.apply( results, context.getElementsByClassName( m ) ); return results; } } // Take advantage of querySelectorAll if ( support.qsa && !compilerCache[ selector + " " ] && (!rbuggyQSA || !rbuggyQSA.test( selector )) ) { if ( nodeType !== 1 ) { newContext = context; newSelector = selector; // qSA looks outside Element context, which is not what we want // Thanks to Andrew Dupont for this workaround technique // Support: IE <=8 // Exclude object elements } else if ( context.nodeName.toLowerCase() !== "object" ) { // Capture the context ID, setting it first if necessary if ( (nid = context.getAttribute( "id" )) ) { nid = nid.replace( rcssescape, fcssescape ); } else { context.setAttribute( "id", (nid = expando) ); } // Prefix every selector in the list groups = tokenize( selector ); i = groups.length; while ( i-- ) { groups[i] = "#" + nid + " " + toSelector( groups[i] ); } newSelector = groups.join( "," ); // Expand context for sibling selectors newContext = rsibling.test( selector ) && testContext( context.parentNode ) || context; } if ( newSelector ) { try { push.apply( results, newContext.querySelectorAll( newSelector ) ); return results; } catch ( qsaError ) { } finally { if ( nid === expando ) { context.removeAttribute( "id" ); } } } } } } // All others return select( selector.replace( rtrim, "$1" ), context, results, seed ); } /** * Create key-value caches of limited size * @returns {function(string, object)} Returns the Object data after storing it on itself with * property name the (space-suffixed) string and (if the cache is larger than Expr.cacheLength) * deleting the oldest entry */ function createCache() { var keys = []; function cache( key, value ) { // Use (key + " ") to avoid collision with native prototype properties (see Issue #157) if ( keys.push( key + " " ) > Expr.cacheLength ) { // Only keep the most recent entries delete cache[ keys.shift() ]; } return (cache[ key + " " ] = value); } return cache; } /** * Mark a function for special use by Sizzle * @param {Function} fn The function to mark */ function markFunction( fn ) { fn[ expando ] = true; return fn; } /** * Support testing using an element * @param {Function} fn Passed the created element and returns a boolean result */ function assert( fn ) { var el = document.createElement("fieldset"); try { return !!fn( el ); } catch (e) { return false; } finally { // Remove from its parent by default if ( el.parentNode ) { el.parentNode.removeChild( el ); } // release memory in IE el = null; } } /** * Adds the same handler for all of the specified attrs * @param {String} attrs Pipe-separated list of attributes * @param {Function} handler The method that will be applied */ function addHandle( attrs, handler ) { var arr = attrs.split("|"), i = arr.length; while ( i-- ) { Expr.attrHandle[ arr[i] ] = handler; } } /** * Checks document order of two siblings * @param {Element} a * @param {Element} b * @returns {Number} Returns less than 0 if a precedes b, greater than 0 if a follows b */ function siblingCheck( a, b ) { var cur = b && a, diff = cur && a.nodeType === 1 && b.nodeType === 1 && a.sourceIndex - b.sourceIndex; // Use IE sourceIndex if available on both nodes if ( diff ) { return diff; } // Check if b follows a if ( cur ) { while ( (cur = cur.nextSibling) ) { if ( cur === b ) { return -1; } } } return a ? 1 : -1; } /** * Returns a function to use in pseudos for input types * @param {String} type */ function createInputPseudo( type ) { return function( elem ) { var name = elem.nodeName.toLowerCase(); return name === "input" && elem.type === type; }; } /** * Returns a function to use in pseudos for buttons * @param {String} type */ function createButtonPseudo( type ) { return function( elem ) { var name = elem.nodeName.toLowerCase(); return (name === "input" || name === "button") && elem.type === type; }; } /** * Returns a function to use in pseudos for :enabled/:disabled * @param {Boolean} disabled true for :disabled; false for :enabled */ function createDisabledPseudo( disabled ) { // Known :disabled false positives: // IE: *[disabled]:not(button, input, select, textarea, optgroup, option, menuitem, fieldset) // not IE: fieldset[disabled] > legend:nth-of-type(n+2) :can-disable return function( elem ) { // Check form elements and option elements for explicit disabling return "label" in elem && elem.disabled === disabled || "form" in elem && elem.disabled === disabled || // Check non-disabled form elements for fieldset[disabled] ancestors "form" in elem && elem.disabled === false && ( // Support: IE6-11+ // Ancestry is covered for us elem.isDisabled === disabled || // Otherwise, assume any non-