diff --git a/designer-base/src/main/java/com/fr/design/DesignerEnvManager.java b/designer-base/src/main/java/com/fr/design/DesignerEnvManager.java index d4a60eae7..de83d6d7b 100644 --- a/designer-base/src/main/java/com/fr/design/DesignerEnvManager.java +++ b/designer-base/src/main/java/com/fr/design/DesignerEnvManager.java @@ -18,6 +18,8 @@ import com.fr.design.file.HistoryTemplateListPane; import com.fr.design.i18n.Toolkit; import com.fr.design.locale.impl.ProductImproveMark; import com.fr.design.mainframe.reuse.ComponentReuseNotificationInfo; +import com.fr.design.login.DesignerLoginType; +import com.fr.design.login.config.DesignerLoginConfigManager; import com.fr.design.mainframe.vcs.VcsConfigManager; import com.fr.design.notification.SnapChatConfig; import com.fr.design.port.DesignerPortContext; @@ -195,6 +197,8 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter { private ComponentReuseNotificationInfo notificationInfo = ComponentReuseNotificationInfo.getInstance(); + private DesignerLoginConfigManager designerLoginConfigManager = DesignerLoginConfigManager.getInstance(); + /** * DesignerEnvManager. */ @@ -738,6 +742,113 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter { designerPushUpdateConfigManager.setAutoPushUpdateEnabled(autoPushUpdateEnabled); } + /** + * 设计器登录相关配置 + */ + public void setDesignerLoginUid(int uid) { + designerLoginConfigManager.setUid(uid); + } + + public int getDesignerLoginUid() { + return designerLoginConfigManager.getUid(); + } + + public void setDesignerLoginUsername(String username) { + designerLoginConfigManager.setUsername(username); + } + + public String getDesignerLoginUsername() { + return designerLoginConfigManager.getUsername(); + } + + public void setDesignerLoginAppId(String appId) { + designerLoginConfigManager.setAppId(appId); + } + + public String getDesignerLoginAppId() { + return designerLoginConfigManager.getAppId(); + } + + public void setDesignerLoginRefreshToken(String refreshToken) { + designerLoginConfigManager.setRefreshToken(refreshToken); + } + + public String getDesignerLoginRefreshToken() { + return designerLoginConfigManager.getRefreshToken(); + } + + public void setDesignerLoginDoNotRemind(boolean doNotRemind) { + designerLoginConfigManager.setDoNotRemind(doNotRemind); + } + + public boolean isDesignerLoginDoNotRemind() { + return designerLoginConfigManager.isDoNotRemind(); + } + + public void setDesignerLoginDoNotRemindSelectedTime(long doNotRemindSelectedTime) { + designerLoginConfigManager.setDoNotRemindSelectedTime(doNotRemindSelectedTime); + } + + public long getDesignerLoginDoNotRemindSelectedTime() { + return designerLoginConfigManager.getDoNotRemindSelectedTime(); + } + + public void setDesignerActivatedTime(long designerActivatedTime) { + designerLoginConfigManager.setDesignerActivatedTime(designerActivatedTime); + } + + public long getDesignerActivatedTime() { + return designerLoginConfigManager.getDesignerActivatedTime(); + } + + public void setDesignerLastLoginTime(long lastLoginTime) { + designerLoginConfigManager.setLastLoginTime(lastLoginTime); + } + + public long getDesignerLastLoginTime() { + return designerLoginConfigManager.getLastLoginTime(); + } + + public void setCurrentVersionFirstLaunch(boolean currentVersionFirstLaunch) { + designerLoginConfigManager.setCurrentVersionFirstLaunch(currentVersionFirstLaunch); + } + + public boolean isCurrentVersionFirstLaunch() { + return designerLoginConfigManager.isCurrentVersionFirstLaunch(); + } + + public DesignerLoginType getLastLoginType() { + return designerLoginConfigManager.getLastLoginType(); + } + + public void setLastLoginType(DesignerLoginType lastLoginType) { + designerLoginConfigManager.setLastLoginType(lastLoginType); + } + + public String getLastLoginAccount() { + return designerLoginConfigManager.getLastLoginAccount(); + } + + public void setLastLoginAccount(String lastLoginAccount) { + designerLoginConfigManager.setLastLoginAccount(lastLoginAccount); + } + + public boolean isLoginRemindBeforeJumpBBS() { + return designerLoginConfigManager.isLoginRemindBeforeJumpBBS(); + } + + public void setLoginRemindBeforeJumpBBS(boolean loginRemindBeforeJumpBBS) { + designerLoginConfigManager.setLoginRemindBeforeJumpBBS(loginRemindBeforeJumpBBS); + } + + public boolean isPluginRemindOnFirstLaunch() { + return designerLoginConfigManager.isPluginRemindOnFirstLaunch(); + } + + public void setPluginRemindOnFirstLaunch(boolean pluginRemindOnFirstLaunch) { + designerLoginConfigManager.setPluginRemindOnFirstLaunch(pluginRemindOnFirstLaunch); + } + /** * 内置服务器是否使用时启动 * @@ -1579,6 +1690,8 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter { readDesignerPort(reader); } else if (name.equals(SnapChatConfig.XML_TAG)) { readSnapChatConfig(reader); + } else if (name.equals(DesignerLoginConfigManager.XML_TAG)) { + readDesignerLoginAttr(reader); } else { readLayout(reader, name); } @@ -1811,6 +1924,7 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter { writeDesignerPort(writer); writeSnapChatConfig(writer); writeComponentReuseNotificationInfo(writer); + writeDesignerLoginAttr(writer); writer.end(); } @@ -2088,6 +2202,14 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter { this.vcsConfigManager = vcsConfigManager; } + private void readDesignerLoginAttr(XMLableReader reader) { + reader.readXMLObject(designerLoginConfigManager); + } + + private void writeDesignerLoginAttr(XMLPrintWriter writer) { + this.designerLoginConfigManager.writeXML(writer); + } + enum XmlHandler { Self; public void handle(Throwable throwable) { diff --git a/designer-base/src/main/java/com/fr/design/actions/community/BBSAction.java b/designer-base/src/main/java/com/fr/design/actions/community/BBSAction.java index 05a1d2b20..14046b683 100644 --- a/designer-base/src/main/java/com/fr/design/actions/community/BBSAction.java +++ b/designer-base/src/main/java/com/fr/design/actions/community/BBSAction.java @@ -1,54 +1,43 @@ package com.fr.design.actions.community; -import com.fr.base.svg.IconUtils; -import com.fr.design.actions.UpdateAction; +import com.fr.design.login.AbstractDesignerSSO; import com.fr.design.menu.MenuKeySet; -import com.fr.design.utils.BrowseUtils; import com.fr.general.CloudCenter; import javax.swing.*; -import java.awt.event.ActionEvent; +public class BBSAction extends AbstractDesignerSSO { -public class BBSAction extends UpdateAction -{ + public BBSAction() { + this.setMenuKeySet(BBS); + this.setName(getMenuKeySet().getMenuName()); + this.setMnemonic(getMenuKeySet().getMnemonic()); + this.setSmallIcon("/com/fr/design/images/bbs/bbs"); - public BBSAction() - { - this.setMenuKeySet(BBS); - this.setName(getMenuKeySet().getMenuName()); - this.setMnemonic(getMenuKeySet().getMnemonic()); - this.setSmallIcon("/com/fr/design/images/bbs/bbs"); + } - } - - /** - * 动作 - * @param arg0 事件 - */ @Override - public void actionPerformed(ActionEvent arg0) - { - String url = CloudCenter.getInstance().acquireUrlByKind("bbs"); - BrowseUtils.browser(url); + public String getJumpUrl() { + return CloudCenter.getInstance().acquireUrlByKind("bbs"); } - public static final MenuKeySet BBS = new MenuKeySet() { - @Override - public char getMnemonic() { - return 'B'; - } - - @Override - public String getMenuName() { - return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Community_Bbs"); - } - - @Override - public KeyStroke getKeyStroke() { - return null; - } - }; + + public static final MenuKeySet BBS = new MenuKeySet() { + @Override + public char getMnemonic() { + return 'B'; + } + + @Override + public String getMenuName() { + return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Community_Bbs"); + } + + @Override + public KeyStroke getKeyStroke() { + return null; + } + }; } diff --git a/designer-base/src/main/java/com/fr/design/actions/community/BugAction.java b/designer-base/src/main/java/com/fr/design/actions/community/BugAction.java index cebaa6956..1438f9777 100644 --- a/designer-base/src/main/java/com/fr/design/actions/community/BugAction.java +++ b/designer-base/src/main/java/com/fr/design/actions/community/BugAction.java @@ -1,50 +1,42 @@ package com.fr.design.actions.community; -import com.fr.base.svg.IconUtils; -import com.fr.design.actions.UpdateAction; +import com.fr.design.login.AbstractDesignerSSO; import com.fr.design.menu.MenuKeySet; -import com.fr.design.utils.BrowseUtils; import com.fr.general.CloudCenter; import javax.swing.*; -import java.awt.event.ActionEvent; +public class BugAction extends AbstractDesignerSSO { -public class BugAction extends UpdateAction -{ + public BugAction() { + this.setMenuKeySet(BUG); + this.setName(getMenuKeySet().getMenuName()); + this.setMnemonic(getMenuKeySet().getMnemonic()); + this.setSmallIcon("/com/fr/design/images/bbs/bug"); + } - public BugAction() - { this.setMenuKeySet(BUG); - this.setName(getMenuKeySet().getMenuName()); - this.setMnemonic(getMenuKeySet().getMnemonic()); - this.setSmallIcon("/com/fr/design/images/bbs/bug"); -} - -@Override -public void actionPerformed(ActionEvent arg0) -{ - String url = CloudCenter.getInstance().acquireUrlByKind("bbs.bugs"); - BrowseUtils.browser(url); + @Override + public String getJumpUrl() { + return CloudCenter.getInstance().acquireUrlByKind("bbs.bugs"); + } -} - public static final MenuKeySet BUG = new MenuKeySet() { + public static final MenuKeySet BUG = new MenuKeySet() { - @Override - public String getMenuName() { - return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Community_Bug"); - } + @Override + public String getMenuName() { + return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Community_Bug"); + } - @Override - public KeyStroke getKeyStroke() { - return null; - } + @Override + public KeyStroke getKeyStroke() { + return null; + } - @Override - public char getMnemonic() - { + @Override + public char getMnemonic() { - return 'U'; - } - }; + return 'U'; + } + }; } diff --git a/designer-base/src/main/java/com/fr/design/actions/community/CenterAction.java b/designer-base/src/main/java/com/fr/design/actions/community/CenterAction.java index 64288b9c9..17b2ce379 100644 --- a/designer-base/src/main/java/com/fr/design/actions/community/CenterAction.java +++ b/designer-base/src/main/java/com/fr/design/actions/community/CenterAction.java @@ -1,33 +1,26 @@ package com.fr.design.actions.community; -import com.fr.base.svg.IconUtils; import com.fr.design.menu.MenuKeySet; -import com.fr.design.utils.BrowseUtils; import com.fr.general.CloudCenter; import javax.swing.KeyStroke; -import java.awt.event.ActionEvent; /** * Created by XINZAI on 2018/8/23. */ -public class CenterAction extends UpAction{ - public CenterAction() - { +public class CenterAction extends UpAction { + public CenterAction() { this.setMenuKeySet(CENTER); this.setName(getMenuKeySet().getMenuName()); this.setMnemonic(getMenuKeySet().getMnemonic()); this.setSmallIcon("/com/fr/design/images/bbs/center"); - } @Override - public void actionPerformed(ActionEvent arg0) - { - String url = CloudCenter.getInstance().acquireUrlByKind("bbs.center"); - BrowseUtils.browser(url); - + public String getJumpUrl() { + return CloudCenter.getInstance().acquireUrlByKind("bbs.center"); } + public static final MenuKeySet CENTER = new MenuKeySet() { @Override public char getMnemonic() { diff --git a/designer-base/src/main/java/com/fr/design/actions/community/NeedAction.java b/designer-base/src/main/java/com/fr/design/actions/community/NeedAction.java index 61834547f..b13e42431 100644 --- a/designer-base/src/main/java/com/fr/design/actions/community/NeedAction.java +++ b/designer-base/src/main/java/com/fr/design/actions/community/NeedAction.java @@ -1,49 +1,41 @@ package com.fr.design.actions.community; -import com.fr.base.svg.IconUtils; -import com.fr.design.actions.UpdateAction; +import com.fr.design.login.AbstractDesignerSSO; import com.fr.design.menu.MenuKeySet; -import com.fr.design.utils.BrowseUtils; import com.fr.general.CloudCenter; import javax.swing.*; -import java.awt.event.ActionEvent; - -public class NeedAction extends UpdateAction -{ - - public NeedAction() - { - this.setMenuKeySet(NEED); - this.setName(getMenuKeySet().getMenuName()); - this.setMnemonic(getMenuKeySet().getMnemonic()); - this.setSmallIcon("/com/fr/design/images/bbs/need"); - - } - - @Override - public void actionPerformed(ActionEvent arg0) - { - String url = CloudCenter.getInstance().acquireUrlByKind("bbs.needs"); - BrowseUtils.browser(url); - - } - public static final MenuKeySet NEED = new MenuKeySet() { - @Override - public char getMnemonic() { - return 'N'; - } - - @Override - public String getMenuName() { - return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Commuinity_Need"); - } - - @Override - public KeyStroke getKeyStroke() { - return null; - } - }; +public class NeedAction extends AbstractDesignerSSO { + + public NeedAction() { + this.setMenuKeySet(NEED); + this.setName(getMenuKeySet().getMenuName()); + this.setMnemonic(getMenuKeySet().getMnemonic()); + this.setSmallIcon("/com/fr/design/images/bbs/need"); + + } + + @Override + public String getJumpUrl() { + return CloudCenter.getInstance().acquireUrlByKind("bbs.needs"); + } + + public static final MenuKeySet NEED = new MenuKeySet() { + @Override + public char getMnemonic() { + return 'N'; + } + + @Override + public String getMenuName() { + return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Commuinity_Need"); + } + + @Override + public KeyStroke getKeyStroke() { + return null; + } + }; } diff --git a/designer-base/src/main/java/com/fr/design/actions/community/QuestionAction.java b/designer-base/src/main/java/com/fr/design/actions/community/QuestionAction.java index 94234b1bc..e3b64d31f 100644 --- a/designer-base/src/main/java/com/fr/design/actions/community/QuestionAction.java +++ b/designer-base/src/main/java/com/fr/design/actions/community/QuestionAction.java @@ -1,16 +1,12 @@ package com.fr.design.actions.community; -import com.fr.base.svg.IconUtils; -import com.fr.design.actions.UpdateAction; +import com.fr.design.login.AbstractDesignerSSO; import com.fr.design.menu.MenuKeySet; -import com.fr.design.utils.BrowseUtils; import com.fr.general.CloudCenter; import javax.swing.*; -import java.awt.event.ActionEvent; - -public class QuestionAction extends UpdateAction { +public class QuestionAction extends AbstractDesignerSSO { public QuestionAction() { this.setMenuKeySet(QUESTIONS); @@ -21,9 +17,8 @@ public class QuestionAction extends UpdateAction { } @Override - public void actionPerformed(ActionEvent arg0) { - String url = CloudCenter.getInstance().acquireUrlByKind("bbs.questions"); - BrowseUtils.browser(url); + public String getJumpUrl() { + return CloudCenter.getInstance().acquireUrlByKind("bbs.questions"); } public static final MenuKeySet QUESTIONS = new MenuKeySet() { diff --git a/designer-base/src/main/java/com/fr/design/actions/community/SignAction.java b/designer-base/src/main/java/com/fr/design/actions/community/SignAction.java index 4944ecc3c..244b83854 100644 --- a/designer-base/src/main/java/com/fr/design/actions/community/SignAction.java +++ b/designer-base/src/main/java/com/fr/design/actions/community/SignAction.java @@ -1,49 +1,41 @@ package com.fr.design.actions.community; -import com.fr.base.svg.IconUtils; -import com.fr.design.actions.UpdateAction; +import com.fr.design.login.AbstractDesignerSSO; import com.fr.design.menu.MenuKeySet; -import com.fr.design.utils.BrowseUtils; import com.fr.general.CloudCenter; import javax.swing.*; -import java.awt.event.ActionEvent; - -public class SignAction extends UpdateAction -{ - - public SignAction() - { - this.setMenuKeySet(SIGN); - this.setName(getMenuKeySet().getMenuName()); - this.setMnemonic(getMenuKeySet().getMnemonic()); - this.setSmallIcon("/com/fr/design/images/bbs/sign"); - } - - @Override - public void actionPerformed(ActionEvent arg0) - { - String url = CloudCenter.getInstance().acquireUrlByKind("bbs.aut"); - BrowseUtils.browser(url); - - } - public static final MenuKeySet SIGN = new MenuKeySet() { - @Override - public char getMnemonic() { - return 'S'; - } - - @Override - public String getMenuName() { - return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Community_sign"); - } - - @Override - public KeyStroke getKeyStroke() { - return null; - } - }; +public class SignAction extends AbstractDesignerSSO { + + public SignAction() { + this.setMenuKeySet(SIGN); + this.setName(getMenuKeySet().getMenuName()); + this.setMnemonic(getMenuKeySet().getMnemonic()); + this.setSmallIcon("/com/fr/design/images/bbs/sign"); + } + + @Override + public String getJumpUrl() { + return CloudCenter.getInstance().acquireUrlByKind("bbs.aut"); + } + + public static final MenuKeySet SIGN = new MenuKeySet() { + @Override + public char getMnemonic() { + return 'S'; + } + + @Override + public String getMenuName() { + return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Community_sign"); + } + + @Override + public KeyStroke getKeyStroke() { + return null; + } + }; } diff --git a/designer-base/src/main/java/com/fr/design/actions/community/TechSolutionAction.java b/designer-base/src/main/java/com/fr/design/actions/community/TechSolutionAction.java index 740ca2387..350cad619 100644 --- a/designer-base/src/main/java/com/fr/design/actions/community/TechSolutionAction.java +++ b/designer-base/src/main/java/com/fr/design/actions/community/TechSolutionAction.java @@ -1,23 +1,16 @@ package com.fr.design.actions.community; -import com.fr.base.svg.IconUtils; -import com.fr.design.actions.UpdateAction; +import com.fr.design.login.AbstractDesignerSSO; import com.fr.design.menu.MenuKeySet; -import com.fr.design.utils.BrowseUtils; import com.fr.general.CloudCenter; - import javax.swing.KeyStroke; -import java.awt.event.ActionEvent; - - /** * Created by XINZAI on 2018/8/23. */ -public class TechSolutionAction extends UpdateAction{ - public TechSolutionAction() - { +public class TechSolutionAction extends AbstractDesignerSSO { + public TechSolutionAction() { this.setMenuKeySet(TSO); this.setName(getMenuKeySet().getMenuName()); this.setMnemonic(getMenuKeySet().getMnemonic()); @@ -26,12 +19,10 @@ public class TechSolutionAction extends UpdateAction{ } @Override - public void actionPerformed(ActionEvent arg0) - { - String url = CloudCenter.getInstance().acquireUrlByKind("bbs.solution"); - BrowseUtils.browser(url); - + public String getJumpUrl() { + return CloudCenter.getInstance().acquireUrlByKind("bbs.solution"); } + public static final MenuKeySet TSO = new MenuKeySet() { @Override public char getMnemonic() { diff --git a/designer-base/src/main/java/com/fr/design/actions/community/UpAction.java b/designer-base/src/main/java/com/fr/design/actions/community/UpAction.java index 9e550377f..effc00eb1 100644 --- a/designer-base/src/main/java/com/fr/design/actions/community/UpAction.java +++ b/designer-base/src/main/java/com/fr/design/actions/community/UpAction.java @@ -1,69 +1,41 @@ package com.fr.design.actions.community; import com.fr.base.BaseUtils; -import com.fr.design.actions.UpdateAction; -import com.fr.design.dialog.FineJOptionPane; +import com.fr.design.login.AbstractDesignerSSO; import com.fr.design.menu.MenuKeySet; import com.fr.general.CloudCenter; -import com.fr.log.FineLoggerFactory; -import com.fr.stable.StringUtils; -import javax.swing.JOptionPane; import javax.swing.KeyStroke; -import java.awt.Desktop; -import java.awt.event.ActionEvent; -import java.io.IOException; -import java.net.URI; -import java.net.URISyntaxException; -public class UpAction extends UpdateAction -{ +public class UpAction extends AbstractDesignerSSO { - public UpAction() - { - this.setMenuKeySet(UPDATE); - this.setName(getMenuKeySet().getMenuName()); - this.setMnemonic(getMenuKeySet().getMnemonic()); - this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/update.png")); - - } + public UpAction() { + this.setMenuKeySet(UPDATE); + this.setName(getMenuKeySet().getMenuName()); + this.setMnemonic(getMenuKeySet().getMnemonic()); + this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/update.png")); + } @Override - public void actionPerformed(ActionEvent arg0) - { - String url = CloudCenter.getInstance().acquireUrlByKind("bbs.update"); - if (StringUtils.isEmpty(url)) { - FineLoggerFactory.getLogger().info("The URL is empty!"); - return; - } - try { - Desktop.getDesktop().browse(new URI(url)); - } catch (IOException exp) { - FineJOptionPane.showMessageDialog(null, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Set_Default_Browser")); - FineLoggerFactory.getLogger().error(exp.getMessage(), exp); - } catch (URISyntaxException exp) { - FineLoggerFactory.getLogger().error(exp.getMessage(), exp); - } catch (Exception exp) { - FineLoggerFactory.getLogger().error(exp.getMessage(), exp); - FineLoggerFactory.getLogger().error("Can not open the browser for URL: " + url); - } - + public String getJumpUrl() { + return CloudCenter.getInstance().acquireUrlByKind("bbs.update"); } - public static final MenuKeySet UPDATE = new MenuKeySet() { - @Override - public char getMnemonic() { - return 'U'; - } - - @Override - public String getMenuName() { - return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Community_Update"); - } - @Override - public KeyStroke getKeyStroke() { - return null; - } - }; + public static final MenuKeySet UPDATE = new MenuKeySet() { + @Override + public char getMnemonic() { + return 'U'; + } + + @Override + public String getMenuName() { + return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Community_Update"); + } + + @Override + public KeyStroke getKeyStroke() { + return null; + } + }; } diff --git a/designer-base/src/main/java/com/fr/design/actions/community/VideoAction.java b/designer-base/src/main/java/com/fr/design/actions/community/VideoAction.java index 62ccf845e..609884635 100644 --- a/designer-base/src/main/java/com/fr/design/actions/community/VideoAction.java +++ b/designer-base/src/main/java/com/fr/design/actions/community/VideoAction.java @@ -1,49 +1,43 @@ package com.fr.design.actions.community; -import com.fr.base.svg.IconUtils; -import com.fr.design.actions.UpdateAction; import com.fr.design.locale.impl.VideoMark; +import com.fr.design.login.AbstractDesignerSSO; import com.fr.design.menu.MenuKeySet; -import com.fr.design.utils.BrowseUtils; import com.fr.general.locale.LocaleCenter; import com.fr.general.locale.LocaleMark; import javax.swing.*; -import java.awt.event.ActionEvent; +public class VideoAction extends AbstractDesignerSSO { -public class VideoAction extends UpdateAction -{ - - public VideoAction() - { - this.setMenuKeySet(VIDEO); - this.setName(getMenuKeySet().getMenuName()); - this.setMnemonic(getMenuKeySet().getMnemonic()); - this.setSmallIcon("/com/fr/design/images/bbs/video"); - } + public VideoAction() { + this.setMenuKeySet(VIDEO); + this.setName(getMenuKeySet().getMenuName()); + this.setMnemonic(getMenuKeySet().getMnemonic()); + this.setSmallIcon("/com/fr/design/images/bbs/video"); + } @Override - public void actionPerformed(ActionEvent arg0) - { + public String getJumpUrl() { LocaleMark localeMark = LocaleCenter.getMark(VideoMark.class); - BrowseUtils.browser(localeMark.getValue()); + return localeMark.getValue(); } - public static final MenuKeySet VIDEO = new MenuKeySet() { - @Override - public char getMnemonic() { - return 'V'; - } - - @Override - public String getMenuName() { - return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Community_Video"); - } - - @Override - public KeyStroke getKeyStroke() { - return null; - } - }; + + public static final MenuKeySet VIDEO = new MenuKeySet() { + @Override + public char getMnemonic() { + return 'V'; + } + + @Override + public String getMenuName() { + return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Community_Video"); + } + + @Override + public KeyStroke getKeyStroke() { + return null; + } + }; } diff --git a/designer-base/src/main/java/com/fr/design/actions/community/WorkOrderCenterAction.java b/designer-base/src/main/java/com/fr/design/actions/community/WorkOrderCenterAction.java index d556548c1..3e711ac8d 100644 --- a/designer-base/src/main/java/com/fr/design/actions/community/WorkOrderCenterAction.java +++ b/designer-base/src/main/java/com/fr/design/actions/community/WorkOrderCenterAction.java @@ -1,12 +1,8 @@ package com.fr.design.actions.community; - import com.fr.design.i18n.Toolkit; -import com.fr.design.utils.BrowseUtils; import com.fr.general.CloudCenter; -import java.awt.event.ActionEvent; - /** * @Description 工单中心 * @Author Henry.Wang @@ -19,8 +15,7 @@ public class WorkOrderCenterAction extends UpAction { } @Override - public void actionPerformed(ActionEvent arg0) { - String url = CloudCenter.getInstance().acquireUrlByKind("bbs.work.order.center"); - BrowseUtils.browser(url); + public String getJumpUrl() { + return CloudCenter.getInstance().acquireUrlByKind("bbs.work.order.center"); } } \ No newline at end of file diff --git a/designer-base/src/main/java/com/fr/design/actions/help/TutorialAction.java b/designer-base/src/main/java/com/fr/design/actions/help/TutorialAction.java index af0ea605f..cf4f02f40 100644 --- a/designer-base/src/main/java/com/fr/design/actions/help/TutorialAction.java +++ b/designer-base/src/main/java/com/fr/design/actions/help/TutorialAction.java @@ -1,12 +1,10 @@ package com.fr.design.actions.help; -import com.fr.base.svg.IconUtils; -import com.fr.design.actions.UpdateAction; +import com.fr.design.login.AbstractDesignerSSO; import com.fr.design.menu.MenuKeySet; import com.fr.general.CloudCenter; import com.fr.general.GeneralContext; import com.fr.general.http.HttpToolbox; -import com.fr.log.FineLoggerFactory; import com.fr.stable.CommonUtils; import com.fr.stable.ProductConstants; import com.fr.stable.StringUtils; @@ -15,14 +13,9 @@ import com.fr.third.org.apache.http.StatusLine; import com.fr.third.org.apache.http.client.methods.HttpGet; import javax.swing.KeyStroke; -import java.awt.Desktop; -import java.awt.event.ActionEvent; import java.awt.event.KeyEvent; -import java.net.URI; -public class TutorialAction extends UpdateAction { - - private static final String URL_FOR_TEST_NETWORK = "https://www.baidu.com"; +public class TutorialAction extends AbstractDesignerSSO { public TutorialAction() { this.setMenuKeySet(HELP_TUTORIAL); @@ -32,29 +25,15 @@ public class TutorialAction extends UpdateAction { this.setAccelerator(getMenuKeySet().getKeyStroke()); } - /** - * 动作 - * @param evt 事件 - */ @Override - public void actionPerformed(ActionEvent evt) { - String helpURL = CloudCenter.getInstance().acquireUrlByKind(createDocKey()); - // 用第三方网址去判断是否处在离线状态 - if (isServerOnline(URL_FOR_TEST_NETWORK)) { - try { - Desktop.getDesktop().browse(new URI(helpURL)); - return; - } catch (Exception e) { - FineLoggerFactory.getLogger().error(e.getMessage(), e); - } - } - FineLoggerFactory.getLogger().warn(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Offline_Helptutorial_Msg")); + public String getJumpUrl() { + return CloudCenter.getInstance().acquireUrlByKind(createDocKey()); } // 生成帮助文档 sitecenter key, help.zh_CN.10 protected String createDocKey() { String locale = GeneralContext.getLocale().toString(); - return CommonUtils.join(new String[]{ "help", locale, ProductConstants.MAIN_VERSION }, "."); + return CommonUtils.join(new String[]{"help", locale, ProductConstants.MAIN_VERSION}, "."); } // 判断是否可以访问在线文档 diff --git a/designer-base/src/main/java/com/fr/design/constants/UIConstants.java b/designer-base/src/main/java/com/fr/design/constants/UIConstants.java index fdc92a937..b10d3f9e5 100644 --- a/designer-base/src/main/java/com/fr/design/constants/UIConstants.java +++ b/designer-base/src/main/java/com/fr/design/constants/UIConstants.java @@ -148,7 +148,8 @@ public interface UIConstants { public static final Color TAB_BUTTON_PRESS_SELECTED = new Color(236, 236, 238); public static final Color POPUP_TITLE_BACKGROUND = new Color(0xd8f2fd); public static final Color LIST_ITEM_SPLIT_LINE = new Color(0xf0f0f3); - + public static final Color DESIGNER_LOGIN_BACKGROUND = new Color(0xf1ad14); + public static final Color DESIGNER_LOGIN_BACKGROUND_ONCLICK = new Color(0xd89600); public static final BufferedImage DRAG_BAR = IOUtils.readImage("com/fr/design/images/control/bar.png"); public static final BufferedImage DRAG_BAR_LIGHT = IOUtils.readImage("com/fr/design/images/control/bar-light.png"); diff --git a/designer-base/src/main/java/com/fr/design/extra/LoginContextListener.java b/designer-base/src/main/java/com/fr/design/extra/LoginContextListener.java index ca1354443..50d9c1a01 100644 --- a/designer-base/src/main/java/com/fr/design/extra/LoginContextListener.java +++ b/designer-base/src/main/java/com/fr/design/extra/LoginContextListener.java @@ -1,8 +1,10 @@ package com.fr.design.extra; +import com.fr.design.login.DesignerLoginSource; + /** * Created by lp on 2016/8/16. */ public interface LoginContextListener { - void showLoginContext(); + void showLoginContext(DesignerLoginSource source); } diff --git a/designer-base/src/main/java/com/fr/design/extra/LoginWebBridge.java b/designer-base/src/main/java/com/fr/design/extra/LoginWebBridge.java index 81e34335a..0ec65001c 100644 --- a/designer-base/src/main/java/com/fr/design/extra/LoginWebBridge.java +++ b/designer-base/src/main/java/com/fr/design/extra/LoginWebBridge.java @@ -1,13 +1,15 @@ package com.fr.design.extra; -import com.fr.base.passport.FinePassportManager; import com.fr.concurrent.NamedThreadFactory; import com.fr.config.MarketConfig; +import com.fr.design.DesignerEnvManager; import com.fr.design.dialog.UIDialog; import com.fr.design.extra.exe.PluginLoginExecutor; import com.fr.design.gui.ilable.UILabel; import com.fr.design.locale.impl.BbsRegisterMark; import com.fr.design.locale.impl.BbsResetMark; +import com.fr.design.login.service.DesignerLoginClient; +import com.fr.design.login.service.DesignerLoginResult; import com.fr.general.CloudCenter; import com.fr.general.http.HttpClient; import com.fr.general.locale.LocaleCenter; @@ -80,17 +82,15 @@ public class LoginWebBridge { */ public void setMessageCount(int count) { if (count == MIN_MESSAGE_COUNT) { - uiLabel.setText(MarketConfig.getInstance().getBbsUsername()); - MarketConfig.getInstance().setInShowBBsName(MarketConfig.getInstance().getBbsUsername()); + MarketConfig.getInstance().setInShowBBsName(DesignerEnvManager.getEnvManager().getDesignerLoginUsername()); return; } this.messageCount = count; StringBuilder sb = new StringBuilder(); - sb.append(StringUtils.BLANK).append(MarketConfig.getInstance().getBbsUsername()) + sb.append(StringUtils.BLANK).append(DesignerEnvManager.getEnvManager().getDesignerLoginUsername()) .append("(").append(this.messageCount) .append(")").append(StringUtils.BLANK); MarketConfig.getInstance().setInShowBBsName(sb.toString()); - uiLabel.setText(sb.toString()); } public void setQQDialog(UIDialog qqDialog) { @@ -163,20 +163,11 @@ public class LoginWebBridge { * @return 登录信息标志 */ public String login(String userInfo, String password) { - if (!StringUtils.isNotBlank(userInfo) && !StringUtils.isNotBlank(password)) { - return LOGIN_INFO_EMPTY; - } - if (!testConnection()) { - return NET_FAILED; - } - int uid = 0; - try { - uid = FinePassportManager.getInstance().login(userInfo, password); - } catch (Exception e) { - FineLoggerFactory.getLogger().error(e.getMessage(), e); - } + DesignerLoginClient client = new DesignerLoginClient(); + DesignerLoginResult result = client.login(userInfo, password); + int uid = result.getUid(); if (uid > 0) { - loginSuccess(MarketConfig.getInstance().getBbsUsername()); + closeWindow(); } return String.valueOf(uid); } @@ -191,17 +182,6 @@ public class LoginWebBridge { } } - /** - * 关闭窗口并且重新赋值 - * - * @param username 用户名 - */ - private void loginSuccess(String username) { - closeWindow(); - uiLabel.setText(username); - uiLabel.setBackground(LOGIN_BACKGROUND); - } - /** * 关闭QQ授权窗口 */ diff --git a/designer-base/src/main/java/com/fr/design/extra/PluginFromStorePane.java b/designer-base/src/main/java/com/fr/design/extra/PluginFromStorePane.java index 5f76dbafc..dbb6e3edb 100644 --- a/designer-base/src/main/java/com/fr/design/extra/PluginFromStorePane.java +++ b/designer-base/src/main/java/com/fr/design/extra/PluginFromStorePane.java @@ -1,6 +1,6 @@ package com.fr.design.extra; -import com.fr.config.MarketConfig; +import com.fr.design.DesignerEnvManager; import com.fr.design.dialog.FineJOptionPane; import com.fr.design.extra.tradition.callback.UpdateOnlineCallback; import com.fr.design.gui.frpane.UITabbedPane; @@ -190,10 +190,10 @@ public class PluginFromStorePane extends PluginAbstractLoadingViewPane config; private WebEngine webEngine; - private UILabel uiLabel; - private ExecutorService threadPoolExecutor = new ThreadPoolExecutor(COREPOOLSIZE, MAXPOOLSIZE, 0L, TimeUnit.MILLISECONDS, new LinkedBlockingQueue(COREPOOLSIZE), @@ -423,7 +420,7 @@ public class PluginWebBridge { */ public String getLoginInfo(final JSObject callback) { registerLoginInfo(callback); - return MarketConfig.getInstance().getBbsUsername(); + return DesignerEnvManager.getEnvManager().getDesignerLoginUsername(); } /** @@ -433,7 +430,7 @@ public class PluginWebBridge { */ public void registerLoginInfo(final JSObject callback) { JSCallback jsCallback = new JSCallback(PluginJavaFxExecutor.create(webEngine, callback)); - PluginOperateUtils.getLoginInfo(jsCallback, uiLabel); + PluginOperateUtils.getLoginInfo(jsCallback); } /** @@ -455,7 +452,7 @@ public class PluginWebBridge { SwingUtilities.invokeLater(new Runnable() { @Override public void run() { - UserLoginContext.fireLoginContextListener(); + UserLoginContext.fireLoginContextListener(DesignerLoginSource.NORMAL); } }); } @@ -526,10 +523,6 @@ public class PluginWebBridge { } } - public void setUILabel(UILabel uiLabel) { - this.uiLabel = uiLabel; - } - /** * 设计器端的用户登录 * @@ -546,7 +539,7 @@ public class PluginWebBridge { * 通过QQ登录后通知登录 */ public void ucsynLogin(long uid, String username, String password, final JSONObject callback) { - uiLabel.setText(username); + } /** @@ -554,8 +547,6 @@ public class PluginWebBridge { */ public void clearUserInfo() { MarketConfig.getInstance().setInShowBBsName(StringUtils.EMPTY); - FinePassportManager.getInstance().logout(); - uiLabel.setText(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Base_UnSignIn")); } public void getPackInfo(final JSObject callback){ diff --git a/designer-base/src/main/java/com/fr/design/extra/UserLoginContext.java b/designer-base/src/main/java/com/fr/design/extra/UserLoginContext.java index 354a9177f..6f41c3340 100644 --- a/designer-base/src/main/java/com/fr/design/extra/UserLoginContext.java +++ b/designer-base/src/main/java/com/fr/design/extra/UserLoginContext.java @@ -1,5 +1,6 @@ package com.fr.design.extra; +import com.fr.design.login.DesignerLoginSource; import java.util.ArrayList; /** @@ -11,9 +12,9 @@ public class UserLoginContext { /** * 触发登录框弹出的监听器 */ - public static void fireLoginContextListener() { + public static void fireLoginContextListener(DesignerLoginSource source) { for (LoginContextListener l : fireLoginContextListener) { - l.showLoginContext(); + l.showLoginContext(source); } } diff --git a/designer-base/src/main/java/com/fr/design/extra/WebViewDlgHelper.java b/designer-base/src/main/java/com/fr/design/extra/WebViewDlgHelper.java index 628adfec6..88bfdecbd 100644 --- a/designer-base/src/main/java/com/fr/design/extra/WebViewDlgHelper.java +++ b/designer-base/src/main/java/com/fr/design/extra/WebViewDlgHelper.java @@ -5,6 +5,7 @@ import com.fr.design.dialog.BasicPane; import com.fr.design.dialog.FineJOptionPane; import com.fr.design.dialog.UIDialog; import com.fr.design.gui.frpane.UITabbedPane; +import com.fr.design.login.utils.DesignerLoginUtils; import com.fr.design.mainframe.DesignerContext; import com.fr.general.CloudCenter; import com.fr.general.CommonIOUtils; @@ -206,6 +207,7 @@ public class WebViewDlgHelper { UIDialog dlg = new ShopDialog(DesignerContext.getDesignerFrame(), managerPane); PluginWebBridge.getHelper().setDialogHandle(dlg); dlg.setVisible(true); + DesignerLoginUtils.showPluginRemindOnFirstLaunch(); } catch (Exception e) { // ignored FineLoggerFactory.getLogger().error(e.getMessage(), e); diff --git a/designer-base/src/main/java/com/fr/design/extra/exe/PluginLoginExecutor.java b/designer-base/src/main/java/com/fr/design/extra/exe/PluginLoginExecutor.java index 1ce13f25c..7c6de0e06 100644 --- a/designer-base/src/main/java/com/fr/design/extra/exe/PluginLoginExecutor.java +++ b/designer-base/src/main/java/com/fr/design/extra/exe/PluginLoginExecutor.java @@ -2,6 +2,7 @@ package com.fr.design.extra.exe; import com.fr.design.extra.LoginWebBridge; import com.fr.design.extra.Process; +import com.fr.design.login.service.DesignerPassportManager; /** * @author vito @@ -34,7 +35,11 @@ public class PluginLoginExecutor implements Executor { @Override public void run(Process process) { - result = LoginWebBridge.getHelper().login(username, password); + int uid = DesignerPassportManager.getInstance().login(username, password); + if (uid > 0) { + LoginWebBridge.getHelper().closeWindow(); + } + result = String.valueOf(uid); } } }; diff --git a/designer-base/src/main/java/com/fr/design/login/AbstractDesignerSSO.java b/designer-base/src/main/java/com/fr/design/login/AbstractDesignerSSO.java new file mode 100644 index 000000000..80d6462fa --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/login/AbstractDesignerSSO.java @@ -0,0 +1,92 @@ +package com.fr.design.login; + +import com.fr.design.DesignerEnvManager; +import com.fr.design.actions.UpdateAction; +import com.fr.design.os.impl.SupportOSImpl; +import com.fr.design.utils.BrowseUtils; +import com.fr.general.CloudCenter; +import com.fr.general.log.MessageFormatter; +import com.fr.json.JSONObject; +import com.fr.log.FineLoggerFactory; +import com.fr.stable.StringUtils; +import com.fr.third.org.bouncycastle.util.encoders.Hex; +import java.awt.event.ActionEvent; +import java.security.SecureRandom; +import java.util.HashMap; +import java.util.Map; +import javax.crypto.Cipher; +import javax.crypto.spec.IvParameterSpec; +import javax.crypto.spec.SecretKeySpec; + +/** + * @author Lanlan + * @version 10.0 + * Created by Lanlan on 2021/6/7 + */ +public abstract class AbstractDesignerSSO extends UpdateAction { + + private static final String PRODUCT_FINEREPORT = "product-finereport"; + + private static final String KEY = "i7hP48WAcuTrmxfN"; + + @Override + public void actionPerformed(ActionEvent event) { + String url = getJumpUrl(); + if (!SupportOSImpl.DESIGNER_LOGIN.support()) { + BrowseUtils.browser(url); + return; + } + DesignerEnvManager manager = DesignerEnvManager.getEnvManager(); + int uid = manager.getDesignerLoginUid(); + if (uid > 0) { + String ssoUrl = CloudCenter.getInstance().acquireUrlByKind("designer.sso.api", "https://id.fanruan.com/api/app/?code={}&referrer={}"); + try { + String code = generateLoginCode(); + MessageFormatter.FormattingTuple tuple = MessageFormatter.arrayFormat(ssoUrl, new String[]{code, url}); + BrowseUtils.browser(tuple.getMessage()); + } catch (Exception e) { + BrowseUtils.browser(url); + FineLoggerFactory.getLogger().error(e.getMessage(), e); + } + } else { + boolean loginRemindBeforeJumpBBS = manager.isLoginRemindBeforeJumpBBS(); + if (loginRemindBeforeJumpBBS) { + Map params = new HashMap<>(); + params.put("bbsJumpUrl", url); + DesignerLoginHelper.showLoginDialog(DesignerLoginSource.BBS_JUMP, params); + manager.setLoginRemindBeforeJumpBBS(false); + } else { + BrowseUtils.browser(url); + } + } + } + + private String generateLoginCode() throws Exception { + DesignerEnvManager manager = DesignerEnvManager.getEnvManager(); + JSONObject jo = JSONObject.create(); + jo.put("uid", manager.getDesignerLoginUid()); + jo.put("username", manager.getDesignerLoginUsername()); + jo.put("source", PRODUCT_FINEREPORT); + byte[] iv = randomIv(); + return new String(Hex.encode(iv)) + encrypt(jo.toString(), KEY.getBytes(), iv); + } + + private static byte[] randomIv() { + byte[] salt = new byte[16]; + SecureRandom secureRandom = new SecureRandom(); + secureRandom.setSeed(System.currentTimeMillis()); + secureRandom.nextBytes(salt); + return salt; + } + + public static String encrypt(String content, byte[] key, byte[] iv) throws Exception { + SecretKeySpec secretKeySpec = new SecretKeySpec(key, "AES"); + Cipher cipher = Cipher.getInstance("AES/CTR/PKCS5Padding"); + IvParameterSpec ivParameterSpec = new IvParameterSpec(iv); + cipher.init(Cipher.ENCRYPT_MODE, secretKeySpec, ivParameterSpec); + byte[] resultBytes = cipher.doFinal(content.getBytes()); + return new String(Hex.encode(resultBytes)); + } + + public abstract String getJumpUrl(); +} diff --git a/designer-base/src/main/java/com/fr/design/login/DesignerLoginBridge.java b/designer-base/src/main/java/com/fr/design/login/DesignerLoginBridge.java new file mode 100644 index 000000000..4d0ba8a41 --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/login/DesignerLoginBridge.java @@ -0,0 +1,280 @@ +package com.fr.design.login; + +import com.fr.design.bridge.exec.JSBridge; +import com.fr.design.bridge.exec.JSCallback; +import com.fr.design.dialog.FineJOptionPane; +import com.fr.design.gui.ilable.ActionLabel; +import com.fr.design.gui.ilable.UILabel; +import com.fr.design.i18n.Toolkit; +import com.fr.design.layout.FRGUIPaneFactory; +import com.fr.design.locale.impl.BbsResetMark; +import com.fr.design.login.executor.DesignerLoginBrowserExecutor; +import com.fr.design.login.executor.DesignerLoginExecutor; +import com.fr.design.login.executor.DesignerSendCaptchaExecutor; +import com.fr.design.login.executor.DesignerSmsLoginExecutor; +import com.fr.design.login.executor.DesignerSmsRegisterExecutor; +import com.fr.design.login.task.DesignerLoginTaskWorker; +import com.fr.design.mainframe.toast.DesignerToastMsgUtil; +import com.fr.design.utils.BrowseUtils; +import com.fr.general.CloudCenter; +import com.fr.general.locale.LocaleCenter; +import com.fr.general.locale.LocaleMark; +import com.fr.log.FineLoggerFactory; +import com.teamdev.jxbrowser.chromium.Browser; +import com.teamdev.jxbrowser.chromium.JSFunction; +import com.teamdev.jxbrowser.chromium.JSObject; +import java.awt.Desktop; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.net.URI; +import java.util.Map; +import java.util.Set; +import javax.swing.JOptionPane; +import javax.swing.JPanel; +import javax.swing.SwingUtilities; + +/** + * @author Lanlan + * @version 10.0 + * Created by Lanlan on 2021/5/21 + */ +public class DesignerLoginBridge { + + private Map params; + + public static DesignerLoginBridge getBridge(Browser browser, Map params) { + return new DesignerLoginBridge(browser, params); + } + + private JSObject window; + + private DesignerLoginBridge(Browser browser, Map params) { + this.params = params; + this.window = browser.executeJavaScriptAndReturnValue("window").asObject(); + Set> entries = params.entrySet(); + for (Map.Entry entry : entries) { + this.window.setProperty(entry.getKey(), entry.getValue()); + } + } + + @JSBridge + public String i18nText(String key) { + return Toolkit.i18nText(key); + } + + @JSBridge + public void closeWindow(boolean loginSuccess) { + DesignerLoginSource source = DesignerLoginSource.valueOf(Integer.parseInt(params.get("designerLoginSource"))); + if (loginSuccess) { + if (source == DesignerLoginSource.GUIDE) { + DesignerToastMsgUtil.toastPrompt( + getHyperlinkPane( + com.fr.design.i18n.Toolkit.i18nText("Fine-Designer_Guide_Login_Success_Title"), + com.fr.design.i18n.Toolkit.i18nText("Fine-Designer_Guide_Login_Success_Hyperlink_Text"), + CloudCenter.getInstance().acquireUrlByKind("designer.premium.template", "https://market.fanruan.com/template") + ) + ); + } else if (source == DesignerLoginSource.BBS_JUMP) { + String bbsJumpUrl = params.get("bbsJumpUrl"); + BrowseUtils.browser(bbsJumpUrl); + } + DesignerLoginHelper.closeWindow(); + return; + } + if (source == DesignerLoginSource.SWITCH_ACCOUNT) { + DesignerLoginHelper.closeWindow(); + return; + } + if (source == DesignerLoginSource.BBS_JUMP) { + SwingUtilities.invokeLater(new Runnable() { + @Override + public void run() { + String bbsJumpUrl = params.get("bbsJumpUrl"); + String[] options = new String[]{ + com.fr.design.i18n.Toolkit.i18nText("Fine-Designer_BBS_Go_Directly"), + com.fr.design.i18n.Toolkit.i18nText("Fine-Designer_Login_Return_Login") + }; + int rv = FineJOptionPane.showConfirmDialog( + DesignerLoginHelper.getDialog(), + com.fr.design.i18n.Toolkit.i18nText("Fine-Designer_BBS_Quit_Tip"), + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Tool_Tips"), + JOptionPane.OK_CANCEL_OPTION, + JOptionPane.WARNING_MESSAGE, + null, + options, + options[1] + ); + if (rv == JOptionPane.YES_OPTION) { + BrowseUtils.browser(bbsJumpUrl); + DesignerLoginHelper.closeWindow(); + } + } + }); + } else { + SwingUtilities.invokeLater(new Runnable() { + @Override + public void run() { + String[] options = new String[]{ + com.fr.design.i18n.Toolkit.i18nText("Fine-Designer_Login_Quit"), + com.fr.design.i18n.Toolkit.i18nText("Fine-Designer_Login_Return_Login") + }; + int rv = FineJOptionPane.showConfirmDialog( + DesignerLoginHelper.getDialog(), + com.fr.design.i18n.Toolkit.i18nText("Fine-Designer_Login_Quit_Tip"), + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Tool_Tips"), + JOptionPane.OK_CANCEL_OPTION, + JOptionPane.WARNING_MESSAGE, + null, + options, + options[1] + ); + if (rv == JOptionPane.OK_OPTION) { + DesignerLoginHelper.closeWindow(); + } + } + }); + } + } + + /** + * 服务条款 + */ + @JSBridge + public void serviceHref() { + try { + String url = CloudCenter.getInstance().acquireUrlByKind("designer.bbs.service.terms", "https://bbs.fanruan.com/thread-102821-1-1.html"); + Desktop.getDesktop().browse(new URI(url)); + } catch (Exception e) { + FineLoggerFactory.getLogger().info(e.getMessage()); + } + } + + /** + * 忘记密码 + */ + @JSBridge + public void forgetHref() { + try { + LocaleMark resetMark = LocaleCenter.getMark(BbsResetMark.class); + Desktop.getDesktop().browse(new URI(resetMark.getValue())); + } catch (Exception e) { + FineLoggerFactory.getLogger().info(e.getMessage()); + } + } + + + /** + * 设计器端的用户登录 + * + * @param username 用户名 + * @param password 密码 + * @param callback 回调函数 + */ + @JSBridge + public void normalLogin(String username, String password, final JSFunction callback) { + DesignerLoginTaskWorker worker = new DesignerLoginTaskWorker<>( + new JSCallback(DesignerLoginBrowserExecutor.create(window, callback)), + new DesignerLoginExecutor(username, password)); + worker.execute(); + } + + /** + * 发送短信验证码 + * + * @param regionCode 区号 + * @param phone 手机 + * @param callback 回调函数 + */ + @JSBridge + public void sendCaptcha(String regionCode, String phone, final JSFunction callback) { + DesignerLoginTaskWorker worker = new DesignerLoginTaskWorker<>( + new JSCallback(DesignerLoginBrowserExecutor.create(window, callback)), + new DesignerSendCaptchaExecutor(regionCode, phone)); + worker.execute(); + } + + /** + * 设计器端的短信登录 + * + * @param regionCode 区号 + * @param phone 手机 + * @param code 验证码 + * @param callback 回调函数 + */ + @JSBridge + public void smsLogin(String regionCode, String phone, String code, final JSFunction callback) { + DesignerLoginTaskWorker worker = new DesignerLoginTaskWorker<>( + new JSCallback(DesignerLoginBrowserExecutor.create(window, callback)), + new DesignerSmsLoginExecutor(regionCode, phone, code)); + worker.execute(); + } + + /** + * 设计器端的用户注册 + * + * @param regionCode 区号 + * @param phone 手机 + * @param password 密码 + * @param regToken 注册令牌 + * @param callback 回调函数 + */ + @JSBridge + public void smsRegister(String regionCode, String phone, String password, String regToken, final JSFunction callback) { + DesignerLoginTaskWorker worker = new DesignerLoginTaskWorker<>( + new JSCallback(DesignerLoginBrowserExecutor.create(window, callback)), + new DesignerSmsRegisterExecutor(regionCode, phone, password, regToken)); + worker.execute(); + } + + /** + * 使用系统浏览器打开网页 + * + * @param url 要打开的网页 + */ + @JSBridge + public void openShopUrlAtWebBrowser(String url) { + if (Desktop.isDesktopSupported()) { + try { + //创建一个URI实例,注意不是URL + URI uri = URI.create(url); + //获取当前系统桌面扩展 + Desktop desktop = Desktop.getDesktop(); + //判断系统桌面是否支持要执行的功能 + if (desktop.isSupported(Desktop.Action.BROWSE)) { + //获取系统默认浏览器打开链接 + desktop.browse(uri); + } + } catch (Exception e) { + FineLoggerFactory.getLogger().error(e.getMessage(), e); + } + } + } + + /** + * 调整面板大小 + * + * @param width 宽 + * @param height 高 + */ + @JSBridge + public void resize(int width, int height) { + DesignerLoginHelper.getDialog().setSize(width, height); + } + + private JPanel getHyperlinkPane(String title, String hyperlinkText, String hyperlink) { + ActionLabel actionLabel = new ActionLabel(hyperlinkText); + actionLabel.addActionListener(new ActionListener() { + @Override + public void actionPerformed(ActionEvent e) { + try { + Desktop.getDesktop().browse(new URI(hyperlink)); + } catch (Exception ignore) { + } + } + }); + JPanel panel = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane(); + panel.add(new UILabel(title)); + panel.add(actionLabel); + return panel; + } +} diff --git a/designer-base/src/main/java/com/fr/design/login/DesignerLoginHelper.java b/designer-base/src/main/java/com/fr/design/login/DesignerLoginHelper.java new file mode 100644 index 000000000..93d7b1adf --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/login/DesignerLoginHelper.java @@ -0,0 +1,104 @@ +package com.fr.design.login; + +import com.fr.design.DesignerEnvManager; +import com.fr.design.dialog.UIDialog; +import com.fr.design.extra.WebViewDlgHelper; +import com.fr.design.i18n.Toolkit; +import com.fr.design.mainframe.DesignerContext; +import com.fr.design.os.impl.SupportOSImpl; +import com.fr.design.update.ui.dialog.UpdateMainDialog; +import com.fr.general.GeneralContext; +import java.awt.Dialog; +import java.awt.Frame; +import java.awt.Window; +import java.util.HashMap; +import java.util.Locale; +import java.util.Map; +import javax.swing.JOptionPane; +import javax.swing.WindowConstants; + +/** + * @author Lanlan + * @version 10.0 + * Created by Lanlan on 2021/5/21 + */ +public class DesignerLoginHelper { + + private static final String MAIN_RESOURCE_PATH = "/com/fr/design/login/login.html"; + private static final String JXBROWSER = "com.teamdev.jxbrowser.chromium.Browser"; + + private static UIDialog dialog = null; + + public static String getMainResourcePath() { + return MAIN_RESOURCE_PATH; + } + + public static UIDialog getDialog() { + return dialog; + } + + public static void showLoginDialog(DesignerLoginSource source) { + showLoginDialog(source, new HashMap<>()); + } + + public static void showLoginDialog(DesignerLoginSource source, Map params) { + showLoginDialog(source, params, DesignerContext.getDesignerFrame()); + } + + public static void showLoginDialog(DesignerLoginSource source, Map params, Window window) { + if (!SupportOSImpl.DESIGNER_LOGIN.support()) { + WebViewDlgHelper.createLoginDialog(window); + return; + } + boolean hasJxBrowser = true; + try { + Class.forName(JXBROWSER); + } catch (ClassNotFoundException e) { + hasJxBrowser = false; + } + if (hasJxBrowser) { + showLoginPane(source, params, window); + } else { + showUpdatePane(); + } + } + + private static void showLoginPane(DesignerLoginSource source, Map params, Window window) { + DesignerLoginPane designerLoginPane = new DesignerLoginPane(source, params); + if (dialog == null) { + if (window instanceof Dialog) { + dialog = new DesignerLoginShowDialog((Dialog) window, designerLoginPane); + } else if (window instanceof Frame) { + dialog = new DesignerLoginShowDialog((Frame) window, designerLoginPane); + } else { + return; + } + + } + dialog.setVisible(true); + } + + + private static void showUpdatePane() { + JOptionPane.showMessageDialog(DesignerContext.getDesignerFrame(), Toolkit.i18nText("Fine-Design_Update_Info_Login_Message")); + if (!GeneralContext.getLocale().equals(Locale.JAPANESE) && !GeneralContext.getLocale().equals(Locale.JAPAN) + && !Locale.getDefault().equals(Locale.JAPAN) && !Locale.getDefault().equals(Locale.JAPANESE)) { + UpdateMainDialog dialog = new UpdateMainDialog(DesignerContext.getDesignerFrame()); + dialog.setAutoUpdateAfterInit(); + dialog.showDialog(); + } + } + + public static void closeWindow() { + if (dialog != null) { + dialog.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE); + dialog.setVisible(false); + dialog = null; + } + } + + public static void main(String[] args) { + DesignerEnvManager.getEnvManager().setOpenDebug(true); + showLoginDialog(DesignerLoginSource.NORMAL); + } +} diff --git a/designer-base/src/main/java/com/fr/design/login/DesignerLoginPane.java b/designer-base/src/main/java/com/fr/design/login/DesignerLoginPane.java new file mode 100644 index 000000000..be5df3a84 --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/login/DesignerLoginPane.java @@ -0,0 +1,42 @@ +package com.fr.design.login; + +import com.fr.design.DesignerEnvManager; +import com.fr.design.dialog.BasicPane; +import com.fr.design.login.utils.DesignerLoginUtils; +import com.fr.design.ui.ModernUIPane; +import com.teamdev.jxbrowser.chromium.JSValue; +import com.teamdev.jxbrowser.chromium.events.ScriptContextAdapter; +import com.teamdev.jxbrowser.chromium.events.ScriptContextEvent; +import java.awt.BorderLayout; +import java.util.Map; + +/** + * @author Lanlan + * @version 10.0 + * Created by Lanlan on 2021/5/21 + */ +public class DesignerLoginPane extends BasicPane { + + @Override + protected String title4PopupWindow() { + return "DESIGNER_LOGIN"; + } + + public DesignerLoginPane(DesignerLoginSource source, Map params) { + params.put("designerLoginSource", String.valueOf(source.getSource())); + params.put("lastLoginType", String.valueOf(DesignerEnvManager.getEnvManager().getLastLoginType().getType())); + params.put("lastLoginAccount", DesignerEnvManager.getEnvManager().getLastLoginAccount()); + setLayout(new BorderLayout()); + ModernUIPane modernUIPane = new ModernUIPane.Builder<>() + .prepare(new ScriptContextAdapter() { + @Override + public void onScriptContextCreated(ScriptContextEvent event) { + JSValue window = event.getBrowser().executeJavaScriptAndReturnValue("window"); + window.asObject().setProperty("DesignerLoginHelper", DesignerLoginBridge.getBridge(event.getBrowser(), params)); + } + }) + .withEMB(DesignerLoginHelper.getMainResourcePath(), DesignerLoginUtils.renderMap()) + .build(); + add(modernUIPane, BorderLayout.CENTER); + } +} diff --git a/designer-base/src/main/java/com/fr/design/login/DesignerLoginShowDialog.java b/designer-base/src/main/java/com/fr/design/login/DesignerLoginShowDialog.java new file mode 100644 index 000000000..031ec4941 --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/login/DesignerLoginShowDialog.java @@ -0,0 +1,45 @@ +package com.fr.design.login; + +import com.fr.design.dialog.UIDialog; +import com.fr.design.utils.gui.GUICoreUtils; +import java.awt.BorderLayout; +import java.awt.Component; +import java.awt.Dialog; +import java.awt.Dimension; +import java.awt.Frame; +import javax.swing.JPanel; + +/** + * @author Lanlan + * @version 10.0 + * Created by Lanlan on 2021/5/21 + */ +public class DesignerLoginShowDialog extends UIDialog { + + private static final Dimension DEFAULT = new Dimension(422, 478); + + public DesignerLoginShowDialog(Frame frame, Component pane) { + super(frame); + init(pane); + } + + public DesignerLoginShowDialog(Dialog dialog, Component pane) { + super(dialog); + init(pane); + } + + private void init(Component pane) { + setUndecorated(true); + JPanel panel = (JPanel) getContentPane(); + panel.setLayout(new BorderLayout()); + add(pane, BorderLayout.CENTER); + setSize(DEFAULT); + GUICoreUtils.centerWindow(this); + setResizable(false); + } + + @Override + public void checkValid() throws Exception { + + } +} diff --git a/designer-base/src/main/java/com/fr/design/login/DesignerLoginSource.java b/designer-base/src/main/java/com/fr/design/login/DesignerLoginSource.java new file mode 100644 index 000000000..c369df1d2 --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/login/DesignerLoginSource.java @@ -0,0 +1,29 @@ +package com.fr.design.login; + +/** + * @author Lanlan + * @version 10.0 + * Created by Lanlan on 2021/6/7 + */ +public enum DesignerLoginSource { + NORMAL(0), GUIDE(1), SWITCH_ACCOUNT(2), BBS_JUMP(3), UNKNOWN(-1); + + private int source; + + DesignerLoginSource(int source) { + this.source = source; + } + + public int getSource() { + return source; + } + + public static DesignerLoginSource valueOf(int source) { + for(DesignerLoginSource value : DesignerLoginSource.values()) { + if(value.getSource() == source) { + return value; + } + } + return UNKNOWN; + } +} diff --git a/designer-base/src/main/java/com/fr/design/login/DesignerLoginType.java b/designer-base/src/main/java/com/fr/design/login/DesignerLoginType.java new file mode 100644 index 000000000..deba6ce6a --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/login/DesignerLoginType.java @@ -0,0 +1,29 @@ +package com.fr.design.login; + +/** + * @author Lanlan + * @version 10.0 + * Created by Lanlan on 2021/6/4 + */ +public enum DesignerLoginType { + NORMAL_LOGIN(0), SMS_LOGIN(1), UNKNOWN(-1); + + private int type; + + DesignerLoginType(int type) { + this.type = type; + } + + public int getType() { + return type; + } + + public static DesignerLoginType valueOf(int type) { + for(DesignerLoginType value : DesignerLoginType.values()) { + if(value.getType() == type) { + return value; + } + } + return UNKNOWN; + } +} diff --git a/designer-base/src/main/java/com/fr/design/login/bean/BBSAccountLogin.java b/designer-base/src/main/java/com/fr/design/login/bean/BBSAccountLogin.java new file mode 100644 index 000000000..b52fe5dec --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/login/bean/BBSAccountLogin.java @@ -0,0 +1,49 @@ +package com.fr.design.login.bean; + +/** + * @author Lanlan + * @version 10.0 + * Created by Lanlan on 2021/6/3 + */ +public class BBSAccountLogin { + + private int uid; + + private String username; + + private String appId; + + private String refreshToken; + + public int getUid() { + return uid; + } + + public void setUid(int uid) { + this.uid = uid; + } + + public String getUsername() { + return username; + } + + public void setUsername(String username) { + this.username = username; + } + + public String getAppId() { + return appId; + } + + public void setAppId(String appId) { + this.appId = appId; + } + + public String getRefreshToken() { + return refreshToken; + } + + public void setRefreshToken(String refreshToken) { + this.refreshToken = refreshToken; + } +} diff --git a/designer-base/src/main/java/com/fr/design/login/config/DesignerLoginConfigManager.java b/designer-base/src/main/java/com/fr/design/login/config/DesignerLoginConfigManager.java new file mode 100644 index 000000000..a0ab68109 --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/login/config/DesignerLoginConfigManager.java @@ -0,0 +1,226 @@ +package com.fr.design.login.config; + +import com.fr.design.login.DesignerLoginType; +import com.fr.stable.StringUtils; +import com.fr.stable.xml.XMLPrintWriter; +import com.fr.stable.xml.XMLReadable; +import com.fr.stable.xml.XMLWriter; +import com.fr.stable.xml.XMLableReader; + +/** + * @author Lanlan + * @version 10.0 + * Created by Lanlan on 2021/6/2 + */ +public class DesignerLoginConfigManager implements XMLReadable, XMLWriter { + + public static final String XML_TAG = "DesignerLoginConfigManager"; + + private static DesignerLoginConfigManager singleton; + + /** + * bbs uid + */ + private int uid = -1; + /** + * bbs 用户名 + */ + private String username = StringUtils.EMPTY; + /** + * bbs 应用Id + */ + private String appId = StringUtils.EMPTY; + /** + * bbs refreshToken + */ + private String refreshToken = StringUtils.EMPTY; + /** + * 登录引导页一个月内不再提醒 + */ + private boolean doNotRemind = false; + /** + * 登录引导页一个月内不再提醒 + */ + private long doNotRemindSelectedTime = -1L; + /** + * 设计器激活时间 + */ + private long designerActivatedTime = -1L; + /** + * bbs 上次登录时间 + */ + private long lastLoginTime = -1L; + /** + * bbs 上次登录方式 + */ + private DesignerLoginType lastLoginType = DesignerLoginType.UNKNOWN; + /** + * bbs 上次登录账号 + */ + private String lastLoginAccount = StringUtils.EMPTY; + /** + * 当前版本第一次启动 + */ + private boolean currentVersionFirstLaunch = true; + /** + * bbs跳转前的登录提醒 + */ + private boolean loginRemindBeforeJumpBBS = true; + /** + * 插件管理第一次启动时的提醒 + */ + private boolean pluginRemindOnFirstLaunch = true; + + private DesignerLoginConfigManager() { + + } + + public static DesignerLoginConfigManager getInstance() { + if (singleton == null) { + singleton = new DesignerLoginConfigManager(); + } + return singleton; + } + + @Override + public void readXML(XMLableReader reader) { + if (reader.isAttr()) { + this.setUid(reader.getAttrAsInt("uid", -1)); + this.setUsername(reader.getAttrAsString("username", StringUtils.EMPTY)); + this.setAppId(reader.getAttrAsString("appId", StringUtils.EMPTY)); + this.setRefreshToken(reader.getAttrAsString("refreshToken", StringUtils.EMPTY)); + this.setDoNotRemind(reader.getAttrAsBoolean("doNotRemind", false)); + this.setDoNotRemindSelectedTime(reader.getAttrAsLong("doNotRemindSelectedTime", -1L)); + this.setDesignerActivatedTime(reader.getAttrAsLong("designerActivatedTime", -1L)); + this.setLastLoginTime(reader.getAttrAsLong("lastLoginTime", -1L)); + this.setCurrentVersionFirstLaunch(reader.getAttrAsBoolean("currentVersionFirstLaunch", true)); + this.setLastLoginType(DesignerLoginType.valueOf(reader.getAttrAsInt("lastLoginType", -1))); + this.setLastLoginAccount(reader.getAttrAsString("lastLoginAccount", StringUtils.EMPTY)); + this.setLoginRemindBeforeJumpBBS(reader.getAttrAsBoolean("loginRemindBeforeJumpBBS", true)); + this.setPluginRemindOnFirstLaunch(reader.getAttrAsBoolean("pluginRemindOnFirstLaunch", true)); + } + } + + @Override + public void writeXML(XMLPrintWriter writer) { + writer.startTAG(XML_TAG); + writer.attr("uid", uid); + writer.attr("username", username); + writer.attr("appId", appId); + writer.attr("refreshToken", refreshToken); + writer.attr("doNotRemind", doNotRemind); + writer.attr("doNotRemindSelectedTime", doNotRemindSelectedTime); + writer.attr("designerActivatedTime", designerActivatedTime); + writer.attr("lastLoginTime", lastLoginTime); + writer.attr("currentVersionFirstLaunch", currentVersionFirstLaunch); + writer.attr("lastLoginType", lastLoginType.getType()); + writer.attr("lastLoginAccount", lastLoginAccount); + writer.attr("loginRemindBeforeJumpBBS", loginRemindBeforeJumpBBS); + writer.attr("pluginRemindOnFirstLaunch", pluginRemindOnFirstLaunch); + writer.end(); + } + + public int getUid() { + return uid; + } + + public void setUid(int uid) { + this.uid = uid; + } + + public String getUsername() { + return username; + } + + public void setUsername(String username) { + this.username = username; + } + + public String getAppId() { + return appId; + } + + public void setAppId(String appId) { + this.appId = appId; + } + + public String getRefreshToken() { + return refreshToken; + } + + public void setRefreshToken(String refreshToken) { + this.refreshToken = refreshToken; + } + + public long getDoNotRemindSelectedTime() { + return doNotRemindSelectedTime; + } + + public void setDoNotRemindSelectedTime(long doNotRemindSelectedTime) { + this.doNotRemindSelectedTime = doNotRemindSelectedTime; + } + + public boolean isDoNotRemind() { + return doNotRemind; + } + + public void setDoNotRemind(boolean doNotRemind) { + this.doNotRemind = doNotRemind; + } + + public long getDesignerActivatedTime() { + return designerActivatedTime; + } + + public void setDesignerActivatedTime(long designerActivatedTime) { + this.designerActivatedTime = designerActivatedTime; + } + + public long getLastLoginTime() { + return lastLoginTime; + } + + public void setLastLoginTime(long lastLoginTime) { + this.lastLoginTime = lastLoginTime; + } + + public boolean isCurrentVersionFirstLaunch() { + return currentVersionFirstLaunch; + } + + public void setCurrentVersionFirstLaunch(boolean currentVersionFirstLaunch) { + this.currentVersionFirstLaunch = currentVersionFirstLaunch; + } + + public DesignerLoginType getLastLoginType() { + return lastLoginType; + } + + public void setLastLoginType(DesignerLoginType lastLoginType) { + this.lastLoginType = lastLoginType; + } + + public String getLastLoginAccount() { + return lastLoginAccount; + } + + public void setLastLoginAccount(String lastLoginAccount) { + this.lastLoginAccount = lastLoginAccount; + } + + public boolean isLoginRemindBeforeJumpBBS() { + return loginRemindBeforeJumpBBS; + } + + public void setLoginRemindBeforeJumpBBS(boolean loginRemindBeforeJumpBBS) { + this.loginRemindBeforeJumpBBS = loginRemindBeforeJumpBBS; + } + + public boolean isPluginRemindOnFirstLaunch() { + return pluginRemindOnFirstLaunch; + } + + public void setPluginRemindOnFirstLaunch(boolean pluginRemindOnFirstLaunch) { + this.pluginRemindOnFirstLaunch = pluginRemindOnFirstLaunch; + } +} diff --git a/designer-base/src/main/java/com/fr/design/login/executor/DesignerLoginBrowserExecutor.java b/designer-base/src/main/java/com/fr/design/login/executor/DesignerLoginBrowserExecutor.java new file mode 100644 index 000000000..fa7fa6487 --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/login/executor/DesignerLoginBrowserExecutor.java @@ -0,0 +1,30 @@ +package com.fr.design.login.executor; + +import com.fr.design.bridge.exec.JSExecutor; +import com.teamdev.jxbrowser.chromium.JSFunction; +import com.teamdev.jxbrowser.chromium.JSObject; + +/** + * @author richie + * @version 10.0 + * Created by richie on 2019-04-18 + */ +public class DesignerLoginBrowserExecutor implements JSExecutor { + + public static DesignerLoginBrowserExecutor create(JSObject window, JSFunction callback) { + return new DesignerLoginBrowserExecutor(window, callback); + } + + private JSObject window; + private JSFunction callback; + + private DesignerLoginBrowserExecutor(JSObject window, JSFunction callback) { + this.window = window; + this.callback = callback; + } + + @Override + public void executor(String newValue) { + callback.invoke(window, newValue); + } +} diff --git a/designer-base/src/main/java/com/fr/design/login/executor/DesignerLoginExecutor.java b/designer-base/src/main/java/com/fr/design/login/executor/DesignerLoginExecutor.java new file mode 100644 index 000000000..6aff424d1 --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/login/executor/DesignerLoginExecutor.java @@ -0,0 +1,45 @@ +package com.fr.design.login.executor; + +import com.fr.design.extra.Process; +import com.fr.design.extra.exe.Command; +import com.fr.design.extra.exe.Executor; +import com.fr.design.login.service.DesignerPassportManager; + +/** + * @author Lanlan + * @version 10.0 + * Created by Lanlan on 2021/5/28 + */ +public class DesignerLoginExecutor implements Executor { + private String result = "[]"; + + private String username; + private String password; + + public DesignerLoginExecutor(String username, String password) { + this.username = username; + this.password = password; + } + + @Override + public String getTaskFinishMessage() { + return result; + } + + @Override + public Command[] getCommands() { + return new Command[]{ + new Command() { + @Override + public String getExecuteMessage() { + return null; + } + + @Override + public void run(Process process) { + result = String.valueOf(DesignerPassportManager.getInstance().login(username, password)); + } + } + }; + } +} diff --git a/designer-base/src/main/java/com/fr/design/login/executor/DesignerSendCaptchaExecutor.java b/designer-base/src/main/java/com/fr/design/login/executor/DesignerSendCaptchaExecutor.java new file mode 100644 index 000000000..0e64f33d2 --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/login/executor/DesignerSendCaptchaExecutor.java @@ -0,0 +1,45 @@ +package com.fr.design.login.executor; + +import com.fr.design.extra.Process; +import com.fr.design.extra.exe.Command; +import com.fr.design.extra.exe.Executor; +import com.fr.design.login.service.DesignerPassportManager; + +/** + * @author Lanlan + * @version 10.0 + * Created by Lanlan on 2021/5/28 + */ +public class DesignerSendCaptchaExecutor implements Executor { + private String result = "[]"; + + private String regionCode; + private String phone; + + public DesignerSendCaptchaExecutor(String regionCode, String phone) { + this.regionCode = regionCode; + this.phone = phone; + } + + @Override + public String getTaskFinishMessage() { + return result; + } + + @Override + public Command[] getCommands() { + return new Command[]{ + new Command() { + @Override + public String getExecuteMessage() { + return null; + } + + @Override + public void run(Process process) { + result = String.valueOf(DesignerPassportManager.getInstance().sendCaptcha(regionCode, phone)); + } + } + }; + } +} diff --git a/designer-base/src/main/java/com/fr/design/login/executor/DesignerSmsLoginExecutor.java b/designer-base/src/main/java/com/fr/design/login/executor/DesignerSmsLoginExecutor.java new file mode 100644 index 000000000..cfc2c115d --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/login/executor/DesignerSmsLoginExecutor.java @@ -0,0 +1,47 @@ +package com.fr.design.login.executor; + +import com.fr.design.extra.Process; +import com.fr.design.extra.exe.Command; +import com.fr.design.extra.exe.Executor; +import com.fr.design.login.service.DesignerPassportManager; + +/** + * @author Lanlan + * @version 10.0 + * Created by Lanlan on 2021/5/28 + */ +public class DesignerSmsLoginExecutor implements Executor { + private String result = "[]"; + + private String regionCode; + private String phone; + private String code; + + public DesignerSmsLoginExecutor(String regionCode, String phone, String code) { + this.regionCode = regionCode; + this.phone = phone; + this.code = code; + } + + @Override + public String getTaskFinishMessage() { + return result; + } + + @Override + public Command[] getCommands() { + return new Command[]{ + new Command() { + @Override + public String getExecuteMessage() { + return null; + } + + @Override + public void run(Process process) { + result = DesignerPassportManager.getInstance().smsLogin(regionCode, phone, code); + } + } + }; + } +} diff --git a/designer-base/src/main/java/com/fr/design/login/executor/DesignerSmsRegisterExecutor.java b/designer-base/src/main/java/com/fr/design/login/executor/DesignerSmsRegisterExecutor.java new file mode 100644 index 000000000..dde25c29c --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/login/executor/DesignerSmsRegisterExecutor.java @@ -0,0 +1,49 @@ +package com.fr.design.login.executor; + +import com.fr.design.extra.Process; +import com.fr.design.extra.exe.Command; +import com.fr.design.extra.exe.Executor; +import com.fr.design.login.service.DesignerPassportManager; + +/** + * @author Lanlan + * @version 10.0 + * Created by Lanlan on 2021/5/28 + */ +public class DesignerSmsRegisterExecutor implements Executor { + private String result = "[]"; + + private String regionCode; + private String phone; + private String password; + private String regToken; + + public DesignerSmsRegisterExecutor(String regionCode, String phone, String password, String regToken) { + this.regionCode = regionCode; + this.phone = phone; + this.password = password; + this.regToken = regToken; + } + + @Override + public String getTaskFinishMessage() { + return result; + } + + @Override + public Command[] getCommands() { + return new Command[]{ + new Command() { + @Override + public String getExecuteMessage() { + return null; + } + + @Override + public void run(Process process) { + result = String.valueOf(DesignerPassportManager.getInstance().smsRegister(regionCode, phone, password, regToken)); + } + } + }; + } +} diff --git a/designer-base/src/main/java/com/fr/design/login/guide/DesignerGuideBridge.java b/designer-base/src/main/java/com/fr/design/login/guide/DesignerGuideBridge.java new file mode 100644 index 000000000..9b9c561e7 --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/login/guide/DesignerGuideBridge.java @@ -0,0 +1,83 @@ +package com.fr.design.login.guide; + +import com.fr.design.DesignerEnvManager; +import com.fr.design.bridge.exec.JSBridge; +import com.fr.design.dialog.FineJOptionPane; +import com.fr.design.i18n.Toolkit; +import com.fr.design.login.DesignerLoginHelper; +import com.fr.design.login.DesignerLoginSource; +import com.teamdev.jxbrowser.chromium.Browser; +import com.teamdev.jxbrowser.chromium.JSObject; +import javax.swing.JOptionPane; +import javax.swing.SwingUtilities; + +/** + * @author Lanlan + * @version 10.0 + * Created by Lanlan on 2021/5/21 + */ +public class DesignerGuideBridge { + + public static DesignerGuideBridge getBridge(Browser browser) { + return new DesignerGuideBridge(browser); + } + + private JSObject window; + + private DesignerGuideBridge(Browser browser) { + this.window = browser.executeJavaScriptAndReturnValue("window").asObject(); + } + + @JSBridge + public String i18nText(String key) { + return Toolkit.i18nText(key); + } + + @JSBridge + public void closeWindow(boolean doNotRemind, boolean login) { + if (login) { + DesignerGuideHelper.closeWindow(); + DesignerLoginHelper.showLoginDialog(DesignerLoginSource.GUIDE); + checkDoNotRemind(doNotRemind); + } else { + SwingUtilities.invokeLater(new Runnable() { + @Override + public void run() { + String[] options = new String[]{ + com.fr.design.i18n.Toolkit.i18nText("Fine-Designer_Login_Quit"), + com.fr.design.i18n.Toolkit.i18nText("Fine-Designer_Login_Return_Login") + }; + int rv = FineJOptionPane.showConfirmDialog( + DesignerGuideHelper.getDialog(), + com.fr.design.i18n.Toolkit.i18nText("Fine-Designer_Login_Quit_Tip"), + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Tool_Tips"), + JOptionPane.YES_NO_OPTION, + JOptionPane.WARNING_MESSAGE, + null, + options, + options[1] + ); + if (rv == JOptionPane.YES_OPTION) { + DesignerGuideHelper.closeWindow(); + checkDoNotRemind(doNotRemind); + } else if (rv == JOptionPane.NO_OPTION) { + DesignerLoginHelper.showLoginDialog(DesignerLoginSource.GUIDE); + DesignerGuideHelper.closeWindow(); + checkDoNotRemind(doNotRemind); + } + } + }); + } + } + + /** + * 用户勾选了一个月内不再提醒 + */ + private void checkDoNotRemind(boolean doNotRemind) { + DesignerEnvManager manager = DesignerEnvManager.getEnvManager(); + manager.setDesignerLoginDoNotRemind(doNotRemind); + if (doNotRemind) { + manager.setDesignerLoginDoNotRemindSelectedTime(System.currentTimeMillis()); + } + } +} diff --git a/designer-base/src/main/java/com/fr/design/login/guide/DesignerGuideHelper.java b/designer-base/src/main/java/com/fr/design/login/guide/DesignerGuideHelper.java new file mode 100644 index 000000000..71e7f13e0 --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/login/guide/DesignerGuideHelper.java @@ -0,0 +1,114 @@ +package com.fr.design.login.guide; + +import com.fr.design.DesignerEnvManager; +import com.fr.design.dialog.UIDialog; +import com.fr.design.event.DesignerOpenedListener; +import com.fr.design.mainframe.DesignerContext; +import com.fr.design.os.impl.SupportOSImpl; +import javax.swing.WindowConstants; + +/** + * @author Lanlan + * @version 10.0 + * Created by Lanlan on 2021/5/21 + */ +public class DesignerGuideHelper { + + private static final String MAIN_RESOURCE_PATH = "/com/fr/design/login/guide.html"; + private static final String JXBROWSER = "com.teamdev.jxbrowser.chromium.Browser"; + private static final long ONE_WEEK = 7 * 24 * 3600 * 1000L; + private static final long ONE_MONTH = 30 * 24 * 3600 * 1000L; + private static final long SIX_MONTH = 6 * ONE_MONTH; + + private static UIDialog dialog = null; + + public static String getMainResourcePath() { + return MAIN_RESOURCE_PATH; + } + + public static UIDialog getDialog() { + return dialog; + } + + public static void prepareShowGuideDialog() { + if (!SupportOSImpl.DESIGNER_LOGIN.support()) { + return; + } + if (isActivatedForOneWeek()) { + if (isLogin() && !isLoginForSixMonths()) { + return; + } + if (selectedDoNotRemindInOneMonth()) { + return; + } + DesignerContext.getDesignerFrame().addDesignerOpenedListener(new DesignerOpenedListener() { + @Override + public void designerOpened() { + showGuideDialog(); + } + }); + } + } + + /** + * 激活满一周 + */ + private static boolean isActivatedForOneWeek() { + return (System.currentTimeMillis() - DesignerEnvManager.getEnvManager().getDesignerActivatedTime()) > ONE_WEEK; + } + + /** + * 已经登录 + */ + private static boolean isLogin() { + return DesignerEnvManager.getEnvManager().getDesignerLoginUid() > 0; + } + + /** + * 已经登录满六个月 + */ + private static boolean isLoginForSixMonths() { + return isLogin() && (System.currentTimeMillis() - DesignerEnvManager.getEnvManager().getDesignerLastLoginTime()) > SIX_MONTH; + } + + /** + * 一个月内不再提醒 + */ + private static boolean selectedDoNotRemindInOneMonth() { + return DesignerEnvManager.getEnvManager().isDesignerLoginDoNotRemind() + && (System.currentTimeMillis() - DesignerEnvManager.getEnvManager().getDesignerLoginDoNotRemindSelectedTime()) <= ONE_MONTH; + } + + private static void showGuideDialog() { + boolean hasJxBrowser = true; + try { + Class.forName(JXBROWSER); + } catch (ClassNotFoundException e) { + hasJxBrowser = false; + } + if (hasJxBrowser) { + showGuidePane(); + } + } + + private static void showGuidePane() { + DesignerGuidePane designerGuidePane = new DesignerGuidePane(); + if (dialog == null) { + dialog = new DesignerGuideShowDialog(DesignerContext.getDesignerFrame(), designerGuidePane); + } + dialog.setVisible(true); + } + + public static void closeWindow() { + if (dialog != null) { + dialog.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE); + dialog.setVisible(false); + dialog = null; + } + } + + public static void main(String[] args) { + DesignerEnvManager.getEnvManager().setOpenDebug(true); + showGuideDialog(); + } +} diff --git a/designer-base/src/main/java/com/fr/design/login/guide/DesignerGuidePane.java b/designer-base/src/main/java/com/fr/design/login/guide/DesignerGuidePane.java new file mode 100644 index 000000000..64bd316ef --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/login/guide/DesignerGuidePane.java @@ -0,0 +1,37 @@ +package com.fr.design.login.guide; + +import com.fr.design.dialog.BasicPane; +import com.fr.design.login.guide.utils.DesignerGuideUtils; +import com.fr.design.ui.ModernUIPane; +import com.teamdev.jxbrowser.chromium.JSValue; +import com.teamdev.jxbrowser.chromium.events.ScriptContextAdapter; +import com.teamdev.jxbrowser.chromium.events.ScriptContextEvent; +import java.awt.BorderLayout; + +/** + * @author Lanlan + * @version 10.0 + * Created by Lanlan on 2021/5/21 + */ +public class DesignerGuidePane extends BasicPane { + + @Override + protected String title4PopupWindow() { + return "DESIGNER_GUIDE"; + } + + public DesignerGuidePane() { + setLayout(new BorderLayout()); + ModernUIPane modernUIPane = new ModernUIPane.Builder<>() + .prepare(new ScriptContextAdapter() { + @Override + public void onScriptContextCreated(ScriptContextEvent event) { + JSValue window = event.getBrowser().executeJavaScriptAndReturnValue("window"); + window.asObject().setProperty("DesignerGuideHelper", DesignerGuideBridge.getBridge(event.getBrowser())); + } + }) + .withEMB(DesignerGuideHelper.getMainResourcePath(), DesignerGuideUtils.renderMap()) + .build(); + add(modernUIPane, BorderLayout.CENTER); + } +} diff --git a/designer-base/src/main/java/com/fr/design/login/guide/DesignerGuideShowDialog.java b/designer-base/src/main/java/com/fr/design/login/guide/DesignerGuideShowDialog.java new file mode 100644 index 000000000..f50c3c0b8 --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/login/guide/DesignerGuideShowDialog.java @@ -0,0 +1,35 @@ +package com.fr.design.login.guide; + +import com.fr.design.dialog.BasicPane; +import com.fr.design.dialog.UIDialog; +import com.fr.design.utils.gui.GUICoreUtils; +import java.awt.BorderLayout; +import java.awt.Dimension; +import java.awt.Frame; +import javax.swing.JPanel; + +/** + * @author Lanlan + * @version 10.0 + * Created by Lanlan on 2021/5/21 + */ +public class DesignerGuideShowDialog extends UIDialog { + + private static final Dimension DEFAULT = new Dimension(700, 577); + + public DesignerGuideShowDialog(Frame frame, BasicPane pane) { + super(frame); + setUndecorated(true); + JPanel panel = (JPanel) getContentPane(); + panel.setLayout(new BorderLayout()); + add(pane, BorderLayout.CENTER); + setSize(DEFAULT); + GUICoreUtils.centerWindow(this); + setResizable(false); + } + + @Override + public void checkValid() throws Exception { + + } +} diff --git a/designer-base/src/main/java/com/fr/design/login/guide/utils/DesignerGuideUtils.java b/designer-base/src/main/java/com/fr/design/login/guide/utils/DesignerGuideUtils.java new file mode 100644 index 000000000..81901b182 --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/login/guide/utils/DesignerGuideUtils.java @@ -0,0 +1,19 @@ +package com.fr.design.login.guide.utils; + +import com.fr.general.GeneralContext; +import java.util.HashMap; +import java.util.Map; + +/** + * @author Lanlan + * @version 10.0 + * Created by Lanlan on 2021/5/21 + */ +public class DesignerGuideUtils { + + public static Map renderMap() { + Map map4Tpl = new HashMap<>(); + map4Tpl.put("language", GeneralContext.getLocale().toString()); + return map4Tpl; + } +} diff --git a/designer-base/src/main/java/com/fr/design/login/service/DesignerLoginClient.java b/designer-base/src/main/java/com/fr/design/login/service/DesignerLoginClient.java new file mode 100644 index 000000000..8e68128c8 --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/login/service/DesignerLoginClient.java @@ -0,0 +1,167 @@ +package com.fr.design.login.service; + +import com.fr.general.CloudCenter; +import com.fr.general.http.HttpToolbox; +import com.fr.general.log.MessageFormatter; +import com.fr.json.JSON; +import com.fr.json.JSONFactory; +import com.fr.json.JSONObject; +import com.fr.log.FineLoggerFactory; +import com.fr.stable.StringUtils; +import com.fr.third.org.apache.commons.lang3.RandomStringUtils; +import java.util.HashMap; +import java.util.UUID; + +/** + * @author Lanlan + * @version 10.0 + * Created by Lanlan on 2021/5/28 + */ +public class DesignerLoginClient { + + private static final String LOGIN_API = CloudCenter.getInstance().acquireUrlByKind("designer.login.api", "http://api.shequ.fanruan.com/v1/user/login/"); + private static final String SEND_CAPTCHA_API = CloudCenter.getInstance().acquireUrlByKind("designer.send.captcha.api", "http://api.shequ.fanruan.com/v1/code/getsmscaptcha/?location={}&phone={}&smstype={}"); + private static final String SMS_LOGIN_API = CloudCenter.getInstance().acquireUrlByKind("designer.sms.login.api", "http://api.shequ.fanruan.com/v1/user/smslogin/"); + private static final String SMS_REGISTER_API = CloudCenter.getInstance().acquireUrlByKind("designer.sms.register.api", "http://api.shequ.fanruan.com/v1/user/register/"); + private static final String USERNAME = "username"; + private static final String PASSWORD = "password"; + private static final String SMS_TYPE_LOGIN_AND_REGISTER = "1"; + private static final String LOCATION = "location"; + private static final String PHONE = "phone"; + private static final String CODE = "code"; + private static final String STATUS = "status"; + private static final String DATA = "data"; + private static final String CLIENT = "client"; + private static final String UID = "uid"; + private static final String APP_ID = "appid"; + private static final String REFRESH_TOKEN = "refresh_token"; + private static final String REGISTER = "register"; + private static final String REG_TOKEN = "regtoken"; + private static final String REG_PHONE = "regphone"; + private static final String DEVICE = "device"; + private static final String REG_FROM = "reg_from"; + private static final String PRODUCT_FINEREPORT = "product-finereport"; + + /** + * 服务器内部错误 + */ + private static final int INTERNAL_ERROR = 0; + + /** + * 未知错误 + */ + private static final int UNKNOWN_ERROR = -3; + + /** + * 网络连接失败 + */ + private static final int NETWORK_CONNECTED_FAILED = -4; + + public DesignerLoginResult login(String username, String password) { + try { + HashMap params = new HashMap<>(); + params.put(USERNAME, username); + params.put(PASSWORD, password); + String result = HttpToolbox.post(LOGIN_API, params); + JSONObject response = JSONFactory.createJSON(JSON.OBJECT, result); + int status = response.optInt(STATUS); + if (status < 0) { + return DesignerLoginResult.create(status, StringUtils.EMPTY, StringUtils.EMPTY, StringUtils.EMPTY, false, StringUtils.EMPTY); + } + JSONObject data = response.optJSONObject(DATA); + if (data != null) { + JSONObject client = data.optJSONObject(CLIENT); + if (client != null) { + int uid = client.optInt(UID); + if (uid > 0) { + return DesignerLoginResult.create(uid, client.optString(USERNAME), client.optString(APP_ID), data.optString(REFRESH_TOKEN), false, StringUtils.EMPTY); + } + } + } + } catch (Exception e) { + FineLoggerFactory.getLogger().error(e.getMessage(), e); + return DesignerLoginResult.create(NETWORK_CONNECTED_FAILED, StringUtils.EMPTY, StringUtils.EMPTY, StringUtils.EMPTY, false, StringUtils.EMPTY); + } + return DesignerLoginResult.create(UNKNOWN_ERROR, StringUtils.EMPTY, StringUtils.EMPTY, StringUtils.EMPTY, false, StringUtils.EMPTY); + } + + public int sendCaptcha(String regionCode, String phone) { + try { + String url = MessageFormatter.arrayFormat(SEND_CAPTCHA_API, new String[]{regionCode, phone, SMS_TYPE_LOGIN_AND_REGISTER}).getMessage(); + String result = HttpToolbox.get(url); + JSONObject response = JSONFactory.createJSON(JSON.OBJECT, result); + return response.optInt(STATUS); + } catch (Exception e) { + FineLoggerFactory.getLogger().error(e.getMessage(), e); + } + return INTERNAL_ERROR; + } + + public DesignerLoginResult smsLogin(String regionCode, String phone, String code) { + try { + HashMap params = new HashMap<>(); + params.put(LOCATION, regionCode); + params.put(PHONE, phone); + params.put(CODE, code); + String result = HttpToolbox.post(SMS_LOGIN_API, params); + JSONObject response = JSONFactory.createJSON(JSON.OBJECT, result); + int status = response.optInt(STATUS); + if (status < 0) { + return DesignerLoginResult.create(status, StringUtils.EMPTY, StringUtils.EMPTY, StringUtils.EMPTY, false, StringUtils.EMPTY); + } + JSONObject data = response.optJSONObject(DATA); + if (data != null) { + boolean register = data.optBoolean(REGISTER); + if (register) { + String regToken = data.optString(REG_TOKEN); + if (regToken != null) { + return DesignerLoginResult.create(status, StringUtils.EMPTY, StringUtils.EMPTY, StringUtils.EMPTY, true, regToken); + } + } else { + JSONObject client = data.optJSONObject(CLIENT); + if (client != null) { + int uid = client.optInt(UID); + if (uid > 0) { + return DesignerLoginResult.create(uid, client.optString(USERNAME), client.optString(APP_ID), data.optString(REFRESH_TOKEN), false, StringUtils.EMPTY); + } + } + } + } + } catch (Exception e) { + FineLoggerFactory.getLogger().error(e.getMessage(), e); + } + return DesignerLoginResult.create(INTERNAL_ERROR, StringUtils.EMPTY, StringUtils.EMPTY, StringUtils.EMPTY, false, StringUtils.EMPTY); + } + + public DesignerLoginResult smsRegister(String regionCode, String phone, String password, String regToken) { + try { + HashMap params = new HashMap<>(); + params.put(USERNAME, RandomStringUtils.randomAlphabetic(8)); + params.put(PASSWORD, password); + params.put(REG_TOKEN, regToken); + params.put(LOCATION, regionCode); + params.put(REG_PHONE, phone); + params.put(DEVICE, PRODUCT_FINEREPORT); + params.put(REG_FROM, PRODUCT_FINEREPORT); + String result = HttpToolbox.post(SMS_REGISTER_API, params); + JSONObject response = JSONFactory.createJSON(JSON.OBJECT, result); + int status = response.optInt(STATUS); + if (status < 0) { + return DesignerLoginResult.create(status, StringUtils.EMPTY, StringUtils.EMPTY, StringUtils.EMPTY, false, StringUtils.EMPTY); + } + JSONObject data = response.optJSONObject(DATA); + if (data != null) { + JSONObject client = data.optJSONObject(CLIENT); + if (client != null) { + int uid = client.optInt(UID); + if (uid > 0) { + return DesignerLoginResult.create(uid, client.optString(USERNAME), client.optString(APP_ID), data.optString(REFRESH_TOKEN), false, StringUtils.EMPTY); + } + } + } + } catch (Exception e) { + FineLoggerFactory.getLogger().error(e.getMessage(), e); + } + return DesignerLoginResult.create(INTERNAL_ERROR, StringUtils.EMPTY, StringUtils.EMPTY, StringUtils.EMPTY, false, StringUtils.EMPTY); + } +} diff --git a/designer-base/src/main/java/com/fr/design/login/service/DesignerLoginResult.java b/designer-base/src/main/java/com/fr/design/login/service/DesignerLoginResult.java new file mode 100644 index 000000000..891285520 --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/login/service/DesignerLoginResult.java @@ -0,0 +1,82 @@ +package com.fr.design.login.service; + +/** + * @author Lanlan + * @version 10.0 + * Created by Lanlan on 2021/5/28 + */ +public class DesignerLoginResult { + + private int uid; + + private String username; + + private String appId; + + private String refreshToken; + + private boolean register; + + private String regToken; + + private DesignerLoginResult(int uid, String username, String appId, String refreshToken, boolean register, String regToken) { + this.uid = uid; + this.username = username; + this.appId = appId; + this.refreshToken = refreshToken; + this.regToken = regToken; + this.register = register; + } + + public static DesignerLoginResult create(int uid, String username, String appId, String refreshToken, boolean register, String regToken) { + return new DesignerLoginResult(uid, username, appId, refreshToken, register, regToken); + } + + public int getUid() { + return uid; + } + + public void setUid(int uid) { + this.uid = uid; + } + + public String getUsername() { + return username; + } + + public void setUsername(String username) { + this.username = username; + } + + public String getAppId() { + return appId; + } + + public void setAppId(String appId) { + this.appId = appId; + } + + public String getRefreshToken() { + return refreshToken; + } + + public void setRefreshToken(String refreshToken) { + this.refreshToken = refreshToken; + } + + public boolean isRegister() { + return register; + } + + public void setRegister(boolean register) { + this.register = register; + } + + public String getRegToken() { + return regToken; + } + + public void setRegToken(String regToken) { + this.regToken = regToken; + } +} diff --git a/designer-base/src/main/java/com/fr/design/login/service/DesignerPassportManager.java b/designer-base/src/main/java/com/fr/design/login/service/DesignerPassportManager.java new file mode 100644 index 000000000..446a30f8b --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/login/service/DesignerPassportManager.java @@ -0,0 +1,114 @@ +package com.fr.design.login.service; + +import com.fr.design.DesignerEnvManager; +import com.fr.design.login.DesignerLoginType; +import com.fr.design.upm.event.CertificateEvent; +import com.fr.event.EventDispatcher; +import com.fr.json.JSONObject; + +/** + * @author Lanlan + * @version 10.0 + * Created by Lanlan on 2021/5/28 + */ +public class DesignerPassportManager { + + private static final String STATUS = "status"; + private static final String REGISTER = "register"; + private static final String REG_TOKEN = "regtoken"; + + private static volatile DesignerPassportManager instance = null; + + public static DesignerPassportManager getInstance() { + if (instance == null) { + synchronized (DesignerPassportManager.class) { + if (instance == null) { + instance = new DesignerPassportManager(); + } + } + } + return instance; + } + + /** + * 账号密码登录帆软通行证 + * + * @param username 论坛账号 + * @param password 密码 + */ + public int login(String username, String password) { + DesignerLoginClient client = new DesignerLoginClient(); + DesignerLoginResult result = client.login(username, password); + int uid = result.getUid(); + if (uid > 0) { + saveUserInfo(uid, result.getUsername(), result.getAppId(), result.getRefreshToken(), DesignerLoginType.NORMAL_LOGIN, username); + } + return uid; + } + + /** + * 发送短信验证码 + * + * @param regionCode 区号 + * @param phone 手机 + */ + public int sendCaptcha(String regionCode, String phone) { + DesignerLoginClient client = new DesignerLoginClient(); + return client.sendCaptcha(regionCode, phone); + } + + /** + * 短信登录帆软通行证 + * + * @param regionCode 区号 + * @param phone 手机 + * @param code 验证码 + */ + public String smsLogin(String regionCode, String phone, String code) { + DesignerLoginClient client = new DesignerLoginClient(); + DesignerLoginResult result = client.smsLogin(regionCode, phone, code); + int uid = result.getUid(); + if (uid > 0) { + saveUserInfo(uid, result.getUsername(), result.getAppId(), result.getRefreshToken(), DesignerLoginType.SMS_LOGIN, regionCode + "-" + phone); + } + JSONObject jo = new JSONObject(); + jo.put(STATUS, result.getUid()); + jo.put(REGISTER, result.isRegister()); + jo.put(REG_TOKEN, result.getRegToken()); + return jo.toString(); + } + + /** + * 注册帆软通行证 + * + * @param regionCode 区号 + * @param phone 手机 + * @param password 密码 + * @param regToken 注册令牌 + */ + public int smsRegister(String regionCode, String phone, String password, String regToken) { + DesignerLoginClient client = new DesignerLoginClient(); + DesignerLoginResult result = client.smsRegister(regionCode, phone, password, regToken); + int uid = result.getUid(); + if (uid > 0) { + saveUserInfo(uid, result.getUsername(), result.getAppId(), result.getRefreshToken(), DesignerLoginType.SMS_LOGIN, regionCode + "-" + phone); + } + return uid; + } + + /** + * 保存登录信息 + */ + private void saveUserInfo(int uid, String username, String appId, String refreshToken, DesignerLoginType type, String account) { + DesignerEnvManager manager = DesignerEnvManager.getEnvManager(); + manager.setDesignerLoginUid(uid); + manager.setDesignerLoginUsername(username); + manager.setDesignerLoginAppId(appId); + manager.setDesignerLoginRefreshToken(refreshToken); + manager.setDesignerLastLoginTime(System.currentTimeMillis()); + manager.setLastLoginType(type); + manager.setLastLoginAccount(account); + DesignerEnvManager.getEnvManager().saveXMLFile(); + EventDispatcher.fire(CertificateEvent.LOGIN, username); + } +} diff --git a/designer-base/src/main/java/com/fr/design/login/socketio/LoginAuthServer.java b/designer-base/src/main/java/com/fr/design/login/socketio/LoginAuthServer.java new file mode 100644 index 000000000..d60b97d0f --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/login/socketio/LoginAuthServer.java @@ -0,0 +1,87 @@ +package com.fr.design.login.socketio; + +import com.fr.design.DesignerEnvManager; +import com.fr.design.login.DesignerLoginType; +import com.fr.design.login.bean.BBSAccountLogin; +import com.fr.design.upm.event.CertificateEvent; +import com.fr.event.EventDispatcher; +import com.fr.log.FineLoggerFactory; +import com.fr.third.socketio.AckRequest; +import com.fr.third.socketio.Configuration; +import com.fr.third.socketio.SocketIOClient; +import com.fr.third.socketio.SocketIOServer; +import com.fr.third.socketio.listener.DataListener; +import java.net.URLDecoder; + +/** + * @author Lanlan + * @version 10.0 + * Created by Lanlan on 2021/6/3 + */ +public class LoginAuthServer { + + private SocketIOServer server; + + private static final String HOSTNAME = "localhost"; + private static final int PORT = 41925; + + private static volatile LoginAuthServer instance = null; + + public static LoginAuthServer getInstance() { + if (instance == null) { + synchronized (LoginAuthServer.class) { + if (instance == null) { + instance = new LoginAuthServer(); + } + } + } + return instance; + } + + private LoginAuthServer() { + Configuration config = new Configuration(); + config.setHostname(HOSTNAME); + config.setPort(PORT); + server = new SocketIOServer(config); + initEventListener(); + } + + public void start() { + try { + server.start(); + } catch (Exception e) { + FineLoggerFactory.getLogger().error(e.getMessage(), e); + } + } + + public void stop() { + try { + server.stop(); + } catch (Exception e) { + FineLoggerFactory.getLogger().error(e.getMessage(), e); + } + } + + private void initEventListener() { + server.addEventListener("bbsAccountLogin", BBSAccountLogin.class, new DataListener() { + @Override + public void onData(SocketIOClient client, BBSAccountLogin data, AckRequest ackRequest) throws Exception { + // 保存登录信息到.FineReport100配置中 + int uid = data.getUid(); + if (uid > 0) { + String username = URLDecoder.decode(data.getUsername(), "UTF-8"); + DesignerEnvManager manager = DesignerEnvManager.getEnvManager(); + manager.setDesignerLoginUid(data.getUid()); + manager.setDesignerLoginUsername(username); + manager.setDesignerLoginAppId(data.getAppId()); + manager.setDesignerLoginRefreshToken(data.getRefreshToken()); + manager.setDesignerLastLoginTime(System.currentTimeMillis()); + manager.setLastLoginType(DesignerLoginType.NORMAL_LOGIN); + manager.setLastLoginAccount(username); + DesignerEnvManager.getEnvManager().saveXMLFile(); + EventDispatcher.fire(CertificateEvent.LOGIN, username); + } + } + }); + } +} diff --git a/designer-base/src/main/java/com/fr/design/login/task/DesignerLoginTaskWorker.java b/designer-base/src/main/java/com/fr/design/login/task/DesignerLoginTaskWorker.java new file mode 100644 index 000000000..df47d71f6 --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/login/task/DesignerLoginTaskWorker.java @@ -0,0 +1,51 @@ +package com.fr.design.login.task; + +import com.fr.design.bridge.exec.JSCallback; +import com.fr.design.bridge.exec.JSUtils; +import com.fr.design.extra.Process; +import com.fr.design.extra.exe.Command; +import com.fr.design.extra.exe.Executor; +import com.fr.stable.StringUtils; +import javax.swing.SwingWorker; + +/** + * @author Lanlan + * @version 10.0 + * Created by Lanlan on 2021/5/27 + */ +public class DesignerLoginTaskWorker extends SwingWorker { + + private Executor executor; + private JSCallback callback; + + public DesignerLoginTaskWorker(final JSCallback callback, final Executor executor) { + this.executor = executor; + this.callback = callback; + } + + @Override + protected V doInBackground() throws Exception { + Command[] commands = executor.getCommands(); + for (Command command : commands) { + String message = command.getExecuteMessage(); + if (StringUtils.isNotBlank(message)) { + publish(message); + } + command.run(new Process() { + @Override + public void process(String s) { + if (StringUtils.isNotBlank(s)) { + publish(JSUtils.trimText(s)); + } + } + }); + } + return null; + } + + @Override + protected void done() { + String result = executor.getTaskFinishMessage(); + callback.execute(result); + } +} diff --git a/designer-base/src/main/java/com/fr/design/login/utils/DesignerLoginUtils.java b/designer-base/src/main/java/com/fr/design/login/utils/DesignerLoginUtils.java new file mode 100644 index 000000000..0e1815c25 --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/login/utils/DesignerLoginUtils.java @@ -0,0 +1,35 @@ +package com.fr.design.login.utils; + +import com.fr.design.DesignerEnvManager; +import com.fr.design.mainframe.toast.DesignerToastMsgUtil; +import com.fr.general.GeneralContext; +import java.util.HashMap; +import java.util.Map; + +/** + * @author Lanlan + * @version 10.0 + * Created by Lanlan on 2021/5/21 + */ +public class DesignerLoginUtils { + + public static Map renderMap() { + Map map4Tpl = new HashMap<>(); + map4Tpl.put("language", GeneralContext.getLocale().toString()); + return map4Tpl; + } + + public static void showPluginRemindOnFirstLaunch() { + DesignerEnvManager manager = DesignerEnvManager.getEnvManager(); + int uid = manager.getDesignerLoginUid(); + if (uid > 0) { + boolean pluginRemindOnFirstLaunch = manager.isPluginRemindOnFirstLaunch(); + if (pluginRemindOnFirstLaunch) { + DesignerToastMsgUtil.toastWarning( + com.fr.design.i18n.Toolkit.i18nText("Fine-Designer_Plugin_Tip") + ); + manager.setPluginRemindOnFirstLaunch(false); + } + } + } +} diff --git a/designer-base/src/main/java/com/fr/design/mainframe/chart/info/ChartInfo.java b/designer-base/src/main/java/com/fr/design/mainframe/chart/info/ChartInfo.java index 262ccc877..7d687ac14 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/chart/info/ChartInfo.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/chart/info/ChartInfo.java @@ -5,7 +5,6 @@ import com.fr.chartx.attr.ChartProvider; import com.fr.chartx.config.info.AbstractConfig; import com.fr.chartx.config.info.ChartConfigInfo; import com.fr.chartx.config.info.constant.ConfigType; -import com.fr.config.MarketConfig; import com.fr.design.DesignModelAdapter; import com.fr.design.DesignerEnvManager; import com.fr.design.file.HistoryTemplateListCache; @@ -132,8 +131,8 @@ public class ChartInfo extends AbstractPointInfo implements Comparable chartConsumingMap = new HashMap<>(); - String username = MarketConfig.getInstance().getBbsUsername(); - String userId = String.valueOf(MarketConfig.getInstance().getBbsUid()); + String username = DesignerEnvManager.getEnvManager().getDesignerLoginUsername(); + String userId = String.valueOf(DesignerEnvManager.getEnvManager().getDesignerLoginUid()); String uuid = DesignerEnvManager.getEnvManager().getUUID(); String activityKey = DesignerEnvManager.getEnvManager().getActivationKey(); String chartId = chartProvider.getChartUuid(); diff --git a/designer-base/src/main/java/com/fr/design/os/impl/SupportOSImpl.java b/designer-base/src/main/java/com/fr/design/os/impl/SupportOSImpl.java index a25d2606a..949d77045 100644 --- a/designer-base/src/main/java/com/fr/design/os/impl/SupportOSImpl.java +++ b/designer-base/src/main/java/com/fr/design/os/impl/SupportOSImpl.java @@ -140,6 +140,16 @@ public enum SupportOSImpl implements SupportOS { public boolean support() { return JdkVersion.GE_9.support() && OperatingSystem.isMacos() && getMacOsVersion() >= BIG_SUR_VERSION_NUMBER; } + }, + + DESIGNER_LOGIN { + @Override + public boolean support() { + if (OperatingSystem.isLinux()) { + return false; + } + return !OperatingSystem.isMacos() || getMacOsVersion() < BIG_SUR_VERSION_NUMBER; + } }; private static final int BIG_SUR_VERSION_NUMBER = 16; diff --git a/designer-base/src/main/java/com/fr/design/ui/EmbProtocolHandler.java b/designer-base/src/main/java/com/fr/design/ui/EmbProtocolHandler.java index 04d2f0f85..b6bed69ca 100644 --- a/designer-base/src/main/java/com/fr/design/ui/EmbProtocolHandler.java +++ b/designer-base/src/main/java/com/fr/design/ui/EmbProtocolHandler.java @@ -80,6 +80,11 @@ public class EmbProtocolHandler implements ProtocolHandler { path = path.substring(4); } inputStream = IOUtils.readResource(path); + if (path.endsWith(".html")) { + String text = IOUtils.inputStream2String(inputStream, EncodeConstants.ENCODING_UTF_8); + text = TemplateUtils.renderParameter4Tpl(text, map); + return Assistant.inputStream2Response(new ByteArrayInputStream(text.getBytes(StandardCharsets.UTF_8)), path); + } return Assistant.inputStream2Response(inputStream, path); } } catch (Exception e) { diff --git a/designer-base/src/main/java/com/fr/design/ui/ModernUIPane.java b/designer-base/src/main/java/com/fr/design/ui/ModernUIPane.java index 745c56ea7..0afe2ccd3 100644 --- a/designer-base/src/main/java/com/fr/design/ui/ModernUIPane.java +++ b/designer-base/src/main/java/com/fr/design/ui/ModernUIPane.java @@ -174,6 +174,16 @@ public class ModernUIPane extends BasicPane { return this; } + /** + * 加载jar包中的资源 + * @param path 资源路径 + */ + public Builder withEMB(final String path, Map map) { + Assistant.setEmbProtocolHandler(pane.browser, new EmbProtocolHandler(map)); + pane.browser.loadURL("emb:" + path); + return this; + } + /** * 加载url指向的资源 * @param url 文件的地址 diff --git a/designer-base/src/main/java/com/fr/design/upm/UpmBridge.java b/designer-base/src/main/java/com/fr/design/upm/UpmBridge.java index 0c25281d5..1169b7c9a 100644 --- a/designer-base/src/main/java/com/fr/design/upm/UpmBridge.java +++ b/designer-base/src/main/java/com/fr/design/upm/UpmBridge.java @@ -1,9 +1,8 @@ package com.fr.design.upm; -import com.fr.base.passport.FinePassportManager; -import com.fr.config.MarketConfig; import com.fr.config.ServerPreferenceConfig; import com.fr.decision.webservice.v10.plugin.helper.category.impl.UpmResourceLoader; +import com.fr.design.DesignerEnvManager; import com.fr.design.bridge.exec.JSBridge; import com.fr.design.bridge.exec.JSCallback; import com.fr.design.extra.PluginOperateUtils; @@ -19,12 +18,10 @@ import com.fr.design.i18n.Toolkit; import com.fr.design.locale.impl.BbsRegisterMark; import com.fr.design.locale.impl.BbsResetMark; import com.fr.design.locale.impl.BbsSpaceMark; -import com.fr.design.upm.event.CertificateEvent; import com.fr.design.upm.event.DownloadEvent; import com.fr.design.upm.exec.UpmBrowserExecutor; import com.fr.design.upm.task.UpmTaskWorker; import com.fr.event.EventDispatcher; -import com.fr.general.CloudCenter; import com.fr.general.GeneralUtils; import com.fr.general.locale.LocaleCenter; import com.fr.general.locale.LocaleMark; @@ -379,7 +376,7 @@ public class UpmBridge { @JSBridge public String getLoginInfo(final JSFunction callback) { registerLoginInfo(callback); - return MarketConfig.getInstance().getBbsUsername(); + return DesignerEnvManager.getEnvManager().getDesignerLoginUsername(); } /** @@ -390,13 +387,11 @@ public class UpmBridge { @JSBridge public void registerLoginInfo(final JSFunction callback) { JSCallback jsCallback = new JSCallback(UpmBrowserExecutor.create(window, callback)); - String username = MarketConfig.getInstance().getBbsUsername(); + String username = DesignerEnvManager.getEnvManager().getDesignerLoginUsername(); if (StringUtils.isEmpty(username)) { jsCallback.execute(StringUtils.EMPTY); - EventDispatcher.fire(CertificateEvent.LOGOUT, StringUtils.EMPTY); } else { jsCallback.execute(username); - EventDispatcher.fire(CertificateEvent.LOGIN, username); } } @@ -417,10 +412,9 @@ public class UpmBridge { /** * 清除用户信息 */ + @JSBridge public void clearUserInfo() { - MarketConfig.getInstance().setInShowBBsName(StringUtils.EMPTY); - FinePassportManager.getInstance().logout(); - EventDispatcher.fire(CertificateEvent.LOGOUT, StringUtils.EMPTY); + } /** diff --git a/designer-base/src/main/java/com/fr/design/upm/UpmFinder.java b/designer-base/src/main/java/com/fr/design/upm/UpmFinder.java index 36e558d17..74bbcb73f 100644 --- a/designer-base/src/main/java/com/fr/design/upm/UpmFinder.java +++ b/designer-base/src/main/java/com/fr/design/upm/UpmFinder.java @@ -5,6 +5,7 @@ import com.fr.decision.webservice.v10.plugin.helper.category.impl.UpmResourceLoa import com.fr.design.dialog.FineJOptionPane; import com.fr.design.dialog.UIDialog; import com.fr.design.i18n.Toolkit; +import com.fr.design.login.utils.DesignerLoginUtils; import com.fr.design.mainframe.DesignerContext; import com.fr.design.plugin.DesignerPluginContext; import com.fr.design.update.ui.dialog.UpdateMainDialog; @@ -97,6 +98,7 @@ public class UpmFinder { dialog = new UpmShowDialog(DesignerContext.getDesignerFrame(), upmPane); } dialog.setVisible(true); + DesignerLoginUtils.showPluginRemindOnFirstLaunch(); } } diff --git a/designer-base/src/main/java/com/fr/design/upm/event/CertificateEvent.java b/designer-base/src/main/java/com/fr/design/upm/event/CertificateEvent.java index 571076844..f3c2a4bf4 100644 --- a/designer-base/src/main/java/com/fr/design/upm/event/CertificateEvent.java +++ b/designer-base/src/main/java/com/fr/design/upm/event/CertificateEvent.java @@ -7,6 +7,6 @@ import com.fr.event.Event; * @version 10.0 * Created by richie on 2019-04-18 */ -public enum CertificateEvent implements Event { - LOGIN,LOGOUT +public enum CertificateEvent implements Event { + LOGIN, LOGOUT } diff --git a/designer-base/src/main/resources/com/fr/design/i18n/dimension_ko_KR.properties b/designer-base/src/main/resources/com/fr/design/i18n/dimension_ko_KR.properties index 4ebb3e1ed..c00c5eb62 100644 --- a/designer-base/src/main/resources/com/fr/design/i18n/dimension_ko_KR.properties +++ b/designer-base/src/main/resources/com/fr/design/i18n/dimension_ko_KR.properties @@ -1,4 +1,4 @@ com.fr.design.mainframe.check.CheckButton=230*118 com.fr.design.mainframe.check.CheckFontInfoDialog.collapse=490*185 -com.fr.design.mainframe.check.CheckFontInfoDialog.messageWithLink=490*31 +com.fr.design.mainframe.check.CheckFontInfoDialog.messageWithLink=490*35 com.fr.design.mainframe.check.CheckFontInfoDialog.unfold=490*280 \ No newline at end of file diff --git a/designer-base/src/main/resources/com/fr/design/login/designer_login.properties b/designer-base/src/main/resources/com/fr/design/login/designer_login.properties new file mode 100644 index 000000000..853adb77d --- /dev/null +++ b/designer-base/src/main/resources/com/fr/design/login/designer_login.properties @@ -0,0 +1,2 @@ +VERSION=1.0 +ENV_VERSION=10.0 diff --git a/designer-base/src/main/resources/com/fr/design/login/guide.css b/designer-base/src/main/resources/com/fr/design/login/guide.css new file mode 100644 index 000000000..194296aa0 --- /dev/null +++ b/designer-base/src/main/resources/com/fr/design/login/guide.css @@ -0,0 +1,52 @@ +.background-login-close { + color: white !important; + font-weight: bold; + font-size: 14px; +} +.background-guide-close { + color: black !important; + font-weight: bold; + font-size: 16px; +} +.background-login-loading { + background: url(./img/login_loading.gif) no-repeat center center; +} +.background-plugin-need-update { + background: url(./img/icon_new.png) no-repeat center center; +} +.background-plugin-cant-use { + background: url(./img/icon_cantuse.png) no-repeat center center; +} +.background-plugin-is-disable { + background: url(./img/icon_disable.png) no-repeat center center; +} +.background-plugin-is-disable-new { + background: url(./img/icon_disable-new.png) no-repeat center center; +} +.background-plugin-selected { + background: url(./img/icon_marked.png) no-repeat center center; +} +.background-shop-title-close { + background: url(./img/icon_close40x40_normal.svg) no-repeat center center; +} +.background-dialog-confirm { + background: url(./img/warning.png) no-repeat center center; + background-size: contain; +} +.background-close-button { + background: url(./img/icon_close9x9_normal.png) no-repeat center center; +} +.background-close-button:hover { + background: url(./img/icon_close9x9_hover.png) no-repeat center center; +} +.designer-login-guide { + background: url(./img/login_guide.png) no-repeat center center; + background-size: cover; +} +.designer-guide-login-button { + font-size: 14px; + color: white; + border-radius: 4px; + background-color: #3685F2; +} + diff --git a/designer-base/src/main/resources/com/fr/design/login/guide.html b/designer-base/src/main/resources/com/fr/design/login/guide.html new file mode 100644 index 000000000..aeb50ce18 --- /dev/null +++ b/designer-base/src/main/resources/com/fr/design/login/guide.html @@ -0,0 +1,25 @@ + + + + + + title + + + + + + + + + \ No newline at end of file diff --git a/designer-base/src/main/resources/com/fr/design/login/guide.js b/designer-base/src/main/resources/com/fr/design/login/guide.js new file mode 100644 index 000000000..2dc054d2d --- /dev/null +++ b/designer-base/src/main/resources/com/fr/design/login/guide.js @@ -0,0 +1 @@ +!function(e){var t={};function i(o){if(t[o])return t[o].exports;var n=t[o]={i:o,l:!1,exports:{}};return e[o].call(n.exports,n,n.exports,i),n.l=!0,n.exports}i.m=e,i.c=t,i.d=function(e,t,o){i.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:o})},i.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.t=function(e,t){if(1&t&&(e=i(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var o=Object.create(null);if(i.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)i.d(o,n,function(t){return e[t]}.bind(null,n));return o},i.n=function(e){var t=e&&e.__esModule?function(){return e["default"]}:function(){return e};return i.d(t,"a",t),t},i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},i.p="",i(i.s=1)}([function(e,t,i){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,i,o){o===undefined&&(o=i),Object.defineProperty(e,o,{enumerable:!0,get:function(){return t[i]}})}:function(e,t,i,o){o===undefined&&(o=i),e[o]=t[i]}),n=this&&this.__exportStar||function(e,t){for(var i in e)"default"===i||t.hasOwnProperty(i)||o(t,e,i)};Object.defineProperty(t,"__esModule",{value:!0}),n(i(2),t)},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=i(0),n=i(3);BI.addI18n(Store.i18n),BI.createWidget({type:o.Vertical,element:"body",items:[{type:n["default"]}]})},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ListView=t.VirtualGroup=t.LeftRightVerticalAdapt=t.Left=t.Horizontal=t.Vertical=t.Absolute=t.Layout=t.Htape=t.CenterAdapt=t.Vtape=t.HorizontalAdapt=t.VerticalAdapt=t.BubbleCombo=t.Img=t.Tab=t.SingleSelectInsertCombo=t.SingleSelectRadioItem=t.MultiTreePopupView=t.Editor=t.NicEditor=t.RichEditor=t.MultiTreeCombo=t.DynamicDateTimeCombo=t.DynamicDateCombo=t.BarPopOver=t.MultiSelectItem=t.TextAreaEditor=t.AllValueChooserCombo=t.ButtonGroup=t.MultiSelectInsertCombo=t.TextEditor=t.Button=t.SignEditor=t.MultiFileEditor=t.SmallTextEditor=t.HtmlLabel=t.Label=t.DownListCombo=t.TextButton=t.IconChangeButton=t.IconButton=t.IconTextIconItem=t.IconTextItem=void 0,t.IconTextItem="bi.icon_text_item",t.IconTextIconItem="bi.icon_text_icon_item",t.IconButton="bi.icon_button",t.IconChangeButton="bi.icon_change_button",t.TextButton="bi.text_button",t.DownListCombo="bi.down_list_combo",t.Label="bi.label",t.HtmlLabel="bi.html_label",t.SmallTextEditor="bi.small_text_editor",t.MultiFileEditor="bi.multifile_editor",t.SignEditor="bi.sign_editor",t.Button="bi.button",t.TextEditor="bi.text_editor",t.MultiSelectInsertCombo="bi.multi_select_insert_combo",t.ButtonGroup="bi.button_group",t.AllValueChooserCombo="bi.all_value_chooser_combo",t.TextAreaEditor="bi.textarea_editor",t.MultiSelectItem="bi.multi_select_item",t.BarPopOver="bi.bar_popover",t.DynamicDateCombo="bi.dynamic_date_combo",t.DynamicDateTimeCombo="bi.dynamic_date_time_combo",t.MultiTreeCombo="bi.multi_tree_combo",t.RichEditor="bi.rich_editor",t.NicEditor="bi.nic_editor",t.Editor="bi.editor",t.MultiTreePopupView="bi.multi_tree_popup_view",t.SingleSelectRadioItem="bi.single_select_radio_item",t.SingleSelectInsertCombo="bi.single_select_insert_combo",t.Tab="bi.tab",t.Img="bi.img",t.BubbleCombo="bi.bubble_combo",t.VerticalAdapt="bi.vertical_adapt",t.HorizontalAdapt="bi.horizontal_adapt",t.Vtape="bi.vtape",t.CenterAdapt="bi.center_adapt",t.Htape="bi.htape",t.Layout="bi.layout",t.Absolute="bi.absolute",t.Vertical="bi.vertical",t.Horizontal="bi.horizontal",t.Left="bi.left",t.LeftRightVerticalAdapt="bi.left_right_vertical_adapt",t.VirtualGroup="bi.virtual_group",t.ListView="bi.list_view"},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Widget=t.className=void 0;var o=i(0);i(4);var n=i(5),r=i(6);t.className="designer.login.guide",t.Widget=BI.inherit(BI.Widget,{props:{baseCls:"designer-login-guide",width:700,height:557},_store:function(){return BI.Models.getModel(r["default"])},render:function(){var e=this;return{type:o.Vertical,items:[{el:{type:o.HorizontalAdapt,items:[{type:o.TextButton,text:String.fromCharCode(10005),cls:"background-guide-close",width:16,height:16,rgap:18,tgap:18,handler:function(){n["default"].closeWindow(e.model.doNotRemind,!1)}}]}},{el:{type:o.Vertical,items:[{type:o.Horizontal,items:[{type:o.MultiSelectItem,lgap:33,width:240,text:BI.i18nText("Designer-Guide_Do_Not_Remind"),handler:function(){e.store.setDoNotRemind(this.isSelected())}},{type:o.TextButton,width:122,height:38,cls:"designer-guide-login-button",text:BI.i18nText("Designer-Guide_Login"),handler:function(){n["default"].closeWindow(e.model.doNotRemind,!0)}}]}]},tgap:460}]}}}),BI.shortcut(t.className,t.Widget),t["default"]=t.className},function(e,t,i){},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=window.DesignerGuideHelper,n=function(){function e(){}return e.prototype.closeWindow=function(e,t){o&&o.closeWindow(e,t)},e}();t["default"]=new n},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});BI.model("designer.login.guide.model",BI.inherit(Fix.Model,{state:function(){return{doNotRemind:!1}},setDoNotRemind:function(e){this.model.doNotRemind=e}})),t["default"]="designer.login.guide.model"}]); \ No newline at end of file diff --git a/designer-base/src/main/resources/com/fr/design/login/img/icon_cantuse.png b/designer-base/src/main/resources/com/fr/design/login/img/icon_cantuse.png new file mode 100644 index 000000000..278f2c09b Binary files /dev/null and b/designer-base/src/main/resources/com/fr/design/login/img/icon_cantuse.png differ diff --git a/designer-base/src/main/resources/com/fr/design/login/img/icon_close40x40_normal.svg b/designer-base/src/main/resources/com/fr/design/login/img/icon_close40x40_normal.svg new file mode 100644 index 000000000..cc6e8d233 --- /dev/null +++ b/designer-base/src/main/resources/com/fr/design/login/img/icon_close40x40_normal.svg @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + + + diff --git a/designer-base/src/main/resources/com/fr/design/login/img/icon_close9x9_hover.png b/designer-base/src/main/resources/com/fr/design/login/img/icon_close9x9_hover.png new file mode 100644 index 000000000..91a39fe96 Binary files /dev/null and b/designer-base/src/main/resources/com/fr/design/login/img/icon_close9x9_hover.png differ diff --git a/designer-base/src/main/resources/com/fr/design/login/img/icon_close9x9_normal.png b/designer-base/src/main/resources/com/fr/design/login/img/icon_close9x9_normal.png new file mode 100644 index 000000000..198afc837 Binary files /dev/null and b/designer-base/src/main/resources/com/fr/design/login/img/icon_close9x9_normal.png differ diff --git a/designer-base/src/main/resources/com/fr/design/login/img/icon_close_normal.png b/designer-base/src/main/resources/com/fr/design/login/img/icon_close_normal.png new file mode 100644 index 000000000..01855d563 Binary files /dev/null and b/designer-base/src/main/resources/com/fr/design/login/img/icon_close_normal.png differ diff --git a/designer-base/src/main/resources/com/fr/design/login/img/icon_disable-new.png b/designer-base/src/main/resources/com/fr/design/login/img/icon_disable-new.png new file mode 100644 index 000000000..f645f8a7d Binary files /dev/null and b/designer-base/src/main/resources/com/fr/design/login/img/icon_disable-new.png differ diff --git a/designer-base/src/main/resources/com/fr/design/login/img/icon_disable.png b/designer-base/src/main/resources/com/fr/design/login/img/icon_disable.png new file mode 100644 index 000000000..2d34fd865 Binary files /dev/null and b/designer-base/src/main/resources/com/fr/design/login/img/icon_disable.png differ diff --git a/designer-base/src/main/resources/com/fr/design/login/img/icon_marked.png b/designer-base/src/main/resources/com/fr/design/login/img/icon_marked.png new file mode 100644 index 000000000..7f16d5e39 Binary files /dev/null and b/designer-base/src/main/resources/com/fr/design/login/img/icon_marked.png differ diff --git a/designer-base/src/main/resources/com/fr/design/login/img/icon_new.png b/designer-base/src/main/resources/com/fr/design/login/img/icon_new.png new file mode 100644 index 000000000..eb240987b Binary files /dev/null and b/designer-base/src/main/resources/com/fr/design/login/img/icon_new.png differ diff --git a/designer-base/src/main/resources/com/fr/design/login/img/login_guide.png b/designer-base/src/main/resources/com/fr/design/login/img/login_guide.png new file mode 100644 index 000000000..cdc7e085f Binary files /dev/null and b/designer-base/src/main/resources/com/fr/design/login/img/login_guide.png differ diff --git a/designer-base/src/main/resources/com/fr/design/login/img/login_loading.gif b/designer-base/src/main/resources/com/fr/design/login/img/login_loading.gif new file mode 100644 index 000000000..5bb90fd6a Binary files /dev/null and b/designer-base/src/main/resources/com/fr/design/login/img/login_loading.gif differ diff --git a/designer-base/src/main/resources/com/fr/design/login/img/product-01.png b/designer-base/src/main/resources/com/fr/design/login/img/product-01.png new file mode 100644 index 000000000..8a6a096d9 Binary files /dev/null and b/designer-base/src/main/resources/com/fr/design/login/img/product-01.png differ diff --git a/designer-base/src/main/resources/com/fr/design/login/img/warning.png b/designer-base/src/main/resources/com/fr/design/login/img/warning.png new file mode 100644 index 000000000..9e14cb51b Binary files /dev/null and b/designer-base/src/main/resources/com/fr/design/login/img/warning.png differ diff --git a/designer-base/src/main/resources/com/fr/design/login/lib/bluebird.js b/designer-base/src/main/resources/com/fr/design/login/lib/bluebird.js new file mode 100644 index 000000000..0b823f7ce --- /dev/null +++ b/designer-base/src/main/resources/com/fr/design/login/lib/bluebird.js @@ -0,0 +1,5619 @@ +/* @preserve + * The MIT License (MIT) + * + * Copyright (c) 2013-2017 Petka Antonov + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * + */ +/** + * bluebird build version 3.5.0 + * Features enabled: core, race, call_get, generators, map, nodeify, promisify, props, reduce, settle, some, using, timers, filter, any, each +*/ +!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var f;"undefined"!=typeof window?f=window:"undefined"!=typeof global?f=global:"undefined"!=typeof self&&(f=self),f.Promise=e()}}(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof _dereq_=="function"&&_dereq_;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof _dereq_=="function"&&_dereq_;for(var o=0;o 0) { + var fn = queue.shift(); + if (typeof fn !== "function") { + fn._settlePromises(); + continue; + } + var receiver = queue.shift(); + var arg = queue.shift(); + fn.call(receiver, arg); + } +}; + +Async.prototype._drainQueues = function () { + this._drainQueue(this._normalQueue); + this._reset(); + this._haveDrainedQueues = true; + this._drainQueue(this._lateQueue); +}; + +Async.prototype._queueTick = function () { + if (!this._isTickUsed) { + this._isTickUsed = true; + this._schedule(this.drainQueues); + } +}; + +Async.prototype._reset = function () { + this._isTickUsed = false; +}; + +module.exports = Async; +module.exports.firstLineError = firstLineError; + +},{"./queue":26,"./schedule":29,"./util":36}],3:[function(_dereq_,module,exports){ +"use strict"; +module.exports = function(Promise, INTERNAL, tryConvertToPromise, debug) { +var calledBind = false; +var rejectThis = function(_, e) { + this._reject(e); +}; + +var targetRejected = function(e, context) { + context.promiseRejectionQueued = true; + context.bindingPromise._then(rejectThis, rejectThis, null, this, e); +}; + +var bindingResolved = function(thisArg, context) { + if (((this._bitField & 50397184) === 0)) { + this._resolveCallback(context.target); + } +}; + +var bindingRejected = function(e, context) { + if (!context.promiseRejectionQueued) this._reject(e); +}; + +Promise.prototype.bind = function (thisArg) { + if (!calledBind) { + calledBind = true; + Promise.prototype._propagateFrom = debug.propagateFromFunction(); + Promise.prototype._boundValue = debug.boundValueFunction(); + } + var maybePromise = tryConvertToPromise(thisArg); + var ret = new Promise(INTERNAL); + ret._propagateFrom(this, 1); + var target = this._target(); + ret._setBoundTo(maybePromise); + if (maybePromise instanceof Promise) { + var context = { + promiseRejectionQueued: false, + promise: ret, + target: target, + bindingPromise: maybePromise + }; + target._then(INTERNAL, targetRejected, undefined, ret, context); + maybePromise._then( + bindingResolved, bindingRejected, undefined, ret, context); + ret._setOnCancel(maybePromise); + } else { + ret._resolveCallback(target); + } + return ret; +}; + +Promise.prototype._setBoundTo = function (obj) { + if (obj !== undefined) { + this._bitField = this._bitField | 2097152; + this._boundTo = obj; + } else { + this._bitField = this._bitField & (~2097152); + } +}; + +Promise.prototype._isBound = function () { + return (this._bitField & 2097152) === 2097152; +}; + +Promise.bind = function (thisArg, value) { + return Promise.resolve(value).bind(thisArg); +}; +}; + +},{}],4:[function(_dereq_,module,exports){ +"use strict"; +var old; +if (typeof Promise !== "undefined") old = Promise; +function noConflict() { + try { if (Promise === bluebird) Promise = old; } + catch (e) {} + return bluebird; +} +var bluebird = _dereq_("./promise")(); +bluebird.noConflict = noConflict; +module.exports = bluebird; + +},{"./promise":22}],5:[function(_dereq_,module,exports){ +"use strict"; +var cr = Object.create; +if (cr) { + var callerCache = cr(null); + var getterCache = cr(null); + callerCache[" size"] = getterCache[" size"] = 0; +} + +module.exports = function(Promise) { +var util = _dereq_("./util"); +var canEvaluate = util.canEvaluate; +var isIdentifier = util.isIdentifier; + +var getMethodCaller; +var getGetter; +if (!true) { +var makeMethodCaller = function (methodName) { + return new Function("ensureMethod", " \n\ + return function(obj) { \n\ + 'use strict' \n\ + var len = this.length; \n\ + ensureMethod(obj, 'methodName'); \n\ + switch(len) { \n\ + case 1: return obj.methodName(this[0]); \n\ + case 2: return obj.methodName(this[0], this[1]); \n\ + case 3: return obj.methodName(this[0], this[1], this[2]); \n\ + case 0: return obj.methodName(); \n\ + default: \n\ + return obj.methodName.apply(obj, this); \n\ + } \n\ + }; \n\ + ".replace(/methodName/g, methodName))(ensureMethod); +}; + +var makeGetter = function (propertyName) { + return new Function("obj", " \n\ + 'use strict'; \n\ + return obj.propertyName; \n\ + ".replace("propertyName", propertyName)); +}; + +var getCompiled = function(name, compiler, cache) { + var ret = cache[name]; + if (typeof ret !== "function") { + if (!isIdentifier(name)) { + return null; + } + ret = compiler(name); + cache[name] = ret; + cache[" size"]++; + if (cache[" size"] > 512) { + var keys = Object.keys(cache); + for (var i = 0; i < 256; ++i) delete cache[keys[i]]; + cache[" size"] = keys.length - 256; + } + } + return ret; +}; + +getMethodCaller = function(name) { + return getCompiled(name, makeMethodCaller, callerCache); +}; + +getGetter = function(name) { + return getCompiled(name, makeGetter, getterCache); +}; +} + +function ensureMethod(obj, methodName) { + var fn; + if (obj != null) fn = obj[methodName]; + if (typeof fn !== "function") { + var message = "Object " + util.classString(obj) + " has no method '" + + util.toString(methodName) + "'"; + throw new Promise.TypeError(message); + } + return fn; +} + +function caller(obj) { + var methodName = this.pop(); + var fn = ensureMethod(obj, methodName); + return fn.apply(obj, this); +} +Promise.prototype.call = function (methodName) { + var args = [].slice.call(arguments, 1);; + if (!true) { + if (canEvaluate) { + var maybeCaller = getMethodCaller(methodName); + if (maybeCaller !== null) { + return this._then( + maybeCaller, undefined, undefined, args, undefined); + } + } + } + args.push(methodName); + return this._then(caller, undefined, undefined, args, undefined); +}; + +function namedGetter(obj) { + return obj[this]; +} +function indexedGetter(obj) { + var index = +this; + if (index < 0) index = Math.max(0, index + obj.length); + return obj[index]; +} +Promise.prototype.get = function (propertyName) { + var isIndex = (typeof propertyName === "number"); + var getter; + if (!isIndex) { + if (canEvaluate) { + var maybeGetter = getGetter(propertyName); + getter = maybeGetter !== null ? maybeGetter : namedGetter; + } else { + getter = namedGetter; + } + } else { + getter = indexedGetter; + } + return this._then(getter, undefined, undefined, propertyName, undefined); +}; +}; + +},{"./util":36}],6:[function(_dereq_,module,exports){ +"use strict"; +module.exports = function(Promise, PromiseArray, apiRejection, debug) { +var util = _dereq_("./util"); +var tryCatch = util.tryCatch; +var errorObj = util.errorObj; +var async = Promise._async; + +Promise.prototype["break"] = Promise.prototype.cancel = function() { + if (!debug.cancellation()) return this._warn("cancellation is disabled"); + + var promise = this; + var child = promise; + while (promise._isCancellable()) { + if (!promise._cancelBy(child)) { + if (child._isFollowing()) { + child._followee().cancel(); + } else { + child._cancelBranched(); + } + break; + } + + var parent = promise._cancellationParent; + if (parent == null || !parent._isCancellable()) { + if (promise._isFollowing()) { + promise._followee().cancel(); + } else { + promise._cancelBranched(); + } + break; + } else { + if (promise._isFollowing()) promise._followee().cancel(); + promise._setWillBeCancelled(); + child = promise; + promise = parent; + } + } +}; + +Promise.prototype._branchHasCancelled = function() { + this._branchesRemainingToCancel--; +}; + +Promise.prototype._enoughBranchesHaveCancelled = function() { + return this._branchesRemainingToCancel === undefined || + this._branchesRemainingToCancel <= 0; +}; + +Promise.prototype._cancelBy = function(canceller) { + if (canceller === this) { + this._branchesRemainingToCancel = 0; + this._invokeOnCancel(); + return true; + } else { + this._branchHasCancelled(); + if (this._enoughBranchesHaveCancelled()) { + this._invokeOnCancel(); + return true; + } + } + return false; +}; + +Promise.prototype._cancelBranched = function() { + if (this._enoughBranchesHaveCancelled()) { + this._cancel(); + } +}; + +Promise.prototype._cancel = function() { + if (!this._isCancellable()) return; + this._setCancelled(); + async.invoke(this._cancelPromises, this, undefined); +}; + +Promise.prototype._cancelPromises = function() { + if (this._length() > 0) this._settlePromises(); +}; + +Promise.prototype._unsetOnCancel = function() { + this._onCancelField = undefined; +}; + +Promise.prototype._isCancellable = function() { + return this.isPending() && !this._isCancelled(); +}; + +Promise.prototype.isCancellable = function() { + return this.isPending() && !this.isCancelled(); +}; + +Promise.prototype._doInvokeOnCancel = function(onCancelCallback, internalOnly) { + if (util.isArray(onCancelCallback)) { + for (var i = 0; i < onCancelCallback.length; ++i) { + this._doInvokeOnCancel(onCancelCallback[i], internalOnly); + } + } else if (onCancelCallback !== undefined) { + if (typeof onCancelCallback === "function") { + if (!internalOnly) { + var e = tryCatch(onCancelCallback).call(this._boundValue()); + if (e === errorObj) { + this._attachExtraTrace(e.e); + async.throwLater(e.e); + } + } + } else { + onCancelCallback._resultCancelled(this); + } + } +}; + +Promise.prototype._invokeOnCancel = function() { + var onCancelCallback = this._onCancel(); + this._unsetOnCancel(); + async.invoke(this._doInvokeOnCancel, this, onCancelCallback); +}; + +Promise.prototype._invokeInternalOnCancel = function() { + if (this._isCancellable()) { + this._doInvokeOnCancel(this._onCancel(), true); + this._unsetOnCancel(); + } +}; + +Promise.prototype._resultCancelled = function() { + this.cancel(); +}; + +}; + +},{"./util":36}],7:[function(_dereq_,module,exports){ +"use strict"; +module.exports = function(NEXT_FILTER) { +var util = _dereq_("./util"); +var getKeys = _dereq_("./es5").keys; +var tryCatch = util.tryCatch; +var errorObj = util.errorObj; + +function catchFilter(instances, cb, promise) { + return function(e) { + var boundTo = promise._boundValue(); + predicateLoop: for (var i = 0; i < instances.length; ++i) { + var item = instances[i]; + + if (item === Error || + (item != null && item.prototype instanceof Error)) { + if (e instanceof item) { + return tryCatch(cb).call(boundTo, e); + } + } else if (typeof item === "function") { + var matchesPredicate = tryCatch(item).call(boundTo, e); + if (matchesPredicate === errorObj) { + return matchesPredicate; + } else if (matchesPredicate) { + return tryCatch(cb).call(boundTo, e); + } + } else if (util.isObject(e)) { + var keys = getKeys(item); + for (var j = 0; j < keys.length; ++j) { + var key = keys[j]; + if (item[key] != e[key]) { + continue predicateLoop; + } + } + return tryCatch(cb).call(boundTo, e); + } + } + return NEXT_FILTER; + }; +} + +return catchFilter; +}; + +},{"./es5":13,"./util":36}],8:[function(_dereq_,module,exports){ +"use strict"; +module.exports = function(Promise) { +var longStackTraces = false; +var contextStack = []; + +Promise.prototype._promiseCreated = function() {}; +Promise.prototype._pushContext = function() {}; +Promise.prototype._popContext = function() {return null;}; +Promise._peekContext = Promise.prototype._peekContext = function() {}; + +function Context() { + this._trace = new Context.CapturedTrace(peekContext()); +} +Context.prototype._pushContext = function () { + if (this._trace !== undefined) { + this._trace._promiseCreated = null; + contextStack.push(this._trace); + } +}; + +Context.prototype._popContext = function () { + if (this._trace !== undefined) { + var trace = contextStack.pop(); + var ret = trace._promiseCreated; + trace._promiseCreated = null; + return ret; + } + return null; +}; + +function createContext() { + if (longStackTraces) return new Context(); +} + +function peekContext() { + var lastIndex = contextStack.length - 1; + if (lastIndex >= 0) { + return contextStack[lastIndex]; + } + return undefined; +} +Context.CapturedTrace = null; +Context.create = createContext; +Context.deactivateLongStackTraces = function() {}; +Context.activateLongStackTraces = function() { + var Promise_pushContext = Promise.prototype._pushContext; + var Promise_popContext = Promise.prototype._popContext; + var Promise_PeekContext = Promise._peekContext; + var Promise_peekContext = Promise.prototype._peekContext; + var Promise_promiseCreated = Promise.prototype._promiseCreated; + Context.deactivateLongStackTraces = function() { + Promise.prototype._pushContext = Promise_pushContext; + Promise.prototype._popContext = Promise_popContext; + Promise._peekContext = Promise_PeekContext; + Promise.prototype._peekContext = Promise_peekContext; + Promise.prototype._promiseCreated = Promise_promiseCreated; + longStackTraces = false; + }; + longStackTraces = true; + Promise.prototype._pushContext = Context.prototype._pushContext; + Promise.prototype._popContext = Context.prototype._popContext; + Promise._peekContext = Promise.prototype._peekContext = peekContext; + Promise.prototype._promiseCreated = function() { + var ctx = this._peekContext(); + if (ctx && ctx._promiseCreated == null) ctx._promiseCreated = this; + }; +}; +return Context; +}; + +},{}],9:[function(_dereq_,module,exports){ +"use strict"; +module.exports = function(Promise, Context) { +var getDomain = Promise._getDomain; +var async = Promise._async; +var Warning = _dereq_("./errors").Warning; +var util = _dereq_("./util"); +var canAttachTrace = util.canAttachTrace; +var unhandledRejectionHandled; +var possiblyUnhandledRejection; +var bluebirdFramePattern = + /[\\\/]bluebird[\\\/]js[\\\/](release|debug|instrumented)/; +var nodeFramePattern = /\((?:timers\.js):\d+:\d+\)/; +var parseLinePattern = /[\/<\(](.+?):(\d+):(\d+)\)?\s*$/; +var stackFramePattern = null; +var formatStack = null; +var indentStackFrames = false; +var printWarning; +var debugging = !!(util.env("BLUEBIRD_DEBUG") != 0 && + (true || + util.env("BLUEBIRD_DEBUG") || + util.env("NODE_ENV") === "development")); + +var warnings = !!(util.env("BLUEBIRD_WARNINGS") != 0 && + (debugging || util.env("BLUEBIRD_WARNINGS"))); + +var longStackTraces = !!(util.env("BLUEBIRD_LONG_STACK_TRACES") != 0 && + (debugging || util.env("BLUEBIRD_LONG_STACK_TRACES"))); + +var wForgottenReturn = util.env("BLUEBIRD_W_FORGOTTEN_RETURN") != 0 && + (warnings || !!util.env("BLUEBIRD_W_FORGOTTEN_RETURN")); + +Promise.prototype.suppressUnhandledRejections = function() { + var target = this._target(); + target._bitField = ((target._bitField & (~1048576)) | + 524288); +}; + +Promise.prototype._ensurePossibleRejectionHandled = function () { + if ((this._bitField & 524288) !== 0) return; + this._setRejectionIsUnhandled(); + async.invokeLater(this._notifyUnhandledRejection, this, undefined); +}; + +Promise.prototype._notifyUnhandledRejectionIsHandled = function () { + fireRejectionEvent("rejectionHandled", + unhandledRejectionHandled, undefined, this); +}; + +Promise.prototype._setReturnedNonUndefined = function() { + this._bitField = this._bitField | 268435456; +}; + +Promise.prototype._returnedNonUndefined = function() { + return (this._bitField & 268435456) !== 0; +}; + +Promise.prototype._notifyUnhandledRejection = function () { + if (this._isRejectionUnhandled()) { + var reason = this._settledValue(); + this._setUnhandledRejectionIsNotified(); + fireRejectionEvent("unhandledRejection", + possiblyUnhandledRejection, reason, this); + } +}; + +Promise.prototype._setUnhandledRejectionIsNotified = function () { + this._bitField = this._bitField | 262144; +}; + +Promise.prototype._unsetUnhandledRejectionIsNotified = function () { + this._bitField = this._bitField & (~262144); +}; + +Promise.prototype._isUnhandledRejectionNotified = function () { + return (this._bitField & 262144) > 0; +}; + +Promise.prototype._setRejectionIsUnhandled = function () { + this._bitField = this._bitField | 1048576; +}; + +Promise.prototype._unsetRejectionIsUnhandled = function () { + this._bitField = this._bitField & (~1048576); + if (this._isUnhandledRejectionNotified()) { + this._unsetUnhandledRejectionIsNotified(); + this._notifyUnhandledRejectionIsHandled(); + } +}; + +Promise.prototype._isRejectionUnhandled = function () { + return (this._bitField & 1048576) > 0; +}; + +Promise.prototype._warn = function(message, shouldUseOwnTrace, promise) { + return warn(message, shouldUseOwnTrace, promise || this); +}; + +Promise.onPossiblyUnhandledRejection = function (fn) { + var domain = getDomain(); + possiblyUnhandledRejection = + typeof fn === "function" ? (domain === null ? + fn : util.domainBind(domain, fn)) + : undefined; +}; + +Promise.onUnhandledRejectionHandled = function (fn) { + var domain = getDomain(); + unhandledRejectionHandled = + typeof fn === "function" ? (domain === null ? + fn : util.domainBind(domain, fn)) + : undefined; +}; + +var disableLongStackTraces = function() {}; +Promise.longStackTraces = function () { + if (async.haveItemsQueued() && !config.longStackTraces) { + throw new Error("cannot enable long stack traces after promises have been created\u000a\u000a See http://goo.gl/MqrFmX\u000a"); + } + if (!config.longStackTraces && longStackTracesIsSupported()) { + var Promise_captureStackTrace = Promise.prototype._captureStackTrace; + var Promise_attachExtraTrace = Promise.prototype._attachExtraTrace; + config.longStackTraces = true; + disableLongStackTraces = function() { + if (async.haveItemsQueued() && !config.longStackTraces) { + throw new Error("cannot enable long stack traces after promises have been created\u000a\u000a See http://goo.gl/MqrFmX\u000a"); + } + Promise.prototype._captureStackTrace = Promise_captureStackTrace; + Promise.prototype._attachExtraTrace = Promise_attachExtraTrace; + Context.deactivateLongStackTraces(); + async.enableTrampoline(); + config.longStackTraces = false; + }; + Promise.prototype._captureStackTrace = longStackTracesCaptureStackTrace; + Promise.prototype._attachExtraTrace = longStackTracesAttachExtraTrace; + Context.activateLongStackTraces(); + async.disableTrampolineIfNecessary(); + } +}; + +Promise.hasLongStackTraces = function () { + return config.longStackTraces && longStackTracesIsSupported(); +}; + +var fireDomEvent = (function() { + try { + if (typeof CustomEvent === "function") { + var event = new CustomEvent("CustomEvent"); + util.global.dispatchEvent(event); + return function(name, event) { + var domEvent = new CustomEvent(name.toLowerCase(), { + detail: event, + cancelable: true + }); + return !util.global.dispatchEvent(domEvent); + }; + } else if (typeof Event === "function") { + var event = new Event("CustomEvent"); + util.global.dispatchEvent(event); + return function(name, event) { + var domEvent = new Event(name.toLowerCase(), { + cancelable: true + }); + domEvent.detail = event; + return !util.global.dispatchEvent(domEvent); + }; + } else { + var event = document.createEvent("CustomEvent"); + event.initCustomEvent("testingtheevent", false, true, {}); + util.global.dispatchEvent(event); + return function(name, event) { + var domEvent = document.createEvent("CustomEvent"); + domEvent.initCustomEvent(name.toLowerCase(), false, true, + event); + return !util.global.dispatchEvent(domEvent); + }; + } + } catch (e) {} + return function() { + return false; + }; +})(); + +var fireGlobalEvent = (function() { + if (util.isNode) { + return function() { + return process.emit.apply(process, arguments); + }; + } else { + if (!util.global) { + return function() { + return false; + }; + } + return function(name) { + var methodName = "on" + name.toLowerCase(); + var method = util.global[methodName]; + if (!method) return false; + method.apply(util.global, [].slice.call(arguments, 1)); + return true; + }; + } +})(); + +function generatePromiseLifecycleEventObject(name, promise) { + return {promise: promise}; +} + +var eventToObjectGenerator = { + promiseCreated: generatePromiseLifecycleEventObject, + promiseFulfilled: generatePromiseLifecycleEventObject, + promiseRejected: generatePromiseLifecycleEventObject, + promiseResolved: generatePromiseLifecycleEventObject, + promiseCancelled: generatePromiseLifecycleEventObject, + promiseChained: function(name, promise, child) { + return {promise: promise, child: child}; + }, + warning: function(name, warning) { + return {warning: warning}; + }, + unhandledRejection: function (name, reason, promise) { + return {reason: reason, promise: promise}; + }, + rejectionHandled: generatePromiseLifecycleEventObject +}; + +var activeFireEvent = function (name) { + var globalEventFired = false; + try { + globalEventFired = fireGlobalEvent.apply(null, arguments); + } catch (e) { + async.throwLater(e); + globalEventFired = true; + } + + var domEventFired = false; + try { + domEventFired = fireDomEvent(name, + eventToObjectGenerator[name].apply(null, arguments)); + } catch (e) { + async.throwLater(e); + domEventFired = true; + } + + return domEventFired || globalEventFired; +}; + +Promise.config = function(opts) { + opts = Object(opts); + if ("longStackTraces" in opts) { + if (opts.longStackTraces) { + Promise.longStackTraces(); + } else if (!opts.longStackTraces && Promise.hasLongStackTraces()) { + disableLongStackTraces(); + } + } + if ("warnings" in opts) { + var warningsOption = opts.warnings; + config.warnings = !!warningsOption; + wForgottenReturn = config.warnings; + + if (util.isObject(warningsOption)) { + if ("wForgottenReturn" in warningsOption) { + wForgottenReturn = !!warningsOption.wForgottenReturn; + } + } + } + if ("cancellation" in opts && opts.cancellation && !config.cancellation) { + if (async.haveItemsQueued()) { + throw new Error( + "cannot enable cancellation after promises are in use"); + } + Promise.prototype._clearCancellationData = + cancellationClearCancellationData; + Promise.prototype._propagateFrom = cancellationPropagateFrom; + Promise.prototype._onCancel = cancellationOnCancel; + Promise.prototype._setOnCancel = cancellationSetOnCancel; + Promise.prototype._attachCancellationCallback = + cancellationAttachCancellationCallback; + Promise.prototype._execute = cancellationExecute; + propagateFromFunction = cancellationPropagateFrom; + config.cancellation = true; + } + if ("monitoring" in opts) { + if (opts.monitoring && !config.monitoring) { + config.monitoring = true; + Promise.prototype._fireEvent = activeFireEvent; + } else if (!opts.monitoring && config.monitoring) { + config.monitoring = false; + Promise.prototype._fireEvent = defaultFireEvent; + } + } + return Promise; +}; + +function defaultFireEvent() { return false; } + +Promise.prototype._fireEvent = defaultFireEvent; +Promise.prototype._execute = function(executor, resolve, reject) { + try { + executor(resolve, reject); + } catch (e) { + return e; + } +}; +Promise.prototype._onCancel = function () {}; +Promise.prototype._setOnCancel = function (handler) { ; }; +Promise.prototype._attachCancellationCallback = function(onCancel) { + ; +}; +Promise.prototype._captureStackTrace = function () {}; +Promise.prototype._attachExtraTrace = function () {}; +Promise.prototype._clearCancellationData = function() {}; +Promise.prototype._propagateFrom = function (parent, flags) { + ; + ; +}; + +function cancellationExecute(executor, resolve, reject) { + var promise = this; + try { + executor(resolve, reject, function(onCancel) { + if (typeof onCancel !== "function") { + throw new TypeError("onCancel must be a function, got: " + + util.toString(onCancel)); + } + promise._attachCancellationCallback(onCancel); + }); + } catch (e) { + return e; + } +} + +function cancellationAttachCancellationCallback(onCancel) { + if (!this._isCancellable()) return this; + + var previousOnCancel = this._onCancel(); + if (previousOnCancel !== undefined) { + if (util.isArray(previousOnCancel)) { + previousOnCancel.push(onCancel); + } else { + this._setOnCancel([previousOnCancel, onCancel]); + } + } else { + this._setOnCancel(onCancel); + } +} + +function cancellationOnCancel() { + return this._onCancelField; +} + +function cancellationSetOnCancel(onCancel) { + this._onCancelField = onCancel; +} + +function cancellationClearCancellationData() { + this._cancellationParent = undefined; + this._onCancelField = undefined; +} + +function cancellationPropagateFrom(parent, flags) { + if ((flags & 1) !== 0) { + this._cancellationParent = parent; + var branchesRemainingToCancel = parent._branchesRemainingToCancel; + if (branchesRemainingToCancel === undefined) { + branchesRemainingToCancel = 0; + } + parent._branchesRemainingToCancel = branchesRemainingToCancel + 1; + } + if ((flags & 2) !== 0 && parent._isBound()) { + this._setBoundTo(parent._boundTo); + } +} + +function bindingPropagateFrom(parent, flags) { + if ((flags & 2) !== 0 && parent._isBound()) { + this._setBoundTo(parent._boundTo); + } +} +var propagateFromFunction = bindingPropagateFrom; + +function boundValueFunction() { + var ret = this._boundTo; + if (ret !== undefined) { + if (ret instanceof Promise) { + if (ret.isFulfilled()) { + return ret.value(); + } else { + return undefined; + } + } + } + return ret; +} + +function longStackTracesCaptureStackTrace() { + this._trace = new CapturedTrace(this._peekContext()); +} + +function longStackTracesAttachExtraTrace(error, ignoreSelf) { + if (canAttachTrace(error)) { + var trace = this._trace; + if (trace !== undefined) { + if (ignoreSelf) trace = trace._parent; + } + if (trace !== undefined) { + trace.attachExtraTrace(error); + } else if (!error.__stackCleaned__) { + var parsed = parseStackAndMessage(error); + util.notEnumerableProp(error, "stack", + parsed.message + "\n" + parsed.stack.join("\n")); + util.notEnumerableProp(error, "__stackCleaned__", true); + } + } +} + +function checkForgottenReturns(returnValue, promiseCreated, name, promise, + parent) { + if (returnValue === undefined && promiseCreated !== null && + wForgottenReturn) { + if (parent !== undefined && parent._returnedNonUndefined()) return; + if ((promise._bitField & 65535) === 0) return; + + if (name) name = name + " "; + var handlerLine = ""; + var creatorLine = ""; + if (promiseCreated._trace) { + var traceLines = promiseCreated._trace.stack.split("\n"); + var stack = cleanStack(traceLines); + for (var i = stack.length - 1; i >= 0; --i) { + var line = stack[i]; + if (!nodeFramePattern.test(line)) { + var lineMatches = line.match(parseLinePattern); + if (lineMatches) { + handlerLine = "at " + lineMatches[1] + + ":" + lineMatches[2] + ":" + lineMatches[3] + " "; + } + break; + } + } + + if (stack.length > 0) { + var firstUserLine = stack[0]; + for (var i = 0; i < traceLines.length; ++i) { + + if (traceLines[i] === firstUserLine) { + if (i > 0) { + creatorLine = "\n" + traceLines[i - 1]; + } + break; + } + } + + } + } + var msg = "a promise was created in a " + name + + "handler " + handlerLine + "but was not returned from it, " + + "see http://goo.gl/rRqMUw" + + creatorLine; + promise._warn(msg, true, promiseCreated); + } +} + +function deprecated(name, replacement) { + var message = name + + " is deprecated and will be removed in a future version."; + if (replacement) message += " Use " + replacement + " instead."; + return warn(message); +} + +function warn(message, shouldUseOwnTrace, promise) { + if (!config.warnings) return; + var warning = new Warning(message); + var ctx; + if (shouldUseOwnTrace) { + promise._attachExtraTrace(warning); + } else if (config.longStackTraces && (ctx = Promise._peekContext())) { + ctx.attachExtraTrace(warning); + } else { + var parsed = parseStackAndMessage(warning); + warning.stack = parsed.message + "\n" + parsed.stack.join("\n"); + } + + if (!activeFireEvent("warning", warning)) { + formatAndLogError(warning, "", true); + } +} + +function reconstructStack(message, stacks) { + for (var i = 0; i < stacks.length - 1; ++i) { + stacks[i].push("From previous event:"); + stacks[i] = stacks[i].join("\n"); + } + if (i < stacks.length) { + stacks[i] = stacks[i].join("\n"); + } + return message + "\n" + stacks.join("\n"); +} + +function removeDuplicateOrEmptyJumps(stacks) { + for (var i = 0; i < stacks.length; ++i) { + if (stacks[i].length === 0 || + ((i + 1 < stacks.length) && stacks[i][0] === stacks[i+1][0])) { + stacks.splice(i, 1); + i--; + } + } +} + +function removeCommonRoots(stacks) { + var current = stacks[0]; + for (var i = 1; i < stacks.length; ++i) { + var prev = stacks[i]; + var currentLastIndex = current.length - 1; + var currentLastLine = current[currentLastIndex]; + var commonRootMeetPoint = -1; + + for (var j = prev.length - 1; j >= 0; --j) { + if (prev[j] === currentLastLine) { + commonRootMeetPoint = j; + break; + } + } + + for (var j = commonRootMeetPoint; j >= 0; --j) { + var line = prev[j]; + if (current[currentLastIndex] === line) { + current.pop(); + currentLastIndex--; + } else { + break; + } + } + current = prev; + } +} + +function cleanStack(stack) { + var ret = []; + for (var i = 0; i < stack.length; ++i) { + var line = stack[i]; + var isTraceLine = " (No stack trace)" === line || + stackFramePattern.test(line); + var isInternalFrame = isTraceLine && shouldIgnore(line); + if (isTraceLine && !isInternalFrame) { + if (indentStackFrames && line.charAt(0) !== " ") { + line = " " + line; + } + ret.push(line); + } + } + return ret; +} + +function stackFramesAsArray(error) { + var stack = error.stack.replace(/\s+$/g, "").split("\n"); + for (var i = 0; i < stack.length; ++i) { + var line = stack[i]; + if (" (No stack trace)" === line || stackFramePattern.test(line)) { + break; + } + } + if (i > 0 && error.name != "SyntaxError") { + stack = stack.slice(i); + } + return stack; +} + +function parseStackAndMessage(error) { + var stack = error.stack; + var message = error.toString(); + stack = typeof stack === "string" && stack.length > 0 + ? stackFramesAsArray(error) : [" (No stack trace)"]; + return { + message: message, + stack: error.name == "SyntaxError" ? stack : cleanStack(stack) + }; +} + +function formatAndLogError(error, title, isSoft) { + if (typeof console !== "undefined") { + var message; + if (util.isObject(error)) { + var stack = error.stack; + message = title + formatStack(stack, error); + } else { + message = title + String(error); + } + if (typeof printWarning === "function") { + printWarning(message, isSoft); + } else if (typeof console.log === "function" || + typeof console.log === "object") { + console.log(message); + } + } +} + +function fireRejectionEvent(name, localHandler, reason, promise) { + var localEventFired = false; + try { + if (typeof localHandler === "function") { + localEventFired = true; + if (name === "rejectionHandled") { + localHandler(promise); + } else { + localHandler(reason, promise); + } + } + } catch (e) { + async.throwLater(e); + } + + if (name === "unhandledRejection") { + if (!activeFireEvent(name, reason, promise) && !localEventFired) { + formatAndLogError(reason, "Unhandled rejection "); + } + } else { + activeFireEvent(name, promise); + } +} + +function formatNonError(obj) { + var str; + if (typeof obj === "function") { + str = "[function " + + (obj.name || "anonymous") + + "]"; + } else { + str = obj && typeof obj.toString === "function" + ? obj.toString() : util.toString(obj); + var ruselessToString = /\[object [a-zA-Z0-9$_]+\]/; + if (ruselessToString.test(str)) { + try { + var newStr = JSON.stringify(obj); + str = newStr; + } + catch(e) { + + } + } + if (str.length === 0) { + str = "(empty array)"; + } + } + return ("(<" + snip(str) + ">, no stack trace)"); +} + +function snip(str) { + var maxChars = 41; + if (str.length < maxChars) { + return str; + } + return str.substr(0, maxChars - 3) + "..."; +} + +function longStackTracesIsSupported() { + return typeof captureStackTrace === "function"; +} + +var shouldIgnore = function() { return false; }; +var parseLineInfoRegex = /[\/<\(]([^:\/]+):(\d+):(?:\d+)\)?\s*$/; +function parseLineInfo(line) { + var matches = line.match(parseLineInfoRegex); + if (matches) { + return { + fileName: matches[1], + line: parseInt(matches[2], 10) + }; + } +} + +function setBounds(firstLineError, lastLineError) { + if (!longStackTracesIsSupported()) return; + var firstStackLines = firstLineError.stack.split("\n"); + var lastStackLines = lastLineError.stack.split("\n"); + var firstIndex = -1; + var lastIndex = -1; + var firstFileName; + var lastFileName; + for (var i = 0; i < firstStackLines.length; ++i) { + var result = parseLineInfo(firstStackLines[i]); + if (result) { + firstFileName = result.fileName; + firstIndex = result.line; + break; + } + } + for (var i = 0; i < lastStackLines.length; ++i) { + var result = parseLineInfo(lastStackLines[i]); + if (result) { + lastFileName = result.fileName; + lastIndex = result.line; + break; + } + } + if (firstIndex < 0 || lastIndex < 0 || !firstFileName || !lastFileName || + firstFileName !== lastFileName || firstIndex >= lastIndex) { + return; + } + + shouldIgnore = function(line) { + if (bluebirdFramePattern.test(line)) return true; + var info = parseLineInfo(line); + if (info) { + if (info.fileName === firstFileName && + (firstIndex <= info.line && info.line <= lastIndex)) { + return true; + } + } + return false; + }; +} + +function CapturedTrace(parent) { + this._parent = parent; + this._promisesCreated = 0; + var length = this._length = 1 + (parent === undefined ? 0 : parent._length); + captureStackTrace(this, CapturedTrace); + if (length > 32) this.uncycle(); +} +util.inherits(CapturedTrace, Error); +Context.CapturedTrace = CapturedTrace; + +CapturedTrace.prototype.uncycle = function() { + var length = this._length; + if (length < 2) return; + var nodes = []; + var stackToIndex = {}; + + for (var i = 0, node = this; node !== undefined; ++i) { + nodes.push(node); + node = node._parent; + } + length = this._length = i; + for (var i = length - 1; i >= 0; --i) { + var stack = nodes[i].stack; + if (stackToIndex[stack] === undefined) { + stackToIndex[stack] = i; + } + } + for (var i = 0; i < length; ++i) { + var currentStack = nodes[i].stack; + var index = stackToIndex[currentStack]; + if (index !== undefined && index !== i) { + if (index > 0) { + nodes[index - 1]._parent = undefined; + nodes[index - 1]._length = 1; + } + nodes[i]._parent = undefined; + nodes[i]._length = 1; + var cycleEdgeNode = i > 0 ? nodes[i - 1] : this; + + if (index < length - 1) { + cycleEdgeNode._parent = nodes[index + 1]; + cycleEdgeNode._parent.uncycle(); + cycleEdgeNode._length = + cycleEdgeNode._parent._length + 1; + } else { + cycleEdgeNode._parent = undefined; + cycleEdgeNode._length = 1; + } + var currentChildLength = cycleEdgeNode._length + 1; + for (var j = i - 2; j >= 0; --j) { + nodes[j]._length = currentChildLength; + currentChildLength++; + } + return; + } + } +}; + +CapturedTrace.prototype.attachExtraTrace = function(error) { + if (error.__stackCleaned__) return; + this.uncycle(); + var parsed = parseStackAndMessage(error); + var message = parsed.message; + var stacks = [parsed.stack]; + + var trace = this; + while (trace !== undefined) { + stacks.push(cleanStack(trace.stack.split("\n"))); + trace = trace._parent; + } + removeCommonRoots(stacks); + removeDuplicateOrEmptyJumps(stacks); + util.notEnumerableProp(error, "stack", reconstructStack(message, stacks)); + util.notEnumerableProp(error, "__stackCleaned__", true); +}; + +var captureStackTrace = (function stackDetection() { + var v8stackFramePattern = /^\s*at\s*/; + var v8stackFormatter = function(stack, error) { + if (typeof stack === "string") return stack; + + if (error.name !== undefined && + error.message !== undefined) { + return error.toString(); + } + return formatNonError(error); + }; + + if (typeof Error.stackTraceLimit === "number" && + typeof Error.captureStackTrace === "function") { + Error.stackTraceLimit += 6; + stackFramePattern = v8stackFramePattern; + formatStack = v8stackFormatter; + var captureStackTrace = Error.captureStackTrace; + + shouldIgnore = function(line) { + return bluebirdFramePattern.test(line); + }; + return function(receiver, ignoreUntil) { + Error.stackTraceLimit += 6; + captureStackTrace(receiver, ignoreUntil); + Error.stackTraceLimit -= 6; + }; + } + var err = new Error(); + + if (typeof err.stack === "string" && + err.stack.split("\n")[0].indexOf("stackDetection@") >= 0) { + stackFramePattern = /@/; + formatStack = v8stackFormatter; + indentStackFrames = true; + return function captureStackTrace(o) { + o.stack = new Error().stack; + }; + } + + var hasStackAfterThrow; + try { throw new Error(); } + catch(e) { + hasStackAfterThrow = ("stack" in e); + } + if (!("stack" in err) && hasStackAfterThrow && + typeof Error.stackTraceLimit === "number") { + stackFramePattern = v8stackFramePattern; + formatStack = v8stackFormatter; + return function captureStackTrace(o) { + Error.stackTraceLimit += 6; + try { throw new Error(); } + catch(e) { o.stack = e.stack; } + Error.stackTraceLimit -= 6; + }; + } + + formatStack = function(stack, error) { + if (typeof stack === "string") return stack; + + if ((typeof error === "object" || + typeof error === "function") && + error.name !== undefined && + error.message !== undefined) { + return error.toString(); + } + return formatNonError(error); + }; + + return null; + +})([]); + +if (typeof console !== "undefined" && typeof console.warn !== "undefined") { + printWarning = function (message) { + console.warn(message); + }; + if (util.isNode && process.stderr.isTTY) { + printWarning = function(message, isSoft) { + var color = isSoft ? "\u001b[33m" : "\u001b[31m"; + console.warn(color + message + "\u001b[0m\n"); + }; + } else if (!util.isNode && typeof (new Error().stack) === "string") { + printWarning = function(message, isSoft) { + console.warn("%c" + message, + isSoft ? "color: darkorange" : "color: red"); + }; + } +} + +var config = { + warnings: warnings, + longStackTraces: false, + cancellation: false, + monitoring: false +}; + +if (longStackTraces) Promise.longStackTraces(); + +return { + longStackTraces: function() { + return config.longStackTraces; + }, + warnings: function() { + return config.warnings; + }, + cancellation: function() { + return config.cancellation; + }, + monitoring: function() { + return config.monitoring; + }, + propagateFromFunction: function() { + return propagateFromFunction; + }, + boundValueFunction: function() { + return boundValueFunction; + }, + checkForgottenReturns: checkForgottenReturns, + setBounds: setBounds, + warn: warn, + deprecated: deprecated, + CapturedTrace: CapturedTrace, + fireDomEvent: fireDomEvent, + fireGlobalEvent: fireGlobalEvent +}; +}; + +},{"./errors":12,"./util":36}],10:[function(_dereq_,module,exports){ +"use strict"; +module.exports = function(Promise) { +function returner() { + return this.value; +} +function thrower() { + throw this.reason; +} + +Promise.prototype["return"] = +Promise.prototype.thenReturn = function (value) { + if (value instanceof Promise) value.suppressUnhandledRejections(); + return this._then( + returner, undefined, undefined, {value: value}, undefined); +}; + +Promise.prototype["throw"] = +Promise.prototype.thenThrow = function (reason) { + return this._then( + thrower, undefined, undefined, {reason: reason}, undefined); +}; + +Promise.prototype.catchThrow = function (reason) { + if (arguments.length <= 1) { + return this._then( + undefined, thrower, undefined, {reason: reason}, undefined); + } else { + var _reason = arguments[1]; + var handler = function() {throw _reason;}; + return this.caught(reason, handler); + } +}; + +Promise.prototype.catchReturn = function (value) { + if (arguments.length <= 1) { + if (value instanceof Promise) value.suppressUnhandledRejections(); + return this._then( + undefined, returner, undefined, {value: value}, undefined); + } else { + var _value = arguments[1]; + if (_value instanceof Promise) _value.suppressUnhandledRejections(); + var handler = function() {return _value;}; + return this.caught(value, handler); + } +}; +}; + +},{}],11:[function(_dereq_,module,exports){ +"use strict"; +module.exports = function(Promise, INTERNAL) { +var PromiseReduce = Promise.reduce; +var PromiseAll = Promise.all; + +function promiseAllThis() { + return PromiseAll(this); +} + +function PromiseMapSeries(promises, fn) { + return PromiseReduce(promises, fn, INTERNAL, INTERNAL); +} + +Promise.prototype.each = function (fn) { + return PromiseReduce(this, fn, INTERNAL, 0) + ._then(promiseAllThis, undefined, undefined, this, undefined); +}; + +Promise.prototype.mapSeries = function (fn) { + return PromiseReduce(this, fn, INTERNAL, INTERNAL); +}; + +Promise.each = function (promises, fn) { + return PromiseReduce(promises, fn, INTERNAL, 0) + ._then(promiseAllThis, undefined, undefined, promises, undefined); +}; + +Promise.mapSeries = PromiseMapSeries; +}; + + +},{}],12:[function(_dereq_,module,exports){ +"use strict"; +var es5 = _dereq_("./es5"); +var Objectfreeze = es5.freeze; +var util = _dereq_("./util"); +var inherits = util.inherits; +var notEnumerableProp = util.notEnumerableProp; + +function subError(nameProperty, defaultMessage) { + function SubError(message) { + if (!(this instanceof SubError)) return new SubError(message); + notEnumerableProp(this, "message", + typeof message === "string" ? message : defaultMessage); + notEnumerableProp(this, "name", nameProperty); + if (Error.captureStackTrace) { + Error.captureStackTrace(this, this.constructor); + } else { + Error.call(this); + } + } + inherits(SubError, Error); + return SubError; +} + +var _TypeError, _RangeError; +var Warning = subError("Warning", "warning"); +var CancellationError = subError("CancellationError", "cancellation error"); +var TimeoutError = subError("TimeoutError", "timeout error"); +var AggregateError = subError("AggregateError", "aggregate error"); +try { + _TypeError = TypeError; + _RangeError = RangeError; +} catch(e) { + _TypeError = subError("TypeError", "type error"); + _RangeError = subError("RangeError", "range error"); +} + +var methods = ("join pop push shift unshift slice filter forEach some " + + "every map indexOf lastIndexOf reduce reduceRight sort reverse").split(" "); + +for (var i = 0; i < methods.length; ++i) { + if (typeof Array.prototype[methods[i]] === "function") { + AggregateError.prototype[methods[i]] = Array.prototype[methods[i]]; + } +} + +es5.defineProperty(AggregateError.prototype, "length", { + value: 0, + configurable: false, + writable: true, + enumerable: true +}); +AggregateError.prototype["isOperational"] = true; +var level = 0; +AggregateError.prototype.toString = function() { + var indent = Array(level * 4 + 1).join(" "); + var ret = "\n" + indent + "AggregateError of:" + "\n"; + level++; + indent = Array(level * 4 + 1).join(" "); + for (var i = 0; i < this.length; ++i) { + var str = this[i] === this ? "[Circular AggregateError]" : this[i] + ""; + var lines = str.split("\n"); + for (var j = 0; j < lines.length; ++j) { + lines[j] = indent + lines[j]; + } + str = lines.join("\n"); + ret += str + "\n"; + } + level--; + return ret; +}; + +function OperationalError(message) { + if (!(this instanceof OperationalError)) + return new OperationalError(message); + notEnumerableProp(this, "name", "OperationalError"); + notEnumerableProp(this, "message", message); + this.cause = message; + this["isOperational"] = true; + + if (message instanceof Error) { + notEnumerableProp(this, "message", message.message); + notEnumerableProp(this, "stack", message.stack); + } else if (Error.captureStackTrace) { + Error.captureStackTrace(this, this.constructor); + } + +} +inherits(OperationalError, Error); + +var errorTypes = Error["__BluebirdErrorTypes__"]; +if (!errorTypes) { + errorTypes = Objectfreeze({ + CancellationError: CancellationError, + TimeoutError: TimeoutError, + OperationalError: OperationalError, + RejectionError: OperationalError, + AggregateError: AggregateError + }); + es5.defineProperty(Error, "__BluebirdErrorTypes__", { + value: errorTypes, + writable: false, + enumerable: false, + configurable: false + }); +} + +module.exports = { + Error: Error, + TypeError: _TypeError, + RangeError: _RangeError, + CancellationError: errorTypes.CancellationError, + OperationalError: errorTypes.OperationalError, + TimeoutError: errorTypes.TimeoutError, + AggregateError: errorTypes.AggregateError, + Warning: Warning +}; + +},{"./es5":13,"./util":36}],13:[function(_dereq_,module,exports){ +var isES5 = (function(){ + "use strict"; + return this === undefined; +})(); + +if (isES5) { + module.exports = { + freeze: Object.freeze, + defineProperty: Object.defineProperty, + getDescriptor: Object.getOwnPropertyDescriptor, + keys: Object.keys, + names: Object.getOwnPropertyNames, + getPrototypeOf: Object.getPrototypeOf, + isArray: Array.isArray, + isES5: isES5, + propertyIsWritable: function(obj, prop) { + var descriptor = Object.getOwnPropertyDescriptor(obj, prop); + return !!(!descriptor || descriptor.writable || descriptor.set); + } + }; +} else { + var has = {}.hasOwnProperty; + var str = {}.toString; + var proto = {}.constructor.prototype; + + var ObjectKeys = function (o) { + var ret = []; + for (var key in o) { + if (has.call(o, key)) { + ret.push(key); + } + } + return ret; + }; + + var ObjectGetDescriptor = function(o, key) { + return {value: o[key]}; + }; + + var ObjectDefineProperty = function (o, key, desc) { + o[key] = desc.value; + return o; + }; + + var ObjectFreeze = function (obj) { + return obj; + }; + + var ObjectGetPrototypeOf = function (obj) { + try { + return Object(obj).constructor.prototype; + } + catch (e) { + return proto; + } + }; + + var ArrayIsArray = function (obj) { + try { + return str.call(obj) === "[object Array]"; + } + catch(e) { + return false; + } + }; + + module.exports = { + isArray: ArrayIsArray, + keys: ObjectKeys, + names: ObjectKeys, + defineProperty: ObjectDefineProperty, + getDescriptor: ObjectGetDescriptor, + freeze: ObjectFreeze, + getPrototypeOf: ObjectGetPrototypeOf, + isES5: isES5, + propertyIsWritable: function() { + return true; + } + }; +} + +},{}],14:[function(_dereq_,module,exports){ +"use strict"; +module.exports = function(Promise, INTERNAL) { +var PromiseMap = Promise.map; + +Promise.prototype.filter = function (fn, options) { + return PromiseMap(this, fn, options, INTERNAL); +}; + +Promise.filter = function (promises, fn, options) { + return PromiseMap(promises, fn, options, INTERNAL); +}; +}; + +},{}],15:[function(_dereq_,module,exports){ +"use strict"; +module.exports = function(Promise, tryConvertToPromise, NEXT_FILTER) { +var util = _dereq_("./util"); +var CancellationError = Promise.CancellationError; +var errorObj = util.errorObj; +var catchFilter = _dereq_("./catch_filter")(NEXT_FILTER); + +function PassThroughHandlerContext(promise, type, handler) { + this.promise = promise; + this.type = type; + this.handler = handler; + this.called = false; + this.cancelPromise = null; +} + +PassThroughHandlerContext.prototype.isFinallyHandler = function() { + return this.type === 0; +}; + +function FinallyHandlerCancelReaction(finallyHandler) { + this.finallyHandler = finallyHandler; +} + +FinallyHandlerCancelReaction.prototype._resultCancelled = function() { + checkCancel(this.finallyHandler); +}; + +function checkCancel(ctx, reason) { + if (ctx.cancelPromise != null) { + if (arguments.length > 1) { + ctx.cancelPromise._reject(reason); + } else { + ctx.cancelPromise._cancel(); + } + ctx.cancelPromise = null; + return true; + } + return false; +} + +function succeed() { + return finallyHandler.call(this, this.promise._target()._settledValue()); +} +function fail(reason) { + if (checkCancel(this, reason)) return; + errorObj.e = reason; + return errorObj; +} +function finallyHandler(reasonOrValue) { + var promise = this.promise; + var handler = this.handler; + + if (!this.called) { + this.called = true; + var ret = this.isFinallyHandler() + ? handler.call(promise._boundValue()) + : handler.call(promise._boundValue(), reasonOrValue); + if (ret === NEXT_FILTER) { + return ret; + } else if (ret !== undefined) { + promise._setReturnedNonUndefined(); + var maybePromise = tryConvertToPromise(ret, promise); + if (maybePromise instanceof Promise) { + if (this.cancelPromise != null) { + if (maybePromise._isCancelled()) { + var reason = + new CancellationError("late cancellation observer"); + promise._attachExtraTrace(reason); + errorObj.e = reason; + return errorObj; + } else if (maybePromise.isPending()) { + maybePromise._attachCancellationCallback( + new FinallyHandlerCancelReaction(this)); + } + } + return maybePromise._then( + succeed, fail, undefined, this, undefined); + } + } + } + + if (promise.isRejected()) { + checkCancel(this); + errorObj.e = reasonOrValue; + return errorObj; + } else { + checkCancel(this); + return reasonOrValue; + } +} + +Promise.prototype._passThrough = function(handler, type, success, fail) { + if (typeof handler !== "function") return this.then(); + return this._then(success, + fail, + undefined, + new PassThroughHandlerContext(this, type, handler), + undefined); +}; + +Promise.prototype.lastly = +Promise.prototype["finally"] = function (handler) { + return this._passThrough(handler, + 0, + finallyHandler, + finallyHandler); +}; + + +Promise.prototype.tap = function (handler) { + return this._passThrough(handler, 1, finallyHandler); +}; + +Promise.prototype.tapCatch = function (handlerOrPredicate) { + var len = arguments.length; + if(len === 1) { + return this._passThrough(handlerOrPredicate, + 1, + undefined, + finallyHandler); + } else { + var catchInstances = new Array(len - 1), + j = 0, i; + for (i = 0; i < len - 1; ++i) { + var item = arguments[i]; + if (util.isObject(item)) { + catchInstances[j++] = item; + } else { + return Promise.reject(new TypeError( + "tapCatch statement predicate: " + + "expecting an object but got " + util.classString(item) + )); + } + } + catchInstances.length = j; + var handler = arguments[i]; + return this._passThrough(catchFilter(catchInstances, handler, this), + 1, + undefined, + finallyHandler); + } + +}; + +return PassThroughHandlerContext; +}; + +},{"./catch_filter":7,"./util":36}],16:[function(_dereq_,module,exports){ +"use strict"; +module.exports = function(Promise, + apiRejection, + INTERNAL, + tryConvertToPromise, + Proxyable, + debug) { +var errors = _dereq_("./errors"); +var TypeError = errors.TypeError; +var util = _dereq_("./util"); +var errorObj = util.errorObj; +var tryCatch = util.tryCatch; +var yieldHandlers = []; + +function promiseFromYieldHandler(value, yieldHandlers, traceParent) { + for (var i = 0; i < yieldHandlers.length; ++i) { + traceParent._pushContext(); + var result = tryCatch(yieldHandlers[i])(value); + traceParent._popContext(); + if (result === errorObj) { + traceParent._pushContext(); + var ret = Promise.reject(errorObj.e); + traceParent._popContext(); + return ret; + } + var maybePromise = tryConvertToPromise(result, traceParent); + if (maybePromise instanceof Promise) return maybePromise; + } + return null; +} + +function PromiseSpawn(generatorFunction, receiver, yieldHandler, stack) { + if (debug.cancellation()) { + var internal = new Promise(INTERNAL); + var _finallyPromise = this._finallyPromise = new Promise(INTERNAL); + this._promise = internal.lastly(function() { + return _finallyPromise; + }); + internal._captureStackTrace(); + internal._setOnCancel(this); + } else { + var promise = this._promise = new Promise(INTERNAL); + promise._captureStackTrace(); + } + this._stack = stack; + this._generatorFunction = generatorFunction; + this._receiver = receiver; + this._generator = undefined; + this._yieldHandlers = typeof yieldHandler === "function" + ? [yieldHandler].concat(yieldHandlers) + : yieldHandlers; + this._yieldedPromise = null; + this._cancellationPhase = false; +} +util.inherits(PromiseSpawn, Proxyable); + +PromiseSpawn.prototype._isResolved = function() { + return this._promise === null; +}; + +PromiseSpawn.prototype._cleanup = function() { + this._promise = this._generator = null; + if (debug.cancellation() && this._finallyPromise !== null) { + this._finallyPromise._fulfill(); + this._finallyPromise = null; + } +}; + +PromiseSpawn.prototype._promiseCancelled = function() { + if (this._isResolved()) return; + var implementsReturn = typeof this._generator["return"] !== "undefined"; + + var result; + if (!implementsReturn) { + var reason = new Promise.CancellationError( + "generator .return() sentinel"); + Promise.coroutine.returnSentinel = reason; + this._promise._attachExtraTrace(reason); + this._promise._pushContext(); + result = tryCatch(this._generator["throw"]).call(this._generator, + reason); + this._promise._popContext(); + } else { + this._promise._pushContext(); + result = tryCatch(this._generator["return"]).call(this._generator, + undefined); + this._promise._popContext(); + } + this._cancellationPhase = true; + this._yieldedPromise = null; + this._continue(result); +}; + +PromiseSpawn.prototype._promiseFulfilled = function(value) { + this._yieldedPromise = null; + this._promise._pushContext(); + var result = tryCatch(this._generator.next).call(this._generator, value); + this._promise._popContext(); + this._continue(result); +}; + +PromiseSpawn.prototype._promiseRejected = function(reason) { + this._yieldedPromise = null; + this._promise._attachExtraTrace(reason); + this._promise._pushContext(); + var result = tryCatch(this._generator["throw"]) + .call(this._generator, reason); + this._promise._popContext(); + this._continue(result); +}; + +PromiseSpawn.prototype._resultCancelled = function() { + if (this._yieldedPromise instanceof Promise) { + var promise = this._yieldedPromise; + this._yieldedPromise = null; + promise.cancel(); + } +}; + +PromiseSpawn.prototype.promise = function () { + return this._promise; +}; + +PromiseSpawn.prototype._run = function () { + this._generator = this._generatorFunction.call(this._receiver); + this._receiver = + this._generatorFunction = undefined; + this._promiseFulfilled(undefined); +}; + +PromiseSpawn.prototype._continue = function (result) { + var promise = this._promise; + if (result === errorObj) { + this._cleanup(); + if (this._cancellationPhase) { + return promise.cancel(); + } else { + return promise._rejectCallback(result.e, false); + } + } + + var value = result.value; + if (result.done === true) { + this._cleanup(); + if (this._cancellationPhase) { + return promise.cancel(); + } else { + return promise._resolveCallback(value); + } + } else { + var maybePromise = tryConvertToPromise(value, this._promise); + if (!(maybePromise instanceof Promise)) { + maybePromise = + promiseFromYieldHandler(maybePromise, + this._yieldHandlers, + this._promise); + if (maybePromise === null) { + this._promiseRejected( + new TypeError( + "A value %s was yielded that could not be treated as a promise\u000a\u000a See http://goo.gl/MqrFmX\u000a\u000a".replace("%s", String(value)) + + "From coroutine:\u000a" + + this._stack.split("\n").slice(1, -7).join("\n") + ) + ); + return; + } + } + maybePromise = maybePromise._target(); + var bitField = maybePromise._bitField; + ; + if (((bitField & 50397184) === 0)) { + this._yieldedPromise = maybePromise; + maybePromise._proxy(this, null); + } else if (((bitField & 33554432) !== 0)) { + Promise._async.invoke( + this._promiseFulfilled, this, maybePromise._value() + ); + } else if (((bitField & 16777216) !== 0)) { + Promise._async.invoke( + this._promiseRejected, this, maybePromise._reason() + ); + } else { + this._promiseCancelled(); + } + } +}; + +Promise.coroutine = function (generatorFunction, options) { + if (typeof generatorFunction !== "function") { + throw new TypeError("generatorFunction must be a function\u000a\u000a See http://goo.gl/MqrFmX\u000a"); + } + var yieldHandler = Object(options).yieldHandler; + var PromiseSpawn$ = PromiseSpawn; + var stack = new Error().stack; + return function () { + var generator = generatorFunction.apply(this, arguments); + var spawn = new PromiseSpawn$(undefined, undefined, yieldHandler, + stack); + var ret = spawn.promise(); + spawn._generator = generator; + spawn._promiseFulfilled(undefined); + return ret; + }; +}; + +Promise.coroutine.addYieldHandler = function(fn) { + if (typeof fn !== "function") { + throw new TypeError("expecting a function but got " + util.classString(fn)); + } + yieldHandlers.push(fn); +}; + +Promise.spawn = function (generatorFunction) { + debug.deprecated("Promise.spawn()", "Promise.coroutine()"); + if (typeof generatorFunction !== "function") { + return apiRejection("generatorFunction must be a function\u000a\u000a See http://goo.gl/MqrFmX\u000a"); + } + var spawn = new PromiseSpawn(generatorFunction, this); + var ret = spawn.promise(); + spawn._run(Promise.spawn); + return ret; +}; +}; + +},{"./errors":12,"./util":36}],17:[function(_dereq_,module,exports){ +"use strict"; +module.exports = +function(Promise, PromiseArray, tryConvertToPromise, INTERNAL, async, + getDomain) { +var util = _dereq_("./util"); +var canEvaluate = util.canEvaluate; +var tryCatch = util.tryCatch; +var errorObj = util.errorObj; +var reject; + +if (!true) { +if (canEvaluate) { + var thenCallback = function(i) { + return new Function("value", "holder", " \n\ + 'use strict'; \n\ + holder.pIndex = value; \n\ + holder.checkFulfillment(this); \n\ + ".replace(/Index/g, i)); + }; + + var promiseSetter = function(i) { + return new Function("promise", "holder", " \n\ + 'use strict'; \n\ + holder.pIndex = promise; \n\ + ".replace(/Index/g, i)); + }; + + var generateHolderClass = function(total) { + var props = new Array(total); + for (var i = 0; i < props.length; ++i) { + props[i] = "this.p" + (i+1); + } + var assignment = props.join(" = ") + " = null;"; + var cancellationCode= "var promise;\n" + props.map(function(prop) { + return " \n\ + promise = " + prop + "; \n\ + if (promise instanceof Promise) { \n\ + promise.cancel(); \n\ + } \n\ + "; + }).join("\n"); + var passedArguments = props.join(", "); + var name = "Holder$" + total; + + + var code = "return function(tryCatch, errorObj, Promise, async) { \n\ + 'use strict'; \n\ + function [TheName](fn) { \n\ + [TheProperties] \n\ + this.fn = fn; \n\ + this.asyncNeeded = true; \n\ + this.now = 0; \n\ + } \n\ + \n\ + [TheName].prototype._callFunction = function(promise) { \n\ + promise._pushContext(); \n\ + var ret = tryCatch(this.fn)([ThePassedArguments]); \n\ + promise._popContext(); \n\ + if (ret === errorObj) { \n\ + promise._rejectCallback(ret.e, false); \n\ + } else { \n\ + promise._resolveCallback(ret); \n\ + } \n\ + }; \n\ + \n\ + [TheName].prototype.checkFulfillment = function(promise) { \n\ + var now = ++this.now; \n\ + if (now === [TheTotal]) { \n\ + if (this.asyncNeeded) { \n\ + async.invoke(this._callFunction, this, promise); \n\ + } else { \n\ + this._callFunction(promise); \n\ + } \n\ + \n\ + } \n\ + }; \n\ + \n\ + [TheName].prototype._resultCancelled = function() { \n\ + [CancellationCode] \n\ + }; \n\ + \n\ + return [TheName]; \n\ + }(tryCatch, errorObj, Promise, async); \n\ + "; + + code = code.replace(/\[TheName\]/g, name) + .replace(/\[TheTotal\]/g, total) + .replace(/\[ThePassedArguments\]/g, passedArguments) + .replace(/\[TheProperties\]/g, assignment) + .replace(/\[CancellationCode\]/g, cancellationCode); + + return new Function("tryCatch", "errorObj", "Promise", "async", code) + (tryCatch, errorObj, Promise, async); + }; + + var holderClasses = []; + var thenCallbacks = []; + var promiseSetters = []; + + for (var i = 0; i < 8; ++i) { + holderClasses.push(generateHolderClass(i + 1)); + thenCallbacks.push(thenCallback(i + 1)); + promiseSetters.push(promiseSetter(i + 1)); + } + + reject = function (reason) { + this._reject(reason); + }; +}} + +Promise.join = function () { + var last = arguments.length - 1; + var fn; + if (last > 0 && typeof arguments[last] === "function") { + fn = arguments[last]; + if (!true) { + if (last <= 8 && canEvaluate) { + var ret = new Promise(INTERNAL); + ret._captureStackTrace(); + var HolderClass = holderClasses[last - 1]; + var holder = new HolderClass(fn); + var callbacks = thenCallbacks; + + for (var i = 0; i < last; ++i) { + var maybePromise = tryConvertToPromise(arguments[i], ret); + if (maybePromise instanceof Promise) { + maybePromise = maybePromise._target(); + var bitField = maybePromise._bitField; + ; + if (((bitField & 50397184) === 0)) { + maybePromise._then(callbacks[i], reject, + undefined, ret, holder); + promiseSetters[i](maybePromise, holder); + holder.asyncNeeded = false; + } else if (((bitField & 33554432) !== 0)) { + callbacks[i].call(ret, + maybePromise._value(), holder); + } else if (((bitField & 16777216) !== 0)) { + ret._reject(maybePromise._reason()); + } else { + ret._cancel(); + } + } else { + callbacks[i].call(ret, maybePromise, holder); + } + } + + if (!ret._isFateSealed()) { + if (holder.asyncNeeded) { + var domain = getDomain(); + if (domain !== null) { + holder.fn = util.domainBind(domain, holder.fn); + } + } + ret._setAsyncGuaranteed(); + ret._setOnCancel(holder); + } + return ret; + } + } + } + var args = [].slice.call(arguments);; + if (fn) args.pop(); + var ret = new PromiseArray(args).promise(); + return fn !== undefined ? ret.spread(fn) : ret; +}; + +}; + +},{"./util":36}],18:[function(_dereq_,module,exports){ +"use strict"; +module.exports = function(Promise, + PromiseArray, + apiRejection, + tryConvertToPromise, + INTERNAL, + debug) { +var getDomain = Promise._getDomain; +var util = _dereq_("./util"); +var tryCatch = util.tryCatch; +var errorObj = util.errorObj; +var async = Promise._async; + +function MappingPromiseArray(promises, fn, limit, _filter) { + this.constructor$(promises); + this._promise._captureStackTrace(); + var domain = getDomain(); + this._callback = domain === null ? fn : util.domainBind(domain, fn); + this._preservedValues = _filter === INTERNAL + ? new Array(this.length()) + : null; + this._limit = limit; + this._inFlight = 0; + this._queue = []; + async.invoke(this._asyncInit, this, undefined); +} +util.inherits(MappingPromiseArray, PromiseArray); + +MappingPromiseArray.prototype._asyncInit = function() { + this._init$(undefined, -2); +}; + +MappingPromiseArray.prototype._init = function () {}; + +MappingPromiseArray.prototype._promiseFulfilled = function (value, index) { + var values = this._values; + var length = this.length(); + var preservedValues = this._preservedValues; + var limit = this._limit; + + if (index < 0) { + index = (index * -1) - 1; + values[index] = value; + if (limit >= 1) { + this._inFlight--; + this._drainQueue(); + if (this._isResolved()) return true; + } + } else { + if (limit >= 1 && this._inFlight >= limit) { + values[index] = value; + this._queue.push(index); + return false; + } + if (preservedValues !== null) preservedValues[index] = value; + + var promise = this._promise; + var callback = this._callback; + var receiver = promise._boundValue(); + promise._pushContext(); + var ret = tryCatch(callback).call(receiver, value, index, length); + var promiseCreated = promise._popContext(); + debug.checkForgottenReturns( + ret, + promiseCreated, + preservedValues !== null ? "Promise.filter" : "Promise.map", + promise + ); + if (ret === errorObj) { + this._reject(ret.e); + return true; + } + + var maybePromise = tryConvertToPromise(ret, this._promise); + if (maybePromise instanceof Promise) { + maybePromise = maybePromise._target(); + var bitField = maybePromise._bitField; + ; + if (((bitField & 50397184) === 0)) { + if (limit >= 1) this._inFlight++; + values[index] = maybePromise; + maybePromise._proxy(this, (index + 1) * -1); + return false; + } else if (((bitField & 33554432) !== 0)) { + ret = maybePromise._value(); + } else if (((bitField & 16777216) !== 0)) { + this._reject(maybePromise._reason()); + return true; + } else { + this._cancel(); + return true; + } + } + values[index] = ret; + } + var totalResolved = ++this._totalResolved; + if (totalResolved >= length) { + if (preservedValues !== null) { + this._filter(values, preservedValues); + } else { + this._resolve(values); + } + return true; + } + return false; +}; + +MappingPromiseArray.prototype._drainQueue = function () { + var queue = this._queue; + var limit = this._limit; + var values = this._values; + while (queue.length > 0 && this._inFlight < limit) { + if (this._isResolved()) return; + var index = queue.pop(); + this._promiseFulfilled(values[index], index); + } +}; + +MappingPromiseArray.prototype._filter = function (booleans, values) { + var len = values.length; + var ret = new Array(len); + var j = 0; + for (var i = 0; i < len; ++i) { + if (booleans[i]) ret[j++] = values[i]; + } + ret.length = j; + this._resolve(ret); +}; + +MappingPromiseArray.prototype.preservedValues = function () { + return this._preservedValues; +}; + +function map(promises, fn, options, _filter) { + if (typeof fn !== "function") { + return apiRejection("expecting a function but got " + util.classString(fn)); + } + + var limit = 0; + if (options !== undefined) { + if (typeof options === "object" && options !== null) { + if (typeof options.concurrency !== "number") { + return Promise.reject( + new TypeError("'concurrency' must be a number but it is " + + util.classString(options.concurrency))); + } + limit = options.concurrency; + } else { + return Promise.reject(new TypeError( + "options argument must be an object but it is " + + util.classString(options))); + } + } + limit = typeof limit === "number" && + isFinite(limit) && limit >= 1 ? limit : 0; + return new MappingPromiseArray(promises, fn, limit, _filter).promise(); +} + +Promise.prototype.map = function (fn, options) { + return map(this, fn, options, null); +}; + +Promise.map = function (promises, fn, options, _filter) { + return map(promises, fn, options, _filter); +}; + + +}; + +},{"./util":36}],19:[function(_dereq_,module,exports){ +"use strict"; +module.exports = +function(Promise, INTERNAL, tryConvertToPromise, apiRejection, debug) { +var util = _dereq_("./util"); +var tryCatch = util.tryCatch; + +Promise.method = function (fn) { + if (typeof fn !== "function") { + throw new Promise.TypeError("expecting a function but got " + util.classString(fn)); + } + return function () { + var ret = new Promise(INTERNAL); + ret._captureStackTrace(); + ret._pushContext(); + var value = tryCatch(fn).apply(this, arguments); + var promiseCreated = ret._popContext(); + debug.checkForgottenReturns( + value, promiseCreated, "Promise.method", ret); + ret._resolveFromSyncValue(value); + return ret; + }; +}; + +Promise.attempt = Promise["try"] = function (fn) { + if (typeof fn !== "function") { + return apiRejection("expecting a function but got " + util.classString(fn)); + } + var ret = new Promise(INTERNAL); + ret._captureStackTrace(); + ret._pushContext(); + var value; + if (arguments.length > 1) { + debug.deprecated("calling Promise.try with more than 1 argument"); + var arg = arguments[1]; + var ctx = arguments[2]; + value = util.isArray(arg) ? tryCatch(fn).apply(ctx, arg) + : tryCatch(fn).call(ctx, arg); + } else { + value = tryCatch(fn)(); + } + var promiseCreated = ret._popContext(); + debug.checkForgottenReturns( + value, promiseCreated, "Promise.try", ret); + ret._resolveFromSyncValue(value); + return ret; +}; + +Promise.prototype._resolveFromSyncValue = function (value) { + if (value === util.errorObj) { + this._rejectCallback(value.e, false); + } else { + this._resolveCallback(value, true); + } +}; +}; + +},{"./util":36}],20:[function(_dereq_,module,exports){ +"use strict"; +var util = _dereq_("./util"); +var maybeWrapAsError = util.maybeWrapAsError; +var errors = _dereq_("./errors"); +var OperationalError = errors.OperationalError; +var es5 = _dereq_("./es5"); + +function isUntypedError(obj) { + return obj instanceof Error && + es5.getPrototypeOf(obj) === Error.prototype; +} + +var rErrorKey = /^(?:name|message|stack|cause)$/; +function wrapAsOperationalError(obj) { + var ret; + if (isUntypedError(obj)) { + ret = new OperationalError(obj); + ret.name = obj.name; + ret.message = obj.message; + ret.stack = obj.stack; + var keys = es5.keys(obj); + for (var i = 0; i < keys.length; ++i) { + var key = keys[i]; + if (!rErrorKey.test(key)) { + ret[key] = obj[key]; + } + } + return ret; + } + util.markAsOriginatingFromRejection(obj); + return obj; +} + +function nodebackForPromise(promise, multiArgs) { + return function(err, value) { + if (promise === null) return; + if (err) { + var wrapped = wrapAsOperationalError(maybeWrapAsError(err)); + promise._attachExtraTrace(wrapped); + promise._reject(wrapped); + } else if (!multiArgs) { + promise._fulfill(value); + } else { + var args = [].slice.call(arguments, 1);; + promise._fulfill(args); + } + promise = null; + }; +} + +module.exports = nodebackForPromise; + +},{"./errors":12,"./es5":13,"./util":36}],21:[function(_dereq_,module,exports){ +"use strict"; +module.exports = function(Promise) { +var util = _dereq_("./util"); +var async = Promise._async; +var tryCatch = util.tryCatch; +var errorObj = util.errorObj; + +function spreadAdapter(val, nodeback) { + var promise = this; + if (!util.isArray(val)) return successAdapter.call(promise, val, nodeback); + var ret = + tryCatch(nodeback).apply(promise._boundValue(), [null].concat(val)); + if (ret === errorObj) { + async.throwLater(ret.e); + } +} + +function successAdapter(val, nodeback) { + var promise = this; + var receiver = promise._boundValue(); + var ret = val === undefined + ? tryCatch(nodeback).call(receiver, null) + : tryCatch(nodeback).call(receiver, null, val); + if (ret === errorObj) { + async.throwLater(ret.e); + } +} +function errorAdapter(reason, nodeback) { + var promise = this; + if (!reason) { + var newReason = new Error(reason + ""); + newReason.cause = reason; + reason = newReason; + } + var ret = tryCatch(nodeback).call(promise._boundValue(), reason); + if (ret === errorObj) { + async.throwLater(ret.e); + } +} + +Promise.prototype.asCallback = Promise.prototype.nodeify = function (nodeback, + options) { + if (typeof nodeback == "function") { + var adapter = successAdapter; + if (options !== undefined && Object(options).spread) { + adapter = spreadAdapter; + } + this._then( + adapter, + errorAdapter, + undefined, + this, + nodeback + ); + } + return this; +}; +}; + +},{"./util":36}],22:[function(_dereq_,module,exports){ +"use strict"; +module.exports = function() { +var makeSelfResolutionError = function () { + return new TypeError("circular promise resolution chain\u000a\u000a See http://goo.gl/MqrFmX\u000a"); +}; +var reflectHandler = function() { + return new Promise.PromiseInspection(this._target()); +}; +var apiRejection = function(msg) { + return Promise.reject(new TypeError(msg)); +}; +function Proxyable() {} +var UNDEFINED_BINDING = {}; +var util = _dereq_("./util"); + +var getDomain; +if (util.isNode) { + getDomain = function() { + var ret = process.domain; + if (ret === undefined) ret = null; + return ret; + }; +} else { + getDomain = function() { + return null; + }; +} +util.notEnumerableProp(Promise, "_getDomain", getDomain); + +var es5 = _dereq_("./es5"); +var Async = _dereq_("./async"); +var async = new Async(); +es5.defineProperty(Promise, "_async", {value: async}); +var errors = _dereq_("./errors"); +var TypeError = Promise.TypeError = errors.TypeError; +Promise.RangeError = errors.RangeError; +var CancellationError = Promise.CancellationError = errors.CancellationError; +Promise.TimeoutError = errors.TimeoutError; +Promise.OperationalError = errors.OperationalError; +Promise.RejectionError = errors.OperationalError; +Promise.AggregateError = errors.AggregateError; +var INTERNAL = function(){}; +var APPLY = {}; +var NEXT_FILTER = {}; +var tryConvertToPromise = _dereq_("./thenables")(Promise, INTERNAL); +var PromiseArray = + _dereq_("./promise_array")(Promise, INTERNAL, + tryConvertToPromise, apiRejection, Proxyable); +var Context = _dereq_("./context")(Promise); + /*jshint unused:false*/ +var createContext = Context.create; +var debug = _dereq_("./debuggability")(Promise, Context); +var CapturedTrace = debug.CapturedTrace; +var PassThroughHandlerContext = + _dereq_("./finally")(Promise, tryConvertToPromise, NEXT_FILTER); +var catchFilter = _dereq_("./catch_filter")(NEXT_FILTER); +var nodebackForPromise = _dereq_("./nodeback"); +var errorObj = util.errorObj; +var tryCatch = util.tryCatch; +function check(self, executor) { + if (self == null || self.constructor !== Promise) { + throw new TypeError("the promise constructor cannot be invoked directly\u000a\u000a See http://goo.gl/MqrFmX\u000a"); + } + if (typeof executor !== "function") { + throw new TypeError("expecting a function but got " + util.classString(executor)); + } + +} + +function Promise(executor) { + if (executor !== INTERNAL) { + check(this, executor); + } + this._bitField = 0; + this._fulfillmentHandler0 = undefined; + this._rejectionHandler0 = undefined; + this._promise0 = undefined; + this._receiver0 = undefined; + this._resolveFromExecutor(executor); + this._promiseCreated(); + this._fireEvent("promiseCreated", this); +} + +Promise.prototype.toString = function () { + return "[object Promise]"; +}; + +Promise.prototype.caught = Promise.prototype["catch"] = function (fn) { + var len = arguments.length; + if (len > 1) { + var catchInstances = new Array(len - 1), + j = 0, i; + for (i = 0; i < len - 1; ++i) { + var item = arguments[i]; + if (util.isObject(item)) { + catchInstances[j++] = item; + } else { + return apiRejection("Catch statement predicate: " + + "expecting an object but got " + util.classString(item)); + } + } + catchInstances.length = j; + fn = arguments[i]; + return this.then(undefined, catchFilter(catchInstances, fn, this)); + } + return this.then(undefined, fn); +}; + +Promise.prototype.reflect = function () { + return this._then(reflectHandler, + reflectHandler, undefined, this, undefined); +}; + +Promise.prototype.then = function (didFulfill, didReject) { + if (debug.warnings() && arguments.length > 0 && + typeof didFulfill !== "function" && + typeof didReject !== "function") { + var msg = ".then() only accepts functions but was passed: " + + util.classString(didFulfill); + if (arguments.length > 1) { + msg += ", " + util.classString(didReject); + } + this._warn(msg); + } + return this._then(didFulfill, didReject, undefined, undefined, undefined); +}; + +Promise.prototype.done = function (didFulfill, didReject) { + var promise = + this._then(didFulfill, didReject, undefined, undefined, undefined); + promise._setIsFinal(); +}; + +Promise.prototype.spread = function (fn) { + if (typeof fn !== "function") { + return apiRejection("expecting a function but got " + util.classString(fn)); + } + return this.all()._then(fn, undefined, undefined, APPLY, undefined); +}; + +Promise.prototype.toJSON = function () { + var ret = { + isFulfilled: false, + isRejected: false, + fulfillmentValue: undefined, + rejectionReason: undefined + }; + if (this.isFulfilled()) { + ret.fulfillmentValue = this.value(); + ret.isFulfilled = true; + } else if (this.isRejected()) { + ret.rejectionReason = this.reason(); + ret.isRejected = true; + } + return ret; +}; + +Promise.prototype.all = function () { + if (arguments.length > 0) { + this._warn(".all() was passed arguments but it does not take any"); + } + return new PromiseArray(this).promise(); +}; + +Promise.prototype.error = function (fn) { + return this.caught(util.originatesFromRejection, fn); +}; + +Promise.getNewLibraryCopy = module.exports; + +Promise.is = function (val) { + return val instanceof Promise; +}; + +Promise.fromNode = Promise.fromCallback = function(fn) { + var ret = new Promise(INTERNAL); + ret._captureStackTrace(); + var multiArgs = arguments.length > 1 ? !!Object(arguments[1]).multiArgs + : false; + var result = tryCatch(fn)(nodebackForPromise(ret, multiArgs)); + if (result === errorObj) { + ret._rejectCallback(result.e, true); + } + if (!ret._isFateSealed()) ret._setAsyncGuaranteed(); + return ret; +}; + +Promise.all = function (promises) { + return new PromiseArray(promises).promise(); +}; + +Promise.cast = function (obj) { + var ret = tryConvertToPromise(obj); + if (!(ret instanceof Promise)) { + ret = new Promise(INTERNAL); + ret._captureStackTrace(); + ret._setFulfilled(); + ret._rejectionHandler0 = obj; + } + return ret; +}; + +Promise.resolve = Promise.fulfilled = Promise.cast; + +Promise.reject = Promise.rejected = function (reason) { + var ret = new Promise(INTERNAL); + ret._captureStackTrace(); + ret._rejectCallback(reason, true); + return ret; +}; + +Promise.setScheduler = function(fn) { + if (typeof fn !== "function") { + throw new TypeError("expecting a function but got " + util.classString(fn)); + } + return async.setScheduler(fn); +}; + +Promise.prototype._then = function ( + didFulfill, + didReject, + _, receiver, + internalData +) { + var haveInternalData = internalData !== undefined; + var promise = haveInternalData ? internalData : new Promise(INTERNAL); + var target = this._target(); + var bitField = target._bitField; + + if (!haveInternalData) { + promise._propagateFrom(this, 3); + promise._captureStackTrace(); + if (receiver === undefined && + ((this._bitField & 2097152) !== 0)) { + if (!((bitField & 50397184) === 0)) { + receiver = this._boundValue(); + } else { + receiver = target === this ? undefined : this._boundTo; + } + } + this._fireEvent("promiseChained", this, promise); + } + + var domain = getDomain(); + if (!((bitField & 50397184) === 0)) { + var handler, value, settler = target._settlePromiseCtx; + if (((bitField & 33554432) !== 0)) { + value = target._rejectionHandler0; + handler = didFulfill; + } else if (((bitField & 16777216) !== 0)) { + value = target._fulfillmentHandler0; + handler = didReject; + target._unsetRejectionIsUnhandled(); + } else { + settler = target._settlePromiseLateCancellationObserver; + value = new CancellationError("late cancellation observer"); + target._attachExtraTrace(value); + handler = didReject; + } + + async.invoke(settler, target, { + handler: domain === null ? handler + : (typeof handler === "function" && + util.domainBind(domain, handler)), + promise: promise, + receiver: receiver, + value: value + }); + } else { + target._addCallbacks(didFulfill, didReject, promise, receiver, domain); + } + + return promise; +}; + +Promise.prototype._length = function () { + return this._bitField & 65535; +}; + +Promise.prototype._isFateSealed = function () { + return (this._bitField & 117506048) !== 0; +}; + +Promise.prototype._isFollowing = function () { + return (this._bitField & 67108864) === 67108864; +}; + +Promise.prototype._setLength = function (len) { + this._bitField = (this._bitField & -65536) | + (len & 65535); +}; + +Promise.prototype._setFulfilled = function () { + this._bitField = this._bitField | 33554432; + this._fireEvent("promiseFulfilled", this); +}; + +Promise.prototype._setRejected = function () { + this._bitField = this._bitField | 16777216; + this._fireEvent("promiseRejected", this); +}; + +Promise.prototype._setFollowing = function () { + this._bitField = this._bitField | 67108864; + this._fireEvent("promiseResolved", this); +}; + +Promise.prototype._setIsFinal = function () { + this._bitField = this._bitField | 4194304; +}; + +Promise.prototype._isFinal = function () { + return (this._bitField & 4194304) > 0; +}; + +Promise.prototype._unsetCancelled = function() { + this._bitField = this._bitField & (~65536); +}; + +Promise.prototype._setCancelled = function() { + this._bitField = this._bitField | 65536; + this._fireEvent("promiseCancelled", this); +}; + +Promise.prototype._setWillBeCancelled = function() { + this._bitField = this._bitField | 8388608; +}; + +Promise.prototype._setAsyncGuaranteed = function() { + if (async.hasCustomScheduler()) return; + this._bitField = this._bitField | 134217728; +}; + +Promise.prototype._receiverAt = function (index) { + var ret = index === 0 ? this._receiver0 : this[ + index * 4 - 4 + 3]; + if (ret === UNDEFINED_BINDING) { + return undefined; + } else if (ret === undefined && this._isBound()) { + return this._boundValue(); + } + return ret; +}; + +Promise.prototype._promiseAt = function (index) { + return this[ + index * 4 - 4 + 2]; +}; + +Promise.prototype._fulfillmentHandlerAt = function (index) { + return this[ + index * 4 - 4 + 0]; +}; + +Promise.prototype._rejectionHandlerAt = function (index) { + return this[ + index * 4 - 4 + 1]; +}; + +Promise.prototype._boundValue = function() {}; + +Promise.prototype._migrateCallback0 = function (follower) { + var bitField = follower._bitField; + var fulfill = follower._fulfillmentHandler0; + var reject = follower._rejectionHandler0; + var promise = follower._promise0; + var receiver = follower._receiverAt(0); + if (receiver === undefined) receiver = UNDEFINED_BINDING; + this._addCallbacks(fulfill, reject, promise, receiver, null); +}; + +Promise.prototype._migrateCallbackAt = function (follower, index) { + var fulfill = follower._fulfillmentHandlerAt(index); + var reject = follower._rejectionHandlerAt(index); + var promise = follower._promiseAt(index); + var receiver = follower._receiverAt(index); + if (receiver === undefined) receiver = UNDEFINED_BINDING; + this._addCallbacks(fulfill, reject, promise, receiver, null); +}; + +Promise.prototype._addCallbacks = function ( + fulfill, + reject, + promise, + receiver, + domain +) { + var index = this._length(); + + if (index >= 65535 - 4) { + index = 0; + this._setLength(0); + } + + if (index === 0) { + this._promise0 = promise; + this._receiver0 = receiver; + if (typeof fulfill === "function") { + this._fulfillmentHandler0 = + domain === null ? fulfill : util.domainBind(domain, fulfill); + } + if (typeof reject === "function") { + this._rejectionHandler0 = + domain === null ? reject : util.domainBind(domain, reject); + } + } else { + var base = index * 4 - 4; + this[base + 2] = promise; + this[base + 3] = receiver; + if (typeof fulfill === "function") { + this[base + 0] = + domain === null ? fulfill : util.domainBind(domain, fulfill); + } + if (typeof reject === "function") { + this[base + 1] = + domain === null ? reject : util.domainBind(domain, reject); + } + } + this._setLength(index + 1); + return index; +}; + +Promise.prototype._proxy = function (proxyable, arg) { + this._addCallbacks(undefined, undefined, arg, proxyable, null); +}; + +Promise.prototype._resolveCallback = function(value, shouldBind) { + if (((this._bitField & 117506048) !== 0)) return; + if (value === this) + return this._rejectCallback(makeSelfResolutionError(), false); + var maybePromise = tryConvertToPromise(value, this); + if (!(maybePromise instanceof Promise)) return this._fulfill(value); + + if (shouldBind) this._propagateFrom(maybePromise, 2); + + var promise = maybePromise._target(); + + if (promise === this) { + this._reject(makeSelfResolutionError()); + return; + } + + var bitField = promise._bitField; + if (((bitField & 50397184) === 0)) { + var len = this._length(); + if (len > 0) promise._migrateCallback0(this); + for (var i = 1; i < len; ++i) { + promise._migrateCallbackAt(this, i); + } + this._setFollowing(); + this._setLength(0); + this._setFollowee(promise); + } else if (((bitField & 33554432) !== 0)) { + this._fulfill(promise._value()); + } else if (((bitField & 16777216) !== 0)) { + this._reject(promise._reason()); + } else { + var reason = new CancellationError("late cancellation observer"); + promise._attachExtraTrace(reason); + this._reject(reason); + } +}; + +Promise.prototype._rejectCallback = +function(reason, synchronous, ignoreNonErrorWarnings) { + var trace = util.ensureErrorObject(reason); + var hasStack = trace === reason; + if (!hasStack && !ignoreNonErrorWarnings && debug.warnings()) { + var message = "a promise was rejected with a non-error: " + + util.classString(reason); + this._warn(message, true); + } + this._attachExtraTrace(trace, synchronous ? hasStack : false); + this._reject(reason); +}; + +Promise.prototype._resolveFromExecutor = function (executor) { + if (executor === INTERNAL) return; + var promise = this; + this._captureStackTrace(); + this._pushContext(); + var synchronous = true; + var r = this._execute(executor, function(value) { + promise._resolveCallback(value); + }, function (reason) { + promise._rejectCallback(reason, synchronous); + }); + synchronous = false; + this._popContext(); + + if (r !== undefined) { + promise._rejectCallback(r, true); + } +}; + +Promise.prototype._settlePromiseFromHandler = function ( + handler, receiver, value, promise +) { + var bitField = promise._bitField; + if (((bitField & 65536) !== 0)) return; + promise._pushContext(); + var x; + if (receiver === APPLY) { + if (!value || typeof value.length !== "number") { + x = errorObj; + x.e = new TypeError("cannot .spread() a non-array: " + + util.classString(value)); + } else { + x = tryCatch(handler).apply(this._boundValue(), value); + } + } else { + x = tryCatch(handler).call(receiver, value); + } + var promiseCreated = promise._popContext(); + bitField = promise._bitField; + if (((bitField & 65536) !== 0)) return; + + if (x === NEXT_FILTER) { + promise._reject(value); + } else if (x === errorObj) { + promise._rejectCallback(x.e, false); + } else { + debug.checkForgottenReturns(x, promiseCreated, "", promise, this); + promise._resolveCallback(x); + } +}; + +Promise.prototype._target = function() { + var ret = this; + while (ret._isFollowing()) ret = ret._followee(); + return ret; +}; + +Promise.prototype._followee = function() { + return this._rejectionHandler0; +}; + +Promise.prototype._setFollowee = function(promise) { + this._rejectionHandler0 = promise; +}; + +Promise.prototype._settlePromise = function(promise, handler, receiver, value) { + var isPromise = promise instanceof Promise; + var bitField = this._bitField; + var asyncGuaranteed = ((bitField & 134217728) !== 0); + if (((bitField & 65536) !== 0)) { + if (isPromise) promise._invokeInternalOnCancel(); + + if (receiver instanceof PassThroughHandlerContext && + receiver.isFinallyHandler()) { + receiver.cancelPromise = promise; + if (tryCatch(handler).call(receiver, value) === errorObj) { + promise._reject(errorObj.e); + } + } else if (handler === reflectHandler) { + promise._fulfill(reflectHandler.call(receiver)); + } else if (receiver instanceof Proxyable) { + receiver._promiseCancelled(promise); + } else if (isPromise || promise instanceof PromiseArray) { + promise._cancel(); + } else { + receiver.cancel(); + } + } else if (typeof handler === "function") { + if (!isPromise) { + handler.call(receiver, value, promise); + } else { + if (asyncGuaranteed) promise._setAsyncGuaranteed(); + this._settlePromiseFromHandler(handler, receiver, value, promise); + } + } else if (receiver instanceof Proxyable) { + if (!receiver._isResolved()) { + if (((bitField & 33554432) !== 0)) { + receiver._promiseFulfilled(value, promise); + } else { + receiver._promiseRejected(value, promise); + } + } + } else if (isPromise) { + if (asyncGuaranteed) promise._setAsyncGuaranteed(); + if (((bitField & 33554432) !== 0)) { + promise._fulfill(value); + } else { + promise._reject(value); + } + } +}; + +Promise.prototype._settlePromiseLateCancellationObserver = function(ctx) { + var handler = ctx.handler; + var promise = ctx.promise; + var receiver = ctx.receiver; + var value = ctx.value; + if (typeof handler === "function") { + if (!(promise instanceof Promise)) { + handler.call(receiver, value, promise); + } else { + this._settlePromiseFromHandler(handler, receiver, value, promise); + } + } else if (promise instanceof Promise) { + promise._reject(value); + } +}; + +Promise.prototype._settlePromiseCtx = function(ctx) { + this._settlePromise(ctx.promise, ctx.handler, ctx.receiver, ctx.value); +}; + +Promise.prototype._settlePromise0 = function(handler, value, bitField) { + var promise = this._promise0; + var receiver = this._receiverAt(0); + this._promise0 = undefined; + this._receiver0 = undefined; + this._settlePromise(promise, handler, receiver, value); +}; + +Promise.prototype._clearCallbackDataAtIndex = function(index) { + var base = index * 4 - 4; + this[base + 2] = + this[base + 3] = + this[base + 0] = + this[base + 1] = undefined; +}; + +Promise.prototype._fulfill = function (value) { + var bitField = this._bitField; + if (((bitField & 117506048) >>> 16)) return; + if (value === this) { + var err = makeSelfResolutionError(); + this._attachExtraTrace(err); + return this._reject(err); + } + this._setFulfilled(); + this._rejectionHandler0 = value; + + if ((bitField & 65535) > 0) { + if (((bitField & 134217728) !== 0)) { + this._settlePromises(); + } else { + async.settlePromises(this); + } + } +}; + +Promise.prototype._reject = function (reason) { + var bitField = this._bitField; + if (((bitField & 117506048) >>> 16)) return; + this._setRejected(); + this._fulfillmentHandler0 = reason; + + if (this._isFinal()) { + return async.fatalError(reason, util.isNode); + } + + if ((bitField & 65535) > 0) { + async.settlePromises(this); + } else { + this._ensurePossibleRejectionHandled(); + } +}; + +Promise.prototype._fulfillPromises = function (len, value) { + for (var i = 1; i < len; i++) { + var handler = this._fulfillmentHandlerAt(i); + var promise = this._promiseAt(i); + var receiver = this._receiverAt(i); + this._clearCallbackDataAtIndex(i); + this._settlePromise(promise, handler, receiver, value); + } +}; + +Promise.prototype._rejectPromises = function (len, reason) { + for (var i = 1; i < len; i++) { + var handler = this._rejectionHandlerAt(i); + var promise = this._promiseAt(i); + var receiver = this._receiverAt(i); + this._clearCallbackDataAtIndex(i); + this._settlePromise(promise, handler, receiver, reason); + } +}; + +Promise.prototype._settlePromises = function () { + var bitField = this._bitField; + var len = (bitField & 65535); + + if (len > 0) { + if (((bitField & 16842752) !== 0)) { + var reason = this._fulfillmentHandler0; + this._settlePromise0(this._rejectionHandler0, reason, bitField); + this._rejectPromises(len, reason); + } else { + var value = this._rejectionHandler0; + this._settlePromise0(this._fulfillmentHandler0, value, bitField); + this._fulfillPromises(len, value); + } + this._setLength(0); + } + this._clearCancellationData(); +}; + +Promise.prototype._settledValue = function() { + var bitField = this._bitField; + if (((bitField & 33554432) !== 0)) { + return this._rejectionHandler0; + } else if (((bitField & 16777216) !== 0)) { + return this._fulfillmentHandler0; + } +}; + +function deferResolve(v) {this.promise._resolveCallback(v);} +function deferReject(v) {this.promise._rejectCallback(v, false);} + +Promise.defer = Promise.pending = function() { + debug.deprecated("Promise.defer", "new Promise"); + var promise = new Promise(INTERNAL); + return { + promise: promise, + resolve: deferResolve, + reject: deferReject + }; +}; + +util.notEnumerableProp(Promise, + "_makeSelfResolutionError", + makeSelfResolutionError); + +_dereq_("./method")(Promise, INTERNAL, tryConvertToPromise, apiRejection, + debug); +_dereq_("./bind")(Promise, INTERNAL, tryConvertToPromise, debug); +_dereq_("./cancel")(Promise, PromiseArray, apiRejection, debug); +_dereq_("./direct_resolve")(Promise); +_dereq_("./synchronous_inspection")(Promise); +_dereq_("./join")( + Promise, PromiseArray, tryConvertToPromise, INTERNAL, async, getDomain); +Promise.Promise = Promise; +Promise.version = "3.5.0"; +_dereq_('./map.js')(Promise, PromiseArray, apiRejection, tryConvertToPromise, INTERNAL, debug); +_dereq_('./call_get.js')(Promise); +_dereq_('./using.js')(Promise, apiRejection, tryConvertToPromise, createContext, INTERNAL, debug); +_dereq_('./timers.js')(Promise, INTERNAL, debug); +_dereq_('./generators.js')(Promise, apiRejection, INTERNAL, tryConvertToPromise, Proxyable, debug); +_dereq_('./nodeify.js')(Promise); +_dereq_('./promisify.js')(Promise, INTERNAL); +_dereq_('./props.js')(Promise, PromiseArray, tryConvertToPromise, apiRejection); +_dereq_('./race.js')(Promise, INTERNAL, tryConvertToPromise, apiRejection); +_dereq_('./reduce.js')(Promise, PromiseArray, apiRejection, tryConvertToPromise, INTERNAL, debug); +_dereq_('./settle.js')(Promise, PromiseArray, debug); +_dereq_('./some.js')(Promise, PromiseArray, apiRejection); +_dereq_('./filter.js')(Promise, INTERNAL); +_dereq_('./each.js')(Promise, INTERNAL); +_dereq_('./any.js')(Promise); + + util.toFastProperties(Promise); + util.toFastProperties(Promise.prototype); + function fillTypes(value) { + var p = new Promise(INTERNAL); + p._fulfillmentHandler0 = value; + p._rejectionHandler0 = value; + p._promise0 = value; + p._receiver0 = value; + } + // Complete slack tracking, opt out of field-type tracking and + // stabilize map + fillTypes({a: 1}); + fillTypes({b: 2}); + fillTypes({c: 3}); + fillTypes(1); + fillTypes(function(){}); + fillTypes(undefined); + fillTypes(false); + fillTypes(new Promise(INTERNAL)); + debug.setBounds(Async.firstLineError, util.lastLineError); + return Promise; + +}; + +},{"./any.js":1,"./async":2,"./bind":3,"./call_get.js":5,"./cancel":6,"./catch_filter":7,"./context":8,"./debuggability":9,"./direct_resolve":10,"./each.js":11,"./errors":12,"./es5":13,"./filter.js":14,"./finally":15,"./generators.js":16,"./join":17,"./map.js":18,"./method":19,"./nodeback":20,"./nodeify.js":21,"./promise_array":23,"./promisify.js":24,"./props.js":25,"./race.js":27,"./reduce.js":28,"./settle.js":30,"./some.js":31,"./synchronous_inspection":32,"./thenables":33,"./timers.js":34,"./using.js":35,"./util":36}],23:[function(_dereq_,module,exports){ +"use strict"; +module.exports = function(Promise, INTERNAL, tryConvertToPromise, + apiRejection, Proxyable) { +var util = _dereq_("./util"); +var isArray = util.isArray; + +function toResolutionValue(val) { + switch(val) { + case -2: return []; + case -3: return {}; + case -6: return new Map(); + } +} + +function PromiseArray(values) { + var promise = this._promise = new Promise(INTERNAL); + if (values instanceof Promise) { + promise._propagateFrom(values, 3); + } + promise._setOnCancel(this); + this._values = values; + this._length = 0; + this._totalResolved = 0; + this._init(undefined, -2); +} +util.inherits(PromiseArray, Proxyable); + +PromiseArray.prototype.length = function () { + return this._length; +}; + +PromiseArray.prototype.promise = function () { + return this._promise; +}; + +PromiseArray.prototype._init = function init(_, resolveValueIfEmpty) { + var values = tryConvertToPromise(this._values, this._promise); + if (values instanceof Promise) { + values = values._target(); + var bitField = values._bitField; + ; + this._values = values; + + if (((bitField & 50397184) === 0)) { + this._promise._setAsyncGuaranteed(); + return values._then( + init, + this._reject, + undefined, + this, + resolveValueIfEmpty + ); + } else if (((bitField & 33554432) !== 0)) { + values = values._value(); + } else if (((bitField & 16777216) !== 0)) { + return this._reject(values._reason()); + } else { + return this._cancel(); + } + } + values = util.asArray(values); + if (values === null) { + var err = apiRejection( + "expecting an array or an iterable object but got " + util.classString(values)).reason(); + this._promise._rejectCallback(err, false); + return; + } + + if (values.length === 0) { + if (resolveValueIfEmpty === -5) { + this._resolveEmptyArray(); + } + else { + this._resolve(toResolutionValue(resolveValueIfEmpty)); + } + return; + } + this._iterate(values); +}; + +PromiseArray.prototype._iterate = function(values) { + var len = this.getActualLength(values.length); + this._length = len; + this._values = this.shouldCopyValues() ? new Array(len) : this._values; + var result = this._promise; + var isResolved = false; + var bitField = null; + for (var i = 0; i < len; ++i) { + var maybePromise = tryConvertToPromise(values[i], result); + + if (maybePromise instanceof Promise) { + maybePromise = maybePromise._target(); + bitField = maybePromise._bitField; + } else { + bitField = null; + } + + if (isResolved) { + if (bitField !== null) { + maybePromise.suppressUnhandledRejections(); + } + } else if (bitField !== null) { + if (((bitField & 50397184) === 0)) { + maybePromise._proxy(this, i); + this._values[i] = maybePromise; + } else if (((bitField & 33554432) !== 0)) { + isResolved = this._promiseFulfilled(maybePromise._value(), i); + } else if (((bitField & 16777216) !== 0)) { + isResolved = this._promiseRejected(maybePromise._reason(), i); + } else { + isResolved = this._promiseCancelled(i); + } + } else { + isResolved = this._promiseFulfilled(maybePromise, i); + } + } + if (!isResolved) result._setAsyncGuaranteed(); +}; + +PromiseArray.prototype._isResolved = function () { + return this._values === null; +}; + +PromiseArray.prototype._resolve = function (value) { + this._values = null; + this._promise._fulfill(value); +}; + +PromiseArray.prototype._cancel = function() { + if (this._isResolved() || !this._promise._isCancellable()) return; + this._values = null; + this._promise._cancel(); +}; + +PromiseArray.prototype._reject = function (reason) { + this._values = null; + this._promise._rejectCallback(reason, false); +}; + +PromiseArray.prototype._promiseFulfilled = function (value, index) { + this._values[index] = value; + var totalResolved = ++this._totalResolved; + if (totalResolved >= this._length) { + this._resolve(this._values); + return true; + } + return false; +}; + +PromiseArray.prototype._promiseCancelled = function() { + this._cancel(); + return true; +}; + +PromiseArray.prototype._promiseRejected = function (reason) { + this._totalResolved++; + this._reject(reason); + return true; +}; + +PromiseArray.prototype._resultCancelled = function() { + if (this._isResolved()) return; + var values = this._values; + this._cancel(); + if (values instanceof Promise) { + values.cancel(); + } else { + for (var i = 0; i < values.length; ++i) { + if (values[i] instanceof Promise) { + values[i].cancel(); + } + } + } +}; + +PromiseArray.prototype.shouldCopyValues = function () { + return true; +}; + +PromiseArray.prototype.getActualLength = function (len) { + return len; +}; + +return PromiseArray; +}; + +},{"./util":36}],24:[function(_dereq_,module,exports){ +"use strict"; +module.exports = function(Promise, INTERNAL) { +var THIS = {}; +var util = _dereq_("./util"); +var nodebackForPromise = _dereq_("./nodeback"); +var withAppended = util.withAppended; +var maybeWrapAsError = util.maybeWrapAsError; +var canEvaluate = util.canEvaluate; +var TypeError = _dereq_("./errors").TypeError; +var defaultSuffix = "Async"; +var defaultPromisified = {__isPromisified__: true}; +var noCopyProps = [ + "arity", "length", + "name", + "arguments", + "caller", + "callee", + "prototype", + "__isPromisified__" +]; +var noCopyPropsPattern = new RegExp("^(?:" + noCopyProps.join("|") + ")$"); + +var defaultFilter = function(name) { + return util.isIdentifier(name) && + name.charAt(0) !== "_" && + name !== "constructor"; +}; + +function propsFilter(key) { + return !noCopyPropsPattern.test(key); +} + +function isPromisified(fn) { + try { + return fn.__isPromisified__ === true; + } + catch (e) { + return false; + } +} + +function hasPromisified(obj, key, suffix) { + var val = util.getDataPropertyOrDefault(obj, key + suffix, + defaultPromisified); + return val ? isPromisified(val) : false; +} +function checkValid(ret, suffix, suffixRegexp) { + for (var i = 0; i < ret.length; i += 2) { + var key = ret[i]; + if (suffixRegexp.test(key)) { + var keyWithoutAsyncSuffix = key.replace(suffixRegexp, ""); + for (var j = 0; j < ret.length; j += 2) { + if (ret[j] === keyWithoutAsyncSuffix) { + throw new TypeError("Cannot promisify an API that has normal methods with '%s'-suffix\u000a\u000a See http://goo.gl/MqrFmX\u000a" + .replace("%s", suffix)); + } + } + } + } +} + +function promisifiableMethods(obj, suffix, suffixRegexp, filter) { + var keys = util.inheritedDataKeys(obj); + var ret = []; + for (var i = 0; i < keys.length; ++i) { + var key = keys[i]; + var value = obj[key]; + var passesDefaultFilter = filter === defaultFilter + ? true : defaultFilter(key, value, obj); + if (typeof value === "function" && + !isPromisified(value) && + !hasPromisified(obj, key, suffix) && + filter(key, value, obj, passesDefaultFilter)) { + ret.push(key, value); + } + } + checkValid(ret, suffix, suffixRegexp); + return ret; +} + +var escapeIdentRegex = function(str) { + return str.replace(/([$])/, "\\$"); +}; + +var makeNodePromisifiedEval; +if (!true) { +var switchCaseArgumentOrder = function(likelyArgumentCount) { + var ret = [likelyArgumentCount]; + var min = Math.max(0, likelyArgumentCount - 1 - 3); + for(var i = likelyArgumentCount - 1; i >= min; --i) { + ret.push(i); + } + for(var i = likelyArgumentCount + 1; i <= 3; ++i) { + ret.push(i); + } + return ret; +}; + +var argumentSequence = function(argumentCount) { + return util.filledRange(argumentCount, "_arg", ""); +}; + +var parameterDeclaration = function(parameterCount) { + return util.filledRange( + Math.max(parameterCount, 3), "_arg", ""); +}; + +var parameterCount = function(fn) { + if (typeof fn.length === "number") { + return Math.max(Math.min(fn.length, 1023 + 1), 0); + } + return 0; +}; + +makeNodePromisifiedEval = +function(callback, receiver, originalName, fn, _, multiArgs) { + var newParameterCount = Math.max(0, parameterCount(fn) - 1); + var argumentOrder = switchCaseArgumentOrder(newParameterCount); + var shouldProxyThis = typeof callback === "string" || receiver === THIS; + + function generateCallForArgumentCount(count) { + var args = argumentSequence(count).join(", "); + var comma = count > 0 ? ", " : ""; + var ret; + if (shouldProxyThis) { + ret = "ret = callback.call(this, {{args}}, nodeback); break;\n"; + } else { + ret = receiver === undefined + ? "ret = callback({{args}}, nodeback); break;\n" + : "ret = callback.call(receiver, {{args}}, nodeback); break;\n"; + } + return ret.replace("{{args}}", args).replace(", ", comma); + } + + function generateArgumentSwitchCase() { + var ret = ""; + for (var i = 0; i < argumentOrder.length; ++i) { + ret += "case " + argumentOrder[i] +":" + + generateCallForArgumentCount(argumentOrder[i]); + } + + ret += " \n\ + default: \n\ + var args = new Array(len + 1); \n\ + var i = 0; \n\ + for (var i = 0; i < len; ++i) { \n\ + args[i] = arguments[i]; \n\ + } \n\ + args[i] = nodeback; \n\ + [CodeForCall] \n\ + break; \n\ + ".replace("[CodeForCall]", (shouldProxyThis + ? "ret = callback.apply(this, args);\n" + : "ret = callback.apply(receiver, args);\n")); + return ret; + } + + var getFunctionCode = typeof callback === "string" + ? ("this != null ? this['"+callback+"'] : fn") + : "fn"; + var body = "'use strict'; \n\ + var ret = function (Parameters) { \n\ + 'use strict'; \n\ + var len = arguments.length; \n\ + var promise = new Promise(INTERNAL); \n\ + promise._captureStackTrace(); \n\ + var nodeback = nodebackForPromise(promise, " + multiArgs + "); \n\ + var ret; \n\ + var callback = tryCatch([GetFunctionCode]); \n\ + switch(len) { \n\ + [CodeForSwitchCase] \n\ + } \n\ + if (ret === errorObj) { \n\ + promise._rejectCallback(maybeWrapAsError(ret.e), true, true);\n\ + } \n\ + if (!promise._isFateSealed()) promise._setAsyncGuaranteed(); \n\ + return promise; \n\ + }; \n\ + notEnumerableProp(ret, '__isPromisified__', true); \n\ + return ret; \n\ + ".replace("[CodeForSwitchCase]", generateArgumentSwitchCase()) + .replace("[GetFunctionCode]", getFunctionCode); + body = body.replace("Parameters", parameterDeclaration(newParameterCount)); + return new Function("Promise", + "fn", + "receiver", + "withAppended", + "maybeWrapAsError", + "nodebackForPromise", + "tryCatch", + "errorObj", + "notEnumerableProp", + "INTERNAL", + body)( + Promise, + fn, + receiver, + withAppended, + maybeWrapAsError, + nodebackForPromise, + util.tryCatch, + util.errorObj, + util.notEnumerableProp, + INTERNAL); +}; +} + +function makeNodePromisifiedClosure(callback, receiver, _, fn, __, multiArgs) { + var defaultThis = (function() {return this;})(); + var method = callback; + if (typeof method === "string") { + callback = fn; + } + function promisified() { + var _receiver = receiver; + if (receiver === THIS) _receiver = this; + var promise = new Promise(INTERNAL); + promise._captureStackTrace(); + var cb = typeof method === "string" && this !== defaultThis + ? this[method] : callback; + var fn = nodebackForPromise(promise, multiArgs); + try { + cb.apply(_receiver, withAppended(arguments, fn)); + } catch(e) { + promise._rejectCallback(maybeWrapAsError(e), true, true); + } + if (!promise._isFateSealed()) promise._setAsyncGuaranteed(); + return promise; + } + util.notEnumerableProp(promisified, "__isPromisified__", true); + return promisified; +} + +var makeNodePromisified = canEvaluate + ? makeNodePromisifiedEval + : makeNodePromisifiedClosure; + +function promisifyAll(obj, suffix, filter, promisifier, multiArgs) { + var suffixRegexp = new RegExp(escapeIdentRegex(suffix) + "$"); + var methods = + promisifiableMethods(obj, suffix, suffixRegexp, filter); + + for (var i = 0, len = methods.length; i < len; i+= 2) { + var key = methods[i]; + var fn = methods[i+1]; + var promisifiedKey = key + suffix; + if (promisifier === makeNodePromisified) { + obj[promisifiedKey] = + makeNodePromisified(key, THIS, key, fn, suffix, multiArgs); + } else { + var promisified = promisifier(fn, function() { + return makeNodePromisified(key, THIS, key, + fn, suffix, multiArgs); + }); + util.notEnumerableProp(promisified, "__isPromisified__", true); + obj[promisifiedKey] = promisified; + } + } + util.toFastProperties(obj); + return obj; +} + +function promisify(callback, receiver, multiArgs) { + return makeNodePromisified(callback, receiver, undefined, + callback, null, multiArgs); +} + +Promise.promisify = function (fn, options) { + if (typeof fn !== "function") { + throw new TypeError("expecting a function but got " + util.classString(fn)); + } + if (isPromisified(fn)) { + return fn; + } + options = Object(options); + var receiver = options.context === undefined ? THIS : options.context; + var multiArgs = !!options.multiArgs; + var ret = promisify(fn, receiver, multiArgs); + util.copyDescriptors(fn, ret, propsFilter); + return ret; +}; + +Promise.promisifyAll = function (target, options) { + if (typeof target !== "function" && typeof target !== "object") { + throw new TypeError("the target of promisifyAll must be an object or a function\u000a\u000a See http://goo.gl/MqrFmX\u000a"); + } + options = Object(options); + var multiArgs = !!options.multiArgs; + var suffix = options.suffix; + if (typeof suffix !== "string") suffix = defaultSuffix; + var filter = options.filter; + if (typeof filter !== "function") filter = defaultFilter; + var promisifier = options.promisifier; + if (typeof promisifier !== "function") promisifier = makeNodePromisified; + + if (!util.isIdentifier(suffix)) { + throw new RangeError("suffix must be a valid identifier\u000a\u000a See http://goo.gl/MqrFmX\u000a"); + } + + var keys = util.inheritedDataKeys(target); + for (var i = 0; i < keys.length; ++i) { + var value = target[keys[i]]; + if (keys[i] !== "constructor" && + util.isClass(value)) { + promisifyAll(value.prototype, suffix, filter, promisifier, + multiArgs); + promisifyAll(value, suffix, filter, promisifier, multiArgs); + } + } + + return promisifyAll(target, suffix, filter, promisifier, multiArgs); +}; +}; + + +},{"./errors":12,"./nodeback":20,"./util":36}],25:[function(_dereq_,module,exports){ +"use strict"; +module.exports = function( + Promise, PromiseArray, tryConvertToPromise, apiRejection) { +var util = _dereq_("./util"); +var isObject = util.isObject; +var es5 = _dereq_("./es5"); +var Es6Map; +if (typeof Map === "function") Es6Map = Map; + +var mapToEntries = (function() { + var index = 0; + var size = 0; + + function extractEntry(value, key) { + this[index] = value; + this[index + size] = key; + index++; + } + + return function mapToEntries(map) { + size = map.size; + index = 0; + var ret = new Array(map.size * 2); + map.forEach(extractEntry, ret); + return ret; + }; +})(); + +var entriesToMap = function(entries) { + var ret = new Es6Map(); + var length = entries.length / 2 | 0; + for (var i = 0; i < length; ++i) { + var key = entries[length + i]; + var value = entries[i]; + ret.set(key, value); + } + return ret; +}; + +function PropertiesPromiseArray(obj) { + var isMap = false; + var entries; + if (Es6Map !== undefined && obj instanceof Es6Map) { + entries = mapToEntries(obj); + isMap = true; + } else { + var keys = es5.keys(obj); + var len = keys.length; + entries = new Array(len * 2); + for (var i = 0; i < len; ++i) { + var key = keys[i]; + entries[i] = obj[key]; + entries[i + len] = key; + } + } + this.constructor$(entries); + this._isMap = isMap; + this._init$(undefined, isMap ? -6 : -3); +} +util.inherits(PropertiesPromiseArray, PromiseArray); + +PropertiesPromiseArray.prototype._init = function () {}; + +PropertiesPromiseArray.prototype._promiseFulfilled = function (value, index) { + this._values[index] = value; + var totalResolved = ++this._totalResolved; + if (totalResolved >= this._length) { + var val; + if (this._isMap) { + val = entriesToMap(this._values); + } else { + val = {}; + var keyOffset = this.length(); + for (var i = 0, len = this.length(); i < len; ++i) { + val[this._values[i + keyOffset]] = this._values[i]; + } + } + this._resolve(val); + return true; + } + return false; +}; + +PropertiesPromiseArray.prototype.shouldCopyValues = function () { + return false; +}; + +PropertiesPromiseArray.prototype.getActualLength = function (len) { + return len >> 1; +}; + +function props(promises) { + var ret; + var castValue = tryConvertToPromise(promises); + + if (!isObject(castValue)) { + return apiRejection("cannot await properties of a non-object\u000a\u000a See http://goo.gl/MqrFmX\u000a"); + } else if (castValue instanceof Promise) { + ret = castValue._then( + Promise.props, undefined, undefined, undefined, undefined); + } else { + ret = new PropertiesPromiseArray(castValue).promise(); + } + + if (castValue instanceof Promise) { + ret._propagateFrom(castValue, 2); + } + return ret; +} + +Promise.prototype.props = function () { + return props(this); +}; + +Promise.props = function (promises) { + return props(promises); +}; +}; + +},{"./es5":13,"./util":36}],26:[function(_dereq_,module,exports){ +"use strict"; +function arrayMove(src, srcIndex, dst, dstIndex, len) { + for (var j = 0; j < len; ++j) { + dst[j + dstIndex] = src[j + srcIndex]; + src[j + srcIndex] = void 0; + } +} + +function Queue(capacity) { + this._capacity = capacity; + this._length = 0; + this._front = 0; +} + +Queue.prototype._willBeOverCapacity = function (size) { + return this._capacity < size; +}; + +Queue.prototype._pushOne = function (arg) { + var length = this.length(); + this._checkCapacity(length + 1); + var i = (this._front + length) & (this._capacity - 1); + this[i] = arg; + this._length = length + 1; +}; + +Queue.prototype.push = function (fn, receiver, arg) { + var length = this.length() + 3; + if (this._willBeOverCapacity(length)) { + this._pushOne(fn); + this._pushOne(receiver); + this._pushOne(arg); + return; + } + var j = this._front + length - 3; + this._checkCapacity(length); + var wrapMask = this._capacity - 1; + this[(j + 0) & wrapMask] = fn; + this[(j + 1) & wrapMask] = receiver; + this[(j + 2) & wrapMask] = arg; + this._length = length; +}; + +Queue.prototype.shift = function () { + var front = this._front, + ret = this[front]; + + this[front] = undefined; + this._front = (front + 1) & (this._capacity - 1); + this._length--; + return ret; +}; + +Queue.prototype.length = function () { + return this._length; +}; + +Queue.prototype._checkCapacity = function (size) { + if (this._capacity < size) { + this._resizeTo(this._capacity << 1); + } +}; + +Queue.prototype._resizeTo = function (capacity) { + var oldCapacity = this._capacity; + this._capacity = capacity; + var front = this._front; + var length = this._length; + var moveItemsCount = (front + length) & (oldCapacity - 1); + arrayMove(this, 0, this, oldCapacity, moveItemsCount); +}; + +module.exports = Queue; + +},{}],27:[function(_dereq_,module,exports){ +"use strict"; +module.exports = function( + Promise, INTERNAL, tryConvertToPromise, apiRejection) { +var util = _dereq_("./util"); + +var raceLater = function (promise) { + return promise.then(function(array) { + return race(array, promise); + }); +}; + +function race(promises, parent) { + var maybePromise = tryConvertToPromise(promises); + + if (maybePromise instanceof Promise) { + return raceLater(maybePromise); + } else { + promises = util.asArray(promises); + if (promises === null) + return apiRejection("expecting an array or an iterable object but got " + util.classString(promises)); + } + + var ret = new Promise(INTERNAL); + if (parent !== undefined) { + ret._propagateFrom(parent, 3); + } + var fulfill = ret._fulfill; + var reject = ret._reject; + for (var i = 0, len = promises.length; i < len; ++i) { + var val = promises[i]; + + if (val === undefined && !(i in promises)) { + continue; + } + + Promise.cast(val)._then(fulfill, reject, undefined, ret, null); + } + return ret; +} + +Promise.race = function (promises) { + return race(promises, undefined); +}; + +Promise.prototype.race = function () { + return race(this, undefined); +}; + +}; + +},{"./util":36}],28:[function(_dereq_,module,exports){ +"use strict"; +module.exports = function(Promise, + PromiseArray, + apiRejection, + tryConvertToPromise, + INTERNAL, + debug) { +var getDomain = Promise._getDomain; +var util = _dereq_("./util"); +var tryCatch = util.tryCatch; + +function ReductionPromiseArray(promises, fn, initialValue, _each) { + this.constructor$(promises); + var domain = getDomain(); + this._fn = domain === null ? fn : util.domainBind(domain, fn); + if (initialValue !== undefined) { + initialValue = Promise.resolve(initialValue); + initialValue._attachCancellationCallback(this); + } + this._initialValue = initialValue; + this._currentCancellable = null; + if(_each === INTERNAL) { + this._eachValues = Array(this._length); + } else if (_each === 0) { + this._eachValues = null; + } else { + this._eachValues = undefined; + } + this._promise._captureStackTrace(); + this._init$(undefined, -5); +} +util.inherits(ReductionPromiseArray, PromiseArray); + +ReductionPromiseArray.prototype._gotAccum = function(accum) { + if (this._eachValues !== undefined && + this._eachValues !== null && + accum !== INTERNAL) { + this._eachValues.push(accum); + } +}; + +ReductionPromiseArray.prototype._eachComplete = function(value) { + if (this._eachValues !== null) { + this._eachValues.push(value); + } + return this._eachValues; +}; + +ReductionPromiseArray.prototype._init = function() {}; + +ReductionPromiseArray.prototype._resolveEmptyArray = function() { + this._resolve(this._eachValues !== undefined ? this._eachValues + : this._initialValue); +}; + +ReductionPromiseArray.prototype.shouldCopyValues = function () { + return false; +}; + +ReductionPromiseArray.prototype._resolve = function(value) { + this._promise._resolveCallback(value); + this._values = null; +}; + +ReductionPromiseArray.prototype._resultCancelled = function(sender) { + if (sender === this._initialValue) return this._cancel(); + if (this._isResolved()) return; + this._resultCancelled$(); + if (this._currentCancellable instanceof Promise) { + this._currentCancellable.cancel(); + } + if (this._initialValue instanceof Promise) { + this._initialValue.cancel(); + } +}; + +ReductionPromiseArray.prototype._iterate = function (values) { + this._values = values; + var value; + var i; + var length = values.length; + if (this._initialValue !== undefined) { + value = this._initialValue; + i = 0; + } else { + value = Promise.resolve(values[0]); + i = 1; + } + + this._currentCancellable = value; + + if (!value.isRejected()) { + for (; i < length; ++i) { + var ctx = { + accum: null, + value: values[i], + index: i, + length: length, + array: this + }; + value = value._then(gotAccum, undefined, undefined, ctx, undefined); + } + } + + if (this._eachValues !== undefined) { + value = value + ._then(this._eachComplete, undefined, undefined, this, undefined); + } + value._then(completed, completed, undefined, value, this); +}; + +Promise.prototype.reduce = function (fn, initialValue) { + return reduce(this, fn, initialValue, null); +}; + +Promise.reduce = function (promises, fn, initialValue, _each) { + return reduce(promises, fn, initialValue, _each); +}; + +function completed(valueOrReason, array) { + if (this.isFulfilled()) { + array._resolve(valueOrReason); + } else { + array._reject(valueOrReason); + } +} + +function reduce(promises, fn, initialValue, _each) { + if (typeof fn !== "function") { + return apiRejection("expecting a function but got " + util.classString(fn)); + } + var array = new ReductionPromiseArray(promises, fn, initialValue, _each); + return array.promise(); +} + +function gotAccum(accum) { + this.accum = accum; + this.array._gotAccum(accum); + var value = tryConvertToPromise(this.value, this.array._promise); + if (value instanceof Promise) { + this.array._currentCancellable = value; + return value._then(gotValue, undefined, undefined, this, undefined); + } else { + return gotValue.call(this, value); + } +} + +function gotValue(value) { + var array = this.array; + var promise = array._promise; + var fn = tryCatch(array._fn); + promise._pushContext(); + var ret; + if (array._eachValues !== undefined) { + ret = fn.call(promise._boundValue(), value, this.index, this.length); + } else { + ret = fn.call(promise._boundValue(), + this.accum, value, this.index, this.length); + } + if (ret instanceof Promise) { + array._currentCancellable = ret; + } + var promiseCreated = promise._popContext(); + debug.checkForgottenReturns( + ret, + promiseCreated, + array._eachValues !== undefined ? "Promise.each" : "Promise.reduce", + promise + ); + return ret; +} +}; + +},{"./util":36}],29:[function(_dereq_,module,exports){ +"use strict"; +var util = _dereq_("./util"); +var schedule; +var noAsyncScheduler = function() { + throw new Error("No async scheduler available\u000a\u000a See http://goo.gl/MqrFmX\u000a"); +}; +var NativePromise = util.getNativePromise(); +if (util.isNode && typeof MutationObserver === "undefined") { + var GlobalSetImmediate = global.setImmediate; + var ProcessNextTick = process.nextTick; + schedule = util.isRecentNode + ? function(fn) { GlobalSetImmediate.call(global, fn); } + : function(fn) { ProcessNextTick.call(process, fn); }; +} else if (typeof NativePromise === "function" && + typeof NativePromise.resolve === "function") { + var nativePromise = NativePromise.resolve(); + schedule = function(fn) { + nativePromise.then(fn); + }; +} else if ((typeof MutationObserver !== "undefined") && + !(typeof window !== "undefined" && + window.navigator && + (window.navigator.standalone || window.cordova))) { + schedule = (function() { + var div = document.createElement("div"); + var opts = {attributes: true}; + var toggleScheduled = false; + var div2 = document.createElement("div"); + var o2 = new MutationObserver(function() { + div.classList.toggle("foo"); + toggleScheduled = false; + }); + o2.observe(div2, opts); + + var scheduleToggle = function() { + if (toggleScheduled) return; + toggleScheduled = true; + div2.classList.toggle("foo"); + }; + + return function schedule(fn) { + var o = new MutationObserver(function() { + o.disconnect(); + fn(); + }); + o.observe(div, opts); + scheduleToggle(); + }; + })(); +} else if (typeof setImmediate !== "undefined") { + schedule = function (fn) { + setImmediate(fn); + }; +} else if (typeof setTimeout !== "undefined") { + schedule = function (fn) { + setTimeout(fn, 0); + }; +} else { + schedule = noAsyncScheduler; +} +module.exports = schedule; + +},{"./util":36}],30:[function(_dereq_,module,exports){ +"use strict"; +module.exports = + function(Promise, PromiseArray, debug) { +var PromiseInspection = Promise.PromiseInspection; +var util = _dereq_("./util"); + +function SettledPromiseArray(values) { + this.constructor$(values); +} +util.inherits(SettledPromiseArray, PromiseArray); + +SettledPromiseArray.prototype._promiseResolved = function (index, inspection) { + this._values[index] = inspection; + var totalResolved = ++this._totalResolved; + if (totalResolved >= this._length) { + this._resolve(this._values); + return true; + } + return false; +}; + +SettledPromiseArray.prototype._promiseFulfilled = function (value, index) { + var ret = new PromiseInspection(); + ret._bitField = 33554432; + ret._settledValueField = value; + return this._promiseResolved(index, ret); +}; +SettledPromiseArray.prototype._promiseRejected = function (reason, index) { + var ret = new PromiseInspection(); + ret._bitField = 16777216; + ret._settledValueField = reason; + return this._promiseResolved(index, ret); +}; + +Promise.settle = function (promises) { + debug.deprecated(".settle()", ".reflect()"); + return new SettledPromiseArray(promises).promise(); +}; + +Promise.prototype.settle = function () { + return Promise.settle(this); +}; +}; + +},{"./util":36}],31:[function(_dereq_,module,exports){ +"use strict"; +module.exports = +function(Promise, PromiseArray, apiRejection) { +var util = _dereq_("./util"); +var RangeError = _dereq_("./errors").RangeError; +var AggregateError = _dereq_("./errors").AggregateError; +var isArray = util.isArray; +var CANCELLATION = {}; + + +function SomePromiseArray(values) { + this.constructor$(values); + this._howMany = 0; + this._unwrap = false; + this._initialized = false; +} +util.inherits(SomePromiseArray, PromiseArray); + +SomePromiseArray.prototype._init = function () { + if (!this._initialized) { + return; + } + if (this._howMany === 0) { + this._resolve([]); + return; + } + this._init$(undefined, -5); + var isArrayResolved = isArray(this._values); + if (!this._isResolved() && + isArrayResolved && + this._howMany > this._canPossiblyFulfill()) { + this._reject(this._getRangeError(this.length())); + } +}; + +SomePromiseArray.prototype.init = function () { + this._initialized = true; + this._init(); +}; + +SomePromiseArray.prototype.setUnwrap = function () { + this._unwrap = true; +}; + +SomePromiseArray.prototype.howMany = function () { + return this._howMany; +}; + +SomePromiseArray.prototype.setHowMany = function (count) { + this._howMany = count; +}; + +SomePromiseArray.prototype._promiseFulfilled = function (value) { + this._addFulfilled(value); + if (this._fulfilled() === this.howMany()) { + this._values.length = this.howMany(); + if (this.howMany() === 1 && this._unwrap) { + this._resolve(this._values[0]); + } else { + this._resolve(this._values); + } + return true; + } + return false; + +}; +SomePromiseArray.prototype._promiseRejected = function (reason) { + this._addRejected(reason); + return this._checkOutcome(); +}; + +SomePromiseArray.prototype._promiseCancelled = function () { + if (this._values instanceof Promise || this._values == null) { + return this._cancel(); + } + this._addRejected(CANCELLATION); + return this._checkOutcome(); +}; + +SomePromiseArray.prototype._checkOutcome = function() { + if (this.howMany() > this._canPossiblyFulfill()) { + var e = new AggregateError(); + for (var i = this.length(); i < this._values.length; ++i) { + if (this._values[i] !== CANCELLATION) { + e.push(this._values[i]); + } + } + if (e.length > 0) { + this._reject(e); + } else { + this._cancel(); + } + return true; + } + return false; +}; + +SomePromiseArray.prototype._fulfilled = function () { + return this._totalResolved; +}; + +SomePromiseArray.prototype._rejected = function () { + return this._values.length - this.length(); +}; + +SomePromiseArray.prototype._addRejected = function (reason) { + this._values.push(reason); +}; + +SomePromiseArray.prototype._addFulfilled = function (value) { + this._values[this._totalResolved++] = value; +}; + +SomePromiseArray.prototype._canPossiblyFulfill = function () { + return this.length() - this._rejected(); +}; + +SomePromiseArray.prototype._getRangeError = function (count) { + var message = "Input array must contain at least " + + this._howMany + " items but contains only " + count + " items"; + return new RangeError(message); +}; + +SomePromiseArray.prototype._resolveEmptyArray = function () { + this._reject(this._getRangeError(0)); +}; + +function some(promises, howMany) { + if ((howMany | 0) !== howMany || howMany < 0) { + return apiRejection("expecting a positive integer\u000a\u000a See http://goo.gl/MqrFmX\u000a"); + } + var ret = new SomePromiseArray(promises); + var promise = ret.promise(); + ret.setHowMany(howMany); + ret.init(); + return promise; +} + +Promise.some = function (promises, howMany) { + return some(promises, howMany); +}; + +Promise.prototype.some = function (howMany) { + return some(this, howMany); +}; + +Promise._SomePromiseArray = SomePromiseArray; +}; + +},{"./errors":12,"./util":36}],32:[function(_dereq_,module,exports){ +"use strict"; +module.exports = function(Promise) { +function PromiseInspection(promise) { + if (promise !== undefined) { + promise = promise._target(); + this._bitField = promise._bitField; + this._settledValueField = promise._isFateSealed() + ? promise._settledValue() : undefined; + } + else { + this._bitField = 0; + this._settledValueField = undefined; + } +} + +PromiseInspection.prototype._settledValue = function() { + return this._settledValueField; +}; + +var value = PromiseInspection.prototype.value = function () { + if (!this.isFulfilled()) { + throw new TypeError("cannot get fulfillment value of a non-fulfilled promise\u000a\u000a See http://goo.gl/MqrFmX\u000a"); + } + return this._settledValue(); +}; + +var reason = PromiseInspection.prototype.error = +PromiseInspection.prototype.reason = function () { + if (!this.isRejected()) { + throw new TypeError("cannot get rejection reason of a non-rejected promise\u000a\u000a See http://goo.gl/MqrFmX\u000a"); + } + return this._settledValue(); +}; + +var isFulfilled = PromiseInspection.prototype.isFulfilled = function() { + return (this._bitField & 33554432) !== 0; +}; + +var isRejected = PromiseInspection.prototype.isRejected = function () { + return (this._bitField & 16777216) !== 0; +}; + +var isPending = PromiseInspection.prototype.isPending = function () { + return (this._bitField & 50397184) === 0; +}; + +var isResolved = PromiseInspection.prototype.isResolved = function () { + return (this._bitField & 50331648) !== 0; +}; + +PromiseInspection.prototype.isCancelled = function() { + return (this._bitField & 8454144) !== 0; +}; + +Promise.prototype.__isCancelled = function() { + return (this._bitField & 65536) === 65536; +}; + +Promise.prototype._isCancelled = function() { + return this._target().__isCancelled(); +}; + +Promise.prototype.isCancelled = function() { + return (this._target()._bitField & 8454144) !== 0; +}; + +Promise.prototype.isPending = function() { + return isPending.call(this._target()); +}; + +Promise.prototype.isRejected = function() { + return isRejected.call(this._target()); +}; + +Promise.prototype.isFulfilled = function() { + return isFulfilled.call(this._target()); +}; + +Promise.prototype.isResolved = function() { + return isResolved.call(this._target()); +}; + +Promise.prototype.value = function() { + return value.call(this._target()); +}; + +Promise.prototype.reason = function() { + var target = this._target(); + target._unsetRejectionIsUnhandled(); + return reason.call(target); +}; + +Promise.prototype._value = function() { + return this._settledValue(); +}; + +Promise.prototype._reason = function() { + this._unsetRejectionIsUnhandled(); + return this._settledValue(); +}; + +Promise.PromiseInspection = PromiseInspection; +}; + +},{}],33:[function(_dereq_,module,exports){ +"use strict"; +module.exports = function(Promise, INTERNAL) { +var util = _dereq_("./util"); +var errorObj = util.errorObj; +var isObject = util.isObject; + +function tryConvertToPromise(obj, context) { + if (isObject(obj)) { + if (obj instanceof Promise) return obj; + var then = getThen(obj); + if (then === errorObj) { + if (context) context._pushContext(); + var ret = Promise.reject(then.e); + if (context) context._popContext(); + return ret; + } else if (typeof then === "function") { + if (isAnyBluebirdPromise(obj)) { + var ret = new Promise(INTERNAL); + obj._then( + ret._fulfill, + ret._reject, + undefined, + ret, + null + ); + return ret; + } + return doThenable(obj, then, context); + } + } + return obj; +} + +function doGetThen(obj) { + return obj.then; +} + +function getThen(obj) { + try { + return doGetThen(obj); + } catch (e) { + errorObj.e = e; + return errorObj; + } +} + +var hasProp = {}.hasOwnProperty; +function isAnyBluebirdPromise(obj) { + try { + return hasProp.call(obj, "_promise0"); + } catch (e) { + return false; + } +} + +function doThenable(x, then, context) { + var promise = new Promise(INTERNAL); + var ret = promise; + if (context) context._pushContext(); + promise._captureStackTrace(); + if (context) context._popContext(); + var synchronous = true; + var result = util.tryCatch(then).call(x, resolve, reject); + synchronous = false; + + if (promise && result === errorObj) { + promise._rejectCallback(result.e, true, true); + promise = null; + } + + function resolve(value) { + if (!promise) return; + promise._resolveCallback(value); + promise = null; + } + + function reject(reason) { + if (!promise) return; + promise._rejectCallback(reason, synchronous, true); + promise = null; + } + return ret; +} + +return tryConvertToPromise; +}; + +},{"./util":36}],34:[function(_dereq_,module,exports){ +"use strict"; +module.exports = function(Promise, INTERNAL, debug) { +var util = _dereq_("./util"); +var TimeoutError = Promise.TimeoutError; + +function HandleWrapper(handle) { + this.handle = handle; +} + +HandleWrapper.prototype._resultCancelled = function() { + clearTimeout(this.handle); +}; + +var afterValue = function(value) { return delay(+this).thenReturn(value); }; +var delay = Promise.delay = function (ms, value) { + var ret; + var handle; + if (value !== undefined) { + ret = Promise.resolve(value) + ._then(afterValue, null, null, ms, undefined); + if (debug.cancellation() && value instanceof Promise) { + ret._setOnCancel(value); + } + } else { + ret = new Promise(INTERNAL); + handle = setTimeout(function() { ret._fulfill(); }, +ms); + if (debug.cancellation()) { + ret._setOnCancel(new HandleWrapper(handle)); + } + ret._captureStackTrace(); + } + ret._setAsyncGuaranteed(); + return ret; +}; + +Promise.prototype.delay = function (ms) { + return delay(ms, this); +}; + +var afterTimeout = function (promise, message, parent) { + var err; + if (typeof message !== "string") { + if (message instanceof Error) { + err = message; + } else { + err = new TimeoutError("operation timed out"); + } + } else { + err = new TimeoutError(message); + } + util.markAsOriginatingFromRejection(err); + promise._attachExtraTrace(err); + promise._reject(err); + + if (parent != null) { + parent.cancel(); + } +}; + +function successClear(value) { + clearTimeout(this.handle); + return value; +} + +function failureClear(reason) { + clearTimeout(this.handle); + throw reason; +} + +Promise.prototype.timeout = function (ms, message) { + ms = +ms; + var ret, parent; + + var handleWrapper = new HandleWrapper(setTimeout(function timeoutTimeout() { + if (ret.isPending()) { + afterTimeout(ret, message, parent); + } + }, ms)); + + if (debug.cancellation()) { + parent = this.then(); + ret = parent._then(successClear, failureClear, + undefined, handleWrapper, undefined); + ret._setOnCancel(handleWrapper); + } else { + ret = this._then(successClear, failureClear, + undefined, handleWrapper, undefined); + } + + return ret; +}; + +}; + +},{"./util":36}],35:[function(_dereq_,module,exports){ +"use strict"; +module.exports = function (Promise, apiRejection, tryConvertToPromise, + createContext, INTERNAL, debug) { + var util = _dereq_("./util"); + var TypeError = _dereq_("./errors").TypeError; + var inherits = _dereq_("./util").inherits; + var errorObj = util.errorObj; + var tryCatch = util.tryCatch; + var NULL = {}; + + function thrower(e) { + setTimeout(function(){throw e;}, 0); + } + + function castPreservingDisposable(thenable) { + var maybePromise = tryConvertToPromise(thenable); + if (maybePromise !== thenable && + typeof thenable._isDisposable === "function" && + typeof thenable._getDisposer === "function" && + thenable._isDisposable()) { + maybePromise._setDisposable(thenable._getDisposer()); + } + return maybePromise; + } + function dispose(resources, inspection) { + var i = 0; + var len = resources.length; + var ret = new Promise(INTERNAL); + function iterator() { + if (i >= len) return ret._fulfill(); + var maybePromise = castPreservingDisposable(resources[i++]); + if (maybePromise instanceof Promise && + maybePromise._isDisposable()) { + try { + maybePromise = tryConvertToPromise( + maybePromise._getDisposer().tryDispose(inspection), + resources.promise); + } catch (e) { + return thrower(e); + } + if (maybePromise instanceof Promise) { + return maybePromise._then(iterator, thrower, + null, null, null); + } + } + iterator(); + } + iterator(); + return ret; + } + + function Disposer(data, promise, context) { + this._data = data; + this._promise = promise; + this._context = context; + } + + Disposer.prototype.data = function () { + return this._data; + }; + + Disposer.prototype.promise = function () { + return this._promise; + }; + + Disposer.prototype.resource = function () { + if (this.promise().isFulfilled()) { + return this.promise().value(); + } + return NULL; + }; + + Disposer.prototype.tryDispose = function(inspection) { + var resource = this.resource(); + var context = this._context; + if (context !== undefined) context._pushContext(); + var ret = resource !== NULL + ? this.doDispose(resource, inspection) : null; + if (context !== undefined) context._popContext(); + this._promise._unsetDisposable(); + this._data = null; + return ret; + }; + + Disposer.isDisposer = function (d) { + return (d != null && + typeof d.resource === "function" && + typeof d.tryDispose === "function"); + }; + + function FunctionDisposer(fn, promise, context) { + this.constructor$(fn, promise, context); + } + inherits(FunctionDisposer, Disposer); + + FunctionDisposer.prototype.doDispose = function (resource, inspection) { + var fn = this.data(); + return fn.call(resource, resource, inspection); + }; + + function maybeUnwrapDisposer(value) { + if (Disposer.isDisposer(value)) { + this.resources[this.index]._setDisposable(value); + return value.promise(); + } + return value; + } + + function ResourceList(length) { + this.length = length; + this.promise = null; + this[length-1] = null; + } + + ResourceList.prototype._resultCancelled = function() { + var len = this.length; + for (var i = 0; i < len; ++i) { + var item = this[i]; + if (item instanceof Promise) { + item.cancel(); + } + } + }; + + Promise.using = function () { + var len = arguments.length; + if (len < 2) return apiRejection( + "you must pass at least 2 arguments to Promise.using"); + var fn = arguments[len - 1]; + if (typeof fn !== "function") { + return apiRejection("expecting a function but got " + util.classString(fn)); + } + var input; + var spreadArgs = true; + if (len === 2 && Array.isArray(arguments[0])) { + input = arguments[0]; + len = input.length; + spreadArgs = false; + } else { + input = arguments; + len--; + } + var resources = new ResourceList(len); + for (var i = 0; i < len; ++i) { + var resource = input[i]; + if (Disposer.isDisposer(resource)) { + var disposer = resource; + resource = resource.promise(); + resource._setDisposable(disposer); + } else { + var maybePromise = tryConvertToPromise(resource); + if (maybePromise instanceof Promise) { + resource = + maybePromise._then(maybeUnwrapDisposer, null, null, { + resources: resources, + index: i + }, undefined); + } + } + resources[i] = resource; + } + + var reflectedResources = new Array(resources.length); + for (var i = 0; i < reflectedResources.length; ++i) { + reflectedResources[i] = Promise.resolve(resources[i]).reflect(); + } + + var resultPromise = Promise.all(reflectedResources) + .then(function(inspections) { + for (var i = 0; i < inspections.length; ++i) { + var inspection = inspections[i]; + if (inspection.isRejected()) { + errorObj.e = inspection.error(); + return errorObj; + } else if (!inspection.isFulfilled()) { + resultPromise.cancel(); + return; + } + inspections[i] = inspection.value(); + } + promise._pushContext(); + + fn = tryCatch(fn); + var ret = spreadArgs + ? fn.apply(undefined, inspections) : fn(inspections); + var promiseCreated = promise._popContext(); + debug.checkForgottenReturns( + ret, promiseCreated, "Promise.using", promise); + return ret; + }); + + var promise = resultPromise.lastly(function() { + var inspection = new Promise.PromiseInspection(resultPromise); + return dispose(resources, inspection); + }); + resources.promise = promise; + promise._setOnCancel(resources); + return promise; + }; + + Promise.prototype._setDisposable = function (disposer) { + this._bitField = this._bitField | 131072; + this._disposer = disposer; + }; + + Promise.prototype._isDisposable = function () { + return (this._bitField & 131072) > 0; + }; + + Promise.prototype._getDisposer = function () { + return this._disposer; + }; + + Promise.prototype._unsetDisposable = function () { + this._bitField = this._bitField & (~131072); + this._disposer = undefined; + }; + + Promise.prototype.disposer = function (fn) { + if (typeof fn === "function") { + return new FunctionDisposer(fn, this, createContext()); + } + throw new TypeError(); + }; + +}; + +},{"./errors":12,"./util":36}],36:[function(_dereq_,module,exports){ +"use strict"; +var es5 = _dereq_("./es5"); +var canEvaluate = typeof navigator == "undefined"; + +var errorObj = {e: {}}; +var tryCatchTarget; +var globalObject = typeof self !== "undefined" ? self : + typeof window !== "undefined" ? window : + typeof global !== "undefined" ? global : + this !== undefined ? this : null; + +function tryCatcher() { + try { + var target = tryCatchTarget; + tryCatchTarget = null; + return target.apply(this, arguments); + } catch (e) { + errorObj.e = e; + return errorObj; + } +} +function tryCatch(fn) { + tryCatchTarget = fn; + return tryCatcher; +} + +var inherits = function(Child, Parent) { + var hasProp = {}.hasOwnProperty; + + function T() { + this.constructor = Child; + this.constructor$ = Parent; + for (var propertyName in Parent.prototype) { + if (hasProp.call(Parent.prototype, propertyName) && + propertyName.charAt(propertyName.length-1) !== "$" + ) { + this[propertyName + "$"] = Parent.prototype[propertyName]; + } + } + } + T.prototype = Parent.prototype; + Child.prototype = new T(); + return Child.prototype; +}; + + +function isPrimitive(val) { + return val == null || val === true || val === false || + typeof val === "string" || typeof val === "number"; + +} + +function isObject(value) { + return typeof value === "function" || + typeof value === "object" && value !== null; +} + +function maybeWrapAsError(maybeError) { + if (!isPrimitive(maybeError)) return maybeError; + + return new Error(safeToString(maybeError)); +} + +function withAppended(target, appendee) { + var len = target.length; + var ret = new Array(len + 1); + var i; + for (i = 0; i < len; ++i) { + ret[i] = target[i]; + } + ret[i] = appendee; + return ret; +} + +function getDataPropertyOrDefault(obj, key, defaultValue) { + if (es5.isES5) { + var desc = Object.getOwnPropertyDescriptor(obj, key); + + if (desc != null) { + return desc.get == null && desc.set == null + ? desc.value + : defaultValue; + } + } else { + return {}.hasOwnProperty.call(obj, key) ? obj[key] : undefined; + } +} + +function notEnumerableProp(obj, name, value) { + if (isPrimitive(obj)) return obj; + var descriptor = { + value: value, + configurable: true, + enumerable: false, + writable: true + }; + es5.defineProperty(obj, name, descriptor); + return obj; +} + +function thrower(r) { + throw r; +} + +var inheritedDataKeys = (function() { + var excludedPrototypes = [ + Array.prototype, + Object.prototype, + Function.prototype + ]; + + var isExcludedProto = function(val) { + for (var i = 0; i < excludedPrototypes.length; ++i) { + if (excludedPrototypes[i] === val) { + return true; + } + } + return false; + }; + + if (es5.isES5) { + var getKeys = Object.getOwnPropertyNames; + return function(obj) { + var ret = []; + var visitedKeys = Object.create(null); + while (obj != null && !isExcludedProto(obj)) { + var keys; + try { + keys = getKeys(obj); + } catch (e) { + return ret; + } + for (var i = 0; i < keys.length; ++i) { + var key = keys[i]; + if (visitedKeys[key]) continue; + visitedKeys[key] = true; + var desc = Object.getOwnPropertyDescriptor(obj, key); + if (desc != null && desc.get == null && desc.set == null) { + ret.push(key); + } + } + obj = es5.getPrototypeOf(obj); + } + return ret; + }; + } else { + var hasProp = {}.hasOwnProperty; + return function(obj) { + if (isExcludedProto(obj)) return []; + var ret = []; + + /*jshint forin:false */ + enumeration: for (var key in obj) { + if (hasProp.call(obj, key)) { + ret.push(key); + } else { + for (var i = 0; i < excludedPrototypes.length; ++i) { + if (hasProp.call(excludedPrototypes[i], key)) { + continue enumeration; + } + } + ret.push(key); + } + } + return ret; + }; + } + +})(); + +var thisAssignmentPattern = /this\s*\.\s*\S+\s*=/; +function isClass(fn) { + try { + if (typeof fn === "function") { + var keys = es5.names(fn.prototype); + + var hasMethods = es5.isES5 && keys.length > 1; + var hasMethodsOtherThanConstructor = keys.length > 0 && + !(keys.length === 1 && keys[0] === "constructor"); + var hasThisAssignmentAndStaticMethods = + thisAssignmentPattern.test(fn + "") && es5.names(fn).length > 0; + + if (hasMethods || hasMethodsOtherThanConstructor || + hasThisAssignmentAndStaticMethods) { + return true; + } + } + return false; + } catch (e) { + return false; + } +} + +function toFastProperties(obj) { + /*jshint -W027,-W055,-W031*/ + function FakeConstructor() {} + FakeConstructor.prototype = obj; + var l = 8; + while (l--) new FakeConstructor(); + return obj; + eval(obj); +} + +var rident = /^[a-z$_][a-z$_0-9]*$/i; +function isIdentifier(str) { + return rident.test(str); +} + +function filledRange(count, prefix, suffix) { + var ret = new Array(count); + for(var i = 0; i < count; ++i) { + ret[i] = prefix + i + suffix; + } + return ret; +} + +function safeToString(obj) { + try { + return obj + ""; + } catch (e) { + return "[no string representation]"; + } +} + +function isError(obj) { + return obj !== null && + typeof obj === "object" && + typeof obj.message === "string" && + typeof obj.name === "string"; +} + +function markAsOriginatingFromRejection(e) { + try { + notEnumerableProp(e, "isOperational", true); + } + catch(ignore) {} +} + +function originatesFromRejection(e) { + if (e == null) return false; + return ((e instanceof Error["__BluebirdErrorTypes__"].OperationalError) || + e["isOperational"] === true); +} + +function canAttachTrace(obj) { + return isError(obj) && es5.propertyIsWritable(obj, "stack"); +} + +var ensureErrorObject = (function() { + if (!("stack" in new Error())) { + return function(value) { + if (canAttachTrace(value)) return value; + try {throw new Error(safeToString(value));} + catch(err) {return err;} + }; + } else { + return function(value) { + if (canAttachTrace(value)) return value; + return new Error(safeToString(value)); + }; + } +})(); + +function classString(obj) { + return {}.toString.call(obj); +} + +function copyDescriptors(from, to, filter) { + var keys = es5.names(from); + for (var i = 0; i < keys.length; ++i) { + var key = keys[i]; + if (filter(key)) { + try { + es5.defineProperty(to, key, es5.getDescriptor(from, key)); + } catch (ignore) {} + } + } +} + +var asArray = function(v) { + if (es5.isArray(v)) { + return v; + } + return null; +}; + +if (typeof Symbol !== "undefined" && Symbol.iterator) { + var ArrayFrom = typeof Array.from === "function" ? function(v) { + return Array.from(v); + } : function(v) { + var ret = []; + var it = v[Symbol.iterator](); + var itResult; + while (!((itResult = it.next()).done)) { + ret.push(itResult.value); + } + return ret; + }; + + asArray = function(v) { + if (es5.isArray(v)) { + return v; + } else if (v != null && typeof v[Symbol.iterator] === "function") { + return ArrayFrom(v); + } + return null; + }; +} + +var isNode = typeof process !== "undefined" && + classString(process).toLowerCase() === "[object process]"; + +var hasEnvVariables = typeof process !== "undefined" && + typeof process.env !== "undefined"; + +function env(key) { + return hasEnvVariables ? process.env[key] : undefined; +} + +function getNativePromise() { + if (typeof Promise === "function") { + try { + var promise = new Promise(function(){}); + if ({}.toString.call(promise) === "[object Promise]") { + return Promise; + } + } catch (e) {} + } +} + +function domainBind(self, cb) { + return self.bind(cb); +} + +var ret = { + isClass: isClass, + isIdentifier: isIdentifier, + inheritedDataKeys: inheritedDataKeys, + getDataPropertyOrDefault: getDataPropertyOrDefault, + thrower: thrower, + isArray: es5.isArray, + asArray: asArray, + notEnumerableProp: notEnumerableProp, + isPrimitive: isPrimitive, + isObject: isObject, + isError: isError, + canEvaluate: canEvaluate, + errorObj: errorObj, + tryCatch: tryCatch, + inherits: inherits, + withAppended: withAppended, + maybeWrapAsError: maybeWrapAsError, + toFastProperties: toFastProperties, + filledRange: filledRange, + toString: safeToString, + canAttachTrace: canAttachTrace, + ensureErrorObject: ensureErrorObject, + originatesFromRejection: originatesFromRejection, + markAsOriginatingFromRejection: markAsOriginatingFromRejection, + classString: classString, + copyDescriptors: copyDescriptors, + hasDevTools: typeof chrome !== "undefined" && chrome && + typeof chrome.loadTimes === "function", + isNode: isNode, + hasEnvVariables: hasEnvVariables, + env: env, + global: globalObject, + getNativePromise: getNativePromise, + domainBind: domainBind +}; +ret.isRecentNode = ret.isNode && (function() { + var version = process.versions.node.split(".").map(Number); + return (version[0] === 0 && version[1] > 10) || (version[0] > 0); +})(); + +if (ret.isNode) ret.toFastProperties(process); + +try {throw new Error(); } catch (e) {ret.lastLineError = e;} +module.exports = ret; + +},{"./es5":13}]},{},[4])(4) +}); ;if (typeof window !== 'undefined' && window !== null) { window.P = window.Promise; } else if (typeof self !== 'undefined' && self !== null) { self.P = self.Promise; } \ No newline at end of file diff --git a/designer-base/src/main/resources/com/fr/design/login/lib/bundle.css b/designer-base/src/main/resources/com/fr/design/login/lib/bundle.css new file mode 100644 index 000000000..f9d1e0cd2 --- /dev/null +++ b/designer-base/src/main/resources/com/fr/design/login/lib/bundle.css @@ -0,0 +1,6540 @@ +/*! normalize.css v1.0.0 | MIT License | git.io/normalize */ +article, +aside, +details, +figcaption, +figure, +footer, +header, +hgroup, +nav, +section, +summary { + display: block; +} +audio, +canvas, +video { + display: inline-block; + *display: inline; + *zoom: 1; +} +audio:not([controls]) { + display: none; + height: 0; +} +[hidden] { + display: none; +} +html { + font-size: 100%; + -webkit-text-size-adjust: 100%; + -ms-text-size-adjust: 100%; +} +html, +button, +input, +select, +textarea { + font-family: sans-serif; +} +body { + margin: 0; +} +a:focus { + outline: thin dotted; +} +a:active, +a:hover { + outline: 0; +} +h1 { + font-size: 2em; + margin: 0.67em 0; +} +h2 { + font-size: 1.5em; + margin: 0.83em 0; +} +h3 { + font-size: 1.17em; + margin: 1em 0; +} +h4 { + font-size: 1em; + margin: 1.33em 0; +} +h5 { + font-size: .83em; + margin: 1.67em 0; +} +h6 { + font-size: .75em; + margin: 2.33em 0; +} +abbr[title] { + border-bottom: 1px dotted; +} +b, +strong { + font-weight: bold; +} +blockquote { + margin: 1em 40px; +} +dfn { + font-style: italic; +} +mark { + background: #ff0; + color: #000; +} +p, +pre { + margin: 1em 0; +} +code, +kbd, +pre, +samp { + font-family: monospace, serif; + _font-family: 'courier new', monospace; + font-size: 1em; +} +pre { + white-space: pre; + white-space: pre-wrap; + word-wrap: break-word; +} +q { + quotes: none; +} +q:before, +q:after { + content: ''; + content: none; +} +small { + font-size: 75%; +} +sub, +sup { + font-size: 75%; + line-height: 0; + position: relative; + vertical-align: baseline; +} +sup { + top: -0.5em; +} +sub { + bottom: -0.25em; +} +dl, +menu, +ol, +ul { + margin: 1em 0; +} +dd { + margin: 0 0 0 40px; +} +menu, +ol, +ul { + padding: 0 0 0 40px; +} +nav ul, +nav ol { + list-style: none; + list-style-image: none; +} +img { + border: 0; + -ms-interpolation-mode: bicubic; +} +svg:not(:root) { + overflow: hidden; +} +figure { + margin: 0; +} +form { + margin: 0; +} +fieldset { + border: 1px solid #c0c0c0; + margin: 0 2px; + padding: 0.35em 0.625em 0.75em; +} +legend { + border: 0; + padding: 0; + white-space: normal; + *margin-left: -7px; +} +button, +input, +select, +textarea { + font-size: 100%; + margin: 0; + vertical-align: baseline; + *vertical-align: middle; +} +button, +input { + line-height: normal; +} +button, +html input[type="button"], +input[type="reset"], +input[type="submit"] { + -webkit-appearance: button; + cursor: pointer; + *overflow: visible; +} +button[disabled], +input[disabled] { + cursor: default; +} +input[type="checkbox"], +input[type="radio"] { + box-sizing: border-box; + padding: 0; + *height: 13px; + *width: 13px; +} +input[type="search"] { + -webkit-appearance: textfield; + -moz-box-sizing: content-box; + -webkit-box-sizing: content-box; + box-sizing: content-box; +} +input[type="search"]::-webkit-search-cancel-button, +input[type="search"]::-webkit-search-decoration { + -webkit-appearance: none; +} +button::-moz-focus-inner, +input::-moz-focus-inner { + border: 0; + padding: 0; +} +textarea { + overflow: auto; + vertical-align: top; +} +table { + border-collapse: collapse; + border-spacing: 0; +} +html, +body, +div, +ul, +ol, +li, +img, +a, +span, +p, +* { + margin: 0; + padding: 0; +} +a { + outline: none; + text-decoration: none; +} +a:focus { + outline: 0; +} +div:focus { + outline: none; +} +input::-webkit-contacts-auto-fill-button { + visibility: hidden; + display: none !important; + pointer-events: none; + position: absolute; + right: 0; +} +input::-ms-clear { + display: none; +} +input, +textarea { + margin: 0; + padding: 0; + outline: none; +} +ul { + list-style: disc; +} +li { + list-style-type: none; +} +i { + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; +} +/** 循环旋转动画 **/ +.anim-rotate { + -webkit-animation: rotate 1s infinite linear both; + -moz-animation: rotate 1s infinite linear both; + -ms-animation: rotate 1s infinite linear both; + -o-animation: rotate 1s infinite linear both; + animation: rotate 1s infinite linear both; +} +@-webkit-keyframes rotate { + from { + transform: rotate(0deg); + } + to { + transform: rotate(360deg); + } +} +@-moz-keyframes rotate { + from { + transform: rotate(0deg); + } + to { + transform: rotate(360deg); + } +} +@-ms-keyframes rotate { + from { + transform: rotate(0deg); + } + to { + transform: rotate(360deg); + } +} +@-o-keyframes rotate { + from { + transform: rotate(0deg); + } + to { + transform: rotate(360deg); + } +} +@keyframes rotate { + from { + transform: rotate(0deg); + } + to { + transform: rotate(360deg); + } +} +input, +textarea { + border: 1px solid #e8eaed; +} +.bi-theme-dark input, +.bi-theme-dark textarea { + border: 1px solid #363e55; +} +.base-disabled { + cursor: not-allowed !important; + color: #9ea6b2 !important; +} +.base-disabled .bi-input { + color: #9ea6b2 !important; +} +.base-disabled .bi-textarea { + color: #9ea6b2 !important; +} +.base-disabled .b-font:before { + color: #d0d4da !important; +} +.bi-theme-dark .base-disabled { + color: #878d9f !important; +} +.bi-theme-dark .base-disabled .bi-input { + color: #878d9f !important; +} +.bi-theme-dark .base-disabled .bi-textarea { + color: #878d9f !important; +} +.bi-theme-dark .base-disabled .b-font:before { + color: #606479 !important; +} +.bi-focus-shadow:focus-within, +.bi-focus-shadow:focus, +.bi-focus-shadow:hover { + border-color: #3685f2; +} +.bi-focus-shadow.disabled:hover { + border-color: #e8eaed; +} +.bi-theme-dark .bi-focus-shadow.disabled:hover { + border-color: #363e55; +} +.base-invalid { + cursor: default !important; +} +.clearfix { + *zoom: 1; +} +.clearfix:before, +.clearfix:after { + content: " "; + display: table; + line-height: 0; +} +.clearfix:after { + clear: both; +} +.bi-background { + background-color: #f7f8fa; + color: #3d4d66; +} +.bi-background .bi-input { + color: #3d4d66; +} +.bi-background .bi-textarea { + color: #3d4d66; +} +.bi-theme-dark .bi-background { + background-color: #191b2b; + color: #d6e0dc; +} +.bi-theme-dark .bi-background .bi-input { + color: #d6e0dc; +} +.bi-theme-dark .bi-background .bi-textarea { + color: #d6e0dc; +} +.bi-header-background { + background-color: #f2f4f7; + color: #647185; +} +.bi-header-background .bi-input { + color: #647185; +} +.bi-header-background .bi-textarea { + color: #647185; +} +.bi-theme-dark .bi-header-background { + background-color: #292f45; + color: #afb7c6; +} +.bi-theme-dark .bi-header-background .bi-input { + color: #afb7c6; +} +.bi-theme-dark .bi-header-background .bi-textarea { + color: #afb7c6; +} +.bi-card { + background-color: #ffffff; + color: #3d4d66; +} +.bi-card .bi-input { + color: #3d4d66; +} +.bi-card .bi-textarea { + color: #3d4d66; +} +.bi-theme-dark .bi-card { + background-color: #20263b; + color: #d6e0dc; +} +.bi-theme-dark .bi-card .bi-input { + color: #d6e0dc; +} +.bi-theme-dark .bi-card .bi-textarea { + color: #d6e0dc; +} +.bi-disabled { + color: #9ea6b2; +} +.bi-disabled .bi-input { + color: #9ea6b2; +} +.bi-disabled .bi-textarea { + color: #9ea6b2; +} +.bi-theme-dark .bi-disabled { + color: #878d9f; +} +.bi-theme-dark .bi-disabled .bi-input { + color: #878d9f; +} +.bi-theme-dark .bi-disabled .bi-textarea { + color: #878d9f; +} +.bi-tips { + color: #9ea6b2; +} +.bi-tips .bi-input { + color: #9ea6b2; +} +.bi-tips .bi-textarea { + color: #9ea6b2; +} +.bi-border { + border: 1px solid #e8eaed; +} +.bi-border.disabled { + border-color: #d0d4da !important; +} +.bi-border-top { + border-top: 1px solid #e8eaed; +} +.bi-border-top.disabled { + border-color: #d0d4da !important; +} +.bi-border-right { + border-right: 1px solid #e8eaed; +} +.bi-border-right.disabled { + border-color: #d0d4da !important; +} +.bi-border-bottom { + border-bottom: 1px solid #e8eaed; +} +.bi-border-bottom.disabled { + border-color: #d0d4da !important; +} +.bi-border-left { + border-left: 1px solid #e8eaed; +} +.bi-border-left.disabled { + border-color: #d0d4da !important; +} +.bi-theme-dark .bi-border { + border: 1px solid #363e55; +} +.bi-theme-dark .bi-border.disabled { + border-color: #606479 !important; +} +.bi-theme-dark .bi-border-top { + border-top: 1px solid #363e55; +} +.bi-theme-dark .bi-border-top.disabled { + border-color: #606479 !important; +} +.bi-theme-dark .bi-border-right { + border-right: 1px solid #363e55; +} +.bi-theme-dark .bi-border-right.disabled { + border-color: #606479 !important; +} +.bi-theme-dark .bi-border-bottom { + border-bottom: 1px solid #363e55; +} +.bi-theme-dark .bi-border-bottom.disabled { + border-color: #606479 !important; +} +.bi-theme-dark .bi-border-left { + border-left: 1px solid #363e55; +} +.bi-theme-dark .bi-border-left.disabled { + border-color: #606479 !important; +} +.bi-split { + border: 1px solid #f2f4f7; +} +.bi-split-top { + border-top: 1px solid #f2f4f7; +} +.bi-split-right { + border-right: 1px solid #f2f4f7; +} +.bi-split-bottom { + border-bottom: 1px solid #f2f4f7; +} +.bi-split-left { + border-left: 1px solid #f2f4f7; +} +.bi-theme-dark .bi-split { + border: 1px solid #292f45; +} +.bi-theme-dark .bi-split-top { + border-top: 1px solid #292f45; +} +.bi-theme-dark .bi-split-right { + border-right: 1px solid #292f45; +} +.bi-theme-dark .bi-split-bottom { + border-bottom: 1px solid #292f45; +} +.bi-theme-dark .bi-split-left { + border-left: 1px solid #292f45; +} +.bi-font-helvetica-neue { + font-family: "Helvetica Neue", Arial, Verdana, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", Heiti, serif; +} +.bi-font-verdana { + font-family: Verdana, "Helvetica Neue", Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", Heiti, serif; +} +.bi-font-arial { + font-family: Arial, "Helvetica Neue", Verdana, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", Heiti, serif; +} +.bi-font-PingFang { + font-family: "PingFang SC", "Helvetica Neue", Verdana, Arial, "Hiragino Sans GB", "Microsoft YaHei", Heiti, serif; +} +.bi-font-hiragino-sans { + font-family: "Hiragino Sans GB", "Helvetica Neue", Verdana, Arial, "PingFang SC", "Microsoft YaHei", Heiti, serif; +} +.bi-font-microsoft-yaHei { + font-family: "Microsoft YaHei", "Helvetica Neue", Verdana, Arial, "PingFang SC", "Hiragino Sans GB", Heiti, serif; +} +.bi-font-heiti { + font-family: Heiti, "Helvetica Neue", Verdana, Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", serif; +} +.bi-border-radius { + -webkit-border-radius: 2px; + -moz-border-radius: 2px; + border-radius: 2px; +} +.bi-font-bold { + font-weight: 700; +} +.bi-keyword-red-mark { + color: #faaa39; +} +.bi-keyword-red-mark .bi-input { + color: #faaa39; +} +.bi-keyword-red-mark .bi-textarea { + color: #faaa39; +} +.bi-high-light { + color: #3685f2; +} +.bi-high-light .bi-input { + color: #3685f2; +} +.bi-high-light .bi-textarea { + color: #3685f2; +} +.bi-error { + color: #e65251; +} +.bi-error .bi-input { + color: #e65251; +} +.bi-error .bi-textarea { + color: #e65251; +} +.bi-high-light-background { + background-color: #3685f2; + color: #ffffff; +} +.bi-high-light-background .bi-input { + color: #ffffff; +} +.bi-high-light-background .bi-textarea { + color: #ffffff; +} +.bi-error-background { + background-color: #e65251; + color: #ffffff; +} +.bi-error-background .bi-input { + color: #ffffff; +} +.bi-error-background .bi-textarea { + color: #ffffff; +} +.bi-high-light-border { + border: 1px solid #3685f2; +} +.bi-high-light-border.disabled { + border-color: #d0d4da !important; +} +.bi-high-light-border-top { + border-top: 1px solid #3685f2; +} +.bi-high-light-border-top.disabled { + border-color: #d0d4da !important; +} +.bi-high-light-border-right { + border-right: 1px solid #3685f2; +} +.bi-high-light-border-right.disabled { + border-color: #d0d4da !important; +} +.bi-high-light-border-bottom { + border-bottom: 1px solid #3685f2; +} +.bi-high-light-border-bottom.disabled { + border-color: #d0d4da !important; +} +.bi-high-light-border-left { + border-left: 1px solid #3685f2; +} +.bi-high-light-border-left.disabled { + border-color: #d0d4da !important; +} +.bi-water-mark { + color: #9ea6b2; + cursor: text; +} +.bi-water-mark .bi-input { + color: #9ea6b2; +} +.bi-water-mark .bi-textarea { + color: #9ea6b2; +} +.bi-theme-dark .bi-water-mark { + color: #6b7084; +} +.bi-theme-dark .bi-water-mark .bi-input { + color: #6b7084; +} +.bi-theme-dark .bi-water-mark .bi-textarea { + color: #6b7084; +} +.bi-resizer { + background: #232E40; + opacity: 0.2; + filter: alpha(opacity=20); + z-index: 1000000000 !important; +} +.bi-theme-dark .bi-resizer { + background: #ffffff; +} +.bi-mask { + color: #ffffff; + background-color: rgba(35, 46, 64, 0.2); + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#33232e40,endColorstr=#33232e40); +} +.bi-mask .bi-input { + color: #ffffff; +} +.bi-mask .bi-textarea { + color: #ffffff; +} +.bi-theme-dark .bi-mask { + color: #20263b; + background-color: rgba(255, 255, 255, 0.2); + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#33ffffff,endColorstr=#33ffffff); +} +.bi-theme-dark .bi-mask .bi-input { + color: #20263b; +} +.bi-theme-dark .bi-mask .bi-textarea { + color: #20263b; +} +.bi-z-index-mask { + background-color: rgba(35, 46, 64, 0.5); + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#80232e40,endColorstr=#80232e40); +} +.bi-theme-dark .bi-z-index-mask { + background-color: rgba(96, 100, 121, 0.5); + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#80606479,endColorstr=#80606479); +} +.bi-list-item:hover, +.bi-list-item.hover { + color: #232e40; + background-color: rgba(54, 133, 242, 0.05); + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#0d3685f2,endColorstr=#0d3685f2); +} +.bi-list-item:hover .bi-input, +.bi-list-item.hover .bi-input { + color: #232e40; +} +.bi-list-item:hover .bi-textarea, +.bi-list-item.hover .bi-textarea { + color: #232e40; +} +.bi-list-item.disabled, +.bi-list-item.disabled:hover, +.bi-list-item.disabled:active { + background-color: transparent !important; + color: #9ea6b2 !important; +} +.bi-list-item.disabled .bi-input, +.bi-list-item.disabled:hover .bi-input, +.bi-list-item.disabled:active .bi-input { + color: #9ea6b2 !important; +} +.bi-list-item.disabled .bi-textarea, +.bi-list-item.disabled:hover .bi-textarea, +.bi-list-item.disabled:active .bi-textarea { + color: #9ea6b2 !important; +} +.bi-list-item.disabled .bi-high-light, +.bi-list-item.disabled:hover .bi-high-light, +.bi-list-item.disabled:active .bi-high-light { + color: #9ea6b2 !important; +} +.bi-theme-dark .bi-list-item:hover, +.bi-theme-dark .bi-list-item.hover { + color: #ffffff; + background-color: rgba(54, 133, 242, 0.05); + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#0d3685f2,endColorstr=#0d3685f2); +} +.bi-theme-dark .bi-list-item:hover .bi-input, +.bi-theme-dark .bi-list-item.hover .bi-input { + color: #ffffff; +} +.bi-theme-dark .bi-list-item:hover .bi-textarea, +.bi-theme-dark .bi-list-item.hover .bi-textarea { + color: #ffffff; +} +.bi-theme-dark .bi-list-item.disabled, +.bi-theme-dark .bi-list-item.disabled:hover, +.bi-theme-dark .bi-list-item.disabled:active { + background-color: transparent !important; + color: #878d9f !important; +} +.bi-theme-dark .bi-list-item.disabled .bi-input, +.bi-theme-dark .bi-list-item.disabled:hover .bi-input, +.bi-theme-dark .bi-list-item.disabled:active .bi-input { + color: #878d9f !important; +} +.bi-theme-dark .bi-list-item.disabled .bi-textarea, +.bi-theme-dark .bi-list-item.disabled:hover .bi-textarea, +.bi-theme-dark .bi-list-item.disabled:active .bi-textarea { + color: #878d9f !important; +} +.bi-theme-dark .bi-list-item.disabled .bi-high-light, +.bi-theme-dark .bi-list-item.disabled:hover .bi-high-light, +.bi-theme-dark .bi-list-item.disabled:active .bi-high-light { + color: #878d9f !important; +} +.bi-list-item-border:active, +.bi-list-item-border.active { + border: 1px solid #3685f2; +} +.bi-list-item-simple:hover, +.bi-list-item-simple.hover { + color: #3685f2; +} +.bi-list-item-simple:hover .bi-input, +.bi-list-item-simple.hover .bi-input { + color: #3685f2; +} +.bi-list-item-simple:hover .bi-textarea, +.bi-list-item-simple.hover .bi-textarea { + color: #3685f2; +} +.bi-list-item-simple.disabled, +.bi-list-item-simple.disabled:hover, +.bi-list-item-simple.disabled:active { + color: #9ea6b2 !important; +} +.bi-list-item-simple.disabled .bi-input, +.bi-list-item-simple.disabled:hover .bi-input, +.bi-list-item-simple.disabled:active .bi-input { + color: #9ea6b2 !important; +} +.bi-list-item-simple.disabled .bi-textarea, +.bi-list-item-simple.disabled:hover .bi-textarea, +.bi-list-item-simple.disabled:active .bi-textarea { + color: #9ea6b2 !important; +} +.bi-list-item-simple.disabled .bi-high-light, +.bi-list-item-simple.disabled:hover .bi-high-light, +.bi-list-item-simple.disabled:active .bi-high-light { + color: #9ea6b2 !important; +} +.bi-list-item-effect:hover { + color: #232e40; +} +.bi-list-item-effect:hover .bi-input { + color: #232e40; +} +.bi-list-item-effect:hover .bi-textarea { + color: #232e40; +} +.bi-list-item-effect.active, +.bi-list-item-effect:active { + color: #3685f2; +} +.bi-list-item-effect.active .bi-input, +.bi-list-item-effect:active .bi-input { + color: #3685f2; +} +.bi-list-item-effect.active .bi-textarea, +.bi-list-item-effect:active .bi-textarea { + color: #3685f2; +} +.bi-list-item-effect.disabled, +.bi-list-item-effect.disabled:hover, +.bi-list-item-effect.disabled:active { + color: #9ea6b2 !important; +} +.bi-list-item-effect.disabled .bi-input, +.bi-list-item-effect.disabled:hover .bi-input, +.bi-list-item-effect.disabled:active .bi-input { + color: #9ea6b2 !important; +} +.bi-list-item-effect.disabled .bi-textarea, +.bi-list-item-effect.disabled:hover .bi-textarea, +.bi-list-item-effect.disabled:active .bi-textarea { + color: #9ea6b2 !important; +} +.bi-list-item-effect.disabled .bi-high-light, +.bi-list-item-effect.disabled:hover .bi-high-light, +.bi-list-item-effect.disabled:active .bi-high-light { + color: #9ea6b2 !important; +} +.bi-theme-dark .bi-list-item-effect:hover { + color: #ffffff; +} +.bi-theme-dark .bi-list-item-effect:hover .bi-input { + color: #ffffff; +} +.bi-theme-dark .bi-list-item-effect:hover .bi-textarea { + color: #ffffff; +} +.bi-theme-dark .bi-list-item-effect.active, +.bi-theme-dark .bi-list-item-effect:active { + color: #3685f2; +} +.bi-theme-dark .bi-list-item-effect.active .bi-input, +.bi-theme-dark .bi-list-item-effect:active .bi-input { + color: #3685f2; +} +.bi-theme-dark .bi-list-item-effect.active .bi-textarea, +.bi-theme-dark .bi-list-item-effect:active .bi-textarea { + color: #3685f2; +} +.bi-theme-dark .bi-list-item-effect.disabled, +.bi-theme-dark .bi-list-item-effect.disabled:hover, +.bi-theme-dark .bi-list-item-effect.disabled:active { + background-color: transparent !important; + color: #878d9f !important; +} +.bi-theme-dark .bi-list-item-effect.disabled .bi-input, +.bi-theme-dark .bi-list-item-effect.disabled:hover .bi-input, +.bi-theme-dark .bi-list-item-effect.disabled:active .bi-input { + color: #878d9f !important; +} +.bi-theme-dark .bi-list-item-effect.disabled .bi-textarea, +.bi-theme-dark .bi-list-item-effect.disabled:hover .bi-textarea, +.bi-theme-dark .bi-list-item-effect.disabled:active .bi-textarea { + color: #878d9f !important; +} +.bi-theme-dark .bi-list-item-effect.disabled .bi-high-light, +.bi-theme-dark .bi-list-item-effect.disabled:hover .bi-high-light, +.bi-theme-dark .bi-list-item-effect.disabled:active .bi-high-light { + color: #878d9f !important; +} +.bi-list-item-active:hover, +.bi-list-item-active.hover { + color: #232e40; + background-color: rgba(54, 133, 242, 0.06); + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#0f3685f2,endColorstr=#0f3685f2); +} +.bi-list-item-active:hover .bi-input, +.bi-list-item-active.hover .bi-input { + color: #232e40; +} +.bi-list-item-active:hover .bi-textarea, +.bi-list-item-active.hover .bi-textarea { + color: #232e40; +} +.bi-list-item-active:active { + color: #3685f2; + background-color: rgba(54, 133, 242, 0.06); + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#0f3685f2,endColorstr=#0f3685f2); +} +.bi-list-item-active:active .bi-input { + color: #3685f2; +} +.bi-list-item-active:active .bi-textarea { + color: #3685f2; +} +.bi-list-item-active.active { + color: #3685f2; +} +.bi-list-item-active.active .bi-input { + color: #3685f2; +} +.bi-list-item-active.active .bi-textarea { + color: #3685f2; +} +.bi-list-item-active.disabled, +.bi-list-item-active.disabled:hover, +.bi-list-item-active.disabled:active { + background-color: transparent !important; + color: #9ea6b2 !important; +} +.bi-list-item-active.disabled .bi-input, +.bi-list-item-active.disabled:hover .bi-input, +.bi-list-item-active.disabled:active .bi-input { + color: #9ea6b2 !important; +} +.bi-list-item-active.disabled .bi-textarea, +.bi-list-item-active.disabled:hover .bi-textarea, +.bi-list-item-active.disabled:active .bi-textarea { + color: #9ea6b2 !important; +} +.bi-list-item-active.disabled .bi-high-light, +.bi-list-item-active.disabled:hover .bi-high-light, +.bi-list-item-active.disabled:active .bi-high-light { + color: #9ea6b2 !important; +} +.bi-theme-dark .bi-list-item-active:hover, +.bi-theme-dark .bi-list-item-active.hover { + color: #ffffff; + background-color: rgba(255, 255, 255, 0.05); + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#0dffffff,endColorstr=#0dffffff); +} +.bi-theme-dark .bi-list-item-active:hover .bi-input, +.bi-theme-dark .bi-list-item-active.hover .bi-input { + color: #ffffff; +} +.bi-theme-dark .bi-list-item-active:hover .bi-textarea, +.bi-theme-dark .bi-list-item-active.hover .bi-textarea { + color: #ffffff; +} +.bi-theme-dark .bi-list-item-active.active, +.bi-theme-dark .bi-list-item-active:active { + color: #3685f2; + background-color: rgba(255, 255, 255, 0.05); + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#0dffffff,endColorstr=#0dffffff); +} +.bi-theme-dark .bi-list-item-active.active .bi-input, +.bi-theme-dark .bi-list-item-active:active .bi-input { + color: #3685f2; +} +.bi-theme-dark .bi-list-item-active.active .bi-textarea, +.bi-theme-dark .bi-list-item-active:active .bi-textarea { + color: #3685f2; +} +.bi-theme-dark .bi-list-item-active.disabled, +.bi-theme-dark .bi-list-item-active.disabled:hover, +.bi-theme-dark .bi-list-item-active.disabled:active { + background-color: transparent !important; + color: #878d9f !important; +} +.bi-theme-dark .bi-list-item-active.disabled .bi-input, +.bi-theme-dark .bi-list-item-active.disabled:hover .bi-input, +.bi-theme-dark .bi-list-item-active.disabled:active .bi-input { + color: #878d9f !important; +} +.bi-theme-dark .bi-list-item-active.disabled .bi-textarea, +.bi-theme-dark .bi-list-item-active.disabled:hover .bi-textarea, +.bi-theme-dark .bi-list-item-active.disabled:active .bi-textarea { + color: #878d9f !important; +} +.bi-theme-dark .bi-list-item-active.disabled .bi-high-light, +.bi-theme-dark .bi-list-item-active.disabled:hover .bi-high-light, +.bi-theme-dark .bi-list-item-active.disabled:active .bi-high-light { + color: #878d9f !important; +} +.bi-list-item-active2:hover, +.bi-list-item-active2.hover { + color: #232e40; + background-color: rgba(54, 133, 242, 0.06); + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#0f3685f2,endColorstr=#0f3685f2); +} +.bi-list-item-active2:hover .bi-input, +.bi-list-item-active2.hover .bi-input { + color: #232e40; +} +.bi-list-item-active2:hover .bi-textarea, +.bi-list-item-active2.hover .bi-textarea { + color: #232e40; +} +.bi-list-item-active2:active, +.bi-list-item-active2.active { + color: #3685f2; + background-color: rgba(54, 133, 242, 0.06); + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#0f3685f2,endColorstr=#0f3685f2); +} +.bi-list-item-active2:active .bi-input, +.bi-list-item-active2.active .bi-input { + color: #3685f2; +} +.bi-list-item-active2:active .bi-textarea, +.bi-list-item-active2.active .bi-textarea { + color: #3685f2; +} +.bi-list-item-active2.disabled, +.bi-list-item-active2.disabled:hover, +.bi-list-item-active2.disabled:active { + background-color: transparent !important; + color: #9ea6b2 !important; +} +.bi-list-item-active2.disabled .bi-input, +.bi-list-item-active2.disabled:hover .bi-input, +.bi-list-item-active2.disabled:active .bi-input { + color: #9ea6b2 !important; +} +.bi-list-item-active2.disabled .bi-textarea, +.bi-list-item-active2.disabled:hover .bi-textarea, +.bi-list-item-active2.disabled:active .bi-textarea { + color: #9ea6b2 !important; +} +.bi-list-item-active2.disabled .bi-high-light, +.bi-list-item-active2.disabled:hover .bi-high-light, +.bi-list-item-active2.disabled:active .bi-high-light { + color: #9ea6b2 !important; +} +.bi-theme-dark .bi-list-item-active2:hover, +.bi-theme-dark .bi-list-item-active2.hover { + color: #ffffff; + background-color: rgba(54, 133, 242, 0.06); + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#0f3685f2,endColorstr=#0f3685f2); +} +.bi-theme-dark .bi-list-item-active2:hover .bi-input, +.bi-theme-dark .bi-list-item-active2.hover .bi-input { + color: #ffffff; +} +.bi-theme-dark .bi-list-item-active2:hover .bi-textarea, +.bi-theme-dark .bi-list-item-active2.hover .bi-textarea { + color: #ffffff; +} +.bi-theme-dark .bi-list-item-active2:active, +.bi-theme-dark .bi-list-item-active2.active { + color: #3685f2; + background-color: rgba(54, 133, 242, 0.06); + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#0f3685f2,endColorstr=#0f3685f2); +} +.bi-theme-dark .bi-list-item-active2:active .bi-input, +.bi-theme-dark .bi-list-item-active2.active .bi-input { + color: #3685f2; +} +.bi-theme-dark .bi-list-item-active2:active .bi-textarea, +.bi-theme-dark .bi-list-item-active2.active .bi-textarea { + color: #3685f2; +} +.bi-theme-dark .bi-list-item-active2.disabled, +.bi-theme-dark .bi-list-item-active2.disabled:hover, +.bi-theme-dark .bi-list-item-active2.disabled:active { + background-color: transparent !important; + color: #878d9f !important; +} +.bi-theme-dark .bi-list-item-active2.disabled .bi-input, +.bi-theme-dark .bi-list-item-active2.disabled:hover .bi-input, +.bi-theme-dark .bi-list-item-active2.disabled:active .bi-input { + color: #878d9f !important; +} +.bi-theme-dark .bi-list-item-active2.disabled .bi-textarea, +.bi-theme-dark .bi-list-item-active2.disabled:hover .bi-textarea, +.bi-theme-dark .bi-list-item-active2.disabled:active .bi-textarea { + color: #878d9f !important; +} +.bi-theme-dark .bi-list-item-active2.disabled .bi-high-light, +.bi-theme-dark .bi-list-item-active2.disabled:hover .bi-high-light, +.bi-theme-dark .bi-list-item-active2.disabled:active .bi-high-light { + color: #878d9f !important; +} +.bi-list-item-select:hover, +.bi-list-item-select.hover { + background-color: rgba(54, 133, 242, 0.06); + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#0f3685f2,endColorstr=#0f3685f2); +} +.bi-list-item-select:active, +.bi-list-item-select.active { + color: #ffffff; + background-color: #3685f2; +} +.bi-list-item-select:active .bi-input, +.bi-list-item-select.active .bi-input { + color: #ffffff; +} +.bi-list-item-select:active .bi-textarea, +.bi-list-item-select.active .bi-textarea { + color: #ffffff; +} +.bi-list-item-select:active .bi-high-light, +.bi-list-item-select.active .bi-high-light { + color: #ffffff; +} +.bi-list-item-select.button-success:active, +.bi-list-item-select.button-success.active { + color: #ffffff; + background-color: #13cd66; +} +.bi-list-item-select.button-success:active .bi-input, +.bi-list-item-select.button-success.active .bi-input { + color: #ffffff; +} +.bi-list-item-select.button-success:active .bi-textarea, +.bi-list-item-select.button-success.active .bi-textarea { + color: #ffffff; +} +.bi-list-item-select.button-success:active .bi-high-light, +.bi-list-item-select.button-success.active .bi-high-light { + color: #ffffff; +} +.bi-list-item-select.button-success:active.bi-high-light-border, +.bi-list-item-select.button-success.active.bi-high-light-border { + border-color: #13cd66; +} +.bi-list-item-select.button-warning { + color: #e65251; +} +.bi-list-item-select.button-warning .bi-input { + color: #e65251; +} +.bi-list-item-select.button-warning .bi-textarea { + color: #e65251; +} +.bi-list-item-select.button-warning .bi-high-light { + color: #e65251; +} +.bi-list-item-select.button-warning.bi-high-light-border { + border-color: #e65251; +} +.bi-list-item-select.button-warning:hover, +.bi-list-item-select.button-warning.hover { + color: #e65251; + background-color: #ffecec; +} +.bi-list-item-select.button-warning:hover .bi-input, +.bi-list-item-select.button-warning.hover .bi-input { + color: #e65251; +} +.bi-list-item-select.button-warning:hover .bi-textarea, +.bi-list-item-select.button-warning.hover .bi-textarea { + color: #e65251; +} +.bi-list-item-select.button-warning:hover .bi-high-light, +.bi-list-item-select.button-warning.hover .bi-high-light { + color: #e65251; +} +.bi-list-item-select.button-warning:hover.bi-high-light-border, +.bi-list-item-select.button-warning.hover.bi-high-light-border { + border-color: #e65251; +} +.bi-list-item-select.button-warning:active, +.bi-list-item-select.button-warning.active { + color: #ffffff; + background-color: #e65251; +} +.bi-list-item-select.button-warning:active .bi-input, +.bi-list-item-select.button-warning.active .bi-input { + color: #ffffff; +} +.bi-list-item-select.button-warning:active .bi-textarea, +.bi-list-item-select.button-warning.active .bi-textarea { + color: #ffffff; +} +.bi-list-item-select.button-warning:active .bi-high-light, +.bi-list-item-select.button-warning.active .bi-high-light { + color: #ffffff; +} +.bi-list-item-select.button-warning:active.bi-high-light-border, +.bi-list-item-select.button-warning.active.bi-high-light-border { + border-color: #e65251; +} +.bi-list-item-select.disabled { + color: #9ea6b2 !important; + background-color: transparent !important; +} +.bi-list-item-select.disabled .bi-input { + color: #9ea6b2 !important; +} +.bi-list-item-select.disabled .bi-textarea { + color: #9ea6b2 !important; +} +.bi-list-item-select.disabled .bi-high-light { + color: #9ea6b2 !important; +} +.bi-list-item-select.disabled.bi-high-light-border { + border-color: #d0d4da; +} +.bi-list-item-select.disabled.hover, +.bi-list-item-select.disabled.active { + color: #ffffff !important; + background-color: #d0d4da !important; +} +.bi-list-item-select.disabled.hover .bi-input, +.bi-list-item-select.disabled.active .bi-input { + color: #ffffff !important; +} +.bi-list-item-select.disabled.hover .bi-textarea, +.bi-list-item-select.disabled.active .bi-textarea { + color: #ffffff !important; +} +.bi-list-item-select.disabled.hover .bi-high-light, +.bi-list-item-select.disabled.active .bi-high-light { + color: #9ea6b2 !important; +} +.bi-list-item-select.disabled.hover.bi-high-light-border, +.bi-list-item-select.disabled.active.bi-high-light-border { + border-color: #d0d4da; +} +.bi-list-item-select2:hover, +.bi-list-item-select2.hover { + color: #232e40; +} +.bi-list-item-select2:hover .bi-input, +.bi-list-item-select2.hover .bi-input { + color: #232e40; +} +.bi-list-item-select2:hover .bi-textarea, +.bi-list-item-select2.hover .bi-textarea { + color: #232e40; +} +.bi-list-item-select2:hover.bi-border, +.bi-list-item-select2.hover.bi-border { + border-color: #3685f2; +} +.bi-list-item-select2:active { + color: #3685f2; +} +.bi-list-item-select2:active .bi-input { + color: #3685f2; +} +.bi-list-item-select2:active .bi-textarea { + color: #3685f2; +} +.bi-list-item-select2:active.bi-border { + border-color: #3685f2; +} +.bi-list-item-select2.active { + color: #ffffff; + background-color: #3685f2; +} +.bi-list-item-select2.active .bi-input { + color: #ffffff; +} +.bi-list-item-select2.active .bi-textarea { + color: #ffffff; +} +.bi-list-item-select2.active.bi-border { + border-color: #3685f2; +} +.bi-list-item-select2.disabled, +.bi-list-item-select2.disabled:hover, +.bi-list-item-select2.disabled:active { + background-color: transparent !important; + color: #9ea6b2 !important; +} +.bi-list-item-select2.disabled .bi-input, +.bi-list-item-select2.disabled:hover .bi-input, +.bi-list-item-select2.disabled:active .bi-input { + color: #9ea6b2 !important; +} +.bi-list-item-select2.disabled .bi-textarea, +.bi-list-item-select2.disabled:hover .bi-textarea, +.bi-list-item-select2.disabled:active .bi-textarea { + color: #9ea6b2 !important; +} +.bi-list-item-select2.disabled .bi-high-light, +.bi-list-item-select2.disabled:hover .bi-high-light, +.bi-list-item-select2.disabled:active .bi-high-light { + color: #9ea6b2 !important; +} +.bi-theme-dark .bi-list-item-select2:hover, +.bi-theme-dark .bi-list-item-select2.hover { + color: #ffffff; +} +.bi-theme-dark .bi-list-item-select2:hover .bi-input, +.bi-theme-dark .bi-list-item-select2.hover .bi-input { + color: #ffffff; +} +.bi-theme-dark .bi-list-item-select2:hover .bi-textarea, +.bi-theme-dark .bi-list-item-select2.hover .bi-textarea { + color: #ffffff; +} +.bi-theme-dark .bi-list-item-select2.active { + background-color: #20263b; +} +.bi-theme-dark .bi-list-item-select2.disabled, +.bi-theme-dark .bi-list-item-select2.disabled:hover, +.bi-theme-dark .bi-list-item-select2.disabled:active { + background-color: transparent !important; + color: #878d9f !important; +} +.bi-theme-dark .bi-list-item-select2.disabled .bi-input, +.bi-theme-dark .bi-list-item-select2.disabled:hover .bi-input, +.bi-theme-dark .bi-list-item-select2.disabled:active .bi-input { + color: #878d9f !important; +} +.bi-theme-dark .bi-list-item-select2.disabled .bi-textarea, +.bi-theme-dark .bi-list-item-select2.disabled:hover .bi-textarea, +.bi-theme-dark .bi-list-item-select2.disabled:active .bi-textarea { + color: #878d9f !important; +} +.bi-theme-dark .bi-list-item-select2.disabled .bi-high-light, +.bi-theme-dark .bi-list-item-select2.disabled:hover .bi-high-light, +.bi-theme-dark .bi-list-item-select2.disabled:active .bi-high-light { + color: #878d9f !important; +} +.bi-list-item-select3:hover, +.bi-list-item-select3.hover { + background-color: #f7f8fa; +} +.bi-list-item-select3:active, +.bi-list-item-select3.active { + color: #3685f2; + background-color: #f7f8fa; +} +.bi-list-item-select3:active .bi-input, +.bi-list-item-select3.active .bi-input { + color: #3685f2; +} +.bi-list-item-select3:active .bi-textarea, +.bi-list-item-select3.active .bi-textarea { + color: #3685f2; +} +.bi-list-item-select3.disabled:hover, +.bi-list-item-select3.disabled.hover, +.bi-list-item-select3.disabled:active, +.bi-list-item-select3.disabled.active { + background-color: #ffffff !important; +} +.bi-theme-dark .bi-list-item-select3:hover, +.bi-theme-dark .bi-list-item-select3.hover { + background-color: #191b2b; +} +.bi-theme-dark .bi-list-item-select3:active, +.bi-theme-dark .bi-list-item-select3.active { + color: #3685f2; + background-color: #191b2b; +} +.bi-theme-dark .bi-list-item-select3:active .bi-input, +.bi-theme-dark .bi-list-item-select3.active .bi-input { + color: #3685f2; +} +.bi-theme-dark .bi-list-item-select3:active .bi-textarea, +.bi-theme-dark .bi-list-item-select3.active .bi-textarea { + color: #3685f2; +} +.bi-theme-dark .bi-list-item-select3.disabled:hover, +.bi-theme-dark .bi-list-item-select3.disabled.hover, +.bi-theme-dark .bi-list-item-select3.disabled:active, +.bi-theme-dark .bi-list-item-select3.disabled.active { + background-color: #20263b !important; +} +.bi-theme-dark .bi-list-item-select:hover, +.bi-theme-dark .bi-list-item-select.hover { + color: #ffffff; + background-color: rgba(255, 255, 255, 0.05); + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#0dffffff,endColorstr=#0dffffff); +} +.bi-theme-dark .bi-list-item-select:hover .bi-input, +.bi-theme-dark .bi-list-item-select.hover .bi-input { + color: #ffffff; +} +.bi-theme-dark .bi-list-item-select:hover .bi-textarea, +.bi-theme-dark .bi-list-item-select.hover .bi-textarea { + color: #ffffff; +} +.bi-theme-dark .bi-list-item-select:active, +.bi-theme-dark .bi-list-item-select.active { + color: #ffffff; + background-color: #3685f2; +} +.bi-theme-dark .bi-list-item-select:active .bi-input, +.bi-theme-dark .bi-list-item-select.active .bi-input { + color: #ffffff; +} +.bi-theme-dark .bi-list-item-select:active .bi-textarea, +.bi-theme-dark .bi-list-item-select.active .bi-textarea { + color: #ffffff; +} +.bi-theme-dark .bi-list-item-select:active .bi-high-light, +.bi-theme-dark .bi-list-item-select.active .bi-high-light { + color: #ffffff; +} +.bi-theme-dark .bi-list-item-select.disabled, +.bi-theme-dark .bi-list-item-select.disabled:hover, +.bi-theme-dark .bi-list-item-select.disabled:active { + background-color: transparent !important; + color: #878d9f !important; +} +.bi-theme-dark .bi-list-item-select.disabled .bi-input, +.bi-theme-dark .bi-list-item-select.disabled:hover .bi-input, +.bi-theme-dark .bi-list-item-select.disabled:active .bi-input { + color: #878d9f !important; +} +.bi-theme-dark .bi-list-item-select.disabled .bi-textarea, +.bi-theme-dark .bi-list-item-select.disabled:hover .bi-textarea, +.bi-theme-dark .bi-list-item-select.disabled:active .bi-textarea { + color: #878d9f !important; +} +.bi-theme-dark .bi-list-item-select.disabled .bi-high-light, +.bi-theme-dark .bi-list-item-select.disabled:hover .bi-high-light, +.bi-theme-dark .bi-list-item-select.disabled:active .bi-high-light { + color: #878d9f !important; +} +.bi-list-item-none:hover, +.bi-list-item-none.hover { + color: inherit; + background-color: transparent; +} +.bi-list-item-none:hover .bi-input, +.bi-list-item-none.hover .bi-input { + color: inherit; +} +.bi-list-item-none:hover .bi-textarea, +.bi-list-item-none.hover .bi-textarea { + color: inherit; +} +.bi-list-item-none:active, +.bi-list-item-none.active { + color: inherit; + background-color: transparent; +} +.bi-list-item-none:active .bi-input, +.bi-list-item-none.active .bi-input { + color: inherit; +} +.bi-list-item-none:active .bi-textarea, +.bi-list-item-none.active .bi-textarea { + color: inherit; +} +.bi-list-item-none:active .bi-high-light, +.bi-list-item-none.active .bi-high-light { + color: inherit; +} +.bi-list-item-none.disabled, +.bi-list-item-none.disabled:hover, +.bi-list-item-none.disabled:active { + color: #9ea6b2 !important; + background-color: transparent !important; +} +.bi-list-item-none.disabled .bi-input, +.bi-list-item-none.disabled:hover .bi-input, +.bi-list-item-none.disabled:active .bi-input { + color: #9ea6b2 !important; +} +.bi-list-item-none.disabled .bi-textarea, +.bi-list-item-none.disabled:hover .bi-textarea, +.bi-list-item-none.disabled:active .bi-textarea { + color: #9ea6b2 !important; +} +.bi-list-item-none.disabled .bi-high-light, +.bi-list-item-none.disabled:hover .bi-high-light, +.bi-list-item-none.disabled:active .bi-high-light { + color: #9ea6b2 !important; +} +.bi-theme-dark .bi-list-item-none:hover, +.bi-theme-dark .bi-list-item-none.hover { + color: inherit; + background-color: transparent; +} +.bi-theme-dark .bi-list-item-none:hover .bi-input, +.bi-theme-dark .bi-list-item-none.hover .bi-input { + color: inherit; +} +.bi-theme-dark .bi-list-item-none:hover .bi-textarea, +.bi-theme-dark .bi-list-item-none.hover .bi-textarea { + color: inherit; +} +.bi-theme-dark .bi-list-item-none:active, +.bi-theme-dark .bi-list-item-none.active { + color: inherit; + background-color: transparent; +} +.bi-theme-dark .bi-list-item-none:active .bi-input, +.bi-theme-dark .bi-list-item-none.active .bi-input { + color: inherit; +} +.bi-theme-dark .bi-list-item-none:active .bi-textarea, +.bi-theme-dark .bi-list-item-none.active .bi-textarea { + color: inherit; +} +.bi-theme-dark .bi-list-item-none:active .bi-high-light, +.bi-theme-dark .bi-list-item-none.active .bi-high-light { + color: inherit; +} +.bi-theme-dark .bi-list-item-none.disabled, +.bi-theme-dark .bi-list-item-none.disabled:hover, +.bi-theme-dark .bi-list-item-none.disabled:active { + background-color: transparent !important; + color: #878d9f !important; +} +.bi-theme-dark .bi-list-item-none.disabled .bi-input, +.bi-theme-dark .bi-list-item-none.disabled:hover .bi-input, +.bi-theme-dark .bi-list-item-none.disabled:active .bi-input { + color: #878d9f !important; +} +.bi-theme-dark .bi-list-item-none.disabled .bi-textarea, +.bi-theme-dark .bi-list-item-none.disabled:hover .bi-textarea, +.bi-theme-dark .bi-list-item-none.disabled:active .bi-textarea { + color: #878d9f !important; +} +.bi-theme-dark .bi-list-item-none.disabled .bi-high-light, +.bi-theme-dark .bi-list-item-none.disabled:hover .bi-high-light, +.bi-theme-dark .bi-list-item-none.disabled:active .bi-high-light { + color: #878d9f !important; +} +/*****************cursor*****************/ +.cursor-pointer { + cursor: pointer; +} +.cursor-default { + cursor: default; +} +.cursor-move { + cursor: move; +} +/*****************cursor*****************/ +.y-overflow-auto { + overflow-y: auto; + overflow-x: hidden; +} +.x-overflow-auto { + overflow-y: hidden; + overflow-x: auto; +} +.y-overflow-scroll { + overflow-y: scroll; + overflow-x: hidden; +} +.x-overflow-scroll { + overflow-y: hidden; + overflow-x: scroll; +} +.overflow-auto { + overflow-x: auto; + overflow-y: auto; +} +.overflow-scroll { + overflow-x: scroll; + overflow-y: scroll; +} +.overflow-hidden { + overflow-x: hidden; + overflow-y: hidden; +} +.td-overflow { + white-space: normal; + word-break: break-all; +} +.overflow-dot { + text-overflow: ellipsis; + overflow-x: hidden; + overflow-y: hidden; + white-space: nowrap; +} +.display-block { + display: block; +} +.display-inline { + display: inline-block; + *display: inline; + *zoom: 1; +} +.display-table { + display: table; +} +/**常用于span元素在与combo并列时**/ +.vertical-super { + vertical-align: super; +} +.vertical-top { + vertical-align: top; +} +.horizon-center { + text-align: center; +} +.horizon-left { + text-align: left; +} +/*类似ie6的盒子模型 可以在有百分比的时候加border 支持到ie8*/ +.border-sizing { + -webkit-box-sizing: border-box; + /*Safari3.2+*/ + -moz-box-sizing: border-box; + /*Firefox3.5+*/ + -ms-box-sizing: border-box; + /*IE8*/ + box-sizing: border-box; + /*W3C标准(IE9+,Safari5.1+,Chrome10.0+,Opera10.6+都符合box-sizing的w3c标准语法)*/ +} +.content-sizing { + -webkit-box-sizing: content-box; + /*Safari3.2+*/ + -moz-box-sizing: content-box; + /*Firefox3.5+*/ + -ms-box-sizing: content-box; + /*IE8*/ + box-sizing: content-box; + /*W3C标准(IE9+,Safari5.1+,Chrome10.0+,Opera10.6+都符合box-sizing的w3c标准语法)*/ +} +.bi-flex-center-adapt-layout { + display: box; + /* OLD - Android 4.4- */ + display: -webkit-box; + /* OLD - iOS 6-, Safari 3.1-6 */ + display: -moz-box; + /* OLD - Firefox 19- (buggy but mostly works) */ + display: -ms-flexbox; + /* TWEENER - IE 10 */ + display: -webkit-flex; + /* NEW - Chrome */ + display: flex; + /* NEW, Spec - Opera 12.1, Firefox 20+ */ + /* 09版 */ + -webkit-box-orient: horizontal; + /* 12版 */ + -webkit-flex-direction: row; + -moz-flex-direction: row; + -ms-flex-direction: row; + -o-flex-direction: row; + flex-direction: row; + /* 09版 */ + -webkit-box-pack: center; + /* 12版 */ + -webkit-justify-content: center; + -moz-justify-content: center; + -ms-justify-content: center; + -o-justify-content: center; + -ms-flex-pack: center; + justify-content: center; + /* 09版 */ + -webkit-box-align: center; + /* 12版 */ + -webkit-align-items: center; + -moz-align-items: center; + -ms-flex-align: center; + -ms-align-items: center; + -o-align-items: center; + align-items: center; +} + +.bi-flex-horizontal-layout { + display: box; + /* OLD - Android 4.4- */ + display: -webkit-box; + /* OLD - iOS 6-, Safari 3.1-6 */ + display: -moz-box; + /* OLD - Firefox 19- (buggy but mostly works) */ + display: -ms-flexbox; + /* TWEENER - IE 10 */ + display: -webkit-flex; + /* NEW - Chrome */ + display: flex; + /* NEW, Spec - Opera 12.1, Firefox 20+ */ + /* 09版 */ + -webkit-box-orient: horizontal; + /* 12版 */ + -webkit-flex-direction: row; + -moz-flex-direction: row; + -ms-flex-direction: row; + -o-flex-direction: row; + flex-direction: row; + /* 09版 */ + -webkit-box-pack: flex-start; + /* 12版 */ + -webkit-justify-content: flex-start; + -moz-justify-content: flex-start; + -ms-justify-content: flex-start; + -o-justify-content: flex-start; + -ms-flex-pack: start; + justify-content: flex-start; + /* 09版 */ + -webkit-box-align: start; + /* 12版 */ + -webkit-align-items: flex-start; + -moz-align-items: flex-start; + -ms-align-items: flex-start; + -ms-flex-align: start; + -o-align-items: flex-start; + align-items: flex-start; + /* 09版 */ + /*-webkit-box-lines: multiple;*/ + /* 12版 */ + -webkit-flex-wrap: nowrap; + -moz-flex-wrap: nowrap; + -ms-flex-wrap: nowrap; + -o-flex-wrap: nowrap; + flex-wrap: nowrap; +} +.bi-flex-horizontal-layout.v-middle { + /* 09版 */ + -webkit-box-align: center; + /* 12版 */ + -webkit-align-items: center; + -moz-align-items: center; + -ms-align-items: center; + -ms-flex-align: center; + -o-align-items: center; + align-items: center; +} +.bi-flex-horizontal-layout.v-bottom { + /* 09版 */ + -webkit-box-align: flex-end; + /* 12版 */ + -webkit-align-items: flex-end; + -moz-align-items: flex-end; + -ms-align-items: flex-end; + -ms-flex-align: end; + -o-align-items: flex-end; + align-items: flex-end; +} +.bi-flex-horizontal-layout.v-stretch { + /* 09版 */ + -webkit-box-align: stretch; + /* 12版 */ + -webkit-align-items: stretch; + -moz-align-items: stretch; + -ms-align-items: stretch; + -ms-flex-align: stretch; + -o-align-items: stretch; + align-items: stretch; +} +.bi-flex-horizontal-layout.h-stretch { + /* 09版 */ + -webkit-box-orient: vertical; + /* 12版 */ + -webkit-flex-direction: column; + -moz-flex-direction: column; + -ms-flex-direction: column; + -o-flex-direction: column; + flex-direction: column; + /* 09版 */ + -webkit-box-pack: center; + /* 12版 */ + -webkit-justify-content: center; + -moz-justify-content: center; + -ms-justify-content: center; + -ms-flex-pack: center; + -o-justify-content: center; + justify-content: center; + /* 09版 */ + -webkit-box-align: stretch; + /* 12版 */ + -webkit-align-items: stretch; + -moz-align-items: stretch; + -ms-align-items: stretch; + -ms-flex-align: stretch; + -o-align-items: stretch; + align-items: stretch; +} + +.bi-flex-vertical-layout { + display: box; + /* OLD - Android 4.4- */ + display: -webkit-box; + /* OLD - iOS 6-, Safari 3.1-6 */ + display: -moz-box; + /* OLD - Firefox 19- (buggy but mostly works) */ + display: -ms-flexbox; + /* TWEENER - IE 10 */ + display: -webkit-flex; + /* NEW - Chrome */ + display: flex; + /* NEW, Spec - Opera 12.1, Firefox 20+ */ + /* 09版 */ + -webkit-box-orient: vertical; + /* 12版 */ + -webkit-flex-direction: column; + -moz-flex-direction: column; + -ms-flex-direction: column; + -o-flex-direction: column; + flex-direction: column; + /* 09版 */ + -webkit-box-pack: flex-start; + /* 12版 */ + -webkit-justify-content: flex-start; + -moz-justify-content: flex-start; + -ms-justify-content: flex-start; + -o-justify-content: flex-start; + -ms-flex-pack: start; + justify-content: flex-start; + /* 09版 */ + -webkit-box-align: start; + /* 12版 */ + -webkit-align-items: flex-start; + -moz-align-items: flex-start; + -ms-align-items: flex-start; + -ms-flex-align: start; + -o-align-items: flex-start; + align-items: flex-start; + /* 09版 */ + /*-webkit-box-lines: multiple;*/ + /* 12版 */ + -webkit-flex-wrap: nowrap; + -moz-flex-wrap: nowrap; + -ms-flex-wrap: nowrap; + -o-flex-wrap: nowrap; + flex-wrap: nowrap; +} +.bi-flex-vertical-layout.h-center { + /* 09版 */ + -webkit-box-align: center; + /* 12版 */ + -webkit-align-items: center; + -moz-align-items: center; + -ms-align-items: center; + -ms-flex-align: center; + -o-align-items: center; + align-items: center; +} +.bi-flex-vertical-layout.h-right { + /* 09版 */ + -webkit-box-align: flex-end; + /* 12版 */ + -webkit-align-items: flex-end; + -moz-align-items: flex-end; + -ms-align-items: flex-end; + -ms-flex-align: end; + -o-align-items: flex-end; + align-items: flex-end; +} +.bi-flex-vertical-layout.h-stretch { + /* 09版 */ + -webkit-box-align: stretch; + /* 12版 */ + -webkit-align-items: stretch; + -moz-align-items: stretch; + -ms-align-items: stretch; + -ms-flex-align: stretch; + -o-align-items: stretch; + align-items: stretch; +} +.bi-flex-vertical-layout.v-stretch { + /* 09版 */ + -webkit-box-orient: horizontal; + /* 12版 */ + -webkit-flex-direction: row; + -moz-flex-direction: row; + -ms-flex-direction: row; + -o-flex-direction: row; + flex-direction: row; + /* 09版 */ + -webkit-box-pack: center; + /* 12版 */ + -webkit-justify-content: center; + -moz-justify-content: center; + -ms-justify-content: center; + -ms-flex-pack: center; + -o-justify-content: center; + justify-content: center; + /* 09版 */ + -webkit-box-align: stretch; + /* 12版 */ + -webkit-align-items: stretch; + -moz-align-items: stretch; + -ms-align-items: stretch; + -ms-flex-align: stretch; + -o-align-items: stretch; + align-items: stretch; +} + +.bi-flex-scrollable-center-adapt-layout .flex-scrollable-center-adapt-layout-wrapper { + display: box; + /* OLD - Android 4.4- */ + display: -webkit-box; + /* OLD - iOS 6-, Safari 3.1-6 */ + display: -moz-box; + /* OLD - Firefox 19- (buggy but mostly works) */ + display: -ms-flexbox; + /* TWEENER - IE 10 */ + display: -webkit-flex; + /* NEW - Chrome */ + display: flex; + /* NEW, Spec - Opera 12.1, Firefox 20+ */ + /* 09版 */ + -webkit-box-orient: horizontal; + /* 12版 */ + -webkit-flex-direction: row; + -moz-flex-direction: row; + -ms-flex-direction: row; + -o-flex-direction: row; + flex-direction: row; + /* 09版 */ + -webkit-box-pack: center; + /* 12版 */ + -webkit-justify-content: center; + -moz-justify-content: center; + -ms-justify-content: center; + -ms-flex-pack: center; + -o-justify-content: center; + justify-content: center; + /* 09版 */ + -webkit-box-align: center; + /* 12版 */ + -webkit-align-items: center; + -moz-align-items: center; + -ms-align-items: center; + -ms-flex-align: center; + -o-align-items: center; + align-items: center; + min-width: 100%; + min-height: 100%; + float: left; +} + +.bi-flex-scrollable-horizontal-layout .flex-scrollable-horizontal-layout-wrapper { + display: box; + /* OLD - Android 4.4- */ + display: -webkit-box; + /* OLD - iOS 6-, Safari 3.1-6 */ + display: -moz-box; + /* OLD - Firefox 19- (buggy but mostly works) */ + display: -ms-flexbox; + /* TWEENER - IE 10 */ + display: -webkit-flex; + /* NEW - Chrome */ + display: flex; + /* NEW, Spec - Opera 12.1, Firefox 20+ */ + /* 09版 */ + -webkit-box-orient: horizontal; + /* 12版 */ + -webkit-flex-direction: row; + -moz-flex-direction: row; + -ms-flex-direction: row; + -o-flex-direction: row; + flex-direction: row; + /* 09版 */ + -webkit-box-pack: flex-start; + /* 12版 */ + -webkit-justify-content: flex-start; + -moz-justify-content: flex-start; + -ms-justify-content: flex-start; + -ms-flex-pack: start; + -o-justify-content: flex-start; + justify-content: flex-start; + /* 09版 */ + -webkit-box-align: flex-start; + /* 12版 */ + -webkit-align-items: flex-start; + -moz-align-items: flex-start; + -ms-align-items: flex-start; + -ms-flex-align: start; + -o-align-items: flex-start; + align-items: flex-start; + /* 09版 */ + /*-webkit-box-lines: multiple;*/ + /* 12版 */ + -webkit-flex-wrap: nowrap; + -moz-flex-wrap: nowrap; + -ms-flex-wrap: nowrap; + -o-flex-wrap: nowrap; + flex-wrap: nowrap; + min-height: 100%; +} +.bi-flex-scrollable-horizontal-layout .flex-scrollable-horizontal-layout-wrapper.v-middle { + /* 09版 */ + -webkit-box-align: center; + /* 12版 */ + -webkit-align-items: center; + -moz-align-items: center; + -ms-align-items: center; + -o-align-items: center; + align-items: center; +} +.bi-flex-scrollable-horizontal-layout .flex-scrollable-horizontal-layout-wrapper.v-bottom { + /* 09版 */ + -webkit-box-align: flex-end; + /* 12版 */ + -webkit-align-items: flex-end; + -moz-align-items: flex-end; + -ms-align-items: flex-end; + -o-align-items: flex-end; + align-items: flex-end; +} +.bi-flex-scrollable-horizontal-layout .flex-scrollable-horizontal-layout-wrapper.v-stretch { + /* 09版 */ + -webkit-box-align: stretch; + /* 12版 */ + -webkit-align-items: stretch; + -moz-align-items: stretch; + -ms-align-items: stretch; + -o-align-items: stretch; + align-items: stretch; +} +.bi-flex-scrollable-horizontal-layout .flex-scrollable-horizontal-layout-wrapper.h-stretch { + /* 09版 */ + -webkit-box-orient: vertical; + /* 12版 */ + -webkit-flex-direction: column; + -moz-flex-direction: column; + -ms-flex-direction: column; + -o-flex-direction: column; + flex-direction: column; + /* 09版 */ + -webkit-box-pack: center; + /* 12版 */ + -webkit-justify-content: center; + -moz-justify-content: center; + -ms-justify-content: center; + -ms-flex-pack: center; + -o-justify-content: center; + justify-content: center; + /* 09版 */ + -webkit-box-align: stretch; + /* 12版 */ + -webkit-align-items: stretch; + -moz-align-items: stretch; + -ms-align-items: stretch; + -ms-flex-align: stretch; + -o-align-items: stretch; + align-items: stretch; +} + +.bi-flex-scrollable-vertical-layout .flex-scrollable-vertical-layout-wrapper { + display: box; + /* OLD - Android 4.4- */ + display: -webkit-box; + /* OLD - iOS 6-, Safari 3.1-6 */ + display: -moz-box; + /* OLD - Firefox 19- (buggy but mostly works) */ + display: -ms-flexbox; + /* TWEENER - IE 10 */ + display: -webkit-flex; + /* NEW - Chrome */ + display: flex; + /* NEW, Spec - Opera 12.1, Firefox 20+ */ + /* 09版 */ + -webkit-box-orient: vertical; + /* 12版 */ + -webkit-flex-direction: column; + -moz-flex-direction: column; + -ms-flex-direction: column; + -o-flex-direction: column; + flex-direction: column; + /* 09版 */ + -webkit-box-pack: flex-start; + /* 12版 */ + -webkit-justify-content: flex-start; + -moz-justify-content: flex-start; + -ms-justify-content: flex-start; + -ms-flex-pack: start; + -o-justify-content: flex-start; + justify-content: flex-start; + /* 09版 */ + -webkit-box-align: flex-start; + /* 12版 */ + -webkit-align-items: flex-start; + -moz-align-items: flex-start; + -ms-align-items: flex-start; + -ms-flex-align: start; + -o-align-items: flex-start; + align-items: flex-start; + /* 09版 */ + /*-webkit-box-lines: multiple;*/ + /* 12版 */ + -webkit-flex-wrap: nowrap; + -moz-flex-wrap: nowrap; + -ms-flex-wrap: nowrap; + -o-flex-wrap: nowrap; + flex-wrap: nowrap; + min-width: 100%; +} +.bi-flex-scrollable-vertical-layout .flex-scrollable-vertical-layout-wrapper.h-center { + /* 09版 */ + -webkit-box-align: center; + /* 12版 */ + -webkit-align-items: center; + -moz-align-items: center; + -ms-align-items: center; + -ms-flex-align: center; + -o-align-items: center; + align-items: center; +} +.bi-flex-scrollable-vertical-layout .flex-scrollable-vertical-layout-wrapper.h-right { + /* 09版 */ + -webkit-box-align: flex-end; + /* 12版 */ + -webkit-align-items: flex-end; + -moz-align-items: flex-end; + -ms-align-items: flex-end; + -ms-flex-align: end; + -o-align-items: flex-end; + align-items: flex-end; +} +.bi-flex-scrollable-vertical-layout .flex-scrollable-vertical-layout-wrapper.h-stretch { + /* 09版 */ + -webkit-box-align: stretch; + /* 12版 */ + -webkit-align-items: stretch; + -moz-align-items: stretch; + -ms-align-items: stretch; + -ms-flex-align: stretch; + -o-align-items: stretch; + align-items: stretch; +} +.bi-flex-scrollable-vertical-layout .flex-scrollable-vertical-layout-wrapper.v-stretch { + /* 09版 */ + -webkit-box-orient: horizontal; + /* 12版 */ + -webkit-flex-direction: row; + -moz-flex-direction: row; + -ms-flex-direction: row; + -o-flex-direction: row; + flex-direction: row; + /* 09版 */ + -webkit-box-pack: center; + /* 12版 */ + -webkit-justify-content: center; + -moz-justify-content: center; + -ms-justify-content: center; + -ms-flex-pack: center; + -o-justify-content: center; + justify-content: center; + /* 09版 */ + -webkit-box-align: stretch; + /* 12版 */ + -webkit-align-items: stretch; + -moz-align-items: stretch; + -ms-align-items: stretch; + -ms-flex-align: stretch; + -o-align-items: stretch; + align-items: stretch; +} +.bi-inline-center-adapt-layout:after { + display: inline-block; + width: 0; + min-height: 100%; + vertical-align: middle; + content: ' '; +} +.bi-inline-center-adapt-layout > .inline-center-adapt-item { + display: inline-block; +} +.bi-inline-center-adapt-layout > .inline-center-adapt-item.x-icon { + display: inline-block !important; +} +.bi-inline-center-adapt-layout > .bi-combo.bi-combo-popup { + display: inline-block !important; +} + +.bi-inline-vertical-adapt-layout:after { + display: inline-block; + width: 0; + min-height: 100%; + vertical-align: middle; + content: ' '; +} +.bi-inline-vertical-adapt-layout > .inline-vertical-adapt-item { + display: inline-block; +} +.bi-inline-vertical-adapt-layout > .inline-vertical-adapt-item.x-icon { + display: inline-block !important; +} +.bi-inline-vertical-adapt-layout > .bi-combo.bi-combo-popup { + display: inline-block !important; +} +.bi-theme-dark { + color: #d6e0dc; +} +.bi-theme-dark .bi-input { + color: #ffffff; +} +.bi-year-calendar { + padding-top: 5px; + padding-bottom: 5px; +} +.bi-color-chooser-popup .disable-mask { + opacity: 0.5; + filter: alpha(opacity=50); + background-color: #ffffff; +} + +.bi-color-chooser-trigger { + -webkit-border-radius: 2px; + -moz-border-radius: 2px; + border-radius: 2px; +} +.bi-color-picker-button .color-picker-button-mask { + border: 1px solid #232e40; +} +.bi-theme-dark .bi-color-picker-button .color-picker-button-mask { + border: 1px solid #ffffff; +} +.bi-farbtastic .wheel { + background: url('images/1x/background/wheel.png') no-repeat center center; +} +.bi-farbtastic .overlay { + background: url('images/1x/background/mask.png') no-repeat center center; +} +.bi-farbtastic .marker { + background: url('images/1x/background/marker.png') no-repeat center center; +} +.bi-display-tree .ztree li span.button.switch.center_open { + background: url('images/2x/icon/tree_vertical_line_3.png') no-repeat center center; + background-size: contain; +} +.bi-display-tree .ztree li span.button.switch.roots_open { + background: url('images/2x/icon/tree_vertical_line_2.png') no-repeat center center; + background-size: contain; +} +.bi-display-tree .ztree li span.button.switch.bottom_open { + background: url('images/2x/icon/tree_vertical_line_4.png') no-repeat center center; + background-size: contain; +} +.bi-display-tree .ztree.hack li span.button.switch.center_open { + background: url('images/1x/icon/tree_vertical_line_3.png') no-repeat center center; +} +.bi-display-tree .ztree.hack li span.button.switch.roots_open { + background: url('images/1x/icon/tree_vertical_line_2.png') no-repeat center center; +} +.bi-display-tree .ztree.hack li span.button.switch.bottom_open { + background: url('images/1x/icon/tree_vertical_line_4.png') no-repeat center center; +} +.ztree li ul.line { + position: relative; +} +.ztree li ul.line:before { + position: absolute; + content: ''; + border-left: 1px dashed #D0D4DA; + height: calc(100% - 3px); + left: 12px; + margin-top: 1px; +} +.ztree.hack li ul.line { + background: url('images/1x/icon/tree_vertical_line_1.png') repeat-y 1px 0; +} +.bi-theme-dark .ztree li ul.line:before { + border-left: 1px dashed #606479; +} +.bi-theme-dark .ztree.hack li ul.line { + background: url('images/1x/icon/dark/tree_vertical_line_1.png') repeat-y 1px 0; +} +.ztree li span.button.chk.checkbox_false_full { + background: url('images/2x/icon/check_box_normal.png') no-repeat center center; + background-size: contain; +} +.ztree li span.button.chk.checkbox_false_full_focus { + background: url('images/2x/icon/check_box_normal.png') no-repeat center center; + background-size: contain; +} +.ztree li span.button.chk.checkbox_false_part { + background: url('images/2x/icon/check_box_normal.png') no-repeat center center; + background-size: contain; +} +.ztree li span.button.chk.checkbox_false_part_focus { + background: url('images/2x/icon/half_selected.png') no-repeat center center; + background-size: contain; +} +.ztree li span.button.chk.checkbox_true_full { + background: url('images/2x/icon/check_box_active.png') no-repeat center center; + background-size: contain; +} +.ztree li span.button.chk.checkbox_true_full_focus { + background: url('images/2x/icon/check_box_active.png') no-repeat center center; + background-size: contain; +} +.ztree li span.button.chk.checkbox_true_part { + background: url('images/2x/icon/half_selected.png') no-repeat center center; + background-size: contain; +} +.ztree li span.button.chk.checkbox_true_part_focus { + background: url('images/2x/icon/half_selected.png') no-repeat center center; + background-size: contain; +} +.ztree.hack li span.button.chk.checkbox_false_full { + background: url('images/1x/icon/check_box_normal.png') no-repeat center center; +} +.ztree.hack li span.button.chk.checkbox_false_full_focus { + background: url('images/1x/icon/check_box_normal.png') no-repeat center center; +} +.ztree.hack li span.button.chk.checkbox_false_part { + background: url('images/1x/icon/check_box_normal.png') no-repeat center center; +} +.ztree.hack li span.button.chk.checkbox_false_part_focus { + background: url('images/1x/icon/half_selected.png') no-repeat center center; +} +.ztree.hack li span.button.chk.checkbox_true_full { + background: url('images/1x/icon/check_box_active.png') no-repeat center center; +} +.ztree.hack li span.button.chk.checkbox_true_full_focus { + background: url('images/1x/icon/check_box_active.png') no-repeat center center; +} +.ztree.hack li span.button.chk.checkbox_true_part { + background: url('images/1x/icon/half_selected.png') no-repeat center center; +} +.ztree.hack li span.button.chk.checkbox_true_part_focus { + background: url('images/1x/icon/half_selected.png') no-repeat center center; +} +.ztree li span.button.root_open { + background: url('images/2x/icon/tree_expand_1.png') no-repeat center center; + background-size: contain; +} +.ztree.hack li span.button.root_open { + background: url('images/1x/icon/tree_expand_1.png') no-repeat center center; +} +.bi-theme-dark .ztree li span.button.root_open { + background: url('images/2x/icon/dark/tree_expand_1.png') no-repeat center center; + background-size: contain; +} +.bi-theme-dark .ztree.hack li span.button.root_open { + background: url('images/1x/icon/dark/tree_expand_1.png') no-repeat center center; +} +.ztree li span.button.root_close { + background: url('images/2x/icon/tree_collapse_1.png') no-repeat center center; + background-size: contain; +} +.ztree.hack li span.button.root_close { + background: url('images/1x/icon/tree_collapse_1.png') no-repeat center center; +} +.bi-theme-dark .ztree li span.button.root_close { + background: url('images/2x/icon/dark/tree_collapse_1.png') no-repeat center center; + background-size: contain; +} +.bi-theme-dark .ztree.hack li span.button.root_close { + background: url('images/1x/icon/dark/tree_collapse_1.png') no-repeat center center; +} +.ztree li span.button.roots_open { + background: url('images/2x/icon/tree_expand_2.png') no-repeat center center; + background-size: contain; +} +.ztree.hack li span.button.roots_open { + background: url('images/1x/icon/tree_expand_2.png') no-repeat center center; +} +.bi-theme-dark .ztree li span.button.roots_open { + background: url('images/2x/icon/dark/tree_expand_2.png') no-repeat center center; + background-size: contain; +} +.bi-theme-dark .ztree.hack li span.button.roots_open { + background: url('images/1x/icon/dark/tree_expand_2.png') no-repeat center center; +} +.ztree li span.button.roots_close { + background: url('images/2x/icon/tree_collapse_2.png') no-repeat center center; + background-size: contain; +} +.ztree.hack li span.button.roots_close { + background: url('images/1x/icon/tree_collapse_2.png') no-repeat center center; +} +.bi-theme-dark .ztree li span.button.roots_close { + background: url('images/2x/icon/dark/tree_collapse_2.png') no-repeat center center; + background-size: contain; +} +.bi-theme-dark .ztree.hack li span.button.roots_close { + background: url('images/1x/icon/dark/tree_collapse_2.png') no-repeat center center; +} +.ztree li span.button.center_open { + background: url('images/2x/icon/tree_expand_3.png') no-repeat center center; + background-size: contain; +} +.ztree.hack li span.button.center_open { + background: url('images/1x/icon/tree_expand_3.png') no-repeat center center; +} +.bi-theme-dark .ztree li span.button.center_open { + background: url('images/2x/icon/dark/tree_expand_3.png') no-repeat center center; + background-size: contain; +} +.bi-theme-dark .ztree.hack li span.button.center_open { + background: url('images/1x/icon/dark/tree_expand_3.png') no-repeat center center; +} +.ztree li span.button.center_close { + background: url('images/2x/icon/tree_collapse_3.png') no-repeat center center; + background-size: contain; +} +.ztree.hack li span.button.center_close { + background: url('images/1x/icon/tree_collapse_3.png') no-repeat center center; +} +.bi-theme-dark .ztree li span.button.center_close { + background: url('images/2x/icon/dark/tree_collapse_3.png') no-repeat center center; + background-size: contain; +} +.bi-theme-dark .ztree.hack li span.button.center_close { + background: url('images/1x/icon/dark/tree_collapse_3.png') no-repeat center center; +} +.ztree li span.button.bottom_open { + background: url('images/2x/icon/tree_expand_4.png') no-repeat center center; + background-size: contain; +} +.ztree.hack li span.button.bottom_open { + background: url('images/1x/icon/tree_expand_4.png') no-repeat center center; +} +.bi-theme-dark .ztree li span.button.bottom_open { + background: url('images/2x/icon/dark/tree_expand_4.png') no-repeat center center; + background-size: contain; +} +.bi-theme-dark .ztree.hack li span.button.bottom_open { + background: url('images/1x/icon/dark/tree_expand_4.png') no-repeat center center; +} +.ztree li span.button.bottom_close { + background: url('images/2x/icon/tree_collapse_4.png') no-repeat center center; + background-size: contain; +} +.ztree.hack li span.button.bottom_close { + background: url('images/1x/icon/tree_collapse_4.png') no-repeat center center; +} +.bi-theme-dark .ztree li span.button.bottom_close { + background: url('images/2x/icon/dark/tree_collapse_4.png') no-repeat center center; + background-size: contain; +} +.bi-theme-dark .ztree.hack li span.button.bottom_close { + background: url('images/1x/icon/dark/tree_collapse_4.png') no-repeat center center; +} +.ztree li span.button.roots_docu { + background: url('images/2x/icon/tree_vertical_line_2.png') no-repeat center center; + background-size: contain; +} +.ztree.hack li span.button.roots_docu { + background: url('images/1x/icon/tree_vertical_line_2.png') no-repeat center center; +} +.bi-theme-dark .ztree li span.button.roots_docu { + background: url('images/2x/icon/dark/tree_vertical_line_2.png') no-repeat center center; + background-size: contain; +} +.bi-theme-dark .ztree.hack li span.button.roots_docu { + background: url('images/1x/icon/dark/tree_vertical_line_2.png') no-repeat center center; +} +.ztree li span.button.center_docu { + background: url('images/2x/icon/tree_vertical_line_3.png') no-repeat center center; + background-size: contain; +} +.ztree.hack li span.button.center_docu { + background: url('images/1x/icon/tree_vertical_line_3.png') no-repeat center center; +} +.bi-theme-dark .ztree li span.button.center_docu { + background: url('images/2x/icon/dark/tree_vertical_line_3.png') no-repeat center center; + background-size: contain; +} +.bi-theme-dark .ztree.hack li span.button.center_docu { + background: url('images/1x/icon/dark/tree_vertical_line_3.png') no-repeat center center; +} +.ztree li span.button.bottom_docu { + background: url('images/2x/icon/tree_vertical_line_4.png') no-repeat center center; + background-size: contain; +} +.ztree.hack li span.button.bottom_docu { + background: url('images/1x/icon/tree_vertical_line_4.png') no-repeat center center; +} +.bi-theme-dark .ztree li span.button.bottom_docu { + background: url('images/2x/icon/dark/tree_vertical_line_4.png') no-repeat center center; + background-size: contain; +} +.bi-theme-dark .ztree.hack li span.button.bottom_docu { + background: url('images/1x/icon/dark/tree_vertical_line_4.png') no-repeat center center; +} +.ztree li span.button.ico_loading { + background: url('images/2x/icon/loading.gif') no-repeat center center; + background-size: contain; +} +.ztree.hack li span.button.ico_loading { + background: url('images/1x/icon/loading.gif') no-repeat center center; +} +.base-line-conn-background { + background: url('images/1x/icon/tree_vertical_line_1.png') repeat-y 0 0; +} +.bi-theme-dark .base-line-conn-background { + background: url('images/1x/icon/dark/tree_vertical_line_1.png') repeat-y 0 0; +} +.first-line-conn-background { + background: url('images/1x/icon/tree_vertical_line_2.png') no-repeat center center; +} +.bi-theme-dark .first-line-conn-background { + background: url('images/1x/icon/dark/tree_vertical_line_2.png') no-repeat center center; +} +.mid-line-conn-background { + background: url('images/1x/icon/tree_vertical_line_3.png') no-repeat center center; +} +.bi-theme-dark .mid-line-conn-background { + background: url('images/1x/icon/dark/tree_vertical_line_3.png') no-repeat center center; +} +.last-line-conn-background { + background: url('images/1x/icon/tree_vertical_line_4.png') no-repeat center center; +} +.bi-theme-dark .last-line-conn-background { + background: url('images/1x/icon/dark/tree_vertical_line_4.png') no-repeat center center; +} +.loading-background { + background: url('images/2x/icon/loading.gif') no-repeat center center; + background-size: contain; +} +.auto-color-background { + background: url('images/2x/background/auto_color.png') no-repeat center center; + background-size: contain; +} +.auto-color-normal-background { + background: url('images/2x/background/auto_color_normal.png') no-repeat center center; + background-size: contain; +} +.auto-color-normal-disabled-background { + background: url('images/2x/background/auto_color_normal_disable.png') no-repeat center center; + background-size: contain; +} +.trans-color-background { + background: url('images/2x/background/trans_normal.png') no-repeat center center; + background-size: contain; +} +.trans-color-disabled-background { + background: url('images/2x/background/trans_disable.png') no-repeat center center; + background-size: contain; +} +.auto-color-background.hack { + background: url('images/1x/background/auto_color.png') no-repeat center center; +} +.auto-color-normal-background.hack { + background: url('images/1x/background/auto_color_normal.png') no-repeat center center; +} +.auto-color-normal-disabled-background.hack { + background: url('images/1x/background/auto_color_normal_disable.png') no-repeat center center; +} +.trans-color-background.hack { + background: url('images/1x/background/trans_normal.png') no-repeat center center; +} +.trans-color-disabled-background.hack { + background: url('images/1x/background/trans_disable.png') no-repeat center center; +} +.wave-loading { + background: url('images/2x/icon/wave_loading.gif') no-repeat center center; + background-size: contain; +} +.wave-loading.hack { + background: url('images/1x/icon/wave_loading.gif') no-repeat center center; +} +.bi-color-picker-editor .color-picker-editor-display { + -webkit-border-radius: 2px; + -moz-border-radius: 2px; + border-radius: 2px; +} +.bi-color-picker-editor.disabled .auto-color-normal-background { + background: url('images/2x/background/auto_color_normal_disable.png') no-repeat center center; + background-size: contain; +} +.bi-color-picker-editor.disabled .auto-color-normal-background.hack { + background: url('images/1x/background/auto_color_normal_disable.png') no-repeat center center; +} +.bi-color-picker-editor.disabled .trans-color-background { + background: url('images/2x/background/trans_disable.png') no-repeat center center; + background-size: contain; +} +.bi-color-picker-editor.disabled .trans-color-background.hack { + background: url('images/1x/background/trans_disable.png') no-repeat center center; +} +.bi-farbtastic * { + cursor: crosshair; +} +.bi-farbtastic .marker { + margin: -8px 0 0 -8px; +} +.bi-bubble-combo .button-combo-triangle-wrapper { + position: fixed !important; + line-height: 0; + z-index: 10000000; + background-color: rgba(255, 255, 255, 0); + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#00ffffff,endColorstr=#00ffffff); +} +.bi-bubble-combo .bubble-combo-triangle-left { + z-index: 1; + position: absolute; + width: 6px; + height: 16px; + text-align: left; +} +.bi-bubble-combo .bubble-combo-triangle-left:before { + position: absolute; + width: 6px; + height: 6px; + margin-left: -3px; + margin-top: 4px; + content: ""; + transform: rotate(-45deg); +} +.bi-bubble-combo .bubble-combo-triangle-right { + z-index: 1; + position: absolute; + width: 6px; + height: 16px; + text-align: left; +} +.bi-bubble-combo .bubble-combo-triangle-right:before { + position: absolute; + width: 6px; + height: 6px; + margin-left: 2px; + margin-top: 3px; + content: ""; + transform: rotate(135deg); +} +.bi-bubble-combo .bubble-combo-triangle-top { + z-index: 1; + position: absolute; + width: 16px; + height: 6px; + text-align: left; +} +.bi-bubble-combo .bubble-combo-triangle-top:before { + position: absolute; + width: 6px; + height: 6px; + margin-left: 4px; + margin-top: -3px; + content: ""; + transform: rotate(45deg); +} +.bi-bubble-combo .bubble-combo-triangle-bottom { + z-index: 1; + position: absolute; + width: 16px; + height: 6px; + text-align: left; +} +.bi-bubble-combo .bubble-combo-triangle-bottom:before { + position: absolute; + width: 6px; + height: 6px; + margin-left: 4px; + margin-top: 2px; + content: ""; + transform: rotate(-135deg); +} +.bi-bubble-combo .bubble-combo-triangle-left:before, +.bi-bubble-combo .bubble-combo-triangle-right:before, +.bi-bubble-combo .bubble-combo-triangle-top:before, +.bi-bubble-combo .bubble-combo-triangle-bottom:before { + background-color: #ffffff; + border-bottom: 1px solid #f2f4f7; + border-right: 1px solid #f2f4f7; +} +.bi-theme-dark .bi-bubble-combo .bubble-combo-triangle-left:before, +.bi-theme-dark .bi-bubble-combo .bubble-combo-triangle-right:before, +.bi-theme-dark .bi-bubble-combo .bubble-combo-triangle-top:before, +.bi-theme-dark .bi-bubble-combo .bubble-combo-triangle-bottom:before { + background-color: #20263b; + border-bottom: 1px solid #292f45; + border-right: 1px solid #292f45; +} + +.bi-combo > .bi-trigger .bi-trigger-icon-button .x-icon { + -webkit-transform: rotate(0deg); + -moz-transform: rotate(0deg); + transform: rotate(0deg); + -webkit-transition: transform 0.3s ease; + -moz-transition: transform 0.3s ease; + -o-transition: transform 0.3s ease; + transition: transform 0.3s ease; +} +.bi-combo.bi-combo-popup { + display: block !important; + visibility: visible !important; +} +.bi-combo.bi-combo-popup > .bi-trigger .bi-trigger-icon-button .x-icon { + -webkit-transform: rotate(180deg); + -moz-transform: rotate(180deg); + transform: rotate(180deg); + -webkit-transition: transform 0.3s ease; + -moz-transition: transform 0.3s ease; + -o-transition: transform 0.3s ease; + transition: transform 0.3s ease; +} +.bi-combo.bi-combo-popup > .bi-border, +.bi-combo.bi-combo-hover > .bi-border, +.bi-combo:hover > .bi-border { + border-color: #3685f2; +} +.bi-combo.disabled.bi-combo-hover > .bi-border, +.bi-combo.disabled:hover > .bi-border { + border-color: #e8eaed; +} +.bi-theme-dark .bi-combo.disabled.bi-combo-hover > .bi-border, +.bi-theme-dark .bi-combo.disabled:hover > .bi-border { + border-color: #363e55; +} + +.bi-search-text-value-combo .trigger-icon-button { + font-size: 16px; +} +.bi-search-text-value-combo .search-text-value-trigger { + -webkit-border-radius: 2px; + -moz-border-radius: 2px; + border-radius: 2px; +} +.bi-search-text-value-combo.combo-error .bi-search-text-value-trigger .bi-text-button { + color: #e65251; +} +.bi-search-text-value-combo .bi-combo.bi-combo-popup + .bi-trigger-icon-button .x-icon { + -webkit-transform: rotate(180deg); + -moz-transform: rotate(180deg); + transform: rotate(180deg); + -webkit-transition: transform 0.3s ease; + -moz-transition: transform 0.3s ease; + -o-transition: transform 0.3s ease; + transition: transform 0.3s ease; +} +.bi-search-text-value-combo .bi-combo + .bi-trigger-icon-button .x-icon { + -webkit-transform: rotate(0deg); + -moz-transform: rotate(0deg); + transform: rotate(0deg); + -webkit-transition: transform 0.3s ease; + -moz-transition: transform 0.3s ease; + -o-transition: transform 0.3s ease; + transition: transform 0.3s ease; +} + +.bi-icon-text-value-combo.combo-error .bi-text-trigger .select-text-label { + color: #e65251; +} + +.bi-text-value-combo.combo-error .bi-select-text-trigger .select-text-label { + color: #e65251; +} + +.bi-text-value-check-combo.bi-combo-popup > .bi-border, +.bi-text-value-check-combo:hover > .bi-border { + border-color: #3685f2; +} + +.bi-text-value-down-list-combo.bi-combo-popup > .bi-border, +.bi-text-value-down-list-combo:hover > .bi-border { + border-color: #3685f2; +} +.bi-bubble-bar-popup-view .bar-popup-container { + max-height: 456px; +} + +/*************BI.SearchEditor******************/ +.bi-search-editor { + -webkit-border-radius: 2px; + -moz-border-radius: 2px; + border-radius: 2px; +} +.bi-search-editor .circle-close-font { + font-size: 18px; +} +.bi-search-editor .search-font { + font-size: 18px; +} + +/*************BI.SearchEditor******************/ +.bi-small-search-editor .bi-editor { + font-size: 12px; +} +.bi-small-search-editor .bi-editor .bi-input { + font-size: 12px; +} +.bi-small-search-editor .bi-editor .bi-label { + font-size: 12px; +} +.bi-small-search-editor .close-font { + font-size: 16px; +} +.bi-small-search-editor .search-font { + font-size: 16px; +} +.bi-message-title { + font-size: 14px; + cursor: pointer; +} +.bi-message-text { + font-size: 16px; + -webkit-user-select: text; + -khtml-user-select: text; + -moz-user-select: text; + -ms-user-select: text; + -o-user-select: text; + user-select: text; +} +.bi-message-content { + font-size: 16px; +} +.bi-message-close { + font-size: 16px; +} +.bi-message-animate { + -webkit-transition: opacity 0.3s, transform 0.3s, left 0.3s, right 0.3s, top 0.4s, bottom 0.3s; + -moz-transition: opacity 0.3s, transform 0.3s, left 0.3s, right 0.3s, top 0.4s, bottom 0.3s; + -o-transition: opacity 0.3s, transform 0.3s, left 0.3s, right 0.3s, top 0.4s, bottom 0.3s; + transition: opacity 0.3s, transform 0.3s, left 0.3s, right 0.3s, top 0.4s, bottom 0.3s; +} +.bi-message-enter { + opacity: 1; +} +.bi-message-leave { + opacity: 0; + transform: translateY(-100%); +} +.bi-multi-list-view .bi-button-mask { + opacity: 0.1; + filter: alpha(opacity=10); +} +.bi-panel { + -webkit-border-radius: 2px; + -moz-border-radius: 2px; + border-radius: 2px; +} +.bi-panel .panel-title .panel-title-text { + cursor: text; + font-size: 14px; +} +.bi-sortable-holder { + border: 1px dashed #e8eaed; +} +.bi-all-count-pager .all-pager-prev { + font-size: 16px; +} +.bi-all-count-pager .all-pager-next { + font-size: 16px; +} +.bi-all-count-pager .row-count { + color: #3685f2; +} + +.bi-direction-pager .direction-pager-prev { + font-size: 16px; +} +.bi-direction-pager .direction-pager-next { + font-size: 16px; +} + +.bi-pager .page-item { + -webkit-border-radius: 2px; + -moz-border-radius: 2px; + border-radius: 2px; +} +.bi-pane { + min-height: 25px; +} +.bi-pane.loading-status { + min-height: 55px; +} +.bi-pane .loading-container { + background-color: rgba(247, 248, 250, 0); + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#00f7f8fa,endColorstr=#00f7f8fa); +} +.bi-loading-widget { + font-size: 0; +} +.bi-loading-widget .animate-rect { + background-color: rgba(54, 133, 242, 0.9); + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#e63685f2,endColorstr=#e63685f2); + -webkit-border-radius: 1.5px; + -moz-border-radius: 1.5px; + border-radius: 1.5px; + -webkit-animation: loading-widget 0.8s infinite linear; + -moz-animation: loading-widget 0.8s infinite linear; + -ms-animation: loading-widget 0.8s infinite linear; + -o-animation: loading-widget 0.8s infinite linear; + animation: loading-widget 0.8s infinite linear; +} +.bi-loading-widget .rect2 { + -webkit-animation-delay: -0.2s; + -moz-animation-delay: -0.2s; + -ms-animation-delay: -0.2s; + -o-animation-delay: -0.2s; + animation-delay: -0.2s; +} +.bi-loading-widget .rect3 { + -webkit-animation-delay: -0.4s; + -moz-animation-delay: -0.4s; + -ms-animation-delay: -0.4s; + -o-animation-delay: -0.4s; + animation-delay: -0.4s; +} +@-webkit-keyframes loading-widget { + 0%, + 100% { + -webkit-transform: scaleY(0.3); + -moz-transform: scaleY(0.3); + -o-transform: scaleY(0.3); + -ms-transform: scaleY(0.3); + transform: scaleY(0.3); + } + 50% { + -webkit-transform: scaleY(1); + -moz-transform: scaleY(1); + -o-transform: scaleY(1); + -ms-transform: scaleY(1); + transform: scaleY(1); + } +} +@-moz-keyframes loading-widget { + 0%, + 100% { + -webkit-transform: scaleY(0.3); + -moz-transform: scaleY(0.3); + -o-transform: scaleY(0.3); + -ms-transform: scaleY(0.3); + transform: scaleY(0.3); + } + 50% { + -webkit-transform: scaleY(1); + -moz-transform: scaleY(1); + -o-transform: scaleY(1); + -ms-transform: scaleY(1); + transform: scaleY(1); + } +} +@-ms-keyframes loading-widget { + 0%, + 100% { + -webkit-transform: scaleY(0.3); + -moz-transform: scaleY(0.3); + -o-transform: scaleY(0.3); + -ms-transform: scaleY(0.3); + transform: scaleY(0.3); + } + 50% { + -webkit-transform: scaleY(1); + -moz-transform: scaleY(1); + -o-transform: scaleY(1); + -ms-transform: scaleY(1); + transform: scaleY(1); + } +} +@-o-keyframes loading-widget { + 0%, + 100% { + -webkit-transform: scaleY(0.3); + -moz-transform: scaleY(0.3); + -o-transform: scaleY(0.3); + -ms-transform: scaleY(0.3); + transform: scaleY(0.3); + } + 50% { + -webkit-transform: scaleY(1); + -moz-transform: scaleY(1); + -o-transform: scaleY(1); + -ms-transform: scaleY(1); + transform: scaleY(1); + } +} +@keyframes loading-widget { + 0%, + 100% { + -webkit-transform: scaleY(0.3); + -moz-transform: scaleY(0.3); + -o-transform: scaleY(0.3); + -ms-transform: scaleY(0.3); + transform: scaleY(0.3); + } + 50% { + -webkit-transform: scaleY(1); + -moz-transform: scaleY(1); + -o-transform: scaleY(1); + -ms-transform: scaleY(1); + transform: scaleY(1); + } +} +.bi-segment-button { + color: #3685f2; +} +.bi-segment > .center-element { + overflow: hidden; + overflow-x: hidden; + overflow-y: hidden; + background: #ffffff; + border-right: 1px solid #3685f2; + border-top: 1px solid #3685f2; + border-bottom: 1px solid #3685f2; +} +.bi-segment > .first-element { + border-left: 1px solid #3685f2; + -webkit-border-radius: 2px 0px 0px 2px; + -moz-border-radius: 2px 0px 0px 2px; + border-radius: 2px 0px 0px 2px; +} +.bi-segment > .last-element { + -webkit-border-radius: 0px 2px 2px 0px; + -moz-border-radius: 0px 2px 2px 0px; + border-radius: 0px 2px 2px 0px; +} +.bi-segment.disabled > .center-element, +.bi-segment.disabled > .first-element { + border-color: #d0d4da; +} +.bi-theme-dark .bi-segment > .center-element { + overflow: hidden; + overflow-x: hidden; + overflow-y: hidden; + background: #20263b; + border-right: 1px solid #363e55; + border-top: 1px solid #363e55; + border-bottom: 1px solid #363e55; +} +.bi-theme-dark .bi-segment > .first-element { + border-left: 1px solid #20263b; +} +.bi-half-button { + -webkit-border-radius: 2px; + -moz-border-radius: 2px; + border-radius: 2px; +} + +body .bi-button, +#body .bi-button { + -webkit-border-radius: 2px; + -moz-border-radius: 2px; + border-radius: 2px; + border: 1px solid #3685f2; + background-color: #3685f2; + -webkit-box-sizing: border-box; + /*Safari3.2+*/ + -moz-box-sizing: border-box; + /*Firefox3.5+*/ + -ms-box-sizing: border-box; + /*IE8*/ + box-sizing: border-box; + /*W3C标准(IE9+,Safari5.1+,Chrome10.0+,Opera10.6+都符合box-sizing的w3c标准语法)*/ + text-align: center; + vertical-align: middle; + cursor: pointer; +} +body .bi-button.hack, +#body .bi-button.hack { + -webkit-border-radius: 0px; + -moz-border-radius: 0px; + border-radius: 0px; +} +body .bi-button.block, +#body .bi-button.block { + font-size: inherit; + border-width: 0; + -webkit-border-radius: 0px; + -moz-border-radius: 0px; + border-radius: 0px; +} +body .bi-button.clear, +#body .bi-button.clear { + font-size: inherit; + border-width: 0; + background-color: transparent; +} +body .bi-button.clear:hover, +#body .bi-button.clear:hover { + opacity: 0.9; + filter: alpha(opacity=90); +} +body .bi-button.clear:active, +#body .bi-button.clear:active { + opacity: 0.8; + filter: alpha(opacity=80); +} +body .bi-button.clear:after, +#body .bi-button.clear:after { + display: none; +} +body .bi-button.ghost, +#body .bi-button.ghost { + font-size: inherit; + background-color: transparent; +} +body .bi-button.button-common, +#body .bi-button.button-common, +body .bi-button.button-common .b-font:before, +#body .bi-button.button-common .b-font:before { + color: #ffffff; +} +body .bi-button.button-common.clear, +#body .bi-button.button-common.clear, +body .bi-button.button-common.clear .b-font:before, +#body .bi-button.button-common.clear .b-font:before { + color: #3685f2; +} +body .bi-button.button-common.ghost, +#body .bi-button.button-common.ghost, +body .bi-button.button-common.ghost .b-font:before, +#body .bi-button.button-common.ghost .b-font:before { + color: #3685f2; +} +body .bi-button.button-common.ghost:hover, +#body .bi-button.button-common.ghost:hover { + color: #ffffff; + background-color: #3685f2; +} +body .bi-button.button-common.ghost:active, +#body .bi-button.button-common.ghost:active { + background-color: #3685f2; +} +body .bi-button.button-ignore, +#body .bi-button.button-ignore { + background-color: transparent; + border-color: #3685f2; +} +body .bi-button.button-ignore, +#body .bi-button.button-ignore, +body .bi-button.button-ignore .b-font:before, +#body .bi-button.button-ignore .b-font:before { + color: #3685f2; +} +body .bi-button.button-ignore.clear, +#body .bi-button.button-ignore.clear { + background-color: transparent; + border-width: 0; +} +body .bi-button.button-success, +#body .bi-button.button-success { + background-color: #13cd66; + border-color: #13cd66; +} +body .bi-button.button-success, +#body .bi-button.button-success, +body .bi-button.button-success .b-font:before, +#body .bi-button.button-success .b-font:before { + color: #ffffff; +} +body .bi-button.button-success.clear, +#body .bi-button.button-success.clear { + background-color: transparent; + border-width: 0; +} +body .bi-button.button-success.clear, +#body .bi-button.button-success.clear, +body .bi-button.button-success.clear .b-font:before, +#body .bi-button.button-success.clear .b-font:before { + color: #13cd66; +} +body .bi-button.button-warning, +#body .bi-button.button-warning { + background-color: #faaa39; + border-color: #fbb03b; +} +body .bi-button.button-warning, +#body .bi-button.button-warning, +body .bi-button.button-warning .b-font:before, +#body .bi-button.button-warning .b-font:before { + color: #ffffff; +} +body .bi-button.button-warning.clear, +#body .bi-button.button-warning.clear { + background-color: transparent; + border-width: 0; +} +body .bi-button.button-warning.clear, +#body .bi-button.button-warning.clear, +body .bi-button.button-warning.clear .b-font:before, +#body .bi-button.button-warning.clear .b-font:before { + color: #faaa39; +} +body .bi-button.button-error, +#body .bi-button.button-error { + background-color: #e65251; + border-color: #e65251; +} +body .bi-button.button-error, +#body .bi-button.button-error, +body .bi-button.button-error .b-font:before, +#body .bi-button.button-error .b-font:before { + color: #ffffff; +} +body .bi-button.button-error.clear, +#body .bi-button.button-error.clear { + background-color: transparent; + border-width: 0; +} +body .bi-button.button-error.clear, +#body .bi-button.button-error.clear, +body .bi-button.button-error.clear .b-font:before, +#body .bi-button.button-error.clear .b-font:before { + color: #e65251; +} +body .bi-button.button-common.disabled, +#body .bi-button.button-common.disabled, +body .bi-button.button-success.disabled, +#body .bi-button.button-success.disabled, +body .bi-button.button-error.disabled, +#body .bi-button.button-error.disabled, +body .bi-button.button-warning.disabled, +#body .bi-button.button-warning.disabled, +body .bi-button.button-common.disabled.base-disabled, +#body .bi-button.button-common.disabled.base-disabled, +body .bi-button.button-success.disabled.base-disabled, +#body .bi-button.button-success.disabled.base-disabled, +body .bi-button.button-error.disabled.base-disabled, +#body .bi-button.button-error.disabled.base-disabled, +body .bi-button.button-warning.disabled.base-disabled, +#body .bi-button.button-warning.disabled.base-disabled { + background-color: rgba(158, 166, 178, 0.2) !important; + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#339ea6b2,endColorstr=#339ea6b2); + border-color: #d0d4da !important; +} +body .bi-button.button-common.disabled, +#body .bi-button.button-common.disabled, +body .bi-button.button-success.disabled, +#body .bi-button.button-success.disabled, +body .bi-button.button-error.disabled, +#body .bi-button.button-error.disabled, +body .bi-button.button-warning.disabled, +#body .bi-button.button-warning.disabled, +body .bi-button.button-common.disabled.base-disabled, +#body .bi-button.button-common.disabled.base-disabled, +body .bi-button.button-success.disabled.base-disabled, +#body .bi-button.button-success.disabled.base-disabled, +body .bi-button.button-error.disabled.base-disabled, +#body .bi-button.button-error.disabled.base-disabled, +body .bi-button.button-warning.disabled.base-disabled, +#body .bi-button.button-warning.disabled.base-disabled, +body .bi-button.button-common.disabled .b-font:before, +#body .bi-button.button-common.disabled .b-font:before, +body .bi-button.button-success.disabled .b-font:before, +#body .bi-button.button-success.disabled .b-font:before, +body .bi-button.button-error.disabled .b-font:before, +#body .bi-button.button-error.disabled .b-font:before, +body .bi-button.button-warning.disabled .b-font:before, +#body .bi-button.button-warning.disabled .b-font:before, +body .bi-button.button-common.disabled.base-disabled .b-font:before, +#body .bi-button.button-common.disabled.base-disabled .b-font:before, +body .bi-button.button-success.disabled.base-disabled .b-font:before, +#body .bi-button.button-success.disabled.base-disabled .b-font:before, +body .bi-button.button-error.disabled.base-disabled .b-font:before, +#body .bi-button.button-error.disabled.base-disabled .b-font:before, +body .bi-button.button-warning.disabled.base-disabled .b-font:before, +#body .bi-button.button-warning.disabled.base-disabled .b-font:before { + color: #9ea6b2 !important; +} +body .bi-button.button-common.disabled:after, +#body .bi-button.button-common.disabled:after, +body .bi-button.button-success.disabled:after, +#body .bi-button.button-success.disabled:after, +body .bi-button.button-error.disabled:after, +#body .bi-button.button-error.disabled:after, +body .bi-button.button-warning.disabled:after, +#body .bi-button.button-warning.disabled:after { + display: none; +} +body .bi-button.button-ignore.disabled, +#body .bi-button.button-ignore.disabled { + background: #ffffff !important; + border-color: #e8eaed !important; +} +body .bi-button.button-ignore.disabled, +#body .bi-button.button-ignore.disabled, +body .bi-button.button-ignore.disabled .b-font:before, +#body .bi-button.button-ignore.disabled .b-font:before { + color: #9ea6b2 !important; +} +body .bi-button.button-ignore.disabled:after, +#body .bi-button.button-ignore.disabled:after { + display: none; +} +body .bi-button.button-common.disabled.clear, +#body .bi-button.button-common.disabled.clear, +body .bi-button.button-success.disabled.clear, +#body .bi-button.button-success.disabled.clear, +body .bi-button.button-warning.disabled.clear, +#body .bi-button.button-warning.disabled.clear, +body .bi-button.button-error.disabled.clear, +#body .bi-button.button-error.disabled.clear, +body .bi-button.button-ignore.disabled.clear, +#body .bi-button.button-ignore.disabled.clear { + background: transparent !important; + border-width: 0 !important; +} +body .bi-button.button-common.disabled.clear, +#body .bi-button.button-common.disabled.clear, +body .bi-button.button-success.disabled.clear, +#body .bi-button.button-success.disabled.clear, +body .bi-button.button-warning.disabled.clear, +#body .bi-button.button-warning.disabled.clear, +body .bi-button.button-error.disabled.clear, +#body .bi-button.button-error.disabled.clear, +body .bi-button.button-ignore.disabled.clear, +#body .bi-button.button-ignore.disabled.clear, +body .bi-button.button-common.disabled.clear .b-font:before, +#body .bi-button.button-common.disabled.clear .b-font:before, +body .bi-button.button-success.disabled.clear .b-font:before, +#body .bi-button.button-success.disabled.clear .b-font:before, +body .bi-button.button-warning.disabled.clear .b-font:before, +#body .bi-button.button-warning.disabled.clear .b-font:before, +body .bi-button.button-error.disabled.clear .b-font:before, +#body .bi-button.button-error.disabled.clear .b-font:before, +body .bi-button.button-ignore.disabled.clear .b-font:before, +#body .bi-button.button-ignore.disabled.clear .b-font:before { + color: #9ea6b2 !important; +} +body .bi-button.button-common.disabled.clear:hover, +#body .bi-button.button-common.disabled.clear:hover, +body .bi-button.button-success.disabled.clear:hover, +#body .bi-button.button-success.disabled.clear:hover, +body .bi-button.button-warning.disabled.clear:hover, +#body .bi-button.button-warning.disabled.clear:hover, +body .bi-button.button-error.disabled.clear:hover, +#body .bi-button.button-error.disabled.clear:hover, +body .bi-button.button-ignore.disabled.clear:hover, +#body .bi-button.button-ignore.disabled.clear:hover, +body .bi-button.button-common.disabled.clear:active, +#body .bi-button.button-common.disabled.clear:active, +body .bi-button.button-success.disabled.clear:active, +#body .bi-button.button-success.disabled.clear:active, +body .bi-button.button-warning.disabled.clear:active, +#body .bi-button.button-warning.disabled.clear:active, +body .bi-button.button-error.disabled.clear:active, +#body .bi-button.button-error.disabled.clear:active, +body .bi-button.button-ignore.disabled.clear:active, +#body .bi-button.button-ignore.disabled.clear:active { + opacity: 1; + filter: alpha(opacity=100); +} +body .bi-button.button-common.disabled.ghost, +#body .bi-button.button-common.disabled.ghost, +body .bi-button.button-success.disabled.ghost, +#body .bi-button.button-success.disabled.ghost, +body .bi-button.button-warning.disabled.ghost, +#body .bi-button.button-warning.disabled.ghost, +body .bi-button.button-error.disabled.ghost, +#body .bi-button.button-error.disabled.ghost, +body .bi-button.button-ignore.disabled.ghost, +#body .bi-button.button-ignore.disabled.ghost { + background: transparent !important; + border-color: #3685f2 !important; + opacity: 0.5; + filter: alpha(opacity=50); +} +body .bi-button.button-common.disabled.ghost, +#body .bi-button.button-common.disabled.ghost, +body .bi-button.button-success.disabled.ghost, +#body .bi-button.button-success.disabled.ghost, +body .bi-button.button-warning.disabled.ghost, +#body .bi-button.button-warning.disabled.ghost, +body .bi-button.button-error.disabled.ghost, +#body .bi-button.button-error.disabled.ghost, +body .bi-button.button-ignore.disabled.ghost, +#body .bi-button.button-ignore.disabled.ghost, +body .bi-button.button-common.disabled.ghost .b-font:before, +#body .bi-button.button-common.disabled.ghost .b-font:before, +body .bi-button.button-success.disabled.ghost .b-font:before, +#body .bi-button.button-success.disabled.ghost .b-font:before, +body .bi-button.button-warning.disabled.ghost .b-font:before, +#body .bi-button.button-warning.disabled.ghost .b-font:before, +body .bi-button.button-error.disabled.ghost .b-font:before, +#body .bi-button.button-error.disabled.ghost .b-font:before, +body .bi-button.button-ignore.disabled.ghost .b-font:before, +#body .bi-button.button-ignore.disabled.ghost .b-font:before { + color: #3685f2 !important; +} +.bi-basic-button.button-common:after, +.bi-basic-button.button-success:after, +.bi-basic-button.button-warning:after, +.bi-basic-button.button-error:after { + content: ""; + background-color: #232E40; + -webkit-border-radius: 10px; + -moz-border-radius: 10px; + border-radius: 10px; + display: block; + width: 100%; + height: 100%; + position: absolute; + transform: scale(1, 1); + opacity: 0; + filter: alpha(opacity=0); + -webkit-transition: transform 0.5s ease, opacity 1s ease; + -moz-transition: transform 0.5s ease, opacity 1s ease; + -o-transition: transform 0.5s ease, opacity 1s ease; + transition: transform 0.5s ease, opacity 1s ease; + left: 0; + top: 0; + pointer-events: none; +} +.bi-basic-button.button-common.hack:after, +.bi-basic-button.button-success.hack:after, +.bi-basic-button.button-warning.hack:after, +.bi-basic-button.button-error.hack:after { + content: none; +} +.bi-basic-button.button-common:active:after, +.bi-basic-button.button-success:active:after, +.bi-basic-button.button-warning:active:after, +.bi-basic-button.button-error:active:after { + transform: scale(0, 1); + opacity: 0.1; + filter: alpha(opacity=10); + -webkit-transition: transform 0s; + -moz-transition: transform 0s; + -o-transition: transform 0s; + transition: transform 0s; +} +.bi-basic-button.button-common:hover .bi-button-mask, +.bi-basic-button.button-success:hover .bi-button-mask, +.bi-basic-button.button-warning:hover .bi-button-mask, +.bi-basic-button.button-error:hover .bi-button-mask { + opacity: 0.1; + filter: alpha(opacity=10); + background-color: #ffffff; + -webkit-transition: opacity 0.3s ease; + -moz-transition: opacity 0.3s ease; + -o-transition: opacity 0.3s ease; + transition: opacity 0.3s ease; +} +.bi-basic-button.button-ignore:after { + content: ""; + background-color: #3685f2; + -webkit-border-radius: 10px; + -moz-border-radius: 10px; + border-radius: 10px; + display: block; + width: 100%; + height: 100%; + position: absolute; + transform: scale(1, 1); + opacity: 0; + filter: alpha(opacity=0); + -webkit-transition: transform 0.5s ease, opacity 1s ease; + -moz-transition: transform 0.5s ease, opacity 1s ease; + -o-transition: transform 0.5s ease, opacity 1s ease; + transition: transform 0.5s ease, opacity 1s ease; + left: 0; + top: 0; + pointer-events: none; +} +.bi-basic-button.button-ignore.hack:after { + content: none; +} +.bi-basic-button.button-ignore:active:after { + transform: scale(0, 1); + opacity: 0.1; + filter: alpha(opacity=10); + -webkit-transition: transform 0s; + -moz-transition: transform 0s; + -o-transition: transform 0s; + transition: transform 0s; +} +.bi-basic-button.button-ignore:hover { + background-color: rgba(54, 133, 242, 0.05); + -webkit-transition: opacity 0.3s ease; + -moz-transition: opacity 0.3s ease; + -o-transition: opacity 0.3s ease; + transition: opacity 0.3s ease; +} +.bi-basic-button .popup-content { + font-size: 14px; +} +.bi-theme-dark body .bi-button.button-common.ghost, +.bi-theme-dark #body .bi-button.button-common.ghost, +.bi-theme-dark body .bi-button.button-common.ghost .b-font:before, +.bi-theme-dark #body .bi-button.button-common.ghost .b-font:before { + color: #ffffff; + border-color: #ffffff; +} +.bi-theme-dark body .bi-button.button-common.ghost:hover, +.bi-theme-dark #body .bi-button.button-common.ghost:hover { + color: #3d4d66; + background-color: #ffffff; +} +.bi-theme-dark body .bi-button.button-common.ghost:active, +.bi-theme-dark #body .bi-button.button-common.ghost:active { + background-color: rgba(255, 255, 255, 0.9); + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#e6ffffff,endColorstr=#e6ffffff); +} +.bi-theme-dark body .bi-button.button-ignore:hover, +.bi-theme-dark #body .bi-button.button-ignore:hover { + background-color: rgba(54, 133, 242, 0.05); +} +.bi-theme-dark body .bi-button.button-ignore:active, +.bi-theme-dark #body .bi-button.button-ignore:active { + background-color: rgba(54, 133, 242, 0.1); +} +.bi-theme-dark body .bi-button.button-common.disabled.ghost, +.bi-theme-dark #body .bi-button.button-common.disabled.ghost { + background: transparent !important; + border-color: #ffffff !important; + opacity: 0.5; + filter: alpha(opacity=50); +} +.bi-theme-dark body .bi-button.button-common.disabled.ghost, +.bi-theme-dark #body .bi-button.button-common.disabled.ghost, +.bi-theme-dark body .bi-button.button-common.disabled.ghost .b-font:before, +.bi-theme-dark #body .bi-button.button-common.disabled.ghost .b-font:before { + color: #ffffff !important; +} +.bi-theme-dark body .bi-button.button-success.disabled, +.bi-theme-dark #body .bi-button.button-success.disabled, +.bi-theme-dark body .bi-button.button-error.disabled, +.bi-theme-dark #body .bi-button.button-error.disabled, +.bi-theme-dark body .bi-button.button-warning.disabled, +.bi-theme-dark #body .bi-button.button-warning.disabled, +.bi-theme-dark body .bi-button.button-ignore.disabled, +.bi-theme-dark #body .bi-button.button-ignore.disabled, +.bi-theme-dark body .bi-button.button-success.disabled.base-disabled, +.bi-theme-dark #body .bi-button.button-success.disabled.base-disabled, +.bi-theme-dark body .bi-button.button-error.disabled.base-disabled, +.bi-theme-dark #body .bi-button.button-error.disabled.base-disabled, +.bi-theme-dark body .bi-button.button-warning.disabled.base-disabled, +.bi-theme-dark #body .bi-button.button-warning.disabled.base-disabled, +.bi-theme-dark body .bi-button.button-ignore.disabled.base-disabled, +.bi-theme-dark #body .bi-button.button-ignore.disabled.base-disabled { + background-color: rgba(135, 141, 159, 0.2) !important; + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#33878d9f,endColorstr=#33878d9f); +} +.bi-single-select-icon-text-item:active .b-font:before, +.bi-single-select-icon-text-item.active .b-font:before { + color: #3685f2; +} +.bi-switch { + -webkit-border-radius: 40px 40px 40px 40px; + -moz-border-radius: 40px 40px 40px 40px; + border-radius: 40px 40px 40px 40px; + background-color: #d0d4da; +} +.bi-switch:active, +.bi-switch.active { + background-color: #3685f2; +} +.bi-switch .circle-button { + -webkit-border-radius: 9px 9px 9px 9px; + -moz-border-radius: 9px 9px 9px 9px; + border-radius: 9px 9px 9px 9px; +} +.bi-switch.disabled { + background-color: #f2f4f7; +} +.bi-switch.disabled:active { + background-color: #f2f4f7; +} +.bi-theme-dark .bi-switch { + background-color: #606479; +} +.bi-theme-dark .bi-switch:active, +.bi-theme-dark .bi-switch.active { + background-color: #3685f2; +} +.bi-theme-dark .bi-switch.disabled { + background-color: #292f45; +} +.bi-theme-dark .bi-switch.disabled:active { + background-color: #292f45; +} +.bi-multifile-editor .multifile-editor { + text-align: right; + cursor: pointer; + font-size: 100px; + z-index: 2; + margin-left: -5px; +} + +.bi-textarea-editor { + overflow: hidden; + overflow-x: hidden; + overflow-y: hidden; +} +.bi-textarea-editor .textarea-editor-content { + white-space: pre-wrap; + font-size: 12px; + line-height: 21px; + border: none; +} +.bi-html article, +.bi-html aside, +.bi-html details, +.bi-html figcaption, +.bi-html figure, +.bi-html footer, +.bi-html header, +.bi-html hgroup, +.bi-html nav, +.bi-html section, +.bi-html summary { + display: block; +} +.bi-html audio, +.bi-html canvas, +.bi-html video { + display: inline-block; + *display: inline; + *zoom: 1; +} +.bi-html audio:not([controls]) { + display: none; + height: 0; +} +.bi-html [hidden] { + display: none; +} +.bi-html html { + font-size: 100%; + -webkit-text-size-adjust: 100%; + -ms-text-size-adjust: 100%; +} +.bi-html html, +.bi-html button, +.bi-html input, +.bi-html select, +.bi-html textarea { + font-family: sans-serif; +} +.bi-html body { + margin: 0; +} +.bi-html a:focus { + outline: thin dotted; +} +.bi-html a:active, +.bi-html a:hover { + outline: 0; +} +.bi-html h1 { + font-size: 2em; + margin: 0.67em 0; +} +.bi-html h2 { + font-size: 1.5em; + margin: 0.83em 0; +} +.bi-html h3 { + font-size: 1.17em; + margin: 1em 0; +} +.bi-html h4 { + font-size: 1em; + margin: 1.33em 0; +} +.bi-html h5 { + font-size: .83em; + margin: 1.67em 0; +} +.bi-html h6 { + font-size: .75em; + margin: 2.33em 0; +} +.bi-html abbr[title] { + border-bottom: 1px dotted; +} +.bi-html b, +.bi-html strong { + font-weight: bold; +} +.bi-html blockquote { + margin: 1em 40px; +} +.bi-html dfn { + font-style: italic; +} +.bi-html mark { + background: #ff0; + color: #000; +} +.bi-html p, +.bi-html pre { + margin: 1em 0; +} +.bi-html code, +.bi-html kbd, +.bi-html pre, +.bi-html samp { + font-family: monospace, serif; + _font-family: 'courier new', monospace; + font-size: 1em; +} +.bi-html pre { + white-space: pre; + white-space: pre-wrap; + word-wrap: break-word; +} +.bi-html q { + quotes: none; +} +.bi-html q:before, +.bi-html q:after { + content: ''; + content: none; +} +.bi-html small { + font-size: 75%; +} +.bi-html sub, +.bi-html sup { + font-size: 75%; + line-height: 0; + position: relative; + vertical-align: baseline; +} +.bi-html sup { + top: -0.5em; +} +.bi-html sub { + bottom: -0.25em; +} +.bi-html dl, +.bi-html menu, +.bi-html ol, +.bi-html ul { + margin: 1em 0; +} +.bi-html dd { + margin: 0 0 0 40px; +} +.bi-html menu, +.bi-html ol, +.bi-html ul { + padding: 0 0 0 40px; +} +.bi-html nav ul, +.bi-html nav ol { + list-style: none; + list-style-image: none; +} +.bi-html ul { + list-style: disc; +} +.bi-html li { + list-style-type: disc; +} +.bi-html img { + border: 0; + -ms-interpolation-mode: bicubic; +} +.bi-html svg:not(:root) { + overflow: hidden; +} +.bi-html figure { + margin: 0; +} +.bi-html form { + margin: 0; +} +.bi-html fieldset { + border: 1px solid #c0c0c0; + margin: 0 2px; + padding: 0.35em 0.625em 0.75em; +} +.bi-html legend { + border: 0; + padding: 0; + white-space: normal; + *margin-left: -7px; +} +.bi-html button, +.bi-html input, +.bi-html select, +.bi-html textarea { + font-size: 100%; + margin: 0; + vertical-align: baseline; + *vertical-align: middle; +} +.bi-html button, +.bi-html input { + line-height: normal; +} +.bi-html button, +.bi-html html input[type="button"], +.bi-html input[type="reset"], +.bi-html input[type="submit"] { + -webkit-appearance: button; + cursor: pointer; + *overflow: visible; +} +.bi-html button[disabled], +.bi-html input[disabled] { + cursor: default; +} +.bi-html input[type="checkbox"], +.bi-html input[type="radio"] { + box-sizing: border-box; + padding: 0; + *height: 13px; + *width: 13px; +} +.bi-html input[type="search"] { + -webkit-appearance: textfield; + -moz-box-sizing: content-box; + -webkit-box-sizing: content-box; + box-sizing: content-box; +} +.bi-html input[type="search"]::-webkit-search-cancel-button, +.bi-html input[type="search"]::-webkit-search-decoration { + -webkit-appearance: none; +} +.bi-html button::-moz-focus-inner, +.bi-html input::-moz-focus-inner { + border: 0; + padding: 0; +} +.bi-html textarea { + overflow: auto; + vertical-align: top; +} +.bi-html table { + border-collapse: collapse; + border-spacing: 0; +} +.x-icon.b-font { + margin: auto; + width: 100%; +} +.bi-checkbox .checkbox-content { + -webkit-border-radius: 2px; + -moz-border-radius: 2px; + border-radius: 2px; + border: 1px solid #9EA6B2; +} +.bi-checkbox .checkbox-content:after { + position: absolute; + display: table; + top: 50%; + left: 20%; + border: 2px solid transparent; + border-top: 0; + border-left: 0; + width: 4px; + height: 8px; + -webkit-transform: rotate(45deg) scale(1) translate(-50%, -50%); + -moz-transform: rotate(45deg) scale(1) translate(-50%, -50%); + -o-transform: rotate(45deg) scale(1) translate(-50%, -50%); + -ms-transform: rotate(45deg) scale(1) translate(-50%, -50%); + transform: rotate(45deg) scale(1) translate(-50%, -50%); + content: ''; +} +.bi-checkbox .checkbox-content.hover, +.bi-checkbox .checkbox-content:hover { + border-color: #3685f2; +} +.bi-checkbox.active .checkbox-content, +.bi-checkbox:active .checkbox-content { + border-color: #3685f2; +} +.bi-checkbox.active .checkbox-content:after, +.bi-checkbox:active .checkbox-content:after { + border-color: #ffffff; + opacity: 1; +} +.bi-checkbox.disabled .checkbox-content { + background-color: #f2f4f7; + border-color: #d0d4da; +} +.bi-checkbox.disabled .checkbox-content:after { + opacity: 0; +} +.bi-checkbox.disabled.active .checkbox-content { + background-color: #d0d4da; +} +.bi-checkbox.disabled.active .checkbox-content:after { + opacity: 1; +} +.bi-theme-dark .bi-checkbox .checkbox-content { + border-color: #878D9F; +} +.bi-theme-dark .bi-checkbox .checkbox-content.hover, +.bi-theme-dark .bi-checkbox .checkbox-content:hover { + border-color: #3685f2; +} +.bi-theme-dark .bi-checkbox.active .checkbox-content, +.bi-theme-dark .bi-checkbox:active .checkbox-content { + border-color: #3685f2; +} +.bi-theme-dark .bi-checkbox.disabled .checkbox-content { + background-color: #292f45; +} +.bi-theme-dark .bi-checkbox.disabled.active .checkbox-content { + background-color: #606479; + border-color: #606479; +} +.bi-file { + opacity: 0; + filter: alpha(opacity=0); + z-index: 2; +} +.bi-input, +.bi-textarea { + border: none; + outline: none; + background-color: transparent; + padding: 0; + margin: 0; + width: 100%; + height: 100%; +} +.bi-input.bi-input-focus, +.bi-textarea.bi-input-focus { + border: none; +} +.bi-input.bi-input-error, +.bi-textarea.bi-input-error { + border: none; + color: #e65251 !important; +} +.bi-radio .radio-content { + -webkit-border-radius: 8px; + -moz-border-radius: 8px; + border-radius: 8px; + border: 1px solid #9EA6B2; +} +.bi-radio .radio-content:after { + content: ""; +} +.bi-radio .radio-content.hover, +.bi-radio .radio-content:hover { + border-color: #3685f2; +} +.bi-radio:active .radio-content, +.bi-radio.active .radio-content { + border-color: #3685f2; +} +.bi-radio:active .radio-content:after, +.bi-radio.active .radio-content:after { + width: 6px; + height: 6px; + display: table; + position: absolute; + top: 50%; + left: 50%; + -webkit-border-radius: 3px; + -moz-border-radius: 3px; + border-radius: 3px; + background-color: #ffffff; + -webkit-transform: translate(-50%, -50%); + -moz-transform: translate(-50%, -50%); + -o-transform: translate(-50%, -50%); + -ms-transform: translate(-50%, -50%); + transform: translate(-50%, -50%); +} +.bi-radio.disabled .radio-content { + background-color: #f2f4f7; + border-color: #d0d4da; +} +.bi-radio.disabled .radio-content:after { + background-color: transparent; +} +.bi-radio.disabled.active .radio-content { + background-color: #d0d4da; +} +.bi-radio.disabled.active .radio-content:after { + background-color: #ffffff; +} +.bi-theme-dark .bi-radio .radio-content { + border-color: #878D9F; +} +.bi-theme-dark .bi-radio .radio-content.hover, +.bi-theme-dark .bi-radio .radio-content:hover { + border-color: #3685f2; +} +.bi-theme-dark .bi-radio.active .radio-content, +.bi-theme-dark .bi-radio:active .radio-content { + border-color: #3685f2; +} +.bi-theme-dark .bi-radio.disabled .radio-content { + background-color: #292f45; +} +.bi-theme-dark .bi-radio.disabled .radio-content.hover, +.bi-theme-dark .bi-radio.disabled .radio-content:hover { + border-color: #878D9F; +} +.bi-theme-dark .bi-radio.disabled.active .radio-content { + background-color: #606479; + border-color: #606479; +} +.bi-label { + overflow: hidden; + overflow-x: hidden; + overflow-y: hidden; + word-break: break-all; +} +.bi-text { + overflow: hidden; + overflow-x: hidden; + overflow-y: hidden; + -webkit-box-sizing: border-box; + /*Safari3.2+*/ + -moz-box-sizing: border-box; + /*Firefox3.5+*/ + -ms-box-sizing: border-box; + /*IE8*/ + box-sizing: border-box; + /*W3C标准(IE9+,Safari5.1+,Chrome10.0+,Opera10.6+都符合box-sizing的w3c标准语法)*/ + word-break: break-word; +} +.bi-bubble .bubble-text { + -webkit-border-radius: 2px; + -moz-border-radius: 2px; + border-radius: 2px; +} +.bi-bubble .bubble-error { + background: #ffecec; + color: #e65251; +} +.bi-theme-dark .bi-bubble .bubble-error { + background: #3A2940; +} +.bi-bubble .bubble-common { + background: #eaf2fd; + color: #3685f2; +} +.bi-bubble .bubble-success { + background: #e1f4e7; + color: #13cd66; +} +.bi-bubble .bubble-warning { + background: #feeed7; + color: #faaa39; +} + +.bi-tip { + position: fixed !important; +} + +.bi-toast { + color: #ffffff; + max-width: 400px; + min-width: 150px; + -webkit-border-radius: 2px; + -moz-border-radius: 2px; + border-radius: 2px; +} +.bi-toast.toast-success { + background: #13cd66; +} +.bi-toast.toast-warning { + background: #faaa39; +} +.bi-toast.toast-error { + background: #e65251; +} +.bi-toast.toast-normal { + background: #3685f2; +} +.bi-toast .toast-icon { + font-size: 16px; +} + +.bi-tooltip { + max-width: 250px; + -webkit-border-radius: 2px; + -moz-border-radius: 2px; + border-radius: 2px; + font-size: 12px; + color: #ffffff; +} +.bi-tooltip.tooltip-success { + background: #647185; + border: 1px solid #647185; +} +.bi-tooltip.tooltip-warning { + background: #e65251; + border: 1px solid #e65251; +} +.bi-branch-tree .bi-branch-tree-view { + min-width: 300px; +} + +.bi-display-tree .ztree * { + color: #999999; +} +.bi-display-tree .ztree li a, +.bi-display-tree .ztree li span { + cursor: default !important; +} +.bi-display-tree .ztree li a:hover { + text-decoration: none; +} +.bi-display-tree .ztree li a.curSelectedNode { + padding-top: 1px; + border: none; + background-color: inherit; + opacity: 1; + filter: alpha(opacity=100); +} + +.bi-list-display-tree .ztree li a, +.bi-list-display-tree .ztree li span { + cursor: default !important; +} +.bi-list-display-tree .ztree li a:hover { + text-decoration: none; +} +.bi-list-display-tree .ztree li a.curSelectedNode { + padding-top: 1px; + border: none; + background-color: inherit; + opacity: 1; + filter: alpha(opacity=100); +} +.ztree * { + padding: 0; + margin: 0; +} +.ztree { + margin: 0; + padding: 5px; +} +.ztree li { + padding: 0; + margin: 0; + list-style: none; + line-height: 14px; + text-align: left; + white-space: nowrap; + outline: 0; +} +.ztree li ul { + margin: 0; + padding: 0 0 0 18px; +} +.ztree li a { + padding: 1px 3px 0 0; + margin: 0; + cursor: pointer; + height: 24px; + background-color: transparent; + text-decoration: none; + vertical-align: top; + display: inline-block; +} +.ztree li a:hover { + background-color: rgba(54, 133, 242, 0.06); + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#0f3685f2,endColorstr=#0f3685f2); +} +.ztree li a:active { + color: #3685f2; + background-color: rgba(54, 133, 242, 0.06); + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#0f3685f2,endColorstr=#0f3685f2); +} +.ztree li a.curSelectedNode_Edit { + padding-top: 0px; + background-color: #FFE6B0; + color: black; + height: 16px; + border: 1px #FFB951 solid; + opacity: 0.8; +} +.ztree li a.tmpTargetNode_inner { + padding-top: 0px; + background-color: #316AC5; + color: white; + height: 16px; + border: 1px #316AC5 solid; + opacity: 0.8; + filter: alpha(opacity=80); +} +.ztree li a input.rename { + height: 14px; + width: 80px; + padding: 0; + margin: 0; + font-size: 12px; + border: 1px #7EC4CC solid; + *border: 0px; +} +.ztree li span { + line-height: 24px; + margin-right: 2px; +} +.ztree li span.bi-keyword-red-mark { + margin-right: 0px; +} +.ztree li span.button { + line-height: 0; + margin: 0; + width: 16px; + height: 16px; + display: inline-block; + vertical-align: middle; + border: 0 none; + cursor: pointer; + outline: none; + background-color: transparent; + background-repeat: no-repeat; + background-attachment: scroll; +} +.ztree li span.button.chk { + width: 16px; + height: 16px; + margin: 0 3px 0 0; + cursor: auto; +} +.ztree li span.button.chk.checkbox_false_disable { + background-position: 0 -56px; +} +.ztree li span.button.chk.checkbox_true_disable { + background-position: -14px -56px; +} +.ztree li span.button.chk.radio_false_full { + background-position: -28px 0; +} +.ztree li span.button.chk.radio_false_full_focus { + background-position: -28px -14px; +} +.ztree li span.button.chk.radio_false_part { + background-position: -28px -28px; +} +.ztree li span.button.chk.radio_false_part_focus { + background-position: -28px -42px; +} +.ztree li span.button.chk.radio_false_disable { + background-position: -28px -56px; +} +.ztree li span.button.chk.radio_true_full { + background-position: -42px 0; +} +.ztree li span.button.chk.radio_true_full_focus { + background-position: -42px -14px; +} +.ztree li span.button.chk.radio_true_part { + background-position: -42px -28px; +} +.ztree li span.button.chk.radio_true_part_focus { + background-position: -42px -42px; +} +.ztree li span.button.chk.checkbox_true_full + a { + color: #3685f2; +} +.ztree li span.button.chk.checkbox_true_full_focus + a { + color: #3685f2; +} +.ztree li span.button.chk.checkbox_true_part + a { + color: #3685f2; +} +.ztree li span.button.chk.checkbox_true_part_focus + a { + color: #3685f2; +} +.ztree li span.button.chk.radio_true_disable { + background-position: -42px -56px; +} +.ztree li span.button.switch { + width: 25px; + height: 25px; +} +.ztree li span.button.noline_open { + background-position: -92px -72px; +} +.ztree li span.button.noline_close { + background-position: -74px -72px; +} +.ztree li span.button.root_docu { + background: none; +} +.ztree li span.button.noline_docu { + background: none; +} +.ztree li span.button.ico_open { + margin-right: 2px; + background-position: -110px -16px; + vertical-align: top; + *vertical-align: middle; +} +.ztree li span.button.ico_close { + margin-right: 2px; + background-position: -110px 0; + vertical-align: top; + *vertical-align: middle; +} +.ztree li span.button.ico_docu { + margin-right: 2px; + background-position: -110px -32px; + vertical-align: top; + *vertical-align: middle; +} +.ztree li span.button.edit { + margin-right: 2px; + background-position: -110px -48px; + vertical-align: top; + *vertical-align: middle; +} +.ztree li span.button.remove { + margin-right: 2px; + background-position: -110px -64px; + vertical-align: top; + *vertical-align: middle; +} +.ztree li span.button.ico_loading { + width: 0px; + margin-right: 2px; + vertical-align: top; + *vertical-align: middle; +} +ul.tmpTargetzTree { + background-color: #FFE6B0; + opacity: 0.8; + filter: alpha(opacity=80); +} +span.tmpzTreeMove_arrow { + width: 16px; + height: 16px; + display: inline-block; + padding: 0; + margin: 2px 0 0 1px; + border: 0 none; + position: absolute; + background-color: transparent; + background-repeat: no-repeat; + background-attachment: scroll; + background-position: -110px -80px; +} +ul.ztree.zTreeDragUL { + margin: 0; + padding: 0; + position: absolute; + width: auto; + height: auto; + overflow: hidden; + background-color: #cfcfcf; + border: 1px #00B83F dotted; + opacity: 0.8; + filter: alpha(opacity=80); +} +.zTreeMask { + z-index: 10000; + background-color: #cfcfcf; + opacity: 0.0; + filter: alpha(opacity=0); + position: absolute; +} +/* level style*/ +/*.ztree li span.button.level0 { + display:none; +} +.ztree li ul.level0 { + padding:0; + background:none; +}*/ + + +.bi-trigger .bi-trigger-icon-button { + font-size: 16px; +} + +.bi-select-text-trigger { + -webkit-border-radius: 2px; + -moz-border-radius: 2px; + border-radius: 2px; +} + +.bi-small-select-text-trigger { + -webkit-border-radius: 2px; + -moz-border-radius: 2px; + border-radius: 2px; +} +.bi-popover { + border: 1px solid transparent; +} +/**********BI.BIListView*************/ +.bi-popup-view { + position: fixed !important; + overflow-y: visible !important; + overflow-x: visible !important; + overflow: visible !important; + cursor: default; +} +.bi-popup-view .list-view-outer { + -webkit-border-radius: 2px; + -moz-border-radius: 2px; + border-radius: 2px; +} +.bi-popup-view .padding-outer { + padding-top: 5px; + padding-bottom: 5px; +} +.bi-popup-view .list-view-shadow { + -webkit-box-shadow: 0 1px 5px 0 rgba(35, 46, 64, 0.2); + -moz-box-shadow: 0 1px 5px 0 rgba(35, 46, 64, 0.2); + box-shadow: 0 1px 5px 0 rgba(35, 46, 64, 0.2); +} +.bi-popup-view .list-view-toolbar { + line-height: 24px; +} +.bi-popup-view .list-view-toolbar > .center-element { + border-left: 1px solid #e8eaed; +} +.bi-popup-view .list-view-toolbar > .first-element { + border-left: none; +} +.bi-theme-dark .bi-popup-view .list-view-toolbar > .center-element { + border-left: 1px solid #363e55; +} +.bi-theme-dark .bi-popup-view .list-view-toolbar > .first-element { + border-left: none; +} +.bi-theme-dark .list-view-shadow { + -webkit-box-shadow: 0 1px 5px 0 rgba(25, 27, 43, 0.8); + -moz-box-shadow: 0 1px 5px 0 rgba(25, 27, 43, 0.8); + box-shadow: 0 1px 5px 0 rgba(25, 27, 43, 0.8); +} +.bi-date-trigger { + -webkit-border-radius: 2px; + -moz-border-radius: 2px; + border-radius: 2px; +} +.bi-down-list-popup .list-group-item-text { + max-width: 203px; +} +.bi-down-list-popup .bi-down-list-item .list-item-text { + max-width: 203px; +} +.bi-dynamic-date-combo .date-font { + font-size: 16px; +} +.bi-interactive-arrangement .interactive-arrangement-dragtag-line { + z-index: 1000000000; + background-color: #faaa39; +} +.bi-interactive-arrangement .interactive-arrangement-dragtag-icon { + z-index: 1000000000; +} +.bi-interval-slider-label { + min-height: 50px; +} + +.bi-interval-slider { + min-height: 50px; +} +.bi-month-trigger { + -webkit-border-radius: 2px; + -moz-border-radius: 2px; + border-radius: 2px; +} +.bi-multilayer-select-tree-combo .trigger-icon-button { + font-size: 16px; +} +.bi-multilayer-select-tree-combo .bi-combo.bi-combo-popup + .bi-trigger-icon-button .x-icon { + -webkit-transform: rotate(180deg); + -moz-transform: rotate(180deg); + transform: rotate(180deg); + -webkit-transition: transform 0.3s ease; + -moz-transition: transform 0.3s ease; + -o-transition: transform 0.3s ease; + transition: transform 0.3s ease; +} +.bi-multilayer-select-tree-combo .bi-combo + .bi-trigger-icon-button .x-icon { + -webkit-transform: rotate(0deg); + -moz-transform: rotate(0deg); + transform: rotate(0deg); + -webkit-transition: transform 0.3s ease; + -moz-transition: transform 0.3s ease; + -o-transition: transform 0.3s ease; + transition: transform 0.3s ease; +} + +.bi-multilayer-select-level-tree .tree-view { + min-width: 100%; +} +.bi-multilayer-single-tree-combo .trigger-icon-button { + font-size: 16px; +} +.bi-multilayer-single-tree-combo .bi-combo.bi-combo-popup + .bi-trigger-icon-button .x-icon { + -webkit-transform: rotate(180deg); + -moz-transform: rotate(180deg); + transform: rotate(180deg); + -webkit-transition: transform 0.3s ease; + -moz-transition: transform 0.3s ease; + -o-transition: transform 0.3s ease; + transition: transform 0.3s ease; +} +.bi-multilayer-single-tree-combo .bi-combo + .bi-trigger-icon-button .x-icon { + -webkit-transform: rotate(0deg); + -moz-transform: rotate(0deg); + transform: rotate(0deg); + -webkit-transition: transform 0.3s ease; + -moz-transition: transform 0.3s ease; + -o-transition: transform 0.3s ease; + transition: transform 0.3s ease; +} + +.bi-multilayer-single-level-tree .tree-view { + min-width: 100%; +} +.bi-multi-select-check-pane .multi-select-check-selected { + text-decoration: underline; +} + +.bi-multi-select-combo .multi-select-trigger-icon-button { + font-size: 16px; +} +.bi-multi-select-combo .bi-combo.bi-combo-popup + .bi-trigger-icon-button .x-icon { + -webkit-transform: rotate(180deg); + -moz-transform: rotate(180deg); + transform: rotate(180deg); + -webkit-transition: transform 0.3s ease; + -moz-transition: transform 0.3s ease; + -o-transition: transform 0.3s ease; + transition: transform 0.3s ease; +} +.bi-multi-select-combo .bi-combo + .bi-trigger-icon-button .x-icon { + -webkit-transform: rotate(0deg); + -moz-transform: rotate(0deg); + transform: rotate(0deg); + -webkit-transition: transform 0.3s ease; + -moz-transition: transform 0.3s ease; + -o-transition: transform 0.3s ease; + transition: transform 0.3s ease; +} + +.bi-multi-select-insert-combo .multi-select-trigger-icon-button { + font-size: 16px; +} +.bi-multi-select-insert-combo .bi-combo.bi-combo-popup + .bi-trigger-icon-button .x-icon { + -webkit-transform: rotate(180deg); + -moz-transform: rotate(180deg); + transform: rotate(180deg); + -webkit-transition: transform 0.3s ease; + -moz-transition: transform 0.3s ease; + -o-transition: transform 0.3s ease; + transition: transform 0.3s ease; +} +.bi-multi-select-insert-combo .bi-combo + .bi-trigger-icon-button .x-icon { + -webkit-transform: rotate(0deg); + -moz-transform: rotate(0deg); + transform: rotate(0deg); + -webkit-transition: transform 0.3s ease; + -moz-transition: transform 0.3s ease; + -o-transition: transform 0.3s ease; + transition: transform 0.3s ease; +} + + +.bi-multi-select-search-pane .multi-select-toolbar { + color: #faaa39; +} +.bi-multi-select-check-selected-button { + z-index: 1; + min-width: 16px; + -webkit-border-radius: 8px; + -moz-border-radius: 8px; + border-radius: 8px; +} +.bi-multi-select-insert-list .bi-search-editor { + -moz-border-radius-bottomleft: 0px; + -webkit-border-bottom-left-radius: 0px; + -moz-border-radius-bottomright: 0px; + -webkit-border-bottom-right-radius: 0px; + border-bottom-right-radius: 0px; + border-bottom-left-radius: 0px; +} + +.bi-multi-select-list .bi-search-editor { + -moz-border-radius-bottomleft: 0px; + -webkit-border-bottom-left-radius: 0px; + -moz-border-radius-bottomright: 0px; + -webkit-border-bottom-right-radius: 0px; + border-bottom-right-radius: 0px; + border-bottom-left-radius: 0px; +} +.bi-multi-tree-check-pane .multi-tree-check-selected { + color: #3685f2; +} +.bi-multi-tree-combo .multi-select-trigger-icon-button { + font-size: 16px; +} +.bi-multi-tree-combo .bi-combo.bi-combo-popup + .bi-trigger-icon-button .x-icon { + -webkit-transform: rotate(180deg); + -moz-transform: rotate(180deg); + transform: rotate(180deg); + -webkit-transition: transform 0.3s ease; + -moz-transition: transform 0.3s ease; + -o-transition: transform 0.3s ease; + transition: transform 0.3s ease; +} +.bi-multi-tree-combo .bi-combo + .bi-trigger-icon-button .x-icon { + -webkit-transform: rotate(0deg); + -moz-transform: rotate(0deg); + transform: rotate(0deg); + -webkit-transition: transform 0.3s ease; + -moz-transition: transform 0.3s ease; + -o-transition: transform 0.3s ease; + transition: transform 0.3s ease; +} +.bi-multi-tree-popup .popup-view-tree { + min-height: 170px; +} +.bi-multi-tree-check-selected-button .trigger-check-selected { + color: #3685f2; + z-index: 1; +} +.bi-number-editor { + -webkit-border-radius: 2px; + -moz-border-radius: 2px; + border-radius: 2px; +} +.bi-number-editor .pull-down-font { + font-size: 12px; +} +.bi-number-editor .pull-up-font { + font-size: 12px; +} +.bi-number-interval.hack { + -webkit-border-radius: 0px; + -moz-border-radius: 0px; + border-radius: 0px; +} +.bi-number-interval .number-interval-small-editor { + -moz-border-radius-topleft: 2px; + -webkit-border-top-left-radius: 2px; + -moz-border-radius-bottomleft: 2px; + -webkit-border-bottom-left-radius: 2px; + border-top-left-radius: 2px; + border-bottom-left-radius: 2px; +} +.bi-number-interval .number-interval-big-editor { + -moz-border-radius-topright: 2px; + -webkit-border-top-right-radius: 2px; + -moz-border-radius-bottomright: 2px; + -webkit-border-bottom-right-radius: 2px; + border-top-right-radius: 2px; + border-bottom-right-radius: 2px; +} +.bi-number-interval .number-interval-big-combo { + -moz-border-radius-topleft: 2px; + -webkit-border-top-left-radius: 2px; + -moz-border-radius-bottomleft: 2px; + -webkit-border-bottom-left-radius: 2px; + border-top-left-radius: 2px; + border-bottom-left-radius: 2px; +} +.bi-number-interval .number-interval-big-combo .bi-icon-combo-trigger .icon-combo-trigger-icon { + font-size: 14px; +} +.bi-number-interval .number-interval-small-combo { + -moz-border-radius-topright: 2px; + -webkit-border-top-right-radius: 2px; + -moz-border-radius-bottomright: 2px; + -webkit-border-bottom-right-radius: 2px; + border-top-right-radius: 2px; + border-bottom-right-radius: 2px; +} +.bi-number-interval .number-interval-small-combo .bi-icon-combo-trigger .icon-combo-trigger-icon { + font-size: 14px; +} +.bi-number-interval.number-error .bi-input { + color: #e65251 !important; +} +.bi-quarter-trigger { + -webkit-border-radius: 2px; + -moz-border-radius: 2px; + border-radius: 2px; +} +.bi-search-multi-text-value-combo .multi-select-trigger-icon-button { + font-size: 16px; +} +.bi-search-multi-text-value-combo.combo-error .bi-multi-select-searcher .tip-text-style { + color: #e65251; +} +.bi-single-select-combo .single-select-trigger-icon-button { + font-size: 16px; +} +.bi-single-select-combo .bi-combo.bi-combo-popup + .bi-trigger-icon-button .x-icon { + -webkit-transform: rotate(180deg); + -moz-transform: rotate(180deg); + transform: rotate(180deg); + -webkit-transition: transform 0.3s ease; + -moz-transition: transform 0.3s ease; + -o-transition: transform 0.3s ease; + transition: transform 0.3s ease; +} +.bi-single-select-combo .bi-combo + .bi-trigger-icon-button .x-icon { + -webkit-transform: rotate(0deg); + -moz-transform: rotate(0deg); + transform: rotate(0deg); + -webkit-transition: transform 0.3s ease; + -moz-transition: transform 0.3s ease; + -o-transition: transform 0.3s ease; + transition: transform 0.3s ease; +} +.bi-single-slider-label { + min-height: 50px; +} + +.bi-single-slider-normal { + min-height: 30px; +} +.bi-single-slider { + min-height: 50px; +} +.bi-single-slider-button .slider-button { + cursor: ew-resize; + border-width: 2px; + border-style: solid; + -webkit-border-radius: 8px; + -moz-border-radius: 8px; + border-radius: 8px; + background-color: #ffffff; + height: 12px; + width: 12px; + top: 6px; + left: -8px; +} +.bi-single-slider-button .slider-button:hover, +.bi-single-slider-button .slider-button.hover { + -webkit-border-radius: 10px; + -moz-border-radius: 10px; + border-radius: 10px; + background-color: #f7f8fa; + width: 16px; + height: 16px; + top: 4px; + left: -10px; +} +.bi-single-slider-button .slider-button.disabled { + border-color: #d0d4da; +} +.bi-single-slider-button .slider-button.disabled:hover, +.bi-single-slider-button .slider-button.disabled.hover { + background-color: #f7f8fa; + width: 12px; + height: 12px; + top: 6px; + left: -8px; +} +.bi-theme-dark .bi-single-slider-button .slider-button { + background-color: #20263b; +} +.bi-theme-dark .bi-single-slider-button .slider-button:hover, +.bi-theme-dark .bi-single-slider-button .slider-button.hover { + background-color: #191b2b; +} +.bi-theme-dark .bi-single-slider-button .slider-button.disabled:hover, +.bi-theme-dark .bi-single-slider-button .slider-button.disabled.hover { + background-color: #191b2b; +} +.bi-slider-track .gray-track { + background-color: rgba(61, 77, 102, 0.1); + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#1a3d4d66,endColorstr=#1a3d4d66); + -webkit-border-radius: 3px; + -moz-border-radius: 3px; + border-radius: 3px; +} +.bi-slider-track .blue-track { + -webkit-border-radius: 3px; + -moz-border-radius: 3px; + border-radius: 3px; +} +.bi-slider-track .disabled-blue-track { + background-color: #d0d4da; + -webkit-border-radius: 3px; + -moz-border-radius: 3px; + border-radius: 3px; +} +.bi-theme-dark .bi-slider-track .gray-track { + background-color: rgba(214, 224, 220, 0.1); + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#1ad6e0dc,endColorstr=#1ad6e0dc); + -webkit-border-radius: 3px; + -moz-border-radius: 3px; + border-radius: 3px; +} +.bi-theme-dark .bi-slider-track .disabled-blue-track { + background-color: #606479; + -webkit-border-radius: 3px; + -moz-border-radius: 3px; + border-radius: 3px; +} +.bi-time-trigger .show-text { + background-color: rgba(255, 255, 255, 0); + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#00ffffff,endColorstr=#00ffffff); +} +.bi-date-interval.time-error .bi-input { + color: #e65251; +} +.bi-date-interval.time-error .sign-editor-text { + color: #e65251; +} +.bi-time-interval .bi-date-time-trigger { + -webkit-border-radius: 2px; + -moz-border-radius: 2px; + border-radius: 2px; +} +.bi-time-interval.time-error .bi-date-time-trigger .bi-input { + color: #e65251; +} +.bi-time-interval.time-error .bi-date-time-trigger .sign-editor-text { + color: #e65251; +} +.bi-year-popup .year-popup-navigation { + line-height: 30px; +} +.bi-year-popup .year-popup-navigation > .center-element { + border-left: 1px solid #e8eaed; +} +.bi-year-popup .year-popup-navigation > .first-element { + border-left: none; +} +.bi-theme-dark .bi-year-popup .year-popup-navigation > .center-element { + border-left: 1px solid #363e55; +} +.bi-theme-dark .bi-year-popup .year-popup-navigation > .first-element { + border-left: none; +} +.bi-year-trigger { + -webkit-border-radius: 2px; + -moz-border-radius: 2px; + border-radius: 2px; +} +.bi-year-month-interval.time-error .bi-input { + color: #e65251; +} +.bi-year-month-interval.time-error .sign-editor-text { + color: #e65251; +} +html { + height: 100%; + overflow: hidden; +} +body { + position: absolute; + width: 100%; + height: 100%; + margin: 0; + padding: 0; + top: 0; + left: 0; + background-repeat: repeat; + -webkit-user-select: none; + -khtml-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + -o-user-select: none; + user-select: none; + color: #3d4d66; + font: normal 12px "Helvetica Neue", Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "微软雅黑", Heiti, "黑体", sans-serif; + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; + text-decoration: none; + -kthml-user-focus: normal; + -moz-user-focus: normal; + -moz-outline: 0 none; + outline: 0 none; +} +div::-webkit-scrollbar, +textarea::-webkit-scrollbar { + -webkit-appearance: none; + width: 10px; + height: 10px; +} +div::-webkit-scrollbar-track, +textarea::-webkit-scrollbar-track { + -webkit-border-radius: 5px; + -moz-border-radius: 5px; + border-radius: 5px; + background-color: rgba(35, 46, 64, 0.05); + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#0d232e40,endColorstr=#0d232e40); +} +div::-webkit-scrollbar-track:hover, +textarea::-webkit-scrollbar-track:hover { + background-color: rgba(35, 46, 64, 0.05); + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#0d232e40,endColorstr=#0d232e40); +} +div::-webkit-scrollbar-thumb, +textarea::-webkit-scrollbar-thumb { + border: 2px solid transparent; + background-clip: padding-box; + -webkit-border-radius: 10px; + -moz-border-radius: 10px; + border-radius: 10px; + background-color: rgba(35, 46, 64, 0.1); + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#1a232e40,endColorstr=#1a232e40); +} +div::-webkit-scrollbar-thumb:hover, +textarea::-webkit-scrollbar-thumb:hover { + background-color: rgba(35, 46, 64, 0.3); + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#4d232e40,endColorstr=#4d232e40); +} +div::-webkit-scrollbar-corner, +textarea::-webkit-scrollbar-corner { + background-color: transparent; +} +.bi-theme-dark div::-webkit-scrollbar, +.bi-theme-dark textarea::-webkit-scrollbar { + -webkit-appearance: none; +} +.bi-theme-dark div::-webkit-scrollbar-track, +.bi-theme-dark textarea::-webkit-scrollbar-track { + background-color: rgba(255, 255, 255, 0.05); + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#0dffffff,endColorstr=#0dffffff); +} +.bi-theme-dark div::-webkit-scrollbar-track:hover, +.bi-theme-dark textarea::-webkit-scrollbar-track:hover { + background-color: rgba(255, 255, 255, 0.05); + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#0dffffff,endColorstr=#0dffffff); +} +.bi-theme-dark div::-webkit-scrollbar-thumb, +.bi-theme-dark textarea::-webkit-scrollbar-thumb { + background-color: rgba(255, 255, 255, 0.1); + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#1affffff,endColorstr=#1affffff); +} +.bi-theme-dark div::-webkit-scrollbar-thumb:hover, +.bi-theme-dark textarea::-webkit-scrollbar-thumb:hover { + background-color: rgba(255, 255, 255, 0.3); + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#4dffffff,endColorstr=#4dffffff); +} +.bi-farbtastic .wheel { + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/1x/background/wheel.png') no-repeat center center; +} +.bi-farbtastic .overlay { + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/1x/background/mask.png') no-repeat center center; +} +.bi-farbtastic .marker { + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/1x/background/marker.png') no-repeat center center; +} +.bi-display-tree .ztree li span.button.switch.center_open { + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/2x/icon/tree_vertical_line_3.png') no-repeat center center; + background-size: contain; +} +.bi-display-tree .ztree li span.button.switch.roots_open { + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/2x/icon/tree_vertical_line_2.png') no-repeat center center; + background-size: contain; +} +.bi-display-tree .ztree li span.button.switch.bottom_open { + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/2x/icon/tree_vertical_line_4.png') no-repeat center center; + background-size: contain; +} +.bi-display-tree .ztree.hack li span.button.switch.center_open { + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/1x/icon/tree_vertical_line_3.png') no-repeat center center; +} +.bi-display-tree .ztree.hack li span.button.switch.roots_open { + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/1x/icon/tree_vertical_line_2.png') no-repeat center center; +} +.bi-display-tree .ztree.hack li span.button.switch.bottom_open { + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/1x/icon/tree_vertical_line_4.png') no-repeat center center; +} +.ztree li ul.line { + position: relative; +} +.ztree li ul.line:before { + position: absolute; + content: ''; + border-left: 1px dashed #D0D4DA; + height: calc(100% - 3px); + left: 12px; + margin-top: 1px; +} +.ztree.hack li ul.line { + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/1x/icon/tree_vertical_line_1.png') repeat-y 1px 0; +} +.bi-theme-dark .ztree li ul.line:before { + border-left: 1px dashed #606479; +} +.bi-theme-dark .ztree.hack li ul.line { + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/1x/icon/dark/tree_vertical_line_1.png') repeat-y 1px 0; +} +.ztree li span.button.chk.checkbox_false_full { + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/2x/icon/check_box_normal.png') no-repeat center center; + background-size: contain; +} +.ztree li span.button.chk.checkbox_false_full_focus { + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/2x/icon/check_box_normal.png') no-repeat center center; + background-size: contain; +} +.ztree li span.button.chk.checkbox_false_part { + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/2x/icon/check_box_normal.png') no-repeat center center; + background-size: contain; +} +.ztree li span.button.chk.checkbox_false_part_focus { + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/2x/icon/half_selected.png') no-repeat center center; + background-size: contain; +} +.ztree li span.button.chk.checkbox_true_full { + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/2x/icon/check_box_active.png') no-repeat center center; + background-size: contain; +} +.ztree li span.button.chk.checkbox_true_full_focus { + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/2x/icon/check_box_active.png') no-repeat center center; + background-size: contain; +} +.ztree li span.button.chk.checkbox_true_part { + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/2x/icon/half_selected.png') no-repeat center center; + background-size: contain; +} +.ztree li span.button.chk.checkbox_true_part_focus { + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/2x/icon/half_selected.png') no-repeat center center; + background-size: contain; +} +.ztree.hack li span.button.chk.checkbox_false_full { + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/1x/icon/check_box_normal.png') no-repeat center center; +} +.ztree.hack li span.button.chk.checkbox_false_full_focus { + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/1x/icon/check_box_normal.png') no-repeat center center; +} +.ztree.hack li span.button.chk.checkbox_false_part { + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/1x/icon/check_box_normal.png') no-repeat center center; +} +.ztree.hack li span.button.chk.checkbox_false_part_focus { + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/1x/icon/half_selected.png') no-repeat center center; +} +.ztree.hack li span.button.chk.checkbox_true_full { + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/1x/icon/check_box_active.png') no-repeat center center; +} +.ztree.hack li span.button.chk.checkbox_true_full_focus { + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/1x/icon/check_box_active.png') no-repeat center center; +} +.ztree.hack li span.button.chk.checkbox_true_part { + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/1x/icon/half_selected.png') no-repeat center center; +} +.ztree.hack li span.button.chk.checkbox_true_part_focus { + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/1x/icon/half_selected.png') no-repeat center center; +} +.ztree li span.button.root_open { + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/2x/icon/tree_expand_1.png') no-repeat center center; + background-size: contain; +} +.ztree.hack li span.button.root_open { + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/1x/icon/tree_expand_1.png') no-repeat center center; +} +.bi-theme-dark .ztree li span.button.root_open { + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/2x/icon/dark/tree_expand_1.png') no-repeat center center; + background-size: contain; +} +.bi-theme-dark .ztree.hack li span.button.root_open { + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/1x/icon/dark/tree_expand_1.png') no-repeat center center; +} +.ztree li span.button.root_close { + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/2x/icon/tree_collapse_1.png') no-repeat center center; + background-size: contain; +} +.ztree.hack li span.button.root_close { + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/1x/icon/tree_collapse_1.png') no-repeat center center; +} +.bi-theme-dark .ztree li span.button.root_close { + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/2x/icon/dark/tree_collapse_1.png') no-repeat center center; + background-size: contain; +} +.bi-theme-dark .ztree.hack li span.button.root_close { + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/1x/icon/dark/tree_collapse_1.png') no-repeat center center; +} +.ztree li span.button.roots_open { + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/2x/icon/tree_expand_2.png') no-repeat center center; + background-size: contain; +} +.ztree.hack li span.button.roots_open { + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/1x/icon/tree_expand_2.png') no-repeat center center; +} +.bi-theme-dark .ztree li span.button.roots_open { + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/2x/icon/dark/tree_expand_2.png') no-repeat center center; + background-size: contain; +} +.bi-theme-dark .ztree.hack li span.button.roots_open { + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/1x/icon/dark/tree_expand_2.png') no-repeat center center; +} +.ztree li span.button.roots_close { + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/2x/icon/tree_collapse_2.png') no-repeat center center; + background-size: contain; +} +.ztree.hack li span.button.roots_close { + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/1x/icon/tree_collapse_2.png') no-repeat center center; +} +.bi-theme-dark .ztree li span.button.roots_close { + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/2x/icon/dark/tree_collapse_2.png') no-repeat center center; + background-size: contain; +} +.bi-theme-dark .ztree.hack li span.button.roots_close { + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/1x/icon/dark/tree_collapse_2.png') no-repeat center center; +} +.ztree li span.button.center_open { + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/2x/icon/tree_expand_3.png') no-repeat center center; + background-size: contain; +} +.ztree.hack li span.button.center_open { + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/1x/icon/tree_expand_3.png') no-repeat center center; +} +.bi-theme-dark .ztree li span.button.center_open { + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/2x/icon/dark/tree_expand_3.png') no-repeat center center; + background-size: contain; +} +.bi-theme-dark .ztree.hack li span.button.center_open { + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/1x/icon/dark/tree_expand_3.png') no-repeat center center; +} +.ztree li span.button.center_close { + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/2x/icon/tree_collapse_3.png') no-repeat center center; + background-size: contain; +} +.ztree.hack li span.button.center_close { + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/1x/icon/tree_collapse_3.png') no-repeat center center; +} +.bi-theme-dark .ztree li span.button.center_close { + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/2x/icon/dark/tree_collapse_3.png') no-repeat center center; + background-size: contain; +} +.bi-theme-dark .ztree.hack li span.button.center_close { + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/1x/icon/dark/tree_collapse_3.png') no-repeat center center; +} +.ztree li span.button.bottom_open { + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/2x/icon/tree_expand_4.png') no-repeat center center; + background-size: contain; +} +.ztree.hack li span.button.bottom_open { + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/1x/icon/tree_expand_4.png') no-repeat center center; +} +.bi-theme-dark .ztree li span.button.bottom_open { + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/2x/icon/dark/tree_expand_4.png') no-repeat center center; + background-size: contain; +} +.bi-theme-dark .ztree.hack li span.button.bottom_open { + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/1x/icon/dark/tree_expand_4.png') no-repeat center center; +} +.ztree li span.button.bottom_close { + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/2x/icon/tree_collapse_4.png') no-repeat center center; + background-size: contain; +} +.ztree.hack li span.button.bottom_close { + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/1x/icon/tree_collapse_4.png') no-repeat center center; +} +.bi-theme-dark .ztree li span.button.bottom_close { + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/2x/icon/dark/tree_collapse_4.png') no-repeat center center; + background-size: contain; +} +.bi-theme-dark .ztree.hack li span.button.bottom_close { + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/1x/icon/dark/tree_collapse_4.png') no-repeat center center; +} +.ztree li span.button.roots_docu { + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/2x/icon/tree_vertical_line_2.png') no-repeat center center; + background-size: contain; +} +.ztree.hack li span.button.roots_docu { + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/1x/icon/tree_vertical_line_2.png') no-repeat center center; +} +.bi-theme-dark .ztree li span.button.roots_docu { + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/2x/icon/dark/tree_vertical_line_2.png') no-repeat center center; + background-size: contain; +} +.bi-theme-dark .ztree.hack li span.button.roots_docu { + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/1x/icon/dark/tree_vertical_line_2.png') no-repeat center center; +} +.ztree li span.button.center_docu { + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/2x/icon/tree_vertical_line_3.png') no-repeat center center; + background-size: contain; +} +.ztree.hack li span.button.center_docu { + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/1x/icon/tree_vertical_line_3.png') no-repeat center center; +} +.bi-theme-dark .ztree li span.button.center_docu { + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/2x/icon/dark/tree_vertical_line_3.png') no-repeat center center; + background-size: contain; +} +.bi-theme-dark .ztree.hack li span.button.center_docu { + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/1x/icon/dark/tree_vertical_line_3.png') no-repeat center center; +} +.ztree li span.button.bottom_docu { + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/2x/icon/tree_vertical_line_4.png') no-repeat center center; + background-size: contain; +} +.ztree.hack li span.button.bottom_docu { + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/1x/icon/tree_vertical_line_4.png') no-repeat center center; +} +.bi-theme-dark .ztree li span.button.bottom_docu { + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/2x/icon/dark/tree_vertical_line_4.png') no-repeat center center; + background-size: contain; +} +.bi-theme-dark .ztree.hack li span.button.bottom_docu { + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/1x/icon/dark/tree_vertical_line_4.png') no-repeat center center; +} +.ztree li span.button.ico_loading { + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/2x/icon/loading.gif') no-repeat center center; + background-size: contain; +} +.ztree.hack li span.button.ico_loading { + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/1x/icon/loading.gif') no-repeat center center; +} +.base-line-conn-background { + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/1x/icon/tree_vertical_line_1.png') repeat-y 0 0; +} +.bi-theme-dark .base-line-conn-background { + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/1x/icon/dark/tree_vertical_line_1.png') repeat-y 0 0; +} +.first-line-conn-background { + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/1x/icon/tree_vertical_line_2.png') no-repeat center center; +} +.bi-theme-dark .first-line-conn-background { + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/1x/icon/dark/tree_vertical_line_2.png') no-repeat center center; +} +.mid-line-conn-background { + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/1x/icon/tree_vertical_line_3.png') no-repeat center center; +} +.bi-theme-dark .mid-line-conn-background { + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/1x/icon/dark/tree_vertical_line_3.png') no-repeat center center; +} +.last-line-conn-background { + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/1x/icon/tree_vertical_line_4.png') no-repeat center center; +} +.bi-theme-dark .last-line-conn-background { + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/1x/icon/dark/tree_vertical_line_4.png') no-repeat center center; +} +.loading-background { + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/2x/icon/loading.gif') no-repeat center center; + background-size: contain; +} +.auto-color-background { + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/2x/background/auto_color.png') no-repeat center center; + background-size: contain; +} +.auto-color-normal-background { + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/2x/background/auto_color_normal.png') no-repeat center center; + background-size: contain; +} +.auto-color-normal-disabled-background { + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/2x/background/auto_color_normal_disable.png') no-repeat center center; + background-size: contain; +} +.trans-color-background { + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/2x/background/trans_normal.png') no-repeat center center; + background-size: contain; +} +.trans-color-disabled-background { + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/2x/background/trans_disable.png') no-repeat center center; + background-size: contain; +} +.auto-color-background.hack { + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/1x/background/auto_color.png') no-repeat center center; +} +.auto-color-normal-background.hack { + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/1x/background/auto_color_normal.png') no-repeat center center; +} +.auto-color-normal-disabled-background.hack { + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/1x/background/auto_color_normal_disable.png') no-repeat center center; +} +.trans-color-background.hack { + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/1x/background/trans_normal.png') no-repeat center center; +} +.trans-color-disabled-background.hack { + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/1x/background/trans_disable.png') no-repeat center center; +} +.wave-loading { + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/2x/icon/wave_loading.gif') no-repeat center center; + background-size: contain; +} +.wave-loading.hack { + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/1x/icon/wave_loading.gif') no-repeat center center; +} +@font-face { + font-family: "fineui"; + src: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/font/iconfont.eot'); + src: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/font/iconfont.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */ url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/font/iconfont.woff') format('woff'), /* chrome、firefox */ url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/font/iconfont.ttf') format('truetype'), /* chrome、firefox、opera、Safari, Android, iOS 4.2+*/ url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/font/iconfont.svg#svgFontName') format('svg'); + /* iOS 4.1- */ +} +.b-font { + font-family: 'fineui'; + font-style: normal; + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; +} +.close-font .b-font { + *zoom: expression( this.runtimeStyle['zoom'] = '1',this.innerHTML = ''); +} +.close-font .b-font:before { + content: "\e6d0"; + color: inherit; +} +.close-font.disabled .b-font:before { + content: "\e6d0"; + color: inherit; +} +.close-h-font .b-font { + *zoom: expression( this.runtimeStyle['zoom'] = '1',this.innerHTML = ''); +} +.close-h-font .b-font:before { + content: "\e6d0"; + color: inherit; +} +.close-h-font:hover .b-font:before, +.close-h-font.hover .b-font:before { + content: "\e6d0"; + color: inherit; +} +.close-h-font.disabled .b-font:before { + content: "\e6d0"; + color: inherit; +} +.close-ha-font .b-font { + *zoom: expression( this.runtimeStyle['zoom'] = '1',this.innerHTML = ''); +} +.close-ha-font .b-font:before { + content: "\e6d0"; + color: inherit; +} +.close-ha-font:hover .b-font:before, +.close-ha-font.hover .b-font:before { + content: "\e6d0"; + color: inherit; +} +.close-ha-font:active .b-font:before, +.close-ha-font.active .b-font:before { + content: "\e6d0"; + color: #3f8ce8; +} +.close-ha-font.disabled .b-font:before { + content: "\e6d0"; + color: inherit; +} +.circle-close-font .b-font { + *zoom: expression( this.runtimeStyle['zoom'] = '1',this.innerHTML = ''); +} +.circle-close-font .b-font:before { + content: "\e6d5"; + color: inherit; +} +.circle-close-font.disabled .b-font:before { + content: "\e6d5"; + color: inherit; +} +.search-close-h-font .b-font { + *zoom: expression( this.runtimeStyle['zoom'] = '1',this.innerHTML = ''); +} +.search-close-h-font .b-font:before { + content: "\e6d0"; + color: inherit; +} +.search-close-h-font:hover .b-font:before, +.search-close-h-font.hover .b-font:before { + content: "\e6d0"; + color: #e65251; +} +.search-close-h-font.disabled .b-font:before { + content: "\e6d0"; + color: inherit; +} +.pre-page-h-font .b-font { + *zoom: expression( this.runtimeStyle['zoom'] = '1',this.innerHTML = ''); +} +.pre-page-h-font .b-font:before { + content: "\e70d"; + color: inherit; +} +.pre-page-h-font:hover .b-font:before, +.pre-page-h-font.hover .b-font:before { + content: "\e70d"; + color: inherit; +} +.pre-page-h-font.disabled .b-font:before { + content: "\e70d"; + color: inherit; +} +.next-page-h-font .b-font { + *zoom: expression( this.runtimeStyle['zoom'] = '1',this.innerHTML = ''); +} +.next-page-h-font .b-font:before { + content: "\e70c"; + color: inherit; +} +.next-page-h-font:hover .b-font:before, +.next-page-h-font.hover .b-font:before { + content: "\e70c"; + color: inherit; +} +.next-page-h-font.disabled .b-font:before { + content: "\e70c"; + color: inherit; +} +.search-font .b-font { + *zoom: expression( this.runtimeStyle['zoom'] = '1',this.innerHTML = ''); +} +.search-font .b-font:before { + content: "\e6dc"; + color: inherit; +} +.search-font.disabled .b-font:before { + content: "\e6dc"; + color: inherit; +} +.date-font .b-font { + *zoom: expression( this.runtimeStyle['zoom'] = '1',this.innerHTML = ''); +} +.date-font .b-font:before { + content: "\e733"; + color: inherit; +} +.date-font.disabled .b-font:before { + content: "\e733"; + color: inherit; +} +.time-font .b-font { + *zoom: expression( this.runtimeStyle['zoom'] = '1',this.innerHTML = ''); +} +.time-font .b-font:before { + content: "\e6b1"; + color: inherit; +} +.time-font.disabled .b-font:before { + content: "\e6b1"; + color: inherit; +} +.date-change-h-font .b-font { + *zoom: expression( this.runtimeStyle['zoom'] = '1',this.innerHTML = ''); +} +.date-change-h-font .b-font:before { + content: "\e72f"; + color: inherit; +} +.date-change-h-font:hover .b-font:before, +.date-change-h-font.hover .b-font:before { + content: "\e72f"; + color: inherit; +} +.date-change-h-font.disabled .b-font:before { + content: "\e72f"; + color: inherit; +} +.dot-font .b-font { + *zoom: expression( this.runtimeStyle['zoom'] = '1',this.innerHTML = ''); +} +.dot-font .b-font:before { + content: "\e762"; + color: #232e40; +} +.dot-font.disabled .b-font:before { + content: "\e762"; + color: #232e40; +} +.dot-h-font .b-font { + *zoom: expression( this.runtimeStyle['zoom'] = '1',this.innerHTML = ''); +} +.dot-h-font .b-font:before { + content: "\e762"; + color: #232e40; +} +.dot-h-font:hover .b-font:before, +.dot-h-font.hover .b-font:before { + content: "\e762"; + color: inherit; +} +.dot-h-font.disabled .b-font:before { + content: "\e762"; + color: #232e40; +} +.dot-ha-font .b-font { + *zoom: expression( this.runtimeStyle['zoom'] = '1',this.innerHTML = ''); +} +.dot-ha-font .b-font:before { + content: "\e762"; + color: #ffffff; +} +.dot-ha-font:hover .b-font:before, +.dot-ha-font.hover .b-font:before { + content: "\e762"; + color: #999999; +} +.dot-ha-font:active .b-font:before, +.dot-ha-font.active .b-font:before { + content: "\e762"; + color: #232e40; +} +.dot-ha-font.disabled .b-font:before { + content: "\e762"; + color: #ffffff; +} +.dot-e-font .b-font { + *zoom: expression( this.runtimeStyle['zoom'] = '1',this.innerHTML = ''); +} +.dot-e-font .b-font:before { + content: "\e762"; + color: transparent; +} +.dot-e-font:hover .b-font:before, +.dot-e-font.hover .b-font:before { + content: "\e762"; + color: transparent; +} +.dot-e-font:active .b-font:before { + content: "\e762"; + color: transparent; +} +.dot-e-font.active .b-font:before { + content: "\e762"; + color: #3685f2; +} +.dot-e-font.disabled .b-font:before { + content: "\e762"; + color: transparent; +} +.pull-right-font .b-font { + *zoom: expression( this.runtimeStyle['zoom'] = '1',this.innerHTML = ''); +} +.pull-right-font .b-font:before { + content: "\e70c"; + color: inherit; +} +.pull-right-font.disabled .b-font:before { + content: "\e70c"; + color: inherit; +} +.pull-right-h-font .b-font { + *zoom: expression( this.runtimeStyle['zoom'] = '1',this.innerHTML = ''); +} +.pull-right-h-font .b-font:before { + content: "\e70c"; + color: inherit; +} +.pull-right-h-font:hover .b-font:before, +.pull-right-h-font.hover .b-font:before { + content: "\e70c"; + color: inherit; +} +.pull-right-h-font.disabled .b-font:before { + content: "\e70c"; + color: inherit; +} +.pull-right-ha-font .b-font { + *zoom: expression( this.runtimeStyle['zoom'] = '1',this.innerHTML = ''); +} +.pull-right-ha-font .b-font:before { + content: "\e70c"; + color: inherit; +} +.pull-right-ha-font:hover .b-font:before, +.pull-right-ha-font.hover .b-font:before { + content: "\e70c"; + color: inherit; +} +.pull-right-ha-font:active .b-font:before, +.pull-right-ha-font.active .b-font:before { + content: "\e70c"; + color: #3f8ce8; +} +.pull-right-ha-font.disabled .b-font:before { + content: "\e70c"; + color: inherit; +} +.pull-right-e-font .b-font { + *zoom: expression( this.runtimeStyle['zoom'] = '1',this.innerHTML = ''); +} +.pull-right-e-font .b-font:before { + content: "\e70c"; + color: inherit; +} +.pull-right-e-font:hover .b-font:before, +.pull-right-e-font.hover .b-font:before { + content: "\e70c"; + color: inherit; +} +.pull-right-e-font:active .b-font:before { + content: "\e70c"; + color: #3f8ce8; +} +.pull-right-e-font.active .b-font:before { + content: "\e70c"; + color: #3f8ce8; +} +.pull-right-e-font.disabled .b-font:before { + content: "\e70c"; + color: inherit; +} +.copy-font .b-font { + *zoom: expression( this.runtimeStyle['zoom'] = '1',this.innerHTML = ''); +} +.copy-font .b-font:before { + content: "\e6bd"; + color: inherit; +} +.copy-font.disabled .b-font:before { + content: "\e6bd"; + color: inherit; +} +.copy-h-font .b-font { + *zoom: expression( this.runtimeStyle['zoom'] = '1',this.innerHTML = ''); +} +.copy-h-font .b-font:before { + content: "\e6bd"; + color: #232e40; +} +.copy-h-font:hover .b-font:before, +.copy-h-font.hover .b-font:before { + content: "\e6bd"; + color: inherit; +} +.copy-h-font.disabled .b-font:before { + content: "\e6bd"; + color: #232e40; +} +.copy-ha-font .b-font { + *zoom: expression( this.runtimeStyle['zoom'] = '1',this.innerHTML = ''); +} +.copy-ha-font .b-font:before { + content: "\e6bd"; + color: inherit; +} +.copy-ha-font:hover .b-font:before, +.copy-ha-font.hover .b-font:before { + content: "\e6bd"; + color: inherit; +} +.copy-ha-font:active .b-font:before, +.copy-ha-font.active .b-font:before { + content: "\e6bd"; + color: #3f8ce8; +} +.copy-ha-font.disabled .b-font:before { + content: "\e6bd"; + color: inherit; +} +.copy-e-font .b-font { + *zoom: expression( this.runtimeStyle['zoom'] = '1',this.innerHTML = ''); +} +.copy-e-font .b-font:before { + content: "\e6bd"; + color: inherit; +} +.copy-e-font:hover .b-font:before, +.copy-e-font.hover .b-font:before { + content: "\e6bd"; + color: inherit; +} +.copy-e-font:active .b-font:before { + content: "\e6bd"; + color: #3f8ce8; +} +.copy-e-font.active .b-font:before { + content: "\e6bd"; + color: #3f8ce8; +} +.copy-e-font.disabled .b-font:before { + content: "\e6bd"; + color: inherit; +} +.check-mark-font .b-font { + *zoom: expression( this.runtimeStyle['zoom'] = '1',this.innerHTML = ''); +} +.check-mark-font .b-font:before { + content: "\e6cf"; + color: inherit; +} +.check-mark-font.disabled .b-font:before { + content: "\e6cf"; + color: inherit; +} +.check-mark-h-font .b-font { + *zoom: expression( this.runtimeStyle['zoom'] = '1',this.innerHTML = ''); +} +.check-mark-h-font .b-font:before { + content: "\e6cf"; + color: inherit; +} +.check-mark-h-font:hover .b-font:before, +.check-mark-h-font.hover .b-font:before { + content: "\e6cf"; + color: inherit; +} +.check-mark-h-font.disabled .b-font:before { + content: "\e6cf"; + color: inherit; +} +.check-mark-ha-font .b-font { + *zoom: expression( this.runtimeStyle['zoom'] = '1',this.innerHTML = ''); +} +.check-mark-ha-font .b-font:before { + content: "\e6cf"; + color: inherit; +} +.check-mark-ha-font:hover .b-font:before, +.check-mark-ha-font.hover .b-font:before { + content: "\e6cf"; + color: inherit; +} +.check-mark-ha-font:active .b-font:before, +.check-mark-ha-font.active .b-font:before { + content: "\e6cf"; + color: #3f8ce8; +} +.check-mark-ha-font.disabled .b-font:before { + content: "\e6cf"; + color: inherit; +} +.check-mark-e-font .b-font { + *zoom: expression( this.runtimeStyle['zoom'] = '1',this.innerHTML = ''); +} +.check-mark-e-font .b-font:before { + content: "\e6cf"; + color: inherit; +} +.check-mark-e-font:hover .b-font:before, +.check-mark-e-font.hover .b-font:before { + content: "\e6cf"; + color: inherit; +} +.check-mark-e-font:active .b-font:before { + content: "\e6cf"; + color: #3f8ce8; +} +.check-mark-e-font.active .b-font:before { + content: "\e6cf"; + color: #3f8ce8; +} +.check-mark-e-font.disabled .b-font:before { + content: "\e6cf"; + color: inherit; +} +/** dashboard组件/控件 下拉列表图标字体 ~end~**/ +.row-pre-page-h-font .b-font { + *zoom: expression( this.runtimeStyle['zoom'] = '1',this.innerHTML = ''); +} +.row-pre-page-h-font .b-font:before { + content: "\e70d"; + color: inherit; +} +.row-pre-page-h-font:hover .b-font:before, +.row-pre-page-h-font.hover .b-font:before { + content: "\e70d"; + color: inherit; +} +.row-pre-page-h-font.disabled .b-font:before { + content: "\e70d"; + color: inherit; +} +.row-next-page-h-font .b-font { + *zoom: expression( this.runtimeStyle['zoom'] = '1',this.innerHTML = ''); +} +.row-next-page-h-font .b-font:before { + content: "\e70c"; + color: inherit; +} +.row-next-page-h-font:hover .b-font:before, +.row-next-page-h-font.hover .b-font:before { + content: "\e70c"; + color: inherit; +} +.row-next-page-h-font.disabled .b-font:before { + content: "\e70c"; + color: inherit; +} +.column-pre-page-h-font .b-font { + *zoom: expression( this.runtimeStyle['zoom'] = '1',this.innerHTML = ''); +} +.column-pre-page-h-font .b-font:before { + content: "\e70a"; + color: inherit; +} +.column-pre-page-h-font:hover .b-font:before, +.column-pre-page-h-font.hover .b-font:before { + content: "\e70a"; + color: inherit; +} +.column-pre-page-h-font.disabled .b-font:before { + content: "\e70a"; + color: inherit; +} +.column-next-page-h-font .b-font { + *zoom: expression( this.runtimeStyle['zoom'] = '1',this.innerHTML = ''); +} +.column-next-page-h-font .b-font:before { + content: "\e70b"; + color: inherit; +} +.column-next-page-h-font:hover .b-font:before, +.column-next-page-h-font.hover .b-font:before { + content: "\e70b"; + color: inherit; +} +.column-next-page-h-font.disabled .b-font:before { + content: "\e70b"; + color: inherit; +} +.expander-right-font .b-font { + *zoom: expression( this.runtimeStyle['zoom'] = '1',this.innerHTML = ''); +} +.expander-right-font .b-font:before { + content: "\e6d8"; + color: inherit; +} +.expander-right-font.disabled .b-font:before { + content: "\e6d8"; + color: inherit; +} +.expander-down-font .b-font { + *zoom: expression( this.runtimeStyle['zoom'] = '1',this.innerHTML = ''); +} +.expander-down-font .b-font:before { + content: "\e6d7"; + color: inherit; +} +.expander-down-font.disabled .b-font:before { + content: "\e6d7"; + color: inherit; +} +.solid-triangle-top-font .b-font { + *zoom: expression( this.runtimeStyle['zoom'] = '1',this.innerHTML = ''); +} +.solid-triangle-top-font .b-font:before { + content: "\e6d6"; + color: inherit; +} +.solid-triangle-top-font:hover .b-font:before, +.solid-triangle-top-font.hover .b-font:before { + content: "\e6d6"; + color: inherit; +} +.solid-triangle-top-font.disabled .b-font:before { + content: "\e6d6"; + color: inherit; +} +.solid-triangle-bottom-font .b-font { + *zoom: expression( this.runtimeStyle['zoom'] = '1',this.innerHTML = ''); +} +.solid-triangle-bottom-font .b-font:before { + content: "\e6d7"; + color: inherit; +} +.solid-triangle-bottom-font:hover .b-font:before, +.solid-triangle-bottom-font.hover .b-font:before { + content: "\e6d7"; + color: inherit; +} +.solid-triangle-bottom-font.disabled .b-font:before { + content: "\e6d7"; + color: inherit; +} +.trigger-triangle-font .b-font { + *zoom: expression( this.runtimeStyle['zoom'] = '1',this.innerHTML = ''); +} +.trigger-triangle-font .b-font:before { + content: "\e64e"; + color: inherit; +} +.trigger-triangle-font.disabled .b-font:before { + content: "\e64e"; + color: inherit; +} +.pull-up-font .b-font { + *zoom: expression( this.runtimeStyle['zoom'] = '1',this.innerHTML = ''); +} +.pull-up-font .b-font:before { + content: "\e70a"; + color: inherit; +} +.pull-up-font.disabled .b-font:before { + content: "\e70a"; + color: inherit; +} +.pull-down-font .b-font { + *zoom: expression( this.runtimeStyle['zoom'] = '1',this.innerHTML = ''); +} +.pull-down-font .b-font:before { + content: "\e70b"; + color: inherit; +} +.pull-down-font.disabled .b-font:before { + content: "\e70b"; + color: inherit; +} +.pull-down-h-font .b-font { + *zoom: expression( this.runtimeStyle['zoom'] = '1',this.innerHTML = ''); +} +.pull-down-h-font .b-font:before { + content: "\e70b"; + color: #647185; +} +.pull-down-h-font:hover .b-font:before, +.pull-down-h-font.hover .b-font:before { + content: "\e70b"; + color: inherit; +} +.pull-down-h-font.disabled .b-font:before { + content: "\e70b"; + color: #647185; +} +.pull-down-ha-font .b-font { + *zoom: expression( this.runtimeStyle['zoom'] = '1',this.innerHTML = ''); +} +.pull-down-ha-font .b-font:before { + content: "\e70b"; + color: #647185; +} +.pull-down-ha-font:hover .b-font:before, +.pull-down-ha-font.hover .b-font:before { + content: "\e70b"; + color: inherit; +} +.pull-down-ha-font:active .b-font:before, +.pull-down-ha-font.active .b-font:before { + content: "\e70b"; + color: #3f8ce8; +} +.pull-down-ha-font.disabled .b-font:before { + content: "\e70b"; + color: #647185; +} +.check-font .b-font { + *zoom: expression( this.runtimeStyle['zoom'] = '1',this.innerHTML = ''); +} +.check-font .b-font:before { + content: "\e6cf"; + color: #3685f2; +} +.check-font.disabled .b-font:before { + content: "\e6cf"; + color: #3685f2; +} +.item-check-font .b-font { + *zoom: expression( this.runtimeStyle['zoom'] = '1',this.innerHTML = ''); +} +.item-check-font .b-font:before { + content: "\e6cf"; + color: #ffffff; +} +.item-check-font:hover .b-font:before, +.item-check-font.hover .b-font:before { + content: "\e6cf"; + color: #999999; +} +.item-check-font:active .b-font:before, +.item-check-font.active .b-font:before { + content: "\e6cf"; + color: #3f8ce8; +} +.item-check-font.disabled .b-font:before { + content: "\e6cf"; + color: #ffffff; +} +.primary-key-font .b-font { + *zoom: expression( this.runtimeStyle['zoom'] = '1',this.innerHTML = ''); +} +.primary-key-font .b-font:before { + content: "\e740"; + color: inherit; +} +.primary-key-font:hover .b-font:before, +.primary-key-font.hover .b-font:before { + content: "\e740"; + color: inherit; +} +.primary-key-font.disabled .b-font:before { + content: "\e740"; + color: inherit; +} +.drag-tag-font .b-font { + *zoom: expression( this.runtimeStyle['zoom'] = '1',this.innerHTML = ''); +} +.drag-tag-font .b-font:before { + content: "\e6d0"; + color: #faaa39; +} +.drag-tag-font.disabled .b-font:before { + content: "\e6d0"; + color: #faaa39; +} +.less-font .b-font { + *zoom: expression( this.runtimeStyle['zoom'] = '1',this.innerHTML = ''); +} +.less-font .b-font:before { + content: "\e75e"; + color: inherit; +} +.less-font.disabled .b-font:before { + content: "\e75e"; + color: inherit; +} +.less-equal-font .b-font { + *zoom: expression( this.runtimeStyle['zoom'] = '1',this.innerHTML = ''); +} +.less-equal-font .b-font:before { + content: "\e761"; + color: inherit; +} +.less-equal-font.disabled .b-font:before { + content: "\e761"; + color: inherit; +} +.text-bold-font .b-font { + *zoom: expression( this.runtimeStyle['zoom'] = '1',this.innerHTML = ''); +} +.text-bold-font .b-font:before { + content: "\e697"; + color: inherit; +} +.text-bold-font.disabled .b-font:before { + content: "\e697"; + color: inherit; +} +.text-italic-font .b-font { + *zoom: expression( this.runtimeStyle['zoom'] = '1',this.innerHTML = ''); +} +.text-italic-font .b-font:before { + content: "\e69d"; + color: inherit; +} +.text-italic-font.disabled .b-font:before { + content: "\e69d"; + color: inherit; +} +.text-underline-font .b-font { + *zoom: expression( this.runtimeStyle['zoom'] = '1',this.innerHTML = ''); +} +.text-underline-font .b-font:before { + content: "\e69c"; + color: inherit; +} +.text-underline-font.disabled .b-font:before { + content: "\e69c"; + color: inherit; +} +.text-color-font .b-font { + *zoom: expression( this.runtimeStyle['zoom'] = '1',this.innerHTML = ''); +} +.text-color-font .b-font:before { + content: "\e698"; + color: inherit; +} +.text-color-font.disabled .b-font:before { + content: "\e698"; + color: inherit; +} +.text-background-font .b-font { + *zoom: expression( this.runtimeStyle['zoom'] = '1',this.innerHTML = ''); +} +.text-background-font .b-font:before { + content: "\e699"; + color: inherit; +} +.text-background-font.disabled .b-font:before { + content: "\e699"; + color: inherit; +} +.text-color-underline-font .b-font { + *zoom: expression( this.runtimeStyle['zoom'] = '1',this.innerHTML = ''); +} +.text-color-underline-font .b-font:before { + content: "\e69a"; + color: inherit; +} +.text-color-underline-font.disabled .b-font:before { + content: "\e69a"; + color: inherit; +} +.text-align-left-font .b-font { + *zoom: expression( this.runtimeStyle['zoom'] = '1',this.innerHTML = ''); +} +.text-align-left-font .b-font:before { + content: "\e6ca"; + color: inherit; +} +.text-align-left-font.disabled .b-font:before { + content: "\e6ca"; + color: inherit; +} +.text-align-center-font .b-font { + *zoom: expression( this.runtimeStyle['zoom'] = '1',this.innerHTML = ''); +} +.text-align-center-font .b-font:before { + content: "\e6bf"; + color: inherit; +} +.text-align-center-font.disabled .b-font:before { + content: "\e6bf"; + color: inherit; +} +.text-align-right-font .b-font { + *zoom: expression( this.runtimeStyle['zoom'] = '1',this.innerHTML = ''); +} +.text-align-right-font .b-font:before { + content: "\e6c8"; + color: inherit; +} +.text-align-right-font.disabled .b-font:before { + content: "\e6c8"; + color: inherit; +} +.toast-error-font .b-font { + *zoom: expression( this.runtimeStyle['zoom'] = '1',this.innerHTML = ''); +} +.toast-error-font .b-font:before { + content: "\e757"; + color: inherit; +} +.toast-error-font.disabled .b-font:before { + content: "\e757"; + color: inherit; +} +.toast-success-font .b-font { + *zoom: expression( this.runtimeStyle['zoom'] = '1',this.innerHTML = ''); +} +.toast-success-font .b-font:before { + content: "\e756"; + color: inherit; +} +.toast-success-font.disabled .b-font:before { + content: "\e756"; + color: inherit; +} +.toast-warning-font .b-font { + *zoom: expression( this.runtimeStyle['zoom'] = '1',this.innerHTML = ''); +} +.toast-warning-font .b-font:before { + content: "\e755"; + color: inherit; +} +.toast-warning-font.disabled .b-font:before { + content: "\e755"; + color: inherit; +} +.toast-message-font .b-font { + *zoom: expression( this.runtimeStyle['zoom'] = '1',this.innerHTML = ''); +} +.toast-message-font .b-font:before { + content: "\e74b"; + color: inherit; +} +.toast-message-font.disabled .b-font:before { + content: "\e74b"; + color: inherit; +} +.text-add-tip-font .b-font { + *zoom: expression( this.runtimeStyle['zoom'] = '1',this.innerHTML = ''); +} +.text-add-tip-font .b-font:before { + content: "\e6dd"; + color: #13cd66; +} +.text-add-tip-font.disabled .b-font:before { + content: "\e6dd"; + color: #13cd66; +} +.add-up-font .b-font { + *zoom: expression( this.runtimeStyle['zoom'] = '1',this.innerHTML = ''); +} +.add-up-font .b-font:before { + content: "\e70a"; + color: inherit; +} +.add-up-font.disabled .b-font:before { + content: "\e70a"; + color: inherit; +} +.minus-down-font .b-font { + *zoom: expression( this.runtimeStyle['zoom'] = '1',this.innerHTML = ''); +} +.minus-down-font .b-font:before { + content: "\e70b"; + color: inherit; +} +.minus-down-font.disabled .b-font:before { + content: "\e70b"; + color: inherit; +} +.tree-collapse-icon-type1 .x-icon { + display: block; + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/2x/icon/tree_collapse_1.png') no-repeat center center; + background-size: contain; +} +.tree-collapse-icon-type1 .x-icon.hack { + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/1x/icon/tree_collapse_1.png') no-repeat center center; +} +.tree-collapse-icon-type2 .x-icon { + display: block; + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/2x/icon/tree_collapse_2.png') no-repeat center center; + background-size: contain; +} +.tree-collapse-icon-type2 .x-icon.hack { + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/1x/icon/tree_collapse_2.png') no-repeat center center; +} +.tree-collapse-icon-type3 .x-icon { + display: block; + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/2x/icon/tree_collapse_3.png') no-repeat center center; + background-size: contain; +} +.tree-collapse-icon-type3 .x-icon.hack { + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/1x/icon/tree_collapse_3.png') no-repeat center center; +} +.tree-collapse-icon-type4 .x-icon { + display: block; + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/2x/icon/tree_collapse_4.png') no-repeat center center; + background-size: contain; +} +.tree-collapse-icon-type4 .x-icon.hack { + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/1x/icon/tree_collapse_4.png') no-repeat center center; +} +.tree-expand-icon-type1 .x-icon { + display: block; + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/2x/icon/tree_expand_1.png') no-repeat center center; + background-size: contain; +} +.tree-expand-icon-type1 .x-icon.hack { + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/1x/icon/tree_expand_1.png') no-repeat center center; +} +.tree-expand-icon-type2 .x-icon { + display: block; + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/2x/icon/tree_expand_2.png') no-repeat center center; + background-size: contain; +} +.tree-expand-icon-type2 .x-icon.hack { + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/1x/icon/tree_expand_2.png') no-repeat center center; +} +.tree-expand-icon-type3 .x-icon { + display: block; + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/2x/icon/tree_expand_3.png') no-repeat center center; + background-size: contain; +} +.tree-expand-icon-type3 .x-icon.hack { + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/1x/icon/tree_expand_3.png') no-repeat center center; +} +.tree-expand-icon-type4 .x-icon { + display: block; + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/2x/icon/tree_expand_4.png') no-repeat center center; + background-size: contain; +} +.tree-expand-icon-type4 .x-icon.hack { + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/1x/icon/tree_expand_4.png') no-repeat center center; +} +.tree-vertical-line-type2 .x-icon { + display: block; + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/2x/icon/tree_vertical_line_2.png') no-repeat center center; + background-size: contain; +} +.tree-vertical-line-type2 .x-icon.hack { + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/1x/icon/tree_vertical_line_2.png') no-repeat center center; +} +.tree-vertical-line-type3 .x-icon { + display: block; + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/2x/icon/tree_vertical_line_3.png') no-repeat center center; + background-size: contain; +} +.tree-vertical-line-type3 .x-icon.hack { + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/1x/icon/tree_vertical_line_3.png') no-repeat center center; +} +.tree-vertical-line-type4 .x-icon { + display: block; + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/2x/icon/tree_vertical_line_4.png') no-repeat center center; + background-size: contain; +} +.tree-vertical-line-type4 .x-icon.hack { + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/1x/icon/tree_vertical_line_4.png') no-repeat center center; +} +.bi-theme-dark .tree-collapse-icon-type1 .x-icon { + display: block; + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/2x/icon/dark/tree_collapse_1.png') no-repeat center center; + background-size: contain; +} +.bi-theme-dark .tree-collapse-icon-type1 .x-icon.hack { + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/1x/icon/dark/tree_collapse_1.png') no-repeat center center; +} +.bi-theme-dark .tree-collapse-icon-type2 .x-icon { + display: block; + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/2x/icon/dark/tree_collapse_2.png') no-repeat center center; + background-size: contain; +} +.bi-theme-dark .tree-collapse-icon-type2 .x-icon.hack { + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/1x/icon/dark/tree_collapse_2.png') no-repeat center center; +} +.bi-theme-dark .tree-collapse-icon-type3 .x-icon { + display: block; + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/2x/icon/dark/tree_collapse_3.png') no-repeat center center; + background-size: contain; +} +.bi-theme-dark .tree-collapse-icon-type3 .x-icon.hack { + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/1x/icon/dark/tree_collapse_3.png') no-repeat center center; +} +.bi-theme-dark .tree-collapse-icon-type4 .x-icon { + display: block; + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/2x/icon/dark/tree_collapse_4.png') no-repeat center center; + background-size: contain; +} +.bi-theme-dark .tree-collapse-icon-type4 .x-icon.hack { + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/1x/icon/dark/tree_collapse_4.png') no-repeat center center; +} +.bi-theme-dark .tree-expand-icon-type1 .x-icon { + display: block; + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/2x/icon/dark/tree_expand_1.png') no-repeat center center; + background-size: contain; +} +.bi-theme-dark .tree-expand-icon-type1 .x-icon.hack { + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/1x/icon/dark/tree_expand_1.png') no-repeat center center; +} +.bi-theme-dark .tree-expand-icon-type2 .x-icon { + display: block; + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/2x/icon/dark/tree_expand_2.png') no-repeat center center; + background-size: contain; +} +.bi-theme-dark .tree-expand-icon-type2 .x-icon.hack { + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/1x/icon/dark/tree_expand_2.png') no-repeat center center; +} +.bi-theme-dark .tree-expand-icon-type3 .x-icon { + display: block; + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/2x/icon/dark/tree_expand_3.png') no-repeat center center; + background-size: contain; +} +.bi-theme-dark .tree-expand-icon-type3 .x-icon.hack { + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/1x/icon/dark/tree_expand_3.png') no-repeat center center; +} +.bi-theme-dark .tree-expand-icon-type4 .x-icon { + display: block; + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/2x/icon/dark/tree_expand_4.png') no-repeat center center; + background-size: contain; +} +.bi-theme-dark .tree-expand-icon-type4 .x-icon.hack { + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/1x/icon/dark/tree_expand_4.png') no-repeat center center; +} +.bi-theme-dark .tree-vertical-line-type2 .x-icon { + display: block; + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/2x/icon/dark/tree_vertical_line_2.png') no-repeat center center; + background-size: contain; +} +.bi-theme-dark .tree-vertical-line-type2 .x-icon.hack { + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/1x/icon/dark/tree_vertical_line_2.png') no-repeat center center; +} +.bi-theme-dark .tree-vertical-line-type3 .x-icon { + display: block; + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/2x/icon/dark/tree_vertical_line_3.png') no-repeat center center; + background-size: contain; +} +.bi-theme-dark .tree-vertical-line-type3 .x-icon.hack { + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/1x/icon/dark/tree_vertical_line_3.png') no-repeat center center; +} +.bi-theme-dark .tree-vertical-line-type4 .x-icon { + display: block; + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/2x/icon/dark/tree_vertical_line_4.png') no-repeat center center; + background-size: contain; +} +.bi-theme-dark .tree-vertical-line-type4 .x-icon.hack { + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/1x/icon/dark/tree_vertical_line_4.png') no-repeat center center; +} +.check-box-icon .x-icon { + display: block; + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/2x/icon/check_box_normal.png') no-repeat center center; + background-size: contain; +} +.check-box-icon .x-icon.hack { + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/1x/icon/check_box_normal.png') no-repeat center center; +} +.check-box-icon:hover .x-icon, +.check-box-icon.hover .x-icon { + display: block; + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/2x/icon/check_box_normal.png') no-repeat center center; + background-size: contain; +} +.check-box-icon:hover .x-icon.hack, +.check-box-icon.hover .x-icon.hack { + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/1x/icon/check_box_normal.png') no-repeat center center; +} +.check-box-icon:active .x-icon { + display: block; + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/2x/icon/check_box_normal.png') no-repeat center center; + background-size: contain; +} +.check-box-icon:active .x-icon.hack { + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/1x/icon/check_box_normal.png') no-repeat center center; +} +.check-box-icon.active .x-icon { + display: block; + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/2x/icon/check_box_active.png') no-repeat center center; + background-size: contain; +} +.check-box-icon.active .x-icon.hack { + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/1x/icon/check_box_active.png') no-repeat center center; +} +.check-box-icon.disabled .x-icon { + display: block; + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/2x/icon/check_box_disable.png') no-repeat center center; + background-size: contain; +} +.check-box-icon.disabled .x-icon.hack { + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/1x/icon/check_box_disable.png') no-repeat center center; +} +.check-box-icon.disabled.active .x-icon { + display: block; + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/2x/icon/check_box_disable2.png') no-repeat center center; + background-size: contain; +} +.check-box-icon.disabled.active .x-icon.hack { + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/1x/icon/check_box_disable2.png') no-repeat center center; +} +.radio-icon .x-icon { + display: block; + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/2x/icon/radio_normal.png') no-repeat center center; + background-size: contain; +} +.radio-icon .x-icon.hack { + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/1x/icon/radio_normal.png') no-repeat center center; +} +.radio-icon:hover .x-icon, +.radio-icon.hover .x-icon { + display: block; + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/2x/icon/radio_normal.png') no-repeat center center; + background-size: contain; +} +.radio-icon:hover .x-icon.hack, +.radio-icon.hover .x-icon.hack { + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/1x/icon/radio_normal.png') no-repeat center center; +} +.radio-icon:active .x-icon { + display: block; + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/2x/icon/radio_normal.png') no-repeat center center; + background-size: contain; +} +.radio-icon:active .x-icon.hack { + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/1x/icon/radio_normal.png') no-repeat center center; +} +.radio-icon.active .x-icon { + display: block; + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/2x/icon/radio_active.png') no-repeat center center; + background-size: contain; +} +.radio-icon.active .x-icon.hack { + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/1x/icon/radio_active.png') no-repeat center center; +} +.radio-icon.disabled .x-icon { + display: block; + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/2x/icon/radio_disable.png') no-repeat center center; + background-size: contain; +} +.radio-icon.disabled .x-icon.hack { + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/1x/icon/radio_disable.png') no-repeat center center; +} +.radio-icon.disabled.active .x-icon { + display: block; + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/2x/icon/radio_disable2.png') no-repeat center center; + background-size: contain; +} +.radio-icon.disabled.active .x-icon.hack { + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/1x/icon/radio_disable2.png') no-repeat center center; +} +.check-half-select-icon .x-icon { + display: block; + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/2x/icon/half_selected.png') no-repeat center center; + background-size: contain; +} +.check-half-select-icon .x-icon.hack { + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/1x/icon/half_selected.png') no-repeat center center; +} +.check-half-select-icon.disabled .x-icon { + display: block; + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/2x/icon/half_selected_disable.png') no-repeat center center; + background-size: contain; +} +.check-half-select-icon.disabled .x-icon.hack { + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/1x/icon/half_selected_disable.png') no-repeat center center; +} +.slider-icon .x-icon { + display: block; + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/2x/icon/slider_normal_small.png') no-repeat center center; + background-size: contain; +} +.slider-icon .x-icon.hack { + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/1x/icon/slider_normal_small.png') no-repeat center center; +} +.slider-icon:hover .x-icon, +.slider-icon.hover .x-icon { + display: block; + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/2x/icon/slider_active_small.png') no-repeat center center; + background-size: contain; +} +.slider-icon:hover .x-icon.hack, +.slider-icon.hover .x-icon.hack { + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/1x/icon/slider_active_small.png') no-repeat center center; +} +.slider-icon.disabled .x-icon { + display: block; + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/2x/icon/slider_normal_small.png') no-repeat center center; + background-size: contain; +} +.slider-icon.disabled .x-icon.hack { + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/1x/icon/slider_normal_small.png') no-repeat center center; +} +.auto-color-icon .x-icon { + display: block; + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/2x/icon/auto_normal.png') no-repeat center center; + background-size: contain; +} +.auto-color-icon .x-icon.hack { + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/1x/icon/auto_normal.png') no-repeat center center; +} +.auto-color-icon.active .x-icon { + display: block; + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/2x/icon/auto_select.png') no-repeat center center; + background-size: contain; +} +.auto-color-icon.active .x-icon.hack { + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/1x/icon/auto_select.png') no-repeat center center; +} +.auto-color-icon.disabled .x-icon { + display: block; + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/2x/icon/auto_disable.png') no-repeat center center; + background-size: contain; +} +.auto-color-icon.disabled .x-icon.hack { + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/1x/icon/auto_disable.png') no-repeat center center; +} +.trans-color-icon .x-icon { + display: block; + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/2x/icon/trans_normal.png') no-repeat center center; + background-size: contain; +} +.trans-color-icon .x-icon.hack { + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/1x/icon/trans_normal.png') no-repeat center center; +} +.trans-color-icon.active .x-icon { + display: block; + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/2x/icon/trans_select.png') no-repeat center center; + background-size: contain; +} +.trans-color-icon.active .x-icon.hack { + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/1x/icon/trans_select.png') no-repeat center center; +} +.trans-color-icon.disabled .x-icon { + display: block; + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/2x/icon/trans_disable.png') no-repeat center center; + background-size: contain; +} +.trans-color-icon.disabled .x-icon.hack { + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/1x/icon/trans_disable.png') no-repeat center center; +} +.icon-size-12 .b-font { + font-size: 12px; +} +.icon-size-16 .b-font { + font-size: 16px; +} +.icon-size-24 .b-font { + font-size: 24px; +} +.icon-size-40 .b-font { + font-size: 40px; +} +.icon-size-50 .b-font { + font-size: 50px; +} +.icon-size-70 .b-font { + font-size: 70px; +} diff --git a/designer-base/src/main/resources/com/fr/design/login/lib/fineui.ie.min.js b/designer-base/src/main/resources/com/fr/design/login/lib/fineui.ie.min.js new file mode 100644 index 000000000..02e3facce --- /dev/null +++ b/designer-base/src/main/resources/com/fr/design/login/lib/fineui.ie.min.js @@ -0,0 +1,53 @@ +/*! fineui 2019-10-24 10:46:55 */ + +function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}var _global;_global="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,null==_global.BI&&(_global.BI={prepares:[]}),null==_global.BI.prepares&&(_global.BI.prepares=[]),Array.prototype.indexOf||(Array.prototype.indexOf=function(searchElement,fromIndex){var k;if(null==this)throw new TypeError('"this" is null or not defined');var o=Object(this),len=o.length>>>0;if(0===len)return-1;var n=0|fromIndex;if(n>=len)return-1;for(k=Math.max(n>=0?n:len-Math.abs(n),0);k>>0;if(0===len)return-1;for(n=len-1,arguments.length>1&&(n=Number(arguments[1]),n!=n?n=0:0!=n&&n!=1/0&&n!=-(1/0)&&(n=(n>0||-1)*Math.floor(Math.abs(n)))),k=n>=0?Math.min(n,len-1):len-Math.abs(n);k>=0;k--)if(k in t&&t[k]===searchElement)return k;return-1}),_global.console=_global.console||function(){var c={};return c.log=c.warn=c.debug=c.info=c.error=c.time=c.dir=c.profile=c.clear=c.exception=c.trace=c.assert=function(){},c}(),_global.localStorage||(_global.localStorage={items:{},setItem:function(k,v){BI.Cache.addCookie(k,v)},getItem:function(k){return BI.Cache.getCookie(k)},removeItem:function(k){BI.Cache.deleteCookie(k)},key:function(){},clear:function(){this.items={}}}),Object.keys||(Object.keys=function(o){if(o!==Object(o))throw new TypeError("Object.keys called on a non-object");var falsy,skipArray={__ob__:falsy,$accessors:falsy,$vbthis:falsy,$vbsetter:falsy},k=[],p;for(p in o)p in skipArray||Object.prototype.hasOwnProperty.call(o,p)&&k.push(p);return k}),Array.isArray||(Array.isArray=function(arg){return"[object Array]"===Object.prototype.toString.call(arg)}),"function"!=typeof Object.getPrototypeOf&&(Object.getPrototypeOf="".__proto__===String.prototype?function(object){return object.__proto__}:function(object){return object.constructor.prototype}),Date.now||(Date.now=function(){return(new Date).valueOf()}),"undefined"!=typeof Set&&Set.toString().match(/native code/)||(Set=function(){this.set={}},Set.prototype.has=function(key){return void 0!==this.set[key]},Set.prototype.add=function(key){this.set[key]=1},Set.prototype.clear=function(){this.set={}}),!function(window){var ua=window.navigator.userAgent.toLowerCase(),reg=/msie/;if(reg.test(ua)){var _sort=Array.prototype.sort;Array.prototype.sort=function(fn){if(fn&&"function"==typeof fn){if(this.length<2)return this;for(var i=0,j=i+1,l=this.length,tmp,r=!1,t=0;i0,r===!0&&(tmp=this[i],this[i]=this[j],this[j]=tmp);return this}return _sort.call(this)}}}(window);var _global;_global="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,null==_global.BI&&(_global.BI={prepares:[]}),null==_global.BI.prepares&&(_global.BI.prepares=[]),function(){function apply(func,thisArg,args){switch(args.length){case 0:return func.call(thisArg);case 1:return func.call(thisArg,args[0]);case 2:return func.call(thisArg,args[0],args[1]);case 3:return func.call(thisArg,args[0],args[1],args[2])}return func.apply(thisArg,args)}function arrayAggregator(array,setter,iteratee,accumulator){for(var index=-1,length=null==array?0:array.length;++index-1}function arrayIncludesWith(array,value,comparator){for(var index=-1,length=null==array?0:array.length;++index-1;);return index}function charsEndIndex(strSymbols,chrSymbols){for(var index=strSymbols.length;index--&&baseIndexOf(chrSymbols,strSymbols[index],0)>-1;);return index}function countHolders(array,placeholder){for(var length=array.length,result=0;length--;)array[length]===placeholder&&++result;return result}function getValue(object,key){return null==object?undefined:object[key]}function hasUnicode(string){return reHasUnicode.test(string)}function iteratorToArray(iterator){for(var data,result=[];!(data=iterator.next()).done;)result.push(data.value);return result}function mapToArray(map){var index=-1,result=Array(map.size);return map.forEach(function(value,key){result[++index]=[key,value]}),result}function overArg(func,transform){return function(arg){return func(transform(arg))}}function replaceHolders(array,placeholder){for(var index=-1,length=array.length,resIndex=0,result=[];++index-1}function listCacheSet(key,value){var data=this.__data__,index=assocIndexOf(data,key);return index<0?(++this.size,data.push([key,value])):data[index][1]=value,this}function MapCache(entries){var index=-1,length=null==entries?0:entries.length;for(this.clear();++index=lower?number:lower)),number}function baseClone(value,bitmask,customizer,key,object,stack){var result,isDeep=bitmask&CLONE_DEEP_FLAG,isFlat=bitmask&CLONE_FLAT_FLAG,isFull=bitmask&CLONE_SYMBOLS_FLAG;if(customizer&&(result=object?customizer(value,key,object,stack):customizer(value)),result!==undefined)return result;if(!isObject(value))return value;var isArr=isArray(value);if(isArr){if(result=initCloneArray(value),!isDeep)return copyArray(value,result)}else{var tag=getTag(value),isFunc=tag==funcTag||tag==genTag;if(isBuffer(value))return cloneBuffer(value,isDeep);if(tag==objectTag||tag==argsTag||isFunc&&!object){if(result=isFlat||isFunc?{}:initCloneObject(value),!isDeep)return isFlat?copySymbolsIn(value,baseAssignIn(result,value)):copySymbols(value,baseAssign(result,value))}else{if(!cloneableTags[tag])return object?value:{};result=initCloneByTag(value,tag,isDeep)}}stack||(stack=new Stack);var stacked=stack.get(value);if(stacked)return stacked;if(stack.set(value,result),isSet(value))return value.forEach(function(subValue){result.add(baseClone(subValue,bitmask,customizer,subValue,value,stack))}),result;if(isMap(value))return value.forEach(function(subValue,key){result.set(key,baseClone(subValue,bitmask,customizer,key,value,stack))}),result;var keysFunc=isFull?isFlat?getAllKeysIn:getAllKeys:isFlat?keysIn:keys,props=isArr?undefined:keysFunc(value);return arrayEach(props||value,function(subValue,key){props&&(key=subValue,subValue=value[key]),assignValue(result,key,baseClone(subValue,bitmask,customizer,key,value,stack))}),result}function baseDelay(func,wait,args){if("function"!=typeof func)throw new TypeError(FUNC_ERROR_TEXT);return setTimeout(function(){func.apply(undefined,args)},wait)}function baseDifference(array,values,iteratee,comparator){var index=-1,includes=arrayIncludes,isCommon=!0,length=array.length,result=[],valuesLength=values.length;if(!length)return result;iteratee&&(values=arrayMap(values,baseUnary(iteratee))),comparator?(includes=arrayIncludesWith,isCommon=!1):values.length>=LARGE_ARRAY_SIZE&&(includes=cacheHas,isCommon=!1,values=new SetCache(values));outer:for(;++index0&&predicate(value)?depth>1?baseFlatten(value,depth-1,predicate,isStrict,result):arrayPush(result,value):isStrict||(result[result.length]=value)}return result}function baseForOwn(object,iteratee){return object&&baseFor(object,iteratee,keys)}function baseForOwnRight(object,iteratee){return object&&baseForRight(object,iteratee,keys)}function baseFunctions(object,props){return arrayFilter(props,function(key){return isFunction(object[key])})}function baseGet(object,path){path=castPath(path,object);for(var index=0,length=path.length;null!=object&&indexother}function baseHas(object,key){return null!=object&&hasOwnProperty.call(object,key)}function baseHasIn(object,key){return null!=object&&key in Object(object)}function baseIntersection(arrays,iteratee,comparator){for(var includes=comparator?arrayIncludesWith:arrayIncludes,length=arrays[0].length,othLength=arrays.length,othIndex=othLength,caches=Array(othLength),maxLength=1/0,result=[];othIndex--;){var array=arrays[othIndex];othIndex&&iteratee&&(array=arrayMap(array,baseUnary(iteratee))),maxLength=nativeMin(array.length,maxLength),caches[othIndex]=!comparator&&(iteratee||length>=120&&array.length>=120)?new SetCache(othIndex&&array):undefined}array=arrays[0];var index=-1,seen=caches[0];outer:for(;++indexlength?0:length+start),end=end>length?length:end,end<0&&(end+=length),length=start>end?0:end-start>>>0,start>>>=0;for(var result=Array(length);++index=LARGE_ARRAY_SIZE){var set=iteratee?null:createSet(array);if(set)return setToArray(set);isCommon=!1,includes=cacheHas,seen=new SetCache}else seen=iteratee?[]:result;outer:for(;++index=length?array:baseSlice(array,start,end)}function cloneBuffer(buffer,isDeep){if(isDeep)return buffer.slice();var length=buffer.length,result=allocUnsafe?allocUnsafe(length):new buffer.constructor(length);return buffer.copy(result),result}function cloneArrayBuffer(arrayBuffer){var result=new arrayBuffer.constructor(arrayBuffer.byteLength);return new Uint8Array(result).set(new Uint8Array(arrayBuffer)), +result}function cloneDataView(dataView,isDeep){var buffer=isDeep?cloneArrayBuffer(dataView.buffer):dataView.buffer;return new dataView.constructor(buffer,dataView.byteOffset,dataView.byteLength)}function cloneRegExp(regexp){var result=new regexp.constructor(regexp.source,reFlags.exec(regexp));return result.lastIndex=regexp.lastIndex,result}function cloneSymbol(symbol){return symbolValueOf?Object(symbolValueOf.call(symbol)):{}}function cloneTypedArray(typedArray,isDeep){var buffer=isDeep?cloneArrayBuffer(typedArray.buffer):typedArray.buffer;return new typedArray.constructor(buffer,typedArray.byteOffset,typedArray.length)}function compareAscending(value,other){if(value!==other){var valIsDefined=value!==undefined,valIsNull=null===value,valIsReflexive=value===value,valIsSymbol=isSymbol(value),othIsDefined=other!==undefined,othIsNull=null===other,othIsReflexive=other===other,othIsSymbol=isSymbol(other);if(!othIsNull&&!othIsSymbol&&!valIsSymbol&&value>other||valIsSymbol&&othIsDefined&&othIsReflexive&&!othIsNull&&!othIsSymbol||valIsNull&&othIsDefined&&othIsReflexive||!valIsDefined&&othIsReflexive||!valIsReflexive)return 1;if(!valIsNull&&!valIsSymbol&&!othIsSymbol&&value=ordersLength)return result;var order=orders[index];return result*("desc"==order?-1:1)}}return object.index-other.index}function composeArgs(args,partials,holders,isCurried){for(var argsIndex=-1,argsLength=args.length,holdersLength=holders.length,leftIndex=-1,leftLength=partials.length,rangeLength=nativeMax(argsLength-holdersLength,0),result=Array(leftLength+rangeLength),isUncurried=!isCurried;++leftIndex1?sources[length-1]:undefined,guard=length>2?sources[2]:undefined;for(customizer=assigner.length>3&&"function"==typeof customizer?(length--,customizer):undefined,guard&&isIterateeCall(sources[0],sources[1],guard)&&(customizer=length<3?undefined:customizer,length=1),object=Object(object);++index-1?iterable[iteratee?collection[index]:index]:undefined}}function createHybrid(func,bitmask,thisArg,partials,holders,partialsRight,holdersRight,argPos,ary,arity){function wrapper(){for(var length=arguments.length,args=Array(length),index=length;index--;)args[index]=arguments[index];if(isCurried)var placeholder=getHolder(wrapper),holdersCount=countHolders(args,placeholder);if(partials&&(args=composeArgs(args,partials,holders,isCurried)),partialsRight&&(args=composeArgsRight(args,partialsRight,holdersRight,isCurried)),length-=holdersCount,isCurried&&length1&&args.reverse(),isAry&&aryarrLength))return!1;var stacked=stack.get(array);if(stacked&&stack.get(other))return stacked==other;var index=-1,result=!0,seen=bitmask&COMPARE_UNORDERED_FLAG?new SetCache:undefined;for(stack.set(array,other),stack.set(other,array);++index1?"& ":"")+details[lastIndex],details=details.join(length>2?", ":" "),source.replace(reWrapComment,"{\n/* [wrapped with "+details+"] */\n")}function isFlattenable(value){return isArray(value)||isArguments(value)||!!(spreadableSymbol&&value&&value[spreadableSymbol])}function isIndex(value,length){var type=typeof value;return length=null==length?MAX_SAFE_INTEGER:length,!!length&&("number"==type||"symbol"!=type&&reIsUint.test(value))&&value>-1&&value%1==0&&value0){if(++count>=HOT_COUNT)return arguments[0]}else count=0;return func.apply(undefined,arguments)}}function toKey(value){if("string"==typeof value||isSymbol(value))return value;var result=value+"";return"0"==result&&1/value==-INFINITY?"-0":result}function toSource(func){if(null!=func){try{return funcToString.call(func)}catch(e){}try{return func+""}catch(e){}}return""}function updateWrapDetails(details,bitmask){return arrayEach(wrapFlags,function(pair){var value="_."+pair[0];bitmask&pair[1]&&!arrayIncludes(details,value)&&details.push(value)}),details.sort()}function wrapperClone(wrapper){if(wrapper instanceof LazyWrapper)return wrapper.clone();var result=new LodashWrapper(wrapper.__wrapped__,wrapper.__chain__);return result.__actions__=copyArray(wrapper.__actions__),result.__index__=wrapper.__index__,result.__values__=wrapper.__values__,result}function compact(array){for(var index=-1,length=null==array?0:array.length,resIndex=0,result=[];++index=this.__values__.length,value=done?undefined:this.__values__[this.__index__++];return{done:done,value:value}}function wrapperToIterator(){return this}function wrapperPlant(value){for(var result,parent=this;parent instanceof baseLodash;){var clone=wrapperClone(parent);clone.__index__=0,clone.__values__=undefined,result?previous.__wrapped__=clone:result=clone;var previous=clone;parent=parent.__wrapped__}return previous.__wrapped__=value,result}function wrapperReverse(){var value=this.__wrapped__;if(value instanceof LazyWrapper){var wrapped=value;return this.__actions__.length&&(wrapped=new LazyWrapper(this)),wrapped=wrapped.reverse(),wrapped.__actions__.push({func:thru,args:[reverse],thisArg:undefined}),new LodashWrapper(wrapped,this.__chain__)}return this.thru(reverse)}function wrapperValue(){return baseWrapperValue(this.__wrapped__,this.__actions__)}function every(collection,predicate,guard){var func=isArray(collection)?arrayEvery:baseEvery;return guard&&isIterateeCall(collection,predicate,guard)&&(predicate=undefined),func(collection,baseIteratee(predicate,3))}function filter(collection,predicate){var func=isArray(collection)?arrayFilter:baseFilter;return func(collection,baseIteratee(predicate,3))}function forEach(collection,iteratee){var func=isArray(collection)?arrayEach:baseEach;return func(collection,baseIteratee(iteratee,3))}function map(collection,iteratee){var func=isArray(collection)?arrayMap:baseMap;return func(collection,baseIteratee(iteratee,3))}function reduce(collection,iteratee,accumulator){var func=isArray(collection)?arrayReduce:baseReduce,initAccum=arguments.length<3;return func(collection,baseIteratee(iteratee,4),accumulator,initAccum,baseEach)}function reject(collection,predicate){var func=isArray(collection)?arrayFilter:baseFilter;return func(collection,negate(baseIteratee(predicate,3)))}function size(collection){if(null==collection)return 0;if(isArrayLike(collection))return isString(collection)?stringSize(collection):collection.length;var tag=getTag(collection);return tag==mapTag||tag==setTag?collection.size:baseKeys(collection).length}function some(collection,predicate,guard){var func=isArray(collection)?arraySome:baseSome;return guard&&isIterateeCall(collection,predicate,guard)&&(predicate=undefined),func(collection,baseIteratee(predicate,3))}function before(n,func){var result;if("function"!=typeof func)throw new TypeError(FUNC_ERROR_TEXT);return n=toInteger(n),function(){return--n>0&&(result=func.apply(this,arguments)),n<=1&&(func=undefined),result}}function debounce(func,wait,options){function invokeFunc(time){var args=lastArgs,thisArg=lastThis;return lastArgs=lastThis=undefined,lastInvokeTime=time,result=func.apply(thisArg,args)}function leadingEdge(time){return lastInvokeTime=time,timerId=setTimeout(timerExpired,wait),leading?invokeFunc(time):result}function remainingWait(time){var timeSinceLastCall=time-lastCallTime,timeSinceLastInvoke=time-lastInvokeTime,timeWaiting=wait-timeSinceLastCall;return maxing?nativeMin(timeWaiting,maxWait-timeSinceLastInvoke):timeWaiting}function shouldInvoke(time){var timeSinceLastCall=time-lastCallTime,timeSinceLastInvoke=time-lastInvokeTime;return lastCallTime===undefined||timeSinceLastCall>=wait||timeSinceLastCall<0||maxing&&timeSinceLastInvoke>=maxWait}function timerExpired(){var time=now();return shouldInvoke(time)?trailingEdge(time):void(timerId=setTimeout(timerExpired,remainingWait(time)))}function trailingEdge(time){return timerId=undefined,trailing&&lastArgs?invokeFunc(time):(lastArgs=lastThis=undefined,result)}function cancel(){timerId!==undefined&&clearTimeout(timerId),lastInvokeTime=0,lastArgs=lastCallTime=lastThis=timerId=undefined}function flush(){return timerId===undefined?result:trailingEdge(now())}function debounced(){var time=now(),isInvoking=shouldInvoke(time);if(lastArgs=arguments,lastThis=this,lastCallTime=time,isInvoking){if(timerId===undefined)return leadingEdge(lastCallTime);if(maxing)return timerId=setTimeout(timerExpired,wait),invokeFunc(lastCallTime)}return timerId===undefined&&(timerId=setTimeout(timerExpired,wait)),result}var lastArgs,lastThis,maxWait,result,timerId,lastCallTime,lastInvokeTime=0,leading=!1,maxing=!1,trailing=!0;if("function"!=typeof func)throw new TypeError(FUNC_ERROR_TEXT);return wait=toNumber(wait)||0,isObject(options)&&(leading=!!options.leading,maxing="maxWait"in options,maxWait=maxing?nativeMax(toNumber(options.maxWait)||0,wait):maxWait,trailing="trailing"in options?!!options.trailing:trailing),debounced.cancel=cancel,debounced.flush=flush,debounced}function memoize(func,resolver){if("function"!=typeof func||null!=resolver&&"function"!=typeof resolver)throw new TypeError(FUNC_ERROR_TEXT);var memoized=function(){var args=arguments,key=resolver?resolver.apply(this,args):args[0],cache=memoized.cache;if(cache.has(key))return cache.get(key);var result=func.apply(this,args);return memoized.cache=cache.set(key,result)||cache,result};return memoized.cache=new(memoize.Cache||MapCache), +memoized}function negate(predicate){if("function"!=typeof predicate)throw new TypeError(FUNC_ERROR_TEXT);return function(){var args=arguments;switch(args.length){case 0:return!predicate.call(this);case 1:return!predicate.call(this,args[0]);case 2:return!predicate.call(this,args[0],args[1]);case 3:return!predicate.call(this,args[0],args[1],args[2])}return!predicate.apply(this,args)}}function once(func){return before(2,func)}function rest(func,start){if("function"!=typeof func)throw new TypeError(FUNC_ERROR_TEXT);return start=start===undefined?start:toInteger(start),baseRest(func,start)}function throttle(func,wait,options){var leading=!0,trailing=!0;if("function"!=typeof func)throw new TypeError(FUNC_ERROR_TEXT);return isObject(options)&&(leading="leading"in options?!!options.leading:leading,trailing="trailing"in options?!!options.trailing:trailing),debounce(func,wait,{leading:leading,maxWait:wait,trailing:trailing})}function clone(value){return baseClone(value,CLONE_SYMBOLS_FLAG)}function cloneDeep(value){return baseClone(value,CLONE_DEEP_FLAG|CLONE_SYMBOLS_FLAG)}function eq(value,other){return value===other||value!==value&&other!==other}function isArrayLike(value){return null!=value&&isLength(value.length)&&!isFunction(value)}function isArrayLikeObject(value){return isObjectLike(value)&&isArrayLike(value)}function isBoolean(value){return value===!0||value===!1||isObjectLike(value)&&baseGetTag(value)==boolTag}function isEmpty(value){if(null==value)return!0;if(isArrayLike(value)&&(isArray(value)||"string"==typeof value||"function"==typeof value.splice||isBuffer(value)||isTypedArray(value)||isArguments(value)))return!value.length;var tag=getTag(value);if(tag==mapTag||tag==setTag)return!value.size;if(isPrototype(value))return!baseKeys(value).length;for(var key in value)if(hasOwnProperty.call(value,key))return!1;return!0}function isEqual(value,other){return baseIsEqual(value,other)}function isFinite(value){return"number"==typeof value&&nativeIsFinite(value)}function isFunction(value){if(!isObject(value))return!1;var tag=baseGetTag(value);return tag==funcTag||tag==genTag||tag==asyncTag||tag==proxyTag}function isLength(value){return"number"==typeof value&&value>-1&&value%1==0&&value<=MAX_SAFE_INTEGER}function isObject(value){var type=typeof value;return null!=value&&("object"==type||"function"==type)}function isObjectLike(value){return null!=value&&"object"==typeof value}function isNaN(value){return isNumber(value)&&value!=+value}function isNull(value){return null===value}function isNumber(value){return"number"==typeof value||isObjectLike(value)&&baseGetTag(value)==numberTag}function isPlainObject(value){if(!isObjectLike(value)||baseGetTag(value)!=objectTag)return!1;var proto=getPrototype(value);if(null===proto)return!0;var Ctor=hasOwnProperty.call(proto,"constructor")&&proto.constructor;return"function"==typeof Ctor&&Ctor instanceof Ctor&&funcToString.call(Ctor)==objectCtorString}function isString(value){return"string"==typeof value||!isArray(value)&&isObjectLike(value)&&baseGetTag(value)==stringTag}function isSymbol(value){return"symbol"==typeof value||isObjectLike(value)&&baseGetTag(value)==symbolTag}function isUndefined(value){return value===undefined}function toArray(value){if(!value)return[];if(isArrayLike(value))return isString(value)?stringToArray(value):copyArray(value);if(symIterator&&value[symIterator])return iteratorToArray(value[symIterator]());var tag=getTag(value),func=tag==mapTag?mapToArray:tag==setTag?setToArray:values;return func(value)}function toFinite(value){if(!value)return 0===value?value:0;if(value=toNumber(value),value===INFINITY||value===-INFINITY){var sign=value<0?-1:1;return sign*MAX_INTEGER}return value===value?value:0}function toInteger(value){var result=toFinite(value),remainder=result%1;return result===result?remainder?result-remainder:result:0}function toNumber(value){if("number"==typeof value)return value;if(isSymbol(value))return NAN;if(isObject(value)){var other="function"==typeof value.valueOf?value.valueOf():value;value=isObject(other)?other+"":other}if("string"!=typeof value)return 0===value?value:+value;value=value.replace(reTrim,"");var isBinary=reIsBinary.test(value);return isBinary||reIsOctal.test(value)?freeParseInt(value.slice(2),isBinary?2:8):reIsBadHex.test(value)?NAN:+value}function toPlainObject(value){return copyObject(value,keysIn(value))}function toString(value){return null==value?"":baseToString(value)}function create(prototype,properties){var result=baseCreate(prototype);return null==properties?result:baseAssign(result,properties)}function findKey(object,predicate){return baseFindKey(object,baseIteratee(predicate,3),baseForOwn)}function findLastKey(object,predicate){return baseFindKey(object,baseIteratee(predicate,3),baseForOwnRight)}function get(object,path,defaultValue){var result=null==object?undefined:baseGet(object,path);return result===undefined?defaultValue:result}function has(object,path){return null!=object&&hasPath(object,path,baseHas)}function hasIn(object,path){return null!=object&&hasPath(object,path,baseHasIn)}function keys(object){return isArrayLike(object)?arrayLikeKeys(object):baseKeys(object)}function keysIn(object){return isArrayLike(object)?arrayLikeKeys(object,!0):baseKeysIn(object)}function omitBy(object,predicate){return pickBy(object,negate(baseIteratee(predicate)))}function pickBy(object,predicate){if(null==object)return{};var props=arrayMap(getAllKeysIn(object),function(prop){return[prop]});return predicate=baseIteratee(predicate),basePickBy(object,props,function(value,path){return predicate(value,path[0])})}function result(object,path,defaultValue){path=castPath(path,object);var index=-1,length=path.length;for(length||(length=1,object=undefined);++indexupper){var temp=lower;lower=upper,upper=temp}if(floating||lower%1||upper%1){var rand=nativeRandom();return nativeMin(lower+rand*(upper-lower+freeParseFloat("1e-"+((rand+"").length-1))),upper)}return baseRandom(lower,upper)}function escape(string){return string=toString(string),string&&reHasUnescapedHtml.test(string)?string.replace(reUnescapedHtml,escapeHtmlChar):string}function trim(string,chars,guard){if(string=toString(string),string&&(guard||chars===undefined))return string.replace(reTrim,"");if(!string||!(chars=baseToString(chars)))return string;var strSymbols=stringToArray(string),chrSymbols=stringToArray(chars),start=charsStartIndex(strSymbols,chrSymbols),end=charsEndIndex(strSymbols,chrSymbols)+1;return castSlice(strSymbols,start,end).join("")}function constant(value){return function(){return value}}function identity(value){return value}function iteratee(func){return baseIteratee("function"==typeof func?func:baseClone(func,CLONE_DEEP_FLAG))}function matches(source){return baseMatches(baseClone(source,CLONE_DEEP_FLAG))}function mixin(object,source,options){var props=keys(source),methodNames=baseFunctions(source,props);null!=options||isObject(source)&&(methodNames.length||!props.length)||(options=source,source=object,object=this,methodNames=baseFunctions(source,keys(source)));var chain=!(isObject(options)&&"chain"in options&&!options.chain),isFunc=isFunction(object);return arrayEach(methodNames,function(methodName){var func=source[methodName];object[methodName]=func,isFunc&&(object.prototype[methodName]=function(){var chainAll=this.__chain__;if(chain||chainAll){var result=object(this.__wrapped__),actions=result.__actions__=copyArray(this.__actions__);return actions.push({func:func,args:arguments,thisArg:object}),result.__chain__=chainAll,result}return func.apply(object,arrayPush([this.value()],arguments))})}),object}function noConflict(){return root._===this&&(root._=oldDash),this}function noop(){}function property(path){return isKey(path)?baseProperty(toKey(path)):basePropertyDeep(path)}function stubArray(){return[]}function stubFalse(){return!1}function uniqueId(prefix){var id=++idCounter;return toString(prefix)+id}function max(array){return array&&array.length?baseExtremum(array,identity,baseGt):undefined}function min(array){return array&&array.length?baseExtremum(array,identity,baseLt):undefined}var undefined,VERSION="4.17.5",LARGE_ARRAY_SIZE=200,FUNC_ERROR_TEXT="Expected a function",HASH_UNDEFINED="__lodash_hash_undefined__",MAX_MEMOIZE_SIZE=500,PLACEHOLDER="__lodash_placeholder__",CLONE_DEEP_FLAG=1,CLONE_FLAT_FLAG=2,CLONE_SYMBOLS_FLAG=4,COMPARE_PARTIAL_FLAG=1,COMPARE_UNORDERED_FLAG=2,WRAP_BIND_FLAG=1,WRAP_BIND_KEY_FLAG=2,WRAP_CURRY_BOUND_FLAG=4,WRAP_CURRY_FLAG=8,WRAP_CURRY_RIGHT_FLAG=16,WRAP_PARTIAL_FLAG=32,WRAP_PARTIAL_RIGHT_FLAG=64,WRAP_ARY_FLAG=128,WRAP_REARG_FLAG=256,WRAP_FLIP_FLAG=512,HOT_COUNT=800,HOT_SPAN=16,LAZY_FILTER_FLAG=1,LAZY_MAP_FLAG=2,LAZY_WHILE_FLAG=3,INFINITY=1/0,MAX_SAFE_INTEGER=9007199254740991,MAX_INTEGER=1.7976931348623157e308,NAN=NaN,MAX_ARRAY_LENGTH=4294967295,wrapFlags=[["ary",WRAP_ARY_FLAG],["bind",WRAP_BIND_FLAG],["bindKey",WRAP_BIND_KEY_FLAG],["curry",WRAP_CURRY_FLAG],["curryRight",WRAP_CURRY_RIGHT_FLAG],["flip",WRAP_FLIP_FLAG],["partial",WRAP_PARTIAL_FLAG],["partialRight",WRAP_PARTIAL_RIGHT_FLAG],["rearg",WRAP_REARG_FLAG]],argsTag="[object Arguments]",arrayTag="[object Array]",asyncTag="[object AsyncFunction]",boolTag="[object Boolean]",dateTag="[object Date]",errorTag="[object Error]",funcTag="[object Function]",genTag="[object GeneratorFunction]",mapTag="[object Map]",numberTag="[object Number]",nullTag="[object Null]",objectTag="[object Object]",promiseTag="[object Promise]",proxyTag="[object Proxy]",regexpTag="[object RegExp]",setTag="[object Set]",stringTag="[object String]",symbolTag="[object Symbol]",undefinedTag="[object Undefined]",weakMapTag="[object WeakMap]",arrayBufferTag="[object ArrayBuffer]",dataViewTag="[object DataView]",float32Tag="[object Float32Array]",float64Tag="[object Float64Array]",int8Tag="[object Int8Array]",int16Tag="[object Int16Array]",int32Tag="[object Int32Array]",uint8Tag="[object Uint8Array]",uint8ClampedTag="[object Uint8ClampedArray]",uint16Tag="[object Uint16Array]",uint32Tag="[object Uint32Array]",reUnescapedHtml=/[&<>"']/g,reHasUnescapedHtml=RegExp(reUnescapedHtml.source),reIsDeepProp=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,reIsPlainProp=/^\w*$/,rePropName=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,reRegExpChar=/[\\^$.*+?()[\]{}|]/g,reTrim=/^\s+|\s+$/g,reWrapComment=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,reWrapDetails=/\{\n\/\* \[wrapped with (.+)\] \*/,reSplitDetails=/,? & /,reEscapeChar=/\\(\\)?/g,reFlags=/\w*$/,reIsBadHex=/^[-+]0x[0-9a-f]+$/i,reIsBinary=/^0b[01]+$/i,reIsHostCtor=/^\[object .+?Constructor\]$/,reIsOctal=/^0o[0-7]+$/i,reIsUint=/^(?:0|[1-9]\d*)$/,rsAstralRange="\\ud800-\\udfff",rsComboMarksRange="\\u0300-\\u036f",reComboHalfMarksRange="\\ufe20-\\ufe2f",rsComboSymbolsRange="\\u20d0-\\u20ff",rsComboRange=rsComboMarksRange+reComboHalfMarksRange+rsComboSymbolsRange,rsVarRange="\\ufe0e\\ufe0f",rsAstral="["+rsAstralRange+"]",rsCombo="["+rsComboRange+"]",rsFitz="\\ud83c[\\udffb-\\udfff]",rsModifier="(?:"+rsCombo+"|"+rsFitz+")",rsNonAstral="[^"+rsAstralRange+"]",rsRegional="(?:\\ud83c[\\udde6-\\uddff]){2}",rsSurrPair="[\\ud800-\\udbff][\\udc00-\\udfff]",rsZWJ="\\u200d",reOptMod=rsModifier+"?",rsOptVar="["+rsVarRange+"]?",rsOptJoin="(?:"+rsZWJ+"(?:"+[rsNonAstral,rsRegional,rsSurrPair].join("|")+")"+rsOptVar+reOptMod+")*",rsSeq=rsOptVar+reOptMod+rsOptJoin,rsSymbol="(?:"+[rsNonAstral+rsCombo+"?",rsCombo,rsRegional,rsSurrPair,rsAstral].join("|")+")",reUnicode=RegExp(rsFitz+"(?="+rsFitz+")|"+rsSymbol+rsSeq,"g"),reHasUnicode=RegExp("["+rsZWJ+rsAstralRange+rsComboRange+rsVarRange+"]"),typedArrayTags={};typedArrayTags[float32Tag]=typedArrayTags[float64Tag]=typedArrayTags[int8Tag]=typedArrayTags[int16Tag]=typedArrayTags[int32Tag]=typedArrayTags[uint8Tag]=typedArrayTags[uint8ClampedTag]=typedArrayTags[uint16Tag]=typedArrayTags[uint32Tag]=!0,typedArrayTags[argsTag]=typedArrayTags[arrayTag]=typedArrayTags[arrayBufferTag]=typedArrayTags[boolTag]=typedArrayTags[dataViewTag]=typedArrayTags[dateTag]=typedArrayTags[errorTag]=typedArrayTags[funcTag]=typedArrayTags[mapTag]=typedArrayTags[numberTag]=typedArrayTags[objectTag]=typedArrayTags[regexpTag]=typedArrayTags[setTag]=typedArrayTags[stringTag]=typedArrayTags[weakMapTag]=!1;var cloneableTags={};cloneableTags[argsTag]=cloneableTags[arrayTag]=cloneableTags[arrayBufferTag]=cloneableTags[dataViewTag]=cloneableTags[boolTag]=cloneableTags[dateTag]=cloneableTags[float32Tag]=cloneableTags[float64Tag]=cloneableTags[int8Tag]=cloneableTags[int16Tag]=cloneableTags[int32Tag]=cloneableTags[mapTag]=cloneableTags[numberTag]=cloneableTags[objectTag]=cloneableTags[regexpTag]=cloneableTags[setTag]=cloneableTags[stringTag]=cloneableTags[symbolTag]=cloneableTags[uint8Tag]=cloneableTags[uint8ClampedTag]=cloneableTags[uint16Tag]=cloneableTags[uint32Tag]=!0,cloneableTags[errorTag]=cloneableTags[funcTag]=cloneableTags[weakMapTag]=!1;var htmlEscapes={"&":"&","<":"<",">":">",'"':""","'":"'"},freeParseFloat=parseFloat,freeParseInt=parseInt,freeGlobal="object"==typeof global&&global&&global.Object===Object&&global,freeSelf="object"==typeof self&&self&&self.Object===Object&&self,root=freeGlobal||freeSelf||Function("return this")(),freeExports="object"==typeof exports&&exports&&!exports.nodeType&&exports,freeModule=freeExports&&"object"==typeof module&&module&&!module.nodeType&&module,moduleExports=freeModule&&freeModule.exports===freeExports,freeProcess=moduleExports&&freeGlobal.process,nodeUtil=function(){try{return freeProcess&&freeProcess.binding&&freeProcess.binding("util")}catch(e){}}(),nodeIsDate=nodeUtil&&nodeUtil.isDate,nodeIsMap=nodeUtil&&nodeUtil.isMap,nodeIsRegExp=nodeUtil&&nodeUtil.isRegExp,nodeIsSet=nodeUtil&&nodeUtil.isSet,nodeIsTypedArray=nodeUtil&&nodeUtil.isTypedArray,asciiSize=baseProperty("length"),escapeHtmlChar=basePropertyOf(htmlEscapes),arrayProto=Array.prototype,funcProto=Function.prototype,objectProto=Object.prototype,coreJsData=root["__core-js_shared__"],funcToString=funcProto.toString,hasOwnProperty=objectProto.hasOwnProperty,idCounter=0,maskSrcKey=function(){var uid=/[^.]+$/.exec(coreJsData&&coreJsData.keys&&coreJsData.keys.IE_PROTO||"");return uid?"Symbol(src)_1."+uid:""}(),nativeObjectToString=objectProto.toString,objectCtorString=funcToString.call(Object),oldDash=root._,reIsNative=RegExp("^"+funcToString.call(hasOwnProperty).replace(reRegExpChar,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Buffer=moduleExports?root.Buffer:undefined,Symbol=root.Symbol,Uint8Array=root.Uint8Array,allocUnsafe=Buffer?Buffer.allocUnsafe:undefined,getPrototype=overArg(Object.getPrototypeOf,Object),objectCreate=Object.create,propertyIsEnumerable=objectProto.propertyIsEnumerable,splice=arrayProto.splice,spreadableSymbol=Symbol?Symbol.isConcatSpreadable:undefined,symIterator=Symbol?Symbol.iterator:undefined,symToStringTag=Symbol?Symbol.toStringTag:undefined,defineProperty=function(){try{var func=getNative(Object,"defineProperty");return func({},"",{}),func}catch(e){}}(),nativeCeil=Math.ceil,nativeFloor=Math.floor,nativeGetSymbols=Object.getOwnPropertySymbols,nativeIsBuffer=Buffer?Buffer.isBuffer:undefined,nativeIsFinite=root.isFinite,nativeKeys=overArg(Object.keys,Object),nativeMax=Math.max,nativeMin=Math.min,nativeNow=Date.now,nativeRandom=Math.random,nativeReverse=arrayProto.reverse,DataView=getNative(root,"DataView"),Map=getNative(root,"Map"),Promise=getNative(root,"Promise"),Set=getNative(root,"Set"),WeakMap=getNative(root,"WeakMap"),nativeCreate=getNative(Object,"create"),metaMap=WeakMap&&new WeakMap,realNames={},dataViewCtorString=toSource(DataView),mapCtorString=toSource(Map),promiseCtorString=toSource(Promise),setCtorString=toSource(Set),weakMapCtorString=toSource(WeakMap),symbolProto=Symbol?Symbol.prototype:undefined,symbolValueOf=symbolProto?symbolProto.valueOf:undefined,symbolToString=symbolProto?symbolProto.toString:undefined,baseCreate=function(){function object(){}return function(proto){if(!isObject(proto))return{};if(objectCreate)return objectCreate(proto);object.prototype=proto;var result=new object;return object.prototype=undefined,result}}();lodash.prototype=baseLodash.prototype,lodash.prototype.constructor=lodash,LodashWrapper.prototype=baseCreate(baseLodash.prototype),LodashWrapper.prototype.constructor=LodashWrapper,LazyWrapper.prototype=baseCreate(baseLodash.prototype),LazyWrapper.prototype.constructor=LazyWrapper,Hash.prototype.clear=hashClear,Hash.prototype["delete"]=hashDelete,Hash.prototype.get=hashGet,Hash.prototype.has=hashHas,Hash.prototype.set=hashSet,ListCache.prototype.clear=listCacheClear,ListCache.prototype["delete"]=listCacheDelete,ListCache.prototype.get=listCacheGet,ListCache.prototype.has=listCacheHas,ListCache.prototype.set=listCacheSet,MapCache.prototype.clear=mapCacheClear,MapCache.prototype["delete"]=mapCacheDelete,MapCache.prototype.get=mapCacheGet,MapCache.prototype.has=mapCacheHas,MapCache.prototype.set=mapCacheSet,SetCache.prototype.add=SetCache.prototype.push=setCacheAdd,SetCache.prototype.has=setCacheHas,Stack.prototype.clear=stackClear,Stack.prototype["delete"]=stackDelete,Stack.prototype.get=stackGet,Stack.prototype.has=stackHas,Stack.prototype.set=stackSet;var baseEach=createBaseEach(baseForOwn),baseFor=createBaseFor(),baseForRight=createBaseFor(!0),baseSetData=metaMap?function(func,data){return metaMap.set(func,data),func}:identity,baseSetToString=defineProperty?function(func,string){return defineProperty(func,"toString",{configurable:!0,enumerable:!1,value:constant(string),writable:!0})}:identity,createSet=Set&&1/setToArray(new Set([,-0]))[1]==INFINITY?function(values){return new Set(values)}:noop,getData=metaMap?function(func){return metaMap.get(func)}:noop,getSymbols=nativeGetSymbols?function(object){return null==object?[]:(object=Object(object),arrayFilter(nativeGetSymbols(object),function(symbol){return propertyIsEnumerable.call(object,symbol)}))}:stubArray,getSymbolsIn=nativeGetSymbols?function(object){for(var result=[];object;)arrayPush(result,getSymbols(object)),object=getPrototype(object);return result}:stubArray,getTag=baseGetTag;(DataView&&getTag(new DataView(new ArrayBuffer(1)))!=dataViewTag||Map&&getTag(new Map)!=mapTag||Promise&&getTag(Promise.resolve())!=promiseTag||Set&&getTag(new Set)!=setTag||WeakMap&&getTag(new WeakMap)!=weakMapTag)&&(getTag=function(value){var result=baseGetTag(value),Ctor=result==objectTag?value.constructor:undefined,ctorString=Ctor?toSource(Ctor):"";if(ctorString)switch(ctorString){case dataViewCtorString:return dataViewTag;case mapCtorString:return mapTag;case promiseCtorString:return promiseTag;case setCtorString:return setTag;case weakMapCtorString:return weakMapTag}return result});var setData=shortOut(baseSetData),setToString=shortOut(baseSetToString),stringToPath=memoizeCapped(function(string){var result=[];return 46===string.charCodeAt(0)&&result.push(""),string.replace(rePropName,function(match,number,quote,subString){result.push(quote?subString.replace(reEscapeChar,"$1"):number||match)}),result}),difference=baseRest(function(array,values){return isArrayLikeObject(array)?baseDifference(array,baseFlatten(values,1,isArrayLikeObject,!0)):[]}),intersection=baseRest(function(arrays){var mapped=arrayMap(arrays,castArrayLikeObject);return mapped.length&&mapped[0]===arrays[0]?baseIntersection(mapped):[]}),union=baseRest(function(arrays){return baseUniq(baseFlatten(arrays,1,isArrayLikeObject,!0))}),without=baseRest(function(array,values){return isArrayLikeObject(array)?baseDifference(array,values):[]}),zip=baseRest(unzip),wrapperAt=flatRest(function(paths){var length=paths.length,start=length?paths[0]:0,value=this.__wrapped__,interceptor=function(object){return baseAt(object,paths)};return!(length>1||this.__actions__.length)&&value instanceof LazyWrapper&&isIndex(start)?(value=value.slice(start,+start+(length?1:0)),value.__actions__.push({func:thru,args:[interceptor],thisArg:undefined}),new LodashWrapper(value,this.__chain__).thru(function(array){return length&&!array.length&&array.push(undefined),array})):this.thru(interceptor)}),countBy=createAggregator(function(result,value,key){hasOwnProperty.call(result,key)?++result[key]:baseAssignValue(result,key,1)}),find=createFind(findIndex),groupBy=createAggregator(function(result,value,key){hasOwnProperty.call(result,key)?result[key].push(value):baseAssignValue(result,key,[value])}),sortBy=baseRest(function(collection,iteratees){if(null==collection)return[];var length=iteratees.length;return length>1&&isIterateeCall(collection,iteratees[0],iteratees[1])?iteratees=[]:length>2&&isIterateeCall(iteratees[0],iteratees[1],iteratees[2])&&(iteratees=[iteratees[0]]),baseOrderBy(collection,baseFlatten(iteratees,1),[])}),now=function(){return root.Date.now()},bind=baseRest(function(func,thisArg,partials){var bitmask=WRAP_BIND_FLAG;if(partials.length){var holders=replaceHolders(partials,getHolder(bind));bitmask|=WRAP_PARTIAL_FLAG}return createWrap(func,bitmask,thisArg,partials,holders)}),defer=baseRest(function(func,args){return baseDelay(func,1,args)}),delay=baseRest(function(func,wait,args){return baseDelay(func,toNumber(wait)||0,args)});memoize.Cache=MapCache;var isArguments=baseIsArguments(function(){return arguments}())?baseIsArguments:function(value){return isObjectLike(value)&&hasOwnProperty.call(value,"callee")&&!propertyIsEnumerable.call(value,"callee")},isArray=Array.isArray,isBuffer=nativeIsBuffer||stubFalse,isDate=nodeIsDate?baseUnary(nodeIsDate):baseIsDate,isMap=nodeIsMap?baseUnary(nodeIsMap):baseIsMap,isRegExp=nodeIsRegExp?baseUnary(nodeIsRegExp):baseIsRegExp,isSet=nodeIsSet?baseUnary(nodeIsSet):baseIsSet,isTypedArray=nodeIsTypedArray?baseUnary(nodeIsTypedArray):baseIsTypedArray,assignIn=createAssigner(function(object,source){copyObject(source,keysIn(source),object)}),defaults=baseRest(function(object,sources){object=Object(object);var index=-1,length=sources.length,guard=length>2?sources[2]:undefined;for(guard&&isIterateeCall(sources[0],sources[1],guard)&&(length=1);++index1),path}),copyObject(object,getAllKeysIn(object),result),isDeep&&(result=baseClone(result,CLONE_DEEP_FLAG|CLONE_FLAT_FLAG|CLONE_SYMBOLS_FLAG,customOmitClone));for(var length=paths.length;length--;)baseUnset(result,paths[length]);return result}),pick=flatRest(function(object,paths){return null==object?{}:basePick(object,paths)}),range=createRange();lodash.assignIn=assignIn,lodash.before=before,lodash.bind=bind,lodash.chain=chain,lodash.compact=compact,lodash.concat=concat,lodash.countBy=countBy,lodash.create=create,lodash.debounce=debounce,lodash.defaults=defaults,lodash.defaultsDeep=defaultsDeep,lodash.defer=defer,lodash.delay=delay,lodash.difference=difference,lodash.drop=drop,lodash.filter=filter,lodash.flatten=flatten,lodash.flattenDeep=flattenDeep,lodash.groupBy=groupBy,lodash.initial=initial,lodash.intersection=intersection,lodash.invert=invert,lodash.invertBy=invertBy,lodash.iteratee=iteratee,lodash.keys=keys,lodash.map=map,lodash.matches=matches,lodash.merge=merge,lodash.mixin=mixin,lodash.negate=negate,lodash.omit=omit,lodash.omitBy=omitBy,lodash.once=once,lodash.pick=pick,lodash.range=range,lodash.reject=reject,lodash.rest=rest,lodash.slice=slice,lodash.sortBy=sortBy,lodash.take=take,lodash.takeRight=takeRight,lodash.tap=tap,lodash.throttle=throttle,lodash.thru=thru,lodash.toArray=toArray,lodash.union=union,lodash.uniq=uniq,lodash.uniqBy=uniqBy,lodash.unzip=unzip,lodash.values=values,lodash.without=without,lodash.zip=zip,lodash.zipObject=zipObject,lodash.extend=assignIn,mixin(lodash,lodash),lodash.clamp=clamp,lodash.clone=clone,lodash.cloneDeep=cloneDeep,lodash.escape=escape,lodash.every=every,lodash.find=find,lodash.findIndex=findIndex,lodash.findKey=findKey,lodash.findLastIndex=findLastIndex,lodash.findLastKey=findLastKey,lodash.forEach=forEach,lodash.get=get,lodash.has=has,lodash.head=head,lodash.identity=identity,lodash.indexOf=indexOf,lodash.isArguments=isArguments,lodash.isArray=isArray,lodash.isArrayLike=isArrayLike,lodash.isBoolean=isBoolean,lodash.isDate=isDate,lodash.isEmpty=isEmpty,lodash.isEqual=isEqual,lodash.isFinite=isFinite,lodash.isFunction=isFunction,lodash.isNaN=isNaN,lodash.isNull=isNull,lodash.isNumber=isNumber,lodash.isObject=isObject,lodash.isPlainObject=isPlainObject,lodash.isRegExp=isRegExp,lodash.isString=isString,lodash.isUndefined=isUndefined,lodash.last=last,lodash.max=max,lodash.min=min,lodash.noConflict=noConflict,lodash.noop=noop,lodash.random=random,lodash.reduce=reduce,lodash.result=result,lodash.size=size,lodash.some=some,lodash.trim=trim,lodash.uniqueId=uniqueId,lodash.each=forEach,lodash.first=head,mixin(lodash,function(){var source={};return baseForOwn(lodash,function(func,methodName){hasOwnProperty.call(lodash.prototype,methodName)||(source[methodName]=func)}),source}(),{chain:!1}),lodash.VERSION=VERSION,arrayEach(["drop","take"],function(methodName,index){LazyWrapper.prototype[methodName]=function(n){n=n===undefined?1:nativeMax(toInteger(n),0);var result=this.__filtered__&&!index?new LazyWrapper(this):this.clone();return result.__filtered__?result.__takeCount__=nativeMin(n,result.__takeCount__):result.__views__.push({size:nativeMin(n,MAX_ARRAY_LENGTH),type:methodName+(result.__dir__<0?"Right":"")}),result},LazyWrapper.prototype[methodName+"Right"]=function(n){return this.reverse()[methodName](n).reverse()}}),arrayEach(["filter","map","takeWhile"],function(methodName,index){var type=index+1,isFilter=type==LAZY_FILTER_FLAG||type==LAZY_WHILE_FLAG;LazyWrapper.prototype[methodName]=function(iteratee){var result=this.clone();return result.__iteratees__.push({iteratee:getIteratee(iteratee,3),type:type}),result.__filtered__=result.__filtered__||isFilter,result}}),arrayEach(["head","last"],function(methodName,index){var takeName="take"+(index?"Right":"");LazyWrapper.prototype[methodName]=function(){return this[takeName](1).value()[0]}}),arrayEach(["initial","tail"],function(methodName,index){var dropName="drop"+(index?"":"Right");LazyWrapper.prototype[methodName]=function(){return this.__filtered__?new LazyWrapper(this):this[dropName](1)}}),LazyWrapper.prototype.compact=function(){return this.filter(identity)},LazyWrapper.prototype.find=function(predicate){return this.filter(predicate).head()},LazyWrapper.prototype.findLast=function(predicate){return this.reverse().find(predicate)},LazyWrapper.prototype.invokeMap=baseRest(function(path,args){return"function"==typeof path?new LazyWrapper(this):this.map(function(value){return baseInvoke(value,path,args)})}),LazyWrapper.prototype.reject=function(predicate){return this.filter(negate(getIteratee(predicate)))},LazyWrapper.prototype.slice=function(start,end){start=toInteger(start);var result=this;return result.__filtered__&&(start>0||end<0)?new LazyWrapper(result):(start<0?result=result.takeRight(-start):start&&(result=result.drop(start)),end!==undefined&&(end=toInteger(end),result=end<0?result.dropRight(-end):result.take(end-start)),result)},LazyWrapper.prototype.takeRightWhile=function(predicate){return this.reverse().takeWhile(predicate).reverse()},LazyWrapper.prototype.toArray=function(){return this.take(MAX_ARRAY_LENGTH)},baseForOwn(LazyWrapper.prototype,function(func,methodName){var checkIteratee=/^(?:filter|find|map|reject)|While$/.test(methodName),isTaker=/^(?:head|last)$/.test(methodName),lodashFunc=lodash[isTaker?"take"+("last"==methodName?"Right":""):methodName],retUnwrapped=isTaker||/^find/.test(methodName);lodashFunc&&(lodash.prototype[methodName]=function(){var value=this.__wrapped__,args=isTaker?[1]:arguments,isLazy=value instanceof LazyWrapper,iteratee=args[0],useLazy=isLazy||isArray(value),interceptor=function(value){var result=lodashFunc.apply(lodash,arrayPush([value],args));return isTaker&&chainAll?result[0]:result};useLazy&&checkIteratee&&"function"==typeof iteratee&&1!=iteratee.length&&(isLazy=useLazy=!1);var chainAll=this.__chain__,isHybrid=!!this.__actions__.length,isUnwrapped=retUnwrapped&&!chainAll,onlyLazy=isLazy&&!isHybrid;if(!retUnwrapped&&useLazy){value=onlyLazy?value:new LazyWrapper(this);var result=func.apply(value,args);return result.__actions__.push({func:thru,args:[interceptor],thisArg:undefined}),new LodashWrapper(result,chainAll)}return isUnwrapped&&onlyLazy?func.apply(this,args):(result=this.thru(interceptor),isUnwrapped?isTaker?result.value()[0]:result.value():result)})}),arrayEach(["pop","push","shift","sort","splice","unshift"],function(methodName){var func=arrayProto[methodName],chainName=/^(?:push|sort|unshift)$/.test(methodName)?"tap":"thru",retUnwrapped=/^(?:pop|shift)$/.test(methodName);lodash.prototype[methodName]=function(){var args=arguments;if(retUnwrapped&&!this.__chain__){var value=this.value();return func.apply(isArray(value)?value:[],args)}return this[chainName](function(value){return func.apply(isArray(value)?value:[],args)})}}),baseForOwn(LazyWrapper.prototype,function(func,methodName){var lodashFunc=lodash[methodName];if(lodashFunc){var key=lodashFunc.name+"",names=realNames[key]||(realNames[key]=[]);names.push({name:methodName,func:lodashFunc})}}),realNames[createHybrid(undefined,WRAP_BIND_KEY_FLAG).name]=[{name:"wrapper",func:undefined}],LazyWrapper.prototype.clone=lazyClone,LazyWrapper.prototype.reverse=lazyReverse,LazyWrapper.prototype.value=lazyValue,lodash.prototype.first=lodash.prototype.head,symIterator&&(lodash.prototype[symIterator]=wrapperToIterator),"function"==typeof define&&"object"==typeof define.amd&&define.amd?(root._=lodash,define(function(){return lodash})):freeModule?((freeModule.exports=lodash)._=lodash,freeExports._=lodash):root._=lodash}.call(this);var _global;_global="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,_global.BI||(_global.BI={}),!function(undefined){var traverse=function(func,context){return function(value,key,obj){return func.call(context,key,value,obj); +}},_apply=function(name){return function(){return _[name].apply(_,arguments)}},_applyFunc=function(name){return function(){var args=Array.prototype.slice.call(arguments,0);return args[1]=_.isFunction(args[1])?traverse(args[1],args[2]):args[1],_[name].apply(_,args)}};_.extend(BI,{assert:function(v,is){if(this.isFunction(is)){if(is(v))return!0;throw new Error(v+" error")}if(this.isArray(is)||(is=[is]),!this.deepContains(is,v))throw new Error(v+" error")},warn:function(message){console.warn(message)},UUID:function(){for(var f=["0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f"],str="",i=0;i<16;i++){var r=parseInt(f.length*Math.random(),10);str+=f[r]}return str},isWidget:function(widget){return widget instanceof BI.Widget||BI.View&&widget instanceof BI.View},createWidgets:function(items,options,context){if(!BI.isArray(items))throw new Error("cannot create Widgets");return BI.isWidget(options)?(context=options,options={}):options||(options={}),BI.map(BI.flatten(items),function(i,item){return BI.createWidget(item,BI.deepClone(options))})},createItems:function(data,innerAttr,outerAttr){return innerAttr=BI.isArray(innerAttr)?innerAttr:BI.makeArray(BI.flatten(data).length,innerAttr||{}),outerAttr=BI.isArray(outerAttr)?outerAttr:BI.makeArray(BI.flatten(data).length,outerAttr||{}),BI.map(data,function(i,item){return BI.isArray(item)?BI.createItems(item,innerAttr,outerAttr):item instanceof BI.Widget?BI.extend({},innerAttr.shift(),outerAttr.shift(),{type:null,el:item}):innerAttr[0]instanceof BI.Widget?(outerAttr.shift(),BI.extend({},item,{el:innerAttr.shift()})):item.el instanceof BI.Widget||BI.View&&item.el instanceof BI.View?(innerAttr.shift(),BI.extend({},outerAttr.shift(),{type:null},item)):item.el?BI.extend({},outerAttr.shift(),item,{el:BI.extend({},innerAttr.shift(),item.el)}):BI.extend({},outerAttr.shift(),{el:BI.extend({},innerAttr.shift(),item)})})},packageItems:function(items,layouts){for(var i=layouts.length-1;i>=0;i--)items=BI.map(items,function(k,it){return BI.extend({},layouts[i],{items:[BI.extend({},layouts[i].el,{el:it})]})});return items},formatEL:function(obj){return obj&&!obj.type&&obj.el?obj:{el:obj}},stripEL:function(obj){return obj.type&&obj||obj.el||obj},trans2Element:function(widgets){return BI.map(widgets,function(i,wi){return wi.element})}}),_.each(["where","findWhere","invoke","pluck","shuffle","sample","toArray","size"],function(name){BI[name]=_apply(name)}),_.each(["get","each","map","reduce","reduceRight","find","filter","reject","every","all","some","any","max","min","sortBy","groupBy","indexBy","countBy","partition","clamp"],function(name){"any"===name?BI[name]=_applyFunc("some"):BI[name]=_applyFunc(name)}),_.extend(BI,{count:function(from,to,predicate){var t;if(predicate)for(t=from;t=0;index--)predicate(index,obj[index],obj);return!1},backAny:function(obj,predicate,context){predicate=BI.iteratee(predicate,context);for(var index=obj.length-1;index>=0;index--)if(predicate(index,obj[index],obj))return!0;return!1},backEvery:function(obj,predicate,context){predicate=BI.iteratee(predicate,context);for(var index=obj.length-1;index>=0;index--)if(!predicate(index,obj[index],obj))return!1;return!0},backFindKey:function(obj,predicate,context){predicate=BI.iteratee(predicate,context);for(var keys=_.keys(obj),key,i=keys.length-1;i>=0;i--)if(key=keys[i],predicate(obj[key],key,obj))return key},backFind:function(obj,predicate,context){var key;if(key=BI.isArray(obj)?BI.findLastIndex(obj,predicate,context):BI.backFindKey(obj,predicate,context),void 0!==key&&key!==-1)return obj[key]},remove:function(obj,target,context){var isFunction=BI.isFunction(target);target=isFunction||BI.isArray(target)?target:[target];var i;if(BI.isArray(obj))for(i=0;i(2147483646-str.charAt(i).charCodeAt(0)+start.charCodeAt(0))/26)return 0;return idx},int2Abc:function(num){var DIGITS=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"],idx=num,str="";if(0===num)return"";for(;0!==idx;){var t=idx%26;0===t&&(t=26),str=DIGITS[t-1]+str,idx=(idx-t)/26}return str}}),_.each(["first","initial","last","rest","compact","flatten","without","union","intersection","difference","zip","unzip","object","indexOf","lastIndexOf","sortedIndex","range","take","takeRight","uniqBy"],function(name){BI[name]=_apply(name)}),_.each(["findIndex","findLastIndex"],function(name){BI[name]=_applyFunc(name)}),_.extend(BI,{makeArray:function(length,value){for(var res=[],i=0;i0;)BI.prepares.shift()()},has:function(obj,keys){return BI.isArray(keys)?0!==keys.length&&BI.every(keys,function(i,key){return _.has(obj,key)}):_.has.apply(_,arguments)},freeze:function(value){return Object.freeze&&BI.isObject(value)?Object.freeze(value):value},isKey:function(key){return BI.isNumber(key)||BI.isString(key)&&key.length>0},isCapitalEqual:function(a,b){return a=BI.isNull(a)?a:(""+a).toLowerCase(),b=BI.isNull(b)?b:(""+b).toLowerCase(),BI.isEqual(a,b)},isWidthOrHeight:function(w){return"number"==typeof w?w>=0:"string"==typeof w?/^\d{1,3}%$/.exec(w)||"auto"==w||/^\d+px$/.exec(w):void 0},isNotNull:function(obj){return!BI.isNull(obj)},isNull:function(obj){return"undefined"==typeof obj||null===obj},isEmptyArray:function(arr){return BI.isArray(arr)&&BI.isEmpty(arr)},isNotEmptyArray:function(arr){return BI.isArray(arr)&&!BI.isEmpty(arr)},isEmptyObject:function(obj){return BI.isEqual(obj,{})},isNotEmptyObject:function(obj){return BI.isPlainObject(obj)&&!BI.isEmptyObject(obj)},isEmptyString:function(obj){return BI.isString(obj)&&0===obj.length},isNotEmptyString:function(obj){return BI.isString(obj)&&!BI.isEmptyString(obj)},isWindow:function(obj){return null!=obj&&obj==obj.window}}),_.extend(BI,{deepClone:_.cloneDeep,deepExtend:_.merge,isDeepMatch:function(object,attrs){var keys=BI.keys(attrs),length=keys.length;if(null==object)return!length;for(var obj=Object(object),i=0;i=0},deepContains:function(obj,copy){return BI.isObject(copy)?BI.any(obj,function(i,v){if(BI.isEqual(v,copy))return!0}):BI.contains(obj,copy)},deepIndexOf:function(obj,target){for(var i=0;imaxDate[0]?back=["y",1]:YY>=minDate[0]&&YY<=maxDate[0]&&(YY==minDate[0]&&(MMmaxDate[1]?back=["m",1]:MM==maxDate[1]&&DD>maxDate[2]&&(back=["d",1]))),back},checkDateLegal:function(str){var ar=str.match(/\d+/g),YY=0|ar[0],MM=0|ar[1],DD=0|ar[2];if(ar.length<=1)return!0;if(ar.length<=2)return MM>=1&&MM<=12;var MD=BI.Date._MD.slice(0);return MD[1]=BI.isLeapYear(YY)?29:28,MM>=1&&MM<=12&&DD<=MD[MM-1]},parseDateTime:function(str,fmt){var today=BI.getDate(),y=0,m=0,d=1,a=str.split(/\W+/);if("%y%x"==fmt.toLowerCase()||"%y%x%d"==fmt.toLowerCase()){var yearlength=4,otherlength=2;a[0]=str.substring(0,yearlength),a[1]=str.substring(yearlength,yearlength+otherlength),a[2]=str.substring(yearlength+otherlength,yearlength+2*otherlength)}var b=fmt.match(/%./g),i=0,j=0,hr=0,min=0,sec=0;for(i=0;i29?1900:2e3);break;case"%b":case"%B":for(j=0;j<12;++j)if(BI.Date._MN[j].substr(0,a[i].length).toLowerCase()==a[i].toLowerCase()){m=j;break}break;case"%H":case"%I":case"%k":case"%l":hr=parseInt(a[i],10);break;case"%P":case"%p":/pm/i.test(a[i])&&hr<12?hr+=12:/am/i.test(a[i])&&hr>=12&&(hr-=12);break;case"%M":min=parseInt(a[i],10);case"%S":sec=parseInt(a[i],10)}if(isNaN(y)&&(y=today.getFullYear()),isNaN(m)&&(m=today.getMonth()),isNaN(d)&&(d=today.getDate()),isNaN(hr)&&(hr=today.getHours()),isNaN(min)&&(min=today.getMinutes()),isNaN(sec)&&(sec=today.getSeconds()),0!=y)return BI.getDate(y,m,d,hr,min,sec);for(y=0,m=-1,d=0,i=0;i31&&0==y?(y=parseInt(a[i],10),y<100&&(y+=y>29?1900:2e3)):0==d&&(d=a[i]);return 0==y&&(y=today.getFullYear()),m!=-1&&0!=d?BI.getDate(y,m,d,hr,min,sec):today},getDate:function(){var length=arguments.length,args=arguments,dt;switch(length){case 0:dt=new Date;break;case 1:dt=new Date(args[0]);break;case 2:dt=new Date(args[0],args[1]);break;case 3:dt=new Date(args[0],args[1],args[2]);break;case 4:dt=new Date(args[0],args[1],args[2],args[3]);break;case 5:dt=new Date(args[0],args[1],args[2],args[3],args[4]);break;case 6:dt=new Date(args[0],args[1],args[2],args[3],args[4],args[5]);break;case 7:dt=new Date(args[0],args[1],args[2],args[3],args[4],args[5],args[6]);break;default:dt=new Date}if(BI.isNotNull(BI.timeZone)&&(0===arguments.length||1===arguments.length&&BI.isNumber(arguments[0]))){var localTime=dt.getTime(),localOffset=6e4*dt.getTimezoneOffset(),utc=localTime+localOffset;return new Date(utc+BI.timeZone)}return dt},getTime:function(){var length=arguments.length,args=arguments,dt;switch(length){case 0:dt=new Date;break;case 1:dt=new Date(args[0]);break;case 2:dt=new Date(args[0],args[1]);break;case 3:dt=new Date(args[0],args[1],args[2]);break;case 4:dt=new Date(args[0],args[1],args[2],args[3]);break;case 5:dt=new Date(args[0],args[1],args[2],args[3],args[4]);break;case 6:dt=new Date(args[0],args[1],args[2],args[3],args[4],args[5]);break;case 7:dt=new Date(args[0],args[1],args[2],args[3],args[4],args[5],args[6]);break;default:dt=new Date}return BI.isNotNull(BI.timeZone)?dt.getTime()-BI.timeZone-6e4*(new Date).getTimezoneOffset():dt.getTime()}})}(),!function(){function extend(){for(var target=arguments[0]||{},length=arguments.length,i=1,options,name,src,copy;i0;)BI.prepares.shift()();var el,w;if(item||(item={}),BI.isWidget(options)?(context=options,options={}):options||(options={}),BI.isEmpty(item)&&BI.isEmpty(options))return BI.createWidget({type:"bi.layout"});if(BI.isWidget(item))return item;if(item.type||options.type)return el=BI.extend({},options,item),w=BI.Plugin.getWidget(el.type,el),w.listeners=(w.listeners||[]).concat([{eventName:BI.Events.MOUNT,action:function(){BI.Plugin.getObject(el.type,this)}}]),w.type===el.type?createWidget(w):BI.createWidget(BI.extend({},item,{type:w.type},options));if(item.el&&(item.el.type||options.type))return el=BI.extend({},options,item.el),w=BI.Plugin.getWidget(el.type,el),w.listeners=(w.listeners||[]).concat([{eventName:BI.Events.MOUNT,action:function(){BI.Plugin.getObject(el.type,this)}}]),w.type===el.type?createWidget(w):BI.createWidget(BI.extend({},item,{type:w.type},options));if(BI.isWidget(item.el))return item.el;throw new Error("无法根据item创建组件")},BI.createElement=function(){var widget=BI.createWidget.apply(this,arguments);return widget.element}}(),!function(){BI.CRYPT_TYPE=BI.CRYPT_TYPE||{},BI.CRYPT_TYPE.AES="aes";var CryptoJS=CryptoJS||function(Math,undefined){var C={},C_lib=C.lib={},Base=C_lib.Base=function(){function F(){}return{extend:function(overrides){F.prototype=this;var subtype=new F;return overrides&&subtype.mixIn(overrides),subtype.hasOwnProperty("init")||(subtype.init=function(){subtype.$super.init.apply(this,arguments)}),subtype.init.prototype=subtype,subtype.$super=this,subtype},create:function(){var instance=this.extend();return instance.init.apply(instance,arguments),instance},init:function(){},mixIn:function(properties){for(var propertyName in properties)properties.hasOwnProperty(propertyName)&&(this[propertyName]=properties[propertyName]);properties.hasOwnProperty("toString")&&(this.toString=properties.toString)},clone:function(){return this.init.prototype.extend(this)}}}(),WordArray=C_lib.WordArray=Base.extend({init:function(words,sigBytes){words=this.words=words||[],sigBytes!=undefined?this.sigBytes=sigBytes:this.sigBytes=4*words.length},toString:function(encoder){return(encoder||Hex).stringify(this)},concat:function(wordArray){var thisWords=this.words,thatWords=wordArray.words,thisSigBytes=this.sigBytes,thatSigBytes=wordArray.sigBytes;if(this.clamp(),thisSigBytes%4)for(var i=0;i>>2]>>>24-i%4*8&255;thisWords[thisSigBytes+i>>>2]|=thatByte<<24-(thisSigBytes+i)%4*8}else if(thatWords.length>65535)for(var i=0;i>>2]=thatWords[i>>>2];else thisWords.push.apply(thisWords,thatWords);return this.sigBytes+=thatSigBytes,this},clamp:function(){var words=this.words,sigBytes=this.sigBytes;words[sigBytes>>>2]&=4294967295<<32-sigBytes%4*8,words.length=Math.ceil(sigBytes/4); +},clone:function(){var clone=Base.clone.call(this);return clone.words=this.words.slice(0),clone},random:function(nBytes){for(var words=[],i=0;i>>2]>>>24-i%4*8&255;hexChars.push((bite>>>4).toString(16)),hexChars.push((15&bite).toString(16))}return hexChars.join("")},parse:function(hexStr){for(var hexStrLength=hexStr.length,words=[],i=0;i>>3]|=parseInt(hexStr.substr(i,2),16)<<24-i%8*4;return new WordArray.init(words,hexStrLength/2)}},Latin1=C_enc.Latin1={stringify:function(wordArray){for(var words=wordArray.words,sigBytes=wordArray.sigBytes,latin1Chars=[],i=0;i>>2]>>>24-i%4*8&255;latin1Chars.push(String.fromCharCode(bite))}return latin1Chars.join("")},parse:function(latin1Str){for(var latin1StrLength=latin1Str.length,words=[],i=0;i>>2]|=(255&latin1Str.charCodeAt(i))<<24-i%4*8;return new WordArray.init(words,latin1StrLength)}},Utf8=C_enc.Utf8={stringify:function(wordArray){try{return decodeURIComponent(escape(Latin1.stringify(wordArray)))}catch(e){throw new Error("Malformed UTF-8 data")}},parse:function(utf8Str){return Latin1.parse(unescape(encodeURIComponent(utf8Str)))}},BufferedBlockAlgorithm=C_lib.BufferedBlockAlgorithm=Base.extend({reset:function(){this._data=new WordArray.init,this._nDataBytes=0},_append:function(data){"string"==typeof data&&(data=Utf8.parse(data)),this._data.concat(data),this._nDataBytes+=data.sigBytes},_process:function(doFlush){var data=this._data,dataWords=data.words,dataSigBytes=data.sigBytes,blockSize=this.blockSize,blockSizeBytes=4*blockSize,nBlocksReady=dataSigBytes/blockSizeBytes;nBlocksReady=doFlush?Math.ceil(nBlocksReady):Math.max((0|nBlocksReady)-this._minBufferSize,0);var nWordsReady=nBlocksReady*blockSize,nBytesReady=Math.min(4*nWordsReady,dataSigBytes);if(nWordsReady){for(var offset=0;offset>>2]>>>24-i%4*8&255,byte2=words[i+1>>>2]>>>24-(i+1)%4*8&255,byte3=words[i+2>>>2]>>>24-(i+2)%4*8&255,triplet=byte1<<16|byte2<<8|byte3,j=0;j<4&&i+.75*j>>6*(3-j)&63));var paddingChar=map.charAt(64);if(paddingChar)for(;base64Chars.length%4;)base64Chars.push(paddingChar);return base64Chars.join("")},parse:function(base64Str){var base64StrLength=base64Str.length,map=this._map,paddingChar=map.charAt(64);if(paddingChar){var paddingIndex=base64Str.indexOf(paddingChar);paddingIndex!=-1&&(base64StrLength=paddingIndex)}for(var words=[],nBytes=0,i=0;i>>6-i%4*2;words[nBytes>>>2]|=(bits1|bits2)<<24-nBytes%4*8,nBytes++}return WordArray.create(words,nBytes)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="}}(),function(Math){function FF(a,b,c,d,x,s,t){var n=a+(b&c|~b&d)+x+t;return(n<>>32-s)+b}function GG(a,b,c,d,x,s,t){var n=a+(b&d|c&~d)+x+t;return(n<>>32-s)+b}function HH(a,b,c,d,x,s,t){var n=a+(b^c^d)+x+t;return(n<>>32-s)+b}function II(a,b,c,d,x,s,t){var n=a+(c^(b|~d))+x+t;return(n<>>32-s)+b}var C=CryptoJS,C_lib=C.lib,WordArray=C_lib.WordArray,Hasher=C_lib.Hasher,C_algo=C.algo,T=[];!function(){for(var i=0;i<64;i++)T[i]=4294967296*Math.abs(Math.sin(i+1))|0}();var MD5=C_algo.MD5=Hasher.extend({_doReset:function(){this._hash=new WordArray.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(M,offset){for(var i=0;i<16;i++){var offset_i=offset+i,M_offset_i=M[offset_i];M[offset_i]=16711935&(M_offset_i<<8|M_offset_i>>>24)|4278255360&(M_offset_i<<24|M_offset_i>>>8)}var H=this._hash.words,M_offset_0=M[offset+0],M_offset_1=M[offset+1],M_offset_2=M[offset+2],M_offset_3=M[offset+3],M_offset_4=M[offset+4],M_offset_5=M[offset+5],M_offset_6=M[offset+6],M_offset_7=M[offset+7],M_offset_8=M[offset+8],M_offset_9=M[offset+9],M_offset_10=M[offset+10],M_offset_11=M[offset+11],M_offset_12=M[offset+12],M_offset_13=M[offset+13],M_offset_14=M[offset+14],M_offset_15=M[offset+15],a=H[0],b=H[1],c=H[2],d=H[3];a=FF(a,b,c,d,M_offset_0,7,T[0]),d=FF(d,a,b,c,M_offset_1,12,T[1]),c=FF(c,d,a,b,M_offset_2,17,T[2]),b=FF(b,c,d,a,M_offset_3,22,T[3]),a=FF(a,b,c,d,M_offset_4,7,T[4]),d=FF(d,a,b,c,M_offset_5,12,T[5]),c=FF(c,d,a,b,M_offset_6,17,T[6]),b=FF(b,c,d,a,M_offset_7,22,T[7]),a=FF(a,b,c,d,M_offset_8,7,T[8]),d=FF(d,a,b,c,M_offset_9,12,T[9]),c=FF(c,d,a,b,M_offset_10,17,T[10]),b=FF(b,c,d,a,M_offset_11,22,T[11]),a=FF(a,b,c,d,M_offset_12,7,T[12]),d=FF(d,a,b,c,M_offset_13,12,T[13]),c=FF(c,d,a,b,M_offset_14,17,T[14]),b=FF(b,c,d,a,M_offset_15,22,T[15]),a=GG(a,b,c,d,M_offset_1,5,T[16]),d=GG(d,a,b,c,M_offset_6,9,T[17]),c=GG(c,d,a,b,M_offset_11,14,T[18]),b=GG(b,c,d,a,M_offset_0,20,T[19]),a=GG(a,b,c,d,M_offset_5,5,T[20]),d=GG(d,a,b,c,M_offset_10,9,T[21]),c=GG(c,d,a,b,M_offset_15,14,T[22]),b=GG(b,c,d,a,M_offset_4,20,T[23]),a=GG(a,b,c,d,M_offset_9,5,T[24]),d=GG(d,a,b,c,M_offset_14,9,T[25]),c=GG(c,d,a,b,M_offset_3,14,T[26]),b=GG(b,c,d,a,M_offset_8,20,T[27]),a=GG(a,b,c,d,M_offset_13,5,T[28]),d=GG(d,a,b,c,M_offset_2,9,T[29]),c=GG(c,d,a,b,M_offset_7,14,T[30]),b=GG(b,c,d,a,M_offset_12,20,T[31]),a=HH(a,b,c,d,M_offset_5,4,T[32]),d=HH(d,a,b,c,M_offset_8,11,T[33]),c=HH(c,d,a,b,M_offset_11,16,T[34]),b=HH(b,c,d,a,M_offset_14,23,T[35]),a=HH(a,b,c,d,M_offset_1,4,T[36]),d=HH(d,a,b,c,M_offset_4,11,T[37]),c=HH(c,d,a,b,M_offset_7,16,T[38]),b=HH(b,c,d,a,M_offset_10,23,T[39]),a=HH(a,b,c,d,M_offset_13,4,T[40]),d=HH(d,a,b,c,M_offset_0,11,T[41]),c=HH(c,d,a,b,M_offset_3,16,T[42]),b=HH(b,c,d,a,M_offset_6,23,T[43]),a=HH(a,b,c,d,M_offset_9,4,T[44]),d=HH(d,a,b,c,M_offset_12,11,T[45]),c=HH(c,d,a,b,M_offset_15,16,T[46]),b=HH(b,c,d,a,M_offset_2,23,T[47]),a=II(a,b,c,d,M_offset_0,6,T[48]),d=II(d,a,b,c,M_offset_7,10,T[49]),c=II(c,d,a,b,M_offset_14,15,T[50]),b=II(b,c,d,a,M_offset_5,21,T[51]),a=II(a,b,c,d,M_offset_12,6,T[52]),d=II(d,a,b,c,M_offset_3,10,T[53]),c=II(c,d,a,b,M_offset_10,15,T[54]),b=II(b,c,d,a,M_offset_1,21,T[55]),a=II(a,b,c,d,M_offset_8,6,T[56]),d=II(d,a,b,c,M_offset_15,10,T[57]),c=II(c,d,a,b,M_offset_6,15,T[58]),b=II(b,c,d,a,M_offset_13,21,T[59]),a=II(a,b,c,d,M_offset_4,6,T[60]),d=II(d,a,b,c,M_offset_11,10,T[61]),c=II(c,d,a,b,M_offset_2,15,T[62]),b=II(b,c,d,a,M_offset_9,21,T[63]),H[0]=H[0]+a|0,H[1]=H[1]+b|0,H[2]=H[2]+c|0,H[3]=H[3]+d|0},_doFinalize:function(){var data=this._data,dataWords=data.words,nBitsTotal=8*this._nDataBytes,nBitsLeft=8*data.sigBytes;dataWords[nBitsLeft>>>5]|=128<<24-nBitsLeft%32;var nBitsTotalH=Math.floor(nBitsTotal/4294967296),nBitsTotalL=nBitsTotal;dataWords[(nBitsLeft+64>>>9<<4)+15]=16711935&(nBitsTotalH<<8|nBitsTotalH>>>24)|4278255360&(nBitsTotalH<<24|nBitsTotalH>>>8),dataWords[(nBitsLeft+64>>>9<<4)+14]=16711935&(nBitsTotalL<<8|nBitsTotalL>>>24)|4278255360&(nBitsTotalL<<24|nBitsTotalL>>>8),data.sigBytes=4*(dataWords.length+1),this._process();for(var hash=this._hash,H=hash.words,i=0;i<4;i++){var H_i=H[i];H[i]=16711935&(H_i<<8|H_i>>>24)|4278255360&(H_i<<24|H_i>>>8)}return hash},clone:function(){var clone=Hasher.clone.call(this);return clone._hash=this._hash.clone(),clone}});C.MD5=Hasher._createHelper(MD5),C.HmacMD5=Hasher._createHmacHelper(MD5)}(Math),function(){var C=CryptoJS,C_lib=C.lib,Base=C_lib.Base,WordArray=C_lib.WordArray,C_algo=C.algo,MD5=C_algo.MD5,EvpKDF=C_algo.EvpKDF=Base.extend({cfg:Base.extend({keySize:4,hasher:MD5,iterations:1}),init:function(cfg){this.cfg=this.cfg.extend(cfg)},compute:function(password,salt){for(var cfg=this.cfg,hasher=cfg.hasher.create(),derivedKey=WordArray.create(),derivedKeyWords=derivedKey.words,keySize=cfg.keySize,iterations=cfg.iterations;derivedKeyWords.length>>2];data.sigBytes-=nPaddingBytes}},BlockCipher=C_lib.BlockCipher=Cipher.extend({cfg:Cipher.cfg.extend({mode:CBC,padding:Pkcs7}),reset:function(){Cipher.reset.call(this);var cfg=this.cfg,iv=cfg.iv,mode=cfg.mode;if(this._xformMode==this._ENC_XFORM_MODE)var modeCreator=mode.createEncryptor;else{var modeCreator=mode.createDecryptor;this._minBufferSize=1}this._mode=modeCreator.call(mode,this,iv&&iv.words)},_doProcessBlock:function(words,offset){this._mode.processBlock(words,offset)},_doFinalize:function(){var padding=this.cfg.padding;if(this._xformMode==this._ENC_XFORM_MODE){padding.pad(this._data,this.blockSize);var finalProcessedBlocks=this._process(!0)}else{var finalProcessedBlocks=this._process(!0);padding.unpad(finalProcessedBlocks)}return finalProcessedBlocks},blockSize:4}),CipherParams=C_lib.CipherParams=Base.extend({init:function(cipherParams){this.mixIn(cipherParams)},toString:function(formatter){return(formatter||this.formatter).stringify(this)}}),C_format=C.format={},OpenSSLFormatter=C_format.OpenSSL={stringify:function(cipherParams){var ciphertext=cipherParams.ciphertext,salt=cipherParams.salt;if(salt)var wordArray=WordArray.create([1398893684,1701076831]).concat(salt).concat(ciphertext);else var wordArray=ciphertext;return wordArray.toString(Base64)},parse:function(openSSLStr){var ciphertext=Base64.parse(openSSLStr),ciphertextWords=ciphertext.words;if(1398893684==ciphertextWords[0]&&1701076831==ciphertextWords[1]){var salt=WordArray.create(ciphertextWords.slice(2,4));ciphertextWords.splice(0,4),ciphertext.sigBytes-=16}return CipherParams.create({ciphertext:ciphertext,salt:salt})}},SerializableCipher=C_lib.SerializableCipher=Base.extend({cfg:Base.extend({format:OpenSSLFormatter}),encrypt:function(cipher,message,key,cfg){cfg=this.cfg.extend(cfg);var encryptor=cipher.createEncryptor(key,cfg),ciphertext=encryptor.finalize(message),cipherCfg=encryptor.cfg;return CipherParams.create({ciphertext:ciphertext,key:key,iv:cipherCfg.iv,algorithm:cipher,mode:cipherCfg.mode,padding:cipherCfg.padding,blockSize:cipher.blockSize,formatter:cfg.format})},decrypt:function(cipher,ciphertext,key,cfg){cfg=this.cfg.extend(cfg),ciphertext=this._parse(ciphertext,cfg.format);var plaintext=cipher.createDecryptor(key,cfg).finalize(ciphertext.ciphertext);return plaintext},_parse:function(ciphertext,format){return"string"==typeof ciphertext?format.parse(ciphertext,this):ciphertext}}),C_kdf=C.kdf={},OpenSSLKdf=C_kdf.OpenSSL={execute:function(password,keySize,ivSize,salt){salt||(salt=WordArray.random(8));var key=EvpKDF.create({keySize:keySize+ivSize}).compute(password,salt),iv=WordArray.create(key.words.slice(keySize),4*ivSize);return key.sigBytes=4*keySize,CipherParams.create({key:key,iv:iv,salt:salt})}},PasswordBasedCipher=C_lib.PasswordBasedCipher=SerializableCipher.extend({cfg:SerializableCipher.cfg.extend({kdf:OpenSSLKdf}),encrypt:function(cipher,message,password,cfg){cfg=this.cfg.extend(cfg);var derivedParams=cfg.kdf.execute(password,cipher.keySize,cipher.ivSize);cfg.iv=derivedParams.iv;var ciphertext=SerializableCipher.encrypt.call(this,cipher,message,derivedParams.key,cfg);return ciphertext.mixIn(derivedParams),ciphertext},decrypt:function(cipher,ciphertext,password,cfg){cfg=this.cfg.extend(cfg),ciphertext=this._parse(ciphertext,cfg.format);var derivedParams=cfg.kdf.execute(password,cipher.keySize,cipher.ivSize,ciphertext.salt);cfg.iv=derivedParams.iv;var plaintext=SerializableCipher.decrypt.call(this,cipher,ciphertext,derivedParams.key,cfg);return plaintext}})}(),CryptoJS.mode.ECB=function(){var ECB=CryptoJS.lib.BlockCipherMode.extend();return ECB.Encryptor=ECB.extend({processBlock:function(words,offset){this._cipher.encryptBlock(words,offset)}}),ECB.Decryptor=ECB.extend({processBlock:function(words,offset){this._cipher.decryptBlock(words,offset)}}),ECB}(),function(){var C=CryptoJS,C_lib=C.lib,BlockCipher=C_lib.BlockCipher,C_algo=C.algo,SBOX=[],INV_SBOX=[],SUB_MIX_0=[],SUB_MIX_1=[],SUB_MIX_2=[],SUB_MIX_3=[],INV_SUB_MIX_0=[],INV_SUB_MIX_1=[],INV_SUB_MIX_2=[],INV_SUB_MIX_3=[];!function(){for(var d=[],i=0;i<256;i++)i<128?d[i]=i<<1:d[i]=i<<1^283;for(var x=0,xi=0,i=0;i<256;i++){var sx=xi^xi<<1^xi<<2^xi<<3^xi<<4;sx=sx>>>8^255&sx^99,SBOX[x]=sx,INV_SBOX[sx]=x;var x2=d[x],x4=d[x2],x8=d[x4],t=257*d[sx]^16843008*sx;SUB_MIX_0[x]=t<<24|t>>>8,SUB_MIX_1[x]=t<<16|t>>>16,SUB_MIX_2[x]=t<<8|t>>>24,SUB_MIX_3[x]=t;var t=16843009*x8^65537*x4^257*x2^16843008*x;INV_SUB_MIX_0[sx]=t<<24|t>>>8,INV_SUB_MIX_1[sx]=t<<16|t>>>16,INV_SUB_MIX_2[sx]=t<<8|t>>>24,INV_SUB_MIX_3[sx]=t,x?(x=x2^d[d[d[x8^x2]]],xi^=d[d[xi]]):x=xi=1}}();var RCON=[0,1,2,4,8,16,32,64,128,27,54],AES=C_algo.AES=BlockCipher.extend({_doReset:function(){for(var key=this._key,keyWords=key.words,keySize=key.sigBytes/4,nRounds=this._nRounds=keySize+6,ksRows=4*(nRounds+1),keySchedule=this._keySchedule=[],ksRow=0;ksRow6&&ksRow%keySize==4&&(t=SBOX[t>>>24]<<24|SBOX[t>>>16&255]<<16|SBOX[t>>>8&255]<<8|SBOX[255&t]):(t=t<<8|t>>>24,t=SBOX[t>>>24]<<24|SBOX[t>>>16&255]<<16|SBOX[t>>>8&255]<<8|SBOX[255&t],t^=RCON[ksRow/keySize|0]<<24),keySchedule[ksRow]=keySchedule[ksRow-keySize]^t}for(var invKeySchedule=this._invKeySchedule=[],invKsRow=0;invKsRow>>24]]^INV_SUB_MIX_1[SBOX[t>>>16&255]]^INV_SUB_MIX_2[SBOX[t>>>8&255]]^INV_SUB_MIX_3[SBOX[255&t]]}},encryptBlock:function(M,offset){this._doCryptBlock(M,offset,this._keySchedule,SUB_MIX_0,SUB_MIX_1,SUB_MIX_2,SUB_MIX_3,SBOX)},decryptBlock:function(M,offset){var t=M[offset+1];M[offset+1]=M[offset+3],M[offset+3]=t,this._doCryptBlock(M,offset,this._invKeySchedule,INV_SUB_MIX_0,INV_SUB_MIX_1,INV_SUB_MIX_2,INV_SUB_MIX_3,INV_SBOX);var t=M[offset+1];M[offset+1]=M[offset+3],M[offset+3]=t},_doCryptBlock:function(M,offset,keySchedule,SUB_MIX_0,SUB_MIX_1,SUB_MIX_2,SUB_MIX_3,SBOX){for(var nRounds=this._nRounds,s0=M[offset]^keySchedule[0],s1=M[offset+1]^keySchedule[1],s2=M[offset+2]^keySchedule[2],s3=M[offset+3]^keySchedule[3],ksRow=4,round=1;round>>24]^SUB_MIX_1[s1>>>16&255]^SUB_MIX_2[s2>>>8&255]^SUB_MIX_3[255&s3]^keySchedule[ksRow++],t1=SUB_MIX_0[s1>>>24]^SUB_MIX_1[s2>>>16&255]^SUB_MIX_2[s3>>>8&255]^SUB_MIX_3[255&s0]^keySchedule[ksRow++],t2=SUB_MIX_0[s2>>>24]^SUB_MIX_1[s3>>>16&255]^SUB_MIX_2[s0>>>8&255]^SUB_MIX_3[255&s1]^keySchedule[ksRow++],t3=SUB_MIX_0[s3>>>24]^SUB_MIX_1[s0>>>16&255]^SUB_MIX_2[s1>>>8&255]^SUB_MIX_3[255&s2]^keySchedule[ksRow++];s0=t0,s1=t1,s2=t2,s3=t3}var t0=(SBOX[s0>>>24]<<24|SBOX[s1>>>16&255]<<16|SBOX[s2>>>8&255]<<8|SBOX[255&s3])^keySchedule[ksRow++],t1=(SBOX[s1>>>24]<<24|SBOX[s2>>>16&255]<<16|SBOX[s3>>>8&255]<<8|SBOX[255&s0])^keySchedule[ksRow++],t2=(SBOX[s2>>>24]<<24|SBOX[s3>>>16&255]<<16|SBOX[s0>>>8&255]<<8|SBOX[255&s1])^keySchedule[ksRow++],t3=(SBOX[s3>>>24]<<24|SBOX[s0>>>16&255]<<16|SBOX[s1>>>8&255]<<8|SBOX[255&s2])^keySchedule[ksRow++];M[offset]=t0,M[offset+1]=t1,M[offset+2]=t2,M[offset+3]=t3},keySize:8});C.AES=BlockCipher._createHelper(AES)}(),_.extend(BI,{aesEncrypt:function(text,key){key=CryptoJS.enc.Utf8.parse(key);var cipher=CryptoJS.AES.encrypt(text,key,{mode:CryptoJS.mode.ECB,padding:CryptoJS.pad.Pkcs7}),base64Cipher=cipher.ciphertext.toString(CryptoJS.enc.Base64);return base64Cipher}})}(),!function(){function aspect(type){return function(target,methodName,advice){var exist=target[methodName],dispatcher;exist&&exist.target==target||(dispatcher=target[methodName]=function(){for(var beforeArr=dispatcher.before,args=arguments,next,l=beforeArr.length;l--;){if(next=beforeArr[l].advice.apply(this,args),next===!1)return!1;args=next||args}for(var rs=dispatcher.method.apply(this,args),afterArr=dispatcher.after,i=0,ii=afterArr.length;i127&&c<2048?(utftext+=String.fromCharCode(c>>6|192),utftext+=String.fromCharCode(63&c|128)):(utftext+=String.fromCharCode(c>>12|224),utftext+=String.fromCharCode(c>>6&63|128),utftext+=String.fromCharCode(63&c|128))}return utftext},_utf8_decode=function(utftext){for(var string="",i=0,c=0,c3=0,c2=0;i191&&c<224?(c2=utftext.charCodeAt(i+1),string+=String.fromCharCode((31&c)<<6|63&c2),i+=2):(c2=utftext.charCodeAt(i+1),c3=utftext.charCodeAt(i+2),string+=String.fromCharCode((15&c)<<12|(63&c2)<<6|63&c3),i+=3);return string};_.extend(BI,{encode:function(input){var output="",chr1,chr2,chr3,enc1,enc2,enc3,enc4,i=0;for(input=_utf8_encode(input);i>2,enc2=(3&chr1)<<4|chr2>>4,enc3=(15&chr2)<<2|chr3>>6,enc4=63&chr3,isNaN(chr2)?enc3=enc4=64:isNaN(chr3)&&(enc4=64),output=output+_keyStr.charAt(enc1)+_keyStr.charAt(enc2)+_keyStr.charAt(enc3)+_keyStr.charAt(enc4);return output},decode:function(input){var output="",chr1,chr2,chr3,enc1,enc2,enc3,enc4,i=0;for(input=input.replace(/[^A-Za-z0-9\+\/\=]/g,"");i>4,chr2=(15&enc2)<<4|enc3>>2,chr3=(3&enc3)<<6|enc4,output+=String.fromCharCode(chr1),64!=enc3&&(output+=String.fromCharCode(chr2)),64!=enc4&&(output+=String.fromCharCode(chr3));return output=_utf8_decode(output)}})}(),BI.Cache={_prefix:"bi",setUsername:function(username){localStorage.setItem(BI.Cache._prefix+".username",(username+""||"").toUpperCase())},getUsername:function(){return localStorage.getItem(BI.Cache._prefix+".username")||""},_getKeyPrefix:function(){return BI.Cache.getUsername()+"."+BI.Cache._prefix+"."},_generateKey:function(key){return BI.Cache._getKeyPrefix()+(key||"")},getItem:function(key){return localStorage.getItem(BI.Cache._generateKey(key))},setItem:function(key,value){localStorage.setItem(BI.Cache._generateKey(key),value)},removeItem:function(key){localStorage.removeItem(BI.Cache._generateKey(key))},clear:function(){for(var i=localStorage.length;i>=0;i--){var key=localStorage.key(i);key&&0===key.indexOf(BI.Cache._getKeyPrefix())&&localStorage.removeItem(key)}},keys:function(){for(var result=[],i=localStorage.length;i>=0;i--){var key=localStorage.key(i);if(key){var prefix=BI.Cache._getKeyPrefix();0===key.indexOf(prefix)&&(result[result.length]=key.substring(prefix.length))}}return result},addCookie:function(name,value,path,expiresHours){var cookieString=name+"="+escape(value);if(expiresHours&&expiresHours>0){var date=new Date;date.setTime(BI.getTime()+3600*expiresHours*1e3),cookieString=cookieString+"; expires="+date.toGMTString()}path&&(cookieString=cookieString+"; path="+path),document.cookie=cookieString},getCookie:function(name){var arr,reg=new RegExp("(^| )"+name+"=([^;]*)(;|$)");return(arr=document.cookie.match(reg))?unescape(arr[2]):null},deleteCookie:function(name,path){var date=new Date;date.setTime(BI.getTime()-1e4);var cookieString=name+"=v; expires="+date.toGMTString();path&&(cookieString=cookieString+"; path="+path),document.cookie=cookieString}},BI.CellSizeAndPositionManager=function(cellCount,cellSizeGetter,estimatedCellSize){this._cellSizeGetter=cellSizeGetter,this._cellCount=cellCount,this._estimatedCellSize=estimatedCellSize,this._cellSizeAndPositionData={},this._lastMeasuredIndex=-1},BI.CellSizeAndPositionManager.prototype={constructor:BI.CellSizeAndPositionManager,configure:function(cellCount,estimatedCellSize){this._cellCount=cellCount,this._estimatedCellSize=estimatedCellSize},getCellCount:function(){return this._cellCount},getEstimatedCellSize:function(){return this._estimatedCellSize},getLastMeasuredIndex:function(){return this._lastMeasuredIndex},getSizeAndPositionOfCell:function(index){if(!(index<0||index>=this._cellCount)){if(index>this._lastMeasuredIndex){for(var lastMeasuredCellSizeAndPosition=this.getSizeAndPositionOfLastMeasuredCell(),offset=lastMeasuredCellSizeAndPosition.offset+lastMeasuredCellSizeAndPosition.size,i=this._lastMeasuredIndex+1;i<=index;i++){var size=this._cellSizeGetter(i);null==size||isNaN(size)||(this._cellSizeAndPositionData[i]={offset:offset,size:size},offset+=size)}this._lastMeasuredIndex=index}return this._cellSizeAndPositionData[index]}},getSizeAndPositionOfLastMeasuredCell:function(){return this._lastMeasuredIndex>=0?this._cellSizeAndPositionData[this._lastMeasuredIndex]:{offset:0,size:0}},getTotalSize:function(){var lastMeasuredCellSizeAndPosition=this.getSizeAndPositionOfLastMeasuredCell();return lastMeasuredCellSizeAndPosition.offset+lastMeasuredCellSizeAndPosition.size+(this._cellCount-this._lastMeasuredIndex-1)*this._estimatedCellSize},getUpdatedOffsetForIndex:function(align,containerSize,currentOffset,targetIndex){var datum=this.getSizeAndPositionOfCell(targetIndex),maxOffset=datum.offset,minOffset=maxOffset-containerSize+datum.size,idealOffset;switch(align){case"start":idealOffset=maxOffset;break;case"end":idealOffset=minOffset;break;case"center":idealOffset=maxOffset-(containerSize-datum.size)/2;break;default:idealOffset=Math.max(minOffset,Math.min(maxOffset,currentOffset))}var totalSize=this.getTotalSize();return Math.max(0,Math.min(totalSize-containerSize,idealOffset))},getVisibleCellRange:function(containerSize,offset){var totalSize=this.getTotalSize();if(0===totalSize)return{};var maxOffset=offset+containerSize,start=this._findNearestCell(offset),datum=this.getSizeAndPositionOfCell(start);offset=datum.offset+datum.size;for(var stop=start;offsetoffset&&(high=middle-1)}if(low>0)return low-1},_exponentialSearch:function(index,offset){for(var interval=1;index=offset?this._binarySearch(lastMeasuredIndex,0,offset):this._exponentialSearch(lastMeasuredIndex,offset)}}},BI.ScalingCellSizeAndPositionManager=function(cellCount,cellSizeGetter,estimatedCellSize,maxScrollSize){this._cellSizeAndPositionManager=new BI.CellSizeAndPositionManager(cellCount,cellSizeGetter,estimatedCellSize),this._maxScrollSize=maxScrollSize||1e7},BI.ScalingCellSizeAndPositionManager.prototype={constructor:BI.ScalingCellSizeAndPositionManager,configure:function(){this._cellSizeAndPositionManager.configure.apply(this._cellSizeAndPositionManager,arguments)},getCellCount:function(){return this._cellSizeAndPositionManager.getCellCount()},getEstimatedCellSize:function(){return this._cellSizeAndPositionManager.getEstimatedCellSize()},getLastMeasuredIndex:function(){return this._cellSizeAndPositionManager.getLastMeasuredIndex()},getOffsetAdjustment:function(containerSize,offset){var totalSize=this._cellSizeAndPositionManager.getTotalSize(),safeTotalSize=this.getTotalSize(),offsetPercentage=this._getOffsetPercentage(containerSize,offset,safeTotalSize);return Math.round(offsetPercentage*(safeTotalSize-totalSize))},getSizeAndPositionOfCell:function(index){return this._cellSizeAndPositionManager.getSizeAndPositionOfCell(index)},getSizeAndPositionOfLastMeasuredCell:function(){return this._cellSizeAndPositionManager.getSizeAndPositionOfLastMeasuredCell()},getTotalSize:function(){return Math.min(this._maxScrollSize,this._cellSizeAndPositionManager.getTotalSize())},getUpdatedOffsetForIndex:function(align,containerSize,currentOffset,targetIndex){currentOffset=this._safeOffsetToOffset(containerSize,currentOffset);var offset=this._cellSizeAndPositionManager.getUpdatedOffsetForIndex(align,containerSize,currentOffset,targetIndex);return this._offsetToSafeOffset(containerSize,offset)},getVisibleCellRange:function(containerSize,offset){return offset=this._safeOffsetToOffset(containerSize,offset),this._cellSizeAndPositionManager.getVisibleCellRange(containerSize,offset)},resetCell:function(index){this._cellSizeAndPositionManager.resetCell(index)},_getOffsetPercentage:function(containerSize,offset,totalSize){return totalSize<=containerSize?0:offset/(totalSize-containerSize)},_offsetToSafeOffset:function(containerSize,offset){var totalSize=this._cellSizeAndPositionManager.getTotalSize(),safeTotalSize=this.getTotalSize();if(totalSize===safeTotalSize)return offset;var offsetPercentage=this._getOffsetPercentage(containerSize,offset,totalSize);return Math.round(offsetPercentage*(safeTotalSize-containerSize))},_safeOffsetToOffset:function(containerSize,offset){var totalSize=this._cellSizeAndPositionManager.getTotalSize(),safeTotalSize=this.getTotalSize();if(totalSize===safeTotalSize)return offset;var offsetPercentage=this._getOffsetPercentage(containerSize,offset,safeTotalSize);return Math.round(offsetPercentage*(totalSize-containerSize))}},!function(){var _ChineseFirstPY="YDYQSXMWZSSXJBYMGCCZQPSSQBYCDSCDQLDYLYBSSJGYZZJJFKCCLZDHWDWZJLJPFYYNWJJTMYHZWZHFLZPPQHGSCYYYNJQYXXGJHHSDSJNKKTMOMLCRXYPSNQSECCQZGGLLYJLMYZZSECYKYYHQWJSSGGYXYZYJWWKDJHYCHMYXJTLXJYQBYXZLDWRDJRWYSRLDZJPCBZJJBRCFTLECZSTZFXXZHTRQHYBDLYCZSSYMMRFMYQZPWWJJYFCRWFDFZQPYDDWYXKYJAWJFFXYPSFTZYHHYZYSWCJYXSCLCXXWZZXNBGNNXBXLZSZSBSGPYSYZDHMDZBQBZCWDZZYYTZHBTSYYBZGNTNXQYWQSKBPHHLXGYBFMJEBJHHGQTJCYSXSTKZHLYCKGLYSMZXYALMELDCCXGZYRJXSDLTYZCQKCNNJWHJTZZCQLJSTSTBNXBTYXCEQXGKWJYFLZQLYHYXSPSFXLMPBYSXXXYDJCZYLLLSJXFHJXPJBTFFYABYXBHZZBJYZLWLCZGGBTSSMDTJZXPTHYQTGLJSCQFZKJZJQNLZWLSLHDZBWJNCJZYZSQQYCQYRZCJJWYBRTWPYFTWEXCSKDZCTBZHYZZYYJXZCFFZZMJYXXSDZZOTTBZLQWFCKSZSXFYRLNYJMBDTHJXSQQCCSBXYYTSYFBXDZTGBCNSLCYZZPSAZYZZSCJCSHZQYDXLBPJLLMQXTYDZXSQJTZPXLCGLQTZWJBHCTSYJSFXYEJJTLBGXSXJMYJQQPFZASYJNTYDJXKJCDJSZCBARTDCLYJQMWNQNCLLLKBYBZZSYHQQLTWLCCXTXLLZNTYLNEWYZYXCZXXGRKRMTCNDNJTSYYSSDQDGHSDBJGHRWRQLYBGLXHLGTGXBQJDZPYJSJYJCTMRNYMGRZJCZGJMZMGXMPRYXKJNYMSGMZJYMKMFXMLDTGFBHCJHKYLPFMDXLQJJSMTQGZSJLQDLDGJYCALCMZCSDJLLNXDJFFFFJCZFMZFFPFKHKGDPSXKTACJDHHZDDCRRCFQYJKQCCWJDXHWJLYLLZGCFCQDSMLZPBJJPLSBCJGGDCKKDEZSQCCKJGCGKDJTJDLZYCXKLQSCGJCLTFPCQCZGWPJDQYZJJBYJHSJDZWGFSJGZKQCCZLLPSPKJGQJHZZLJPLGJGJJTHJJYJZCZMLZLYQBGJWMLJKXZDZNJQSYZMLJLLJKYWXMKJLHSKJGBMCLYYMKXJQLBMLLKMDXXKWYXYSLMLPSJQQJQXYXFJTJDXMXXLLCXQBSYJBGWYMBGGBCYXPJYGPEPFGDJGBHBNSQJYZJKJKHXQFGQZKFHYGKHDKLLSDJQXPQYKYBNQSXQNSZSWHBSXWHXWBZZXDMNSJBSBKBBZKLYLXGWXDRWYQZMYWSJQLCJXXJXKJEQXSCYETLZHLYYYSDZPAQYZCMTLSHTZCFYZYXYLJSDCJQAGYSLCQLYYYSHMRQQKLDXZSCSSSYDYCJYSFSJBFRSSZQSBXXPXJYSDRCKGJLGDKZJZBDKTCSYQPYHSTCLDJDHMXMCGXYZHJDDTMHLTXZXYLYMOHYJCLTYFBQQXPFBDFHHTKSQHZYYWCNXXCRWHOWGYJLEGWDQCWGFJYCSNTMYTOLBYGWQWESJPWNMLRYDZSZTXYQPZGCWXHNGPYXSHMYQJXZTDPPBFYHZHTJYFDZWKGKZBLDNTSXHQEEGZZYLZMMZYJZGXZXKHKSTXNXXWYLYAPSTHXDWHZYMPXAGKYDXBHNHXKDPJNMYHYLPMGOCSLNZHKXXLPZZLBMLSFBHHGYGYYGGBHSCYAQTYWLXTZQCEZYDQDQMMHTKLLSZHLSJZWFYHQSWSCWLQAZYNYTLSXTHAZNKZZSZZLAXXZWWCTGQQTDDYZTCCHYQZFLXPSLZYGPZSZNGLNDQTBDLXGTCTAJDKYWNSYZLJHHZZCWNYYZYWMHYCHHYXHJKZWSXHZYXLYSKQYSPSLYZWMYPPKBYGLKZHTYXAXQSYSHXASMCHKDSCRSWJPWXSGZJLWWSCHSJHSQNHCSEGNDAQTBAALZZMSSTDQJCJKTSCJAXPLGGXHHGXXZCXPDMMHLDGTYBYSJMXHMRCPXXJZCKZXSHMLQXXTTHXWZFKHCCZDYTCJYXQHLXDHYPJQXYLSYYDZOZJNYXQEZYSQYAYXWYPDGXDDXSPPYZNDLTWRHXYDXZZJHTCXMCZLHPYYYYMHZLLHNXMYLLLMDCPPXHMXDKYCYRDLTXJCHHZZXZLCCLYLNZSHZJZZLNNRLWHYQSNJHXYNTTTKYJPYCHHYEGKCTTWLGQRLGGTGTYGYHPYHYLQYQGCWYQKPYYYTTTTLHYHLLTYTTSPLKYZXGZWGPYDSSZZDQXSKCQNMJJZZBXYQMJRTFFBTKHZKBXLJJKDXJTLBWFZPPTKQTZTGPDGNTPJYFALQMKGXBDCLZFHZCLLLLADPMXDJHLCCLGYHDZFGYDDGCYYFGYDXKSSEBDHYKDKDKHNAXXYBPBYYHXZQGAFFQYJXDMLJCSQZLLPCHBSXGJYNDYBYQSPZWJLZKSDDTACTBXZDYZYPJZQSJNKKTKNJDJGYYPGTLFYQKASDNTCYHBLWDZHBBYDWJRYGKZYHEYYFJMSDTYFZJJHGCXPLXHLDWXXJKYTCYKSSSMTWCTTQZLPBSZDZWZXGZAGYKTYWXLHLSPBCLLOQMMZSSLCMBJCSZZKYDCZJGQQDSMCYTZQQLWZQZXSSFPTTFQMDDZDSHDTDWFHTDYZJYQJQKYPBDJYYXTLJHDRQXXXHAYDHRJLKLYTWHLLRLLRCXYLBWSRSZZSYMKZZHHKYHXKSMDSYDYCJPBZBSQLFCXXXNXKXWYWSDZYQOGGQMMYHCDZTTFJYYBGSTTTYBYKJDHKYXBELHTYPJQNFXFDYKZHQKZBYJTZBXHFDXKDASWTAWAJLDYJSFHBLDNNTNQJTJNCHXFJSRFWHZFMDRYJYJWZPDJKZYJYMPCYZNYNXFBYTFYFWYGDBNZZZDNYTXZEMMQBSQEHXFZMBMFLZZSRXYMJGSXWZJSPRYDJSJGXHJJGLJJYNZZJXHGXKYMLPYYYCXYTWQZSWHWLYRJLPXSLSXMFSWWKLCTNXNYNPSJSZHDZEPTXMYYWXYYSYWLXJQZQXZDCLEEELMCPJPCLWBXSQHFWWTFFJTNQJHJQDXHWLBYZNFJLALKYYJLDXHHYCSTYYWNRJYXYWTRMDRQHWQCMFJDYZMHMYYXJWMYZQZXTLMRSPWWCHAQBXYGZYPXYYRRCLMPYMGKSJSZYSRMYJSNXTPLNBAPPYPYLXYYZKYNLDZYJZCZNNLMZHHARQMPGWQTZMXXMLLHGDZXYHXKYXYCJMFFYYHJFSBSSQLXXNDYCANNMTCJCYPRRNYTYQNYYMBMSXNDLYLYSLJRLXYSXQMLLYZLZJJJKYZZCSFBZXXMSTBJGNXYZHLXNMCWSCYZYFZLXBRNNNYLBNRTGZQYSATSWRYHYJZMZDHZGZDWYBSSCSKXSYHYTXXGCQGXZZSHYXJSCRHMKKBXCZJYJYMKQHZJFNBHMQHYSNJNZYBKNQMCLGQHWLZNZSWXKHLJHYYBQLBFCDSXDLDSPFZPSKJYZWZXZDDXJSMMEGJSCSSMGCLXXKYYYLNYPWWWGYDKZJGGGZGGSYCKNJWNJPCXBJJTQTJWDSSPJXZXNZXUMELPXFSXTLLXCLJXJJLJZXCTPSWXLYDHLYQRWHSYCSQYYBYAYWJJJQFWQCQQCJQGXALDBZZYJGKGXPLTZYFXJLTPADKYQHPMATLCPDCKBMTXYBHKLENXDLEEGQDYMSAWHZMLJTWYGXLYQZLJEEYYBQQFFNLYXRDSCTGJGXYYNKLLYQKCCTLHJLQMKKZGCYYGLLLJDZGYDHZWXPYSJBZKDZGYZZHYWYFQYTYZSZYEZZLYMHJJHTSMQWYZLKYYWZCSRKQYTLTDXWCTYJKLWSQZWBDCQYNCJSRSZJLKCDCDTLZZZACQQZZDDXYPLXZBQJYLZLLLQDDZQJYJYJZYXNYYYNYJXKXDAZWYRDLJYYYRJLXLLDYXJCYWYWNQCCLDDNYYYNYCKCZHXXCCLGZQJGKWPPCQQJYSBZZXYJSQPXJPZBSBDSFNSFPZXHDWZTDWPPTFLZZBZDMYYPQJRSDZSQZSQXBDGCPZSWDWCSQZGMDHZXMWWFYBPDGPHTMJTHZSMMBGZMBZJCFZWFZBBZMQCFMBDMCJXLGPNJBBXGYHYYJGPTZGZMQBQTCGYXJXLWZKYDPDYMGCFTPFXYZTZXDZXTGKMTYBBCLBJASKYTSSQYYMSZXFJEWLXLLSZBQJJJAKLYLXLYCCTSXMCWFKKKBSXLLLLJYXTYLTJYYTDPJHNHNNKBYQNFQYYZBYYESSESSGDYHFHWTCJBSDZZTFDMXHCNJZYMQWSRYJDZJQPDQBBSTJGGFBKJBXTGQHNGWJXJGDLLTHZHHYYYYYYSXWTYYYCCBDBPYPZYCCZYJPZYWCBDLFWZCWJDXXHYHLHWZZXJTCZLCDPXUJCZZZLYXJJTXPHFXWPYWXZPTDZZBDZCYHJHMLXBQXSBYLRDTGJRRCTTTHYTCZWMXFYTWWZCWJWXJYWCSKYBZSCCTZQNHXNWXXKHKFHTSWOCCJYBCMPZZYKBNNZPBZHHZDLSYDDYTYFJPXYNGFXBYQXCBHXCPSXTYZDMKYSNXSXLHKMZXLYHDHKWHXXSSKQYHHCJYXGLHZXCSNHEKDTGZXQYPKDHEXTYKCNYMYYYPKQYYYKXZLTHJQTBYQHXBMYHSQCKWWYLLHCYYLNNEQXQWMCFBDCCMLJGGXDQKTLXKGNQCDGZJWYJJLYHHQTTTNWCHMXCXWHWSZJYDJCCDBQCDGDNYXZTHCQRXCBHZTQCBXWGQWYYBXHMBYMYQTYEXMQKYAQYRGYZSLFYKKQHYSSQYSHJGJCNXKZYCXSBXYXHYYLSTYCXQTHYSMGSCPMMGCCCCCMTZTASMGQZJHKLOSQYLSWTMXSYQKDZLJQQYPLSYCZTCQQPBBQJZCLPKHQZYYXXDTDDTSJCXFFLLCHQXMJLWCJCXTSPYCXNDTJSHJWXDQQJSKXYAMYLSJHMLALYKXCYYDMNMDQMXMCZNNCYBZKKYFLMCHCMLHXRCJJHSYLNMTJZGZGYWJXSRXCWJGJQHQZDQJDCJJZKJKGDZQGJJYJYLXZXXCDQHHHEYTMHLFSBDJSYYSHFYSTCZQLPBDRFRZTZYKYWHSZYQKWDQZRKMSYNBCRXQBJYFAZPZZEDZCJYWBCJWHYJBQSZYWRYSZPTDKZPFPBNZTKLQYHBBZPNPPTYZZYBQNYDCPJMMCYCQMCYFZZDCMNLFPBPLNGQJTBTTNJZPZBBZNJKLJQYLNBZQHKSJZNGGQSZZKYXSHPZSNBCGZKDDZQANZHJKDRTLZLSWJLJZLYWTJNDJZJHXYAYNCBGTZCSSQMNJPJYTYSWXZFKWJQTKHTZPLBHSNJZSYZBWZZZZLSYLSBJHDWWQPSLMMFBJDWAQYZTCJTBNNWZXQXCDSLQGDSDPDZHJTQQPSWLYYJZLGYXYZLCTCBJTKTYCZJTQKBSJLGMGZDMCSGPYNJZYQYYKNXRPWSZXMTNCSZZYXYBYHYZAXYWQCJTLLCKJJTJHGDXDXYQYZZBYWDLWQCGLZGJGQRQZCZSSBCRPCSKYDZNXJSQGXSSJMYDNSTZTPBDLTKZWXQWQTZEXNQCZGWEZKSSBYBRTSSSLCCGBPSZQSZLCCGLLLZXHZQTHCZMQGYZQZNMCOCSZJMMZSQPJYGQLJYJPPLDXRGZYXCCSXHSHGTZNLZWZKJCXTCFCJXLBMQBCZZWPQDNHXLJCTHYZLGYLNLSZZPCXDSCQQHJQKSXZPBAJYEMSMJTZDXLCJYRYYNWJBNGZZTMJXLTBSLYRZPYLSSCNXPHLLHYLLQQZQLXYMRSYCXZLMMCZLTZSDWTJJLLNZGGQXPFSKYGYGHBFZPDKMWGHCXMSGDXJMCJZDYCABXJDLNBCDQYGSKYDQTXDJJYXMSZQAZDZFSLQXYJSJZYLBTXXWXQQZBJZUFBBLYLWDSLJHXJYZJWTDJCZFQZQZZDZSXZZQLZCDZFJHYSPYMPQZMLPPLFFXJJNZZYLSJEYQZFPFZKSYWJJJHRDJZZXTXXGLGHYDXCSKYSWMMZCWYBAZBJKSHFHJCXMHFQHYXXYZFTSJYZFXYXPZLCHMZMBXHZZSXYFYMNCWDABAZLXKTCSHHXKXJJZJSTHYGXSXYYHHHJWXKZXSSBZZWHHHCWTZZZPJXSNXQQJGZYZYWLLCWXZFXXYXYHXMKYYSWSQMNLNAYCYSPMJKHWCQHYLAJJMZXHMMCNZHBHXCLXTJPLTXYJHDYYLTTXFSZHYXXSJBJYAYRSMXYPLCKDUYHLXRLNLLSTYZYYQYGYHHSCCSMZCTZQXKYQFPYYRPFFLKQUNTSZLLZMWWTCQQYZWTLLMLMPWMBZSSTZRBPDDTLQJJBXZCSRZQQYGWCSXFWZLXCCRSZDZMCYGGDZQSGTJSWLJMYMMZYHFBJDGYXCCPSHXNZCSBSJYJGJMPPWAFFYFNXHYZXZYLREMZGZCYZSSZDLLJCSQFNXZKPTXZGXJJGFMYYYSNBTYLBNLHPFZDCYFBMGQRRSSSZXYSGTZRNYDZZCDGPJAFJFZKNZBLCZSZPSGCYCJSZLMLRSZBZZLDLSLLYSXSQZQLYXZLSKKBRXBRBZCYCXZZZEEYFGKLZLYYHGZSGZLFJHGTGWKRAAJYZKZQTSSHJJXDCYZUYJLZYRZDQQHGJZXSSZBYKJPBFRTJXLLFQWJHYLQTYMBLPZDXTZYGBDHZZRBGXHWNJTJXLKSCFSMWLSDQYSJTXKZSCFWJLBXFTZLLJZLLQBLSQMQQCGCZFPBPHZCZJLPYYGGDTGWDCFCZQYYYQYSSCLXZSKLZZZGFFCQNWGLHQYZJJCZLQZZYJPJZZBPDCCMHJGXDQDGDLZQMFGPSYTSDYFWWDJZJYSXYYCZCYHZWPBYKXRYLYBHKJKSFXTZJMMCKHLLTNYYMSYXYZPYJQYCSYCWMTJJKQYRHLLQXPSGTLYYCLJSCPXJYZFNMLRGJJTYZBXYZMSJYJHHFZQMSYXRSZCWTLRTQZSSTKXGQKGSPTGCZNJSJCQCXHMXGGZTQYDJKZDLBZSXJLHYQGGGTHQSZPYHJHHGYYGKGGCWJZZYLCZLXQSFTGZSLLLMLJSKCTBLLZZSZMMNYTPZSXQHJCJYQXYZXZQZCPSHKZZYSXCDFGMWQRLLQXRFZTLYSTCTMJCXJJXHJNXTNRZTZFQYHQGLLGCXSZSJDJLJCYDSJTLNYXHSZXCGJZYQPYLFHDJSBPCCZHJJJQZJQDYBSSLLCMYTTMQTBHJQNNYGKYRQYQMZGCJKPDCGMYZHQLLSLLCLMHOLZGDYYFZSLJCQZLYLZQJESHNYLLJXGJXLYSYYYXNBZLJSSZCQQCJYLLZLTJYLLZLLBNYLGQCHXYYXOXCXQKYJXXXYKLXSXXYQXCYKQXQCSGYXXYQXYGYTQOHXHXPYXXXULCYEYCHZZCBWQBBWJQZSCSZSSLZYLKDESJZWMYMCYTSDSXXSCJPQQSQYLYYZYCMDJDZYWCBTJSYDJKCYDDJLBDJJSODZYSYXQQYXDHHGQQYQHDYXWGMMMAJDYBBBPPBCMUUPLJZSMTXERXJMHQNUTPJDCBSSMSSSTKJTSSMMTRCPLZSZMLQDSDMJMQPNQDXCFYNBFSDQXYXHYAYKQYDDLQYYYSSZBYDSLNTFQTZQPZMCHDHCZCWFDXTMYQSPHQYYXSRGJCWTJTZZQMGWJJTJHTQJBBHWZPXXHYQFXXQYWYYHYSCDYDHHQMNMTMWCPBSZPPZZGLMZFOLLCFWHMMSJZTTDHZZYFFYTZZGZYSKYJXQYJZQBHMBZZLYGHGFMSHPZFZSNCLPBQSNJXZSLXXFPMTYJYGBXLLDLXPZJYZJYHHZCYWHJYLSJEXFSZZYWXKZJLUYDTMLYMQJPWXYHXSKTQJEZRPXXZHHMHWQPWQLYJJQJJZSZCPHJLCHHNXJLQWZJHBMZYXBDHHYPZLHLHLGFWLCHYYTLHJXCJMSCPXSTKPNHQXSRTYXXTESYJCTLSSLSTDLLLWWYHDHRJZSFGXTSYCZYNYHTDHWJSLHTZDQDJZXXQHGYLTZPHCSQFCLNJTCLZPFSTPDYNYLGMJLLYCQHYSSHCHYLHQYQTMZYPBYWRFQYKQSYSLZDQJMPXYYSSRHZJNYWTQDFZBWWTWWRXCWHGYHXMKMYYYQMSMZHNGCEPMLQQMTCWCTMMPXJPJJHFXYYZSXZHTYBMSTSYJTTQQQYYLHYNPYQZLCYZHZWSMYLKFJXLWGXYPJYTYSYXYMZCKTTWLKSMZSYLMPWLZWXWQZSSAQSYXYRHSSNTSRAPXCPWCMGDXHXZDZYFJHGZTTSBJHGYZSZYSMYCLLLXBTYXHBBZJKSSDMALXHYCFYGMQYPJYCQXJLLLJGSLZGQLYCJCCZOTYXMTMTTLLWTGPXYMZMKLPSZZZXHKQYSXCTYJZYHXSHYXZKXLZWPSQPYHJWPJPWXQQYLXSDHMRSLZZYZWTTCYXYSZZSHBSCCSTPLWSSCJCHNLCGCHSSPHYLHFHHXJSXYLLNYLSZDHZXYLSXLWZYKCLDYAXZCMDDYSPJTQJZLNWQPSSSWCTSTSZLBLNXSMNYYMJQBQHRZWTYYDCHQLXKPZWBGQYBKFCMZWPZLLYYLSZYDWHXPSBCMLJBSCGBHXLQHYRLJXYSWXWXZSLDFHLSLYNJLZYFLYJYCDRJLFSYZFSLLCQYQFGJYHYXZLYLMSTDJCYHBZLLNWLXXYGYYHSMGDHXXHHLZZJZXCZZZCYQZFNGWPYLCPKPYYPMCLQKDGXZGGWQBDXZZKZFBXXLZXJTPJPTTBYTSZZDWSLCHZHSLTYXHQLHYXXXYYZYSWTXZKHLXZXZPYHGCHKCFSYHUTJRLXFJXPTZTWHPLYXFCRHXSHXKYXXYHZQDXQWULHYHMJTBFLKHTXCWHJFWJCFPQRYQXCYYYQYGRPYWSGSUNGWCHKZDXYFLXXHJJBYZWTSXXNCYJJYMSWZJQRMHXZWFQSYLZJZGBHYNSLBGTTCSYBYXXWXYHXYYXNSQYXMQYWRGYQLXBBZLJSYLPSYTJZYHYZAWLRORJMKSCZJXXXYXCHDYXRYXXJDTSQFXLYLTSFFYXLMTYJMJUYYYXLTZCSXQZQHZXLYYXZHDNBRXXXJCTYHLBRLMBRLLAXKYLLLJLYXXLYCRYLCJTGJCMTLZLLCYZZPZPCYAWHJJFYBDYYZSMPCKZDQYQPBPCJPDCYZMDPBCYYDYCNNPLMTMLRMFMMGWYZBSJGYGSMZQQQZTXMKQWGXLLPJGZBQCDJJJFPKJKCXBLJMSWMDTQJXLDLPPBXCWRCQFBFQJCZAHZGMYKPHYYHZYKNDKZMBPJYXPXYHLFPNYYGXJDBKXNXHJMZJXSTRSTLDXSKZYSYBZXJLXYSLBZYSLHXJPFXPQNBYLLJQKYGZMCYZZYMCCSLCLHZFWFWYXZMWSXTYNXJHPYYMCYSPMHYSMYDYSHQYZCHMJJMZCAAGCFJBBHPLYZYLXXSDJGXDHKXXTXXNBHRMLYJSLTXMRHNLXQJXYZLLYSWQGDLBJHDCGJYQYCMHWFMJYBMBYJYJWYMDPWHXQLDYGPDFXXBCGJSPCKRSSYZJMSLBZZJFLJJJLGXZGYXYXLSZQYXBEXYXHGCXBPLDYHWETTWWCJMBTXCHXYQXLLXFLYXLLJLSSFWDPZSMYJCLMWYTCZPCHQEKCQBWLCQYDPLQPPQZQFJQDJHYMMCXTXDRMJWRHXCJZYLQXDYYNHYYHRSLSRSYWWZJYMTLTLLGTQCJZYABTCKZCJYCCQLJZQXALMZYHYWLWDXZXQDLLQSHGPJFJLJHJABCQZDJGTKHSSTCYJLPSWZLXZXRWGLDLZRLZXTGSLLLLZLYXXWGDZYGBDPHZPBRLWSXQBPFDWOFMWHLYPCBJCCLDMBZPBZZLCYQXLDOMZBLZWPDWYYGDSTTHCSQSCCRSSSYSLFYBFNTYJSZDFNDPDHDZZMBBLSLCMYFFGTJJQWFTMTPJWFNLBZCMMJTGBDZLQLPYFHYYMJYLSDCHDZJWJCCTLJCLDTLJJCPDDSQDSSZYBNDBJLGGJZXSXNLYCYBJXQYCBYLZCFZPPGKCXZDZFZTJJFJSJXZBNZYJQTTYJYHTYCZHYMDJXTTMPXSPLZCDWSLSHXYPZGTFMLCJTYCBPMGDKWYCYZCDSZZYHFLYCTYGWHKJYYLSJCXGYWJCBLLCSNDDBTZBSCLYZCZZSSQDLLMQYYHFSLQLLXFTYHABXGWNYWYYPLLSDLDLLBJCYXJZMLHLJDXYYQYTDLLLBUGBFDFBBQJZZMDPJHGCLGMJJPGAEHHBWCQXAXHHHZCHXYPHJAXHLPHJPGPZJQCQZGJJZZUZDMQYYBZZPHYHYBWHAZYJHYKFGDPFQSDLZMLJXKXGALXZDAGLMDGXMWZQYXXDXXPFDMMSSYMPFMDMMKXKSYZYSHDZKXSYSMMZZZMSYDNZZCZXFPLSTMZDNMXCKJMZTYYMZMZZMSXHHDCZJEMXXKLJSTLWLSQLYJZLLZJSSDPPMHNLZJCZYHMXXHGZCJMDHXTKGRMXFWMCGMWKDTKSXQMMMFZZYDKMSCLCMPCGMHSPXQPZDSSLCXKYXTWLWJYAHZJGZQMCSNXYYMMPMLKJXMHLMLQMXCTKZMJQYSZJSYSZHSYJZJCDAJZYBSDQJZGWZQQXFKDMSDJLFWEHKZQKJPEYPZYSZCDWYJFFMZZYLTTDZZEFMZLBNPPLPLPEPSZALLTYLKCKQZKGENQLWAGYXYDPXLHSXQQWQCQXQCLHYXXMLYCCWLYMQYSKGCHLCJNSZKPYZKCQZQLJPDMDZHLASXLBYDWQLWDNBQCRYDDZTJYBKBWSZDXDTNPJDTCTQDFXQQMGNXECLTTBKPWSLCTYQLPWYZZKLPYGZCQQPLLKCCYLPQMZCZQCLJSLQZDJXLDDHPZQDLJJXZQDXYZQKZLJCYQDYJPPYPQYKJYRMPCBYMCXKLLZLLFQPYLLLMBSGLCYSSLRSYSQTMXYXZQZFDZUYSYZTFFMZZSMZQHZSSCCMLYXWTPZGXZJGZGSJSGKDDHTQGGZLLBJDZLCBCHYXYZHZFYWXYZYMSDBZZYJGTSMTFXQYXQSTDGSLNXDLRYZZLRYYLXQHTXSRTZNGZXBNQQZFMYKMZJBZYMKBPNLYZPBLMCNQYZZZSJZHJCTZKHYZZJRDYZHNPXGLFZTLKGJTCTSSYLLGZRZBBQZZKLPKLCZYSSUYXBJFPNJZZXCDWXZYJXZZDJJKGGRSRJKMSMZJLSJYWQSKYHQJSXPJZZZLSNSHRNYPZTWCHKLPSRZLZXYJQXQKYSJYCZTLQZYBBYBWZPQDWWYZCYTJCJXCKCWDKKZXSGKDZXWWYYJQYYTCYTDLLXWKCZKKLCCLZCQQDZLQLCSFQCHQHSFSMQZZLNBJJZBSJHTSZDYSJQJPDLZCDCWJKJZZLPYCGMZWDJJBSJQZSYZYHHXJPBJYDSSXDZNCGLQMBTSFSBPDZDLZNFGFJGFSMPXJQLMBLGQCYYXBQKDJJQYRFKZTJDHCZKLBSDZCFJTPLLJGXHYXZCSSZZXSTJYGKGCKGYOQXJPLZPBPGTGYJZGHZQZZLBJLSQFZGKQQJZGYCZBZQTLDXRJXBSXXPZXHYZYCLWDXJJHXMFDZPFZHQHQMQGKSLYHTYCGFRZGNQXCLPDLBZCSCZQLLJBLHBZCYPZZPPDYMZZSGYHCKCPZJGSLJLNSCDSLDLXBMSTLDDFJMKDJDHZLZXLSZQPQPGJLLYBDSZGQLBZLSLKYYHZTTNTJYQTZZPSZQZTLLJTYYLLQLLQYZQLBDZLSLYYZYMDFSZSNHLXZNCZQZPBWSKRFBSYZMTHBLGJPMCZZLSTLXSHTCSYZLZBLFEQHLXFLCJLYLJQCBZLZJHHSSTBRMHXZHJZCLXFNBGXGTQJCZTMSFZKJMSSNXLJKBHSJXNTNLZDNTLMSJXGZJYJCZXYJYJWRWWQNZTNFJSZPZSHZJFYRDJSFSZJZBJFZQZZHZLXFYSBZQLZSGYFTZDCSZXZJBQMSZKJRHYJZCKMJKHCHGTXKXQGLXPXFXTRTYLXJXHDTSJXHJZJXZWZLCQSBTXWXGXTXXHXFTSDKFJHZYJFJXRZSDLLLTQSQQZQWZXSYQTWGWBZCGZLLYZBCLMQQTZHZXZXLJFRMYZFLXYSQXXJKXRMQDZDMMYYBSQBHGZMWFWXGMXLZPYYTGZYCCDXYZXYWGSYJYZNBHPZJSQSYXSXRTFYZGRHZTXSZZTHCBFCLSYXZLZQMZLMPLMXZJXSFLBYZMYQHXJSXRXSQZZZSSLYFRCZJRCRXHHZXQYDYHXSJJHZCXZBTYNSYSXJBQLPXZQPYMLXZKYXLXCJLCYSXXZZLXDLLLJJYHZXGYJWKJRWYHCPSGNRZLFZWFZZNSXGXFLZSXZZZBFCSYJDBRJKRDHHGXJLJJTGXJXXSTJTJXLYXQFCSGSWMSBCTLQZZWLZZKXJMLTMJYHSDDBXGZHDLBMYJFRZFSGCLYJBPMLYSMSXLSZJQQHJZFXGFQFQBPXZGYYQXGZTCQWYLTLGWSGWHRLFSFGZJMGMGBGTJFSYZZGZYZAFLSSPMLPFLCWBJZCLJJMZLPJJLYMQDMYYYFBGYGYZMLYZDXQYXRQQQHSYYYQXYLJTYXFSFSLLGNQCYHYCWFHCCCFXPYLYPLLZYXXXXXKQHHXSHJZCFZSCZJXCPZWHHHHHAPYLQALPQAFYHXDYLUKMZQGGGDDESRNNZLTZGCHYPPYSQJJHCLLJTOLNJPZLJLHYMHEYDYDSQYCDDHGZUNDZCLZYZLLZNTNYZGSLHSLPJJBDGWXPCDUTJCKLKCLWKLLCASSTKZZDNQNTTLYYZSSYSSZZRYLJQKCQDHHCRXRZYDGRGCWCGZQFFFPPJFZYNAKRGYWYQPQXXFKJTSZZXSWZDDFBBXTBGTZKZNPZZPZXZPJSZBMQHKCYXYLDKLJNYPKYGHGDZJXXEAHPNZKZTZCMXCXMMJXNKSZQNMNLWBWWXJKYHCPSTMCSQTZJYXTPCTPDTNNPGLLLZSJLSPBLPLQHDTNJNLYYRSZFFJFQWDPHZDWMRZCCLODAXNSSNYZRESTYJWJYJDBCFXNMWTTBYLWSTSZGYBLJPXGLBOCLHPCBJLTMXZLJYLZXCLTPNCLCKXTPZJSWCYXSFYSZDKNTLBYJCYJLLSTGQCBXRYZXBXKLYLHZLQZLNZCXWJZLJZJNCJHXMNZZGJZZXTZJXYCYYCXXJYYXJJXSSSJSTSSTTPPGQTCSXWZDCSYFPTFBFHFBBLZJCLZZDBXGCXLQPXKFZFLSYLTUWBMQJHSZBMDDBCYSCCLDXYCDDQLYJJWMQLLCSGLJJSYFPYYCCYLTJANTJJPWYCMMGQYYSXDXQMZHSZXPFTWWZQSWQRFKJLZJQQYFBRXJHHFWJJZYQAZMYFRHCYYBYQWLPEXCCZSTYRLTTDMQLYKMBBGMYYJPRKZNPBSXYXBHYZDJDNGHPMFSGMWFZMFQMMBCMZZCJJLCNUXYQLMLRYGQZCYXZLWJGCJCGGMCJNFYZZJHYCPRRCMTZQZXHFQGTJXCCJEAQCRJYHPLQLSZDJRBCQHQDYRHYLYXJSYMHZYDWLDFRYHBPYDTSSCNWBXGLPZMLZZTQSSCPJMXXYCSJYTYCGHYCJWYRXXLFEMWJNMKLLSWTXHYYYNCMMCWJDQDJZGLLJWJRKHPZGGFLCCSCZMCBLTBHBQJXQDSPDJZZGHGLFQYWBZYZJLTSTDHQHCTCBCHFLQMPWDSHYYTQWCNZZJTLBYMBPDYYYXSQKXWYYFLXXNCWCXYPMAELYKKJMZZZBRXYYQJFLJPFHHHYTZZXSGQQMHSPGDZQWBWPJHZJDYSCQWZKTXXSQLZYYMYSDZGRXCKKUJLWPYSYSCSYZLRMLQSYLJXBCXTLWDQZPCYCYKPPPNSXFYZJJRCEMHSZMSXLXGLRWGCSTLRSXBZGBZGZTCPLUJLSLYLYMTXMTZPALZXPXJTJWTCYYZLBLXBZLQMYLXPGHDSLSSDMXMBDZZSXWHAMLCZCPJMCNHJYSNSYGCHSKQMZZQDLLKABLWJXSFMOCDXJRRLYQZKJMYBYQLYHETFJZFRFKSRYXFJTWDSXXSYSQJYSLYXWJHSNLXYYXHBHAWHHJZXWMYLJCSSLKYDZTXBZSYFDXGXZJKHSXXYBSSXDPYNZWRPTQZCZENYGCXQFJYKJBZMLJCMQQXUOXSLYXXLYLLJDZBTYMHPFSTTQQWLHOKYBLZZALZXQLHZWRRQHLSTMYPYXJJXMQSJFNBXYXYJXXYQYLTHYLQYFMLKLJTMLLHSZWKZHLJMLHLJKLJSTLQXYLMBHHLNLZXQJHXCFXXLHYHJJGBYZZKBXSCQDJQDSUJZYYHZHHMGSXCSYMXFEBCQWWRBPYYJQTYZCYQYQQZYHMWFFHGZFRJFCDPXNTQYZPDYKHJLFRZXPPXZDBBGZQSTLGDGYLCQMLCHHMFYWLZYXKJLYPQHSYWMQQGQZMLZJNSQXJQSYJYCBEHSXFSZPXZWFLLBCYYJDYTDTHWZSFJMQQYJLMQXXLLDTTKHHYBFPWTYYSQQWNQWLGWDEBZWCMYGCULKJXTMXMYJSXHYBRWFYMWFRXYQMXYSZTZZTFYKMLDHQDXWYYNLCRYJBLPSXCXYWLSPRRJWXHQYPHTYDNXHHMMYWYTZCSQMTSSCCDALWZTCPQPYJLLQZYJSWXMZZMMYLMXCLMXCZMXMZSQTZPPQQBLPGXQZHFLJJHYTJSRXWZXSCCDLXTYJDCQJXSLQYCLZXLZZXMXQRJMHRHZJBHMFLJLMLCLQNLDXZLLLPYPSYJYSXCQQDCMQJZZXHNPNXZMEKMXHYKYQLXSXTXJYYHWDCWDZHQYYBGYBCYSCFGPSJNZDYZZJZXRZRQJJYMCANYRJTLDPPYZBSTJKXXZYPFDWFGZZRPYMTNGXZQBYXNBUFNQKRJQZMJEGRZGYCLKXZDSKKNSXKCLJSPJYYZLQQJYBZSSQLLLKJXTBKTYLCCDDBLSPPFYLGYDTZJYQGGKQTTFZXBDKTYYHYBBFYTYYBCLPDYTGDHRYRNJSPTCSNYJQHKLLLZSLYDXXWBCJQSPXBPJZJCJDZFFXXBRMLAZHCSNDLBJDSZBLPRZTSWSBXBCLLXXLZDJZSJPYLYXXYFTFFFBHJJXGBYXJPMMMPSSJZJMTLYZJXSWXTYLEDQPJMYGQZJGDJLQJWJQLLSJGJGYGMSCLJJXDTYGJQJQJCJZCJGDZZSXQGSJGGCXHQXSNQLZZBXHSGZXCXYLJXYXYYDFQQJHJFXDHCTXJYRXYSQTJXYEFYYSSYYJXNCYZXFXMSYSZXYYSCHSHXZZZGZZZGFJDLTYLNPZGYJYZYYQZPBXQBDZTZCZYXXYHHSQXSHDHGQHJHGYWSZTMZMLHYXGEBTYLZKQWYTJZRCLEKYSTDBCYKQQSAYXCJXWWGSBHJYZYDHCSJKQCXSWXFLTYNYZPZCCZJQTZWJQDZZZQZLJJXLSBHPYXXPSXSHHEZTXFPTLQYZZXHYTXNCFZYYHXGNXMYWXTZSJPTHHGYMXMXQZXTSBCZYJYXXTYYZYPCQLMMSZMJZZLLZXGXZAAJZYXJMZXWDXZSXZDZXLEYJJZQBHZWZZZQTZPSXZTDSXJJJZNYAZPHXYYSRNQDTHZHYYKYJHDZXZLSWCLYBZYECWCYCRYLCXNHZYDZYDYJDFRJJHTRSQTXYXJRJHOJYNXELXSFSFJZGHPZSXZSZDZCQZBYYKLSGSJHCZSHDGQGXYZGXCHXZJWYQWGYHKSSEQZZNDZFKWYSSTCLZSTSYMCDHJXXYWEYXCZAYDMPXMDSXYBSQMJMZJMTZQLPJYQZCGQHXJHHLXXHLHDLDJQCLDWBSXFZZYYSCHTYTYYBHECXHYKGJPXHHYZJFXHWHBDZFYZBCAPNPGNYDMSXHMMMMAMYNBYJTMPXYYMCTHJBZYFCGTYHWPHFTWZZEZSBZEGPFMTSKFTYCMHFLLHGPZJXZJGZJYXZSBBQSCZZLZCCSTPGXMJSFTCCZJZDJXCYBZLFCJSYZFGSZLYBCWZZBYZDZYPSWYJZXZBDSYUXLZZBZFYGCZXBZHZFTPBGZGEJBSTGKDMFHYZZJHZLLZZGJQZLSFDJSSCBZGPDLFZFZSZYZYZSYGCXSNXXCHCZXTZZLJFZGQSQYXZJQDCCZTQCDXZJYQJQCHXZTDLGSCXZSYQJQTZWLQDQZTQCHQQJZYEZZZPBWKDJFCJPZTYPQYQTTYNLMBDKTJZPQZQZZFPZSBNJLGYJDXJDZZKZGQKXDLPZJTCJDQBXDJQJSTCKNXBXZMSLYJCQMTJQWWCJQNJNLLLHJCWQTBZQYDZCZPZZDZYDDCYZZZCCJTTJFZDPRRTZTJDCQTQZDTJNPLZBCLLCTZSXKJZQZPZLBZRBTJDCXFCZDBCCJJLTQQPLDCGZDBBZJCQDCJWYNLLZYZCCDWLLXWZLXRXNTQQCZXKQLSGDFQTDDGLRLAJJTKUYMKQLLTZYTDYYCZGJWYXDXFRSKSTQTENQMRKQZHHQKDLDAZFKYPBGGPZREBZZYKZZSPEGJXGYKQZZZSLYSYYYZWFQZYLZZLZHWCHKYPQGNPGBLPLRRJYXCCSYYHSFZFYBZYYTGZXYLXCZWXXZJZBLFFLGSKHYJZEYJHLPLLLLCZGXDRZELRHGKLZZYHZLYQSZZJZQLJZFLNBHGWLCZCFJYSPYXZLZLXGCCPZBLLCYBBBBUBBCBPCRNNZCZYRBFSRLDCGQYYQXYGMQZWTZYTYJXYFWTEHZZJYWLCCNTZYJJZDEDPZDZTSYQJHDYMBJNYJZLXTSSTPHNDJXXBYXQTZQDDTJTDYYTGWSCSZQFLSHLGLBCZPHDLYZJYCKWTYTYLBNYTSDSYCCTYSZYYEBHEXHQDTWNYGYCLXTSZYSTQMYGZAZCCSZZDSLZCLZRQXYYELJSBYMXSXZTEMBBLLYYLLYTDQYSHYMRQWKFKBFXNXSBYCHXBWJYHTQBPBSBWDZYLKGZSKYHXQZJXHXJXGNLJKZLYYCDXLFYFGHLJGJYBXQLYBXQPQGZTZPLNCYPXDJYQYDYMRBESJYYHKXXSTMXRCZZYWXYQYBMCLLYZHQYZWQXDBXBZWZMSLPDMYSKFMZKLZCYQYCZLQXFZZYDQZPZYGYJYZMZXDZFYFYTTQTZHGSPCZMLCCYTZXJCYTJMKSLPZHYSNZLLYTPZCTZZCKTXDHXXTQCYFKSMQCCYYAZHTJPCYLZLYJBJXTPNYLJYYNRXSYLMMNXJSMYBCSYSYLZYLXJJQYLDZLPQBFZZBLFNDXQKCZFYWHGQMRDSXYCYTXNQQJZYYPFZXDYZFPRXEJDGYQBXRCNFYYQPGHYJDYZXGRHTKYLNWDZNTSMPKLBTHBPYSZBZTJZSZZJTYYXZPHSSZZBZCZPTQFZMYFLYPYBBJQXZMXXDJMTSYSKKBJZXHJCKLPSMKYJZCXTMLJYXRZZQSLXXQPYZXMKYXXXJCLJPRMYYGADYSKQLSNDHYZKQXZYZTCGHZTLMLWZYBWSYCTBHJHJFCWZTXWYTKZLXQSHLYJZJXTMPLPYCGLTBZZTLZJCYJGDTCLKLPLLQPJMZPAPXYZLKKTKDZCZZBNZDYDYQZJYJGMCTXLTGXSZLMLHBGLKFWNWZHDXUHLFMKYSLGXDTWWFRJEJZTZHYDXYKSHWFZCQSHKTMQQHTZHYMJDJSKHXZJZBZZXYMPAGQMSTPXLSKLZYNWRTSQLSZBPSPSGZWYHTLKSSSWHZZLYYTNXJGMJSZSUFWNLSOZTXGXLSAMMLBWLDSZYLAKQCQCTMYCFJBSLXCLZZCLXXKSBZQCLHJPSQPLSXXCKSLNHPSFQQYTXYJZLQLDXZQJZDYYDJNZPTUZDSKJFSLJHYLZSQZLBTXYDGTQFDBYAZXDZHZJNHHQBYKNXJJQCZMLLJZKSPLDYCLBBLXKLELXJLBQYCXJXGCNLCQPLZLZYJTZLJGYZDZPLTQCSXFDMNYCXGBTJDCZNBGBQYQJWGKFHTNPYQZQGBKPBBYZMTJDYTBLSQMPSXTBNPDXKLEMYYCJYNZCTLDYKZZXDDXHQSHDGMZSJYCCTAYRZLPYLTLKXSLZCGGEXCLFXLKJRTLQJAQZNCMBYDKKCXGLCZJZXJHPTDJJMZQYKQSECQZDSHHADMLZFMMZBGNTJNNLGBYJBRBTMLBYJDZXLCJLPLDLPCQDHLXZLYCBLCXZZJADJLNZMMSSSMYBHBSQKBHRSXXJMXSDZNZPXLGBRHWGGFCXGMSKLLTSJYYCQLTSKYWYYHYWXBXQYWPYWYKQLSQPTNTKHQCWDQKTWPXXHCPTHTWUMSSYHBWCRWXHJMKMZNGWTMLKFGHKJYLSYYCXWHYECLQHKQHTTQKHFZLDXQWYZYYDESBPKYRZPJFYYZJCEQDZZDLATZBBFJLLCXDLMJSSXEGYGSJQXCWBXSSZPDYZCXDNYXPPZYDLYJCZPLTXLSXYZYRXCYYYDYLWWNZSAHJSYQYHGYWWAXTJZDAXYSRLTDPSSYYFNEJDXYZHLXLLLZQZSJNYQYQQXYJGHZGZCYJCHZLYCDSHWSHJZYJXCLLNXZJJYYXNFXMWFPYLCYLLABWDDHWDXJMCXZTZPMLQZHSFHZYNZTLLDYWLSLXHYMMYLMBWWKYXYADTXYLLDJPYBPWUXJMWMLLSAFDLLYFLBHHHBQQLTZJCQJLDJTFFKMMMBYTHYGDCQRDDWRQJXNBYSNWZDBYYTBJHPYBYTTJXAAHGQDQTMYSTQXKBTZPKJLZRBEQQSSMJJBDJOTGTBXPGBKTLHQXJJJCTHXQDWJLWRFWQGWSHCKRYSWGFTGYGBXSDWDWRFHWYTJJXXXJYZYSLPYYYPAYXHYDQKXSHXYXGSKQHYWFDDDPPLCJLQQEEWXKSYYKDYPLTJTHKJLTCYYHHJTTPLTZZCDLTHQKZXQYSTEEYWYYZYXXYYSTTJKLLPZMCYHQGXYHSRMBXPLLNQYDQHXSXXWGDQBSHYLLPJJJTHYJKYPPTHYYKTYEZYENMDSHLCRPQFDGFXZPSFTLJXXJBSWYYSKSFLXLPPLBBBLBSFXFYZBSJSSYLPBBFFFFSSCJDSTZSXZRYYSYFFSYZYZBJTBCTSBSDHRTJJBYTCXYJEYLXCBNEBJDSYXYKGSJZBXBYTFZWGENYHHTHZHHXFWGCSTBGXKLSXYWMTMBYXJSTZSCDYQRCYTWXZFHMYMCXLZNSDJTTTXRYCFYJSBSDYERXJLJXBBDEYNJGHXGCKGSCYMBLXJMSZNSKGXFBNBPTHFJAAFXYXFPXMYPQDTZCXZZPXRSYWZDLYBBKTYQPQJPZYPZJZNJPZJLZZFYSBTTSLMPTZRTDXQSJEHBZYLZDHLJSQMLHTXTJECXSLZZSPKTLZKQQYFSYGYWPCPQFHQHYTQXZKRSGTTSQCZLPTXCDYYZXSQZSLXLZMYCPCQBZYXHBSXLZDLTCDXTYLZJYYZPZYZLTXJSJXHLPMYTXCQRBLZSSFJZZTNJYTXMYJHLHPPLCYXQJQQKZZSCPZKSWALQSBLCCZJSXGWWWYGYKTJBBZTDKHXHKGTGPBKQYSLPXPJCKBMLLXDZSTBKLGGQKQLSBKKTFXRMDKBFTPZFRTBBRFERQGXYJPZSSTLBZTPSZQZSJDHLJQLZBPMSMMSXLQQNHKNBLRDDNXXDHDDJCYYGYLXGZLXSYGMQQGKHBPMXYXLYTQWLWGCPBMQXCYZYDRJBHTDJYHQSHTMJSBYPLWHLZFFNYPMHXXHPLTBQPFBJWQDBYGPNZTPFZJGSDDTQSHZEAWZZYLLTYYBWJKXXGHLFKXDJTMSZSQYNZGGSWQSPHTLSSKMCLZXYSZQZXNCJDQGZDLFNYKLJCJLLZLMZZNHYDSSHTHZZLZZBBHQZWWYCRZHLYQQJBEYFXXXWHSRXWQHWPSLMSSKZTTYGYQQWRSLALHMJTQJSMXQBJJZJXZYZKXBYQXBJXSHZTSFJLXMXZXFGHKZSZGGYLCLSARJYHSLLLMZXELGLXYDJYTLFBHBPNLYZFBBHPTGJKWETZHKJJXZXXGLLJLSTGSHJJYQLQZFKCGNNDJSSZFDBCTWWSEQFHQJBSAQTGYPQLBXBMMYWXGSLZHGLZGQYFLZBYFZJFRYSFMBYZHQGFWZSYFYJJPHZBYYZFFWODGRLMFTWLBZGYCQXCDJYGZYYYYTYTYDWEGAZYHXJLZYYHLRMGRXXZCLHNELJJTJTPWJYBJJBXJJTJTEEKHWSLJPLPSFYZPQQBDLQJJTYYQLYZKDKSQJYYQZLDQTGJQYZJSUCMRYQTHTEJMFCTYHYPKMHYZWJDQFHYYXWSHCTXRLJHQXHCCYYYJLTKTTYTMXGTCJTZAYYOCZLYLBSZYWJYTSJYHBYSHFJLYGJXXTMZYYLTXXYPZLXYJZYZYYPNHMYMDYYLBLHLSYYQQLLNJJYMSOYQBZGDLYXYLCQYXTSZEGXHZGLHWBLJHEYXTWQMAKBPQCGYSHHEGQCMWYYWLJYJHYYZLLJJYLHZYHMGSLJLJXCJJYCLYCJPCPZJZJMMYLCQLNQLJQJSXYJMLSZLJQLYCMMHCFMMFPQQMFYLQMCFFQMMMMHMZNFHHJGTTHHKHSLNCHHYQDXTMMQDCYZYXYQMYQYLTDCYYYZAZZCYMZYDLZFFFMMYCQZWZZMABTBYZTDMNZZGGDFTYPCGQYTTSSFFWFDTZQSSYSTWXJHXYTSXXYLBYQHWWKXHZXWZNNZZJZJJQJCCCHYYXBZXZCYZTLLCQXYNJYCYYCYNZZQYYYEWYCZDCJYCCHYJLBTZYYCQWMPWPYMLGKDLDLGKQQBGYCHJXY",oMultiDiff={ +19969:"DZ",19975:"WM",19988:"QJ",20048:"YL",20056:"SC",20060:"NM",20094:"QG",20127:"QJ",20167:"QC",20193:"YG",20250:"KH",20256:"ZC",20282:"SC",20285:"QJG",20291:"TD",20314:"YD",20315:"BF",20340:"NE",20375:"TD",20389:"YJ",20391:"CZ",20415:"PB",20446:"YS",20447:"SQ",20504:"TC",20608:"KG",20854:"QJ",20857:"ZC",20911:"PF",20985:"AW",21032:"PB",21048:"XQ",21049:"SC",21089:"YS",21119:"JC",21242:"SB",21273:"SC",21305:"YP",21306:"QO",21330:"ZC",21333:"SDC",21345:"QK",21378:"CA",21397:"SC",21414:"XS",21442:"SC",21477:"JG",21480:"TD",21484:"ZS",21494:"YX",21505:"YX",21512:"HG",21523:"XH",21537:"PB",21542:"PF",21549:"KH",21571:"E",21574:"DA",21588:"TD",21589:"O",21618:"ZC",21621:"KHA",21632:"ZJ",21654:"KG",21679:"LKG",21683:"KH",21710:"A",21719:"YH",21734:"WOE",21769:"A",21780:"WN",21804:"XH",21834:"A",21899:"ZD",21903:"RN",21908:"WO",21939:"ZC",21956:"SA",21964:"YA",21970:"TD",22003:"A",22031:"JG",22040:"XS",22060:"ZC",22066:"ZC",22079:"MH",22129:"XJ",22179:"XA",22237:"NJ",22244:"TD",22280:"JQ",22300:"YH",22313:"XW",22331:"YQ",22343:"YJ",22351:"PH",22395:"DC",22412:"TD",22484:"PB",22500:"PB",22534:"ZD",22549:"DH",22561:"PB",22612:"TD",22771:"KQ",22831:"HB",22841:"JG",22855:"QJ",22865:"XQ",23013:"ML",23081:"WM",23487:"SX",23558:"QJ",23561:"YW",23586:"YW",23614:"YW",23615:"SN",23631:"PB",23646:"ZS",23663:"ZT",23673:"YG",23762:"TD",23769:"ZS",23780:"QJ",23884:"QK",24055:"XH",24113:"DC",24162:"ZC",24191:"GA",24273:"QJ",24324:"NL",24377:"TD",24378:"QJ",24439:"PF",24554:"ZS",24683:"TD",24694:"WE",24733:"LK",24925:"TN",25094:"ZG",25100:"XQ",25103:"XH",25153:"PB",25170:"PB",25179:"KG",25203:"PB",25240:"ZS",25282:"FB",25303:"NA",25324:"KG",25341:"ZY",25373:"WZ",25375:"XJ",25384:"A",25457:"A",25528:"SD",25530:"SC",25552:"TD",25774:"ZC",25874:"ZC",26044:"YW",26080:"WM",26292:"PB",26333:"PB",26355:"ZY",26366:"CZ",26397:"ZC",26399:"QJ",26415:"ZS",26451:"SB",26526:"ZC",26552:"JG",26561:"TD",26588:"JG",26597:"CZ",26629:"ZS",26638:"YL",26646:"XQ",26653:"KG",26657:"XJ",26727:"HG",26894:"ZC",26937:"ZS",26946:"ZC",26999:"KJ",27099:"KJ",27449:"YQ",27481:"XS",27542:"ZS",27663:"ZS",27748:"TS",27784:"SC",27788:"ZD",27795:"TD",27812:"O",27850:"PB",27852:"MB",27895:"SL",27898:"PL",27973:"QJ",27981:"KH",27986:"HX",27994:"XJ",28044:"YC",28065:"WG",28177:"SM",28267:"QJ",28291:"KH",28337:"ZQ",28463:"TL",28548:"DC",28601:"TD",28689:"PB",28805:"JG",28820:"QG",28846:"PB",28952:"TD",28975:"ZC",29100:"A",29325:"QJ",29575:"SL",29602:"FB",30010:"TD",30044:"CX",30058:"PF",30091:"YSP",30111:"YN",30229:"XJ",30427:"SC",30465:"SX",30631:"YQ",30655:"QJ",30684:"QJG",30707:"SD",30729:"XH",30796:"LG",30917:"PB",31074:"NM",31085:"JZ",31109:"SC",31181:"ZC",31192:"MLB",31293:"JQ",31400:"YX",31584:"YJ",31896:"ZN",31909:"ZY",31995:"XJ",32321:"PF",32327:"ZY",32418:"HG",32420:"XQ",32421:"HG",32438:"LG",32473:"GJ",32488:"TD",32521:"QJ",32527:"PB",32562:"ZSQ",32564:"JZ",32735:"ZD",32793:"PB",33071:"PF",33098:"XL",33100:"YA",33152:"PB",33261:"CX",33324:"BP",33333:"TD",33406:"YA",33426:"WM",33432:"PB",33445:"JG",33486:"ZN",33493:"TS",33507:"QJ",33540:"QJ",33544:"ZC",33564:"XQ",33617:"YT",33632:"QJ",33636:"XH",33637:"YX",33694:"WG",33705:"PF",33728:"YW",33882:"SR",34067:"WM",34074:"YW",34121:"QJ",34255:"ZC",34259:"XL",34425:"JH",34430:"XH",34485:"KH",34503:"YS",34532:"HG",34552:"XS",34558:"YE",34593:"ZL",34660:"YQ",34892:"XH",34928:"SC",34999:"QJ",35048:"PB",35059:"SC",35098:"ZC",35203:"TQ",35265:"JX",35299:"JX",35782:"SZ",35828:"YS",35830:"E",35843:"TD",35895:"YG",35977:"MH",36158:"JG",36228:"QJ",36426:"XQ",36466:"DC",36710:"JC",36711:"ZYG",36767:"PB",36866:"SK",36951:"YW",37034:"YX",37063:"XH",37218:"ZC",37325:"ZC",38063:"PB",38079:"TD",38085:"QY",38107:"DC",38116:"TD",38123:"YD",38224:"HG",38241:"XTC",38271:"ZC",38415:"YE",38426:"KH",38461:"YD",38463:"AE",38466:"PB",38477:"XJ",38518:"YT",38551:"WK",38585:"ZC",38704:"XS",38739:"LJ",38761:"GJ",38808:"SQ",39048:"JG",39049:"XJ",39052:"HG",39076:"CZ",39271:"XT",39534:"TD",39552:"TD",39584:"PB",39647:"SB",39730:"LG",39748:"TPB",40109:"ZQ",40479:"ND",40516:"HG",40536:"HG",40583:"QJ",40765:"YQ",40784:"QJ",40840:"YK",40863:"QJG"},_checkPYCh=function(ch){var uni=ch.charCodeAt(0);return uni>40869||uni<19968?ch:oMultiDiff[uni]?oMultiDiff[uni]:_ChineseFirstPY.charAt(uni-19968)},_mkPYRslt=function(arr,ignoreMulti){for(var arrRslt=[""],k,multiLen=0,i=0,len=arr.length;i14||ignoreMulti){var tmpStr=str.substring(0,1);for(k=0;k0&&(this._items[0]=lastElt,this._sinkDown(0)),elt}},push:function(item){this._items[this._size++]=item,this._bubbleUp(this._size-1)},size:function(){return this._size},peek:function(){if(0!==this._size)return this._items[0]},_heapify:function(){for(var index=Math.floor((this._size+1)/2);index>=0;index--)this._sinkDown(index)},_bubbleUp:function(index){for(var elt=this._items[index];index>0;){var parentIndex=Math.floor((index+1)/2)-1,parentElt=this._items[parentIndex];if(this._comparator(parentElt,elt))return;this._items[parentIndex]=elt,this._items[index]=parentElt,index=parentIndex}},_sinkDown:function(index){for(var elt=this._items[index];;){var leftChildIndex=2*(index+1)-1,rightChildIndex=2*(index+1),swapIndex=-1;if(leftChildIndex=0;--i)xs[i]=0;return xs},ceilLog2=function(x){for(var y=1;y0;--i)this._heap[i]=this._heap[2*i]+this._heap[2*i+1]},BI.PrefixIntervalTree.prototype={constructor:BI.PrefixIntervalTree,set:function(index,value){var node=this._half+index;for(this._heap[node]=value,node=parent(node);0!==node;node=parent(node))this._heap[node]=this._heap[2*node]+this._heap[2*node+1]},get:function(index){var node=this._half+index;return this._heap[node]},getSize:function(){return this._size},sumUntil:function(end){if(0===end)return 0;for(var node=this._half+end-1,sum=this._heap[node];1!==node;node=parent(node))node%2===1&&(sum+=this._heap[node-1]);return sum},sumTo:function(inclusiveEnd){return this.sumUntil(inclusiveEnd+1)},sum:function(begin,end){return this.sumUntil(end)-this.sumUntil(begin)},greatestLowerBound:function(t){if(t<0)return-1;var node=1;if(this._heap[node]<=t)return this._size;for(;node=0;--i)xs[i]=initialValue;return new BI.PrefixIntervalTree(xs)},BI.PrefixIntervalTree.empty=function(size){return BI.PrefixIntervalTree.uniform(size,0)}}(),!function(){BI.Queue=function(capacity){this.capacity=capacity,this.array=[]},BI.Queue.prototype={constructor:BI.Queue,contains:function(v){return BI.contains(this.array,v)},indexOf:function(v){return BI.contains(this.array,v)},getElementByIndex:function(index){return this.array[index]},push:function(v){this.array.push(v),this.capacity&&this.array.length>this.capacity&&this.array.shift()},pop:function(){this.array.pop()},shift:function(){this.array.shift()},unshift:function(v){this.array.unshift(v),this.capacity&&this.array.length>this.capacity&&this.array.pop()},remove:function(v){BI.remove(this.array,v)},splice:function(){this.array.splice.apply(this.array,arguments)},slice:function(){this.array.slice.apply(this.array,arguments)},size:function(){return this.array.length},each:function(fn,scope){var scope=scope||window,fn=fn||null;if(null!=fn&&"function"==typeof fn)for(var i=0;i0?{children:children}:{})},toJSON:function(node){var self=this,result=[];return BI.each((node||this.root).getChildren(),function(i,child){result.push(self._toJSON(child))}),result},_toJSONWithNode:function(node){var self=this,children=[];return BI.each(node.getChildren(),function(i,child){children.push(self._toJSONWithNode(child))}),BI.extend({id:node.id},BI.deepClone(node.get("data")),{node:node},children.length>0?{children:children}:{})},toJSONWithNode:function(node){var self=this,result=[];return BI.each((node||this.root).getChildren(),function(i,child){result.push(self._toJSONWithNode(child))}),result},search:function(root,target,param){if(!(root instanceof BI.Node))return arguments.callee.apply(this,[this.root,root,target]);var self=this,next=null;return BI.isNull(target)?null:BI.isEqual(root[param||"id"],target)?root:(BI.any(root.getChildren(),function(i,child){if(next=self.search(child,target,param),null!==next)return!0}),next)},_traverse:function(node,callback){var queue=[];for(queue.push(node);!BI.isEmpty(queue);){var temp=queue.shift(),b=callback&&callback(temp);if(b===!1)break;b!==!0&&null!=temp&&(queue=queue.concat(temp.getChildren()))}},traverse:function(callback){this._traverse(this.root,callback)},_recursion:function(node,route,callback){var self=this;return BI.every(node.getChildren(),function(i,child){var next=BI.clone(route);next.push(child.id);var b=callback&&callback(child,next);return b!==!1&&(b===!0||self._recursion(child,next,callback))})},recursion:function(callback){this._recursion(this.root,[],callback)},inOrderTraverse:function(callback){this._inOrderTraverse(this.root,callback)},_inOrderTraverse:function(node,callback){null!=node&&(this._inOrderTraverse(node.getLeft()),callback&&callback(node),this._inOrderTraverse(node.getRight()))},nrInOrderTraverse:function(callback){for(var stack=[],node=this.root;null!=node||!BI.isEmpty(stack);){for(;null!=node;)stack.push(node),node=node.getLeft();node=stack.pop(),callback&&callback(node),node=node.getRight()}},preOrderTraverse:function(callback){this._preOrderTraverse(this.root,callback)},_preOrderTraverse:function(node,callback){null!=node&&(callback&&callback(node),this._preOrderTraverse(node.getLeft()),this._preOrderTraverse(node.getRight()))},nrPreOrderTraverse:function(callback){for(var stack=[],node=this.root;null!=node||!BI.isEmpty(stack);){for(;null!=node;)callback&&callback(node),stack.push(node),node=node.getLeft();node=stack.pop(),node=node.getRight()}},postOrderTraverse:function(callback){this._postOrderTraverse(this.root,callback)},_postOrderTraverse:function(node,callback){null!=node&&(this._postOrderTraverse(node.getLeft()),this._postOrderTraverse(node.getRight()),callback&&callback(node))},nrPostOrderTraverse:function(callback){for(var stack=[],node=this.root,preNode=null;null!=node||!BI.isEmpty(stack);){for(;null!=node;)stack.push(node),node=node.getLeft();node=BI.last(stack),null==node.getRight()||node.getRight()==preNode?(callback&&callback(node),node=stack.pop(),preNode=node,node=null):node=node.getRight()}}},BI.Node=function(id){BI.isObject(id)?BI.extend(this,id):this.id=id,this.clear.apply(this,arguments)},BI.Node.prototype={constructor:BI.Node,set:function(key,value){return BI.isObject(key)?void BI.extend(this,key):void(this[key]=value)},get:function(key){return this[key]},isLeaf:function(){return BI.isEmpty(this.children)},getChildren:function(){return this.children},getChildrenLength:function(){return this.children.length},getFirstChild:function(){return BI.first(this.children)},getLastChild:function(){return BI.last(this.children)},setLeft:function(left){this.left=left},getLeft:function(){return this.left},setRight:function(right){this.right=right},getRight:function(){return this.right},setParent:function(parent){this.parent=parent},getParent:function(){return this.parent},getChild:function(index){return this.children[index]},getChildIndex:function(id){return BI.findIndex(this.children,function(i,ch){return ch.get("id")===id})},removeChild:function(id){this.removeChildByIndex(this.getChildIndex(id))},removeChildByIndex:function(index){var before=this.getChild(index-1),behind=this.getChild(index+1);null!=before&&before.setRight(behind||null),null!=behind&&behind.setLeft(before||null),this.children.splice(index,1)},removeAllChilds:function(){this.children=[]},addChild:function(child,index){var cur=null;cur=BI.isUndefined(index)?this.children.length-1:index-1,child.setParent(this),cur>=0&&(this.getChild(cur)&&this.getChild(cur).setRight(child),child.setLeft(this.getChild(cur))),BI.isUndefined(index)?this.children.push(child):this.children.splice(index,0,child)},equals:function(obj){return this===obj||this.id===obj.id},clear:function(){this.parent=null,this.left=null,this.right=null,this.children=[]}},BI.extend(BI.Tree,{transformToArrayFormat:function(nodes,pId){if(!nodes)return[];var r=[];if(BI.isArray(nodes))for(var i=0,l=nodes.length;i=this.x&&x<=this.x+this.w&&y>=this.y&&y<=this.y+this.h)},getPosition:function(){var pos=[];return pos.push(this.x+this.w/2),pos.push(this.y+this.h/2),pos}},BI.BehaviorFactory={createBehavior:function(key,options){var behavior;switch(key){case"highlight":behavior=BI.HighlightBehavior;break;case"redmark":behavior=BI.RedMarkBehavior}return new behavior(options)}},BI.Behavior=BI.inherit(BI.OB,{_defaultConfig:function(){return BI.extend(BI.Behavior.superclass._defaultConfig.apply(this,arguments),{rule:function(){return!0}})},_init:function(){BI.Behavior.superclass._init.apply(this,arguments)},doBehavior:function(){}}),BI.Layout=BI.inherit(BI.Widget,{props:function(){return{scrollable:null,scrollx:!1,scrolly:!1,items:[]}},render:function(){this._init4Margin(),this._init4Scroll()},_init4Margin:function(){this.options.top&&this.element.css("top",this.options.top),this.options.left&&this.element.css("left",this.options.left),this.options.bottom&&this.element.css("bottom",this.options.bottom),this.options.right&&this.element.css("right",this.options.right)},_init4Scroll:function(){switch(this.options.scrollable){case!0:this.element.css("overflow","auto");break;case!1:this.element.css("overflow","hidden")}this.options.scrollx&&this.element.css({"overflow-x":"auto","overflow-y":"hidden"}),this.options.scrolly&&this.element.css({"overflow-x":"hidden","overflow-y":"auto"})},appendFragment:function(frag){this.element.append(frag)},_mountChildren:function(){var self=this,frag=BI.Widget._renderEngine.createFragment(),hasChild=!1;BI.each(this._children,function(i,widget){widget.element!==self.element&&(frag.appendChild(widget.element[0]),hasChild=!0)}),hasChild===!0&&this.appendFragment(frag)},_getChildName:function(index){return index+""},_addElement:function(i,item,context){var self=this,w;return this.hasWidget(this._getChildName(i))?w=this.getWidgetByName(this._getChildName(i)):(w=BI.createWidget(item,context),w.on(BI.Events.DESTROY,function(){BI.each(self._children,function(name,child){child===w&&(BI.remove(self._children,child),self.removeItemAt(0|name))})}),this.addWidget(this._getChildName(i),w)),w},_getOptions:function(item){return item instanceof BI.Widget&&(item=item.options),item=BI.stripEL(item),item instanceof BI.Widget&&(item=item.options),item},_compare:function(item1,item2){function eq(a,b,aStack,bStack){if(a===b)return 0!==a||1/a===1/b;if(null==a||null==b)return a===b;var className=Object.prototype.toString.call(a);switch(className){case"[object RegExp]":case"[object String]":return""+a==""+b;case"[object Number]":return+a!==+a?+b!==+b:0===+a?1/+a===1/b:+a===+b;case"[object Date]":case"[object Boolean]":return+a===+b}var areArrays="[object Array]"===className;if(!areArrays){if(BI.isFunction(a)&&BI.isFunction(b))return!0;a=self._getOptions(a),b=self._getOptions(b)}aStack=aStack||[],bStack=bStack||[];for(var length=aStack.length;length--;)if(aStack[length]===a)return bStack[length]===b;if(aStack.push(a),bStack.push(b),areArrays){if(length=a.length,length!==b.length)return!1;for(;length--;)if(!eq(a[length],b[length],aStack,bStack))return!1}else{var keys=_.keys(a),key;if(length=keys.length,_.keys(b).length!==length)return!1;for(;length--;)if(key=keys[length],!_.has(b,key)||!eq(a[key],b[key],aStack,bStack))return!1}return aStack.pop(),bStack.pop(),!0}var self=this;return eq(item1,item2)},_getWrapper:function(){return this.element},_addItemAt:function(index,item){for(var i=this.options.items.length;i>index;i--)this._children[this._getChildName(i)]=this._children[this._getChildName(i-1)];delete this._children[this._getChildName(index)],this.options.items.splice(index,0,item)},_removeItemAt:function(index){for(var i=index;ithis.options.items.length)){this._addItemAt(index,item);var w=this._addElement(index,item);return index>0?this._children[this._getChildName(index-1)].element.after(w.element):w.element.prependTo(this._getWrapper()),w._mount(),w}},removeItemAt:function(indexes){indexes=BI.isArray(indexes)?indexes:[indexes];for(var deleted=[],newItems=[],newChildren={},i=0,len=this.options.items.length;ithis.options.items.length-1)return!1;var child=this._children[this._getChildName(index)];return child.shouldUpdate?child.shouldUpdate(this._getOptions(item))===!0:null},updateItemAt:function(index,item){if(!(index<0||index>this.options.items.length-1)){ +var child=this._children[this._getChildName(index)],updated;if(updated=child.update(this._getOptions(item)))return updated;var del=this._children[this._getChildName(index)];delete this._children[this._getChildName(index)],this.options.items.splice(index,1);var w=this._addElement(index,item);this.options.items.splice(index,0,item),this._children[this._getChildName(index)]=w,index>0?this._children[this._getChildName(index-1)].element.after(w.element):w.element.prependTo(this._getWrapper()),del._destroy(),w._mount()}},addItems:function(items,context){var self=this,o=this.options,fragment=BI.Widget._renderEngine.createFragment(),added=[];BI.each(items,function(i,item){var w=self._addElement(o.items.length,item,context);self._children[self._getChildName(o.items.length)]=w,o.items.push(item),added.push(w),fragment.appendChild(w.element[0])}),this._isMounted&&(this._getWrapper().append(fragment),BI.each(added,function(i,w){w._mount()}))},prependItems:function(items,context){var self=this;items=items||[];for(var fragment=BI.Widget._renderEngine.createFragment(),added=[],i=items.length-1;i>=0;i--){this._addItemAt(0,items[i]);var w=this._addElement(0,items[i],context);self._children[self._getChildName(0)]=w,this.options.items.unshift(items[i]),added.push(w),fragment.appendChild(w.element[0])}this._isMounted&&(this._getWrapper().prepend(fragment),BI.each(added,function(i,w){w._mount()}))},getValue:function(){var self=this,value=[],child;return BI.each(this.options.items,function(i){if(child=self._children[self._getChildName(i)]){var v=child.getValue();v=BI.isArray(v)?v:[v],value=value.concat(v)}}),value},setValue:function(v){var self=this,child;BI.each(this.options.items,function(i){(child=self._children[self._getChildName(i)])&&child.setValue(v)})},setText:function(v){var self=this,child;BI.each(this.options.items,function(i){(child=self._children[self._getChildName(i)])&&child.setText(v)})},patchItem:function(oldVnode,vnode,index){var shouldUpdate=this.shouldUpdateItem(index,vnode);if(shouldUpdate===!0||null===shouldUpdate&&!this._compare(oldVnode,vnode))return this.updateItemAt(index,vnode)},updateChildren:function(oldCh,newCh){function sameVnode(vnode1,vnode2,oldIndex,newIndex){return vnode1=self._getOptions(vnode1),vnode2=self._getOptions(vnode2),BI.isKey(vnode1.key)?vnode1.key===vnode2.key:oldIndex>=0?oldIndex===newIndex:void 0}function addNode(vnode,index){var opt=self._getOptions(vnode),key=null==opt.key?self._getChildName(index):opt.key;return children[key]=self._addElement(key,vnode)}function addVnodes(before,vnodes,startIdx,endIdx){for(;startIdx<=endIdx;++startIdx){var node=addNode(vnodes[startIdx],startIdx);insertBefore(node,before,!1,startIdx)}}function removeVnodes(vnodes,startIdx,endIdx){for(;startIdx<=endIdx;++startIdx){var ch=vnodes[startIdx];if(BI.isNotNull(ch)){var node=self._getOptions(ch),key=null==node.key?self._getChildName(startIdx):node.key;delete self._children[self._getChildName(key)],children[key]._destroy()}}}function insertBefore(insert,before,isNext,index){insert=self._getOptions(insert),before=before&&self._getOptions(before);var insertKey=BI.isKey(insert.key)?insert.key:self._getChildName(index);if(before&&children[before.key]){var beforeKey=BI.isKey(before.key)?before.key:self._getChildName(index),next;next=isNext?children[beforeKey].element.next():children[beforeKey].element,next.length>0?next.before(children[insertKey].element):self._getWrapper().append(children[insertKey].element)}else self._getWrapper().append(children[insertKey].element)}function findOldVnode(vnodes,vNode,beginIdx,endIdx){var i,found;for(i=beginIdx;i<=endIdx;++i)vnodes[i]&&sameVnode(vnodes[i],vNode)&&(found=vnodes[i]);return found}var self=this,oldStartIdx=0,newStartIdx=0,oldEndIdx=oldCh.length-1,oldStartVnode=oldCh[0],oldEndVnode=oldCh[oldEndIdx],newEndIdx=newCh.length-1,newStartVnode=newCh[0],newEndVnode=newCh[newEndIdx],before,updated,children={};for(BI.each(oldCh,function(i,child){child=self._getOptions(child);var key=null==child.key?i:child.key;BI.isKey(key)&&(children[key]=self._children[self._getChildName(i)])});oldStartIdx<=oldEndIdx&&newStartIdx<=newEndIdx;)if(BI.isNull(oldStartVnode))oldStartVnode=oldCh[++oldStartIdx];else if(BI.isNull(oldEndVnode))oldEndVnode=oldCh[--oldEndIdx];else if(sameVnode(oldStartVnode,newStartVnode,oldStartIdx,newStartIdx))updated=this.patchItem(oldStartVnode,newStartVnode,oldStartIdx)||updated,children[null==oldStartVnode.key?this._getChildName(oldStartIdx):oldStartVnode.key]=this._children[this._getChildName(oldStartIdx)],oldStartVnode=oldCh[++oldStartIdx],newStartVnode=newCh[++newStartIdx];else if(sameVnode(oldEndVnode,newEndVnode,oldEndIdx,newEndIdx))updated=this.patchItem(oldEndVnode,newEndVnode,oldEndIdx)||updated,children[null==oldEndVnode.key?this._getChildName(oldEndIdx):oldEndVnode.key]=this._children[this._getChildName(oldEndIdx)],oldEndVnode=oldCh[--oldEndIdx],newEndVnode=newCh[--newEndIdx];else if(sameVnode(oldStartVnode,newEndVnode))updated=this.patchItem(oldStartVnode,newEndVnode,oldStartIdx)||updated,children[null==oldStartVnode.key?this._getChildName(oldStartIdx):oldStartVnode.key]=this._children[this._getChildName(oldStartIdx)],insertBefore(oldStartVnode,oldEndVnode,!0),oldStartVnode=oldCh[++oldStartIdx],newEndVnode=newCh[--newEndIdx];else if(sameVnode(oldEndVnode,newStartVnode))updated=this.patchItem(oldEndVnode,newStartVnode,oldEndIdx)||updated,children[null==oldEndVnode.key?this._getChildName(oldEndIdx):oldEndVnode.key]=this._children[this._getChildName(oldEndIdx)],insertBefore(oldEndVnode,oldStartVnode),oldEndVnode=oldCh[--oldEndIdx],newStartVnode=newCh[++newStartIdx];else{var sameOldVnode=findOldVnode(oldCh,newStartVnode,oldStartIdx,oldEndIdx);if(BI.isNull(sameOldVnode)){var node=addNode(newStartVnode);insertBefore(node,oldStartVnode),newStartVnode=newCh[++newStartIdx]}else BI.each(oldCh,function(index,child){child&&sameVnode(child,newStartVnode)&&(updated=self.patchItem(sameOldVnode,newStartVnode,index)||updated,children[null==sameOldVnode.key?self._getChildName(index):sameOldVnode.key]=self._children[self._getChildName(index)],oldCh[index]=void 0,insertBefore(sameOldVnode,oldStartVnode))}),newStartVnode=newCh[++newStartIdx]}return oldStartIdx>oldEndIdx?(before=BI.isNull(newCh[newEndIdx+1])?null:newCh[newEndIdx+1],addVnodes(before,newCh,newStartIdx,newEndIdx)):newStartIdx>newEndIdx&&removeVnodes(oldCh,oldStartIdx,oldEndIdx),this._children={},BI.each(newCh,function(i,child){var node=self._getOptions(child),key=null==node.key?self._getChildName(i):node.key;children[key]._mount(),self._children[self._getChildName(i)]=children[key]}),updated},update:function(opt){var o=this.options,items=opt.items||[],updated=this.updateChildren(o.items,items);return this.options.items=items,updated},stroke:function(items){var self=this;BI.each(items,function(i,item){item&&self._addElement(i,item)})},removeWidget:function(nameOrWidget){var removeIndex;BI.isWidget(nameOrWidget)?BI.each(this._children,function(name,child){child===nameOrWidget&&(removeIndex=name)}):removeIndex=nameOrWidget,removeIndex&&this._removeItemAt(0|removeIndex)},empty:function(){BI.Layout.superclass.empty.apply(this,arguments),this.options.items=[]},destroy:function(){BI.Layout.superclass.destroy.apply(this,arguments),this.options.items=[]},populate:function(items){var self=this,o=this.options;return items=items||[],this._isMounted?void this.update({items:items}):(this.options.items=items,void this.stroke(items))},resize:function(){}}),BI.shortcut("bi.layout",BI.Layout),BI.Plugin=BI.Plugin||{},!function(){var _WidgetsPlugin={},_ObjectPlugin={},_ConfigPlugin={},_GlobalWidgetConfigFn,_GlobalObjectConfigFn;BI.extend(BI.Plugin,{getWidget:function(type,options){if(_GlobalWidgetConfigFn&&_GlobalWidgetConfigFn(type,options),_ConfigPlugin[type])for(var i=_ConfigPlugin[type].length-1;i>=0;i--)_ConfigPlugin[type][i](options);if(_WidgetsPlugin[type])for(var res,i=_WidgetsPlugin[type].length-1;i>=0;i--)if(res=_WidgetsPlugin[type][i](options))return res;return options},config:function(widgetConfigFn,objectConfigFn){_GlobalWidgetConfigFn=widgetConfigFn,_GlobalObjectConfigFn=objectConfigFn},configWidget:function(type,fn){_ConfigPlugin[type]||(_ConfigPlugin[type]=[]),_ConfigPlugin[type].push(fn)},registerWidget:function(type,fn){_WidgetsPlugin[type]||(_WidgetsPlugin[type]=[]),_WidgetsPlugin[type].length>0&&console.log("组件已经注册过了!"),_WidgetsPlugin[type].push(fn)},relieveWidget:function(type){delete _WidgetsPlugin[type]},getObject:function(type,object){if(_GlobalObjectConfigFn&&_GlobalObjectConfigFn(type,object),_ObjectPlugin[type])for(var res,i=0,len=_ObjectPlugin[type].length;i0&&console.log("对象已经注册过了!"),_ObjectPlugin[type].push(fn)},relieveObject:function(type){delete _ObjectPlugin[type]}})}(),BI.Action=BI.inherit(BI.OB,{_defaultConfig:function(){return BI.extend(BI.Action.superclass._defaultConfig.apply(this,arguments),{src:null,tar:null})},_init:function(){BI.Action.superclass._init.apply(this,arguments)},actionPerformed:function(src,tar,callback){},actionBack:function(tar,src,callback){}}),BI.ActionFactory={createAction:function(key,options){var action;switch(key){case"show":action=BI.ShowAction}return new action(options)}},BI.ShowAction=BI.inherit(BI.Action,{_defaultConfig:function(){return BI.extend(BI.ShowAction.superclass._defaultConfig.apply(this,arguments),{})},_init:function(){BI.ShowAction.superclass._init.apply(this,arguments)},actionPerformed:function(src,tar,callback){tar=tar||this.options.tar,tar.setVisible(!0),callback&&callback()},actionBack:function(tar,src,callback){tar=tar||this.options.tar,tar.setVisible(!1),callback&&callback()}}),function(){function isEmpty(value){var result=""===value||null===value||void 0===value;return result}function isInvalidDate(date){return"Invalid Date"==date||"NaN"==date}function _eFormat(text,fmt){function eFormat(num,format){var neg=num<0?(num*=-1,"-"):"",magnitudeNeg="",funcName=num>0&&num<1?"floor":"ceil",magnitude=Math[funcName](Math.log(num)/Math.log(10));if(!isFinite(magnitude))return format.replace(/#/gi,"").replace(/\.e/gi,"E");num/=Math.pow(10,magnitude),num>0&&num<1&&(num*=10,magnitude-=1);var integerLen=getInteger(magnitude,format);integerLen>1&&(magnitude-=integerLen-1,num*=Math.pow(10,integerLen-1)),magnitude<0&&(magnitudeNeg="-",magnitude*=-1);var precision=getPrecision(format),isValueCarry=isValueCarried(num);return num*=Math.pow(10,precision),num=Math.round(num),isValueCarry&&(num/=10,magnitude+="-"===magnitudeNeg?-1:1),num/=Math.pow(10,precision),num=num.toFixed(precision),magnitude=formatExponential(format,magnitude,magnitudeNeg),neg+num+"E"+magnitude}function formatExponential(format,num,magnitudeNeg){if(num+="",!/e/gi.test(format))return num;for(format=format.split(/e/gi)[1];num.length1?arr[1].length:0}function getInteger(magnitude,format){if(!/e/gi.test(format))return 0;var formatLeft=format.split(/e/gi)[0].split(".")[0],i,f,len=formatLeft.length,valueLeftLen=0;for(i=0;i-1)return text>=0?_numberFormat(text+"",format.substring(0,numMod)):_numberFormat(-text+"",format.substr(numMod+1));if(+text<0&&"-"!==format.charAt(0))return _numberFormat(-text+"","-"+format);var fp=format.split("."),fleft=fp[0]||"",fright=fp[1]||"";text=_dealNumberPrecision(text,fright);var tp=text.split("."),tleft=tp[0]||"",tright=tp[1]||"";if(/[%‰]$/.test(format)){var paddingZero=/[%]$/.test(format)?"00":"000";tright+=paddingZero,tleft+=tright.substr(0,paddingZero.length),tleft=tleft.replace(/^0+/gi,""),tright=tright.substr(paddingZero.length).replace(/0+$/gi,"")}var right=_dealWithRight(tright,fright);right.leftPlus&&(tleft=parseInt(tleft)+1+"",tleft=isNaN(tleft)?"1":tleft),right=right.num;var left=_dealWithLeft(tleft,fleft);return/[0-9]/.test(left)||(left+="0"),/[0-9]/.test(right)?left+"."+right:left+right}function _dealWithRight(tright,fright){for(var right="",j=0,i=0,len=fright.length;i4){result.leftPlus=!0;var numReg=right.match(/^[0-9]+/);if(numReg){var num=numReg[0],orilen=num.length,newnum=parseInt(num)+1+"";newnum.length>orilen?newnum=newnum.substr(1):(newnum=BI.leftPad(newnum,orilen,"0"),result.leftPlus=!1),right=right.replace(/^[0-9]+/,newnum)}}return result.num=right,result}function _dealWithLeft(tleft,fleft){for(var left="",j=tleft.length-1,combo=-1,last=-1,i=fleft.length-1;i>=0;i--){var ch=fleft.charAt(i),c=tleft.charAt(j);switch(ch){case"0":isEmpty(c)&&(c="0"),last=-1,left=c+left,j--;break;case"#":last=i,left=c+left,j--;break;case",":if(!isEmpty(c)){var com=fleft.match(/,[#0]+/);com&&(combo=com[0].length-1),left=","+left}break;default:left=ch+left}}if(last>-1){var tll=tleft.substr(0,j+1);left=left.substr(0,last)+tll+left.substr(last)}if(combo>0){var res=left.match(/[0-9]+,/);if(res){res=res[0];for(var newstr="",n=res.length-1-combo;n>=0;n-=combo)newstr=res.substr(n,combo)+","+newstr;var lres=res.substr(0,n+combo);isEmpty(lres)||(newstr=lres+","+newstr)}left=left.replace(/[0-9]+,/,newstr)}return left}var _global;_global="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,_global.BI||(_global.BI={}),BI.cjkEncode=function(text){if("string"!=typeof text)return text;for(var newText="",i=0;i=128||91===code||93===code?"["+code.toString(16)+"]":text.charAt(i)}return newText},BI.cjkDecode=function(text){if(null==text)return"";if(!isNaN(text)||text.indexOf("[")==-1)return text;for(var newText="",i=0;ii+1){var subText=text.substring(i+1,rightIdx);subText.length>0&&(ch=String.fromCharCode(eval("0x"+subText))),i=rightIdx}}newText+=ch}return newText};var SPECIAL_TAGS={"&":"&",'"':""","<":"<",">":">"," ":" "};BI.htmlEncode=function(text){return BI.isNull(text)?"":BI.replaceAll(text+"",'&|"|<|>|\\s',function(v){return SPECIAL_TAGS[v]?SPECIAL_TAGS[v]:" "})},BI.htmlDecode=function(text){return BI.isNull(text)?"":BI.replaceAll(text+"","&|"|<|>| ",function(v){switch(v){case"&":return"&";case""":return'"';case"<":return"<";case">":return">";case" ":default:return" "}})},BI.cjkEncodeDO=function(o){if(BI.isPlainObject(o)){var result={};return _.each(o,function(v,k){"string"!=typeof v&&(v=BI.jsonEncode(v)),k=BI.cjkEncode(k),result[k]=BI.cjkEncode(v)}),result}return o},BI.jsonEncode=function(o){var useHasOwn=!!{}.hasOwnProperty,m={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},encodeString=function(s){return/["\\\x00-\x1f]/.test(s)?'"'+s.replace(/([\x00-\x1f\\"])/g,function(a,b){var c=m[b];return c?c:(c=b.charCodeAt(),"\\u00"+Math.floor(c/16).toString(16)+(c%16).toString(16))})+'"':'"'+s+'"'},encodeArray=function(o){var a=["["],b,i,l=o.length,v;for(i=0;i2?BI.Date._MN[date.getMonth()]:len<2?date.getMonth()+1:BI.leftPad(date.getMonth()+1+"",2,"0");break;case"d":str=len>1?BI.leftPad(date.getDate()+"",2,"0"):date.getDate();break;case"h":var hour=date.getHours()%12;0===hour&&(hour=12),str=len>1?BI.leftPad(hour+"",2,"0"):hour;break;case"H":str=len>1?BI.leftPad(date.getHours()+"",2,"0"):date.getHours();break;case"m":str=len>1?BI.leftPad(date.getMinutes()+"",2,"0"):date.getMinutes();break;case"s":str=len>1?BI.leftPad(date.getSeconds()+"",2,"0"):date.getSeconds();break;case"a":str=date.getHours()<12?"am":"pm";break;case"z":str=BI.getTimezone(date);break;default:str=jfmt.str}return str}if(!date)return"";var len=format.length,result="";if(len>0){for(var flagch=format.charAt(0),start=0,str=flagch,i=1;iBI.Widget._renderEngine.createElement("body").outerWidth()&&(x-=tooltip.element.outerWidth()+15);var bodyHeight=BI.Widget._renderEngine.createElement("body").outerHeight();return y+tooltip.element.outerHeight()>bodyHeight||top+tooltip.element.outerHeight()>bodyHeight?(y-=tooltip.element.outerHeight()+15,!opt.belowMouse&&(y=Math.min(y,offset.top-tooltip.element.outerHeight()-5))):!opt.belowMouse&&(y=Math.max(y,top)),tooltip.element.css({left:x<0?0:x+"px",top:y<0?0:y+"px"}),tooltip.element.hover(function(){self.remove(name),context.element.trigger("mouseleave.title"+context.getName())}),this},add:function(name,bubble){return this.has(name)?this:(this.set(name,bubble),this)},get:function(name){return this.tooltipsManager[name]},set:function(name,bubble){this.tooltipsManager[name]=bubble},has:function(name){return null!=this.tooltipsManager[name]},remove:function(name){return this.has(name)?(this.tooltipsManager[name].destroy(),delete this.tooltipsManager[name],this):this}}),_.extend(BI,{Events:{KEYDOWN:"_KEYDOWN",BACKSPACE:"_BACKSPACE",SPACE:"_SPACE",ENTER:"_ENTER",CONFIRM:"_CONFIRM",ERROR:"_ERROR",PAUSE:"_PAUSE",DESTROY:"_DESTROY",MOUNT:"_MOUNT",UNMOUNT:"_UNMOUNT",CLEAR:"_CLEAR",ADD:"_ADD",EDITING:"_EDITING",EMPTY:"_EMPTY",VIEW:"_VIEW",RESIZE:"_RESIZE",BEFOREEDIT:"_BEFOREEDIT",AFTEREDIT:"_AFTEREDIT",STARTEDIT:"_STARTEDIT",STOPEDIT:"_STOPEDIT",CHANGE:"_CHANGE",EXPAND:"_EXPAND",COLLAPSE:"_COLLAPSE",CALLBACK:"_CALLBACK",CLICK:"_CLICK",STATECHANGE:"_STATECHANGE",BEFORESTATECHANGE:"_BEFORESTATECHANGE",INIT:"_INIT",AFTERINIT:"_AFTERINIT",SCROLL:"_SCROLL",STARTLOAD:"_STARTLOAD",AFTERLOAD:"_AFTERLOAD",BS:"beforesubmit",AS:"aftersubmit",SC:"submitcomplete",SF:"submitfailure",SS:"submitsuccess",BVW:"beforeverifywrite",AVW:"afterverifywrite",AV:"afterverify",BW:"beforewrite",AW:"afterwrite",WS:"writesuccess",WF:"writefailure",BA:"beforeappend",AA:"afterappend",BD:"beforedelete",AD:"beforedelete",UC:"unloadcheck",BTOPDF:"beforetopdf",ATOPDF:"aftertopdf",BTOEXCEL:"beforetoexcel",ATOEXCEL:"aftertoexcel",BTOWORD:"beforetoword",ATOWORD:"aftertoword",BTOIMAGE:"beforetoimage",ATOIMAGE:"aftertoimage",BTOHTML:"beforetohtml",ATOHTML:"aftertohtml",BIMEXCEL:"beforeimportexcel",AIMEXCEL:"afterimportexcel",BPDFPRINT:"beforepdfprint",APDFPRINT:"afterpdfprint",BFLASHPRINT:"beforeflashprint",AFLASHPRINT:"afterflashprint",BAPPLETPRINT:"beforeappletprint",AAPPLETPRINT:"afterappletprint",BSEVERPRINT:"beforeserverprint",ASERVERPRINT:"afterserverprint",BEMAIL:"beforeemail",AEMAIL:"afteremail"}}),_.extend(BI,{pushArray:function(sArray,array){for(var i=0;imonthDay&&(day=monthDay),dt.setDate(day),dt.setMonth(dt.getMonth()+3*parseInt(n)),dt},getQuarterStartMonth:function(date){var quarterStartMonth=0,nowMonth=date.getMonth();return nowMonth<3&&(quarterStartMonth=0),28&&(quarterStartMonth=9),quarterStartMonth},getQuarterStartDate:function(date){return BI.getDate(date.getFullYear(),BI.getQuarterStartMonth(date),1)},getQuarterEndDate:function(date){var quarterEndMonth=BI.getQuarterStartMonth(date)+2;return BI.getDate(date.getFullYear(),quarterEndMonth,BI.getMonthDays(date,quarterEndMonth))},getOffsetMonth:function(date,n){var dt=BI.getDate(BI.getTime(date.getFullYear(),date.getMonth(),date.getDate(),date.getHours(),date.getMinutes(),date.getSeconds())),day=dt.getDate(),monthDay=BI.getMonthDays(BI.getDate(dt.getFullYear(),dt.getMonth()+parseInt(n),1));return day>monthDay&&(day=monthDay),dt.setDate(day),dt.setMonth(dt.getMonth()+parseInt(n)),dt},getWeekStartDate:function(date){var w=date.getDay(),startOfWeek=BI.StartOfWeek%7;return BI.getOffsetDate(date,BI.Date._OFFSET[w=12,ir=pm?hr-12:hr,dy=BI.getDayOfYear(date);0==ir&&(ir=12);var min=date.getMinutes(),sec=date.getSeconds();s["%a"]=BI.Date._SDN[w],s["%A"]=BI.Date._DN[w],s["%b"]=BI.Date._SMN[m],s["%B"]=BI.Date._MN[m],s["%C"]=1+Math.floor(y/100),s["%d"]=d<10?"0"+d:d,s["%e"]=d,s["%H"]=hr<10?"0"+hr:hr,s["%I"]=ir<10?"0"+ir:ir,s["%j"]=dy<100?dy<10?"00"+dy:"0"+dy:dy,s["%k"]=hr+"",s["%l"]=ir+"",s["%X"]=m<9?"0"+(1+m):1+m,s["%x"]=m+1,s["%M"]=min<10?"0"+min:min,s["%n"]="\n",s["%p"]=pm?"PM":"AM",s["%P"]=pm?"pm":"am",s["%s"]=Math.floor(date.getTime()/1e3),s["%S"]=sec<10?"0"+sec:sec,s["%t"]="\t",s["%U"]=s["%W"]=s["%V"]=wn<10?"0"+wn:wn,s["%u"]=w+1,s["%w"]=w,s["%y"]=yWith4number.substr(2,2),s["%Y"]=yWith4number,s["%%"]="%",s["%Q"]=qr;var re=/%./g;if(BI.isKhtml=BI.isKhtml||function(){return!!_global.navigator&&/Konqueror|Safari|KHTML/i.test(navigator.userAgent)},!(str.indexOf("%Y")===-1&&str.indexOf("%y")===-1||str.indexOf("%W")===-1&&str.indexOf("%U")===-1&&str.indexOf("%V")===-1))switch(wn){case 1:11===m&&(s["%y"]=parseInt(s["%y"])+1,s["%Y"]=parseInt(s["%Y"])+1);break;case 53:0===m&&(s["%y"]=parseInt(s["%y"])-1,s["%Y"]=parseInt(s["%Y"])-1)}if(!BI.isKhtml())return str.replace(re,function(par){return s[par]||par});for(var a=str.match(re),i=0;i-1?text===keyword?isArray?matched.push(item):matched[i]=item:isArray?find.push(item):find[i]=item:(pidx=py.indexOf(keyword),pidx>-1&&Math.floor(pidx/text.length)===Math.floor((pidx+keyword.length-1)/text.length)&&(text===keyword||keyword.length===text.length?isArray?matched.push(item):matched[i]=item:isArray?find.push(item):find[i]=item))}}),{match:matched,find:find}}}),_.extend(BI,{beforeFunc:function(sFunc,func){var __self=sFunc;return function(){return func.apply(sFunc,arguments)!==!1&&__self.apply(sFunc,arguments)}},afterFunc:function(sFunc,func){var __self=sFunc;return function(){var ret=__self.apply(sFunc,arguments);return ret!==!1&&(func.apply(sFunc,arguments),ret)}}}),_.extend(BI,{add:function(num,arg){function accAdd(arg1,arg2){var r1,r2,m,c;try{r1=arg1.toString().split(".")[1].length}catch(e){r1=0}try{r2=arg2.toString().split(".")[1].length}catch(e){r2=0}if(c=Math.abs(r1-r2),m=Math.pow(10,Math.max(r1,r2)),c>0){var cm=Math.pow(10,c);r1>r2?(arg1=Number(arg1.toString().replace(".","")),arg2=Number(arg2.toString().replace(".",""))*cm):(arg1=Number(arg1.toString().replace(".",""))*cm,arg2=Number(arg2.toString().replace(".","")))}else arg1=Number(arg1.toString().replace(".","")),arg2=Number(arg2.toString().replace(".",""));return(arg1+arg2)/m}return accAdd(arg,num)},sub:function(num,arg){function accSub(arg1,arg2){var r1,r2,m,n;try{r1=arg1.toString().split(".")[1].length}catch(e){r1=0}try{r2=arg2.toString().split(".")[1].length}catch(e){r2=0}return m=Math.pow(10,Math.max(r1,r2)),n=r1>=r2?r1:r2,((arg1*m-arg2*m)/m).toFixed(n)}return accSub(num,arg)},mul:function(num,arg){function accMul(arg1,arg2){var m=0,s1=arg1.toString(),s2=arg2.toString();try{m+=s1.split(".")[1].length}catch(e){}try{m+=s2.split(".")[1].length}catch(e){}return Number(s1.replace(".",""))*Number(s2.replace(".",""))/Math.pow(10,m)}return accMul(arg,num)},div:function(num,arg){function digitLength(num){var eSplit=num.toString().split(/[eE]/),len=(eSplit[0].split(".")[1]||"").length-+(eSplit[1]||0);return len>0?len:0}function float2Fixed(num){if(num.toString().indexOf("e")===-1)return Number(num.toString().replace(".",""));var dLen=digitLength(num);return dLen>0?num*Math.pow(10,dLen):num}function times(num1,num2){for(var others=[],_i=2;_i0)return times.apply(void 0,[times(num1,num2),others[0]].concat(others.slice(1)));var num1Changed=float2Fixed(num1),num2Changed=float2Fixed(num2),baseNum=digitLength(num1)+digitLength(num2),leftValue=num1Changed*num2Changed;return leftValue/Math.pow(10,baseNum)}function accDivide(num1,num2){for(var others=[],_i=2;_i0)return accDivide.apply(void 0,[accDivide(num1,num2),others[0]].concat(others.slice(1)));var num1Changed=float2Fixed(num1),num2Changed=float2Fixed(num2);return times(num1Changed/num2Changed,Math.pow(10,digitLength(num2)-digitLength(num1)))}return accDivide(num,arg)}}),_.extend(BI,{startWith:function(str,startTag){return str=str||"",!(null==startTag||""==startTag||0===str.length||startTag.length>str.length)&&str.substr(0,startTag.length)==startTag},endWith:function(str,endTag){return!(null==endTag||""==endTag||0===str.length||endTag.length>str.length)&&str.substring(str.length-endTag.length)==endTag},getQuery:function(str,name){var reg=new RegExp("(^|&)"+name+"=([^&]*)(&|$)"),r=str.substr(str.indexOf("?")+1).match(reg);return r?unescape(r[2]):null},appendQuery:function(str,paras){if(!paras)return str;var src=str;return src.indexOf("?")===-1&&(src+="?"),src.endWith("?")!==!1||(src+="&"),_.each(paras,function(value,name){"string"==typeof name&&(src+=name+"="+value+"&")}),src=src.substr(0,src.length-1)},replaceAll:function(str,s1,s2){return str.replace(new RegExp(s1,"gm"),s2)},perfectStart:function(str,start){return str.startWith(start)?str:start+str},allIndexOf:function(str,sub){if("string"!=typeof sub)return[];for(var location=[],offset=0;str.length>0;){var loc=str.indexOf(sub);if(loc===-1)break;location.push(offset+loc),str=str.substring(loc+sub.length,str.length),offset+=loc+sub.length}return location}}),!function(){var i18nStore={};_.extend(BI,{addI18n:function(i18n){BI.extend(i18nStore,i18n)},i18nText:function(key){var localeText=i18nStore[key]||BI.i18n&&BI.i18n[key]||"";localeText||(localeText=key);var len=arguments.length;if(len>1){if(!(localeText.indexOf("{R1}")>-1)){var args=Array.prototype.slice.call(arguments),count=1;return BI.replaceAll(localeText,"\\{\\s*\\}",function(){return args[count++]+""})}for(var i=1;i1?v.toString():v[0]:v,BI.isNull(v))throw new Error("value cannot be null");var cardName=o.cardNameCreator(v);if(!o.cardLayout.isCardExisted(cardName)){var card=o.cardCreator(cardName);o.cardLayout.addCardByName(cardName,card),o.afterCardCreated(cardName)}o.cardLayout.showCardByName(cardName),BI.nextTick(function(){o.afterCardShow(cardName),self.fireEvent(BI.ShowListener.EVENT_CHANGE,cardName)})}})}}),BI.ShowListener.EVENT_CHANGE="EVENT_CHANGE",BI.StyleLoaderManager=BI.inherit(BI.OB,{_defaultConfig:function(){return BI.extend(BI.StyleLoaderManager.superclass._defaultConfig.apply(this,arguments),{})},_init:function(){BI.StyleLoaderManager.superclass._init.apply(this,arguments),this.stylesManager={}},loadStyle:function(name,styleString){if(_global.document){var d=document,styles=d.createElement("style");return d.getElementsByTagName("head")[0].appendChild(styles),styles.setAttribute("type","text/css"),styles.styleSheet?styles.styleSheet.cssText=styleString:styles.appendChild(document.createTextNode(styleString)),this.stylesManager[name]=styles,this}},get:function(name){return this.stylesManager[name]},has:function(name){return null!=this.stylesManager[name]},removeStyle:function(name){return this.has(name)?(this.stylesManager[name].parentNode.removeChild(this.stylesManager[name]),delete this.stylesManager[name],this):this}}),BI.Logic=BI.inherit(BI.OB,{createLogic:function(){return this.options||{}}}),BI.LogicFactory={Type:{Vertical:"vertical",Horizontal:"horizontal",Table:"table",HorizontalFill:"horizontal_fill"},createLogic:function(key,options){var logic;switch(key){case BI.LogicFactory.Type.Vertical:logic=BI.VerticalLayoutLogic;break;case BI.LogicFactory.Type.Horizontal:logic=BI.HorizontalLayoutLogic;break;case BI.LogicFactory.Type.Table:logic=BI.TableLayoutLogic;break;case BI.LogicFactory.Type.HorizontalFill:logic=BI.HorizontalFillLayoutLogic;break;default:logic=BI.Logic}return new logic(options).createLogic()},createLogicTypeByDirection:function(direction){switch(direction){case BI.Direction.Top:case BI.Direction.Bottom:case BI.Direction.Custom:return BI.LogicFactory.Type.Vertical;case BI.Direction.Left:case BI.Direction.Right:return BI.LogicFactory.Type.Horizontal}},createLogicItemsByDirection:function(direction){var layout,items=Array.prototype.slice.call(arguments,1);switch(items=BI.map(items,function(i,item){return BI.isWidget(item)?{el:item,width:item.options.width,height:item.options.height}:item}),direction){case BI.Direction.Bottom:layout=BI.LogicFactory.Type.Vertical,items.reverse();break;case BI.Direction.Right:layout=BI.LogicFactory.Type.Horizontal,items.reverse();break;case BI.Direction.Custom:items=items.slice(1)}return items}},BI.VerticalLayoutLogic=BI.inherit(BI.Logic,{_defaultConfig:function(){return BI.extend(BI.VerticalLayoutLogic.superclass._defaultConfig.apply(this,arguments),{dynamic:!1,scrollable:null,scrolly:!1,scrollx:!1,items:[],hgap:0,vgap:0,lgap:0,rgap:0,tgap:0,bgap:0})},createLogic:function(){var layout,o=this.options;return layout=o.dynamic?"bi.vertical":"bi.vtape",{type:layout,scrollable:o.scrollable,scrolly:o.scrolly,scrollx:o.scrollx,hgap:o.hgap,vgap:o.vgap,lgap:o.lgap,rgap:o.rgap,tgap:o.tgap,bgap:o.bgap,items:o.items}},_init:function(){BI.VerticalLayoutLogic.superclass._init.apply(this,arguments)}}),BI.HorizontalLayoutLogic=BI.inherit(BI.Logic,{_defaultConfig:function(){return BI.extend(BI.HorizontalLayoutLogic.superclass._defaultConfig.apply(this,arguments),{dynamic:!1,scrollable:null,scrolly:!1,scrollx:!1,items:[],hgap:0,vgap:0,lgap:0,rgap:0,tgap:0,bgap:0})},createLogic:function(){var layout,o=this.options;return layout=o.dynamic?"bi.vertical_adapt":"bi.htape",{type:layout,scrollable:o.scrollable,scrolly:o.scrolly,scrollx:o.scrollx,hgap:o.hgap,vgap:o.vgap,lgap:o.lgap,rgap:o.rgap,tgap:o.tgap,bgap:o.bgap,items:o.items}},_init:function(){BI.HorizontalLayoutLogic.superclass._init.apply(this,arguments)}}),BI.TableLayoutLogic=BI.inherit(BI.Logic,{_defaultConfig:function(){return BI.extend(BI.TableLayoutLogic.superclass._defaultConfig.apply(this,arguments),{dynamic:!1,scrollable:null,scrolly:!1,scrollx:!1,columns:0,rows:0,columnSize:[],rowSize:[],hgap:0,vgap:0,items:[]})},createLogic:function(){var layout,o=this.options;return layout=o.dynamic?"bi.table":"bi.window",{type:layout,scrollable:o.scrollable,scrolly:o.scrolly,scrollx:o.scrollx,columns:o.columns,rows:o.rows,columnSize:o.columnSize,rowSize:o.rowSize,hgap:o.hgap,vgap:o.vgap,items:o.items}},_init:function(){BI.TableLayoutLogic.superclass._init.apply(this,arguments)}}),BI.HorizontalFillLayoutLogic=BI.inherit(BI.Logic,{_defaultConfig:function(){return BI.extend(BI.HorizontalFillLayoutLogic.superclass._defaultConfig.apply(this,arguments),{dynamic:!1,scrollable:null,scrolly:!1,scrollx:!1,items:[],hgap:0,vgap:0,lgap:0,rgap:0,tgap:0,bgap:0})},createLogic:function(){var layout,o=this.options,columnSize=[];return BI.each(o.items,function(i,item){columnSize.push(item.width||0)}),layout=o.dynamic?"bi.horizontal_adapt":"bi.htape",{type:layout,columnSize:columnSize,scrollable:o.scrollable,scrolly:o.scrolly,scrollx:o.scrollx,hgap:o.hgap,vgap:o.vgap,lgap:o.lgap,rgap:o.rgap,tgap:o.tgap,bgap:o.bgap,items:o.items}},_init:function(){BI.HorizontalFillLayoutLogic.superclass._init.apply(this,arguments)}}),BI.prepares.push(function(){var _isSupportFlex,isSupportFlex=function(){return null==_isSupportFlex&&(_isSupportFlex=!(!BI.isSupportCss3||!BI.isSupportCss3("flex"))),_isSupportFlex};BI.Plugin.registerWidget("bi.horizontal",function(ob){var isIE=BI.isIE(),supportFlex=isSupportFlex(),isLessIE8=isIE&&BI.getIEVersion()<8;return ob.verticalAlign===BI.VerticalAlign.Middle&&ob.horizontalAlign===BI.HorizontalAlign.Center?isLessIE8?ob:BI.extend(ob,{type:"bi.table_adapt"}):ob.verticalAlign===BI.VerticalAlign.Middle&&ob.horizontalAlign===BI.HorizontalAlign.Left?isLessIE8?ob:BI.extend(ob,{type:"bi.table_adapt"}):ob.verticalAlign===BI.VerticalAlign.Top&&ob.horizontalAlign===BI.HorizontalAlign.Center?isLessIE8?ob:BI.extend(ob,{type:"bi.table_adapt"}):isIE?ob:supportFlex?BI.extend(ob,{type:"bi.flex_horizontal"}):BI.extend(ob,{type:"bi.table_adapt"})}),BI.Plugin.registerWidget("bi.center_adapt",function(ob){var isIE=BI.isIE(),supportFlex=isSupportFlex(),justOneItem=ob.items&&ob.items.length<=1;return!isIE&&supportFlex&&justOneItem?ob.scrollable===!0||ob.scrollx===!0||ob.scrolly===!0?BI.extend(ob,{type:"bi.flex_scrollable_center_adapt"}):BI.extend(ob,{type:"bi.flex_center_adapt"}):justOneItem?BI.extend(ob,{type:"bi.inline_center_adapt"}):ob}),BI.Plugin.registerWidget("bi.vertical_adapt",function(ob){ +var isIE=BI.isIE(),supportFlex=isSupportFlex();return!isIE&&supportFlex?ob.scrollable===!0||ob.scrollx===!0||ob.scrolly===!0?BI.extend({},ob,{type:"bi.flex_scrollable_vertical_center_adapt"}):BI.extend(ob,{type:"bi.flex_vertical_center_adapt"}):BI.extend(ob,{type:"bi.inline_vertical_adapt"})}),BI.Plugin.registerWidget("bi.horizontal_adapt",function(ob){return ob.items&&ob.items.length<=1?BI.extend(ob,{type:"bi.horizontal_auto"}):ob}),BI.Plugin.registerWidget("bi.float_center_adapt",function(ob){return!BI.isIE()&&isSupportFlex()?ob.scrollable===!0||ob.scrollx===!0||ob.scrolly===!0?BI.extend({},ob,{type:"bi.flex_scrollable_center_adapt"}):BI.extend(ob,{type:"bi.flex_center_adapt"}):BI.extend(ob,{type:"bi.inline_center_adapt"})}),BI.Plugin.registerWidget("bi.flex_horizontal",function(ob){if(ob.scrollable===!0||ob.scrolly===!0)return BI.extend({},ob,{type:"bi.flex_scrollable_horizontal"})}),BI.Plugin.registerWidget("bi.flex_vertical",function(ob){if(ob.scrollable===!0||ob.scrollx===!0)return BI.extend({},ob,{type:"bi.flex_scrollable_vertical"})}),BI.Plugin.registerWidget("bi.flex_horizontal_adapt",function(ob){if(ob.scrollable===!0||ob.scrollx===!0)return BI.extend({},ob,{type:"bi.flex_scrollable_horizontal_adapt"})}),BI.Plugin.registerWidget("bi.flex_vertical_adapt",function(ob){if(ob.scrollable===!0||ob.scrolly===!0)return BI.extend({},ob,{type:"bi.flex_scrollable_vertical_adapt"})}),BI.Plugin.registerWidget("bi.flex_horizontal_center_adapt",function(ob){if(ob.scrollable===!0||ob.scrollx===!0)return BI.extend({},ob,{type:"bi.flex_scrollable_horizontal_adapt"})}),BI.Plugin.registerWidget("bi.flex_vertical_center_adapt",function(ob){if(ob.scrollable===!0||ob.scrolly===!0)return BI.extend({},ob,{type:"bi.flex_scrollable_vertical_adapt"})}),BI.Plugin.registerWidget("bi.flex_center_adapt",function(ob){if(ob.scrollable===!0||ob.scrolly===!0||ob.scrollx===!0)return BI.extend({},ob,{type:"bi.flex_scrollable_center_adapt"})}),BI.Plugin.registerWidget("bi.radio",function(ob){return BI.isIE()&&BI.getIEVersion()<9?BI.extend(ob,{type:"bi.image_radio"}):ob}),BI.Plugin.registerWidget("bi.checkbox",function(ob){return BI.isIE()&&BI.getIEVersion()<9?BI.extend(ob,{type:"bi.image_checkbox"}):ob}),BI.Plugin.registerWidget("bi.half_icon_button",function(ob){return BI.isIE()&&BI.getIEVersion()<9?ob:BI.extend(ob,{type:"bi.half_button"})})}),!function(){var attachEvent=_global.document&&_global.document.attachEvent,stylesCreated=!1;if(_global.document&&!attachEvent){var requestFrame=function(){var raf=_global.requestAnimationFrame||_global.mozRequestAnimationFrame||_global.webkitRequestAnimationFrame||function(fn){return _global.setTimeout(fn,20)};return function(fn){return raf(fn)}}(),cancelFrame=function(){var cancel=_global.cancelAnimationFrame||_global.mozCancelAnimationFrame||_global.webkitCancelAnimationFrame||_global.clearTimeout;return function(id){return cancel(id)}}(),resetTriggers=function(element){var triggers=element.__resizeTriggers__,expand=triggers.firstElementChild,contract=triggers.lastElementChild,expandChild=expand.firstElementChild;contract.scrollLeft=contract.scrollWidth,contract.scrollTop=contract.scrollHeight,expandChild.style.width=expand.offsetWidth+1+"px",expandChild.style.height=expand.offsetHeight+1+"px",expand.scrollLeft=expand.scrollWidth,expand.scrollTop=expand.scrollHeight},checkTriggers=function(element){return element.offsetWidth!==element.__resizeLast__.width||element.offsetHeight!==element.__resizeLast__.height},scrollListener=function(e){var element=this;resetTriggers(this),this.__resizeRAF__&&cancelFrame(this.__resizeRAF__),this.__resizeRAF__=requestFrame(function(){checkTriggers(element)&&(element.__resizeLast__.width=element.offsetWidth,element.__resizeLast__.height=element.offsetHeight,element.__resizeListeners__.forEach(function(fn){fn.call(element,e)}))})},animation=!1,animationstring="animation",keyframeprefix="",animationstartevent="animationstart",domPrefixes="Webkit Moz O ms".split(" "),startEvents="webkitAnimationStart animationstart oAnimationStart MSAnimationStart".split(" "),pfx="",elm=document.createElement("fakeelement");if(void 0!==elm.style.animationName&&(animation=!0),animation===!1)for(var i=0;i div, .contract-trigger:before { content: " "; display: block; position: absolute; top: 0; left: 0; height: 100%; width: 100%; overflow: hidden; } .resize-triggers > div { background: #eee; overflow: auto; } .contract-trigger:before { width: 200%; height: 200%; }',head=document.head||document.getElementsByTagName("head")[0],style=document.createElement("style");style.type="text/css",style.styleSheet?style.styleSheet.cssText=css:style.appendChild(document.createTextNode(css)),head.appendChild(style),stylesCreated=!0}},addResizeListener=function(element,fn){attachEvent?(element.attachEvent("onresize",fn),BI.nextTick(fn)):(element.__resizeTriggers__||("static"===getComputedStyle(element).position&&(element.style.position="relative"),createStyles(),element.__resizeLast__={},element.__resizeListeners__=[],(element.__resizeTriggers__=document.createElement("div")).className="resize-triggers",element.__resizeTriggers__.innerHTML='
',element.appendChild(element.__resizeTriggers__),resetTriggers(element),element.addEventListener("scroll",scrollListener,!0),animationstartevent&&element.__resizeTriggers__.addEventListener(animationstartevent,function(e){e.animationName===animationName&&resetTriggers(element)})),element.__resizeListeners__.push(fn))},removeResizeListener=function(element,fn){attachEvent?element.detachEvent("onresize",fn):(element.__resizeListeners__.splice(element.__resizeListeners__.indexOf(fn),1),element.__resizeListeners__.length||(element.removeEventListener("scroll",scrollListener),element.__resizeTriggers__=!element.removeChild(element.__resizeTriggers__)))};BI.ResizeDetector={addResizeListener:function(widget,fn){return addResizeListener(widget.element[0],fn),function(){removeResizeListener(widget.element[0],fn)}},removeResizeListener:function(widget,fn){removeResizeListener(widget.element[0],fn)}}}(),!function(){BI.DOM={},BI.extend(BI.DOM,{ready:function(fn){BI.Widget._renderEngine.createElement(document).ready(fn)}}),BI.extend(BI.DOM,{patchProps:function(fromElement,toElement){var elemData=BI.jQuery._data(fromElement[0]),events=elemData.events;BI.each(events,function(eventKey,event){BI.each(event,function(i,handler){toElement.on(eventKey+(handler.namespace?"."+handler.namespace:""),handler)})});var fromChildren=fromElement.children(),toChildren=toElement.children();if(fromChildren.length!==toChildren.length)throw new Error("不匹配");BI.each(fromChildren,function(i,child){BI.DOM.patchProps(BI.jQuery(child),BI.jQuery(toChildren[i]))}),BI.each(fromElement.data("__widgets"),function(i,widget){widget.element=toElement})},hang:function(doms){if(!BI.isEmpty(doms)){var frag=BI.Widget._renderEngine.createFragment();return BI.each(doms,function(i,dom){dom instanceof BI.Widget&&(dom=dom.element),dom instanceof BI.$&&dom[0]&&frag.appendChild(dom[0])}),frag}},isExist:function(obj){return BI.Widget._renderEngine.createElement("body").find(obj.element).length>0},preloadImages:function(srcArray,onload){function complete(){count++,count>=srcArray.length&&onload()}var count=0,images=[];BI.each(srcArray,function(i,src){images[i]=new Image,images[i].src=src,images[i].onload=function(){complete()},images[i].onerror=function(){complete()}})},getTextSizeWidth:function(text,fontSize){var span=BI.Widget._renderEngine.createElement("").addClass("text-width-span").appendTo("body");null==fontSize&&(fontSize=12),fontSize+="px",span.css("font-size",fontSize).text(text);var width=span.width();return span.remove(),width},getTextSizeHeight:function(text,fontSize){var span=BI.Widget._renderEngine.createElement("").addClass("text-width-span").appendTo("body");null==fontSize&&(fontSize=12),fontSize+="px",span.css("font-size",fontSize).text(text);var height=span.height();return span.remove(),height},getScrollWidth:function(){if(BI.isNull(this._scrollWidth)||0===this._scrollWidth){var ul=BI.Widget._renderEngine.createElement("
").width(50).height(50).css({position:"absolute",top:"-9999px",overflow:"scroll"}).appendTo("body");this._scrollWidth=ul[0].offsetWidth-ul[0].clientWidth,ul.destroy()}return this._scrollWidth},getImage:function(param,fillStyle,backgroundColor){var canvas=document.createElement("canvas"),ratio=2;BI.Widget._renderEngine.createElement("body").append(canvas);var ctx=canvas.getContext("2d");ctx.font="12px Georgia";var w=ctx.measureText(param).width+4;canvas.width=w*ratio,canvas.height=16*ratio,ctx.font=12*ratio+"px Georgia",ctx.fillStyle=fillStyle||"#3685f2",ctx.textBaseline="middle",ctx.fillText(param,2*ratio,9*ratio),BI.Widget._renderEngine.createElement(canvas).destroy();var backColor=backgroundColor||"rgba(54, 133, 242, 0.1)";return{width:w,height:16,src:canvas.toDataURL("image/png"),style:"background-color: "+backColor+";vertical-align: middle; margin: 0 1px; width:"+w+"px;height: 16px; max-width:"+w+"px;max-height: 16px; min-width:"+w+"px;min-height: 16px",param:param}}}),BI.extend(BI.DOM,{isColor:function(color){return color&&(this.isRGBColor(color)||this.isHexColor(color))},isRGBColor:function(color){return!!color&&"rgb"===color.substr(0,3)},isHexColor:function(color){return!!color&&("#"===color[0]&&7===color.length)},isDarkColor:function(hex){if(!hex||!this.isHexColor(hex))return!1;var rgb=this.rgb2json(this.hex2rgb(hex)),grayLevel=Math.round(.299*rgb.r+.587*rgb.g+.114*rgb.b);return grayLevel<192},getContrastColor:function(color){return color&&this.isColor(color)?this.isDarkColor(color)?"#ffffff":"#1a1a1a":""},rgb2hex:function(rgbColour){if(!rgbColour||"rgb"!=rgbColour.substr(0,3))return"";var rgbValues=rgbColour.match(/\d+(\.\d+)?/g),red=BI.parseInt(rgbValues[0]),green=BI.parseInt(rgbValues[1]),blue=BI.parseInt(rgbValues[2]),hexColour="#"+this.int2hex(red)+this.int2hex(green)+this.int2hex(blue);return hexColour},rgb2json:function(rgbColour){if(!rgbColour)return{};if(!this.isRGBColor(rgbColour))return{};var rgbValues=rgbColour.match(/\d+(\.\d+)?/g);return{r:BI.parseInt(rgbValues[0]),g:BI.parseInt(rgbValues[1]),b:BI.parseInt(rgbValues[2])}},rgba2json:function(rgbColour){if(!rgbColour)return{};var rgbValues=rgbColour.match(/\d+(\.\d+)?/g);return{r:BI.parseInt(rgbValues[0]),g:BI.parseInt(rgbValues[1]),b:BI.parseInt(rgbValues[2]),a:BI.parseFloat(rgbValues[3])}},json2rgb:function(rgb){return BI.isKey(rgb.r)&&BI.isKey(rgb.g)&&BI.isKey(rgb.b)?"rgb("+rgb.r+","+rgb.g+","+rgb.b+")":""},json2rgba:function(rgba){return BI.isKey(rgba.r)&&BI.isKey(rgba.g)&&BI.isKey(rgba.b)?"rgba("+rgba.r+","+rgba.g+","+rgba.b+","+rgba.a+")":""},int2hex:function(strNum){var hexdig=["0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f"];return hexdig[strNum>>>4]+""+hexdig[15&strNum]},hex2rgb:function(color){if(!color)return"";if(!this.isHexColor(color))return color;var tempValue="rgb(",colorArray;return 7===color.length?colorArray=[BI.parseInt("0x"+color.substring(1,3)),BI.parseInt("0x"+color.substring(3,5)),BI.parseInt("0x"+color.substring(5,7))]:4===color.length&&(colorArray=[BI.parseInt("0x"+color.substring(1,2)),BI.parseInt("0x"+color.substring(2,3)),BI.parseInt("0x"+color.substring(3,4))]),tempValue+=colorArray[0]+",",tempValue+=colorArray[1]+",",tempValue+=colorArray[2]+")"},rgba2rgb:function(rgbColor,bgColor){if(BI.isNull(bgColor)&&(bgColor=1),"rgba"!=rgbColor.substr(0,4))return"";var rgbValues=rgbColor.match(/\d+(\.\d+)?/g);if(rgbValues.length<4)return"";var R=BI.parseFloat(rgbValues[0]),G=BI.parseFloat(rgbValues[1]),B=BI.parseFloat(rgbValues[2]),A=BI.parseFloat(rgbValues[3]);return"rgb("+Math.floor(255*(bgColor*(1-A))+R*A)+","+Math.floor(255*(bgColor*(1-A))+G*A)+","+Math.floor(255*(bgColor*(1-A))+B*A)+")"}}),BI.extend(BI.DOM,{getLeftPosition:function(combo,popup,extraWidth){return{left:combo.element.offset().left-popup.element.outerWidth()-(extraWidth||0)}},getInnerLeftPosition:function(combo,popup,extraWidth){return{left:combo.element.offset().left+(extraWidth||0)}},getRightPosition:function(combo,popup,extraWidth){var el=combo.element;return{left:el.offset().left+el.outerWidth()+(extraWidth||0)}},getInnerRightPosition:function(combo,popup,extraWidth){var el=combo.element,viewBounds=popup.element.bounds();return{left:el.offset().left+el.outerWidth()-viewBounds.width-(extraWidth||0)}},getTopPosition:function(combo,popup,extraHeight){return{top:combo.element.offset().top-popup.element.outerHeight()-(extraHeight||0)}},getBottomPosition:function(combo,popup,extraHeight){var el=combo.element;return{top:el.offset().top+el.outerHeight()+(extraHeight||0)}},isLeftSpaceEnough:function(combo,popup,extraWidth){return BI.DOM.getLeftPosition(combo,popup,extraWidth).left>=0},isInnerLeftSpaceEnough:function(combo,popup,extraWidth){var viewBounds=popup.element.bounds(),windowBounds=BI.Widget._renderEngine.createElement("body").bounds();return BI.DOM.getInnerLeftPosition(combo,popup,extraWidth).left+viewBounds.width<=windowBounds.width},isRightSpaceEnough:function(combo,popup,extraWidth){var viewBounds=popup.element.bounds(),windowBounds=BI.Widget._renderEngine.createElement("body").bounds();return BI.DOM.getRightPosition(combo,popup,extraWidth).left+viewBounds.width<=windowBounds.width},isInnerRightSpaceEnough:function(combo,popup,extraWidth){return BI.DOM.getInnerRightPosition(combo,popup,extraWidth).left>=0},isTopSpaceEnough:function(combo,popup,extraHeight){return BI.DOM.getTopPosition(combo,popup,extraHeight).top>=0},isBottomSpaceEnough:function(combo,popup,extraHeight){var viewBounds=popup.element.bounds(),windowBounds=BI.Widget._renderEngine.createElement("body").bounds();return BI.DOM.getBottomPosition(combo,popup,extraHeight).top+viewBounds.height<=windowBounds.height},isRightSpaceLarger:function(combo){var windowBounds=BI.Widget._renderEngine.createElement("body").bounds();return windowBounds.width-combo.element.offset().left-combo.element.bounds().width>=combo.element.offset().left},isBottomSpaceLarger:function(combo){var windowBounds=BI.Widget._renderEngine.createElement("body").bounds();return windowBounds.height-combo.element.offset().top-combo.element.bounds().height>=combo.element.offset().top},getLeftAlignPosition:function(combo,popup,extraWidth){var viewBounds=popup.element.bounds(),windowBounds=BI.Widget._renderEngine.createElement("body").bounds(),left=combo.element.offset().left+extraWidth;return left+viewBounds.width>windowBounds.width&&(left=windowBounds.width-viewBounds.width),left<0&&(left=0),{left:left}},getLeftAdaptPosition:function(combo,popup,extraWidth){return BI.DOM.isLeftSpaceEnough(combo,popup,extraWidth)?BI.DOM.getLeftPosition(combo,popup,extraWidth):{left:0}},getRightAlignPosition:function(combo,popup,extraWidth){var comboBounds=combo.element.bounds(),viewBounds=popup.element.bounds(),left=combo.element.offset().left+comboBounds.width-viewBounds.width-extraWidth;return left<0&&(left=0),{left:left}},getRightAdaptPosition:function(combo,popup,extraWidth){return BI.DOM.isRightSpaceEnough(combo,popup,extraWidth)?BI.DOM.getRightPosition(combo,popup,extraWidth):{left:BI.Widget._renderEngine.createElement("body").bounds().width-popup.element.bounds().width}},getTopAlignPosition:function(combo,popup,extraHeight,needAdaptHeight){var comboOffset=combo.element.offset(),comboBounds=combo.element.bounds(),popupBounds=popup.element.bounds(),windowBounds=BI.Widget._renderEngine.createElement("body").bounds(),top,adaptHeight;return BI.DOM.isBottomSpaceEnough(combo,popup,-1*comboBounds.height+extraHeight)?top=comboOffset.top+extraHeight:needAdaptHeight?(top=comboOffset.top+extraHeight,adaptHeight=windowBounds.height-top):(top=windowBounds.height-popupBounds.height,topwindowBounds.height?{top:0,adaptHeight:windowBounds.height-extraHeight}:{top:0}},getBottomAlignPosition:function(combo,popup,extraHeight,needAdaptHeight){var comboOffset=combo.element.offset(),comboBounds=combo.element.bounds(),popupBounds=popup.element.bounds(),windowBounds=BI.Widget._renderEngine.createElement("body").bounds(),top,adaptHeight;return BI.DOM.isTopSpaceEnough(combo,popup,-1*comboBounds.height+extraHeight)?top=comboOffset.top+comboBounds.height-popupBounds.height-extraHeight:needAdaptHeight?(top=0,adaptHeight=comboOffset.top+comboBounds.height-extraHeight):(top=0,popupBounds.height+extraHeight>windowBounds.height&&(adaptHeight=windowBounds.height-extraHeight)),top<0&&(top=0),adaptHeight?{top:top,adaptHeight:adaptHeight}:{top:top}},getBottomAdaptPosition:function(combo,popup,extraHeight,needAdaptHeight){var comboOffset=combo.element.offset(),comboBounds=combo.element.bounds(),popupBounds=popup.element.bounds(),windowBounds=BI.Widget._renderEngine.createElement("body").bounds();return BI.DOM.isBottomSpaceEnough(combo,popup,extraHeight)?BI.DOM.getBottomPosition(combo,popup,extraHeight):needAdaptHeight?{top:comboOffset.top+comboBounds.height+extraHeight,adaptHeight:windowBounds.height-comboOffset.top-comboBounds.height-extraHeight}:popupBounds.height+extraHeight>windowBounds.height?{top:extraHeight,adaptHeight:windowBounds.height-extraHeight}:{top:windowBounds.height-popupBounds.height-extraHeight}},getCenterAdaptPosition:function(combo,popup){var comboOffset=combo.element.offset(),comboBounds=combo.element.bounds(),popupBounds=popup.element.bounds(),windowBounds=BI.Widget._renderEngine.createElement("body").bounds(),left;return left=comboOffset.left+comboBounds.width/2+popupBounds.width/2>windowBounds.width?windowBounds.width-popupBounds.width:comboOffset.left+comboBounds.width/2-popupBounds.width/2,left<0&&(left=0),{left:left}},getMiddleAdaptPosition:function(combo,popup){var comboOffset=combo.element.offset(),comboBounds=combo.element.bounds(),popupBounds=popup.element.bounds(),windowBounds=BI.Widget._renderEngine.createElement("body").bounds(),top;return top=comboOffset.top+comboBounds.height/2+popupBounds.height/2>windowBounds.height?windowBounds.height-popupBounds.height:comboOffset.top+comboBounds.height/2-popupBounds.height/2,top<0&&(top=0),{top:top}},getComboPositionByDirections:function(combo,popup,extraWidth,extraHeight,needAdaptHeight,directions){extraWidth||(extraWidth=0),extraHeight||(extraHeight=0);var i,direct,leftRight=[],topBottom=[],innerLeftRight=[],isNeedAdaptHeight=!1,tbFirst=!1,lrFirst=!1,left,top,pos,firstDir=directions[0];for(i=0;i0&&length-1 in obj)))}function createOptions(options){var object=optionsCache[options]={};return jQuery.each(options.match(core_rnotwhite)||[],function(_,flag){object[flag]=!0}),object}function internalData(elem,name,data,pvt){if(jQuery.acceptData(elem)){var thisCache,ret,internalKey=jQuery.expando,getByName="string"==typeof name,isNode=elem.nodeType,cache=isNode?jQuery.cache:elem,id=isNode?elem[internalKey]:elem[internalKey]&&internalKey;if(id&&cache[id]&&(pvt||cache[id].data)||!getByName||data!==undefined)return id||(isNode?elem[internalKey]=id=core_deletedIds.pop()||jQuery.guid++:id=internalKey),cache[id]||(cache[id]={},isNode||(cache[id].toJSON=jQuery.noop)),"object"!=typeof name&&"function"!=typeof name||(pvt?cache[id]=jQuery.extend(cache[id],name):cache[id].data=jQuery.extend(cache[id].data,name)),thisCache=cache[id],pvt||(thisCache.data||(thisCache.data={}),thisCache=thisCache.data),data!==undefined&&(thisCache[jQuery.camelCase(name)]=data),getByName?(ret=thisCache[name],null==ret&&(ret=thisCache[jQuery.camelCase(name)])):ret=thisCache,ret}}function internalRemoveData(elem,name,pvt){if(jQuery.acceptData(elem)){var i,l,thisCache,isNode=elem.nodeType,cache=isNode?jQuery.cache:elem,id=isNode?elem[jQuery.expando]:jQuery.expando;if(cache[id]){if(name&&(thisCache=pvt?cache[id]:cache[id].data)){jQuery.isArray(name)?name=name.concat(jQuery.map(name,jQuery.camelCase)):name in thisCache?name=[name]:(name=jQuery.camelCase(name),name=name in thisCache?[name]:name.split(" "));for(i=0,l=name.length;i=0===keep})}function createSafeFragment(document){var list=nodeNames.split("|"),safeFrag=document.createDocumentFragment();if(safeFrag.createElement)for(;list.length;)safeFrag.createElement(list.pop());return safeFrag}function findOrAppend(elem,tag){return elem.getElementsByTagName(tag)[0]||elem.appendChild(elem.ownerDocument.createElement(tag))}function disableScript(elem){var attr=elem.getAttributeNode("type");return elem.type=(attr&&attr.specified)+"/"+elem.type,elem}function restoreScript(elem){var match=rscriptTypeMasked.exec(elem.type);return match?elem.type=match[1]:elem.removeAttribute("type"),elem}function setGlobalEval(elems,refElements){for(var elem,i=0;null!=(elem=elems[i]);i++)jQuery._data(elem,"globalEval",!refElements||jQuery._data(refElements[i],"globalEval"))}function cloneCopyEvent(src,dest){if(1===dest.nodeType&&jQuery.hasData(src)){var type,i,l,oldData=jQuery._data(src),curData=jQuery._data(dest,oldData),events=oldData.events;if(events){delete curData.handle,curData.events={};for(type in events)for(i=0,l=events[type].length;i").css("cssText","display:block !important")).appendTo(doc.documentElement),doc=(iframe[0].contentWindow||iframe[0].contentDocument).document,doc.write(""),doc.close(),display=actualDisplay(nodeName,doc),iframe.detach()),elemdisplay[nodeName]=display),display}function actualDisplay(name,doc){var elem=jQuery(doc.createElement(name)).appendTo(doc.body),display=jQuery.css(elem[0],"display");return elem.remove(),display}function buildParams(prefix,obj,traditional,add){var name;if(jQuery.isArray(obj))jQuery.each(obj,function(i,v){traditional||rbracket.test(prefix)?add(prefix,v):buildParams(prefix+"["+("object"==typeof v?i:"")+"]",v,traditional,add)});else if(traditional||"object"!==jQuery.type(obj))add(prefix,obj);else for(name in obj)buildParams(prefix+"["+name+"]",obj[name],traditional,add)}function addToPrefiltersOrTransports(structure){return function(dataTypeExpression,func){"string"!=typeof dataTypeExpression&&(func=dataTypeExpression,dataTypeExpression="*");var dataType,i=0,dataTypes=dataTypeExpression.toLowerCase().match(core_rnotwhite)||[];if(jQuery.isFunction(func))for(;dataType=dataTypes[i++];)"+"===dataType[0]?(dataType=dataType.slice(1)||"*",(structure[dataType]=structure[dataType]||[]).unshift(func)):(structure[dataType]=structure[dataType]||[]).push(func)}}function inspectPrefiltersOrTransports(structure,options,originalOptions,jqXHR){function inspect(dataType){var selected;return inspected[dataType]=!0,jQuery.each(structure[dataType]||[],function(_,prefilterOrFactory){var dataTypeOrTransport=prefilterOrFactory(options,originalOptions,jqXHR);return"string"!=typeof dataTypeOrTransport||seekingTransport||inspected[dataTypeOrTransport]?seekingTransport?!(selected=dataTypeOrTransport):void 0:(options.dataTypes.unshift(dataTypeOrTransport),inspect(dataTypeOrTransport),!1)}),selected}var inspected={},seekingTransport=structure===transports;return inspect(options.dataTypes[0])||!inspected["*"]&&inspect("*")}function ajaxExtend(target,src){var deep,key,flatOptions=jQuery.ajaxSettings.flatOptions||{};for(key in src)src[key]!==undefined&&((flatOptions[key]?target:deep||(deep={}))[key]=src[key]);return deep&&jQuery.extend(!0,target,deep),target}function ajaxHandleResponses(s,jqXHR,responses){var firstDataType,ct,finalDataType,type,contents=s.contents,dataTypes=s.dataTypes,responseFields=s.responseFields;for(type in responseFields)type in responses&&(jqXHR[responseFields[type]]=responses[type]);for(;"*"===dataTypes[0];)dataTypes.shift(),ct===undefined&&(ct=s.mimeType||jqXHR.getResponseHeader("Content-Type"));if(ct)for(type in contents)if(contents[type]&&contents[type].test(ct)){dataTypes.unshift(type);break}if(dataTypes[0]in responses)finalDataType=dataTypes[0];else{for(type in responses){if(!dataTypes[0]||s.converters[type+" "+dataTypes[0]]){finalDataType=type;break}firstDataType||(firstDataType=type)}finalDataType=finalDataType||firstDataType}if(finalDataType)return finalDataType!==dataTypes[0]&&dataTypes.unshift(finalDataType),responses[finalDataType]}function ajaxConvert(s,response){var conv2,current,conv,tmp,converters={},i=0,dataTypes=s.dataTypes.slice(),prev=dataTypes[0];if(s.dataFilter&&(response=s.dataFilter(response,s.dataType)),dataTypes[1])for(conv in s.converters)converters[conv.toLowerCase()]=s.converters[conv];for(;current=dataTypes[++i];)if("*"!==current){if("*"!==prev&&prev!==current){if(conv=converters[prev+" "+current]||converters["* "+current],!conv)for(conv2 in converters)if(tmp=conv2.split(" "),tmp[1]===current&&(conv=converters[prev+" "+tmp[0]]||converters["* "+tmp[0]])){conv===!0?conv=converters[conv2]:converters[conv2]!==!0&&(current=tmp[0],dataTypes.splice(i--,0,current));break}if(conv!==!0)if(conv&&s["throws"])response=conv(response);else try{response=conv(response)}catch(e){return{state:"parsererror",error:conv?e:"No conversion from "+prev+" to "+current}}}prev=current}return{state:"success",data:response}}function createStandardXHR(){try{return new window.XMLHttpRequest}catch(e){}}function createActiveXHR(){try{return new window.ActiveXObject("Microsoft.XMLHTTP")}catch(e){}}function createFxNow(){return setTimeout(function(){fxNow=undefined}),fxNow=jQuery.now()}function createTweens(animation,props){jQuery.each(props,function(prop,value){for(var collection=(tweeners[prop]||[]).concat(tweeners["*"]),index=0,length=collection.length;index)[^>]*|#([\w-]*))$/,rsingleTag=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,rvalidchars=/^[\],:{}\s]*$/,rvalidbraces=/(?:^|:|,)(?:\s*\[)+/g,rvalidescape=/\\(?:["\\\/bfnrt]|u[\da-fA-F]{4})/g,rvalidtokens=/"[^"\\\r\n]*"|true|false|null|-?(?:\d+\.|)\d+(?:[eE][+-]?\d+|)/g,rmsPrefix=/^-ms-/,rdashAlpha=/-([\da-z])/gi,fcamelCase=function(all,letter){return letter.toUpperCase()},completed=function(event){(document.addEventListener||"load"===event.type||"complete"===document.readyState)&&(detach(),jQuery.ready())},detach=function(){document.addEventListener?(document.removeEventListener("DOMContentLoaded",completed,!1),window.removeEventListener("load",completed,!1)):(document.detachEvent("onreadystatechange",completed),window.detachEvent("onload",completed))};jQuery.fn=jQuery.prototype={jquery:core_version,constructor:jQuery,init:function(selector,context,rootjQuery){var match,elem;if(!selector)return this;if("string"==typeof selector){if(match="<"===selector.charAt(0)&&">"===selector.charAt(selector.length-1)&&selector.length>=3?[null,selector,null]:rquickExpr.exec(selector),!match||!match[1]&&context)return!context||context.jquery?(context||rootjQuery).find(selector):this.constructor(context).find(selector);if(match[1]){if(context=context instanceof jQuery?context[0]:context,jQuery.merge(this,jQuery.parseHTML(match[1],context&&context.nodeType?context.ownerDocument||context:document,!0)),rsingleTag.test(match[1])&&jQuery.isPlainObject(context))for(match in context)jQuery.isFunction(this[match])?this[match](context[match]):this.attr(match,context[match]);return this}if(elem=document.getElementById(match[2]),elem&&elem.parentNode){if(elem.id!==match[2])return rootjQuery.find(selector);this.length=1,this[0]=elem}return this.context=document,this.selector=selector,this}return selector.nodeType?(this.context=this[0]=selector,this.length=1,this):jQuery.isFunction(selector)?rootjQuery.ready(selector):(selector.selector!==undefined&&(this.selector=selector.selector,this.context=selector.context),jQuery.makeArray(selector,this))},selector:"",length:0,size:function(){return this.length},toArray:function(){return core_slice.call(this)},get:function(num){return null==num?this.toArray():num<0?this[this.length+num]:this[num]},pushStack:function(elems){var ret=jQuery.merge(this.constructor(),elems);return ret.prevObject=this,ret.context=this.context,ret},each:function(callback,args){return jQuery.each(this,callback,args)},ready:function(fn){return jQuery.ready.promise().done(fn),this},slice:function(){return this.pushStack(core_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&&j0||(readyList.resolveWith(document,[jQuery]),jQuery.fn.trigger&&jQuery(document).trigger("ready").off("ready"))}},isFunction:function(obj){return"function"===jQuery.type(obj)},isArray:Array.isArray||function(obj){return"array"===jQuery.type(obj)},isWindow:function(obj){return null!=obj&&obj==obj.window},isNumeric:function(obj){return!isNaN(parseFloat(obj))&&isFinite(obj)},type:function(obj){return null==obj?String(obj):"object"==typeof obj||"function"==typeof obj?class2type[core_toString.call(obj)]||"object":typeof obj},isPlainObject:function(obj){if(!obj||"object"!==jQuery.type(obj)||obj.nodeType||jQuery.isWindow(obj))return!1;try{if(obj.constructor&&!core_hasOwn.call(obj,"constructor")&&!core_hasOwn.call(obj.constructor.prototype,"isPrototypeOf"))return!1}catch(e){return!1}var key;for(key in obj);return key===undefined||core_hasOwn.call(obj,key)},isEmptyObject:function(obj){var name;for(name in obj)return!1;return!0},error:function(msg){throw new Error(msg)},parseHTML:function(data,context,keepScripts){if(!data||"string"!=typeof data)return null;"boolean"==typeof context&&(keepScripts=context,context=!1),context=context||document;var parsed=rsingleTag.exec(data),scripts=!keepScripts&&[];return parsed?[context.createElement(parsed[1])]:(parsed=jQuery.buildFragment([data],context,scripts),scripts&&jQuery(scripts).remove(),jQuery.merge([],parsed.childNodes))},parseJSON:function(data){return window.JSON&&window.JSON.parse?window.JSON.parse(data):null===data?data:"string"==typeof data&&(data=jQuery.trim(data),data&&rvalidchars.test(data.replace(rvalidescape,"@").replace(rvalidtokens,"]").replace(rvalidbraces,"")))?new Function("return "+data)():void jQuery.error("Invalid JSON: "+data)},parseXML:function(data){var xml,tmp;if(!data||"string"!=typeof data)return null;try{window.DOMParser?(tmp=new DOMParser,xml=tmp.parseFromString(data,"text/xml")):(xml=new ActiveXObject("Microsoft.XMLDOM"),xml.async="false",xml.loadXML(data))}catch(e){xml=undefined}return xml&&xml.documentElement&&!xml.getElementsByTagName("parsererror").length||jQuery.error("Invalid XML: "+data),xml},noop:function(){},globalEval:function(data){data&&jQuery.trim(data)&&(window.execScript||function(data){window.eval.call(window,data)})(data)},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,args){var value,i=0,length=obj.length,isArray=isArraylike(obj);if(args){if(isArray)for(;i-1;)list.splice(index,1),firing&&(index<=firingLength&&firingLength--,index<=firingIndex&&firingIndex--)}),this},has:function(fn){return fn?jQuery.inArray(fn,list)>-1:!(!list||!list.length)},empty:function(){return list=[],this},disable:function(){return list=stack=memory=undefined,this},disabled:function(){return!list},lock:function(){return stack=undefined,memory||self.disable(),this},locked:function(){return!stack},fireWith:function(context,args){return args=args||[],args=[context,args.slice?args.slice():args],!list||fired&&!stack||(firing?stack.push(args):fire(args)),this},fire:function(){return self.fireWith(this,arguments),this},fired:function(){return!!fired}};return self},jQuery.extend({Deferred:function(func){var tuples=[["resolve","done",jQuery.Callbacks("once memory"),"resolved"],["reject","fail",jQuery.Callbacks("once memory"),"rejected"],["notify","progress",jQuery.Callbacks("memory")]],state="pending",promise={state:function(){return state},always:function(){return deferred.done(arguments).fail(arguments),this},then:function(){var fns=arguments;return jQuery.Deferred(function(newDefer){jQuery.each(tuples,function(i,tuple){var action=tuple[0],fn=jQuery.isFunction(fns[i])&&fns[i];deferred[tuple[1]](function(){var returned=fn&&fn.apply(this,arguments);returned&&jQuery.isFunction(returned.promise)?returned.promise().done(newDefer.resolve).fail(newDefer.reject).progress(newDefer.notify):newDefer[action+"With"](this===promise?newDefer.promise():this,fn?[returned]:arguments)})}),fns=null}).promise()},promise:function(obj){return null!=obj?jQuery.extend(obj,promise):promise}},deferred={};return promise.pipe=promise.then,jQuery.each(tuples,function(i,tuple){var list=tuple[2],stateString=tuple[3];promise[tuple[1]]=list.add,stateString&&list.add(function(){state=stateString},tuples[1^i][2].disable,tuples[2][2].lock),deferred[tuple[0]]=function(){return deferred[tuple[0]+"With"](this===deferred?promise:this,arguments),this},deferred[tuple[0]+"With"]=list.fireWith}),promise.promise(deferred),func&&func.call(deferred,deferred),deferred},when:function(subordinate){var i=0,resolveValues=core_slice.call(arguments),length=resolveValues.length,remaining=1!==length||subordinate&&jQuery.isFunction(subordinate.promise)?length:0,deferred=1===remaining?subordinate:jQuery.Deferred(),updateFunc=function(i,contexts,values){return function(value){contexts[i]=this,values[i]=arguments.length>1?core_slice.call(arguments):value,values===progressValues?deferred.notifyWith(contexts,values):--remaining||deferred.resolveWith(contexts,values)}},progressValues,progressContexts,resolveContexts;if(length>1)for(progressValues=new Array(length),progressContexts=new Array(length),resolveContexts=new Array(length);i
a",all=div.getElementsByTagName("*"),a=div.getElementsByTagName("a")[0],!all||!a||!all.length)return{};select=document.createElement("select"),opt=select.appendChild(document.createElement("option")),input=div.getElementsByTagName("input")[0],a.style.cssText="top:1px;float:left;opacity:.5",support={getSetAttribute:"t"!==div.className,leadingWhitespace:3===div.firstChild.nodeType,tbody:!div.getElementsByTagName("tbody").length,htmlSerialize:!!div.getElementsByTagName("link").length,style:/top/.test(a.getAttribute("style")),hrefNormalized:"/a"===a.getAttribute("href"),opacity:/^0.5/.test(a.style.opacity),cssFloat:!!a.style.cssFloat,checkOn:!!input.value,optSelected:opt.selected,enctype:!!document.createElement("form").enctype,html5Clone:"<:nav>"!==document.createElement("nav").cloneNode(!0).outerHTML,boxModel:"CSS1Compat"===document.compatMode,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0,boxSizingReliable:!0,pixelPosition:!1},input.checked=!0,support.noCloneChecked=input.cloneNode(!0).checked,select.disabled=!0,support.optDisabled=!opt.disabled;try{delete div.test}catch(e){support.deleteExpando=!1}input=document.createElement("input"),input.setAttribute("value",""),support.input=""===input.getAttribute("value"),input.value="t",input.setAttribute("type","radio"),support.radioValue="t"===input.value,input.setAttribute("checked","t"),input.setAttribute("name","t"),fragment=document.createDocumentFragment(),fragment.appendChild(input),support.appendChecked=input.checked,support.checkClone=fragment.cloneNode(!0).cloneNode(!0).lastChild.checked,div.attachEvent&&(div.attachEvent("onclick",function(){support.noCloneEvent=!1}),div.cloneNode(!0).click());for(i in{submit:!0,change:!0,focusin:!0})div.setAttribute(eventName="on"+i,"t"),support[i+"Bubbles"]=eventName in window||div.attributes[eventName].expando===!1;return div.style.backgroundClip="content-box",div.cloneNode(!0).style.backgroundClip="",support.clearCloneStyle="content-box"===div.style.backgroundClip,jQuery(function(){var container,marginDiv,tds,divReset="padding:0;margin:0;border:0;display:block;box-sizing:content-box;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;",body=document.getElementsByTagName("body")[0];body&&(container=document.createElement("div"),container.style.cssText="border:0;width:0;height:0;position:absolute;top:0;left:-9999px;margin-top:1px",body.appendChild(container).appendChild(div),div.innerHTML="
t
",tds=div.getElementsByTagName("td"),tds[0].style.cssText="padding:0;margin:0;border:0;display:none",isSupported=0===tds[0].offsetHeight,tds[0].style.display="",tds[1].style.display="none",support.reliableHiddenOffsets=isSupported&&0===tds[0].offsetHeight,div.innerHTML="",div.style.cssText="box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;position:absolute;top:1%;",support.boxSizing=4===div.offsetWidth,support.doesNotIncludeMarginInBodyOffset=1!==body.offsetTop,window.getComputedStyle&&(support.pixelPosition="1%"!==(window.getComputedStyle(div,null)||{}).top,support.boxSizingReliable="4px"===(window.getComputedStyle(div,null)||{width:"4px"}).width,marginDiv=div.appendChild(document.createElement("div")),marginDiv.style.cssText=div.style.cssText=divReset,marginDiv.style.marginRight=marginDiv.style.width="0",div.style.width="1px",support.reliableMarginRight=!parseFloat((window.getComputedStyle(marginDiv,null)||{}).marginRight)),typeof div.style.zoom!==core_strundefined&&(div.innerHTML="",div.style.cssText=divReset+"width:1px;padding:1px;display:inline;zoom:1",support.inlineBlockNeedsLayout=3===div.offsetWidth,div.style.display="block",div.innerHTML="
",div.firstChild.style.width="5px", +support.shrinkWrapBlocks=3!==div.offsetWidth,support.inlineBlockNeedsLayout&&(body.style.zoom=1)),body.removeChild(container),container=div=tds=marginDiv=null)}),all=select=fragment=opt=a=input=null,support}();var rbrace=/(?:\{[\s\S]*\}|\[[\s\S]*\])$/,rmultiDash=/([A-Z])/g;jQuery.extend({cache:{},expando:"jQuery"+(core_version+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(elem){return elem=elem.nodeType?jQuery.cache[elem[jQuery.expando]]:elem[jQuery.expando],!!elem&&!isEmptyDataObject(elem)},data:function(elem,name,data){return internalData(elem,name,data)},removeData:function(elem,name){return internalRemoveData(elem,name)},_data:function(elem,name,data){return internalData(elem,name,data,!0)},_removeData:function(elem,name){return internalRemoveData(elem,name,!0)},acceptData:function(elem){if(elem.nodeType&&1!==elem.nodeType&&9!==elem.nodeType)return!1;var noData=elem.nodeName&&jQuery.noData[elem.nodeName.toLowerCase()];return!noData||noData!==!0&&elem.getAttribute("classid")===noData}}),jQuery.fn.extend({data:function(key,value){var attrs,name,elem=this[0],i=0,data=null;if(key===undefined){if(this.length&&(data=jQuery.data(elem),1===elem.nodeType&&!jQuery._data(elem,"parsedAttrs"))){for(attrs=elem.attributes;i1,null,!0)},removeData:function(key){return this.each(function(){jQuery.removeData(this,key)})}}),jQuery.extend({queue:function(elem,type,data){var queue;if(elem)return type=(type||"fx")+"queue",queue=jQuery._data(elem,type),data&&(!queue||jQuery.isArray(data)?queue=jQuery._data(elem,type,jQuery.makeArray(data)):queue.push(data)),queue||[]},dequeue:function(elem,type){type=type||"fx";var queue=jQuery.queue(elem,type),startLength=queue.length,fn=queue.shift(),hooks=jQuery._queueHooks(elem,type),next=function(){jQuery.dequeue(elem,type)};"inprogress"===fn&&(fn=queue.shift(),startLength--),hooks.cur=fn,fn&&("fx"===type&&queue.unshift("inprogress"),delete hooks.stop,fn.call(elem,next,hooks)),!startLength&&hooks&&hooks.empty.fire()},_queueHooks:function(elem,type){var key=type+"queueHooks";return jQuery._data(elem,key)||jQuery._data(elem,key,{empty:jQuery.Callbacks("once memory").add(function(){jQuery._removeData(elem,type+"queue"),jQuery._removeData(elem,key)})})}}),jQuery.fn.extend({queue:function(type,data){var setter=2;return"string"!=typeof type&&(data=type,type="fx",setter--),arguments.length1)},removeAttr:function(name){return this.each(function(){jQuery.removeAttr(this,name)})},prop:function(name,value){return jQuery.access(this,jQuery.prop,name,value,arguments.length>1)},removeProp:function(name){return name=jQuery.propFix[name]||name,this.each(function(){try{this[name]=undefined,delete this[name]}catch(e){}})},addClass:function(value){var classes,elem,cur,clazz,j,i=0,len=this.length,proceed="string"==typeof value&&value;if(jQuery.isFunction(value))return this.each(function(j){jQuery(this).addClass(value.call(this,j,this.className))});if(proceed)for(classes=(value||"").match(core_rnotwhite)||[];i=0;)cur=cur.replace(" "+clazz+" "," ");elem.className=value?jQuery.trim(cur):""}return this},toggleClass:function(value,stateVal){var type=typeof value,isBool="boolean"==typeof stateVal;return jQuery.isFunction(value)?this.each(function(i){jQuery(this).toggleClass(value.call(this,i,this.className,stateVal),stateVal)}):this.each(function(){if("string"===type)for(var className,i=0,self=jQuery(this),state=stateVal,classNames=value.match(core_rnotwhite)||[];className=classNames[i++];)state=isBool?state:!self.hasClass(className),self[state?"addClass":"removeClass"](className);else type!==core_strundefined&&"boolean"!==type||(this.className&&jQuery._data(this,"__className__",this.className),this.className=this.className||value===!1?"":jQuery._data(this,"__className__")||"")})},hasClass:function(selector){for(var className=" "+selector+" ",i=0,l=this.length;i=0)return!0;return!1},val:function(value){var ret,hooks,isFunction,elem=this[0];{if(arguments.length)return isFunction=jQuery.isFunction(value),this.each(function(i){var val,self=jQuery(this);1===this.nodeType&&(val=isFunction?value.call(this,i,self.val()):value,null==val?val="":"number"==typeof val?val+="":jQuery.isArray(val)&&(val=jQuery.map(val,function(value){return null==value?"":value+""})),hooks=jQuery.valHooks[this.type]||jQuery.valHooks[this.nodeName.toLowerCase()],hooks&&"set"in hooks&&hooks.set(this,val,"value")!==undefined||(this.value=val))});if(elem)return hooks=jQuery.valHooks[elem.type]||jQuery.valHooks[elem.nodeName.toLowerCase()],hooks&&"get"in hooks&&(ret=hooks.get(elem,"value"))!==undefined?ret:(ret=elem.value,"string"==typeof ret?ret.replace(rreturn,""):null==ret?"":ret)}}}),jQuery.extend({valHooks:{option:{get:function(elem){var val=elem.attributes.value;return!val||val.specified?elem.value:elem.text}},select:{get:function(elem){for(var value,option,options=elem.options,index=elem.selectedIndex,one="select-one"===elem.type||index<0,values=one?null:[],max=one?index+1:options.length,i=index<0?max:one?index:0;i=0}),values.length||(elem.selectedIndex=-1),values}}},attr:function(elem,name,value){var hooks,notxml,ret,nType=elem.nodeType;if(elem&&3!==nType&&8!==nType&&2!==nType)return typeof elem.getAttribute===core_strundefined?jQuery.prop(elem,name,value):(notxml=1!==nType||!jQuery.isXMLDoc(elem),notxml&&(name=name.toLowerCase(),hooks=jQuery.attrHooks[name]||(rboolean.test(name)?boolHook:nodeHook)),value===undefined?hooks&¬xml&&"get"in hooks&&null!==(ret=hooks.get(elem,name))?ret:(typeof elem.getAttribute!==core_strundefined&&(ret=elem.getAttribute(name)),null==ret?undefined:ret):null!==value?hooks&¬xml&&"set"in hooks&&(ret=hooks.set(elem,value,name))!==undefined?ret:(elem.setAttribute(name,value+""),value):void jQuery.removeAttr(elem,name))},removeAttr:function(elem,value){var name,propName,i=0,attrNames=value&&value.match(core_rnotwhite);if(attrNames&&1===elem.nodeType)for(;name=attrNames[i++];)propName=jQuery.propFix[name]||name,rboolean.test(name)?!getSetAttribute&&ruseDefault.test(name)?elem[jQuery.camelCase("default-"+name)]=elem[propName]=!1:elem[propName]=!1:jQuery.attr(elem,name,""),elem.removeAttribute(getSetAttribute?name:propName)},attrHooks:{type:{set:function(elem,value){if(!jQuery.support.radioValue&&"radio"===value&&jQuery.nodeName(elem,"input")){var val=elem.value;return elem.setAttribute("type",value),val&&(elem.value=val),value}}}},propFix:{tabindex:"tabIndex",readonly:"readOnly","for":"htmlFor","class":"className",maxlength:"maxLength",cellspacing:"cellSpacing",cellpadding:"cellPadding",rowspan:"rowSpan",colspan:"colSpan",usemap:"useMap",frameborder:"frameBorder",contenteditable:"contentEditable"},prop:function(elem,name,value){var ret,hooks,notxml,nType=elem.nodeType;if(elem&&3!==nType&&8!==nType&&2!==nType)return notxml=1!==nType||!jQuery.isXMLDoc(elem),notxml&&(name=jQuery.propFix[name]||name,hooks=jQuery.propHooks[name]),value!==undefined?hooks&&"set"in hooks&&(ret=hooks.set(elem,value,name))!==undefined?ret:elem[name]=value:hooks&&"get"in hooks&&null!==(ret=hooks.get(elem,name))?ret:elem[name]},propHooks:{tabIndex:{get:function(elem){var attributeNode=elem.getAttributeNode("tabindex");return attributeNode&&attributeNode.specified?parseInt(attributeNode.value,10):rfocusable.test(elem.nodeName)||rclickable.test(elem.nodeName)&&elem.href?0:undefined}}}}),boolHook={get:function(elem,name){var prop=jQuery.prop(elem,name),attr="boolean"==typeof prop&&elem.getAttribute(name),detail="boolean"==typeof prop?getSetInput&&getSetAttribute?null!=attr:ruseDefault.test(name)?elem[jQuery.camelCase("default-"+name)]:!!attr:elem.getAttributeNode(name);return detail&&detail.value!==!1?name.toLowerCase():undefined},set:function(elem,value,name){return value===!1?jQuery.removeAttr(elem,name):getSetInput&&getSetAttribute||!ruseDefault.test(name)?elem.setAttribute(!getSetAttribute&&jQuery.propFix[name]||name,name):elem[jQuery.camelCase("default-"+name)]=elem[name]=!0,name}},getSetInput&&getSetAttribute||(jQuery.attrHooks.value={get:function(elem,name){var ret=elem.getAttributeNode(name);return jQuery.nodeName(elem,"input")?elem.defaultValue:ret&&ret.specified?ret.value:undefined},set:function(elem,value,name){return jQuery.nodeName(elem,"input")?void(elem.defaultValue=value):nodeHook&&nodeHook.set(elem,value,name)}}),getSetAttribute||(nodeHook=jQuery.valHooks.button={get:function(elem,name){var ret=elem.getAttributeNode(name);return ret&&("id"===name||"name"===name||"coords"===name?""!==ret.value:ret.specified)?ret.value:undefined},set:function(elem,value,name){var ret=elem.getAttributeNode(name);return ret||elem.setAttributeNode(ret=elem.ownerDocument.createAttribute(name)),ret.value=value+="","value"===name||value===elem.getAttribute(name)?value:undefined}},jQuery.attrHooks.contenteditable={get:nodeHook.get,set:function(elem,value,name){nodeHook.set(elem,""!==value&&value,name)}},jQuery.each(["width","height"],function(i,name){jQuery.attrHooks[name]=jQuery.extend(jQuery.attrHooks[name],{set:function(elem,value){if(""===value)return elem.setAttribute(name,"auto"),value}})})),jQuery.support.hrefNormalized||(jQuery.each(["href","src","width","height"],function(i,name){jQuery.attrHooks[name]=jQuery.extend(jQuery.attrHooks[name],{get:function(elem){var ret=elem.getAttribute(name,2);return null==ret?undefined:ret}})}),jQuery.each(["href","src"],function(i,name){jQuery.propHooks[name]={get:function(elem){return elem.getAttribute(name,4)}}})),jQuery.support.style||(jQuery.attrHooks.style={get:function(elem){return elem.style.cssText||undefined},set:function(elem,value){return elem.style.cssText=value+""}}),jQuery.support.optSelected||(jQuery.propHooks.selected=jQuery.extend(jQuery.propHooks.selected,{get:function(elem){var parent=elem.parentNode;return parent&&(parent.selectedIndex,parent.parentNode&&parent.parentNode.selectedIndex),null}})),jQuery.support.enctype||(jQuery.propFix.enctype="encoding"),jQuery.support.checkOn||jQuery.each(["radio","checkbox"],function(){jQuery.valHooks[this]={get:function(elem){return null===elem.getAttribute("value")?"on":elem.value}}}),jQuery.each(["radio","checkbox"],function(){jQuery.valHooks[this]=jQuery.extend(jQuery.valHooks[this],{set:function(elem,value){if(jQuery.isArray(value))return elem.checked=jQuery.inArray(jQuery(elem).val(),value)>=0}})});var rformElems=/^(?:input|select|textarea)$/i,rkeyEvent=/^key/,rmouseEvent=/^(?:mouse|contextmenu)|click/,rfocusMorph=/^(?:focusinfocus|focusoutblur)$/,rtypenamespace=/^([^.]*)(?:\.(.+)|)$/;jQuery.event={global:{},add:function(elem,types,handler,data,selector){var tmp,events,t,handleObjIn,special,eventHandle,handleObj,handlers,type,namespaces,origType,elemData=jQuery._data(elem);if(elemData){for(handler.handler&&(handleObjIn=handler,handler=handleObjIn.handler,selector=handleObjIn.selector),handler.guid||(handler.guid=jQuery.guid++),(events=elemData.events)||(events=elemData.events={}),(eventHandle=elemData.handle)||(eventHandle=elemData.handle=function(e){return typeof jQuery===core_strundefined||e&&jQuery.event.triggered===e.type?undefined:jQuery.event.dispatch.apply(eventHandle.elem,arguments)},eventHandle.elem=elem),types=(types||"").match(core_rnotwhite)||[""],t=types.length;t--;)tmp=rtypenamespace.exec(types[t])||[],type=origType=tmp[1],namespaces=(tmp[2]||"").split(".").sort(),special=jQuery.event.special[type]||{},type=(selector?special.delegateType:special.bindType)||type,special=jQuery.event.special[type]||{},handleObj=jQuery.extend({type:type,origType:origType,data:data,handler:handler,guid:handler.guid,selector:selector,needsContext:selector&&jQuery.expr.match.needsContext.test(selector),namespace:namespaces.join(".")},handleObjIn),(handlers=events[type])||(handlers=events[type]=[],handlers.delegateCount=0,special.setup&&special.setup.call(elem,data,namespaces,eventHandle)!==!1||(elem.addEventListener?elem.addEventListener(type,eventHandle,!1):elem.attachEvent&&elem.attachEvent("on"+type,eventHandle))),special.add&&(special.add.call(elem,handleObj),handleObj.handler.guid||(handleObj.handler.guid=handler.guid)),selector?handlers.splice(handlers.delegateCount++,0,handleObj):handlers.push(handleObj),jQuery.event.global[type]=!0;elem=null}},remove:function(elem,types,handler,selector,mappedTypes){var j,handleObj,tmp,origCount,t,events,special,handlers,type,namespaces,origType,elemData=jQuery.hasData(elem)&&jQuery._data(elem);if(elemData&&(events=elemData.events)){for(types=(types||"").match(core_rnotwhite)||[""],t=types.length;t--;)if(tmp=rtypenamespace.exec(types[t])||[],type=origType=tmp[1],namespaces=(tmp[2]||"").split(".").sort(),type){for(special=jQuery.event.special[type]||{},type=(selector?special.delegateType:special.bindType)||type,handlers=events[type]||[],tmp=tmp[2]&&new RegExp("(^|\\.)"+namespaces.join("\\.(?:.*\\.|)")+"(\\.|$)"),origCount=j=handlers.length;j--;)handleObj=handlers[j],!mappedTypes&&origType!==handleObj.origType||handler&&handler.guid!==handleObj.guid||tmp&&!tmp.test(handleObj.namespace)||selector&&selector!==handleObj.selector&&("**"!==selector||!handleObj.selector)||(handlers.splice(j,1),handleObj.selector&&handlers.delegateCount--,special.remove&&special.remove.call(elem,handleObj));origCount&&!handlers.length&&(special.teardown&&special.teardown.call(elem,namespaces,elemData.handle)!==!1||jQuery.removeEvent(elem,type,elemData.handle),delete events[type])}else for(type in events)jQuery.event.remove(elem,type+types[t],handler,selector,!0);jQuery.isEmptyObject(events)&&(delete elemData.handle,jQuery._removeData(elem,"events"))}},trigger:function(event,data,elem,onlyHandlers){var handle,ontype,cur,bubbleType,special,tmp,i,eventPath=[elem||document],type=core_hasOwn.call(event,"type")?event.type:event,namespaces=core_hasOwn.call(event,"namespace")?event.namespace.split("."):[];if(cur=tmp=elem=elem||document,3!==elem.nodeType&&8!==elem.nodeType&&!rfocusMorph.test(type+jQuery.event.triggered)&&(type.indexOf(".")>=0&&(namespaces=type.split("."),type=namespaces.shift(),namespaces.sort()),ontype=type.indexOf(":")<0&&"on"+type,event=event[jQuery.expando]?event:new jQuery.Event(type,"object"==typeof event&&event),event.isTrigger=!0,event.namespace=namespaces.join("."),event.namespace_re=event.namespace?new RegExp("(^|\\.)"+namespaces.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,event.result=undefined,event.target||(event.target=elem),data=null==data?[event]:jQuery.makeArray(data,[event]),special=jQuery.event.special[type]||{},onlyHandlers||!special.trigger||special.trigger.apply(elem,data)!==!1)){if(!onlyHandlers&&!special.noBubble&&!jQuery.isWindow(elem)){for(bubbleType=special.delegateType||type,rfocusMorph.test(bubbleType+type)||(cur=cur.parentNode);cur;cur=cur.parentNode)eventPath.push(cur),tmp=cur;tmp===(elem.ownerDocument||document)&&eventPath.push(tmp.defaultView||tmp.parentWindow||window)}for(i=0;(cur=eventPath[i++])&&!event.isPropagationStopped();)event.type=i>1?bubbleType:special.bindType||type,handle=(jQuery._data(cur,"events")||{})[event.type]&&jQuery._data(cur,"handle"),handle&&handle.apply(cur,data),handle=ontype&&cur[ontype],handle&&jQuery.acceptData(cur)&&handle.apply&&handle.apply(cur,data)===!1&&event.preventDefault();if(event.type=type,!onlyHandlers&&!event.isDefaultPrevented()&&(!special._default||special._default.apply(elem.ownerDocument,data)===!1)&&("click"!==type||!jQuery.nodeName(elem,"a"))&&jQuery.acceptData(elem)&&ontype&&elem[type]&&!jQuery.isWindow(elem)){tmp=elem[ontype],tmp&&(elem[ontype]=null),jQuery.event.triggered=type;try{elem[type]()}catch(e){}jQuery.event.triggered=undefined,tmp&&(elem[ontype]=tmp)}return event.result}},dispatch:function(event){event=jQuery.event.fix(event);var i,ret,handleObj,matched,j,handlerQueue=[],args=core_slice.call(arguments),handlers=(jQuery._data(this,"events")||{})[event.type]||[],special=jQuery.event.special[event.type]||{};if(args[0]=event,event.delegateTarget=this,!special.preDispatch||special.preDispatch.call(this,event)!==!1){for(handlerQueue=jQuery.event.handlers.call(this,event,handlers),i=0;(matched=handlerQueue[i++])&&!event.isPropagationStopped();)for(event.currentTarget=matched.elem,j=0;(handleObj=matched.handlers[j++])&&!event.isImmediatePropagationStopped();)if(!event.namespace_re||event.namespace_re.test(handleObj.namespace)){event.handleObj=handleObj,event.data=handleObj.data;var obj=(jQuery.event.special[handleObj.origType]||{}).handle||handleObj.handler;obj.apply&&(ret=obj.apply(matched.elem,args)),ret!==undefined&&(event.result=ret)===!1&&(event.preventDefault(),event.stopPropagation())}return special.postDispatch&&special.postDispatch.call(this,event),event.result}},handlers:function(event,handlers){var sel,handleObj,matches,i,handlerQueue=[],delegateCount=handlers.delegateCount,cur=event.target;if(delegateCount&&cur.nodeType&&(!event.button||"click"!==event.type))for(;cur!=this;cur=cur.parentNode||this)if(1===cur.nodeType&&(cur.disabled!==!0||"click"!==event.type)){for(matches=[],i=0;i=0:jQuery.find(sel,this,null,[cur]).length),matches[sel]&&matches.push(handleObj);matches.length&&handlerQueue.push({elem:cur,handlers:matches})}return delegateCountExpr.cacheLength&&delete cache[keys.shift()],cache[key]=value}}function markFunction(fn){return fn[expando]=!0,fn}function assert(fn){var div=document.createElement("div");try{return fn(div)}catch(e){return!1}finally{div=null}}function Sizzle(selector,context,results,seed){var match,elem,m,nodeType,i,groups,old,nid,newContext,newSelector;if((context?context.ownerDocument||context:preferredDoc)!==document&&setDocument(context),context=context||document,results=results||[],!selector||"string"!=typeof selector)return results;if(1!==(nodeType=context.nodeType)&&9!==nodeType)return[];if(!documentIsXML&&!seed){if(match=rquickExpr.exec(selector))if(m=match[1]){if(9===nodeType){if(elem=context.getElementById(m),!elem||!elem.parentNode)return results;if(elem.id===m)return results.push(elem),results}else if(context.ownerDocument&&(elem=context.ownerDocument.getElementById(m))&&contains(context,elem)&&elem.id===m)return results.push(elem),results}else{if(match[2])return push.apply(results,slice.call(context.getElementsByTagName(selector),0)),results;if((m=match[3])&&support.getByClassName&&context.getElementsByClassName)return push.apply(results,slice.call(context.getElementsByClassName(m),0)),results}if(support.qsa&&!rbuggyQSA.test(selector)){if(old=!0,nid=expando,newContext=context,newSelector=9===nodeType&&selector,1===nodeType&&"object"!==context.nodeName.toLowerCase()){for(groups=tokenize(selector),(old=context.getAttribute("id"))?nid=old.replace(rescape,"\\$&"):context.setAttribute("id",nid),nid="[id='"+nid+"'] ",i=groups.length;i--;)groups[i]=nid+toSelector(groups[i]);newContext=rsibling.test(selector)&&context.parentNode||context,newSelector=groups.join(",")}if(newSelector)try{return push.apply(results,slice.call(newContext.querySelectorAll(newSelector),0)),results}catch(qsaError){}finally{old||context.removeAttribute("id")}}}return select(selector.replace(rtrim,"$1"),context,results,seed)}function siblingCheck(a,b){var cur=b&&a,diff=cur&&(~b.sourceIndex||MAX_NEGATIVE)-(~a.sourceIndex||MAX_NEGATIVE);if(diff)return diff;if(cur)for(;cur=cur.nextSibling;)if(cur===b)return-1;return a?1:-1}function createInputPseudo(type){return function(elem){var name=elem.nodeName.toLowerCase();return"input"===name&&elem.type===type}}function createButtonPseudo(type){return function(elem){var name=elem.nodeName.toLowerCase();return("input"===name||"button"===name)&&elem.type===type}}function createPositionalPseudo(fn){return markFunction(function(argument){return argument=+argument,markFunction(function(seed,matches){for(var j,matchIndexes=fn([],seed.length,argument),i=matchIndexes.length;i--;)seed[j=matchIndexes[i]]&&(seed[j]=!(matches[j]=seed[j]))})})}function tokenize(selector,parseOnly){var matched,match,tokens,type,soFar,groups,preFilters,cached=tokenCache[selector+" "];if(cached)return parseOnly?0:cached.slice(0);for(soFar=selector,groups=[],preFilters=Expr.preFilter;soFar;){ +matched&&!(match=rcomma.exec(soFar))||(match&&(soFar=soFar.slice(match[0].length)||soFar),groups.push(tokens=[])),matched=!1,(match=rcombinators.exec(soFar))&&(matched=match.shift(),tokens.push({value:matched,type:match[0].replace(rtrim," ")}),soFar=soFar.slice(matched.length));for(type in Expr.filter)!(match=matchExpr[type].exec(soFar))||preFilters[type]&&!(match=preFilters[type](match))||(matched=match.shift(),tokens.push({value:matched,type:type,matches:match}),soFar=soFar.slice(matched.length));if(!matched)break}return parseOnly?soFar.length:soFar?Sizzle.error(selector):tokenCache(selector,groups).slice(0)}function toSelector(tokens){for(var i=0,len=tokens.length,selector="";i1?function(elem,context,xml){for(var i=matchers.length;i--;)if(!matchers[i](elem,context,xml))return!1;return!0}:matchers[0]}function condense(unmatched,map,filter,context,xml){for(var elem,newUnmatched=[],i=0,len=unmatched.length,mapped=null!=map;i-1&&(seed[temp]=!(results[temp]=elem))}}else matcherOut=condense(matcherOut===results?matcherOut.splice(preexisting,matcherOut.length):matcherOut),postFinder?postFinder(null,results,matcherOut,xml):push.apply(results,matcherOut)})}function matcherFromTokens(tokens){for(var checkContext,matcher,j,len=tokens.length,leadingRelative=Expr.relative[tokens[0].type],implicitRelative=leadingRelative||Expr.relative[" "],i=leadingRelative?1:0,matchContext=addCombinator(function(elem){return elem===checkContext},implicitRelative,!0),matchAnyContext=addCombinator(function(elem){return indexOf.call(checkContext,elem)>-1},implicitRelative,!0),matchers=[function(elem,context,xml){return!leadingRelative&&(xml||context!==outermostContext)||((checkContext=context).nodeType?matchContext(elem,context,xml):matchAnyContext(elem,context,xml))}];i1&&elementMatcher(matchers),i>1&&toSelector(tokens.slice(0,i-1)).replace(rtrim,"$1"),matcher,i0,byElement=elementMatchers.length>0,superMatcher=function(seed,context,xml,results,expandContext){var elem,j,matcher,setMatched=[],matchedCount=0,i="0",unmatched=seed&&[],outermost=null!=expandContext,contextBackup=outermostContext,elems=seed||byElement&&Expr.find.TAG("*",expandContext&&context.parentNode||context),dirrunsUnique=dirruns+=null==contextBackup?1:Math.random()||.1;for(outermost&&(outermostContext=context!==document&&context,cachedruns=matcherCachedRuns);null!=(elem=elems[i]);i++){if(byElement&&elem){for(j=0;matcher=elementMatchers[j++];)if(matcher(elem,context,xml)){results.push(elem);break}outermost&&(dirruns=dirrunsUnique,cachedruns=++matcherCachedRuns)}bySet&&((elem=!matcher&&elem)&&matchedCount--,seed&&unmatched.push(elem))}if(matchedCount+=i,bySet&&i!==matchedCount){for(j=0;matcher=setMatchers[j++];)matcher(unmatched,setMatched,context,xml);if(seed){if(matchedCount>0)for(;i--;)unmatched[i]||setMatched[i]||(setMatched[i]=pop.call(results));setMatched=condense(setMatched)}push.apply(results,setMatched),outermost&&!seed&&setMatched.length>0&&matchedCount+setMatchers.length>1&&Sizzle.uniqueSort(results)}return outermost&&(dirruns=dirrunsUnique,outermostContext=contextBackup),unmatched};return bySet?markFunction(superMatcher):superMatcher}function multipleContexts(selector,contexts,results){for(var i=0,len=contexts.length;i2&&"ID"===(token=tokens[0]).type&&9===context.nodeType&&!documentIsXML&&Expr.relative[tokens[1].type]){if(context=Expr.find.ID(token.matches[0].replace(runescape,funescape),context)[0],!context)return results;selector=selector.slice(tokens.shift().value.length)}for(i=matchExpr.needsContext.test(selector)?0:tokens.length;i--&&(token=tokens[i],!Expr.relative[type=token.type]);)if((find=Expr.find[type])&&(seed=find(token.matches[0].replace(runescape,funescape),rsibling.test(tokens[0].type)&&context.parentNode||context))){if(tokens.splice(i,1),selector=seed.length&&toSelector(tokens),!selector)return push.apply(results,slice.call(seed,0)),results;break}}return compile(selector,match)(seed,context,documentIsXML,results,rsibling.test(selector)),results}function setFilters(){}var i,cachedruns,Expr,getText,isXML,compile,hasDuplicate,outermostContext,setDocument,document,docElem,documentIsXML,rbuggyQSA,rbuggyMatches,matches,contains,sortOrder,expando="sizzle"+-new Date,preferredDoc=window.document,support={},dirruns=0,done=0,classCache=createCache(),tokenCache=createCache(),compilerCache=createCache(),strundefined=typeof undefined,MAX_NEGATIVE=1<<31,arr=[],pop=arr.pop,push=arr.push,slice=arr.slice,indexOf=arr.indexOf||function(elem){for(var i=0,len=this.length;i+~])"+whitespace+"*"),rpseudo=new RegExp(pseudos),ridentifier=new RegExp("^"+identifier+"$"),matchExpr={ID:new RegExp("^#("+characterEncoding+")"),CLASS:new RegExp("^\\.("+characterEncoding+")"),NAME:new RegExp("^\\[name=['\"]?("+characterEncoding+")['\"]?\\]"),TAG:new RegExp("^("+characterEncoding.replace("w","w*")+")"),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"),needsContext:new RegExp("^"+whitespace+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+whitespace+"*((?:-\\d)?\\d*)"+whitespace+"*\\)|)(?=[^-]|$)","i")},rsibling=/[\x20\t\r\n\f]*[+~]/,rnative=/^[^{]+\{\s*\[native code/,rquickExpr=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,rinputs=/^(?:input|select|textarea|button)$/i,rheader=/^h\d$/i,rescape=/'|\\/g,rattributeQuotes=/\=[\x20\t\r\n\f]*([^'"\]]*)[\x20\t\r\n\f]*\]/g,runescape=/\\([\da-fA-F]{1,6}[\x20\t\r\n\f]?|.)/g,funescape=function(_,escaped){var high="0x"+escaped-65536;return high!==high?escaped:high<0?String.fromCharCode(high+65536):String.fromCharCode(high>>10|55296,1023&high|56320)};try{slice.call(preferredDoc.documentElement.childNodes,0)[0].nodeType}catch(e){slice=function(i){for(var elem,results=[];elem=this[i++];)results.push(elem);return results}}isXML=Sizzle.isXML=function(elem){var documentElement=elem&&(elem.ownerDocument||elem).documentElement;return!!documentElement&&"HTML"!==documentElement.nodeName},setDocument=Sizzle.setDocument=function(node){var doc=node?node.ownerDocument||node:preferredDoc;return doc!==document&&9===doc.nodeType&&doc.documentElement?(document=doc,docElem=doc.documentElement,documentIsXML=isXML(doc),support.tagNameNoComments=assert(function(div){return div.appendChild(doc.createComment("")),!div.getElementsByTagName("*").length}),support.attributes=assert(function(div){div.innerHTML="";var type=typeof div.lastChild.getAttribute("multiple");return"boolean"!==type&&"string"!==type}),support.getByClassName=assert(function(div){return div.innerHTML="",!(!div.getElementsByClassName||!div.getElementsByClassName("e").length)&&(div.lastChild.className="e",2===div.getElementsByClassName("e").length)}),support.getByName=assert(function(div){div.id=expando+0,div.innerHTML="
",docElem.insertBefore(div,docElem.firstChild);var pass=doc.getElementsByName&&doc.getElementsByName(expando).length===2+doc.getElementsByName(expando+0).length;return support.getIdNotName=!doc.getElementById(expando),docElem.removeChild(div),pass}),Expr.attrHandle=assert(function(div){return div.innerHTML="",div.firstChild&&typeof div.firstChild.getAttribute!==strundefined&&"#"===div.firstChild.getAttribute("href")})?{}:{href:function(elem){return elem.getAttribute("href",2)},type:function(elem){return elem.getAttribute("type")}},support.getIdNotName?(Expr.find.ID=function(id,context){if(typeof context.getElementById!==strundefined&&!documentIsXML){var m=context.getElementById(id);return m&&m.parentNode?[m]:[]}},Expr.filter.ID=function(id){var attrId=id.replace(runescape,funescape);return function(elem){return elem.getAttribute("id")===attrId}}):(Expr.find.ID=function(id,context){if(typeof context.getElementById!==strundefined&&!documentIsXML){var m=context.getElementById(id);return m?m.id===id||typeof m.getAttributeNode!==strundefined&&m.getAttributeNode("id").value===id?[m]:undefined:[]}},Expr.filter.ID=function(id){var attrId=id.replace(runescape,funescape);return function(elem){var node=typeof elem.getAttributeNode!==strundefined&&elem.getAttributeNode("id");return node&&node.value===attrId}}),Expr.find.TAG=support.tagNameNoComments?function(tag,context){if(typeof context.getElementsByTagName!==strundefined)return context.getElementsByTagName(tag)}:function(tag,context){var elem,tmp=[],i=0,results=context.getElementsByTagName(tag);if("*"===tag){for(;elem=results[i++];)1===elem.nodeType&&tmp.push(elem);return tmp}return results},Expr.find.NAME=support.getByName&&function(tag,context){if(typeof context.getElementsByName!==strundefined)return context.getElementsByName(name)},Expr.find.CLASS=support.getByClassName&&function(className,context){if(typeof context.getElementsByClassName!==strundefined&&!documentIsXML)return context.getElementsByClassName(className)},rbuggyMatches=[],rbuggyQSA=[":focus"],(support.qsa=isNative(doc.querySelectorAll))&&(assert(function(div){div.innerHTML="",div.querySelectorAll("[selected]").length||rbuggyQSA.push("\\["+whitespace+"*(?:checked|disabled|ismap|multiple|readonly|selected|value)"),div.querySelectorAll(":checked").length||rbuggyQSA.push(":checked")}),assert(function(div){div.innerHTML="",div.querySelectorAll("[i^='']").length&&rbuggyQSA.push("[*^$]="+whitespace+"*(?:\"\"|'')"),div.querySelectorAll(":enabled").length||rbuggyQSA.push(":enabled",":disabled"),div.querySelectorAll("*,:x"),rbuggyQSA.push(",.*:")})),(support.matchesSelector=isNative(matches=docElem.matchesSelector||docElem.mozMatchesSelector||docElem.webkitMatchesSelector||docElem.oMatchesSelector||docElem.msMatchesSelector))&&assert(function(div){support.disconnectedMatch=matches.call(div,"div"),matches.call(div,"[s!='']:x"),rbuggyMatches.push("!=",pseudos)}),rbuggyQSA=new RegExp(rbuggyQSA.join("|")),rbuggyMatches=new RegExp(rbuggyMatches.join("|")),contains=isNative(docElem.contains)||docElem.compareDocumentPosition?function(a,b){var adown=9===a.nodeType?a.documentElement:a,bup=b&&b.parentNode;return a===bup||!(!bup||1!==bup.nodeType||!(adown.contains?adown.contains(bup):a.compareDocumentPosition&&16&a.compareDocumentPosition(bup)))}:function(a,b){if(b)for(;b=b.parentNode;)if(b===a)return!0;return!1},sortOrder=docElem.compareDocumentPosition?function(a,b){var compare;return a===b?(hasDuplicate=!0,0):(compare=b.compareDocumentPosition&&a.compareDocumentPosition&&a.compareDocumentPosition(b))?1&compare||a.parentNode&&11===a.parentNode.nodeType?a===doc||contains(preferredDoc,a)?-1:b===doc||contains(preferredDoc,b)?1:0:4&compare?-1:1:a.compareDocumentPosition?-1:1}:function(a,b){var cur,i=0,aup=a.parentNode,bup=b.parentNode,ap=[a],bp=[b];if(a===b)return hasDuplicate=!0,0;if(!aup||!bup)return a===doc?-1:b===doc?1:aup?-1:bup?1:0;if(aup===bup)return siblingCheck(a,b);for(cur=a;cur=cur.parentNode;)ap.unshift(cur);for(cur=b;cur=cur.parentNode;)bp.unshift(cur);for(;ap[i]===bp[i];)i++;return i?siblingCheck(ap[i],bp[i]):ap[i]===preferredDoc?-1:bp[i]===preferredDoc?1:0},hasDuplicate=!1,[0,0].sort(sortOrder),support.detectDuplicates=hasDuplicate,document):document},Sizzle.matches=function(expr,elements){return Sizzle(expr,null,null,elements)},Sizzle.matchesSelector=function(elem,expr){if((elem.ownerDocument||elem)!==document&&setDocument(elem),expr=expr.replace(rattributeQuotes,"='$1']"),support.matchesSelector&&!documentIsXML&&(!rbuggyMatches||!rbuggyMatches.test(expr))&&!rbuggyQSA.test(expr))try{var ret=matches.call(elem,expr);if(ret||support.disconnectedMatch||elem.document&&11!==elem.document.nodeType)return ret}catch(e){}return Sizzle(expr,document,null,[elem]).length>0},Sizzle.contains=function(context,elem){return(context.ownerDocument||context)!==document&&setDocument(context),contains(context,elem)},Sizzle.attr=function(elem,name){var val;return(elem.ownerDocument||elem)!==document&&setDocument(elem),documentIsXML||(name=name.toLowerCase()),(val=Expr.attrHandle[name])?val(elem):documentIsXML||support.attributes?elem.getAttribute(name):((val=elem.getAttributeNode(name))||elem.getAttribute(name))&&elem[name]===!0?name:val&&val.specified?val.value:null},Sizzle.error=function(msg){throw new Error("Syntax error, unrecognized expression: "+msg)},Sizzle.uniqueSort=function(results){var elem,duplicates=[],i=1,j=0;if(hasDuplicate=!support.detectDuplicates,results.sort(sortOrder),hasDuplicate){for(;elem=results[i];i++)elem===results[i-1]&&(j=duplicates.push(i));for(;j--;)results.splice(duplicates[j],1)}return results},getText=Sizzle.getText=function(elem){var node,ret="",i=0,nodeType=elem.nodeType;if(nodeType){if(1===nodeType||9===nodeType||11===nodeType){if("string"==typeof elem.textContent)return elem.textContent;for(elem=elem.firstChild;elem;elem=elem.nextSibling)ret+=getText(elem)}else if(3===nodeType||4===nodeType)return elem.nodeValue}else for(;node=elem[i];i++)ret+=getText(node);return ret},Expr=Sizzle.selectors={cacheLength:50,createPseudo:markFunction,match:matchExpr,find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(match){return match[1]=match[1].replace(runescape,funescape),match[3]=(match[4]||match[5]||"").replace(runescape,funescape),"~="===match[2]&&(match[3]=" "+match[3]+" "),match.slice(0,4)},CHILD:function(match){return match[1]=match[1].toLowerCase(),"nth"===match[1].slice(0,3)?(match[3]||Sizzle.error(match[0]),match[4]=+(match[4]?match[5]+(match[6]||1):2*("even"===match[3]||"odd"===match[3])),match[5]=+(match[7]+match[8]||"odd"===match[3])):match[3]&&Sizzle.error(match[0]),match},PSEUDO:function(match){var excess,unquoted=!match[5]&&match[2];return matchExpr.CHILD.test(match[0])?null:(match[4]?match[2]=match[4]:unquoted&&rpseudo.test(unquoted)&&(excess=tokenize(unquoted,!0))&&(excess=unquoted.indexOf(")",unquoted.length-excess)-unquoted.length)&&(match[0]=match[0].slice(0,excess),match[2]=unquoted.slice(0,excess)),match.slice(0,3))}},filter:{TAG:function(nodeName){return"*"===nodeName?function(){return!0}:(nodeName=nodeName.replace(runescape,funescape).toLowerCase(),function(elem){return elem.nodeName&&elem.nodeName.toLowerCase()===nodeName})},CLASS:function(className){var pattern=classCache[className+" "];return pattern||(pattern=new RegExp("(^|"+whitespace+")"+className+"("+whitespace+"|$)"))&&classCache(className,function(elem){return pattern.test(elem.className||typeof elem.getAttribute!==strundefined&&elem.getAttribute("class")||"")})},ATTR:function(name,operator,check){return function(elem){var result=Sizzle.attr(elem,name);return null==result?"!="===operator:!operator||(result+="","="===operator?result===check:"!="===operator?result!==check:"^="===operator?check&&0===result.indexOf(check):"*="===operator?check&&result.indexOf(check)>-1:"$="===operator?check&&result.slice(-check.length)===check:"~="===operator?(" "+result+" ").indexOf(check)>-1:"|="===operator&&(result===check||result.slice(0,check.length+1)===check+"-"))}},CHILD:function(type,what,argument,first,last){var simple="nth"!==type.slice(0,3),forward="last"!==type.slice(-4),ofType="of-type"===what;return 1===first&&0===last?function(elem){return!!elem.parentNode}:function(elem,context,xml){var cache,outerCache,node,diff,nodeIndex,start,dir=simple!==forward?"nextSibling":"previousSibling",parent=elem.parentNode,name=ofType&&elem.nodeName.toLowerCase(),useCache=!xml&&!ofType;if(parent){if(simple){for(;dir;){for(node=elem;node=node[dir];)if(ofType?node.nodeName.toLowerCase()===name:1===node.nodeType)return!1;start=dir="only"===type&&!start&&"nextSibling"}return!0}if(start=[forward?parent.firstChild:parent.lastChild],forward&&useCache){for(outerCache=parent[expando]||(parent[expando]={}),cache=outerCache[type]||[],nodeIndex=cache[0]===dirruns&&cache[1],diff=cache[0]===dirruns&&cache[2],node=nodeIndex&&parent.childNodes[nodeIndex];node=++nodeIndex&&node&&node[dir]||(diff=nodeIndex=0)||start.pop();)if(1===node.nodeType&&++diff&&node===elem){outerCache[type]=[dirruns,nodeIndex,diff];break}}else if(useCache&&(cache=(elem[expando]||(elem[expando]={}))[type])&&cache[0]===dirruns)diff=cache[1];else for(;(node=++nodeIndex&&node&&node[dir]||(diff=nodeIndex=0)||start.pop())&&((ofType?node.nodeName.toLowerCase()!==name:1!==node.nodeType)||!++diff||(useCache&&((node[expando]||(node[expando]={}))[type]=[dirruns,diff]),node!==elem)););return diff-=last,diff===first||diff%first===0&&diff/first>=0}}},PSEUDO:function(pseudo,argument){var args,fn=Expr.pseudos[pseudo]||Expr.setFilters[pseudo.toLowerCase()]||Sizzle.error("unsupported pseudo: "+pseudo);return fn[expando]?fn(argument):fn.length>1?(args=[pseudo,pseudo,"",argument],Expr.setFilters.hasOwnProperty(pseudo.toLowerCase())?markFunction(function(seed,matches){for(var idx,matched=fn(seed,argument),i=matched.length;i--;)idx=indexOf.call(seed,matched[i]),seed[idx]=!(matches[idx]=matched[i])}):function(elem){return fn(elem,0,args)}):fn}},pseudos:{not:markFunction(function(selector){var input=[],results=[],matcher=compile(selector.replace(rtrim,"$1"));return matcher[expando]?markFunction(function(seed,matches,context,xml){for(var elem,unmatched=matcher(seed,null,xml,[]),i=seed.length;i--;)(elem=unmatched[i])&&(seed[i]=!(matches[i]=elem))}):function(elem,context,xml){return input[0]=elem,matcher(input,null,xml,results),!results.pop()}}),has:markFunction(function(selector){return function(elem){return Sizzle(selector,elem).length>0}}),contains:markFunction(function(text){return function(elem){return(elem.textContent||elem.innerText||getText(elem)).indexOf(text)>-1}}),lang:markFunction(function(lang){return ridentifier.test(lang||"")||Sizzle.error("unsupported lang: "+lang),lang=lang.replace(runescape,funescape).toLowerCase(),function(elem){var elemLang;do if(elemLang=documentIsXML?elem.getAttribute("xml:lang")||elem.getAttribute("lang"):elem.lang)return elemLang=elemLang.toLowerCase(),elemLang===lang||0===elemLang.indexOf(lang+"-");while((elem=elem.parentNode)&&1===elem.nodeType);return!1}}),target:function(elem){var hash=window.location&&window.location.hash;return hash&&hash.slice(1)===elem.id},root:function(elem){return elem===docElem},focus:function(elem){return elem===document.activeElement&&(!document.hasFocus||document.hasFocus())&&!!(elem.type||elem.href||~elem.tabIndex)},enabled:function(elem){return elem.disabled===!1},disabled:function(elem){return elem.disabled===!0},checked:function(elem){var nodeName=elem.nodeName.toLowerCase();return"input"===nodeName&&!!elem.checked||"option"===nodeName&&!!elem.selected},selected:function(elem){return elem.parentNode&&elem.parentNode.selectedIndex,elem.selected===!0},empty:function(elem){for(elem=elem.firstChild;elem;elem=elem.nextSibling)if(elem.nodeName>"@"||3===elem.nodeType||4===elem.nodeType)return!1;return!0},parent:function(elem){return!Expr.pseudos.empty(elem)},header:function(elem){return rheader.test(elem.nodeName)},input:function(elem){return rinputs.test(elem.nodeName)},button:function(elem){var name=elem.nodeName.toLowerCase();return"input"===name&&"button"===elem.type||"button"===name},text:function(elem){var attr;return"input"===elem.nodeName.toLowerCase()&&"text"===elem.type&&(null==(attr=elem.getAttribute("type"))||attr.toLowerCase()===elem.type)},first:createPositionalPseudo(function(){return[0]}),last:createPositionalPseudo(function(matchIndexes,length){return[length-1]}),eq:createPositionalPseudo(function(matchIndexes,length,argument){return[argument<0?argument+length:argument]}),even:createPositionalPseudo(function(matchIndexes,length){for(var i=0;i=0;)matchIndexes.push(i);return matchIndexes}),gt:createPositionalPseudo(function(matchIndexes,length,argument){for(var i=argument<0?argument+length:argument;++i1?jQuery.unique(ret):ret),ret.selector=(this.selector?this.selector+" ":"")+selector,ret},has:function(target){var i,targets=jQuery(target,this),len=targets.length;return this.filter(function(){for(i=0;i=0:jQuery.filter(selector,this).length>0:this.filter(selector).length>0)},closest:function(selectors,context){for(var cur,i=0,l=this.length,ret=[],pos=rneedsContext.test(selectors)||"string"!=typeof selectors?jQuery(selectors,context||this.context):0;i-1:jQuery.find.matchesSelector(cur,selectors)){ret.push(cur);break}cur=cur.parentNode}return this.pushStack(ret.length>1?jQuery.unique(ret):ret)},index:function(elem){return elem?"string"==typeof elem?jQuery.inArray(this[0],jQuery(elem)):jQuery.inArray(elem.jquery?elem[0]:elem,this):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(selector,context){var set="string"==typeof selector?jQuery(selector,context):jQuery.makeArray(selector&&selector.nodeType?[selector]:selector),all=jQuery.merge(this.get(),set);return this.pushStack(jQuery.unique(all))},addBack:function(selector){return this.add(null==selector?this.prevObject:this.prevObject.filter(selector))}}),jQuery.fn.andSelf=jQuery.fn.addBack,jQuery.each({parent:function(elem){var parent=elem.parentNode;return parent&&11!==parent.nodeType?parent:null},parents:function(elem){return jQuery.dir(elem,"parentNode")},parentsUntil:function(elem,i,until){return jQuery.dir(elem,"parentNode",until)},next:function(elem){return sibling(elem,"nextSibling")},prev:function(elem){return sibling(elem,"previousSibling")},nextAll:function(elem){return jQuery.dir(elem,"nextSibling")},prevAll:function(elem){return jQuery.dir(elem,"previousSibling")},nextUntil:function(elem,i,until){return jQuery.dir(elem,"nextSibling",until)},prevUntil:function(elem,i,until){return jQuery.dir(elem,"previousSibling",until)},siblings:function(elem){return jQuery.sibling((elem.parentNode||{}).firstChild,elem)},children:function(elem){return jQuery.sibling(elem.firstChild)},contents:function(elem){return jQuery.nodeName(elem,"iframe")?elem.contentDocument||elem.contentWindow.document:jQuery.merge([],elem.childNodes)}},function(name,fn){jQuery.fn[name]=function(until,selector){var ret=jQuery.map(this,fn,until);return runtil.test(name)||(selector=until),selector&&"string"==typeof selector&&(ret=jQuery.filter(selector,ret)),ret=this.length>1&&!guaranteedUnique[name]?jQuery.unique(ret):ret,this.length>1&&rparentsprev.test(name)&&(ret=ret.reverse()),this.pushStack(ret)}}),jQuery.extend({filter:function(expr,elems,not){return not&&(expr=":not("+expr+")"),1===elems.length?jQuery.find.matchesSelector(elems[0],expr)?[elems[0]]:[]:jQuery.find.matches(expr,elems)},dir:function(elem,dir,until){for(var matched=[],cur=elem[dir];cur&&9!==cur.nodeType&&(until===undefined||1!==cur.nodeType||!jQuery(cur).is(until));)1===cur.nodeType&&matched.push(cur),cur=cur[dir];return matched},sibling:function(n,elem){for(var r=[];n;n=n.nextSibling)1===n.nodeType&&n!==elem&&r.push(n);return r}});var nodeNames="abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",rinlinejQuery=/ jQuery\d+="(?:null|\d+)"/g,rnoshimcache=new RegExp("<(?:"+nodeNames+")[\\s/>]","i"),rleadingWhitespace=/^\s+/,rxhtmlTag=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,rtagName=/<([\w:]+)/,rtbody=/\s*$/g,wrapMap={option:[1,""],legend:[1,"
","
"],area:[1,"",""],param:[1,"",""],thead:[1,"","
"],tr:[2,"","
"],col:[2,"","
"],td:[3,"","
"],_default:jQuery.support.htmlSerialize?[0,"",""]:[1,"X
","
"]},safeFragment=createSafeFragment(document),fragmentDiv=safeFragment.appendChild(document.createElement("div"));wrapMap.optgroup=wrapMap.option,wrapMap.tbody=wrapMap.tfoot=wrapMap.colgroup=wrapMap.caption=wrapMap.thead,wrapMap.th=wrapMap.td,jQuery.fn.extend({text:function(value){return jQuery.access(this,function(value){return value===undefined?jQuery.text(this):this.empty().append((this[0]&&this[0].ownerDocument||document).createTextNode(value))},null,value,arguments.length)},wrapAll:function(html){if(jQuery.isFunction(html))return this.each(function(i){jQuery(this).wrapAll(html.call(this,i))});if(this[0]){var wrap=jQuery(html,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&wrap.insertBefore(this[0]),wrap.map(function(){for(var elem=this;elem.firstChild&&1===elem.firstChild.nodeType;)elem=elem.firstChild;return elem}).append(this)}return this},wrapInner:function(html){return jQuery.isFunction(html)?this.each(function(i){jQuery(this).wrapInner(html.call(this,i))}):this.each(function(){var self=jQuery(this),contents=self.contents();contents.length?contents.wrapAll(html):self.append(html)})},wrap:function(html){var isFunction=jQuery.isFunction(html);return this.each(function(i){jQuery(this).wrapAll(isFunction?html.call(this,i):html)})},unwrap:function(){return this.parent().each(function(){jQuery.nodeName(this,"body")||jQuery(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(elem){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||this.appendChild(elem)})},prepend:function(){return this.domManip(arguments,!0,function(elem){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||this.insertBefore(elem,this.firstChild)})},before:function(){return this.domManip(arguments,!1,function(elem){this.parentNode&&this.parentNode.insertBefore(elem,this)})},after:function(){return this.domManip(arguments,!1,function(elem){this.parentNode&&this.parentNode.insertBefore(elem,this.nextSibling)})},remove:function(selector,keepData){for(var elem,i=0;null!=(elem=this[i]);i++)(!selector||jQuery.filter(selector,[elem]).length>0)&&(keepData||1!==elem.nodeType||jQuery.cleanData(getAll(elem)), +elem.parentNode&&(keepData&&jQuery.contains(elem.ownerDocument,elem)&&setGlobalEval(getAll(elem,"script")),elem.parentNode.removeChild(elem)));return this},empty:function(){for(var elem,i=0;null!=(elem=this[i]);i++){for(1===elem.nodeType&&jQuery.cleanData(getAll(elem,!1));elem.firstChild;)elem.removeChild(elem.firstChild);elem.options&&jQuery.nodeName(elem,"select")&&(elem.options.length=0)}return this},clone:function(dataAndEvents,deepDataAndEvents){return dataAndEvents=null!=dataAndEvents&&dataAndEvents,deepDataAndEvents=null==deepDataAndEvents?dataAndEvents:deepDataAndEvents,this.map(function(){return jQuery.clone(this,dataAndEvents,deepDataAndEvents)})},html:function(value){return jQuery.access(this,function(value){var elem=this[0]||{},i=0,l=this.length;if(value===undefined)return 1===elem.nodeType?elem.innerHTML.replace(rinlinejQuery,""):undefined;if("string"==typeof value&&!rnoInnerhtml.test(value)&&(jQuery.support.htmlSerialize||!rnoshimcache.test(value))&&(jQuery.support.leadingWhitespace||!rleadingWhitespace.test(value))&&!wrapMap[(rtagName.exec(value)||["",""])[1].toLowerCase()]){value=value.replace(rxhtmlTag,"<$1>");try{for(;i")?clone=elem.cloneNode(!0):(fragmentDiv.innerHTML=elem.outerHTML,fragmentDiv.removeChild(clone=fragmentDiv.firstChild)),!(jQuery.support.noCloneEvent&&jQuery.support.noCloneChecked||1!==elem.nodeType&&11!==elem.nodeType||jQuery.isXMLDoc(elem)))for(destElements=getAll(clone),srcElements=getAll(elem),i=0;null!=(node=srcElements[i]);++i)destElements[i]&&fixCloneNodeIssues(node,destElements[i]);if(dataAndEvents)if(deepDataAndEvents)for(srcElements=srcElements||getAll(elem),destElements=destElements||getAll(clone),i=0;null!=(node=srcElements[i]);i++)cloneCopyEvent(node,destElements[i]);else cloneCopyEvent(elem,clone);return destElements=getAll(clone,"script"),destElements.length>0&&setGlobalEval(destElements,!inPage&&getAll(elem,"script")),destElements=srcElements=node=null,clone},buildFragment:function(elems,context,scripts,selection){for(var j,elem,contains,tmp,tag,tbody,wrap,l=elems.length,safe=createSafeFragment(context),nodes=[],i=0;i")+wrap[2],j=wrap[0];j--;)tmp=tmp.lastChild;if(!jQuery.support.leadingWhitespace&&rleadingWhitespace.test(elem)&&nodes.push(context.createTextNode(rleadingWhitespace.exec(elem)[0])),!jQuery.support.tbody)for(elem="table"!==tag||rtbody.test(elem)?""!==wrap[1]||rtbody.test(elem)?0:tmp:tmp.firstChild,j=elem&&elem.childNodes.length;j--;)jQuery.nodeName(tbody=elem.childNodes[j],"tbody")&&!tbody.childNodes.length&&elem.removeChild(tbody);for(jQuery.merge(nodes,tmp.childNodes),tmp.textContent="";tmp.firstChild;)tmp.removeChild(tmp.firstChild);tmp=safe.lastChild}else nodes.push(context.createTextNode(elem));for(tmp&&safe.removeChild(tmp),jQuery.support.appendChecked||jQuery.grep(getAll(nodes,"input"),fixDefaultChecked),i=0;elem=nodes[i++];)if((!selection||jQuery.inArray(elem,selection)===-1)&&(contains=jQuery.contains(elem.ownerDocument,elem),tmp=getAll(safe.appendChild(elem),"script"),contains&&setGlobalEval(tmp),scripts))for(j=0;elem=tmp[j++];)rscriptType.test(elem.type||"")&&scripts.push(elem);return tmp=null,safe},cleanData:function(elems,acceptData){for(var elem,type,id,data,i=0,internalKey=jQuery.expando,cache=jQuery.cache,deleteExpando=jQuery.support.deleteExpando,special=jQuery.event.special;null!=(elem=elems[i]);i++)if((acceptData||jQuery.acceptData(elem))&&(id=elem[internalKey],data=id&&cache[id])){if(data.events)for(type in data.events)special[type]?jQuery.event.remove(elem,type):jQuery.removeEvent(elem,type,data.handle);cache[id]&&(delete cache[id],deleteExpando?delete elem[internalKey]:typeof elem.removeAttribute!==core_strundefined?elem.removeAttribute(internalKey):elem[internalKey]=null,core_deletedIds.push(id))}}});var iframe,getStyles,curCSS,ralpha=/alpha\([^)]*\)/i,ropacity=/opacity\s*=\s*([^)]*)/,rposition=/^(top|right|bottom|left)$/,rdisplayswap=/^(none|table(?!-c[ea]).+)/,rmargin=/^margin/,rnumsplit=new RegExp("^("+core_pnum+")(.*)$","i"),rnumnonpx=new RegExp("^("+core_pnum+")(?!px)[a-z%]+$","i"),rrelNum=new RegExp("^([+-])=("+core_pnum+")","i"),elemdisplay={BODY:"block"},cssShow={position:"absolute",visibility:"hidden",display:"block"},cssNormalTransform={letterSpacing:0,fontWeight:400},cssExpand=["Top","Right","Bottom","Left"],cssPrefixes=["Webkit","O","Moz","ms"];jQuery.fn.extend({css:function(name,value){return jQuery.access(this,function(elem,name,value){var len,styles,map={},i=0;if(jQuery.isArray(name)){for(styles=getStyles(elem),len=name.length;i1)},show:function(){return showHide(this,!0)},hide:function(){return showHide(this)},toggle:function(state){var bool="boolean"==typeof state;return this.each(function(){(bool?state:isHidden(this))?jQuery(this).show():jQuery(this).hide()})}}),jQuery.extend({cssHooks:{opacity:{get:function(elem,computed){if(computed){var ret=curCSS(elem,"opacity");return""===ret?"1":ret}}}},cssNumber:{columnCount:!0,fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":jQuery.support.cssFloat?"cssFloat":"styleFloat"},style:function(elem,name,value,extra){if(elem&&3!==elem.nodeType&&8!==elem.nodeType&&elem.style){var ret,type,hooks,origName=jQuery.camelCase(name),style=elem.style;if(name=jQuery.cssProps[origName]||(jQuery.cssProps[origName]=vendorPropName(style,origName)),hooks=jQuery.cssHooks[name]||jQuery.cssHooks[origName],value===undefined)return hooks&&"get"in hooks&&(ret=hooks.get(elem,!1,extra))!==undefined?ret:style[name];if(type=typeof value,"string"===type&&(ret=rrelNum.exec(value))&&(value=(ret[1]+1)*ret[2]+parseFloat(jQuery.css(elem,name)),type="number"),!(null==value||"number"===type&&isNaN(value)||("number"!==type||jQuery.cssNumber[origName]||(value+="px"),jQuery.support.clearCloneStyle||""!==value||0!==name.indexOf("background")||(style[name]="inherit"),hooks&&"set"in hooks&&(value=hooks.set(elem,value,extra))===undefined)))try{style[name]=value}catch(e){}}},css:function(elem,name,extra,styles){var num,val,hooks,origName=jQuery.camelCase(name);return name=jQuery.cssProps[origName]||(jQuery.cssProps[origName]=vendorPropName(elem.style,origName)),hooks=jQuery.cssHooks[name]||jQuery.cssHooks[origName],hooks&&"get"in hooks&&(val=hooks.get(elem,!0,extra)),val===undefined&&(val=curCSS(elem,name,styles)),"normal"===val&&name in cssNormalTransform&&(val=cssNormalTransform[name]),""===extra||extra?(num=parseFloat(val),extra===!0||jQuery.isNumeric(num)?num||0:val):val},swap:function(elem,options,callback,args){var ret,name,old={};for(name in options)old[name]=elem.style[name],elem.style[name]=options[name];ret=callback.apply(elem,args||[]);for(name in options)elem.style[name]=old[name];return ret}}),window.getComputedStyle?(getStyles=function(elem){return window.getComputedStyle(elem,null)},curCSS=function(elem,name,_computed){var width,minWidth,maxWidth,computed=_computed||getStyles(elem),ret=computed?computed.getPropertyValue(name)||computed[name]:undefined,style=elem.style;return computed&&(""!==ret||jQuery.contains(elem.ownerDocument,elem)||(ret=jQuery.style(elem,name)),rnumnonpx.test(ret)&&rmargin.test(name)&&(width=style.width,minWidth=style.minWidth,maxWidth=style.maxWidth,style.minWidth=style.maxWidth=style.width=ret,ret=computed.width,style.width=width,style.minWidth=minWidth,style.maxWidth=maxWidth)),ret}):document.documentElement.currentStyle&&(getStyles=function(elem){return elem.currentStyle},curCSS=function(elem,name,_computed){var left,rs,rsLeft,computed=_computed||getStyles(elem),ret=computed?computed[name]:undefined,style=elem.style;return null==ret&&style&&style[name]&&(ret=style[name]),rnumnonpx.test(ret)&&!rposition.test(name)&&(left=style.left,rs=elem.runtimeStyle,rsLeft=rs&&rs.left,rsLeft&&(rs.left=elem.currentStyle.left),style.left="fontSize"===name?"1em":ret,ret=style.pixelLeft+"px",style.left=left,rsLeft&&(rs.left=rsLeft)),""===ret?"auto":ret}),jQuery.each(["height","width"],function(i,name){jQuery.cssHooks[name]={get:function(elem,computed,extra){if(computed)return 0===elem.offsetWidth&&rdisplayswap.test(jQuery.css(elem,"display"))?jQuery.swap(elem,cssShow,function(){return getWidthOrHeight(elem,name,extra)}):getWidthOrHeight(elem,name,extra)},set:function(elem,value,extra){var styles=extra&&getStyles(elem);return setPositiveNumber(elem,value,extra?augmentWidthOrHeight(elem,name,extra,jQuery.support.boxSizing&&"border-box"===jQuery.css(elem,"boxSizing",!1,styles),styles):0)}}}),jQuery.support.opacity||(jQuery.cssHooks.opacity={get:function(elem,computed){return ropacity.test((computed&&elem.currentStyle?elem.currentStyle.filter:elem.style.filter)||"")?.01*parseFloat(RegExp.$1)+"":computed?"1":""},set:function(elem,value){var style=elem.style,currentStyle=elem.currentStyle,opacity=jQuery.isNumeric(value)?"alpha(opacity="+100*value+")":"",filter=currentStyle&¤tStyle.filter||style.filter||"";style.zoom=1,(value>=1||""===value)&&""===jQuery.trim(filter.replace(ralpha,""))&&style.removeAttribute&&(style.removeAttribute("filter"),""===value||currentStyle&&!currentStyle.filter)||(style.filter=ralpha.test(filter)?filter.replace(ralpha,opacity):filter+" "+opacity)}}),jQuery(function(){jQuery.support.reliableMarginRight||(jQuery.cssHooks.marginRight={get:function(elem,computed){if(computed)return jQuery.swap(elem,{display:"inline-block"},curCSS,[elem,"marginRight"])}}),!jQuery.support.pixelPosition&&jQuery.fn.position&&jQuery.each(["top","left"],function(i,prop){jQuery.cssHooks[prop]={get:function(elem,computed){if(computed)return computed=curCSS(elem,prop),rnumnonpx.test(computed)?jQuery(elem).position()[prop]+"px":computed}}})}),jQuery.expr&&jQuery.expr.filters&&(jQuery.expr.filters.hidden=function(elem){return elem.offsetWidth<=0&&elem.offsetHeight<=0||!jQuery.support.reliableHiddenOffsets&&"none"===(elem.style&&elem.style.display||jQuery.css(elem,"display"))},jQuery.expr.filters.visible=function(elem){return!jQuery.expr.filters.hidden(elem)}),jQuery.each({margin:"",padding:"",border:"Width"},function(prefix,suffix){jQuery.cssHooks[prefix+suffix]={expand:function(value){for(var i=0,expanded={},parts="string"==typeof value?value.split(" "):[value];i<4;i++)expanded[prefix+cssExpand[i]+suffix]=parts[i]||parts[i-2]||parts[0];return expanded}},rmargin.test(prefix)||(jQuery.cssHooks[prefix+suffix].set=setPositiveNumber)});var r20=/%20/g,rbracket=/\[\]$/,rCRLF=/\r?\n/g,rsubmitterTypes=/^(?:submit|button|image|reset|file)$/i,rsubmittable=/^(?:input|select|textarea|keygen)/i;jQuery.fn.extend({serialize:function(){return jQuery.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var elements=jQuery.prop(this,"elements");return elements?jQuery.makeArray(elements):this}).filter(function(){var type=this.type;return this.name&&!jQuery(this).is(":disabled")&&rsubmittable.test(this.nodeName)&&!rsubmitterTypes.test(type)&&(this.checked||!manipulation_rcheckableType.test(type))}).map(function(i,elem){var val=jQuery(this).val();return null==val?null:jQuery.isArray(val)?jQuery.map(val,function(val){return{name:elem.name,value:val.replace(rCRLF,"\r\n")}}):{name:elem.name,value:val.replace(rCRLF,"\r\n")}}).get()}}),jQuery.param=function(a,traditional){var prefix,s=[],add=function(key,value){value=jQuery.isFunction(value)?value():null==value?"":value,s[s.length]=encodeURIComponent(key)+"="+encodeURIComponent(value)};if(traditional===undefined&&(traditional=jQuery.ajaxSettings&&jQuery.ajaxSettings.traditional),jQuery.isArray(a)||a.jquery&&!jQuery.isPlainObject(a))jQuery.each(a,function(){add(this.name,this.value)});else for(prefix in a)buildParams(prefix,a[prefix],traditional,add);return s.join("&").replace(r20,"+")},jQuery.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "),function(i,name){jQuery.fn[name]=function(data,fn){return arguments.length>0?this.on(name,null,data,fn):this.trigger(name)}}),jQuery.fn.hover=function(fnOver,fnOut){return this.mouseenter(fnOver).mouseleave(fnOut||fnOver)};var ajaxLocParts,ajaxLocation,ajax_nonce=jQuery.now(),ajax_rquery=/\?/,rhash=/#.*$/,rts=/([?&])_=[^&]*/,rheaders=/^(.*?):[ \t]*([^\r\n]*)\r?$/gm,rlocalProtocol=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,rnoContent=/^(?:GET|HEAD)$/,rprotocol=/^\/\//,rurl=/^([\w.+-]+:)(?:\/\/([^\/?#:]*)(?::(\d+)|)|)/,_load=jQuery.fn.load,prefilters={},transports={},allTypes="*/".concat("*");try{ajaxLocation=location.href}catch(e){ajaxLocation=document.createElement("a"),ajaxLocation.href="",ajaxLocation=ajaxLocation.href}ajaxLocParts=rurl.exec(ajaxLocation.toLowerCase())||[],jQuery.fn.load=function(url,params,callback){if("string"!=typeof url&&_load)return _load.apply(this,arguments);var selector,response,type,self=this,off=url.indexOf(" ");return off>=0&&(selector=url.slice(off,url.length),url=url.slice(0,off)),jQuery.isFunction(params)?(callback=params,params=undefined):params&&"object"==typeof params&&(type="POST"),self.length>0&&jQuery.ajax({url:url,type:type,dataType:"html",data:params}).done(function(responseText){response=arguments,self.html(selector?jQuery("
").append(jQuery.parseHTML(responseText)).find(selector):responseText)}).complete(callback&&function(jqXHR,status){self.each(callback,response||[jqXHR.responseText,status,jqXHR])}),this},jQuery.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(i,type){jQuery.fn[type]=function(fn){return this.on(type,fn)}}),jQuery.each(["get","post"],function(i,method){jQuery[method]=function(url,data,callback,type){return jQuery.isFunction(data)&&(type=type||callback,callback=data,data=undefined),jQuery.ajax({url:url,type:method,dataType:type,data:data,success:callback})}}),jQuery.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:ajaxLocation,type:"GET",isLocal:rlocalProtocol.test(ajaxLocParts[1]),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":allTypes,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":window.String,"text html":!0,"text json":jQuery.parseJSON,"text xml":jQuery.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(target,settings){return settings?ajaxExtend(ajaxExtend(target,jQuery.ajaxSettings),settings):ajaxExtend(jQuery.ajaxSettings,target)},ajaxPrefilter:addToPrefiltersOrTransports(prefilters),ajaxTransport:addToPrefiltersOrTransports(transports),ajax:function(url,options){function done(status,nativeStatusText,responses,headers){var isSuccess,success,error,response,modified,statusText=nativeStatusText;2!==state&&(state=2,timeoutTimer&&clearTimeout(timeoutTimer),transport=undefined,responseHeadersString=headers||"",jqXHR.readyState=status>0?4:0,responses&&(response=ajaxHandleResponses(s,jqXHR,responses)),status>=200&&status<300||304===status?(s.ifModified&&(modified=jqXHR.getResponseHeader("Last-Modified"),modified&&(jQuery.lastModified[cacheURL]=modified),modified=jqXHR.getResponseHeader("etag"),modified&&(jQuery.etag[cacheURL]=modified)),204===status?(isSuccess=!0,statusText="nocontent"):304===status?(isSuccess=!0,statusText="notmodified"):(isSuccess=ajaxConvert(s,response),statusText=isSuccess.state,success=isSuccess.data,error=isSuccess.error,isSuccess=!error)):(error=statusText,!status&&statusText||(statusText="error",status<0&&(status=0))),jqXHR.status=status,jqXHR.statusText=(nativeStatusText||statusText)+"",isSuccess?deferred.resolveWith(callbackContext,[success,statusText,jqXHR]):deferred.rejectWith(callbackContext,[jqXHR,statusText,error]),jqXHR.statusCode(statusCode),statusCode=undefined,fireGlobals&&globalEventContext.trigger(isSuccess?"ajaxSuccess":"ajaxError",[jqXHR,s,isSuccess?success:error]),completeDeferred.fireWith(callbackContext,[jqXHR,statusText]),fireGlobals&&(globalEventContext.trigger("ajaxComplete",[jqXHR,s]),--jQuery.active||jQuery.event.trigger("ajaxStop")))}"object"==typeof url&&(options=url,url=undefined),options=options||{};var parts,i,cacheURL,responseHeadersString,timeoutTimer,fireGlobals,transport,responseHeaders,s=jQuery.ajaxSetup({},options),callbackContext=s.context||s,globalEventContext=s.context&&(callbackContext.nodeType||callbackContext.jquery)?jQuery(callbackContext):jQuery.event,deferred=jQuery.Deferred(),completeDeferred=jQuery.Callbacks("once memory"),statusCode=s.statusCode||{},requestHeaders={},requestHeadersNames={},state=0,strAbort="canceled",jqXHR={readyState:0,getResponseHeader:function(key){var match;if(2===state){if(!responseHeaders)for(responseHeaders={};match=rheaders.exec(responseHeadersString);)responseHeaders[match[1].toLowerCase()]=match[2];match=responseHeaders[key.toLowerCase()]}return null==match?null:match},getAllResponseHeaders:function(){return 2===state?responseHeadersString:null},setRequestHeader:function(name,value){var lname=name.toLowerCase();return state||(name=requestHeadersNames[lname]=requestHeadersNames[lname]||name,requestHeaders[name]=value),this},overrideMimeType:function(type){return state||(s.mimeType=type),this},statusCode:function(map){var code;if(map)if(state<2)for(code in map)statusCode[code]=[statusCode[code],map[code]];else jqXHR.always(map[jqXHR.status]);return this},abort:function(statusText){var finalText=statusText||strAbort;return transport&&transport.abort(finalText),done(0,finalText),this}};if(deferred.promise(jqXHR).complete=completeDeferred.add,jqXHR.success=jqXHR.done,jqXHR.error=jqXHR.fail,s.url=((url||s.url||ajaxLocation)+"").replace(rhash,"").replace(rprotocol,ajaxLocParts[1]+"//"),s.type=options.method||options.type||s.method||s.type,s.dataTypes=jQuery.trim(s.dataType||"*").toLowerCase().match(core_rnotwhite)||[""],null==s.crossDomain&&(parts=rurl.exec(s.url.toLowerCase()),s.crossDomain=!(!parts||parts[1]===ajaxLocParts[1]&&parts[2]===ajaxLocParts[2]&&(parts[3]||("http:"===parts[1]?80:443))==(ajaxLocParts[3]||("http:"===ajaxLocParts[1]?80:443)))),s.data&&s.processData&&"string"!=typeof s.data&&(s.data=jQuery.param(s.data,s.traditional)),inspectPrefiltersOrTransports(prefilters,s,options,jqXHR),2===state)return jqXHR;fireGlobals=s.global,fireGlobals&&0===jQuery.active++&&jQuery.event.trigger("ajaxStart"),s.type=s.type.toUpperCase(),s.hasContent=!rnoContent.test(s.type),cacheURL=s.url,s.hasContent||(s.data&&(cacheURL=s.url+=(ajax_rquery.test(cacheURL)?"&":"?")+s.data,delete s.data),s.cache===!1&&(s.url=rts.test(cacheURL)?cacheURL.replace(rts,"$1_="+ajax_nonce++):cacheURL+(ajax_rquery.test(cacheURL)?"&":"?")+"_="+ajax_nonce++)),s.ifModified&&(jQuery.lastModified[cacheURL]&&jqXHR.setRequestHeader("If-Modified-Since",jQuery.lastModified[cacheURL]),jQuery.etag[cacheURL]&&jqXHR.setRequestHeader("If-None-Match",jQuery.etag[cacheURL])),(s.data&&s.hasContent&&s.contentType!==!1||options.contentType)&&jqXHR.setRequestHeader("Content-Type",s.contentType),jqXHR.setRequestHeader("Accept",s.dataTypes[0]&&s.accepts[s.dataTypes[0]]?s.accepts[s.dataTypes[0]]+("*"!==s.dataTypes[0]?", "+allTypes+"; q=0.01":""):s.accepts["*"]);for(i in s.headers)jqXHR.setRequestHeader(i,s.headers[i]);if(s.beforeSend&&(s.beforeSend.call(callbackContext,jqXHR,s)===!1||2===state))return jqXHR.abort();strAbort="abort";for(i in{success:1,error:1,complete:1})jqXHR[i](s[i]);if(transport=inspectPrefiltersOrTransports(transports,s,options,jqXHR)){jqXHR.readyState=1,fireGlobals&&globalEventContext.trigger("ajaxSend",[jqXHR,s]),s.async&&s.timeout>0&&(timeoutTimer=setTimeout(function(){jqXHR.abort("timeout")},s.timeout));try{state=1,transport.send(requestHeaders,done)}catch(e){if(!(state<2))throw e;done(-1,e)}}else done(-1,"No Transport");return jqXHR},getScript:function(url,callback){return jQuery.get(url,undefined,callback,"script")},getJSON:function(url,data,callback){return jQuery.get(url,data,callback,"json")}}),jQuery.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/(?:java|ecma)script/},converters:{"text script":function(text){return jQuery.globalEval(text),text}}}),jQuery.ajaxPrefilter("script",function(s){s.cache===undefined&&(s.cache=!1),s.crossDomain&&(s.type="GET",s.global=!1)}),jQuery.ajaxTransport("script",function(s){if(s.crossDomain){var script,head=document.head||jQuery("head")[0]||document.documentElement;return{send:function(_,callback){script=document.createElement("script"),script.async=!0,s.scriptCharset&&(script.charset=s.scriptCharset),script.src=s.url,script.onload=script.onreadystatechange=function(_,isAbort){(isAbort||!script.readyState||/loaded|complete/.test(script.readyState))&&(script.onload=script.onreadystatechange=null,script.parentNode&&script.parentNode.removeChild(script),script=null,isAbort||callback(200,"success"))},head.insertBefore(script,head.firstChild)},abort:function(){script&&script.onload(undefined,!0)}}}});var oldCallbacks=[],rjsonp=/(=)\?(?=&|$)|\?\?/;jQuery.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var callback=oldCallbacks.pop()||jQuery.expando+"_"+ajax_nonce++;return this[callback]=!0,callback}}),jQuery.ajaxPrefilter("json jsonp",function(s,originalSettings,jqXHR){var callbackName,overwritten,responseContainer,jsonProp=s.jsonp!==!1&&(rjsonp.test(s.url)?"url":"string"==typeof s.data&&!(s.contentType||"").indexOf("application/x-www-form-urlencoded")&&rjsonp.test(s.data)&&"data");if(jsonProp||"jsonp"===s.dataTypes[0])return callbackName=s.jsonpCallback=jQuery.isFunction(s.jsonpCallback)?s.jsonpCallback():s.jsonpCallback,jsonProp?s[jsonProp]=s[jsonProp].replace(rjsonp,"$1"+callbackName):s.jsonp!==!1&&(s.url+=(ajax_rquery.test(s.url)?"&":"?")+s.jsonp+"="+callbackName),s.converters["script json"]=function(){return responseContainer||jQuery.error(callbackName+" was not called"),responseContainer[0]},s.dataTypes[0]="json",overwritten=window[callbackName],window[callbackName]=function(){responseContainer=arguments},jqXHR.always(function(){window[callbackName]=overwritten,s[callbackName]&&(s.jsonpCallback=originalSettings.jsonpCallback,oldCallbacks.push(callbackName)),responseContainer&&jQuery.isFunction(overwritten)&&overwritten(responseContainer[0]),responseContainer=overwritten=undefined}),"script"});var xhrCallbacks,xhrSupported,xhrId=0,xhrOnUnloadAbort=window.ActiveXObject&&function(){var key;for(key in xhrCallbacks)xhrCallbacks[key](undefined,!0)};jQuery.ajaxSettings.xhr=window.ActiveXObject?function(){return!this.isLocal&&createStandardXHR()||createActiveXHR()}:createStandardXHR,xhrSupported=jQuery.ajaxSettings.xhr(),jQuery.support.cors=!!xhrSupported&&"withCredentials"in xhrSupported,xhrSupported=jQuery.support.ajax=!!xhrSupported,xhrSupported&&jQuery.ajaxTransport(function(s){if(!s.crossDomain||jQuery.support.cors){var callback;return{send:function(headers,complete){var handle,i,xhr=s.xhr();if(s.username?xhr.open(s.type,s.url,s.async,s.username,s.password):xhr.open(s.type,s.url,s.async),s.xhrFields)for(i in s.xhrFields)xhr[i]=s.xhrFields[i];s.mimeType&&xhr.overrideMimeType&&xhr.overrideMimeType(s.mimeType),s.crossDomain||headers["X-Requested-With"]||(headers["X-Requested-With"]="XMLHttpRequest");try{for(i in headers)xhr.setRequestHeader(i,headers[i])}catch(err){}xhr.send(s.hasContent&&s.data||null),callback=function(_,isAbort){var status,responseHeaders,statusText,responses;try{if(callback&&(isAbort||4===xhr.readyState))if(callback=undefined,handle&&(xhr.onreadystatechange=jQuery.noop,xhrOnUnloadAbort&&delete xhrCallbacks[handle]),isAbort)4!==xhr.readyState&&xhr.abort();else{responses={},status=xhr.status,responseHeaders=xhr.getAllResponseHeaders(),"string"==typeof xhr.responseText&&(responses.text=xhr.responseText);try{statusText=xhr.statusText}catch(e){statusText=""}status||!s.isLocal||s.crossDomain?1223===status&&(status=204):status=responses.text?200:404}}catch(firefoxAccessException){isAbort||complete(-1,firefoxAccessException)}responses&&complete(status,statusText,responses,responseHeaders)},s.async?4===xhr.readyState?setTimeout(callback):(handle=++xhrId,xhrOnUnloadAbort&&(xhrCallbacks||(xhrCallbacks={},jQuery(window).unload(xhrOnUnloadAbort)),xhrCallbacks[handle]=callback),xhr.onreadystatechange=callback):callback()},abort:function(){callback&&callback(undefined,!0)}}}});var fxNow,timerId,rfxtypes=/^(?:toggle|show|hide)$/,rfxnum=new RegExp("^(?:([+-])=|)("+core_pnum+")([a-z%]*)$","i"),rrun=/queueHooks$/,animationPrefilters=[defaultPrefilter],tweeners={"*":[function(prop,value){var end,unit,tween=this.createTween(prop,value),parts=rfxnum.exec(value),target=tween.cur(),start=+target||0,scale=1,maxIterations=20;if(parts){if(end=+parts[2],unit=parts[3]||(jQuery.cssNumber[prop]?"":"px"),"px"!==unit&&start){start=jQuery.css(tween.elem,prop,!0)||end||1;do scale=scale||".5",start/=scale,jQuery.style(tween.elem,prop,start+unit);while(scale!==(scale=tween.cur()/target)&&1!==scale&&--maxIterations)}tween.unit=unit,tween.start=start,tween.end=parts[1]?start+(parts[1]+1)*end:end}return tween}]};jQuery.Animation=jQuery.extend(Animation,{tweener:function(props,callback){jQuery.isFunction(props)?(callback=props,props=["*"]):props=props.split(" ");for(var prop,index=0,length=props.length;index-1,props={},curPosition={},curTop,curLeft;calculatePosition?(curPosition=curElem.position(),curTop=curPosition.top,curLeft=curPosition.left):(curTop=parseFloat(curCSSTop)||0,curLeft=parseFloat(curCSSLeft)||0),jQuery.isFunction(options)&&(options=options.call(elem,i,curOffset)),null!=options.top&&(props.top=options.top-curOffset.top+curTop),null!=options.left&&(props.left=options.left-curOffset.left+curLeft),"using"in options?options.using.call(elem,props):curElem.css(props)}},jQuery.fn.extend({position:function(){if(this[0]){var offsetParent,offset,parentOffset={top:0,left:0},elem=this[0];return"fixed"===jQuery.css(elem,"position")?offset=elem.getBoundingClientRect():(offsetParent=this.offsetParent(),offset=this.offset(),jQuery.nodeName(offsetParent[0],"html")||(parentOffset=offsetParent.offset()),parentOffset.top+=jQuery.css(offsetParent[0],"borderTopWidth",!0),parentOffset.left+=jQuery.css(offsetParent[0],"borderLeftWidth",!0)),{top:offset.top-parentOffset.top-jQuery.css(elem,"marginTop",!0),left:offset.left-parentOffset.left-jQuery.css(elem,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){for(var offsetParent=this.offsetParent||document.documentElement;offsetParent&&!jQuery.nodeName(offsetParent,"html")&&"static"===jQuery.css(offsetParent,"position");)offsetParent=offsetParent.offsetParent;return offsetParent||document.documentElement})}}),jQuery.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(method,prop){var top=/Y/.test(prop);jQuery.fn[method]=function(val){return jQuery.access(this,function(elem,method,val){var win=getWindow(elem);return val===undefined?win?prop in win?win[prop]:win.document.documentElement[method]:elem[method]:void(win?win.scrollTo(top?jQuery(win).scrollLeft():val,top?val:jQuery(win).scrollTop()):elem[method]=val)},method,val,arguments.length,null)}}),jQuery.each({Height:"height",Width:"width"},function(name,type){jQuery.each({padding:"inner"+name,content:type,"":"outer"+name},function(defaultExtra,funcName){jQuery.fn[funcName]=function(margin,value){var chainable=arguments.length&&(defaultExtra||"boolean"!=typeof margin),extra=defaultExtra||(margin===!0||value===!0?"margin":"border");return jQuery.access(this,function(elem,type,value){var doc;return jQuery.isWindow(elem)?elem.document.documentElement["client"+name]:9===elem.nodeType?(doc=elem.documentElement,Math.max(elem.body["scroll"+name],doc["scroll"+name],elem.body["offset"+name],doc["offset"+name],doc["client"+name])):value===undefined?jQuery.css(elem,type,extra):jQuery.style(elem,type,value,extra)},type,chainable?margin:undefined,chainable,null)}})}),BI.jQuery=BI.$=jQuery,window.$=window.$||jQuery,window.jQuery=window.jQuery||jQuery,"function"==typeof define&&define.amd&&define.amd.jQuery&&define("jquery",[],function(){return jQuery})}(window),BI.$.extend(BI.$.Event.prototype,{stopEvent:function(){this.stopPropagation(),this.preventDefault()}}),BI.jQuery&&(!function($){$.fn.insets||($.fn.insets=function(){var p=this.padding(),b=this.border();return{top:p.top,bottom:p.bottom+b.bottom+b.top,left:p.left,right:p.right+b.right+b.left}}),$.fn.bounds||($.fn.bounds=function(value){var tmp={hasIgnoredBounds:!0};return value?(isNaN(value.x)||(tmp.left=value.x),isNaN(value.y)||(tmp.top=value.y),null!=value.width&&(tmp.width=value.width-(this.outerWidth(!0)-this.width()),tmp.width=tmp.width>=0?tmp.width:value.width),null!=value.height&&(tmp.height=value.height-(this.outerHeight(!0)-this.height()),tmp.height=tmp.height>=0?tmp.height:value.height),this.css(tmp),this):(tmp=this.position(),{x:tmp.left,y:tmp.top,width:this.outerWidth(),height:this.outerHeight()})})}(BI.jQuery),BI.extend(BI.jQuery.fn,{destroy:function(){this.remove(),BI.isIE()===!0&&(this[0].outerHTML="")},__textKeywordMarked__:function(text,keyword,py){if(!BI.isKey(keyword)||(text+"").length>100)return this.html(BI.htmlEncode(text));keyword+="",keyword=BI.toUpperCase(keyword);var textLeft=(text||"")+"";for(py=(py||BI.makeFirstPY(text))+"",null!=py&&(py=BI.toUpperCase(py)),this.empty();py.length>0&&textLeft.length>0;){var tidx=BI.toUpperCase(textLeft).indexOf(keyword),pidx=null;if(null!=py&&(pidx=py.indexOf(keyword),pidx>=0&&(pidx%=text.length)),tidx>=0)this.append(BI.htmlEncode(textLeft.substr(0,tidx))),this.append(BI.$("").addClass("bi-keyword-red-mark").html(BI.htmlEncode(textLeft.substr(tidx,keyword.length)))),textLeft=textLeft.substr(tidx+keyword.length),null!=py&&(py=py.substr(tidx+keyword.length));else{if(!(null!=pidx&&pidx>=0&&Math.floor(pidx/text.length)===Math.floor((pidx+keyword.length-1)/text.length))){this.append(BI.htmlEncode(textLeft));break}this.append(BI.htmlEncode(textLeft.substr(0,pidx))),this.append(BI.$("").addClass("bi-keyword-red-mark").html(BI.htmlEncode(textLeft.substr(pidx,keyword.length)))),null!=py&&(py=py.substr(pidx+keyword.length)),textLeft=textLeft.substr(pidx+keyword.length)}}return this},getDomHeight:function(parent){var clone=BI.$(this).clone();clone.appendTo(BI.$(parent||"body"));var height=clone.height();return clone.remove(),height},hasVerticalScroll:function(){return this.height()>0&&this[0].clientWidth0&&this[0].clientHeightoffset2Body.left+width||e.pageYoffset2Body.top+height)},__hasZIndexMask__:function(zindex){return zindex&&null!=this.zIndexMask[zindex]},__buildZIndexMask__:function(zindex,domArray){this.zIndexMask=this.zIndexMask||{},this.indexMask=this.indexMask||[];var mask=BI.createWidget({type:"bi.center_adapt",cls:"bi-z-index-mask",items:domArray});return mask.element.css({"z-index":zindex}),BI.createWidget({type:"bi.absolute",element:this,items:[{el:mask,left:0,right:0,top:0,bottom:0}]}),this.indexMask.push(mask),zindex&&(this.zIndexMask[zindex]=mask),mask.element},__releaseZIndexMask__:function(zindex){if(zindex&&this.zIndexMask[zindex])return BI.remove(this.indexMask,this.zIndexMask[zindex]),void this.zIndexMask[zindex].destroy();this.indexMask=this.indexMask||[];var indexMask=this.indexMask.pop();indexMask&&indexMask.destroy()}})),_.extend(BI,{$import:function(){function loadReady(src,must){var $scripts=BI.$("head script, body script");BI.$.each($scripts,function(i,item){item.src.indexOf(src)!=-1&&(_LOADED[src]=!0)});var $links=BI.$("head link");BI.$.each($links,function(i,item){item.href.indexOf(src)!=-1&&must&&(_LOADED[src]=!1,BI.$(item).remove())})}var _LOADED={};return function(src,ext,must){if(loadReady(src,must),_LOADED[src]!==!0)if("css"===ext){var link=document.createElement("link");link.rel="stylesheet",link.type="text/css",link.href=src;var head=document.getElementsByTagName("head")[0];head.appendChild(link),_LOADED[src]=!0}else BI.$.ajax({url:src,dataType:"script",async:!1,cache:!0,complete:function(res,status){"success"==status&&(_LOADED[src]=!0)}})}}()}),Number.prototype.toFixed&&"0.000"===8e-5.toFixed(3)&&"0"!==.9.toFixed(0)&&"1.25"===1.255.toFixed(2)&&"1000000000000000128"===(0xde0b6b3a7640080).toFixed(0)||!function(){function multiply(n,c){for(var i=-1;++i=0;)c+=data[i],data[i]=Math.floor(c/n),c=c%n*base}function toString(){for(var i=size,s="";--i>=0;)if(""!==s||0===i||0!==data[i]){var t=String(data[i]);""===s?s=t:s+="0000000".slice(0,7-t.length)+t}return s}function pow(x,n,acc){return 0===n?acc:n%2===1?pow(x,n-1,acc*x):pow(x*x,n/2,acc)}function log(x){for(var n=0;x>=4096;)n+=12,x/=4096;for(;x>=2;)n+=1,x/=2;return n}var base,size,data,i;base=1e7,size=6,data=[0,0,0,0,0,0],Number.prototype.toFixed=function(fractionDigits){var f,x,s,m,e,z,j,k;if(f=Number(fractionDigits),f=f!==f?0:Math.floor(f),f<0||f>20)throw new RangeError("Number.toFixed called with invalid number of decimals");if(x=Number(this),x!==x)return"NaN";if(x<=-1e21||x>1e21)return String(x);if(s="",x<0&&(s="-",x=-x),m="0",x>1e-21)if(e=log(x*pow(2,69,1))-69,z=e<0?x*pow(2,-e,1):x/pow(2,e,1),z*=4503599627370496,e=52-e,e>0){for(multiply(0,z),j=f;j>=7;)multiply(1e7,0),j-=7;for(multiply(pow(10,j,1),0),j=e-1;j>=23;)divide(1<<23),j-=23;divide(1<0?(k=m.length,m=k<=f?s+"0.0000000000000000000".slice(0,f-k+2)+m:s+m.slice(0,k-f)+"."+m.slice(k-f)):m=s+m,m}}(),_.extend(BI,{MAX:0x1000000000000000,MIN:-0x1000000000000000,EVENT_RESPONSE_TIME:200,zIndex_layer:1e5,zIndex_popover:1e6,zIndex_popup:1e7,zIndex_masker:1e8,zIndex_tip:1e9,emptyStr:"",emptyFn:function(){},empty:null,Key:{48:"0",49:"1",50:"2",51:"3",52:"4",53:"5",54:"6",55:"7",56:"8",57:"9",65:"a",66:"b",67:"c",68:"d",69:"e",70:"f",71:"g",72:"h",73:"i",74:"j",75:"k",76:"l",77:"m",78:"n",79:"o",80:"p",81:"q",82:"r",83:"s",84:"t",85:"u",86:"v",87:"w",88:"x",89:"y",90:"z",96:"0",97:"1",98:"2",99:"3",100:"4",101:"5",102:"6",103:"7",104:"8",105:"9",106:"*",107:"+",109:"-",110:".",111:"/"},KeyCode:{BACKSPACE:8,COMMA:188,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,LEFT:37,NUMPAD_ADD:107,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106,NUMPAD_SUBTRACT:109,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SPACE:32,TAB:9,UP:38},Status:{SUCCESS:1,WRONG:2,START:3,END:4,WAITING:5,READY:6,RUNNING:7,OUTOFBOUNDS:8,NULL:-1},Direction:{Top:"top",Bottom:"bottom",Left:"left",Right:"right",Custom:"custom"},Axis:{Vertical:"vertical",Horizontal:"horizontal"},Selection:{Default:-2,None:-1,Single:0,Multi:1,All:2},HorizontalAlign:{Left:"left",Right:"right",Center:"center",Stretch:"stretch"},VerticalAlign:{Middle:"middle",Top:"top",Bottom:"bottom",Stretch:"stretch"},StartOfWeek:1}),BI.version="2.0",BI.AbsoluteCenterLayout=BI.inherit(BI.Layout,{props:function(){return BI.extend(BI.AbsoluteCenterLayout.superclass.props.apply(this,arguments),{baseCls:"bi-absolute-center-layout",hgap:0,lgap:0,rgap:0,vgap:0,tgap:0,bgap:0})},render:function(){BI.AbsoluteCenterLayout.superclass.render.apply(this,arguments),this.populate(this.options.items)},_addElement:function(i,item){var o=this.options,w=BI.AbsoluteCenterLayout.superclass._addElement.apply(this,arguments);return w.element.css({position:"absolute",left:o.hgap+o.lgap+(item.lgap||0)+(item.hgap||0),right:o.hgap+o.rgap+(item.rgap||0)+(item.hgap||0),top:o.vgap+o.tgap+(item.tgap||0)+(item.vgap||0),bottom:o.vgap+o.bgap+(item.bgap||0)+(item.vgap||0),margin:"auto"}),w},resize:function(){},populate:function(items){BI.AbsoluteCenterLayout.superclass.populate.apply(this,arguments),this._mount()}}),BI.shortcut("bi.absolute_center_adapt",BI.AbsoluteCenterLayout),BI.AbsoluteHorizontalLayout=BI.inherit(BI.Layout,{props:function(){return BI.extend(BI.AbsoluteHorizontalLayout.superclass.props.apply(this,arguments),{baseCls:"bi-absolute-horizontal-layout",hgap:0,lgap:0,rgap:0,vgap:0,tgap:0,bgap:0})},render:function(){BI.AbsoluteHorizontalLayout.superclass.render.apply(this,arguments),this.populate(this.options.items)},_addElement:function(i,item){var o=this.options,w=BI.AbsoluteHorizontalLayout.superclass._addElement.apply(this,arguments);return w.element.css({position:"absolute",left:o.hgap+o.lgap+(item.lgap||0)+(item.hgap||0),right:o.hgap+o.rgap+(item.rgap||0)+(item.hgap||0),margin:"auto"}),o.vgap+o.tgap+(item.vgap||0)+(item.tgap||0)!==0&&w.element.css("top",o.vgap+o.tgap+(item.tgap||0)+(item.vgap||0)),o.vgap+o.bgap+(item.vgap||0)+(item.bgap||0)!==0&&w.element.css("bottom",o.vgap+o.bgap+(item.bgap||0)+(item.vgap||0)),w},resize:function(){},populate:function(items){BI.AbsoluteHorizontalLayout.superclass.populate.apply(this,arguments),this._mount()}}),BI.shortcut("bi.absolute_horizontal_adapt",BI.AbsoluteHorizontalLayout),BI.AbsoluteVerticalLayout=BI.inherit(BI.Layout,{props:function(){return BI.extend(BI.AbsoluteVerticalLayout.superclass.props.apply(this,arguments),{baseCls:"bi-absolute-vertical-layout",hgap:0,lgap:0,rgap:0,vgap:0,tgap:0,bgap:0})},render:function(){BI.AbsoluteVerticalLayout.superclass.render.apply(this,arguments),this.populate(this.options.items)},_addElement:function(i,item){var o=this.options,w=BI.AbsoluteVerticalLayout.superclass._addElement.apply(this,arguments);return w.element.css({position:"absolute",left:item.lgap,right:item.rgap,top:o.vgap+o.tgap+(item.tgap||0)+(item.vgap||0),bottom:o.vgap+o.bgap+(item.bgap||0)+(item.vgap||0),margin:"auto"}),o.hgap+o.lgap+(item.hgap||0)+(item.lgap||0)!==0&&w.element.css("left",o.hgap+o.lgap+(item.lgap||0)+(item.hgap||0)),o.hgap+o.rgap+(item.hgap||0)+(item.rgap||0)!==0&&w.element.css("right",o.hgap+o.rgap+(item.rgap||0)+(item.hgap||0)),w},resize:function(){},populate:function(items){BI.AbsoluteVerticalLayout.superclass.populate.apply(this,arguments),this._mount()}}),BI.shortcut("bi.absolute_vertical_adapt",BI.AbsoluteVerticalLayout),BI.CenterAdaptLayout=BI.inherit(BI.Layout,{props:function(){return BI.extend(BI.CenterAdaptLayout.superclass.props.apply(this,arguments),{baseCls:"bi-center-adapt-layout",horizontalAlign:BI.HorizontalAlign.Center,columnSize:[],scrollx:!1,hgap:0,vgap:0,lgap:0,rgap:0,tgap:0,bgap:0})},render:function(){var o=this.options,self=this;return BI.CenterAdaptLayout.superclass.render.apply(this,arguments),{type:"bi.horizontal",verticalAlign:BI.VerticalAlign.Middle,horizontalAlign:o.horizontalAlign,columnSize:o.columnSize,scrollx:o.scrollx,items:o.items,ref:function(_ref){self.layout=_ref},hgap:o.hgap,vgap:o.vgap,lgap:o.lgap,rgap:o.rgap,tgap:o.tgap,bgap:o.bgap}},resize:function(){},populate:function(items){this.layout.populate.apply(this,arguments)}}),BI.shortcut("bi.center_adapt",BI.CenterAdaptLayout),BI.HorizontalAdaptLayout=BI.inherit(BI.Layout,{props:function(){return BI.extend(BI.HorizontalAdaptLayout.superclass.props.apply(this,arguments),{baseCls:"bi-horizontal-adapt-layout",verticalAlign:BI.VerticalAlign.Top,horizontalAlign:BI.HorizontalAlign.Center,columnSize:[],scrollx:!1,hgap:0,vgap:0,lgap:0,rgap:0,tgap:0,bgap:0})},render:function(){var self=this,o=this.options;return BI.HorizontalAdaptLayout.superclass.render.apply(this,arguments),{type:"bi.horizontal",verticalAlign:BI.VerticalAlign.Top,horizontalAlign:o.horizontalAlign,columnSize:o.columnSize,items:o.items,scrollx:o.scrollx,ref:function(_ref){self.layout=_ref},hgap:o.hgap,vgap:o.vgap,lgap:o.lgap,rgap:o.rgap,tgap:o.tgap,bgap:o.bgap}},resize:function(){},populate:function(items){this.layout.populate.apply(this,arguments)}}),BI.shortcut("bi.horizontal_adapt",BI.HorizontalAdaptLayout),BI.LeftRightVerticalAdaptLayout=BI.inherit(BI.Layout,{props:function(){return BI.extend(BI.LeftRightVerticalAdaptLayout.superclass.props.apply(this,arguments),{baseCls:"bi-left-right-vertical-adapt-layout",items:{},llgap:0,lrgap:0,lhgap:0,rlgap:0,rrgap:0,rhgap:0})},render:function(){var o=this.options,self=this;BI.LeftRightVerticalAdaptLayout.superclass.render.apply(this,arguments);var layoutArray=[];return"left"in o.items&&layoutArray.push({type:"bi.left",items:[{el:{type:"bi.vertical_adapt",height:"100%",items:o.items.left,hgap:o.lhgap,lgap:o.llgap,rgap:o.lrgap}}]}),"right"in o.items&&layoutArray.push({type:"bi.right",items:[{el:{type:"bi.vertical_adapt",height:"100%",items:o.items.right,textAlign:"right",hgap:o.rhgap,lgap:o.rlgap,rgap:o.rrgap}}]}),layoutArray},resize:function(){},addItem:function(){throw new Error("cannot be added")},populate:function(items){BI.LeftRightVerticalAdaptLayout.superclass.populate.apply(this,arguments),this._mount()}}),BI.shortcut("bi.left_right_vertical_adapt",BI.LeftRightVerticalAdaptLayout),BI.LeftVerticalAdaptLayout=BI.inherit(BI.Layout,{props:function(){return BI.extend(BI.LeftRightVerticalAdaptLayout.superclass.props.apply(this,arguments),{baseCls:"bi-left-vertical-adapt-layout",items:[],lgap:0,rgap:0,hgap:0})},render:function(){var o=this.options,self=this;return BI.LeftVerticalAdaptLayout.superclass.render.apply(this,arguments),{type:"bi.left",ref:function(_ref){self.layout=_ref},items:[{el:{type:"bi.vertical_adapt",height:"100%",items:o.items,lgap:o.lgap,hgap:o.hgap,rgap:o.rgap}}]}},resize:function(){},addItem:function(){throw new Error("cannot be added")},populate:function(items){this.layout.populate.apply(this,arguments)}}),BI.shortcut("bi.left_vertical_adapt",BI.LeftVerticalAdaptLayout),BI.RightVerticalAdaptLayout=BI.inherit(BI.Layout,{props:function(){return BI.extend(BI.RightVerticalAdaptLayout.superclass.props.apply(this,arguments),{baseCls:"bi-right-vertical-adapt-layout",items:[],lgap:0,rgap:0,hgap:0})},render:function(){var o=this.options,self=this;return BI.RightVerticalAdaptLayout.superclass.render.apply(this,arguments),{type:"bi.right",ref:function(_ref){self.layout=_ref},items:[{el:{type:"bi.vertical_adapt",height:"100%",textAlign:"right",items:o.items,lgap:o.lgap,hgap:o.hgap,rgap:o.rgap}}]}},resize:function(){},addItem:function(){throw new Error("cannot be added")},populate:function(items){this.layout.populate.apply(this,arguments)}}),BI.shortcut("bi.right_vertical_adapt",BI.RightVerticalAdaptLayout),BI.TableAdaptLayout=BI.inherit(BI.Layout,{props:function(){return BI.extend(BI.TableAdaptLayout.superclass.props.apply(this,arguments),{baseCls:"bi-table-center-adapt-layout",columnSize:[],verticalAlign:BI.VerticalAlign.Top,horizontalAlign:BI.HorizontalAlign.Left,scrollx:!0,hgap:0,vgap:0,lgap:0,rgap:0,tgap:0,bgap:0})},render:function(){var o=this.options;BI.TableAdaptLayout.superclass.render.apply(this,arguments),this.$table=BI.Widget._renderEngine.createElement("
").css({position:"relative",display:"table",height:o.verticalAlign===BI.VerticalAlign.Middle?"100%":"auto",width:o.horizontalAlign===BI.HorizontalAlign.Center?"100%":"auto","white-space":"nowrap"}),this.populate(this.options.items)},_addElement:function(i,item){var o=this.options,td,width=o.columnSize[i]<=1?100*o.columnSize[i]+"%":o.columnSize[i];if(this.hasWidget(this._getChildName(i)))td=this.getWidgetByName(this._getChildName(i)),td.element.width(width);else{var w=BI.createWidget(item);w.element.css({position:"relative",top:"0",left:"0",margin:"0px auto"}),td=BI.createWidget({type:"bi.default",width:width,items:[w]}),this.addWidget(this._getChildName(i),td)}return td.element.css({"max-width":o.columnSize[i]<=1?width:width+"px"}),0===i&&td.element.addClass("first-element"),td.element.css({position:"relative",display:"table-cell","vertical-align":o.verticalAlign,margin:"0",padding:"0",height:"100%"}),o.vgap+o.tgap+(item.tgap||0)+(item.vgap||0)!==0&&w.element.css({"margin-top":o.vgap+o.tgap+(item.tgap||0)+(item.vgap||0)+"px"}),o.hgap+o.lgap+(item.lgap||0)+(item.hgap||0)!==0&&w.element.css({"margin-left":(0===i?o.hgap:0)+o.lgap+(item.lgap||0)+(item.hgap||0)+"px"}),o.hgap+o.rgap+(item.rgap||0)+(item.hgap||0)!==0&&w.element.css({"margin-right":o.hgap+o.rgap+(item.rgap||0)+(item.hgap||0)+"px"}),o.vgap+o.bgap+(item.bgap||0)+(item.vgap||0)!==0&&w.element.css({"margin-bottom":o.vgap+o.bgap+(item.bgap||0)+(item.vgap||0)+"px"}),td},appendFragment:function(frag){this.$table.append(frag),this.element.append(this.$table)},resize:function(){},populate:function(items){BI.TableAdaptLayout.superclass.populate.apply(this,arguments),this._mount()}}),BI.shortcut("bi.table_adapt",BI.TableAdaptLayout),BI.VerticalAdaptLayout=BI.inherit(BI.Layout,{props:{baseCls:"bi-vertical-adapt-layout",horizontalAlign:BI.HorizontalAlign.Left,columnSize:[],scrollx:!1,hgap:0,vgap:0,lgap:0,rgap:0,tgap:0,bgap:0},render:function(){var self=this,o=this.options;return BI.VerticalAdaptLayout.superclass.render.apply(this,arguments),{type:"bi.horizontal",verticalAlign:BI.VerticalAlign.Middle,horizontalAlign:o.horizontalAlign,columnSize:o.columnSize,items:o.items,scrollx:o.scrollx,ref:function(_ref){self.layout=_ref},hgap:o.hgap,vgap:o.vgap,lgap:o.lgap,rgap:o.rgap,tgap:o.tgap,bgap:o.bgap}},resize:function(){},populate:function(items){this.layout.populate.apply(this,arguments)}}),BI.shortcut("bi.vertical_adapt",BI.VerticalAdaptLayout),BI.HorizontalAutoLayout=BI.inherit(BI.Layout,{props:function(){return BI.extend(BI.HorizontalAutoLayout.superclass.props.apply(this,arguments),{baseCls:"bi-horizon-auto-layout",hgap:0,lgap:0,rgap:0,vgap:0,tgap:0,bgap:0})},render:function(){BI.HorizontalAutoLayout.superclass.render.apply(this,arguments),this.populate(this.options.items)},_addElement:function(i,item){var o=this.options,w=BI.HorizontalAutoLayout.superclass._addElement.apply(this,arguments);return w.element.css({position:"relative",margin:"0px auto"}),o.vgap+o.tgap+(item.tgap||0)+(item.vgap||0)!==0&&w.element.css({"margin-top":(0===i?o.vgap:0)+o.tgap+(item.tgap||0)+(item.vgap||0)+"px"}),o.hgap+o.lgap+(item.lgap||0)+(item.hgap||0)!==0&&w.element.css({"margin-left":o.hgap+o.lgap+(item.lgap||0)+(item.hgap||0)+"px"}),o.hgap+o.rgap+(item.rgap||0)+(item.hgap||0)!==0&&w.element.css({"margin-right":o.hgap+o.rgap+(item.rgap||0)+(item.hgap||0)+"px"}),o.vgap+o.bgap+(item.bgap||0)+(item.vgap||0)!==0&&w.element.css({"margin-bottom":o.vgap+o.bgap+(item.bgap||0)+(item.vgap||0)+"px"}),w},resize:function(){},populate:function(items){BI.HorizontalAutoLayout.superclass.populate.apply(this,arguments),this._mount()}}),BI.shortcut("bi.horizontal_auto",BI.HorizontalAutoLayout),BI.FloatHorizontalLayout=BI.inherit(BI.Layout,{props:function(){return BI.extend(BI.FloatHorizontalLayout.superclass.props.apply(this,arguments),{baseCls:"bi-float-horizontal-adapt-layout",items:[],hgap:0,vgap:0,tgap:0,bgap:0,lgap:0,rgap:0})},render:function(){BI.FloatHorizontalLayout.superclass.render.apply(this,arguments),this.populate(this.options.items)},resize:function(){},mounted:function(){var self=this,width=this.left.element.width(),height=this.left.element.height();this.left.element.width(width).height(height).css("float","none"),BI.remove(this._children,function(i,wi){wi===self.container&&delete self._children[i]}),BI.createWidget({type:"bi.horizontal_auto",element:this,items:[this.left]})},_addElement:function(i,item){var self=this,o=this.options;return this.left=BI.createWidget({type:"bi.vertical",items:[item],hgap:o.hgap,vgap:o.vgap,tgap:o.tgap,bgap:o.bgap,lgap:o.lgap,rgap:o.rgap}),this.container=BI.createWidget({type:"bi.left",element:this,items:[this.left]}),this.left},populate:function(items){BI.HorizontalAutoLayout.superclass.populate.apply(this,arguments),this._mount()}}),BI.shortcut("bi.horizontal_float",BI.FloatHorizontalLayout),BI.InlineCenterAdaptLayout=BI.inherit(BI.Layout,{props:function(){return BI.extend(BI.InlineLayout.superclass.props.apply(this,arguments),{baseCls:"bi-inline-center-adapt-layout",hgap:0,vgap:0,lgap:0,rgap:0,tgap:0,bgap:0})},render:function(){BI.InlineCenterAdaptLayout.superclass.render.apply(this,arguments),this.element.css({whiteSpace:"nowrap",textAlign:"center"}),this.populate(this.options.items)},_addElement:function(i,item,length){var o=this.options,w=BI.InlineVerticalAdaptLayout.superclass._addElement.apply(this,arguments);return w.element.css({position:"relative","vertical-align":"middle"}),w.element.addClass("inline-center-adapt-item"),o.vgap+o.tgap+(item.tgap||0)+(item.vgap||0)!==0&&w.element.css({"margin-top":o.vgap+o.tgap+(item.tgap||0)+(item.vgap||0)+"px"}),o.hgap+o.lgap+(item.lgap||0)+(item.hgap||0)!==0&&w.element.css({"margin-left":(0===i?o.hgap:0)+o.lgap+(item.lgap||0)+(item.hgap||0)+"px"}),o.hgap+o.rgap+(item.rgap||0)+(item.hgap||0)!==0&&w.element.css({"margin-right":o.hgap+o.rgap+(item.rgap||0)+(item.hgap||0)+"px"}),o.vgap+o.bgap+(item.bgap||0)+(item.vgap||0)!==0&&w.element.css({"margin-bottom":o.vgap+o.bgap+(item.bgap||0)+(item.vgap||0)+"px"}),w},resize:function(){this.stroke(this.options.items)},addItem:function(item){throw new Error("不能添加元素")},stroke:function(items){var self=this;BI.each(items,function(i,item){item&&self._addElement(i,item,items.length)})},populate:function(items){BI.InlineCenterAdaptLayout.superclass.populate.apply(this,arguments),this._mount()}}),BI.shortcut("bi.inline_center_adapt",BI.InlineCenterAdaptLayout),BI.InlineVerticalAdaptLayout=BI.inherit(BI.Layout,{props:function(){return BI.extend(BI.InlineLayout.superclass.props.apply(this,arguments),{baseCls:"bi-inline-vertical-adapt-layout",hgap:0,vgap:0,lgap:0,rgap:0,tgap:0,bgap:0,textAlign:"left"})},render:function(){BI.InlineVerticalAdaptLayout.superclass.render.apply(this,arguments);var o=this.options;this.element.css({whiteSpace:"nowrap",textAlign:o.textAlign}),this.populate(this.options.items)},_addElement:function(i,item){var o=this.options,w=BI.InlineVerticalAdaptLayout.superclass._addElement.apply(this,arguments);return w.element.css({position:"relative","vertical-align":"middle"}),w.element.addClass("inline-vertical-adapt-item"),o.vgap+o.tgap+(item.tgap||0)+(item.vgap||0)!==0&&w.element.css({"margin-top":o.vgap+o.tgap+(item.tgap||0)+(item.vgap||0)+"px"}),o.hgap+o.lgap+(item.lgap||0)+(item.hgap||0)!==0&&w.element.css({"margin-left":(0===i?o.hgap:0)+o.lgap+(item.lgap||0)+(item.hgap||0)+"px"}),o.hgap+o.rgap+(item.rgap||0)+(item.hgap||0)!==0&&w.element.css({"margin-right":o.hgap+o.rgap+(item.rgap||0)+(item.hgap||0)+"px"}),o.vgap+o.bgap+(item.bgap||0)+(item.vgap||0)!==0&&w.element.css({"margin-bottom":o.vgap+o.bgap+(item.bgap||0)+(item.vgap||0)+"px"}),w},resize:function(){this.stroke(this.options.items)},populate:function(items){BI.InlineVerticalAdaptLayout.superclass.populate.apply(this,arguments),this._mount()}}),BI.shortcut("bi.inline_vertical_adapt",BI.InlineVerticalAdaptLayout),BI.FlexCenterLayout=BI.inherit(BI.Layout,{props:function(){return BI.extend(BI.FlexCenterLayout.superclass.props.apply(this,arguments),{baseCls:"bi-flex-center-adapt-layout",hgap:0,vgap:0})},render:function(){BI.FlexCenterLayout.superclass.render.apply(this,arguments),this.populate(this.options.items)},_addElement:function(i,item){var o=this.options,w=BI.FlexCenterLayout.superclass._addElement.apply(this,arguments);return w.element.css({position:"relative","flex-shrink":"0","margin-left":(0===i?o.hgap:0)+"px","margin-right":o.hgap+"px","margin-top":o.vgap+"px","margin-bottom":o.vgap+"px"}),w},resize:function(){},populate:function(items){BI.FlexCenterLayout.superclass.populate.apply(this,arguments),this._mount()}}),BI.shortcut("bi.flex_center_adapt",BI.FlexCenterLayout),BI.FlexHorizontalCenter=BI.inherit(BI.Layout,{props:function(){return BI.extend(BI.FlexHorizontalCenter.superclass.props.apply(this,arguments),{baseCls:"bi-flex-horizontal-center-adapt-layout",verticalAlign:BI.VerticalAlign.Top,rowSize:[],scrolly:!1,hgap:0,vgap:0,lgap:0,rgap:0,tgap:0,bgap:0})},render:function(){var self=this,o=this.options;return{type:"bi.flex_vertical",ref:function(_ref){self.wrapper=_ref},horizontalAlign:BI.HorizontalAlign.Center,verticalAlign:o.verticalAlign,rowSize:o.rowSize,scrollx:o.scrollx,scrolly:o.scrolly,scrollable:o.scrollable,hgap:o.hgap,vgap:o.vgap,tgap:o.tgap,bgap:o.bgap,items:o.items}},resize:function(){},update:function(opt){return this.wrapper.update(opt)},populate:function(items){this.wrapper.populate(items)}}),BI.shortcut("bi.flex_horizontal_adapt",BI.FlexHorizontalCenter),BI.shortcut("bi.flex_horizontal_center_adapt",BI.FlexHorizontalCenter),BI.FlexHorizontalLayout=BI.inherit(BI.Layout,{props:function(){return BI.extend(BI.FlexHorizontalLayout.superclass.props.apply(this,arguments),{baseCls:"bi-flex-horizontal-layout",verticalAlign:BI.VerticalAlign.Top,horizontalAlign:BI.HorizontalAlign.Left,columnSize:[],scrollx:!0,hgap:0,vgap:0,lgap:0,rgap:0,tgap:0,bgap:0})},render:function(){BI.FlexHorizontalLayout.superclass.render.apply(this,arguments);var o=this.options;this.element.addClass("v-"+o.verticalAlign).addClass("h-"+o.horizontalAlign),this.populate(this.options.items)},_addElement:function(i,item){var o=this.options,w=BI.FlexHorizontalLayout.superclass._addElement.apply(this,arguments);return w.element.css({position:"relative","flex-shrink":"0"}),o.columnSize[i]>0&&w.element.width(o.columnSize[i]),"fill"===o.columnSize[i]&&w.element.css("flex","1"),o.vgap+o.tgap+(item.tgap||0)+(item.vgap||0)!==0&&w.element.css({"margin-top":o.vgap+o.tgap+(item.tgap||0)+(item.vgap||0)+"px"}),o.hgap+o.lgap+(item.lgap||0)+(item.hgap||0)!==0&&w.element.css({"margin-left":(0===i?o.hgap:0)+o.lgap+(item.lgap||0)+(item.hgap||0)+"px"}),o.hgap+o.rgap+(item.rgap||0)+(item.hgap||0)!==0&&w.element.css({ +"margin-right":o.hgap+o.rgap+(item.rgap||0)+(item.hgap||0)+"px"}),o.vgap+o.bgap+(item.bgap||0)+(item.vgap||0)!==0&&w.element.css({"margin-bottom":o.vgap+o.bgap+(item.bgap||0)+(item.vgap||0)+"px"}),w},resize:function(){},populate:function(items){BI.FlexHorizontalLayout.superclass.populate.apply(this,arguments),this._mount()}}),BI.shortcut("bi.flex_horizontal",BI.FlexHorizontalLayout),BI.FlexVerticalCenter=BI.inherit(BI.Layout,{props:function(){return BI.extend(BI.FlexVerticalCenter.superclass.props.apply(this,arguments),{baseCls:"bi-flex-vertical-center-adapt-layout",horizontalAlign:BI.HorizontalAlign.Left,columnSize:[],scrollx:!1,hgap:0,vgap:0,lgap:0,rgap:0,tgap:0,bgap:0})},render:function(){var self=this,o=this.options;return{type:"bi.flex_horizontal",ref:function(_ref){self.wrapper=_ref},verticalAlign:BI.VerticalAlign.Middle,horizontalAlign:o.horizontalAlign,columnSize:o.columnSize,scrollx:o.scrollx,scrolly:o.scrolly,scrollable:o.scrollable,vgap:o.vgap,lgap:o.lgap,rgap:o.rgap,hgap:o.hgap,items:o.items}},resize:function(){},update:function(opt){return this.wrapper.update(opt)},populate:function(items){this.wrapper.populate(items)}}),BI.shortcut("bi.flex_vertical_adapt",BI.FlexVerticalCenter),BI.shortcut("bi.flex_vertical_center_adapt",BI.FlexVerticalCenter),BI.FlexVerticalLayout=BI.inherit(BI.Layout,{props:function(){return BI.extend(BI.FlexVerticalLayout.superclass.props.apply(this,arguments),{baseCls:"bi-flex-vertical-layout",horizontalAlign:BI.HorizontalAlign.Left,verticalAlign:BI.VerticalAlign.Top,rowSize:[],scrolly:!0,hgap:0,vgap:0,lgap:0,rgap:0,tgap:0,bgap:0})},render:function(){BI.FlexVerticalLayout.superclass.render.apply(this,arguments);var o=this.options;this.element.addClass("h-"+o.horizontalAlign).addClass("v-"+o.verticalAlign),this.populate(this.options.items)},_addElement:function(i,item){var w=BI.FlexVerticalLayout.superclass._addElement.apply(this,arguments),o=this.options;return w.element.css({position:"relative","flex-shrink":"0"}),o.rowSize[i]>0&&w.element.height(o.rowSize[i]),"fill"===o.rowSize[i]&&w.element.css("flex","1"),o.vgap+o.tgap+(item.tgap||0)+(item.vgap||0)!==0&&w.element.css({"margin-top":(0===i?o.vgap:0)+o.tgap+(item.tgap||0)+(item.vgap||0)+"px"}),o.hgap+o.lgap+(item.lgap||0)+(item.hgap||0)!==0&&w.element.css({"margin-left":o.hgap+o.lgap+(item.lgap||0)+(item.hgap||0)+"px"}),o.hgap+o.rgap+(item.rgap||0)+(item.hgap||0)!==0&&w.element.css({"margin-right":o.hgap+o.rgap+(item.rgap||0)+(item.hgap||0)+"px"}),o.vgap+o.bgap+(item.bgap||0)+(item.vgap||0)!==0&&w.element.css({"margin-bottom":o.vgap+o.bgap+(item.bgap||0)+(item.vgap||0)+"px"}),w},resize:function(){},populate:function(items){BI.FlexVerticalLayout.superclass.populate.apply(this,arguments),this._mount()}}),BI.shortcut("bi.flex_vertical",BI.FlexVerticalLayout),BI.FlexWrapperCenterLayout=BI.inherit(BI.Layout,{props:function(){return BI.extend(BI.FlexWrapperCenterLayout.superclass.props.apply(this,arguments),{baseCls:"bi-flex-scrollable-center-adapt-layout clearfix",scrollable:!0})},render:function(){BI.FlexWrapperCenterLayout.superclass.render.apply(this,arguments),this.$wrapper=BI.Widget._renderEngine.createElement("
").addClass("flex-scrollable-center-adapt-layout-wrapper"),this.populate(this.options.items)},_addElement:function(i,item){var o=this.options,w=BI.FlexWrapperCenterLayout.superclass._addElement.apply(this,arguments);return w.element.css({position:"relative","margin-left":(0===i?o.hgap:0)+"px","margin-right":o.hgap+"px","margin-top":o.vgap+"px","margin-bottom":o.vgap+"px"}),w},appendFragment:function(frag){this.$wrapper.append(frag),this.element.append(this.$wrapper)},_getWrapper:function(){return this.$wrapper},resize:function(){},populate:function(items){BI.FlexWrapperCenterLayout.superclass.populate.apply(this,arguments),this._mount()}}),BI.shortcut("bi.flex_scrollable_center_adapt",BI.FlexWrapperCenterLayout),BI.FlexWrapperHorizontalCenter=BI.inherit(BI.Layout,{props:function(){return BI.extend(BI.FlexWrapperHorizontalCenter.superclass.props.apply(this,arguments),{baseCls:"bi-flex-scrollable-vertical-center-adapt-layout clearfix",verticalAlign:BI.VerticalAlign.Top,rowSize:[],scrollable:!0,scrolly:!1,hgap:0,vgap:0,lgap:0,rgap:0,tgap:0,bgap:0})},render:function(){var self=this,o=this.options;return{type:"bi.flex_scrollable_vertical",ref:function(_ref){self.wrapper=_ref},horizontalAlign:BI.HorizontalAlign.Center,verticalAlign:o.verticalAlign,rowSize:o.rowSize,scrollx:o.scrollx,scrolly:o.scrolly,scrollable:o.scrollable,hgap:o.hgap,vgap:o.vgap,tgap:o.tgap,bgap:o.bgap,items:o.items}},update:function(opt){return this.wrapper.update(opt)},populate:function(items){this.wrapper.populate(items)}}),BI.shortcut("bi.flex_scrollable_horizontal_adapt",BI.FlexWrapperHorizontalCenter),BI.shortcut("bi.flex_scrollable_horizontal_center_adapt",BI.FlexWrapperHorizontalCenter),BI.FlexWrapperHorizontalLayout=BI.inherit(BI.Layout,{props:function(){return BI.extend(BI.FlexWrapperHorizontalLayout.superclass.props.apply(this,arguments),{baseCls:"bi-flex-scrollable-horizontal-layout clearfix",verticalAlign:BI.VerticalAlign.Top,horizontalAlign:BI.HorizontalAlign.Left,columnSize:[],scrollable:null,scrollx:!0,hgap:0,vgap:0,lgap:0,rgap:0,tgap:0,bgap:0})},render:function(){BI.FlexWrapperHorizontalLayout.superclass.render.apply(this,arguments);var o=this.options;this.$wrapper=BI.Widget._renderEngine.createElement("
").addClass("flex-scrollable-horizontal-layout-wrapper v-"+o.verticalAlign).addClass("h-"+o.horizontalAlign),this.populate(this.options.items)},_addElement:function(i,item){var o=this.options,w=BI.FlexWrapperHorizontalLayout.superclass._addElement.apply(this,arguments);return w.element.css({position:"relative","flex-shrink":"0"}),o.columnSize[i]>0&&w.element.width(o.columnSize[i]),"fill"===o.columnSize[i]&&w.element.css("flex","1"),o.vgap+o.tgap+(item.tgap||0)+(item.vgap||0)!==0&&w.element.css({"margin-top":o.vgap+o.tgap+(item.tgap||0)+(item.vgap||0)+"px"}),o.hgap+o.lgap+(item.lgap||0)+(item.hgap||0)!==0&&w.element.css({"margin-left":(0===i?o.hgap:0)+o.lgap+(item.lgap||0)+(item.hgap||0)+"px"}),o.hgap+o.rgap+(item.rgap||0)+(item.hgap||0)!==0&&w.element.css({"margin-right":o.hgap+o.rgap+(item.rgap||0)+(item.hgap||0)+"px"}),o.vgap+o.bgap+(item.bgap||0)+(item.vgap||0)!==0&&w.element.css({"margin-bottom":o.vgap+o.bgap+(item.bgap||0)+(item.vgap||0)+"px"}),w},appendFragment:function(frag){this.$wrapper.append(frag),this.element.append(this.$wrapper)},_getWrapper:function(){return this.$wrapper},resize:function(){},populate:function(items){BI.FlexWrapperHorizontalLayout.superclass.populate.apply(this,arguments),this._mount()}}),BI.shortcut("bi.flex_scrollable_horizontal",BI.FlexWrapperHorizontalLayout),BI.FlexWrapperVerticalCenter=BI.inherit(BI.Layout,{props:function(){return BI.extend(BI.FlexWrapperVerticalCenter.superclass.props.apply(this,arguments),{baseCls:"bi-flex-scrollable-vertical-center-adapt-layout clearfix",horizontalAlign:BI.HorizontalAlign.Left,columnSize:[],scrollx:!1,scrollable:!0,hgap:0,vgap:0,lgap:0,rgap:0,tgap:0,bgap:0})},render:function(){var self=this,o=this.options;return{type:"bi.flex_scrollable_horizontal",ref:function(_ref){self.wrapper=_ref},verticalAlign:BI.VerticalAlign.Middle,horizontalAlign:o.horizontalAlign,columnSize:o.columnSize,scrollx:o.scrollx,scrolly:o.scrolly,scrollable:o.scrollable,hgap:o.hgap,vgap:o.vgap,lgap:o.lgap,rgap:o.rgap,items:o.items}},update:function(opt){return this.wrapper.update(opt)},populate:function(items){this.wrapper.populate(items)}}),BI.shortcut("bi.flex_scrollable_vertical_adapt",BI.FlexWrapperVerticalCenter),BI.shortcut("bi.flex_scrollable_vertical_center_adapt",BI.FlexWrapperVerticalCenter),BI.FlexWrapperVerticalLayout=BI.inherit(BI.Layout,{props:function(){return BI.extend(BI.FlexWrapperVerticalLayout.superclass.props.apply(this,arguments),{baseCls:"bi-flex-scrollable-vertical-layout clearfix",horizontalAlign:BI.HorizontalAlign.Left,verticalAlign:BI.VerticalAlign.Top,rowSize:[],scrollable:null,scrolly:!0,hgap:0,vgap:0,lgap:0,rgap:0,tgap:0,bgap:0})},render:function(){BI.FlexWrapperVerticalLayout.superclass.render.apply(this,arguments);var o=this.options;this.$wrapper=BI.Widget._renderEngine.createElement("
").addClass("flex-scrollable-vertical-layout-wrapper h-"+o.horizontalAlign).addClass("v-"+o.verticalAlign),this.populate(this.options.items)},_addElement:function(i,item){var o=this.options,w=BI.FlexWrapperVerticalLayout.superclass._addElement.apply(this,arguments);return w.element.css({position:"relative","flex-shrink":"0"}),o.rowSize[i]>0&&w.element.height(o.rowSize[i]),"fill"===o.rowSize[i]&&w.element.css("flex","1"),o.vgap+o.tgap+(item.tgap||0)+(item.vgap||0)!==0&&w.element.css({"margin-top":(0===i?o.vgap:0)+o.tgap+(item.tgap||0)+(item.vgap||0)+"px"}),o.hgap+o.lgap+(item.lgap||0)+(item.hgap||0)!==0&&w.element.css({"margin-left":o.hgap+o.lgap+(item.lgap||0)+(item.hgap||0)+"px"}),o.hgap+o.rgap+(item.rgap||0)+(item.hgap||0)!==0&&w.element.css({"margin-right":o.hgap+o.rgap+(item.rgap||0)+(item.hgap||0)+"px"}),o.vgap+o.bgap+(item.bgap||0)+(item.vgap||0)!==0&&w.element.css({"margin-bottom":o.vgap+o.bgap+(item.bgap||0)+(item.vgap||0)+"px"}),w},appendFragment:function(frag){this.$wrapper.append(frag),this.element.append(this.$wrapper)},_getWrapper:function(){return this.$wrapper},resize:function(){},populate:function(items){BI.FlexWrapperVerticalLayout.superclass.populate.apply(this,arguments),this._mount()}}),BI.shortcut("bi.flex_scrollable_vertical",BI.FlexWrapperVerticalLayout),BI.AbsoluteLayout=BI.inherit(BI.Layout,{props:function(){return BI.extend(BI.AbsoluteLayout.superclass.props.apply(this,arguments),{baseCls:"bi-absolute-layout",hgap:null,vgap:null,lgap:null,rgap:null,tgap:null,bgap:null})},render:function(){BI.AbsoluteLayout.superclass.render.apply(this,arguments),this.populate(this.options.items)},_addElement:function(i,item){var o=this.options,w=BI.AbsoluteLayout.superclass._addElement.apply(this,arguments),left=0,right=0,top=0,bottom=0;return BI.isNotNull(item.left)&&(w.element.css({left:item.left}),left+=item.left),BI.isNotNull(item.right)&&(w.element.css({right:item.right}),right+=item.right),BI.isNotNull(item.top)&&(w.element.css({top:item.top}),top+=item.top),BI.isNotNull(item.bottom)&&(w.element.css({bottom:item.bottom}),bottom+=item.bottom),BI.isNotNull(o.hgap)&&(left+=o.hgap,w.element.css({left:left}),right+=o.hgap,w.element.css({right:right})),BI.isNotNull(o.vgap)&&(top+=o.vgap,w.element.css({top:top}),bottom+=o.vgap,w.element.css({bottom:bottom})),BI.isNotNull(o.lgap)&&(left+=o.lgap,w.element.css({left:left})),BI.isNotNull(o.rgap)&&(right+=o.rgap,w.element.css({right:right})),BI.isNotNull(o.tgap)&&(top+=o.tgap,w.element.css({top:top})),BI.isNotNull(o.bgap)&&(bottom+=o.bgap,w.element.css({bottom:bottom})),BI.isNotNull(item.width)&&w.element.css({width:item.width}),BI.isNotNull(item.height)&&w.element.css({height:item.height}),w.element.css({position:"absolute"}),w},resize:function(){this.stroke(this.options.items)},stroke:function(items){this.options.items=items||[];var self=this;BI.each(items,function(i,item){if(item){if(!BI.isWidget(item)&&!item.el)throw new Error("el must be exist");self._addElement(i,item)}})},populate:function(items){BI.AbsoluteLayout.superclass.populate.apply(this,arguments),this._mount()}}),BI.shortcut("bi.absolute",BI.AbsoluteLayout),BI.AdaptiveLayout=BI.inherit(BI.Layout,{props:function(){return BI.extend(BI.AdaptiveLayout.superclass.props.apply(this,arguments),{baseCls:"bi-adaptive-layout",hgap:null,vgap:null,lgap:null,rgap:null,tgap:null,bgap:null})},render:function(){BI.AdaptiveLayout.superclass.render.apply(this,arguments),this.populate(this.options.items)},_addElement:function(i,item){var o=this.options,w=BI.AdaptiveLayout.superclass._addElement.apply(this,arguments);w.element.css({position:"relative"});var left=0,right=0,top=0,bottom=0;return BI.isNotNull(item.left)&&w.element.css({left:item.left}),BI.isNotNull(item.right)&&w.element.css({right:item.right}),BI.isNotNull(item.top)&&w.element.css({top:item.top}),BI.isNotNull(item.bottom)&&w.element.css({bottom:item.bottom}),BI.isNotNull(o.hgap)&&(left+=o.hgap,w.element.css({"margin-left":left}),right+=o.hgap,w.element.css({"margin-right":right})),BI.isNotNull(o.vgap)&&(top+=o.vgap,w.element.css({"margin-top":top}),bottom+=o.vgap,w.element.css({"margin-bottom":bottom})),BI.isNotNull(o.lgap)&&(left+=o.lgap,w.element.css({"margin-left":left})),BI.isNotNull(o.rgap)&&(right+=o.rgap,w.element.css({"margin-right":right})),BI.isNotNull(o.tgap)&&(top+=o.tgap,w.element.css({"margin-top":top})),BI.isNotNull(o.bgap)&&(bottom+=o.bgap,w.element.css({"margin-bottom":bottom})),BI.isNotNull(item.width)&&w.element.css({width:item.width}),BI.isNotNull(item.height)&&w.element.css({height:item.height}),w},resize:function(){this.stroke(this.options.items)},populate:function(items){BI.AbsoluteLayout.superclass.populate.apply(this,arguments),this._mount()}}),BI.shortcut("bi.adaptive",BI.AdaptiveLayout),BI.BorderLayout=BI.inherit(BI.Layout,{props:function(){return BI.extend(BI.BorderLayout.superclass.props.apply(this,arguments),{baseCls:"bi-border-layout",items:{}})},render:function(){BI.BorderLayout.superclass.render.apply(this,arguments),this.populate(this.options.items)},resize:function(){this.stroke(this.options.items)},addItem:function(item){throw new Error("cannot be added")},stroke:function(regions){var item,top=0,bottom=0,left=0,right=0;if("north"in regions&&(item=regions.north,null!=item)){if(item.el){if(!this.hasWidget(this.getName()+"north")){var w=BI.createWidget(item);this.addWidget(this.getName()+"north",w)}this.getWidgetByName(this.getName()+"north").element.height(item.height).css({position:"absolute",top:item.top||0,left:item.left||0,right:item.right||0,bottom:"initial"})}top=(item.height||0)+(item.top||0)+(item.bottom||0)}if("south"in regions&&(item=regions.south,null!=item)){if(item.el){if(!this.hasWidget(this.getName()+"south")){var w=BI.createWidget(item);this.addWidget(this.getName()+"south",w)}this.getWidgetByName(this.getName()+"south").element.height(item.height).css({position:"absolute",bottom:item.bottom||0,left:item.left||0,right:item.right||0,top:"initial"})}bottom=(item.height||0)+(item.top||0)+(item.bottom||0)}if("west"in regions&&(item=regions.west,null!=item)){if(item.el){if(!this.hasWidget(this.getName()+"west")){var w=BI.createWidget(item);this.addWidget(this.getName()+"west",w)}this.getWidgetByName(this.getName()+"west").element.width(item.width).css({position:"absolute",left:item.left||0,top:top,bottom:bottom,right:"initial"})}left=(item.width||0)+(item.left||0)+(item.right||0)}if("east"in regions&&(item=regions.east,null!=item)){if(item.el){if(!this.hasWidget(this.getName()+"east")){var w=BI.createWidget(item);this.addWidget(this.getName()+"east",w)}this.getWidgetByName(this.getName()+"east").element.width(item.width).css({position:"absolute",right:item.right||0,top:top,bottom:bottom,left:"initial"})}right=(item.width||0)+(item.left||0)+(item.right||0)}if("center"in regions&&(item=regions.center,null!=item)){if(!this.hasWidget(this.getName()+"center")){var w=BI.createWidget(item);this.addWidget(this.getName()+"center",w)}this.getWidgetByName(this.getName()+"center").element.css({position:"absolute",top:top,bottom:bottom,left:left,right:right})}},update:function(opt){},populate:function(items){BI.BorderLayout.superclass.populate.apply(this,arguments),this._mount()}}),BI.shortcut("bi.border",BI.BorderLayout),BI.CardLayout=BI.inherit(BI.Layout,{props:function(){return BI.extend(BI.CardLayout.superclass.props.apply(this,arguments),{baseCls:"bi-card-layout",items:[]})},render:function(){BI.CardLayout.superclass.render.apply(this,arguments),this.populate(this.options.items)},resize:function(){},stroke:function(items){var self=this,o=this.options;this.showIndex=void 0,BI.each(items,function(i,item){if(item){if(self.hasWidget(item.cardName))var w=self.getWidgetByName(item.cardName);else{var w=BI.createWidget(item);w.on(BI.Events.DESTROY,function(){var index=BI.findIndex(o.items,function(i,tItem){return tItem.cardName==item.cardName});index>-1&&o.items.splice(index,1)}),self.addWidget(item.cardName,w)}w.element.css({position:"absolute",top:"0",right:"0",bottom:"0",left:"0"}),w.setVisible(!1)}})},update:function(){},empty:function(){BI.CardLayout.superclass.empty.apply(this,arguments),this.options.items=[]},populate:function(items){BI.CardLayout.superclass.populate.apply(this,arguments),this._mount(),this.options.defaultShowName&&this.showCardByName(this.options.defaultShowName)},isCardExisted:function(cardName){return BI.some(this.options.items,function(i,item){return item.cardName==cardName&&item.el})},getCardByName:function(cardName){if(!this.isCardExisted(cardName))throw new Error("cardName is not exist");return this._children[cardName]},_deleteCardByName:function(cardName){delete this._children[cardName];var index=BI.findIndex(this.options.items,function(i,item){return item.cardName==cardName});index>-1&&this.options.items.splice(index,1)},deleteCardByName:function(cardName){if(!this.isCardExisted(cardName))throw new Error("cardName is not exist");var child=this._children[cardName];this._deleteCardByName(cardName),child&&child._destroy()},addCardByName:function(cardName,cardItem){if(this.isCardExisted(cardName))throw new Error("cardName is already exist");var widget=BI.createWidget(cardItem,this);return widget.element.css({position:"relative",top:"0",left:"0",width:"100%",height:"100%"}).appendTo(this.element),widget.invisible(),this.addWidget(cardName,widget),this.options.items.push({el:cardItem,cardName:cardName}),widget},showCardByName:function(name,action,callback){var self=this,exist=this.isCardExisted(name);null!=this.showIndex&&(this.lastShowIndex=this.showIndex),this.showIndex=name;var flag=!1;BI.each(this.options.items,function(i,item){var el=self._children[item.cardName];el&&(name!=item.cardName?!flag&&!exist&&BI.Action&&action instanceof BI.Action?(action.actionBack(el),flag=!0):el.invisible():BI.Action&&action instanceof BI.Action?action.actionPerformed(void 0,el,callback):(el.visible(),callback&&callback()))})},showLastCard:function(){var self=this;this.showIndex=this.lastShowIndex,BI.each(this.options.items,function(i,item){self._children[item.cardName].setVisible(self.showIndex==i)})},setDefaultShowName:function(name){return this.options.defaultShowName=name,this},getDefaultShowName:function(){return this.options.defaultShowName},getAllCardNames:function(){return BI.map(this.options.items,function(i,item){return item.cardName})},getShowingCard:function(){if(BI.isKey(this.showIndex))return this.getWidgetByName(this.showIndex)},deleteAllCard:function(){var self=this;BI.each(this.getAllCardNames(),function(i,name){self.deleteCardByName(name)})},hideAllCard:function(){var self=this;BI.each(this.options.items,function(i,item){self._children[item.cardName].invisible()})},isAllCardHide:function(){var self=this,flag=!0;return BI.some(this.options.items,function(i,item){if(self._children[item.cardName].isVisible())return flag=!1,!1}),flag},removeWidget:function(nameOrWidget){var removeName;BI.isWidget(nameOrWidget)?BI.each(this._children,function(name,child){child===nameOrWidget&&(removeName=name)}):removeName=nameOrWidget,removeName&&this._deleteCardByName(removeName)}}),BI.shortcut("bi.card",BI.CardLayout),BI.DefaultLayout=BI.inherit(BI.Layout,{props:function(){return BI.extend(BI.DefaultLayout.superclass.props.apply(this,arguments),{hgap:0,vgap:0,lgap:0,rgap:0,tgap:0,bgap:0,items:[]})},render:function(){BI.DefaultLayout.superclass.render.apply(this,arguments),this.populate(this.options.items)},_addElement:function(i,item){var o=this.options,w=BI.DefaultLayout.superclass._addElement.apply(this,arguments);return o.vgap+o.tgap+(item.tgap||0)!==0&&w.element.css({"margin-top":o.vgap+o.tgap+(item.tgap||0)+"px"}),o.hgap+o.lgap+(item.lgap||0)!==0&&w.element.css({"margin-left":o.hgap+o.lgap+(item.lgap||0)+"px"}),o.hgap+o.rgap+(item.rgap||0)!==0&&w.element.css({"margin-right":o.hgap+o.rgap+(item.rgap||0)+"px"}),o.vgap+o.bgap+(item.bgap||0)!==0&&w.element.css({"margin-bottom":o.vgap+o.bgap+(item.bgap||0)+"px"}),w},resize:function(){},populate:function(items){BI.DefaultLayout.superclass.populate.apply(this,arguments),this._mount()}}),BI.shortcut("bi.default",BI.DefaultLayout),BI.DivisionLayout=BI.inherit(BI.Layout,{props:function(){return BI.extend(BI.DivisionLayout.superclass.props.apply(this,arguments),{baseCls:"bi-division-layout",columns:null,rows:null,items:[]})},render:function(){BI.DivisionLayout.superclass.render.apply(this,arguments),this.populate(this.options.items)},resize:function(){this.stroke(this.opitons.items)},addItem:function(item){throw new Error("cannot be added")},stroke:function(items){function firstElement(item,row,col){0===row&&item.addClass("first-row"),0===col&&item.addClass("first-col"),item.addClass(BI.isOdd(row+1)?"odd-row":"even-row"),item.addClass(BI.isOdd(col+1)?"odd-col":"even-col"),item.addClass("center-element")}function firstObject(item,row,col){var cls="";0===row&&(cls+=" first-row"),0===col&&(cls+=" first-col"),cls+=BI.isOdd(row+1)?" odd-row":" even-row",cls+=BI.isOdd(col+1)?" odd-col":" even-col",item.cls=(item.cls||"")+cls+" center-element"}function first(item,row,col){item instanceof BI.Widget?firstElement(item.element,row,col):item.el instanceof BI.Widget?firstElement(item.el.element,row,col):item.el?firstObject(item.el,row,col):firstObject(item,row,col)}var o=this.options,rows=o.rows||o.items.length,columns=o.columns||0|(o.items[0]&&o.items[0].length),map=BI.makeArray(rows),widths={},heights={};BI.each(map,function(i){map[i]=BI.makeArray(columns)}),BI.each(items,function(i,item){return BI.isArray(item)?void BI.each(item,function(j,el){widths[i]=(widths[i]||0)+item.width,heights[j]=(heights[j]||0)+item.height,map[i][j]=el}):(widths[item.row]=(widths[item.row]||0)+item.width,heights[item.column]=(heights[item.column]||0)+item.height,void(map[item.row][item.column]=item))});for(var i=0;i0){var lastW=this.getWidgetByName(this.getName()+i+"_"+(j-1));lastW.element.css({right:100-left+"%"})}j==o.columns-1&&w.element.css({right:"0%"}),first(w,i,j),totalW+=map[i][j].width}for(var j=0;j0){var lastW=this.getWidgetByName(this.getName()+(i-1)+"_"+j);lastW.element.css({bottom:100-top+"%"})}i==o.rows-1&&w.element.css({bottom:"0%"}),totalH+=map[i][j].height}},update:function(){},populate:function(items){BI.DivisionLayout.superclass.populate.apply(this,arguments),this._mount()}}),BI.shortcut("bi.division",BI.DivisionLayout),BI.FloatLeftLayout=BI.inherit(BI.Layout,{props:function(){return BI.extend(BI.FloatLeftLayout.superclass.props.apply(this,arguments),{baseCls:"bi-float-left-layout clearfix",hgap:0,vgap:0,lgap:0,rgap:0,tgap:0,bgap:0})},render:function(){BI.FloatLeftLayout.superclass.render.apply(this,arguments),this.populate(this.options.items)},_addElement:function(i,item){var o=this.options,w=BI.FloatLeftLayout.superclass._addElement.apply(this,arguments);return w.element.css({position:"relative","float":"left"}),BI.isNotNull(item.left)&&w.element.css({left:item.left}),BI.isNotNull(item.right)&&w.element.css({right:item.right}),BI.isNotNull(item.top)&&w.element.css({top:item.top}),BI.isNotNull(item.bottom)&&w.element.css({bottom:item.bottom}),o.vgap+o.tgap+(item.tgap||0)+(item.vgap||0)!==0&&w.element.css({"margin-top":o.vgap+o.tgap+(item.tgap||0)+(item.vgap||0)+"px"}),o.hgap+o.lgap+(item.lgap||0)+(item.hgap||0)!==0&&w.element.css({"margin-left":(0===i?o.hgap:0)+o.lgap+(item.lgap||0)+(item.hgap||0)+"px"}),o.hgap+o.rgap+(item.rgap||0)+(item.hgap||0)!==0&&w.element.css({"margin-right":o.hgap+o.rgap+(item.rgap||0)+(item.hgap||0)+"px"}),o.vgap+o.bgap+(item.bgap||0)+(item.vgap||0)!==0&&w.element.css({"margin-bottom":o.vgap+o.bgap+(item.bgap||0)+(item.vgap||0)+"px"}),w},resize:function(){this.stroke(this.options.items)},populate:function(items){BI.FloatLeftLayout.superclass.populate.apply(this,arguments),this._mount()}}),BI.shortcut("bi.left",BI.FloatLeftLayout),BI.FloatRightLayout=BI.inherit(BI.Layout,{props:function(){return BI.extend(BI.FloatRightLayout.superclass.props.apply(this,arguments),{baseCls:"bi-float-right-layout clearfix",hgap:0,vgap:0,lgap:0,rgap:0,tgap:0,bgap:0})},render:function(){BI.FloatRightLayout.superclass.render.apply(this,arguments),this.populate(this.options.items)},_addElement:function(i,item){var o=this.options,w=BI.FloatRightLayout.superclass._addElement.apply(this,arguments);return w.element.css({position:"relative","float":"right"}),BI.isNotNull(item.left)&&w.element.css({left:item.left}),BI.isNotNull(item.right)&&w.element.css({right:item.right}),BI.isNotNull(item.top)&&w.element.css({top:item.top}),BI.isNotNull(item.bottom)&&w.element.css({bottom:item.bottom}),o.vgap+o.tgap+(item.tgap||0)+(item.vgap||0)!==0&&w.element.css({"margin-top":o.vgap+o.tgap+(item.tgap||0)+(item.vgap||0)+"px"}),o.hgap+o.lgap+(item.lgap||0)+(item.hgap||0)!==0&&w.element.css({"margin-left":o.hgap+o.lgap+(item.lgap||0)+(item.hgap||0)+"px"}),o.hgap+o.rgap+(item.rgap||0)+(item.hgap||0)!==0&&w.element.css({"margin-right":(0===i?o.hgap:0)+o.rgap+(item.rgap||0)+(item.hgap||0)+"px"}),o.vgap+o.bgap+(item.bgap||0)+(item.vgap||0)!==0&&w.element.css({"margin-bottom":o.vgap+o.bgap+(item.bgap||0)+(item.vgap||0)+"px"}),w},resize:function(){this.stroke(this.options.items)},populate:function(items){BI.FloatRightLayout.superclass.populate.apply(this,arguments),this._mount()}}),BI.shortcut("bi.right",BI.FloatRightLayout),BI.GridLayout=BI.inherit(BI.Layout,{props:function(){return BI.extend(BI.GridLayout.superclass.props.apply(this,arguments),{baseCls:"bi-grid-layout",columns:null,rows:null,items:[]})},render:function(){BI.GridLayout.superclass.render.apply(this,arguments),this.populate(this.options.items)},resize:function(){},addItem:function(){throw new Error("cannot be added")},stroke:function(items){function firstElement(item,row,col){0===row&&item.addClass("first-row"),0===col&&item.addClass("first-col"),item.addClass(BI.isOdd(row+1)?"odd-row":"even-row"),item.addClass(BI.isOdd(col+1)?"odd-col":"even-col"),item.addClass("center-element")}function firstObject(item,row,col){var cls="";0===row&&(cls+=" first-row"),0===col&&(cls+=" first-col"),cls+=BI.isOdd(row+1)?" odd-row":" even-row",cls+=BI.isOdd(col+1)?" odd-col":" even-col",item.cls=(item.cls||"")+cls+" center-element"}function first(item,row,col){item instanceof BI.Widget?firstElement(item.element,row,col):item.el instanceof BI.Widget?firstElement(item.el.element,row,col):item.el?firstObject(item.el,row,col):firstObject(item,row,col)}for(var self=this,o=this.options,rows=o.rows||o.items.length,columns=o.columns||0|(o.items[0]&&o.items[0].length),width=100/columns,height=100/rows,els=[],i=0;i").attr({cellspacing:0,cellpadding:0}).css({position:"relative","white-space":"nowrap",height:o.verticalAlign===BI.VerticalAlign.Middle?"100%":"auto",width:o.horizontalAlign===BI.HorizontalAlign.Center||o.horizontalAlign===BI.HorizontalAlign.Stretch?"100%":"auto","border-spacing":"0px",border:"none","border-collapse":"separate"}),this.$tr=BI.Widget._renderEngine.createElement("
"),this.$tr.appendTo(this.$table),this.populate(this.options.items)},_addElement:function(i,item){var o=this.options,td,width=o.columnSize[i]<=1?100*o.columnSize[i]+"%":o.columnSize[i];if(this.hasWidget(this._getChildName(i)))td=this.getWidgetByName(this._getChildName(i)),td.element.attr("width",width);else{var w=BI.createWidget(item);w.element.css({position:"relative",margin:"0px auto"}),td=BI.createWidget({type:"bi.default",tagName:"td",attributes:{width:width},items:[w]}),this.addWidget(this._getChildName(i),td)}return td.element.css({"max-width":o.columnSize[i]<=1?width:width+"px"}),0===i&&td.element.addClass("first-element"),td.element.css({position:"relative","vertical-align":o.verticalAlign,margin:"0",padding:"0",border:"none"}),o.vgap+o.tgap+(item.tgap||0)+(item.vgap||0)!==0&&w.element.css({"margin-top":o.vgap+o.tgap+(item.tgap||0)+(item.vgap||0)+"px"}),o.hgap+o.lgap+(item.lgap||0)+(item.hgap||0)!==0&&w.element.css({"margin-left":(0===i?o.hgap:0)+o.lgap+(item.lgap||0)+(item.hgap||0)+"px"}),o.hgap+o.rgap+(item.rgap||0)+(item.hgap||0)!==0&&w.element.css({"margin-right":o.hgap+o.rgap+(item.rgap||0)+(item.hgap||0)+"px"}),o.vgap+o.bgap+(item.bgap||0)+(item.vgap||0)!==0&&w.element.css({"margin-bottom":o.vgap+o.bgap+(item.bgap||0)+(item.vgap||0)+"px"}),td},appendFragment:function(frag){this.$tr.append(frag),this.element.append(this.$table)},resize:function(){},_getWrapper:function(){return this.$tr},populate:function(items){BI.HorizontalLayout.superclass.populate.apply(this,arguments),this._mount()}}),BI.shortcut("bi.horizontal",BI.HorizontalLayout),BI.HorizontalCellLayout=BI.inherit(BI.Layout,{props:function(){return BI.extend(BI.HorizontalCellLayout.superclass.props.apply(this,arguments),{baseCls:"bi-horizontal-cell-layout",scrollable:!0,hgap:0,vgap:0,lgap:0,rgap:0,tgap:0,bgap:0})},render:function(){BI.HorizontalCellLayout.superclass.render.apply(this,arguments),this.element.css({display:"table","vertical-align":"top"}),this.populate(this.options.items)},_addElement:function(i,item){var o=this.options,w=BI.HorizontalCellLayout.superclass._addElement.apply(this,arguments);return w.element.css({position:"relative",display:"table-cell","vertical-align":"middle"}),o.hgap+o.lgap>0&&w.element.css({"margin-left":o.hgap+o.lgap+"px"}),o.hgap+o.rgap>0&&w.element.css({"margin-right":o.hgap+o.rgap+"px"}),o.vgap+o.tgap>0&&w.element.css({"margin-top":o.vgap+o.tgap+"px"}),o.vgap+o.bgap>0&&w.element.css({"margin-bottom":o.vgap+o.bgap+"px"}),w},resize:function(){},populate:function(items){BI.HorizontalCellLayout.superclass.populate.apply(this,arguments),this._mount()}}),BI.shortcut("bi.horizontal_cell",BI.HorizontalCellLayout),BI.InlineLayout=BI.inherit(BI.Layout,{props:function(){return BI.extend(BI.InlineLayout.superclass.props.apply(this,arguments),{baseCls:"bi-inline-layout",hgap:0,vgap:0,lgap:0,rgap:0,tgap:0,bgap:0})},render:function(){BI.InlineLayout.superclass.render.apply(this,arguments),this.populate(this.options.items)},_addElement:function(i,item){var o=this.options,w=BI.InlineLayout.superclass._addElement.apply(this,arguments);return w.element.css({position:"relative",display:"inline-block","*display":"inline","*zoom":1}),o.vgap+o.tgap+(item.tgap||0)+(item.vgap||0)!==0&&w.element.css({"margin-top":o.vgap+o.tgap+(item.tgap||0)+(item.vgap||0)+"px" +}),o.hgap+o.lgap+(item.lgap||0)+(item.hgap||0)!==0&&w.element.css({"margin-left":(0===i?o.hgap:0)+o.lgap+(item.lgap||0)+(item.hgap||0)+"px"}),o.hgap+o.rgap+(item.rgap||0)+(item.hgap||0)!==0&&w.element.css({"margin-right":o.hgap+o.rgap+(item.rgap||0)+(item.hgap||0)+"px"}),o.vgap+o.bgap+(item.bgap||0)+(item.vgap||0)!==0&&w.element.css({"margin-bottom":o.vgap+o.bgap+(item.bgap||0)+(item.vgap||0)+"px"}),w},resize:function(){this.stroke(this.options.items)},populate:function(items){BI.InlineLayout.superclass.populate.apply(this,arguments),this._mount()}}),BI.shortcut("bi.inline",BI.InlineLayout),BI.LatticeLayout=BI.inherit(BI.Layout,{props:function(){return BI.extend(BI.LatticeLayout.superclass.props.apply(this,arguments),{baseCls:"bi-lattice-layout clearfix"})},render:function(){BI.LatticeLayout.superclass.render.apply(this,arguments),this.populate(this.options.items)},_addElement:function(i,item){var o=this.options,w=BI.LatticeLayout.superclass._addElement.apply(this,arguments);if(o.columnSize&&o.columnSize[i])var width=o.columnSize[i]/BI.sum(o.columnSize)*100+"%";else var width=1/this.options.items.length*100+"%";return w.element.css({position:"relative","float":"left",width:width}),w},addItem:function(item){var w=BI.LatticeLayout.superclass.addItem.apply(this,arguments);return this.resize(),w},addItemAt:function(item){var w=BI.LatticeLayout.superclass.addItemAt.apply(this,arguments);return this.resize(),w},resize:function(){this.stroke(this.options.items)},populate:function(items){BI.LatticeLayout.superclass.populate.apply(this,arguments),this._mount()}}),BI.shortcut("bi.lattice",BI.LatticeLayout),BI.TableLayout=BI.inherit(BI.Layout,{props:function(){return BI.extend(BI.TableLayout.superclass.props.apply(this,arguments),{baseCls:"bi-table-layout",scrolly:!0,columnSize:[200,200,"fill"],rowSize:30,hgap:0,vgap:0,items:[[{el:{text:"label1"}},{el:{text:"label2"}},{el:{text:"label3"}}]]})},render:function(){BI.TableLayout.superclass.render.apply(this,arguments),this.rows=0,this.populate(this.options.items)},_addElement:function(idx,arr){function firstElement(item,row,col){0===row&&item.addClass("first-row"),0===col&&item.addClass("first-col"),item.addClass(BI.isOdd(row+1)?"odd-row":"even-row"),item.addClass(BI.isOdd(col+1)?"odd-col":"even-col"),item.addClass("center-element")}function firstObject(item,row,col){var cls="";0===row&&(cls+=" first-row"),0===col&&(cls+=" first-col"),cls+=BI.isOdd(row+1)?" odd-row":" even-row",cls+=BI.isOdd(col+1)?" odd-col":" even-col",item.cls=(item.cls||"")+cls+" center-element"}function first(item,row,col){item instanceof BI.Widget?firstElement(item.element,row,col):item.el instanceof BI.Widget?firstElement(item.el.element,row,col):item.el?firstObject(item.el,row,col):firstObject(item,row,col)}var o=this.options,abs=[],left=0,right=0,i,j;for(i=0;ii;j--){if(!BI.isNumber(o.columnSize[j]))throw new Error("item with fill can only be one");first(arr[j],this.rows,j),abs.push(BI.extend({top:0,bottom:0,right:o.columnSize[j]<=1?100*right+"%":right,width:o.columnSize[j]<=1?100*o.columnSize[j]+"%":o.columnSize[j]},arr[j])),right+=o.columnSize[j]+(o.columnSize[j]<1?0:o.hgap)}i>=0&&i0&&this.getWidgetByName(this.getName()+(this.rows-1)).element.css({"margin-bottom":o.vgap}),w.element.css({position:"relative"}),this.addWidget(this.getName()+this.rows++,w),w},resize:function(){},addItem:function(arr){if(!BI.isArray(arr))throw new Error("item must be array");return BI.TableLayout.superclass.addItem.apply(this,arguments)},update:function(){},populate:function(items){BI.TableLayout.superclass.populate.apply(this,arguments),this._mount()}}),BI.shortcut("bi.table",BI.TableLayout),BI.HTapeLayout=BI.inherit(BI.Layout,{props:function(){return BI.extend(BI.HTapeLayout.superclass.props.apply(this,arguments),{baseCls:"bi-h-tape-layout",hgap:0,vgap:0,lgap:0,rgap:0,tgap:0,bgap:0,items:[{width:100,el:{type:"bi.button",text:"button1"}},{width:"fill",el:{type:"bi.button",text:"button2"}},{width:200,el:{type:"bi.button",text:"button3"}}]})},render:function(){BI.HTapeLayout.superclass.render.apply(this,arguments),this.populate(this.options.items)},resize:function(){this.stroke(this.options.items)},addItem:function(item){throw new Error("cannot be added")},stroke:function(items){var self=this,o=this.options;items=BI.compact(items),BI.each(items,function(i,item){if(self.hasWidget(self.getName()+i+""))w=self.getWidgetByName(self.getName()+i+"");else{var w=BI.createWidget(item);self.addWidget(self.getName()+i+"",w)}w.element.css({position:"absolute",top:(item.vgap||0)+(item.tgap||0)+o.vgap+o.tgap+"px",bottom:(item.bgap||0)+(item.vgap||0)+o.vgap+o.bgap+"px"})});var left={},right={};left[0]=0,right[items.length-1]=0,BI.any(items,function(i,item){var w=self.getWidgetByName(self.getName()+i+"");if(BI.isNull(left[i])&&(left[i]=left[i-1]+items[i-1].width+(items[i-1].lgap||0)+2*(items[i-1].hgap||0)+o.hgap+o.lgap+o.rgap),item.width<1&&item.width>=0?w.element.css({left:100*left[i]+"%",width:100*item.width+"%"}):w.element.css({left:left[i]+(item.lgap||0)+(item.hgap||0)+o.hgap+o.lgap+"px",width:BI.isNumber(item.width)?item.width:""}),!BI.isNumber(item.width))return!0}),BI.backAny(items,function(i,item){var w=self.getWidgetByName(self.getName()+i+"");if(BI.isNull(right[i])&&(right[i]=right[i+1]+items[i+1].width+(items[i+1].rgap||0)+2*(items[i+1].hgap||0)+o.hgap+o.lgap+o.rgap),item.width<1&&item.width>=0?w.element.css({right:100*right[i]+"%",width:100*item.width+"%"}):w.element.css({right:right[i]+(item.rgap||0)+(item.hgap||0)+o.hgap+o.rgap+"px",width:BI.isNumber(item.width)?item.width:""}),!BI.isNumber(item.width))return!0})},update:function(){var updated;return BI.each(this._children,function(i,child){updated=child.update()||updated}),updated},populate:function(items){BI.HTapeLayout.superclass.populate.apply(this,arguments),this._mount()}}),BI.shortcut("bi.htape",BI.HTapeLayout),BI.VTapeLayout=BI.inherit(BI.Layout,{props:function(){return BI.extend(BI.VTapeLayout.superclass.props.apply(this,arguments),{baseCls:"bi-v-tape-layout",hgap:0,vgap:0,lgap:0,rgap:0,tgap:0,bgap:0,items:[{height:100,el:{type:"bi.button",text:"button1"}},{height:"fill",el:{type:"bi.button",text:"button2"}},{height:200,el:{type:"bi.button",text:"button3"}}]})},render:function(){BI.VTapeLayout.superclass.render.apply(this,arguments),this.populate(this.options.items)},resize:function(){this.stroke(this.options.items)},addItem:function(item){throw new Error("cannot be added")},stroke:function(items){var self=this,o=this.options;items=BI.compact(items),BI.each(items,function(i,item){if(self.hasWidget(self.getName()+i+""))w=self.getWidgetByName(self.getName()+i+"");else{var w=BI.createWidget(item);self.addWidget(self.getName()+i+"",w)}w.element.css({position:"absolute",left:(item.lgap||0)+(item.hgap||0)+o.hgap+o.lgap+"px",right:+(item.hgap||0)+(item.rgap||0)+o.hgap+o.rgap+"px"})});var top={},bottom={};top[0]=0,bottom[items.length-1]=0,BI.any(items,function(i,item){var w=self.getWidgetByName(self.getName()+i+"");if(BI.isNull(top[i])&&(top[i]=top[i-1]+items[i-1].height+(items[i-1].tgap||0)+2*(items[i-1].vgap||0)+o.vgap+o.tgap+o.bgap),item.height<1&&item.height>=0?w.element.css({top:100*top[i]+"%",height:100*item.height+"%"}):w.element.css({top:top[i]+(item.vgap||0)+(item.tgap||0)+o.vgap+o.tgap+"px",height:BI.isNumber(item.height)?item.height:""}),!BI.isNumber(item.height))return!0}),BI.backAny(items,function(i,item){var w=self.getWidgetByName(self.getName()+i+"");if(BI.isNull(bottom[i])&&(bottom[i]=bottom[i+1]+items[i+1].height+(items[i+1].bgap||0)+2*(items[i+1].vgap||0)+o.vgap+o.tgap+o.bgap),item.height<1&&item.height>=0?w.element.css({bottom:100*bottom[i]+"%",height:100*item.height+"%"}):w.element.css({bottom:bottom[i]+(item.vgap||0)+(item.bgap||0)+o.vgap+o.bgap+"px",height:BI.isNumber(item.height)?item.height:""}),!BI.isNumber(item.height))return!0})},update:function(){},populate:function(items){BI.VTapeLayout.superclass.populate.apply(this,arguments),this._mount()}}),BI.shortcut("bi.vtape",BI.VTapeLayout),BI.TdLayout=BI.inherit(BI.Layout,{props:function(){return BI.extend(BI.TdLayout.superclass.props.apply(this,arguments),{baseCls:"bi-td-layout",columnSize:[200,200,200],hgap:0,vgap:0,items:[[{el:{text:"label1"}},{el:{text:"label2"}},{el:{text:"label3"}}]]})},render:function(){BI.TdLayout.superclass.render.apply(this,arguments),this.$table=BI.Widget._renderEngine.createElement("
").attr({cellspacing:0,cellpadding:0}).css({position:"relative",width:"100%",height:"100%","border-spacing":"0px",border:"none","border-collapse":"separate"}),this.rows=0,this.populate(this.options.items)},_addElement:function(idx,arr){function firstElement(item,row,col){0===row&&item.addClass("first-row"),0===col&&item.addClass("first-col"),item.addClass(BI.isOdd(row+1)?"odd-row":"even-row"),item.addClass(BI.isOdd(col+1)?"odd-col":"even-col"),item.addClass("center-element")}function firstObject(item,row,col){var cls="";0===row&&(cls+=" first-row"),0===col&&(cls+=" first-col"),cls+=BI.isOdd(row+1)?" odd-row":" even-row",cls+=BI.isOdd(col+1)?" odd-col":" even-col",item.cls=(item.cls||"")+cls+" center-element"}function first(item,row,col){item instanceof BI.Widget?firstElement(item.element,row,col):item.el instanceof BI.Widget?firstElement(item.el.element,row,col):item.el?firstObject(item.el,row,col):firstObject(item,row,col)}for(var o=this.options,tr=BI.createWidget({type:"bi.default",tagName:"tr"}),i=0;i=0;i--){for(var j=0;j=0;j--){for(var i=0;i0&&void 0!==arguments[0]?arguments[0]:"bi";return String(Math.random()+Math.random()).replace(rhashcode,prefix)}function isIE(){return"undefined"!=typeof navigator&&/(msie|trident)/i.test(navigator.userAgent.toLowerCase())}function getIEVersion(){var version=0;if("undefined"==typeof navigator)return!1;var agent=navigator.userAgent.toLowerCase(),v1=agent.match(/(?:msie\s([\w.]+))/),v2=agent.match(/(?:trident.*rv:([\w.]+))/);return version=v1&&v2&&v1[1]&&v2[1]?Math.max(1*v1[1],1*v2[1]):v1&&v1[1]?1*v1[1]:v2&&v2[1]?1*v2[1]:0}function isPlainObject(obj){return"[object Object]"===_toString.call(obj)}function parsePath(path){if(!bailRE.test(path)){var segments=path.split(".");return function(obj){for(var i=0;i3&&void 0!==arguments[3]?arguments[3]:{},model=vm;!model.$watch&&model.$vm&&(model=model.$vm),isPlainObject(cb)&&(options=cb,cb=cb.handler),"string"==typeof cb&&(cb=model[cb]),options=options||{},options.user=!0;var exps=void 0;if(_$1.isFunction(expOrFn)||!(exps=expOrFn.match(/[a-zA-Z0-9_.*]+|[|][|]|[&][&]|[(]|[)]/g))||1===exps.length&&!/\*/.test(expOrFn))return model.$watch(expOrFn,cb,options),[];var watchers=[],fns=exps.slice(),complete=!1,running=!1,callback=function callback(index,newValue,oldValue,attrs){complete!==!0&&(fns[index]=!0,runBinaryFunction(fns)&&(complete=!0,cb.call(vm,newValue,oldValue,attrs)),options&&options.sync?(complete=!1,running=!1,fns=exps.slice()):running||(running=!0,nextTick(function(){complete=!1,running=!1,fns=exps.slice()})))};return _$1.each(exps,function(exp,i){if(!_$1.has(operators,exp)){if(/^[1-9a-zA-Z.]+(\*\*$|\*$)/.test(exp)||"**"===exp){var isGlobal=/\*\*$/.test(exp);exp=isGlobal?exp.replace(".**",""):exp.replace(".*","");var getter=isGlobal?exp:function(){var result={};return _$1.each(model.model,function(v,key){key in $$skipArray||(result[key]=v)}),result};return void model.$watch(getter,function(newValue,oldValue,attrs){callback(i,newValue,oldValue,_$1.extend({index:i},attrs))},_$1.extend(options,{deep:isGlobal}))}if(/\*\*$|\*$/.test(exp))throw new Error("not support");if(/\*/.test(exp)){var paths=exp.split("."),_getter=function _getter(){for(var currentModels={root:model.model},_loop=(function _loop(len,_i){var models={};"*"===paths[_i]?_$1.each(currentModels,function(model,key){_$1.each(model,function(v,k){key+k in $$skipArray||(models[key+k]=v)})}):_$1.each(currentModels,function(model,key){key+paths[_i]in $$skipArray||(models[key+paths[_i]]=model[paths[_i]])}),currentModels=models}),_i=0,len=paths.length;_i3&&void 0!==arguments[3]?arguments[3]:{};isPlainObject(cb)&&(options=cb,cb=cb.handler),"string"==typeof cb&&(cb=vm[cb]);var getter=_$1.isFunction(expOrFn)?_$1.bind(expOrFn,vm):_$1.bind(function(){return parsePath("model."+expOrFn)(vm)},vm);return new Watcher({get:getter,listener:_$1.bind(cb,vm),last:getter(),sync:options.sync,deep:options.deep,id:options.id})}function injectMethod(method,vm){return function(){var result=method.apply(vm,[].concat(Array.prototype.slice.call(arguments)));return vm.$digest(),result}}function initMethods(vm,methods){for(var key in methods)vm[key]=null==methods[key]?noop:injectMethod(methods[key],vm)}function initMixins(vm){var mixins=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];_$1.each(mixins.reverse(),function(mixinType){var mixin$$1=getMixins(mixinType);for(var key in mixin$$1)"function"==typeof mixin$$1[key]&&(_$1.has(vm,key)||(vm[key]=injectMethod(mixin$$1[key],vm)))})}function defineContext(vm,keys){function getSingleContext(key){for(var p=vm._parent;p;){if(p.childContext&&p.childContext.indexOf(key)>-1)return p.$watch(key,function(cur,last,p){vm._contextWatchers[key]&&(vm.model[key]=cur,vm._contextWatchers[key].last=cloneShadow(cur),vm.$digest())},{id:vm._modelHashId+"-"+key}),{p:p,value:p.model[key]};p=p._parent}}var watchers=vm._contextWatchers={};_$1.each(keys,function(key){var context=getSingleContext(key);context&&(vm.model[key]=context.p?context.p.model[key]:void 0,watchers[key]=new Watcher({id:context.p._modelHashId+"-"+key,get:function get(){return vm.model[key]},last:vm.model[key],listener:_$1.bind(function(c){context.p.model[key]=c,context.p.$digest()},context.p)}))})}function digestState(vm){var dirty=!1;return _$1.each(vm._stateWatchers,function(watcher,key){var cur=watcher.get(),last=watcher.last;isShadowEqual(cur,last)||(vm.model[key]=cur,dirty=!0,watcher.last=cloneShadow(cur))}),dirty}function digestComputed(vm){var dirty=!1,dirtyQueue=[],cleanQueue=[];return _$1.each(vm._computedOrder,function(key){var watcher=vm._computedWatchers[key];try{var cur=watcher.get(),last=watcher.last;isShadowEqual(cur,last)?cleanQueue.push(key):(vm.model[key]=cur,dirty=!0,dirtyQueue.push(key),watcher.last=cloneShadow(cur))}catch(err){dirty=!0,dirtyQueue.push(key)}}),vm._computedOrder=[].concat(cleanQueue,dirtyQueue),dirty}function digestContext(vm){var dirty=!1;return _$1.each(vm._contextWatchers,function(watcher,key){var cur=watcher.get(),last=watcher.last;if(!isShadowEqual(cur,last)){var listener={id:watcher.id,cb:_$1.bind(watcher.listener,vm,cur,last,vm)};vm.contextListeners.push(listener),vm.model[key]=cur,dirty=!0,watcher.last=cloneShadow(cur)}}),dirty}function digest(vm){for(var stateDirty=!0,contextDirty=!0,computedDirty=!0,ttl=TTL;stateDirty&&ttl>0;ttl--)stateDirty=digestState(vm);for(var _ttl=TTL;contextDirty&&_ttl>0;_ttl--)contextDirty=digestContext(vm);for(var _ttl2=TTL;computedDirty&&_ttl2>0;_ttl2--)computedDirty=digestComputed(vm)}function executeWatchListeners(vm){var syncListeners=[].concat(vm.syncListeners||[]),asyncListeners=[].concat(vm.asyncListeners||[]),contextListeners=[].concat(vm.contextListeners||[]);vm.asyncListeners=[],vm.syncListeners=[];var watchers=[].concat(vm._watchers);_$1.each(watchers,function(watcher){if(watcher){var cur=watcher.get(),last=watcher.last;if(!isShadowEqual(cur,last)){var listner={id:watcher.id,cb:_$1.bind(watcher.listener,vm,cur,last,vm)};watcher.sync===!0?syncListeners.push(listner):asyncListeners.push(listner),watcher.last=cloneShadow(cur)}}}),_$1.each(syncListeners,function(listener){listener.cb()}),0===contextListeners.length&&0===asyncListeners.length||nextTick(function(){_$1.each(BI.uniqBy(contextListeners.reverse(),"id").reverse(),function(listener){listener.cb()}),_$1.each(asyncListeners,function(listener){listener.cb()})})}function refreshAllDefineModel(){_$1.each(allDefineModelInstances,function(insta){insta&&insta.$digest&&insta.$digest()})}function getAllModelInstances(){return allModelInstances}function refreshAll(){_$1.each(getAllModelInstances(),function(insta){insta&&insta.$digest&&insta.$digest()})}function define(model){var OB=inherit(Model,{state:function state(){return model}}),ob=new OB;return ob._constructor({define:!0}),allDefineModelInstances[ob.getModelID()]=ob,ob.model}_$1="default"in _$1?_$1["default"]:_$1;var falsy=void 0,$$skipArray={$accessors:falsy,$vbthis:falsy,$vbsetter:falsy, +$vm:falsy},$$skips=["$accessors","$vbthis","$vbsetter","$vm"],originalMethods=[];_$1.each(["slice","splice"],function(method){originalMethods[method]=Array.prototype[method]}),Array.prototype.splice=function(){this.__ref__=makeHashCode();for(var _len=arguments.length,args=Array(_len),_key=0;_key<_len;_key++)args[_key]=arguments[_key];return originalMethods.splice.apply(this,args)};var rhashcode=/\d\.\d{4}/,isIE9Below=isIE()&&getIEVersion()<9,_toString=Object.prototype.toString,bailRE=/[^\w.$]/,nextTick=function(){function nextTickHandler(){pending=!1;var copies=callbacks.slice(0);callbacks.length=0;for(var i=0;i=1?"floor":"ceil"](delta/lowestDelta),deltaX=Math[deltaX>=1?"floor":"ceil"](deltaX/lowestDelta),deltaY=Math[deltaY>=1?"floor":"ceil"](deltaY/lowestDelta),special.settings.normalizeOffset&&this.getBoundingClientRect){var boundingRect=this.getBoundingClientRect();offsetX=event.clientX-boundingRect.left,offsetY=event.clientY-boundingRect.top}return event.deltaX=deltaX,event.deltaY=deltaY,event.deltaFactor=lowestDelta,event.offsetX=offsetX,event.offsetY=offsetY,event.deltaMode=0,args.unshift(event,delta,deltaX,deltaY),nullLowestDeltaTimeout&&clearTimeout(nullLowestDeltaTimeout),nullLowestDeltaTimeout=setTimeout(nullLowestDelta,200),($.event.dispatch||$.event.handle).apply(this,args)}}function nullLowestDelta(){lowestDelta=null}function shouldAdjustOldDeltas(orgEvent,absDelta){return special.settings.adjustOldDeltas&&"mousewheel"===orgEvent.type&&absDelta%120===0}var toFix=["wheel","mousewheel","DOMMouseScroll","MozMousePixelScroll"],toBind="onwheel"in document||document.documentMode>=9?["wheel"]:["mousewheel","DomMouseScroll","MozMousePixelScroll"],slice=Array.prototype.slice,nullLowestDeltaTimeout,lowestDelta;if($.event.fixHooks)for(var i=toFix.length;i;)$.event.fixHooks[toFix[--i]]=$.event.mouseHooks;var special=$.event.special.mousewheel={version:"3.1.12",setup:function(){if(this.addEventListener)for(var i=toBind.length;i;)this.addEventListener(toBind[--i],handler,!1);else this.onmousewheel=handler},teardown:function(){if(this.removeEventListener)for(var i=toBind.length;i;)this.removeEventListener(toBind[--i],handler,!1);else this.onmousewheel=null},settings:{adjustOldDeltas:!0,normalizeOffset:!0}};$.fn.extend({mousewheel:function(fn){return fn?this.bind("mousewheel",fn):this.trigger("mousewheel")},unmousewheel:function(fn){return this.unbind("mousewheel",fn)}})}),BI.Pane=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.Pane.superclass._defaultConfig.apply(this,arguments),{_baseCls:"bi-pane",tipText:BI.i18nText("BI-No_Selected_Item"),overlap:!0,onLoaded:BI.emptyFn})},_assertTip:function(){var o=this.options;this._tipText||(this._tipText=BI.createWidget({type:"bi.label",cls:"bi-tips",text:o.tipText,height:25}),BI.createWidget({type:"bi.absolute_center_adapt",element:this,items:[this._tipText]}))},loading:function(){var self=this,o=this.options,isIE=BI.isIE(),loadingAnimation=BI.createWidget({type:"bi.horizontal",cls:"bi-loading-widget"+(isIE?" wave-loading hack":""),height:30,width:30,hgap:5,vgap:2.5,items:isIE?[]:[{type:"bi.layout",cls:"animate-rect rect1",height:25,width:3},{type:"bi.layout",cls:"animate-rect rect2",height:25,width:3},{type:"bi.layout",cls:"animate-rect rect3",height:25,width:3}]});this.setTipVisible(!1),o.overlap===!0?(BI.Layers.has(this.getName())||BI.createWidget({type:"bi.absolute_center_adapt",cls:"loading-container",items:[{el:loadingAnimation}],element:BI.Layers.make(this.getName(),this)}),BI.Layers.show(self.getName())):BI.isNull(this._loading)&&(this._loading=loadingAnimation,this._loading.element.css("zIndex",1),BI.createWidget({type:"bi.absolute_center_adapt",element:this,cls:"loading-container",items:[{el:this._loading,left:0,right:0,top:0}]})),this.element.addClass("loading-status")},loaded:function(){var self=this,o=this.options;BI.Layers.remove(self.getName()),this._loading&&this._loading.destroy(),this._loading&&(this._loading=null),o.onLoaded(),self.fireEvent(BI.Pane.EVENT_LOADED),this.element.removeClass("loading-status")},check:function(){this.setTipVisible(BI.isEmpty(this.options.items))},setTipVisible:function(b){b===!0?(this._assertTip(),this._tipText.setVisible(!0)):this._tipText&&this._tipText.setVisible(!1)},populate:function(items){this.options.items=items||[],this.check()},empty:function(){}}),BI.Pane.EVENT_LOADED="EVENT_LOADED",BI.Single=BI.inherit(BI.Widget,{_defaultConfig:function(){var conf=BI.Single.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{_baseCls:(conf._baseCls||"")+" bi-single",readonly:!1,title:null,warningTitle:null,tipType:null,value:null,belowMouse:!1})},_showToolTip:function(e,opt){opt||(opt={});var self=this,o=this.options,type=this.getTipType()||(this.isEnabled()?"success":"warning"),title="success"===type?this.getTitle():this.getWarningTitle()||this.getTitle();BI.isKey(title)&&(BI.Tooltips.show(e,this.getName(),title,type,this,opt),o.action&&BI.Actions.runAction(o.action,"hover",o,this),BI.Actions.runGlobalAction("hover",o,this))},_hideTooltip:function(){var self=this,tooltip=BI.Tooltips.get(this.getName());BI.isNotNull(tooltip)&&tooltip.element.fadeOut(200,function(){BI.Tooltips.remove(self.getName())})},_init:function(){BI.Single.superclass._init.apply(this,arguments);var self=this,o=this.options;(BI.isKey(o.title)||BI.isKey(o.warningTitle)||BI.isFunction(o.title)||BI.isFunction(o.warningTitle))&&this.enableHover({belowMouse:o.belowMouse,container:o.container})},_clearTimeOut:function(){BI.isNotNull(this.showTimeout)&&(clearTimeout(this.showTimeout),this.showTimeout=null),BI.isNotNull(this.hideTimeout)&&(clearTimeout(this.hideTimeout),this.hideTimeout=null)},enableHover:function(opt){opt||(opt={});var self=this;this._hoverBinded||(this.element.on("mouseenter.title"+this.getName(),function(e){self._e=e,"warning"===self.getTipType()||BI.isKey(self.getWarningTitle())&&!self.isEnabled()?self.showTimeout=BI.delay(function(){BI.isNotNull(self.showTimeout)&&self._showToolTip(self._e||e,opt)},200):("success"===self.getTipType()||self.isEnabled())&&(self.showTimeout=BI.delay(function(){BI.isNotNull(self.showTimeout)&&self._showToolTip(self._e||e,opt)},500))}),this.element.on("mousemove.title"+this.getName(),function(e){self._e=e,BI.isNotNull(self.showTimeout)&&(clearTimeout(self.showTimeout),self.showTimeout=null),BI.isNull(self.hideTimeout)&&(self.hideTimeout=BI.delay(function(){BI.isNotNull(self.hideTimeout)&&self._hideTooltip()},500)),self.showTimeout=BI.delay(function(){BI.isNotNull(self.showTimeout)&&(BI.isNotNull(self.hideTimeout)&&(clearTimeout(self.hideTimeout),self.hideTimeout=null),self.element.__isMouseInBounds__(self._e||e)&&self._showToolTip(self._e||e,opt))},500)}),this.element.on("mouseleave.title"+this.getName(),function(e){self._e=null,self._clearTimeOut(),self._hideTooltip()}),this._hoverBinded=!0)},disabledHover:function(){this._clearTimeOut(),this._hideTooltip(),this.element.unbind("mouseenter.title"+this.getName()).unbind("mousemove.title"+this.getName()).unbind("mouseleave.title"+this.getName()),this._hoverBinded=!1},populate:function(items){this.items=items||[]},setTitle:function(title,opt){this.options.title=title,BI.isKey(title)||BI.isFunction(title)?this.enableHover(opt):this.disabledHover()},setWarningTitle:function(title,opt){this.options.warningTitle=title,BI.isKey(title)||BI.isFunction(title)?this.enableHover(opt):this.disabledHover()},getTipType:function(){return this.options.tipType},isReadOnly:function(){return!!this.options.readonly},getTitle:function(){var title=this.options.title;return BI.isFunction(title)?title():title},getWarningTitle:function(){var title=this.options.warningTitle;return BI.isFunction(title)?title():title},setValue:function(val){this.options.readonly||(this.options.value=val)},getValue:function(){return this.options.value},_unMount:function(){BI.Single.superclass._unMount.apply(this,arguments),BI.Tooltips.remove(this.getName())}}),BI.Text=BI.inherit(BI.Single,{props:{baseCls:"bi-text",textAlign:"left",whiteSpace:"normal",lineHeight:null,handler:null,hgap:0,vgap:0,lgap:0,rgap:0,tgap:0,bgap:0,text:"",py:"",highLight:!1},render:function(){var self=this,o=this.options;o.hgap+o.lgap>0&&this.element.css({"padding-left":o.hgap+o.lgap+"px"}),o.hgap+o.rgap>0&&this.element.css({"padding-right":o.hgap+o.rgap+"px"}),o.vgap+o.tgap>0&&this.element.css({"padding-top":o.vgap+o.tgap+"px"}),o.vgap+o.bgap>0&&this.element.css({"padding-bottom":o.vgap+o.bgap+"px"}),BI.isNumber(o.height)&&this.element.css({lineHeight:o.height+"px"}),BI.isNumber(o.lineHeight)&&this.element.css({lineHeight:o.lineHeight+"px"}),BI.isWidthOrHeight(o.maxWidth)&&this.element.css({maxWidth:o.maxWidth}),this.element.css({textAlign:o.textAlign,whiteSpace:o.whiteSpace,textOverflow:"nowrap"===o.whiteSpace?"ellipsis":"",overflow:"nowrap"===o.whiteSpace?"":BI.isWidthOrHeight(o.height)?"auto":""}),o.handler?(this.text=BI.createWidget({type:"bi.layout",tagName:"span"}),this.text.element.click(function(){o.handler(self.getValue())}),BI.createWidget({type:"bi.default",element:this,items:[this.text]})):this.text=this;var text=this._getShowText();BI.isKey(text)?this.setText(text):BI.isKey(o.value)&&this.setText(o.value),BI.isKey(o.keyword)&&this.doRedMark(o.keyword),o.highLight&&this.doHighLight()},_getShowText:function(){var o=this.options;return BI.isFunction(o.text)?o.text():o.text},doRedMark:function(keyword){var o=this.options;o.keyword=keyword,this.text.element.__textKeywordMarked__(this._getShowText()||o.value,keyword,o.py)},unRedMark:function(){var o=this.options;o.keyword="",this.text.element.__textKeywordMarked__(this._getShowText()||o.value,"",o.py)},doHighLight:function(){this.text.element.addClass("bi-high-light")},unHighLight:function(){this.text.element.removeClass("bi-high-light")},setValue:function(text){BI.Text.superclass.setValue.apply(this,arguments),this.isReadOnly()||this.setText(text)},setStyle:function(css){this.text.element.css(css)},setText:function(text){return BI.Text.superclass.setText.apply(this,arguments),this.options.text=BI.isNotNull(text)?text:"",BI.isIE9Below()?void this.text.element.html(BI.htmlEncode(this._getShowText())):void(/\s/.test(text)?this.text.element[0].innerHTML=BI.htmlEncode(this._getShowText()):this.text.element[0].textContent=this._getShowText())}}),BI.shortcut("bi.text",BI.Text),BI.BasicButton=BI.inherit(BI.Single,{_defaultConfig:function(){var conf=BI.BasicButton.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{_baseCls:(conf._baseCls||"")+" bi-basic-button"+(conf.invalid?"":" cursor-pointer")+(BI.isIE()&&BI.getIEVersion()<10?" hack":""),value:"",text:"",stopEvent:!1,stopPropagation:!1,selected:!1,once:!1,forceSelected:!1,forceNotSelected:!1,disableSelected:!1,shadow:!1,isShadowShowingOnSelected:!1,trigger:null,handler:BI.emptyFn,bubble:null})},_init:function(){BI.BasicButton.superclass._init.apply(this,arguments);var opts=this.options;opts.selected===!0&&BI.nextTick(BI.bind(function(){this.setSelected(opts.selected)},this)),BI.nextTick(BI.bind(this.bindEvent,this)),opts.shadow&&this._createShadow(),opts.level&&this.element.addClass("button-"+opts.level)},_createShadow:function(){var self=this,o=this.options,assertMask=function(){self.$mask||(self.$mask=BI.createWidget(BI.isObject(o.shadow)?o.shadow:{},{type:"bi.layout",cls:"bi-button-mask"}),self.$mask.invisible(),BI.createWidget({type:"bi.absolute",element:self,items:[{el:self.$mask,left:0,right:0,top:0,bottom:0}]}))};this.element.mouseup(function(){self._hover||o.isShadowShowingOnSelected||(assertMask(),self.$mask.invisible())}),this.element.on("mouseenter."+this.getName(),function(e){self.element.__isMouseInBounds__(e)&&(!self.isEnabled()||self._hover||!o.isShadowShowingOnSelected&&self.isSelected()||(assertMask(),self.$mask.visible()))}),this.element.on("mousemove."+this.getName(),function(e){self.element.__isMouseInBounds__(e)||self.isEnabled()&&!self._hover&&(assertMask(),self.$mask.invisible())}),this.element.on("mouseleave."+this.getName(),function(){self.isEnabled()&&!self._hover&&(assertMask(),self.$mask.invisible())})},bindEvent:function(){function ev(e){o.stopEvent&&e.stopEvent(),o.stopPropagation&&e.stopPropagation()}function clk(e){if(ev(e),!(!self.isEnabled()||self.isOnce()&&self.isSelected())){if(BI.isKey(o.bubble)||BI.isFunction(o.bubble)){if(BI.isNull(self.combo)){var popup;BI.createWidget({type:"bi.absolute",element:self,items:[{el:{type:"bi.bubble_combo",trigger:"",destroyWhenHide:!0,ref:function(){self.combo=this},el:{type:"bi.layout",height:"100%"},popup:{type:"bi.text_bubble_bar_popup_view",text:getBubble(),ref:function(){popup=this},listeners:[{eventName:BI.BubblePopupBarView.EVENT_CLICK_TOOLBAR_BUTTON,action:function(v){self.combo.hideView(),v&&onClick.apply(self,arguments)}}]},listeners:[{eventName:BI.BubbleCombo.EVENT_BEFORE_POPUPVIEW,action:function(){popup.populate(getBubble())}}]},left:0,right:0,bottom:0,top:0}]})}return void(self.combo.isViewVisible()?self.combo.hideView():self.combo.showView())}onClick.apply(self,arguments)}}function getBubble(){var bubble=self.options.bubble;return BI.isFunction(bubble)?bubble():bubble}var self=this,o=this.options,hand=this.handle();if(hand){hand=hand.element;var triggerArr=(o.trigger||"").split(",");BI.each(triggerArr,function(idx,trigger){switch(trigger){case"mouseup":var mouseDown=!1;hand.mousedown(function(){mouseDown=!0}),hand.mouseup(function(e){mouseDown===!0&&clk(e),mouseDown=!1,ev(e)});break;case"mousedown":var mouseDown=!1,selected=!1;hand.mousedown(function(e){BI.Widget._renderEngine.createElement(document).bind("mouseup."+self.getName(),function(e){!BI.DOM.isExist(self)||hand.__isMouseInBounds__(e)||mouseDown!==!0||selected||self._trigger(),mouseDown=!1,BI.Widget._renderEngine.createElement(document).unbind("mouseup."+self.getName())}),mouseDown!==!0&&(self.isSelected()?selected=!0:clk(e),mouseDown=!0,ev(e))}),hand.mouseup(function(e){BI.DOM.isExist(self)&&mouseDown===!0&&selected===!0&&clk(e),mouseDown=!1,selected=!1,BI.Widget._renderEngine.createElement(document).unbind("mouseup."+self.getName())});break;case"dblclick":hand.dblclick(clk);break;case"lclick":var mouseDown=!1,interval;hand.mousedown(function(e){BI.Widget._renderEngine.createElement(document).bind("mouseup."+self.getName(),function(e){interval&&clearInterval(interval),interval=null,mouseDown=!1,BI.Widget._renderEngine.createElement(document).unbind("mouseup."+self.getName())}),mouseDown!==!0&&(!self.isEnabled()||self.isOnce()&&self.isSelected()||(interval=setInterval(function(){self.isEnabled()&&self.doClick()},180),mouseDown=!0,ev(e)))});break;default:(o.stopEvent||o.stopPropagation)&&hand.mousedown(function(e){ev(e)}),hand.click(clk)}});var onClick=BI.debounce(this._doClick,BI.EVENT_RESPONSE_TIME,{leading:!0,trailing:!1})}},_trigger:function(e){var o=this.options;if(this.isEnabled()&&(this.isDisableSelected()||(this.isForceSelected()?this.setSelected(!0):this.isForceNotSelected()?this.setSelected(!1):this.setSelected(!this.isSelected())),this.isValid())){o.handler.call(this,this.getValue(),this,e);var v=this.getValue();this.fireEvent(BI.Controller.EVENT_CHANGE,BI.Events.CLICK,v,this,e),this.fireEvent(BI.BasicButton.EVENT_CHANGE,v,this),o.action&&BI.Actions.runAction(o.action,"click",o,this),BI.Actions.runGlobalAction("click",o,this)}},_doClick:function(e){this.isValid()&&this.beforeClick(e),this._trigger(e),this.isValid()&&this.doClick(e)},beforeClick:function(){},doClick:function(){},handle:function(){return this},hover:function(){this._hover=!0,this.handle().element.addClass("hover"),this.options.shadow&&this.$mask&&this.$mask.setVisible(!0)},dishover:function(){this._hover=!1,this.handle().element.removeClass("hover"),this.options.shadow&&this.$mask&&this.$mask.setVisible(!1)},setSelected:function(b){var o=this.options;o.selected=b,b?this.handle().element.addClass("active"):this.handle().element.removeClass("active"),o.shadow&&!o.isShadowShowingOnSelected&&this.$mask&&this.$mask.setVisible(!1)},isSelected:function(){return this.options.selected},isOnce:function(){return this.options.once},isForceSelected:function(){return this.options.forceSelected},isForceNotSelected:function(){return this.options.forceNotSelected},isDisableSelected:function(){return this.options.disableSelected},setText:function(text){this.options.text=text},getText:function(){return this.options.text},_setEnable:function(enable){BI.BasicButton.superclass._setEnable.apply(this,arguments),enable===!0?this.element.removeClass("base-disabled disabled"):enable===!1&&this.element.addClass("base-disabled disabled"),enable||this.options.shadow&&this.$mask&&this.$mask.setVisible(!1)},empty:function(){BI.Widget._renderEngine.createElement(document).unbind("mouseup."+this.getName()),BI.BasicButton.superclass.empty.apply(this,arguments)},destroy:function(){BI.BasicButton.superclass.destroy.apply(this,arguments)}}),BI.BasicButton.EVENT_CHANGE="BasicButton.EVENT_CHANGE",BI.NodeButton=BI.inherit(BI.BasicButton,{_defaultConfig:function(){var conf=BI.NodeButton.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{_baseCls:(conf._baseCls||"")+" bi-node",open:!1})},_init:function(){BI.NodeButton.superclass._init.apply(this,arguments);var self=this;BI.nextTick(function(){self.setOpened(self.isOpened())})},doClick:function(){BI.NodeButton.superclass.doClick.apply(this,arguments),this.setOpened(!this.isOpened())},isOnce:function(){return!1},isOpened:function(){return!!this.options.open},setOpened:function(b){this.options.open=!!b},triggerCollapse:function(){this.isOpened()&&(this.setOpened(!1),this.fireEvent(BI.Controller.EVENT_CHANGE,BI.Events.COLLAPSE,this.getValue(),this))},triggerExpand:function(){this.isOpened()||(this.setOpened(!0),this.fireEvent(BI.Controller.EVENT_CHANGE,BI.Events.EXPAND,this.getValue(),this))}}),BI.Tip=BI.inherit(BI.Single,{_defaultConfig:function(){var conf=BI.Tip.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{_baseCls:(conf._baseCls||"")+" bi-tip",zIndex:BI.zIndex_tip})},_init:function(){BI.Tip.superclass._init.apply(this,arguments),this.element.css({zIndex:this.options.zIndex})}}),BI.ButtonGroup=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.ButtonGroup.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-button-group",behaviors:{},items:[],value:"",chooseType:BI.Selection.Single,layouts:[{type:"bi.center",hgap:0,vgap:0}]})},_init:function(){BI.ButtonGroup.superclass._init.apply(this,arguments);var o=this.options,behaviors={};BI.each(o.behaviors,function(key,rule){behaviors[key]=BI.BehaviorFactory.createBehavior(key,{rule:rule})}),this.behaviors=behaviors,this.populate(o.items),(BI.isKey(o.value)||BI.isNotEmptyArray(o.value))&&this.setValue(o.value)},_createBtns:function(items){var o=this.options;return BI.createWidgets(BI.createItems(items,{type:"bi.text_button"}))},_btnsCreator:function(items){var self=this,args=Array.prototype.slice.call(arguments),o=this.options,buttons=this._createBtns(items);return args[0]=buttons,BI.each(this.behaviors,function(i,behavior){behavior.doBehavior.apply(behavior,args)}),BI.each(buttons,function(i,btn){btn.on(BI.Controller.EVENT_CHANGE,function(type,value,obj){if(type===BI.Events.CLICK){switch(o.chooseType){case BI.ButtonGroup.CHOOSE_TYPE_SINGLE:self.setValue(btn.getValue());break;case BI.ButtonGroup.CHOOSE_TYPE_NONE:self.setValue([])}self.fireEvent(BI.Controller.EVENT_CHANGE,arguments),self.fireEvent(BI.ButtonGroup.EVENT_CHANGE,value,obj)}else self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),btn.on(BI.Events.DESTROY,function(){BI.remove(self.buttons,btn)})}),buttons},_packageBtns:function(btns){for(var o=this.options,i=o.layouts.length-1;i>0;i--)btns=BI.map(btns,function(k,it){return BI.extend({},o.layouts[i],{items:[BI.extend({},o.layouts[i].el,{el:it})]})});return btns},_packageSimpleItems:function(btns){var o=this.options;return BI.map(o.items,function(i,item){return BI.stripEL(item)===item?btns[i]:BI.extend({},item,{el:btns[i]})})},_packageItems:function(items,packBtns){return BI.createItems(BI.makeArrayByArray(items,{}),BI.clone(packBtns))},_packageLayout:function(items){for(var o=this.options,layout=BI.deepClone(o.layouts[0]),lay=BI.formatEL(layout).el;lay&&lay.items&&!BI.isEmpty(lay.items);)lay=BI.formatEL(lay.items[0]).el;return lay.items=items,layout},_isSimpleLayout:function(){var o=this.options;return 1===o.layouts.length&&!BI.isArray(o.items[0])},doBehavior:function(){var args=Array.prototype.slice.call(arguments);args.unshift(this.buttons),BI.each(this.behaviors,function(i,behavior){behavior.doBehavior.apply(behavior,args)})},prependItems:function(items){var o=this.options,btns=this._btnsCreator.apply(this,arguments);return this.buttons=BI.concat(btns,this.buttons),this._isSimpleLayout()&&this.layouts&&this.layouts.prependItems?void this.layouts.prependItems(btns):(items=this._packageItems(items,this._packageBtns(btns)),void this.layouts.prependItems(this._packageLayout(items).items))},addItems:function(items){var o=this.options,btns=this._btnsCreator.apply(this,arguments);return this.buttons=BI.concat(this.buttons,btns),this._isSimpleLayout()&&this.layouts&&this.layouts.addItems?void this.layouts.addItems(btns):(items=this._packageItems(items,this._packageBtns(btns)),void this.layouts.addItems(this._packageLayout(items).items))},removeItemAt:function(indexes){BI.removeAt(this.buttons,indexes),this.layouts.removeItemAt(indexes)},removeItems:function(values){values=BI.isArray(values)?values:[values];var deleted=[];BI.each(this.buttons,function(i,button){BI.deepContains(values,button.getValue())&&deleted.push(i)}),BI.removeAt(this.buttons,deleted),this.layouts.removeItemAt(deleted)},populate:function(items){items=items||[],this.empty(),this.options.items=items,this.buttons=this._btnsCreator.apply(this,arguments),items=this._isSimpleLayout()?this._packageSimpleItems(this.buttons):this._packageItems(items,this._packageBtns(this.buttons)),this.layouts=BI.createWidget(BI.extend({element:this},this._packageLayout(items)))},setNotSelectedValue:function(v){v=BI.isArray(v)?v:[v],BI.each(this.buttons,function(i,item){BI.deepContains(v,item.getValue())?item.setSelected&&item.setSelected(!1):item.setSelected&&item.setSelected(!0)})},setEnabledValue:function(v){v=BI.isArray(v)?v:[v],BI.each(this.buttons,function(i,item){BI.deepContains(v,item.getValue())?item.setEnable(!0):item.setEnable(!1)})},setValue:function(v){v=BI.isArray(v)?v:[v],BI.each(this.buttons,function(i,item){BI.deepContains(v,item.getValue())?item.setSelected&&item.setSelected(!0):item.setSelected&&item.setSelected(!1)})},getNotSelectedValue:function(){var v=[];return BI.each(this.buttons,function(i,item){!item.isEnabled()||item.isSelected&&item.isSelected()||v.push(item.getValue())}),v},getValue:function(){var v=[];return BI.each(this.buttons,function(i,item){item.isEnabled()&&item.isSelected&&item.isSelected()&&v.push(item.getValue())}),v},getAllButtons:function(){return this.buttons},getAllLeaves:function(){return this.buttons},getSelectedButtons:function(){var btns=[];return BI.each(this.buttons,function(i,item){item.isSelected&&item.isSelected()&&btns.push(item)}),btns},getNotSelectedButtons:function(){var btns=[];return BI.each(this.buttons,function(i,item){item.isSelected&&!item.isSelected()&&btns.push(item)}),btns},getIndexByValue:function(value){var index=-1;return BI.any(this.buttons,function(i,item){if(item.isEnabled()&&item.getValue()===value)return index=i,!0}),index},getNodeById:function(id){var node;return BI.any(this.buttons,function(i,item){if(item.isEnabled()&&item.options.id===id)return node=item,!0}),node},getNodeByValue:function(value){var node;return BI.any(this.buttons,function(i,item){if(item.isEnabled()&&item.getValue()===value)return node=item,!0}),node},empty:function(){BI.ButtonGroup.superclass.empty.apply(this,arguments),this.options.items=[]},destroy:function(){BI.ButtonGroup.superclass.destroy.apply(this,arguments),this.options.items=[]}}),BI.extend(BI.ButtonGroup,{CHOOSE_TYPE_SINGLE:BI.Selection.Single,CHOOSE_TYPE_MULTI:BI.Selection.Multi,CHOOSE_TYPE_ALL:BI.Selection.All,CHOOSE_TYPE_NONE:BI.Selection.None,CHOOSE_TYPE_DEFAULT:BI.Selection.Default}),BI.ButtonGroup.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.button_group",BI.ButtonGroup),BI.ButtonTree=BI.inherit(BI.ButtonGroup,{_defaultConfig:function(){return BI.extend(BI.ButtonTree.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-button-tree"})},_init:function(){BI.ButtonTree.superclass._init.apply(this,arguments)},setNotSelectedValue:function(v){v=BI.isArray(v)?v:[v],BI.each(this.buttons,function(i,item){return BI.isFunction(item.setSelected)?void(BI.deepContains(v,item.getValue())?item.setSelected(!1):item.setSelected(!0)):void item.setNotSelectedValue(v)})},setEnabledValue:function(v){v=BI.isArray(v)?v:[v],BI.each(this.buttons,function(i,item){return BI.isFunction(item.setEnabledValue)?void item.setEnabledValue(v):void(BI.deepContains(v,item.getValue())?item.setEnable(!0):item.setEnable(!1))})},setValue:function(v){v=BI.isArray(v)?v:[v],BI.each(this.buttons,function(i,item){return BI.isFunction(item.setSelected)?void(BI.deepContains(v,item.getValue())?item.setSelected(!0):item.setSelected(!1)):void item.setValue(v)})},getNotSelectedValue:function(){ +var v=[];return BI.each(this.buttons,function(i,item){return item.isEnabled()&&!BI.isFunction(item.setSelected)?void(v=BI.concat(v,item.getNotSelectedValue())):void(item.isEnabled()&&item.isSelected&&!item.isSelected()&&v.push(item.getValue()))}),v},getValue:function(){var v=[];return BI.each(this.buttons,function(i,item){return item.isEnabled()&&!BI.isFunction(item.setSelected)?void(v=BI.concat(v,item.getValue())):void(item.isEnabled()&&item.isSelected&&item.isSelected()&&v.push(item.getValue()))}),v},getSelectedButtons:function(){var btns=[];return BI.each(this.buttons,function(i,item){return item.isEnabled()&&!BI.isFunction(item.setSelected)?void(btns=btns.concat(item.getSelectedButtons())):void(item.isSelected&&item.isSelected()&&btns.push(item))}),btns},getNotSelectedButtons:function(){var btns=[];return BI.each(this.buttons,function(i,item){return item.isEnabled()&&!BI.isFunction(item.setSelected)?void(btns=btns.concat(item.getNotSelectedButtons())):void(item.isSelected&&!item.isSelected()&&btns.push(item))}),btns},getAllLeaves:function(){var leaves=[];return BI.each(this.buttons,function(i,item){return item.isEnabled()&&!BI.isFunction(item.setSelected)?void(leaves=leaves.concat(item.getAllLeaves())):void(item.isEnabled()&&leaves.push(item))}),leaves},getIndexByValue:function(value){var index=-1;return BI.any(this.buttons,function(i,item){var vs=item.getValue();if(item.isEnabled()&&(vs===value||BI.contains(vs,value)))return index=i,!0}),index},getNodeById:function(id){var node;return BI.any(this.buttons,function(i,item){if(item.isEnabled()){if(item.attr("id")===id)return node=item,!0;if(BI.isFunction(item.getNodeById)&&(node=item.getNodeById(id)))return!0}}),node},getNodeByValue:function(value){var node;return BI.any(this.buttons,function(i,item){if(item.isEnabled())if(BI.isFunction(item.getNodeByValue)){if(node=item.getNodeByValue(value))return!0}else if(item.attr("value")===value)return node=item,!0}),node}}),BI.ButtonTree.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.button_tree",BI.ButtonTree),BI.TreeView=BI.inherit(BI.Pane,{_defaultConfig:function(){return BI.extend(BI.TreeView.superclass._defaultConfig.apply(this,arguments),{_baseCls:"bi-tree",paras:{selectedValues:{}},itemsCreator:BI.emptyFn})},_init:function(){BI.TreeView.superclass._init.apply(this,arguments);var o=this.options;this._stop=!1,this._createTree(),this.tip=BI.createWidget({type:"bi.loading_bar",invisible:!0,handler:BI.bind(this._loadMore,this)}),BI.createWidget({type:"bi.vertical",scrollable:!0,scrolly:!1,element:this,items:[this.tip]}),BI.isNotNull(o.value)&&this.setSelectedValue(o.value),BI.isIE9Below&&BI.isIE9Below()&&this.element.addClass("hack")},_createTree:function(){this.id="bi-tree"+BI.UUID(),this.nodes&&this.nodes.destroy(),this.tree&&this.tree.destroy(),this.tree=BI.createWidget({type:"bi.layout",element:"
    "}),BI.createWidget({type:"bi.default",element:this.element,items:[this.tree]})},_selectTreeNode:function(treeId,treeNode){this.fireEvent(BI.Controller.EVENT_CHANGE,BI.Events.CLICK,treeNode,this),this.fireEvent(BI.TreeView.EVENT_CHANGE,treeNode,this)},_configSetting:function(){function onClick(event,treeId,treeNode){var checked=treeNode.checked,status=treeNode.getCheckStatus();status.half===!0&&status.checked===!0&&(checked=!1),self.nodes.checkNode(treeNode,!checked,!0,!0)}function getUrl(treeId,treeNode){var parentNode=self._getParentValues(treeNode);treeNode.times=treeNode.times||1;var param="id="+treeNode.id+"×="+treeNode.times++ +"&parentValues= "+_global.encodeURIComponent(BI.jsonEncode(parentNode))+"&checkState="+_global.encodeURIComponent(BI.jsonEncode(treeNode.getCheckStatus()));return"&"+param}function beforeExpand(treeId,treeNode){return treeNode.isAjaxing?(BI.Msg.toast("Please Wait。","warning"),!1):(treeNode.children||(treeNode.times=1,ajaxGetNodes(treeNode,"refresh")),!0)}function onAsyncSuccess(event,treeId,treeNode,msg){if(treeNode.halfCheck=!1,msg&&0!==msg.length&&!/^[\s,\S]*<\/html>$/gi.test(msg)&&!self._stop){var zTree=self.nodes,totalCount=treeNode.count||0;treeNode.children.length>totalCount?(treeNode.count=treeNode.children.length,BI.delay(function(){ajaxGetNodes(treeNode)},perTime)):(zTree.updateNode(treeNode),zTree.selectNode(treeNode.children[0]))}}function onAsyncError(event,treeId,treeNode,XMLHttpRequest,textStatus,errorThrown){var zTree=self.nodes;BI.Msg.toast("Error!","warning")}function ajaxGetNodes(treeNode,reloadType){var zTree=self.nodes;"refresh"==reloadType&&zTree.updateNode(treeNode),zTree.reAsyncChildNodes(treeNode,reloadType,!0)}function beforeCheck(treeId,treeNode){function track(children){BI.each(children,function(i,ch){ch.halfCheck===!0&&(ch.halfCheck=!1,track(ch.children))})}if(treeNode.halfCheck=!1,treeNode.checked===!0){track(treeNode.children);var treeObj=self.nodes,nodes=treeObj.getSelectedNodes();BI.$.each(nodes,function(index,node){node.halfCheck=!1})}var status=treeNode.getCheckStatus();status.half===!0&&status.checked===!0&&(treeNode.checked=!1)}function onCheck(event,treeId,treeNode){self._selectTreeNode(treeId,treeNode)}function onExpand(event,treeId,treeNode){treeNode.halfCheck=!1}function onCollapse(event,treeId,treeNode){}var paras=this.options.paras,self=this,setting={async:{enable:!0,url:getUrl,autoParam:["id","name"],otherParam:BI.cjkEncodeDO(paras)},check:{enable:!0},data:{key:{title:"title",name:"text"},simpleData:{enable:!0}},view:{showIcon:!1,expandSpeed:"",nameIsHTML:!0,dblClickExpand:!1},callback:{beforeExpand:beforeExpand,onAsyncSuccess:onAsyncSuccess,onAsyncError:onAsyncError,beforeCheck:beforeCheck,onCheck:onCheck,onExpand:onExpand,onCollapse:onCollapse,onClick:onClick}},className="dark",perTime=100;return setting},_getParentValues:function(treeNode){if(!treeNode.getParentNode())return[];var parentNode=treeNode.getParentNode(),result=this._getParentValues(parentNode);return result=result.concat([this._getNodeValue(parentNode)])},_getNodeValue:function(node){return null==node.value?BI.replaceAll(node.text.replace(/<[^>]+>/g,"")," "," "):node.value},_getHalfSelectedValues:function(map,node){var self=this,checkState=node.getCheckStatus();if(checkState.checked!==!1||checkState.half!==!1){if(BI.isNotEmptyArray(node.children)&&checkState.half===!0){var children=node.children;return void BI.each(children,function(i,ch){self._getHalfSelectedValues(map,ch)})}var parent=node.parentValues||self._getParentValues(node),path=parent.concat(this._getNodeValue(node));if(BI.isNotEmptyArray(node.children)||checkState.half===!1)return void this._buildTree(map,path);var storeValues=BI.deepClone(this.options.paras.selectedValues),treeNode=this._getTree(storeValues,path);this._addTreeNode(map,parent,this._getNodeValue(node),treeNode)}},_getTree:function(map,values){var cur=map;return BI.any(values,function(i,value){return null==cur[value]||void(cur=cur[value])}),cur},_addTreeNode:function(map,values,key,value){var cur=map;BI.each(values,function(i,value){null==cur[value]&&(cur[value]={}),cur=cur[value]}),cur[key]=value},_buildTree:function(map,values){var cur=map;BI.each(values,function(i,value){null==cur[value]&&(cur[value]={}),cur=cur[value]})},_getSelectedValues:function(){function track(nodes){BI.each(nodes,function(i,node){var checkState=node.getCheckStatus();if(checkState.checked===!0||checkState.half===!0)if(checkState.half===!0)self._getHalfSelectedValues(hashMap,node);else{var parentValues=node.parentValues||self._getParentValues(node),values=parentValues.concat([self._getNodeValue(node)]);self._buildTree(hashMap,values)}})}var self=this,hashMap={},rootNoots=this.nodes.getNodes();return track(rootNoots),hashMap},_dealWidthNodes:function(nodes){var self=this,o=this.options,ns=BI.Tree.arrayFormat(nodes);return BI.each(ns,function(i,n){n.title=n.title||n.text||n.value,n.isParent=n.isParent||n.parent,BI.isKey(o.paras.keyword)?n.text=BI.$("
    ").__textKeywordMarked__(n.text,o.paras.keyword,n.py).html():n.text=BI.htmlEncode(n.text+"")}),nodes},_loadMore:function(){var self=this,o=this.options;this.tip.setLoading();var op=BI.extend({},o.paras,{times:++this.times});o.itemsCreator(op,function(res){if(self._stop!==!0){var hasNext=!!res.hasNext,nodes=res.items||[];hasNext?self.tip.setLoaded():self.tip.setEnd(),nodes.length>0&&self.nodes.addNodes(null,self._dealWidthNodes(nodes))}})},_initTree:function(setting){var self=this,o=this.options;self.fireEvent(BI.Events.INIT),this.times=1;var tree=this.tree;tree.empty(),this.loading(),this.tip.setVisible(!1);var callback=function(nodes){self._stop!==!0&&(self.nodes=BI.$.fn.zTree.init(tree.element,setting,nodes))},op=BI.extend({},o.paras,{times:1});o.itemsCreator(op,function(res){if(self._stop!==!0){var hasNext=!!res.hasNext,nodes=res.items||[];nodes.length>0&&callback(self._dealWidthNodes(nodes)),self.setTipVisible(nodes.length<=0),self.loaded(),hasNext?self.tip.setLoaded():self.tip.invisible(),1===op.times&&self.fireEvent(BI.Events.AFTERINIT)}})},initTree:function(nodes,setting){var setting=setting||{async:{enable:!1},check:{enable:!1},data:{key:{title:"title",name:"text"},simpleData:{enable:!0}},view:{showIcon:!1,expandSpeed:"",nameIsHTML:!0},callback:{}};this.nodes=BI.$.fn.zTree.init(this.tree.element,setting,nodes)},start:function(){this._stop=!1},stop:function(){this._stop=!0},stroke:function(config){delete this.options.keyword,BI.extend(this.options.paras,config);var setting=this._configSetting();this._createTree(),this.start(),this._initTree(setting)},populate:function(){this.stroke.apply(this,arguments)},hasChecked:function(){var treeObj=this.nodes;return treeObj.getCheckedNodes(!0).length>0},checkAll:function(checked){function setNode(children){BI.each(children,function(i,child){child.halfCheck=!1,setNode(child.children)})}this.nodes&&(BI.each(this.nodes.getNodes(),function(i,node){node.halfCheck=!1,setNode(node.children)}),this.nodes.checkAllNodes(checked))},expandAll:function(flag){this.nodes&&this.nodes.expandAll(flag)},setValue:function(value,param){this.checkAll(!1),this.updateValue(value,param),this.refresh()},setSelectedValue:function(value){this.options.paras.selectedValues=BI.deepClone(value||{})},updateValue:function(values,param){if(this.nodes){param||(param="value");var treeObj=this.nodes;BI.each(values,function(v,op){var nodes=treeObj.getNodesByParam(param,v,null);BI.each(nodes,function(j,node){BI.extend(node,{checked:!0},op),treeObj.updateNode(node)})})}},refresh:function(){this.nodes&&this.nodes.refresh()},getValue:function(){return this.nodes?this._getSelectedValues():null},destroyed:function(){this.stop(),this.nodes&&this.nodes.destroy()}}),BI.extend(BI.TreeView,{REQ_TYPE_INIT_DATA:1,REQ_TYPE_ADJUST_DATA:2,REQ_TYPE_SELECT_DATA:3,REQ_TYPE_GET_SELECTED_DATA:4}),BI.TreeView.EVENT_CHANGE="EVENT_CHANGE",BI.TreeView.EVENT_INIT=BI.Events.INIT,BI.TreeView.EVENT_AFTERINIT=BI.Events.AFTERINIT,BI.shortcut("bi.tree_view",BI.TreeView),BI.AsyncTree=BI.inherit(BI.TreeView,{_defaultConfig:function(){return BI.extend(BI.AsyncTree.superclass._defaultConfig.apply(this,arguments),{})},_init:function(){BI.AsyncTree.superclass._init.apply(this,arguments)},_configSetting:function(){function onClick(event,treeId,treeNode){var zTree=BI.$.fn.zTree.getZTreeObj(treeId),checked=treeNode.checked,status=treeNode.getCheckStatus();status.half===!0&&status.checked===!0&&(checked=!1),zTree.checkNode(treeNode,!checked,!0,!0)}function beforeCheck(treeId,treeNode){function track(children){BI.each(children,function(i,ch){ch.halfCheck===!0&&(ch.halfCheck=!1,track(ch.children))})}if(treeNode.halfCheck=!1,treeNode.checked===!0){track(treeNode.children);var treeObj=BI.$.fn.zTree.getZTreeObj(treeId),nodes=treeObj.getSelectedNodes();BI.each(nodes,function(index,node){node.halfCheck=!1})}var status=treeNode.getCheckStatus();status.half===!0&&status.checked===!0&&(treeNode.checked=!1)}function beforeExpand(treeId,treeNode){self._beforeExpandNode(treeId,treeNode)}function onCheck(event,treeId,treeNode){self._selectTreeNode(treeId,treeNode)}function onExpand(event,treeId,treeNode){treeNode.halfCheck=!1}function onCollapse(event,treeId,treeNode){treeNode.halfCheck=!1}var paras=this.options.paras,self=this,setting={async:{enable:!1,otherParam:BI.cjkEncodeDO(paras)},check:{enable:!0},data:{key:{title:"title",name:"text"},simpleData:{enable:!0}},view:{showIcon:!1,expandSpeed:"",nameIsHTML:!0,dblClickExpand:!1},callback:{beforeCheck:beforeCheck,onCheck:onCheck,beforeExpand:beforeExpand,onExpand:onExpand,onCollapse:onCollapse,onClick:onClick}};return setting},_selectTreeNode:function(treeId,treeNode){var self=this,o=this.options,parentValues=BI.deepClone(treeNode.parentValues||self._getParentValues(treeNode)),name=this._getNodeValue(treeNode);if(treeNode.checked===!0);else{var tNode=treeNode,pNode=this._getTree(this.options.paras.selectedValues,parentValues);for(BI.isNotNull(pNode[name])&&delete pNode[name];null!=tNode&&BI.isEmpty(pNode);)parentValues=parentValues.slice(0,parentValues.length-1),tNode=tNode.getParentNode(),null!=tNode&&(pNode=this._getTree(this.options.paras.selectedValues,parentValues),name=this._getNodeValue(tNode),delete pNode[name])}BI.AsyncTree.superclass._selectTreeNode.apply(self,arguments)},_beforeExpandNode:function(treeId,treeNode){function callback(nodes,hasNext){self.nodes.addNodes(treeNode,nodes),hasNext===!0&&BI.delay(function(){times++,op.times=times,o.itemsCreator(op,complete)},100)}var self=this,o=this.options,parentValues=treeNode.parentValues||self._getParentValues(treeNode),op=BI.extend({},o.paras,{id:treeNode.id,times:1,parentValues:parentValues.concat(this._getNodeValue(treeNode)),checkState:treeNode.getCheckStatus()}),complete=function(d){var nodes=d.items||[];nodes.length>0&&callback(self._dealWidthNodes(nodes),!!d.hasNext)},times=1;treeNode.children||setTimeout(function(){o.itemsCreator(op,complete)},17)},_join:function(valueA,valueB){function track(parent,node,compare){BI.each(node,function(n,item){BI.isNull(compare[n])?self._addTreeNode(map,parent,n,item):BI.isEmpty(compare[n])?self._addTreeNode(map,parent,n,{}):track(parent.concat([n]),node[n],compare[n])})}var self=this,map={};return track([],valueA,valueB),track([],valueB,valueA),map},hasChecked:function(){return!BI.isEmpty(this.options.paras.selectedValues)||BI.AsyncTree.superclass.hasChecked.apply(this,arguments)},_getJoinValue:function(){if(!this.nodes)return{};var checkedValues=this._getSelectedValues();return BI.isEmpty(checkedValues)?BI.deepClone(this.options.paras.selectedValues):BI.isEmpty(this.options.paras.selectedValues)?checkedValues:this._join(checkedValues,this.options.paras.selectedValues)},getValue:function(){return this._getJoinValue()},stroke:function(config){delete this.options.keyword,BI.extend(this.options.paras,config);var setting=this._configSetting();this._initTree(setting)}}),BI.shortcut("bi.async_tree",BI.AsyncTree),BI.PartTree=BI.inherit(BI.AsyncTree,{_defaultConfig:function(){return BI.extend(BI.PartTree.superclass._defaultConfig.apply(this,arguments),{})},_init:function(){BI.PartTree.superclass._init.apply(this,arguments)},_loadMore:function(){var self=this,o=this.options,op=BI.extend({},o.paras,{type:BI.TreeView.REQ_TYPE_INIT_DATA,times:++this.times});this.tip.setLoading(),o.itemsCreator(op,function(d){var hasNext=!!d.hasNext,nodes=d.items||[];o.paras.lastSearchValue=d.lastSearchValue,self._stop!==!0&&(hasNext?self.tip.setLoaded():self.tip.setEnd(),nodes.length>0&&self.nodes.addNodes(null,self._dealWidthNodes(nodes)))})},_selectTreeNode:function(treeId,treeNode){var self=this,o=this.options,parentValues=BI.deepClone(treeNode.parentValues||self._getParentValues(treeNode)),name=this._getNodeValue(treeNode);if(treeNode.checked===!0)this.options.paras.selectedValues=this._getJoinValue(),o.itemsCreator(BI.extend({},o.paras,{type:BI.TreeView.REQ_TYPE_ADJUST_DATA,curSelectedValue:name,parentValues:parentValues}),function(res){self.options.paras.selectedValues=res,BI.AsyncTree.superclass._selectTreeNode.apply(self,arguments)});else{for(var t=this.options.paras.selectedValues,p=parentValues.concat(name),i=0,len=p.length;i0?self._dealWidthNodes(nodes):[]),self.setTipVisible(nodes.length<=0),self.loaded(),hasNext?self.tip.setLoaded():self.tip.invisible(),self.fireEvent(BI.Events.AFTERINIT)}};BI.delay(function(){o.itemsCreator(op,complete)},100)},getValue:function(){return BI.deepClone(this.options.paras.selectedValues||{})},stroke:function(config){var o=this.options;delete o.paras.keyword,BI.extend(o.paras,config),delete o.paras.lastSearchValue;var setting=this._configSetting();this._initTree(setting,o.paras.keyword)}}),BI.shortcut("bi.part_tree",BI.PartTree),BI.ListTreeView=BI.inherit(BI.TreeView,{_constants:{SPLIT:"<|>"},_defaultConfig:function(){return BI.extend(BI.ListTreeView.superclass._defaultConfig.apply(this,arguments),{})},_init:function(){BI.ListTreeView.superclass._init.apply(this,arguments);var o=this.options;this.storeValue=o.value||{}},_configSetting:function(){function onClick(event,treeId,treeNode){var zTree=BI.$.fn.zTree.getZTreeObj(treeId),checked=treeNode.checked;self._checkValue(treeNode,!checked),zTree.checkNode(treeNode,!checked,!0,!0)}function onCheck(event,treeId,treeNode){self._selectTreeNode(treeId,treeNode)}var paras=this.options.paras,self=this,setting={async:{enable:!1},check:{enable:!0,chkboxType:{Y:"",N:""}},data:{key:{title:"title",name:"text"},simpleData:{enable:!0}},view:{showIcon:!1,expandSpeed:"",nameIsHTML:!0,dblClickExpand:!1},callback:{onCheck:onCheck,onClick:onClick}};return setting},_selectTreeNode:function(treeId,treeNode){this._checkValue(treeNode,treeNode.checked),BI.ListTreeView.superclass._selectTreeNode.apply(this,arguments)},_transArrayToMap:function(treeArrays){var self=this,map={};return BI.each(treeArrays,function(idx,array){var key=array.join(self._constants.SPLIT);map[key]=!0}),map},_transMapToArray:function(treeMap){var self=this,array=[];return BI.each(treeMap,function(key){var item=key.split(self._constants.SPLIT);array.push(item)}),array},_checkValue:function(treeNode,checked){var key=BI.concat(this._getParentValues(treeNode),this._getNodeValue(treeNode)).join(this._constants.SPLIT);checked?this.storeValue[key]=!0:delete this.storeValue[key]},setSelectedValue:function(value){this.options.paras.selectedValues=value||[],this.storeValue=this._transArrayToMap(value)},getValue:function(){return this._transMapToArray(this.storeValue)}}),BI.shortcut("bi.list_tree_view",BI.ListTreeView),BI.ListAsyncTree=BI.inherit(BI.ListTreeView,{_defaultConfig:function(){return BI.extend(BI.ListAsyncTree.superclass._defaultConfig.apply(this,arguments),{})},_init:function(){BI.ListAsyncTree.superclass._init.apply(this,arguments)},_configSetting:function(){function beforeCheck(treeId,treeNode){treeNode.half=!1}function onClick(event,treeId,treeNode){var zTree=BI.$.fn.zTree.getZTreeObj(treeId),checked=treeNode.checked;self._checkValue(treeNode,!checked),zTree.checkNode(treeNode,!checked,!0,!0)}function beforeExpand(treeId,treeNode){self._beforeExpandNode(treeId,treeNode)}function onCheck(event,treeId,treeNode){self._selectTreeNode(treeId,treeNode)}var paras=this.options.paras,self=this,setting={async:{enable:!1,otherParam:BI.cjkEncodeDO(paras)},check:{enable:!0,chkboxType:{Y:"",N:""}},data:{key:{title:"title",name:"text"},simpleData:{enable:!0}},view:{showIcon:!1,expandSpeed:"",nameIsHTML:!0,dblClickExpand:!1},callback:{onCheck:onCheck,beforeExpand:beforeExpand,beforeCheck:beforeCheck,onClick:onClick}};return setting},_beforeExpandNode:function(treeId,treeNode){function callback(nodes,hasNext){self.nodes.addNodes(treeNode,nodes),hasNext===!0&&BI.delay(function(){times++,op.times=times,o.itemsCreator(op,complete)},100)}var self=this,o=this.options,parentValues=treeNode.parentValues||self._getParentValues(treeNode),op=BI.extend({},o.paras,{id:treeNode.id,times:1,parentValues:parentValues.concat(this._getNodeValue(treeNode))}),complete=function(d){var nodes=d.items||[];nodes.length>0&&callback(self._dealWidthNodes(nodes),!!d.hasNext)},times=1;treeNode.children||setTimeout(function(){o.itemsCreator(op,complete)},17)},hasChecked:function(){return!BI.isEmpty(this.options.paras.selectedValues)||BI.ListAsyncTree.superclass.hasChecked.apply(this,arguments)},stroke:function(config){delete this.options.keyword,BI.extend(this.options.paras,config);var setting=this._configSetting();this._initTree(setting)}}),BI.shortcut("bi.list_async_tree",BI.ListAsyncTree),BI.ListPartTree=BI.inherit(BI.ListAsyncTree,{_defaultConfig:function(){return BI.extend(BI.ListPartTree.superclass._defaultConfig.apply(this,arguments),{})},_init:function(){BI.ListPartTree.superclass._init.apply(this,arguments)},_loadMore:function(){var self=this,o=this.options,op=BI.extend({},o.paras,{type:BI.TreeView.REQ_TYPE_INIT_DATA,times:++this.times});this.tip.setLoading(),o.itemsCreator(op,function(d){var hasNext=!!d.hasNext,nodes=d.items||[];o.paras.lastSearchValue=d.lastSearchValue,self._stop!==!0&&(hasNext?self.tip.setLoaded():self.tip.setEnd(),nodes.length>0&&self.nodes.addNodes(null,self._dealWidthNodes(nodes)))})},_initTree:function(setting,keyword){function callback(nodes){self._stop!==!0&&(self.nodes=BI.$.fn.zTree.init(tree.element,setting,nodes))}var self=this,o=this.options;this.times=1;var tree=this.tree;tree.empty(),self.tip.setVisible(!1),this.loading();var op=BI.extend({},o.paras,{type:BI.TreeView.REQ_TYPE_INIT_DATA,times:this.times}),complete=function(d){if(self._stop!==!0&&keyword==o.paras.keyword){var hasNext=!!d.hasNext,nodes=d.items||[];o.paras.lastSearchValue=d.lastSearchValue,callback(nodes.length>0?self._dealWidthNodes(nodes):[]),self.setTipVisible(nodes.length<=0),self.loaded(),hasNext?self.tip.setLoaded():self.tip.invisible(),self.fireEvent(BI.Events.AFTERINIT)}};BI.delay(function(){o.itemsCreator(op,complete)},100)},stroke:function(config){var o=this.options;delete o.paras.keyword,BI.extend(o.paras,config),delete o.paras.lastSearchValue;var setting=this._configSetting();this._initTree(setting,o.paras.keyword)}}),BI.shortcut("bi.list_part_tree",BI.ListPartTree),BI.prepares.push(function(){BI.Resizers=new BI.ResizeController,BI.Layers=new BI.LayerController,BI.Maskers=new BI.MaskersController,BI.Bubbles=new BI.BubblesController,BI.Tooltips=new BI.TooltipsController,BI.Popovers=new BI.PopoverController,BI.Broadcasts=new BI.BroadcastController,BI.StyleLoaders=new BI.StyleLoaderManager}),BI.CollectionView=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.CollectionView.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-collection",overflowX:!0,overflowY:!0,cellSizeAndPositionGetter:BI.emptyFn,horizontalOverscanSize:0,verticalOverscanSize:0,scrollLeft:0,scrollTop:0,items:[]})},_init:function(){BI.CollectionView.superclass._init.apply(this,arguments);var self=this,o=this.options;this.renderedCells=[],this.renderedKeys=[],this.renderRange={},this._scrollLock=!1,this._debounceRelease=BI.debounce(function(){self._scrollLock=!1},1e3/60),this.container=BI.createWidget({type:"bi.absolute"}),this.element.scroll(function(){self._scrollLock!==!0&&(o.scrollLeft=self.element.scrollLeft(),o.scrollTop=self.element.scrollTop(),self._calculateChildrenToRender(),self.fireEvent(BI.CollectionView.EVENT_SCROLL,{scrollLeft:o.scrollLeft,scrollTop:o.scrollTop}))}),BI.createWidget({type:"bi.vertical",element:this,scrollable:o.overflowX===!0&&o.overflowY===!0,scrolly:o.overflowX===!1&&o.overflowY===!0,scrollx:o.overflowX===!0&&o.overflowY===!1,items:[this.container]}),o.items.length>0&&(this._calculateSizeAndPositionData(),this._populate())},mounted:function(){var o=this.options;0===o.scrollLeft&&0===o.scrollTop||(this.element.scrollTop(o.scrollTop),this.element.scrollLeft(o.scrollLeft))},_calculateSizeAndPositionData:function(){for(var o=this.options,cellMetadata=[],sectionManager=new BI.SectionManager,height=0,width=0,index=0,len=o.items.length;index0&&bottom>0){if(top>=this.renderRange.minY&&bottom<=this.renderRange.maxY&&left>=this.renderRange.minX&&right<=this.renderRange.maxX)return;for(var childrenToDisplay=this._cellRenderers(bottom-top,right-left,left,top),renderedCells=[],renderedKeys={},renderedWidgets={},lefts={},tops={},i=0,len=childrenToDisplay.length;i=0?(datum.width!==this.renderedCells[index]._width&&(this.renderedCells[index]._width=datum.width,this.renderedCells[index].el.setWidth(datum.width)),datum.height!==this.renderedCells[index]._height&&(this.renderedCells[index]._height=datum.height,this.renderedCells[index].el.setHeight(datum.height)),this.renderedCells[index]._left!==datum.x&&this.renderedCells[index].el.element.css("left",datum.x+"px"),this.renderedCells[index]._top!==datum.y&&this.renderedCells[index].el.element.css("top",datum.y+"px"),renderedCells.push(child=this.renderedCells[index])):(child=BI.createWidget(BI.extend({type:"bi.label",width:datum.width,height:datum.height},o.items[datum.index],{cls:(o.items[datum.index].cls||"")+" container-cell"+(0===datum.y?" first-row":"")+(0===datum.x?" first-col":""),_left:datum.x,_top:datum.y})),renderedCells.push({el:child,left:datum.x,top:datum.y,_left:datum.x,_top:datum.y,_width:datum.width,_height:datum.height}));for(var startTopIndex=0|topMap[datum.y],endTopIndex=0|topMap[datum.y+datum.height],k=startTopIndex;k<=endTopIndex;k++){var t=tops[k];assertMinBorder(leftBorder,t),assertMaxBorder(rightBorder,t),leftBorder[t]=Math.min(leftBorder[t],datum.x),rightBorder[t]=Math.max(rightBorder[t],datum.x+datum.width)}for(var startLeftIndex=0|leftMap[datum.x],endLeftIndex=0|leftMap[datum.x+datum.width],k=startLeftIndex;k<=endLeftIndex;k++){var l=lefts[k];assertMinBorder(topBorder,l),assertMaxBorder(bottomBorder,l),topBorder[l]=Math.min(topBorder[l],datum.y),bottomBorder[l]=Math.max(bottomBorder[l],datum.y+datum.height)}renderedKeys[datum.index]=[datum.index,i],renderedWidgets[i]=child}var existSet={},addSet={},deleteArray=[];BI.each(renderedKeys,function(i,key){self.renderedKeys[i]?existSet[i]=key:addSet[i]=key}),BI.each(this.renderedKeys,function(i,key){existSet[i]||addSet[i]||deleteArray.push(key[1])}),BI.each(deleteArray,function(i,index){self.renderedCells[index].el._destroy()});var addedItems=[];BI.each(addSet,function(index,key){addedItems.push(renderedCells[key[1]])}),this.container.addItems(addedItems),this.container._children=renderedWidgets,this.container.attr("items",renderedCells),this.renderedCells=renderedCells,this.renderedKeys=renderedKeys;var minX=BI.min(leftBorder),maxX=BI.max(rightBorder),minY=BI.max(topBorder),maxY=BI.min(bottomBorder);this.renderRange={minX:minX,minY:minY,maxX:maxX,maxY:maxY}}},_getMaxScrollLeft:function(){return Math.max(0,this._width-this.options.width+(this.options.overflowX?BI.DOM.getScrollWidth():0))},_getMaxScrollTop:function(){return Math.max(0,this._height-this.options.height+(this.options.overflowY?BI.DOM.getScrollWidth():0))},_populate:function(items){var o=this.options;if(this._reRange(),items&&items!==this.options.items&&(this.options.items=items,this._calculateSizeAndPositionData()),o.items.length>0){this.container.setWidth(this._width),this.container.setHeight(this._height),this._calculateChildrenToRender();try{this.element.scrollTop(o.scrollTop),this.element.scrollLeft(o.scrollLeft)}catch(e){}}},setScrollLeft:function(scrollLeft){this.options.scrollLeft!==scrollLeft&&(this._scrollLock=!0,this.options.scrollLeft=BI.clamp(scrollLeft||0,0,this._getMaxScrollLeft()),this._debounceRelease(),this._calculateChildrenToRender(),this.element.scrollLeft(this.options.scrollLeft))},setScrollTop:function(scrollTop){this.options.scrollTop!==scrollTop&&(this._scrollLock=!0,this.options.scrollTop=BI.clamp(scrollTop||0,0,this._getMaxScrollTop()),this._debounceRelease(),this._calculateChildrenToRender(),this.element.scrollTop(this.options.scrollTop))},setOverflowX:function(b){var self=this;this.options.overflowX!==!!b&&(this.options.overflowX=!!b,BI.nextTick(function(){self.element.css({overflowX:b?"auto":"hidden"})}))},setOverflowY:function(b){var self=this;this.options.overflowY!==!!b&&(this.options.overflowY=!!b,BI.nextTick(function(){self.element.css({overflowY:b?"auto":"hidden"})}))},getScrollLeft:function(){return this.options.scrollLeft},getScrollTop:function(){return this.options.scrollTop},getMaxScrollLeft:function(){return this._getMaxScrollLeft()},getMaxScrollTop:function(){return this._getMaxScrollTop()},_reRange:function(){this.renderRange={}},_clearChildren:function(){this.container._children={},this.container.attr("items",[])},restore:function(){BI.each(this.renderedCells,function(i,cell){cell.el._destroy()}),this._clearChildren(), +this.renderedCells=[],this.renderedKeys=[],this.renderRange={},this._scrollLock=!1},populate:function(items){items&&items!==this.options.items&&this.restore(),this._populate(items)}}),BI.CollectionView.EVENT_SCROLL="EVENT_SCROLL",BI.shortcut("bi.collection_view",BI.CollectionView),BI.Combo=BI.inherit(BI.Widget,{_defaultConfig:function(){var conf=BI.Combo.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{baseCls:(conf.baseCls||"")+" bi-combo",trigger:"click",toggle:!0,direction:"bottom",logic:{dynamic:!0},container:null,isDefaultInit:!1,destroyWhenHide:!1,isNeedAdjustHeight:!0,isNeedAdjustWidth:!0,stopEvent:!1,stopPropagation:!1,adjustLength:0,adjustXOffset:0,adjustYOffset:0,hideChecker:BI.emptyFn,offsetStyle:"left",el:{},popup:{},comboClass:"bi-combo-popup",hoverClass:"bi-combo-hover"})},_init:function(){BI.Combo.superclass._init.apply(this,arguments);var self=this,o=this.options;this._initCombo(),this._initPullDownAction(),this.combo.on(BI.Controller.EVENT_CHANGE,function(type,value,obj){self.isEnabled()&&self.isValid()&&(type===BI.Events.EXPAND&&self._popupView(),type===BI.Events.COLLAPSE&&self._hideView(),type===BI.Events.EXPAND&&(self.fireEvent(BI.Controller.EVENT_CHANGE,arguments),self.fireEvent(BI.Combo.EVENT_EXPAND)),type===BI.Events.COLLAPSE&&(self.fireEvent(BI.Controller.EVENT_CHANGE,arguments),self.isViewVisible()&&self.fireEvent(BI.Combo.EVENT_COLLAPSE)),type===BI.Events.CLICK&&self.fireEvent(BI.Combo.EVENT_TRIGGER_CHANGE,obj))}),self.element.on("mouseenter."+self.getName(),function(e){self.isEnabled()&&self.isValid()&&self.combo.isEnabled()&&self.combo.isValid()&&self.element.addClass(o.hoverClass)}),self.element.on("mouseleave."+self.getName(),function(e){self.isEnabled()&&self.isValid()&&self.combo.isEnabled()&&self.combo.isValid()&&self.element.removeClass(o.hoverClass)}),BI.createWidget(BI.extend({element:this},BI.LogicFactory.createLogic("vertical",BI.extend(o.logic,{items:[{el:this.combo}]})))),o.isDefaultInit&&this._assertPopupView(),BI.Resizers.add(this.getName(),BI.bind(function(){this.isViewVisible()&&this._hideView()},this))},_toggle:function(){this._assertPopupViewRender(),this.popupView.isVisible()?this._hideView():this.isEnabled()&&this._popupView()},_initPullDownAction:function(){function hide(){self.isEnabled()&&self.isValid()&&self.combo.isEnabled()&&self.combo.isValid()&&o.toggle===!0&&(self._hideView(),self.fireEvent(BI.Controller.EVENT_CHANGE,BI.Events.COLLAPSE,"",self.combo),self.fireEvent(BI.Combo.EVENT_COLLAPSE)),self.popupView&&self.popupView.element.off("mouseenter."+self.getName()).off("mouseleave."+self.getName()),enterPopup=!1}var self=this,o=this.options,evs=(this.options.trigger||"").split(","),st=function(e){o.stopEvent&&e.stopEvent(),o.stopPropagation&&e.stopPropagation()},enterPopup=!1;BI.each(evs,function(i,ev){switch(ev){case"hover":self.element.on("mouseenter."+self.getName(),function(e){self.isEnabled()&&self.isValid()&&self.combo.isEnabled()&&self.combo.isValid()&&(self._popupView(),self.fireEvent(BI.Controller.EVENT_CHANGE,BI.Events.EXPAND,"",self.combo),self.fireEvent(BI.Combo.EVENT_EXPAND))}),self.element.on("mouseleave."+self.getName(),function(e){self.popupView&&(self.popupView.element.on("mouseenter."+self.getName(),function(e){enterPopup=!0,self.popupView.element.on("mouseleave."+self.getName(),function(e){hide()}),self.popupView.element.off("mouseenter."+self.getName())}),BI.defer(function(){enterPopup||hide()},50))});break;case"click":var debounce=BI.debounce(function(e){self.combo.element.__isMouseInBounds__(e)&&self.isEnabled()&&self.isValid()&&self.combo.isEnabled()&&self.combo.isValid()&&(o.toggle?self._toggle():self._popupView(),self.isViewVisible()?(self.fireEvent(BI.Controller.EVENT_CHANGE,BI.Events.EXPAND,"",self.combo),self.fireEvent(BI.Combo.EVENT_EXPAND)):(self.fireEvent(BI.Controller.EVENT_CHANGE,BI.Events.COLLAPSE,"",self.combo),self.fireEvent(BI.Combo.EVENT_COLLAPSE)))},BI.EVENT_RESPONSE_TIME,{leading:!0,trailing:!1});self.element.off(ev+"."+self.getName()).on(ev+"."+self.getName(),function(e){debounce(e),st(e)});break;case"click-hover":var debounce=BI.debounce(function(e){self.combo.element.__isMouseInBounds__(e)&&self.isEnabled()&&self.isValid()&&self.combo.isEnabled()&&self.combo.isValid()&&(self._popupView(),self.isViewVisible()&&(self.fireEvent(BI.Controller.EVENT_CHANGE,BI.Events.EXPAND,"",self.combo),self.fireEvent(BI.Combo.EVENT_EXPAND)))},BI.EVENT_RESPONSE_TIME,{leading:!0,trailing:!1});self.element.off("click."+self.getName()).on("click."+self.getName(),function(e){debounce(e),st(e)}),self.element.on("mouseleave."+self.getName(),function(e){self.popupView&&(self.popupView.element.on("mouseenter."+self.getName(),function(e){enterPopup=!0,self.popupView.element.on("mouseleave."+self.getName(),function(e){hide()}),self.popupView.element.off("mouseenter."+self.getName())}),BI.defer(function(){enterPopup||hide()},50))})}})},_initCombo:function(){this.combo=BI.createWidget(this.options.el,{value:this.options.value})},_assertPopupView:function(){var self=this,o=this.options;null==this.popupView&&(this.popupView=BI.createWidget(this.options.popup,{type:"bi.popup_view",value:o.value},this),this.popupView.on(BI.Controller.EVENT_CHANGE,function(type,value,obj){type===BI.Events.CLICK&&(self.combo.setValue(self.getValue()),self.fireEvent(BI.Combo.EVENT_CHANGE,value,obj)),self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.popupView.setVisible(!1),BI.nextTick(function(){self.fireEvent(BI.Combo.EVENT_AFTER_INIT)}))},_assertPopupViewRender:function(){this._assertPopupView(),this._rendered||(BI.createWidget({type:"bi.vertical",scrolly:!1,element:this.options.container||this,items:[{el:this.popupView}]}),this._rendered=!0)},_hideIf:function(e){if(this.element.find(e.target).length>0||this.popupView&&this.popupView.element.find(e.target).length>0||"CodeMirror-cursor"===e.target.className||BI.Widget._renderEngine.createElement(e.target).closest(".CodeMirror-hints").length>0){var directions=this.options.direction.split(",");return void((BI.contains(directions,"innerLeft")||BI.contains(directions,"innerRight"))&&(this.adjustWidth(),this.adjustHeight()))}var isHide=this.options.hideChecker.apply(this,[e]);isHide!==!1&&this._hideView()},_hideView:function(){this.fireEvent(BI.Combo.EVENT_BEFORE_HIDEVIEW),this.options.destroyWhenHide===!0?(this.popupView&&this.popupView.destroy(),this.popupView=null,this._rendered=!1):this.popupView&&this.popupView.invisible(),this.element.removeClass(this.options.comboClass),BI.Widget._renderEngine.createElement(document).unbind("mousedown."+this.getName()).unbind("mousewheel."+this.getName()),this.fireEvent(BI.Combo.EVENT_AFTER_HIDEVIEW)},_popupView:function(e){this._assertPopupViewRender(),this.fireEvent(BI.Combo.EVENT_BEFORE_POPUPVIEW),this.popupView.visible(),this.adjustWidth(e),this.adjustHeight(e),this.element.addClass(this.options.comboClass),BI.Widget._renderEngine.createElement(document).unbind("mousedown."+this.getName()).unbind("mousewheel."+this.getName()),BI.Widget._renderEngine.createElement(document).bind("mousedown."+this.getName(),BI.bind(this._hideIf,this)).bind("mousewheel."+this.getName(),BI.bind(this._hideIf,this)),this.fireEvent(BI.Combo.EVENT_AFTER_POPUPVIEW)},adjustWidth:function(e){var o=this.options;if(this.popupView&&o.isNeedAdjustWidth===!0){this.resetListWidth("");var width=this.popupView.element.outerWidth(),maxW=this.element.outerWidth()||o.width;width>maxW+80?maxW+=80:width>maxW&&(maxW=width),this.resetListWidth(maxW<100?100:maxW)}},adjustHeight:function(e){var o=this.options,p={};if(this.popupView){var isVisible=this.popupView.isVisible();this.popupView.visible();var combo=BI.isNotNull(e)?{element:{offset:function(){return{left:e.pageX,top:e.pageY}},bounds:function(){return{x:e.offsetX,y:e.offsetY,width:0,height:24}},outerWidth:function(){return 0},outerHeight:function(){return 24}}}:this.combo;switch(o.direction){case"bottom":case"bottom,right":p=BI.DOM.getComboPosition(combo,this.popupView,o.adjustXOffset,o.adjustYOffset||o.adjustLength,o.isNeedAdjustHeight,["bottom","top","right","left"],o.offsetStyle);break;case"top":case"top,right":p=BI.DOM.getComboPosition(combo,this.popupView,o.adjustXOffset,o.adjustYOffset||o.adjustLength,o.isNeedAdjustHeight,["top","bottom","right","left"],o.offsetStyle);break;case"left":case"left,bottom":p=BI.DOM.getComboPosition(combo,this.popupView,o.adjustXOffset||o.adjustLength,o.adjustYOffset,o.isNeedAdjustHeight,["left","right","bottom","top"],o.offsetStyle);break;case"right":case"right,bottom":p=BI.DOM.getComboPosition(combo,this.popupView,o.adjustXOffset||o.adjustLength,o.adjustYOffset,o.isNeedAdjustHeight,["right","left","bottom","top"],o.offsetStyle);break;case"top,left":p=BI.DOM.getComboPosition(combo,this.popupView,o.adjustXOffset,o.adjustYOffset||o.adjustLength,o.isNeedAdjustHeight,["top","bottom","left","right"],o.offsetStyle);break;case"bottom,left":p=BI.DOM.getComboPosition(combo,this.popupView,o.adjustXOffset,o.adjustYOffset||o.adjustLength,o.isNeedAdjustHeight,["bottom","top","left","right"],o.offsetStyle);break;case"left,top":p=BI.DOM.getComboPosition(combo,this.popupView,o.adjustXOffset||o.adjustLength,o.adjustYOffset,o.isNeedAdjustHeight,["left","right","top","bottom"],o.offsetStyle);break;case"right,top":p=BI.DOM.getComboPosition(combo,this.popupView,o.adjustXOffset||o.adjustLength,o.adjustYOffset,o.isNeedAdjustHeight,["right","left","top","bottom"],o.offsetStyle);break;case"right,innerRight":p=BI.DOM.getComboPosition(combo,this.popupView,o.adjustXOffset||o.adjustLength,o.adjustYOffset,o.isNeedAdjustHeight,["right","left","innerRight","innerLeft","bottom","top"],o.offsetStyle);break;case"right,innerLeft":p=BI.DOM.getComboPosition(combo,this.popupView,o.adjustXOffset||o.adjustLength,o.adjustYOffset,o.isNeedAdjustHeight,["right","left","innerLeft","innerRight","bottom","top"],o.offsetStyle);break;case"innerRight":p=BI.DOM.getComboPosition(combo,this.popupView,o.adjustXOffset||o.adjustLength,o.adjustYOffset,o.isNeedAdjustHeight,["innerRight","innerLeft","right","left","bottom","top"],o.offsetStyle);break;case"innerLeft":p=BI.DOM.getComboPosition(combo,this.popupView,o.adjustXOffset||o.adjustLength,o.adjustYOffset,o.isNeedAdjustHeight,["innerLeft","innerRight","left","right","bottom","top"],o.offsetStyle);break;case"top,custom":case"custom,top":p=BI.DOM.getTopAdaptPosition(combo,this.popupView,o.adjustYOffset||o.adjustLength,o.isNeedAdjustHeight);break;case"custom,bottom":case"bottom,custom":p=BI.DOM.getBottomAdaptPosition(combo,this.popupView,o.adjustYOffset||o.adjustLength,o.isNeedAdjustHeight);break;case"left,custom":case"custom,left":p=BI.DOM.getLeftAdaptPosition(combo,this.popupView,o.adjustXOffset||o.adjustLength),delete p.top,delete p.adaptHeight;break;case"custom,right":case"right,custom":p=BI.DOM.getRightAdaptPosition(combo,this.popupView,o.adjustXOffset||o.adjustLength),delete p.top,delete p.adaptHeight}"adaptHeight"in p&&this.resetListHeight(p.adaptHeight),"left"in p&&this.popupView.element.css({left:p.left}),"top"in p&&this.popupView.element.css({top:p.top}),this.position=p,this.popupView.setVisible(isVisible)}},resetListHeight:function(h){this._assertPopupView(),this.popupView.resetHeight&&this.popupView.resetHeight(h)},resetListWidth:function(w){this._assertPopupView(),this.popupView.resetWidth&&this.popupView.resetWidth(w)},populate:function(items){this._assertPopupView(),this.popupView.populate.apply(this.popupView,arguments),this.combo.populate.apply(this.combo,arguments)},_setEnable:function(arg){BI.Combo.superclass._setEnable.apply(this,arguments),arg===!0?this.element.removeClass("base-disabled disabled"):arg===!1&&this.element.addClass("base-disabled disabled"),!arg&&this.element.removeClass(this.options.hoverClass),!arg&&this.isViewVisible()&&this._hideView()},setValue:function(v){this.combo.setValue(v),BI.isNull(this.popupView)?this.options.popup.value=v:this.popupView.setValue(v)},getValue:function(){return BI.isNull(this.popupView)?this.options.popup.value:this.popupView.getValue()},isViewVisible:function(){return this.isEnabled()&&this.combo.isEnabled()&&!!this.popupView&&this.popupView.isVisible()},showView:function(e){this.isEnabled()&&this.combo.isEnabled()&&!this.isViewVisible()&&this._popupView(e)},hideView:function(){this._hideView()},getView:function(){return this.popupView},getPopupPosition:function(){return this.position},toggle:function(){this._toggle()},destroyed:function(){BI.Widget._renderEngine.createElement(document).unbind("mousedown."+this.getName()).unbind("mousewheel."+this.getName()).unbind("mouseenter."+this.getName()).unbind("mousemove."+this.getName()).unbind("mouseleave."+this.getName()),BI.Resizers.remove(this.getName())}}),BI.Combo.EVENT_TRIGGER_CHANGE="EVENT_TRIGGER_CHANGE",BI.Combo.EVENT_CHANGE="EVENT_CHANGE",BI.Combo.EVENT_EXPAND="EVENT_EXPAND",BI.Combo.EVENT_COLLAPSE="EVENT_COLLAPSE",BI.Combo.EVENT_AFTER_INIT="EVENT_AFTER_INIT",BI.Combo.EVENT_BEFORE_POPUPVIEW="EVENT_BEFORE_POPUPVIEW",BI.Combo.EVENT_AFTER_POPUPVIEW="EVENT_AFTER_POPUPVIEW",BI.Combo.EVENT_BEFORE_HIDEVIEW="EVENT_BEFORE_HIDEVIEW",BI.Combo.EVENT_AFTER_HIDEVIEW="EVENT_AFTER_HIDEVIEW",BI.shortcut("bi.combo",BI.Combo),BI.Expander=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.Expander.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-expander",trigger:"click",toggle:!0,isDefaultInit:!1,el:{},popup:{},expanderClass:"bi-expander-popup",hoverClass:"bi-expander-hover"})},_init:function(){BI.Expander.superclass._init.apply(this,arguments);var self=this,o=this.options;this._expanded=!!o.el.open,this._initExpander(),this._initPullDownAction(),this.expander.on(BI.Controller.EVENT_CHANGE,function(type,value,obj){self.isEnabled()&&self.isValid()&&(type===BI.Events.EXPAND&&self._popupView(),type===BI.Events.COLLAPSE&&self._hideView(),type===BI.Events.EXPAND&&(self.fireEvent(BI.Controller.EVENT_CHANGE,arguments),self.fireEvent(BI.Expander.EVENT_EXPAND)),type===BI.Events.COLLAPSE&&(self.fireEvent(BI.Controller.EVENT_CHANGE,arguments),self.isViewVisible()&&self.fireEvent(BI.Expander.EVENT_COLLAPSE)),type===BI.Events.CLICK&&self.fireEvent(BI.Expander.EVENT_TRIGGER_CHANGE,value,obj))}),this.element.hover(function(){self.isEnabled()&&self.isValid()&&self.expander.isEnabled()&&self.expander.isValid()&&self.element.addClass(o.hoverClass)},function(){self.isEnabled()&&self.isValid()&&self.expander.isEnabled()&&self.expander.isValid()&&self.element.removeClass(o.hoverClass)}),BI.createWidget({type:"bi.vertical",scrolly:!1,element:this,items:[{el:this.expander}]}),o.isDefaultInit&&this._assertPopupView(),this.expander.isOpened()===!0&&this._popupView()},_toggle:function(){this._assertPopupViewRender(),this.popupView.isVisible()?this._hideView():this.isEnabled()&&this._popupView()},_initPullDownAction:function(){var self=this,o=this.options,evs=this.options.trigger.split(",");BI.each(evs,function(i,e){switch(e){case"hover":self.element[e](function(e){self.isEnabled()&&self.isValid()&&self.expander.isEnabled()&&self.expander.isValid()&&(self._popupView(),self.fireEvent(BI.Controller.EVENT_CHANGE,BI.Events.EXPAND,"",self.expander),self.fireEvent(BI.Expander.EVENT_EXPAND))},function(){self.isEnabled()&&self.isValid()&&self.expander.isEnabled()&&self.expander.isValid()&&o.toggle&&(self._hideView(),self.fireEvent(BI.Controller.EVENT_CHANGE,BI.Events.COLLAPSE,"",self.expander),self.fireEvent(BI.Expander.EVENT_COLLAPSE))});break;case"click":e&&self.element.off(e+"."+self.getName()).on(e+"."+self.getName(),BI.debounce(function(e){self.expander.element.__isMouseInBounds__(e)&&self.isEnabled()&&self.isValid()&&self.expander.isEnabled()&&self.expander.isValid()&&(o.toggle?self._toggle():self._popupView(),self.isExpanded()?(self.fireEvent(BI.Controller.EVENT_CHANGE,BI.Events.EXPAND,"",self.expander),self.fireEvent(BI.Expander.EVENT_EXPAND)):(self.fireEvent(BI.Controller.EVENT_CHANGE,BI.Events.COLLAPSE,"",self.expander),self.fireEvent(BI.Expander.EVENT_COLLAPSE)))},BI.EVENT_RESPONSE_TIME,{leading:!0,trailing:!1}))}})},_initExpander:function(){this.expander=BI.createWidget(this.options.el)},_assertPopupView:function(){var self=this,o=this.options;null==this.popupView&&(this.popupView=BI.createWidget(this.options.popup,{type:"bi.button_group",cls:"expander-popup",layouts:[{type:"bi.vertical",hgap:0,vgap:0}],value:o.value},this),this.popupView.on(BI.Controller.EVENT_CHANGE,function(type,value,obj){self.fireEvent(BI.Controller.EVENT_CHANGE,arguments),type===BI.Events.CLICK&&self.fireEvent(BI.Expander.EVENT_CHANGE,value,obj)}),this.popupView.setVisible(this.isExpanded()),BI.nextTick(function(){self.fireEvent(BI.Expander.EVENT_AFTER_INIT)}))},_assertPopupViewRender:function(){this._assertPopupView(),this._rendered||(BI.createWidget({type:"bi.vertical",scrolly:!1,element:this,items:[{el:this.popupView}]}),this._rendered=!0)},_hideView:function(){this.fireEvent(BI.Expander.EVENT_BEFORE_HIDEVIEW),this._expanded=!1,this.expander.setOpened(!1),this.popupView&&this.popupView.invisible(),this.element.removeClass(this.options.expanderClass),this.fireEvent(BI.Expander.EVENT_AFTER_HIDEVIEW)},_popupView:function(){this._assertPopupViewRender(),this.fireEvent(BI.Expander.EVENT_BEFORE_POPUPVIEW),this._expanded=!0,this.expander.setOpened(!0),this.popupView.visible(),this.element.addClass(this.options.expanderClass),this.fireEvent(BI.Expander.EVENT_AFTER_POPUPVIEW)},populate:function(items){this.popupView&&this.popupView.populate.apply(this.popupView,arguments),this.expander.populate.apply(this.expander,arguments)},_setEnable:function(arg){BI.Expander.superclass._setEnable.apply(this,arguments),!arg&&this.element.removeClass(this.options.hoverClass),!arg&&this.isViewVisible()&&this._hideView()},setValue:function(v){this.expander.setValue(v),BI.isNull(this.popupView)?this.options.popup.value=v:this.popupView.setValue(v)},getValue:function(){return BI.isNull(this.popupView)?this.options.popup.value:this.popupView.getValue()},isViewVisible:function(){return this.isEnabled()&&this.expander.isEnabled()&&!!this.popupView&&this.popupView.isVisible()},isExpanded:function(){return this._expanded},showView:function(){this.isEnabled()&&this.expander.isEnabled()&&this._popupView()},hideView:function(){this._hideView()},getView:function(){return this.popupView},getAllLeaves:function(){return this.popupView&&this.popupView.getAllLeaves()},getNodeById:function(id){return this.expander.options.id===id?this.expander:this.popupView&&this.popupView.getNodeById(id)},getNodeByValue:function(value){return this.expander.getValue()===value?this.expander:this.popupView&&this.popupView.getNodeByValue(value)},destroy:function(){BI.Expander.superclass.destroy.apply(this,arguments)}}),BI.Expander.EVENT_EXPAND="EVENT_EXPAND",BI.Expander.EVENT_COLLAPSE="EVENT_COLLAPSE",BI.Expander.EVENT_TRIGGER_CHANGE="EVENT_TRIGGER_CHANGE",BI.Expander.EVENT_CHANGE="EVENT_CHANGE",BI.Expander.EVENT_AFTER_INIT="EVENT_AFTER_INIT",BI.Expander.EVENT_BEFORE_POPUPVIEW="EVENT_BEFORE_POPUPVIEW",BI.Expander.EVENT_AFTER_POPUPVIEW="EVENT_AFTER_POPUPVIEW",BI.Expander.EVENT_BEFORE_HIDEVIEW="EVENT_BEFORE_HIDEVIEW",BI.Expander.EVENT_AFTER_HIDEVIEW="EVENT_AFTER_HIDEVIEW",BI.shortcut("bi.expander",BI.Expander),BI.ComboGroup=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.ComboGroup.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-combo-group bi-list-item",trigger:"click,hover",direction:"right",adjustLength:0,isDefaultInit:!1,isNeedAdjustHeight:!1,isNeedAdjustWidth:!1,el:{type:"bi.text_button",text:"",value:""},children:[],popup:{el:{type:"bi.button_tree",chooseType:0,layouts:[{type:"bi.vertical"}]}}})},_init:function(){BI.ComboGroup.superclass._init.apply(this,arguments),this._populate(this.options.el)},_populate:function(item){var self=this,o=this.options,children=o.children;if(BI.isEmpty(children))throw new Error("ComboGroup构造错误");BI.each(children,function(i,ch){var son=BI.formatEL(ch).el.children;ch=BI.formatEL(ch).el,BI.isEmpty(son)||(ch.el=BI.clone(ch),ch.children=son,ch.type="bi.combo_group",ch.action=o.action,ch.height=o.height,ch.direction=o.direction,ch.isDefaultInit=o.isDefaultInit,ch.isNeedAdjustHeight=o.isNeedAdjustHeight,ch.isNeedAdjustWidth=o.isNeedAdjustWidth,ch.adjustLength=o.adjustLength,ch.popup=o.popup)}),this.combo=BI.createWidget({type:"bi.combo",element:this,container:o.container,height:o.height,trigger:o.trigger,direction:o.direction,isDefaultInit:o.isDefaultInit,isNeedAdjustWidth:o.isNeedAdjustWidth,isNeedAdjustHeight:o.isNeedAdjustHeight,adjustLength:o.adjustLength,el:item,popup:BI.extend({},o.popup,{el:BI.extend({items:children},o.popup.el)})}),this.combo.on(BI.Controller.EVENT_CHANGE,function(type,value,obj){self.fireEvent(BI.Controller.EVENT_CHANGE,arguments),type===BI.Events.CLICK&&self.fireEvent(BI.ComboGroup.EVENT_CHANGE,obj)})},getValue:function(){return this.combo.getValue()},setValue:function(v){this.combo.setValue(v)}}),BI.ComboGroup.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.combo_group",BI.ComboGroup),BI.VirtualGroup=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.VirtualGroup.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-virtual-group",items:[],layouts:[{type:"bi.center",hgap:0,vgap:0}]})},render:function(){var o=this.options;this.populate(o.items),BI.isKey(o.value)&&this.setValue(o.value)},_packageBtns:function(items){for(var o=this.options,map=this.buttonMap={},i=o.layouts.length-1;i>0;i--)items=BI.map(items,function(k,it){var el=BI.stripEL(it);return BI.extend({},o.layouts[i],{items:[BI.extend({},o.layouts[i].el,{el:BI.extend({ref:function(_ref){BI.isKey(map[el.value])&&(map[el.value]=_ref)}},el)})]})});return items},_packageLayout:function(items){for(var o=this.options,layout=BI.deepClone(o.layouts[0]),lay=BI.formatEL(layout).el;lay&&lay.items&&!BI.isEmpty(lay.items);)lay=BI.formatEL(lay.items[0]).el;return lay.items=items,layout},addItems:function(items){this.layouts.addItems(items)},prependItems:function(items){this.layouts.prependItems(items)},setValue:function(v){v=BI.isArray(v)?v:[v],BI.each(this.buttonMap,function(key,item){item&&(v.deepContains(key)?item.setSelected&&item.setSelected(!0):item.setSelected&&item.setSelected(!1))})},getNotSelectedValue:function(){var v=[];return BI.each(this.buttonMap,function(i,item){item&&(!item.isEnabled()||item.isSelected&&item.isSelected()||v.push(item.getValue()))}),v},getValue:function(){var v=[];return BI.each(this.buttonMap,function(i,item){item&&item.isEnabled()&&item.isSelected&&item.isSelected()&&v.push(item.getValue())}),v},populate:function(items){var self=this;items=items||[],this.options.items=items,items=this._packageBtns(items),this.layouts?this.layouts.populate(items):this.layouts=BI.createWidget(BI.extend({element:this},this._packageLayout(items)))}}),BI.VirtualGroup.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.virtual_group",BI.VirtualGroup),BI.Loader=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.Loader.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-loader",direction:"top",isDefaultInit:!0,logic:{dynamic:!0,scrolly:!0},el:{type:"bi.button_group"},items:[],itemsCreator:BI.emptyFn,onLoaded:BI.emptyFn,count:!1,prev:!1,next:{},hasPrev:BI.emptyFn,hasNext:BI.emptyFn})},_prevLoad:function(){var self=this,o=this.options;this.prev.setLoading(),o.itemsCreator.apply(this,[{times:--this.times},function(){self.prev.setLoaded(),self.prependItems.apply(self,arguments)}])},_nextLoad:function(){var self=this,o=this.options;this.next.setLoading(),o.itemsCreator.apply(this,[{times:++this.times},function(){self.next.setLoaded(),self.addItems.apply(self,arguments)}])},_init:function(){BI.Loader.superclass._init.apply(this,arguments);var self=this,o=this.options;o.itemsCreator===!1&&(o.prev=!1,o.next=!1),o.prev!==!1&&(this.prev=BI.createWidget(BI.extend({type:"bi.loading_bar"},o.prev)),this.prev.on(BI.Controller.EVENT_CHANGE,function(type){type===BI.Events.CLICK&&self._prevLoad()})),this.button_group=BI.createWidget(o.el,{type:"bi.button_group",chooseType:0,items:o.items,behaviors:{},layouts:[{type:"bi.vertical"}],value:o.value}),this.button_group.on(BI.Controller.EVENT_CHANGE,function(type,value,obj){self.fireEvent(BI.Controller.EVENT_CHANGE,arguments),type===BI.Events.CLICK&&self.fireEvent(BI.Loader.EVENT_CHANGE,obj)}),o.next!==!1&&(this.next=BI.createWidget(BI.extend({type:"bi.loading_bar"},o.next)),this.next.on(BI.Controller.EVENT_CHANGE,function(type){type===BI.Events.CLICK&&self._nextLoad()})),BI.createWidget(BI.extend({element:this},BI.LogicFactory.createLogic(BI.LogicFactory.createLogicTypeByDirection(o.direction),BI.extend({scrolly:!0},o.logic,{items:BI.LogicFactory.createLogicItemsByDirection(o.direction,this.prev,this.button_group,this.next)})))),o.isDefaultInit&&BI.isEmpty(o.items)&&BI.nextTick(BI.bind(function(){o.isDefaultInit&&BI.isEmpty(o.items)&&this._populate()},this)),BI.isNotEmptyArray(o.items)&&this._populate(o.items)},hasPrev:function(){var o=this.options;return BI.isNumber(o.count)?this.count0&&args.push(keyword),BI.Maskers.show(self.getName()),self.popupView.populate.apply(self.popupView,args),o.isAutoSync&&o.adapter&&o.adapter.getValue&&self.popupView.setValue(o.adapter.getValue()),self.popupView.loaded&&self.popupView.loaded(),self.fireEvent(BI.Searcher.EVENT_SEARCHING)}})}},setAdapter:function(adapter){this.options.adapter=adapter,BI.Maskers.remove(this.getName())},doSearch:function(){this.isSearching()&&this._search()},stopSearch:function(){this._stopSearch();try{this.editor.blur()}catch(e){if(!this.editor.blur)throw new Error("editor没有实现blur方法")}finally{this.editor.setValue("")}},isSearching:function(){return this._isSearching},isViewVisible:function(){return this.editor.isEnabled()&&BI.Maskers.isVisible(this.getName())},getView:function(){return this.popupView},hasMatched:function(){return this._assertPopupView(),this.popupView.hasMatched()},adjustHeight:function(){BI.Maskers.has(this.getName())&&BI.Maskers.get(this.getName()).isVisible()&&BI.Maskers.show(this.getName())},adjustView:function(){this.isViewVisible()&&BI.Maskers.show(this.getName())},setValue:function(v){BI.isNull(this.popupView)?this.options.popup.value=v:this.popupView.setValue(v)},getKeyword:function(){return this.editor.getValue()},getKeywords:function(){return this.editor.getKeywords()},getValue:function(){var o=this.options;return o.isAutoSync&&o.adapter&&o.adapter.getValue?o.adapter.getValue():this.isSearching()?this.popupView.getValue():o.adapter&&o.adapter.getValue?o.adapter.getValue():BI.isNull(this.popupView)?o.popup.value:this.popupView.getValue()},populate:function(result,searchResult,keyword){var o=this.options;this._assertPopupView(),this.popupView.populate.apply(this.popupView,arguments),o.isAutoSync&&o.adapter&&o.adapter.getValue&&this.popupView.setValue(o.adapter.getValue())},empty:function(){this.popupView&&this.popupView.empty()},destroyed:function(){BI.Maskers.remove(this.getName())}}),BI.Searcher.EVENT_CHANGE="EVENT_CHANGE",BI.Searcher.EVENT_START="EVENT_START",BI.Searcher.EVENT_STOP="EVENT_STOP",BI.Searcher.EVENT_PAUSE="EVENT_PAUSE",BI.Searcher.EVENT_SEARCHING="EVENT_SEARCHING",BI.Searcher.EVENT_AFTER_INIT="EVENT_AFTER_INIT",BI.shortcut("bi.searcher",BI.Searcher),BI.Switcher=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.Switcher.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-switcher",direction:BI.Direction.Top,trigger:"click",toggle:!0,el:{},popup:{},adapter:null,masker:{},switcherClass:"bi-switcher-popup",hoverClass:"bi-switcher-hover"})},_init:function(){BI.Switcher.superclass._init.apply(this,arguments);var self=this,o=this.options;this._initSwitcher(),this._initPullDownAction(),this.switcher.on(BI.Controller.EVENT_CHANGE,function(type,value,obj){self.isEnabled()&&self.isValid()&&(type===BI.Events.EXPAND&&self._popupView(),type===BI.Events.COLLAPSE&&self._hideView(),type===BI.Events.EXPAND&&(self.fireEvent(BI.Controller.EVENT_CHANGE,arguments),self.fireEvent(BI.Switcher.EVENT_EXPAND)),type===BI.Events.COLLAPSE&&(self.fireEvent(BI.Controller.EVENT_CHANGE,arguments),self.isViewVisible()&&self.fireEvent(BI.Switcher.EVENT_COLLAPSE)),type===BI.Events.CLICK&&self.fireEvent(BI.Switcher.EVENT_TRIGGER_CHANGE,value,obj))}),this.element.hover(function(){self.isEnabled()&&self.switcher.isEnabled()&&self.element.addClass(o.hoverClass)},function(){self.isEnabled()&&self.switcher.isEnabled()&&self.element.removeClass(o.hoverClass)}),BI.createWidget({type:"bi.vertical",scrolly:!1,element:this,items:[{el:this.switcher}]}),o.isDefaultInit&&this._assertPopupView()},_toggle:function(){this._assertPopupView(),this.isExpanded()?this._hideView():this.isEnabled()&&this._popupView()},_initPullDownAction:function(){var self=this,o=this.options,evs=this.options.trigger.split(",");BI.each(evs,function(i,e){switch(e){case"hover":self.element[e](function(e){self.isEnabled()&&self.switcher.isEnabled()&&(self._popupView(),self.fireEvent(BI.Controller.EVENT_CHANGE,BI.Events.EXPAND,"",self.switcher),self.fireEvent(BI.Switcher.EVENT_EXPAND))},function(){self.isEnabled()&&self.switcher.isEnabled()&&o.toggle&&(self._hideView(),self.fireEvent(BI.Controller.EVENT_CHANGE,BI.Events.COLLAPSE,"",self.switcher),self.fireEvent(BI.Switcher.EVENT_COLLAPSE))});break;default:e&&self.element.off(e+"."+self.getName()).on(e+"."+self.getName(),BI.debounce(function(e){self.switcher.element.__isMouseInBounds__(e)&&self.isEnabled()&&self.switcher.isEnabled()&&(o.toggle?self._toggle():self._popupView(),self.isExpanded()?(self.fireEvent(BI.Controller.EVENT_CHANGE,BI.Events.EXPAND,"",self.switcher),self.fireEvent(BI.Switcher.EVENT_EXPAND)):(self.fireEvent(BI.Controller.EVENT_CHANGE,BI.Events.COLLAPSE,"",self.switcher),self.fireEvent(BI.Switcher.EVENT_COLLAPSE)))},BI.EVENT_RESPONSE_TIME,{leading:!0,trailing:!1}))}})},_initSwitcher:function(){this.switcher=BI.createWidget(this.options.el,{value:this.options.value})},_assertPopupView:function(){var self=this,o=this.options;this._created||(this.popupView=BI.createWidget(o.popup,{type:"bi.button_group",element:o.adapter&&BI.Maskers.create(this.getName(),o.adapter,BI.extend({container:this},o.masker)),cls:"switcher-popup",layouts:[{type:"bi.vertical",hgap:0,vgap:0}],value:o.value},this),this.popupView.on(BI.Controller.EVENT_CHANGE,function(type,value,obj){self.fireEvent(BI.Controller.EVENT_CHANGE,arguments),type===BI.Events.CLICK&&self.fireEvent(BI.Switcher.EVENT_CHANGE,value,obj)}),o.direction===BI.Direction.Custom||o.adapter||BI.createWidget({type:"bi.vertical",scrolly:!1,element:this,items:[{el:this.popupView}]}),this._created=!0,BI.nextTick(function(){self.fireEvent(BI.Switcher.EVENT_AFTER_INIT)}))},_hideView:function(){this.fireEvent(BI.Switcher.EVENT_BEFORE_HIDEVIEW);var self=this,o=this.options;o.adapter?BI.Maskers.hide(self.getName()):self.popupView&&self.popupView.setVisible(!1),BI.nextTick(function(){o.adapter?BI.Maskers.hide(self.getName()):self.popupView&&self.popupView.setVisible(!1),self.element.removeClass(o.switcherClass),self.fireEvent(BI.Switcher.EVENT_AFTER_HIDEVIEW)})},_popupView:function(){var self=this,o=this.options;this._assertPopupView(),this.fireEvent(BI.Switcher.EVENT_BEFORE_POPUPVIEW),o.adapter?BI.Maskers.show(this.getName()):self.popupView.setVisible(!0),BI.nextTick(function(name){o.adapter?BI.Maskers.show(name):self.popupView.setVisible(!0),self.element.addClass(o.switcherClass),self.fireEvent(BI.Switcher.EVENT_AFTER_POPUPVIEW)},this.getName())},populate:function(items){this._assertPopupView(),this.popupView.populate.apply(this.popupView,arguments),this.switcher.populate.apply(this.switcher,arguments)},_setEnable:function(arg){BI.Switcher.superclass._setEnable.apply(this,arguments),!arg&&this.isViewVisible()&&this._hideView()},setValue:function(v){this.switcher.setValue(v),BI.isNull(this.popupView)?this.options.popup.value=v:this.popupView.setValue(v)},getValue:function(){return BI.isNull(this.popupView)?this.options.popup.value:this.popupView.getValue()},setAdapter:function(adapter){this.options.adapter=adapter,BI.Maskers.remove(this.getName())},isViewVisible:function(){return this.isEnabled()&&this.switcher.isEnabled()&&(this.options.adapter?BI.Maskers.isVisible(this.getName()):this.popupView&&this.popupView.isVisible())},isExpanded:function(){return this.isViewVisible()},showView:function(){this.isEnabled()&&this.switcher.isEnabled()&&this._popupView()},hideView:function(){this._hideView()},getView:function(){return this.popupView},adjustView:function(){this.isViewVisible()&&BI.Maskers.show(this.getName())},getAllLeaves:function(){return this.popupView&&this.popupView.getAllLeaves()},getNodeById:function(id){return this.switcher.attr("id")===id?this.switcher:this.popupView&&this.popupView.getNodeById(id)},getNodeByValue:function(value){return this.switcher.getValue()===value?this.switcher:this.popupView&&this.popupView.getNodeByValue(value)},empty:function(){this.popupView&&this.popupView.empty()},destroy:function(){BI.Switcher.superclass.destroy.apply(this,arguments)}}),BI.Switcher.EVENT_EXPAND="EVENT_EXPAND",BI.Switcher.EVENT_COLLAPSE="EVENT_COLLAPSE",BI.Switcher.EVENT_TRIGGER_CHANGE="EVENT_TRIGGER_CHANGE",BI.Switcher.EVENT_CHANGE="EVENT_CHANGE",BI.Switcher.EVENT_AFTER_INIT="EVENT_AFTER_INIT",BI.Switcher.EVENT_BEFORE_POPUPVIEW="EVENT_BEFORE_POPUPVIEW",BI.Switcher.EVENT_AFTER_POPUPVIEW="EVENT_AFTER_POPUPVIEW",BI.Switcher.EVENT_BEFORE_HIDEVIEW="EVENT_BEFORE_HIDEVIEW",BI.Switcher.EVENT_AFTER_HIDEVIEW="EVENT_AFTER_HIDEVIEW",BI.shortcut("bi.switcher",BI.Switcher),BI.Tab=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.Tab.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-tab",direction:"top",single:!1,logic:{dynamic:!1},showIndex:!1,tab:!1,cardCreator:function(v){return BI.createWidget()}})},render:function(){var self=this,o=this.options;BI.isObject(o.tab)&&(this.tab=BI.createWidget(this.options.tab,{type:"bi.button_group"}),this.tab.on(BI.Controller.EVENT_CHANGE,function(type,value,obj){self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)})),this.cardMap={},this.layout=BI.createWidget({type:"bi.card"}),BI.createWidget(BI.extend({element:this},BI.LogicFactory.createLogic(BI.LogicFactory.createLogicTypeByDirection(o.direction),BI.extend({},o.logic,{items:BI.LogicFactory.createLogicItemsByDirection(o.direction,this.tab,this.layout)}))));var listener=new BI.ShowListener({eventObj:this.tab,cardLayout:this.layout,cardCreator:function(v){var card=o.cardCreator.apply(self,arguments);return self.cardMap[v]=card,card},afterCardShow:function(v){self._deleteOtherCards(v),self.curr=v}});listener.on(BI.ShowListener.EVENT_CHANGE,function(value){self.fireEvent(BI.Tab.EVENT_CHANGE,value,self)})},_deleteOtherCards:function(currCardName){var self=this,o=this.options;o.single===!0&&BI.each(this.cardMap,function(name,card){name!==currCardName+""&&(self.layout.deleteCardByName(name),delete self.cardMap[name])})},_assertCard:function(v){if(!this.layout.isCardExisted(v)){var card=this.options.cardCreator(v);this.cardMap[v]=card,this.layout.addCardByName(v,card)}},mounted:function(){var o=this.options;o.showIndex!==!1&&this.setSelect(o.showIndex)},setSelect:function(v){this.tab&&this.tab.setValue(v),this._assertCard(v),this.layout.showCardByName(v),this._deleteOtherCards(v),this.curr!==v&&(this.curr=v)},removeTab:function(cardname){var self=this,o=this.options;BI.any(this.cardMap,function(name,card){if(BI.isEqual(name,cardname+""))return self.layout.deleteCardByName(name),delete self.cardMap[name],!0})},getSelect:function(){return this.curr},getSelectedTab:function(){return this.layout.getShowingCard()},getTab:function(v){return this._assertCard(v),this.layout.getCardByName(v)},setValue:function(v){var card=this.layout.getShowingCard();card&&card.setValue(v)},getValue:function(){var card=this.layout.getShowingCard();if(card)return card.getValue()},populate:function(){var card=this.layout.getShowingCard();if(card)return card.populate&&card.populate.apply(card,arguments)},empty:function(){this.layout.deleteAllCard(),this.cardMap={}},destroy:function(){this.cardMap={},BI.Tab.superclass.destroy.apply(this,arguments)}}),BI.Tab.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.tab",BI.Tab),BI.EL=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.EL.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-el",el:{},layout:{}})},_init:function(){BI.EL.superclass._init.apply(this,arguments);var self=this,o=this.options;this.ele=BI.createWidget(o.el),BI.createWidget(o.layout,{type:"bi.adaptive",element:this,items:[this.ele]}),this.ele.on(BI.Controller.EVENT_CHANGE,function(){self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)})},setValue:function(v){this.ele.setValue(v)},getValue:function(){return this.ele.getValue()},populate:function(){this.ele.populate.apply(this,arguments)}}),BI.shortcut("bi.el",BI.EL),BI.Msg=function(){var messageShow,$mask,$pop,toastStack=[];return{alert:function(title,message,callback){this._show(!1,title,message,callback)},confirm:function(title,message,callback){this._show(!0,title,message,callback)},prompt:function(title,message,value,callback,min_width){},toast:function(message,options,context){options=options||{},context=context||BI.Widget._renderEngine.createElement("body");var level=options.level||"normal",autoClose=!!BI.isNull(options.autoClose)||options.autoClose,toast=BI.createWidget({type:"bi.toast",cls:"bi-message-animate bi-message-leave",level:level,autoClose:autoClose,text:message,listeners:[{eventName:BI.Toast.EVENT_DESTORY,action:function(){BI.remove(toastStack,toast.element);var _height=10;BI.each(toastStack,function(i,element){element.css({top:_height}),_height+=element.outerHeight()+10})}}]}),height=10;BI.each(toastStack,function(i,element){height+=element.outerHeight()+10}),BI.createWidget({type:"bi.absolute",element:context,items:[{el:toast,left:"50%",top:height}]}),toastStack.push(toast.element),toast.element.css({"margin-left":-1*toast.element.outerWidth()/2}),toast.element.removeClass("bi-message-leave").addClass("bi-message-enter"),autoClose&&BI.delay(function(){toast.element.removeClass("bi-message-enter").addClass("bi-message-leave"),toast.destroy()},5e3)},_show:function(hasCancel,title,message,callback){$mask=BI.Widget._renderEngine.createElement('
    ').css({position:"absolute",zIndex:BI.zIndex_tip-2,top:0,left:0,right:0,bottom:0,opacity:.5}).appendTo("body"),$pop=BI.Widget._renderEngine.createElement('
    ').css({position:"absolute",zIndex:BI.zIndex_tip-1,top:0,left:0,right:0,bottom:0}).appendTo("body");var close=function(){messageShow.destroy(),$mask.remove()},controlItems=[];hasCancel===!0&&controlItems.push({el:{type:"bi.button",text:BI.i18nText("BI-Basic_Cancel"),level:"ignore",handler:function(){close(),BI.isFunction(callback)&&callback.apply(null,[!1])}}}),controlItems.push({el:{type:"bi.button",text:BI.i18nText("BI-Basic_OK"),handler:function(){close(),BI.isFunction(callback)&&callback.apply(null,[!0])}}});var conf={element:$pop,type:"bi.center_adapt",items:[{type:"bi.border",cls:"bi-card",items:{north:{el:{type:"bi.border",cls:"bi-message-title bi-background",items:{center:{el:{type:"bi.label",cls:"bi-font-bold",text:title||BI.i18nText("BI-Basic_Prompt"),textAlign:"left",hgap:20,height:40}},east:{el:{type:"bi.icon_button",cls:"bi-message-close close-font",handler:function(){close(),BI.isFunction(callback)&&callback.apply(null,[!1])}},width:60}}},height:40},center:{el:{type:"bi.label",vgap:10,hgap:20,whiteSpace:"normal",text:message}},south:{el:{type:"bi.absolute",items:[{el:{type:"bi.right_vertical_adapt",lgap:10,items:controlItems},top:0,left:20,right:20,bottom:0}]},height:44}},width:450,height:200}]};messageShow=BI.createWidget(conf)}}}(),BI.GridView=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.GridView.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-grid-view",overflowX:!0,overflowY:!0,overscanColumnCount:0,overscanRowCount:0,rowHeightGetter:BI.emptyFn,columnWidthGetter:BI.emptyFn,scrollLeft:0,scrollTop:0,items:[]})},_init:function(){BI.GridView.superclass._init.apply(this,arguments);var self=this,o=this.options;this.renderedCells=[],this.renderedKeys=[],this.renderRange={},this._scrollLock=!1,this._debounceRelease=BI.debounce(function(){self._scrollLock=!1},1e3/60),this.container=BI.createWidget({type:"bi.absolute"}),this.element.scroll(function(){self._scrollLock!==!0&&(o.scrollLeft=self.element.scrollLeft(),o.scrollTop=self.element.scrollTop(),self._calculateChildrenToRender(),self.fireEvent(BI.GridView.EVENT_SCROLL,{scrollLeft:o.scrollLeft,scrollTop:o.scrollTop}))}),BI.createWidget({type:"bi.vertical",element:this,scrollable:o.overflowX===!0&&o.overflowY===!0,scrolly:o.overflowX===!1&&o.overflowY===!0,scrollx:o.overflowX===!0&&o.overflowY===!1,items:[this.container]}),o.items.length>0&&this._populate()},mounted:function(){var o=this.options;0===o.scrollLeft&&0===o.scrollTop||(this.element.scrollTop(o.scrollTop),this.element.scrollLeft(o.scrollLeft))},_getOverscanIndices:function(cellCount,overscanCellsCount,startIndex,stopIndex){return{overscanStartIndex:Math.max(0,startIndex-overscanCellsCount),overscanStopIndex:Math.min(cellCount-1,stopIndex+overscanCellsCount)}},_calculateChildrenToRender:function(){var self=this,o=this.options,width=o.width,height=o.height,scrollLeft=BI.clamp(o.scrollLeft,0,this._getMaxScrollLeft()),scrollTop=BI.clamp(o.scrollTop,0,this._getMaxScrollTop()),overscanColumnCount=o.overscanColumnCount,overscanRowCount=o.overscanRowCount;if(height>0&&width>0){var visibleColumnIndices=this._columnSizeAndPositionManager.getVisibleCellRange(width,scrollLeft),visibleRowIndices=this._rowSizeAndPositionManager.getVisibleCellRange(height,scrollTop);if(BI.isEmpty(visibleColumnIndices)||BI.isEmpty(visibleRowIndices))return;var horizontalOffsetAdjustment=this._columnSizeAndPositionManager.getOffsetAdjustment(width,scrollLeft),verticalOffsetAdjustment=this._rowSizeAndPositionManager.getOffsetAdjustment(height,scrollTop);this._renderedColumnStartIndex=visibleColumnIndices.start,this._renderedColumnStopIndex=visibleColumnIndices.stop,this._renderedRowStartIndex=visibleRowIndices.start,this._renderedRowStopIndex=visibleRowIndices.stop;var overscanColumnIndices=this._getOverscanIndices(this.columnCount,overscanColumnCount,this._renderedColumnStartIndex,this._renderedColumnStopIndex),overscanRowIndices=this._getOverscanIndices(this.rowCount,overscanRowCount,this._renderedRowStartIndex,this._renderedRowStopIndex),columnStartIndex=overscanColumnIndices.overscanStartIndex,columnStopIndex=overscanColumnIndices.overscanStopIndex,rowStartIndex=overscanRowIndices.overscanStartIndex,rowStopIndex=overscanRowIndices.overscanStopIndex,minRowDatum=this._rowSizeAndPositionManager.getSizeAndPositionOfCell(rowStartIndex),minColumnDatum=this._columnSizeAndPositionManager.getSizeAndPositionOfCell(columnStartIndex),maxRowDatum=this._rowSizeAndPositionManager.getSizeAndPositionOfCell(rowStopIndex),maxColumnDatum=this._columnSizeAndPositionManager.getSizeAndPositionOfCell(columnStopIndex),top=minRowDatum.offset+verticalOffsetAdjustment,left=minColumnDatum.offset+horizontalOffsetAdjustment,bottom=maxRowDatum.offset+verticalOffsetAdjustment+maxRowDatum.size,right=maxColumnDatum.offset+horizontalOffsetAdjustment+maxColumnDatum.size;if(top>=this.renderRange.minY&&bottom<=this.renderRange.maxY&&left>=this.renderRange.minX&&right<=this.renderRange.maxX)return;for(var renderedCells=[],renderedKeys={},renderedWidgets={},minX=this._getMaxScrollLeft(),minY=this._getMaxScrollTop(),maxX=0,maxY=0,count=0,rowIndex=rowStartIndex;rowIndex<=rowStopIndex;rowIndex++)for(var rowDatum=this._rowSizeAndPositionManager.getSizeAndPositionOfCell(rowIndex),columnIndex=columnStartIndex;columnIndex<=columnStopIndex;columnIndex++){var key=rowIndex+"-"+columnIndex,columnDatum=this._columnSizeAndPositionManager.getSizeAndPositionOfCell(columnIndex),index=this.renderedKeys[key]&&this.renderedKeys[key][2],child;index>=0?(columnDatum.size!==this.renderedCells[index]._width&&(this.renderedCells[index]._width=columnDatum.size,this.renderedCells[index].el.setWidth(columnDatum.size)),rowDatum.size!==this.renderedCells[index]._height&&(this.renderedCells[index]._height=rowDatum.size,this.renderedCells[index].el.setHeight(rowDatum.size)),this.renderedCells[index]._left!==columnDatum.offset+horizontalOffsetAdjustment&&this.renderedCells[index].el.element.css("left",columnDatum.offset+horizontalOffsetAdjustment+"px"),this.renderedCells[index]._top!==rowDatum.offset+verticalOffsetAdjustment&&this.renderedCells[index].el.element.css("top",rowDatum.offset+verticalOffsetAdjustment+"px"),renderedCells.push(child=this.renderedCells[index])):(child=BI.createWidget(BI.extend({type:"bi.label",width:columnDatum.size,height:rowDatum.size},o.items[rowIndex][columnIndex],{cls:(o.items[rowIndex][columnIndex].cls||"")+" grid-cell"+(0===rowIndex?" first-row":"")+(0===columnIndex?" first-col":""),_rowIndex:rowIndex,_columnIndex:columnIndex,_left:columnDatum.offset+horizontalOffsetAdjustment,_top:rowDatum.offset+verticalOffsetAdjustment}),this),renderedCells.push({el:child,left:columnDatum.offset+horizontalOffsetAdjustment,top:rowDatum.offset+verticalOffsetAdjustment,_left:columnDatum.offset+horizontalOffsetAdjustment,_top:rowDatum.offset+verticalOffsetAdjustment,_width:columnDatum.size,_height:rowDatum.size})),minX=Math.min(minX,columnDatum.offset+horizontalOffsetAdjustment),maxX=Math.max(maxX,columnDatum.offset+horizontalOffsetAdjustment+columnDatum.size),minY=Math.min(minY,rowDatum.offset+verticalOffsetAdjustment),maxY=Math.max(maxY,rowDatum.offset+verticalOffsetAdjustment+rowDatum.size),renderedKeys[key]=[rowIndex,columnIndex,count],renderedWidgets[count]=child,count++}var existSet={},addSet={},deleteArray=[];BI.each(renderedKeys,function(i,key){self.renderedKeys[i]?existSet[i]=key:addSet[i]=key}),BI.each(this.renderedKeys,function(i,key){existSet[i]||addSet[i]||deleteArray.push(key[2])}),BI.each(deleteArray,function(i,index){self.renderedCells[index].el._destroy()});var addedItems=[];BI.each(addSet,function(index,key){addedItems.push(renderedCells[key[2]])}),this.container.addItems(addedItems,this),this.container._children=renderedWidgets,this.container.attr("items",renderedCells),this.renderedCells=renderedCells,this.renderedKeys=renderedKeys,this.renderRange={minX:minX,minY:minY,maxX:maxX,maxY:maxY}}},_getRealMaxScrollLeft:function(){var o=this.options,totalWidth=0;return BI.count(0,this.columnCount,function(index){totalWidth+=o.columnWidthGetter(index)}),Math.max(0,totalWidth-this.options.width+(this.options.overflowX?BI.DOM.getScrollWidth():0))},_getMaxScrollLeft:function(){return Math.max(0,this._columnSizeAndPositionManager.getTotalSize()-this.options.width+(this.options.overflowX?BI.DOM.getScrollWidth():0))},_getMaxScrollTop:function(){return Math.max(0,this._rowSizeAndPositionManager.getTotalSize()-this.options.height+(this.options.overflowY?BI.DOM.getScrollWidth():0))},_populate:function(items){var self=this,o=this.options;this._reRange(),this.columnCount=0,this.rowCount=0,items&&items!==this.options.items&&(this.options.items=items),BI.isNumber(o.columnCount)?this.columnCount=o.columnCount:o.items.length>0&&(this.columnCount=o.items[0].length),BI.isNumber(o.rowCount)?this.rowCount=o.rowCount:this.rowCount=o.items.length,this.container.setWidth(this.columnCount*o.estimatedColumnSize),this.container.setHeight(this.rowCount*o.estimatedRowSize),this._columnSizeAndPositionManager=new BI.ScalingCellSizeAndPositionManager(this.columnCount,o.columnWidthGetter,o.estimatedColumnSize),this._rowSizeAndPositionManager=new BI.ScalingCellSizeAndPositionManager(this.rowCount,o.rowHeightGetter,o.estimatedRowSize),this._calculateChildrenToRender();try{this.element.scrollTop(o.scrollTop),this.element.scrollLeft(o.scrollLeft)}catch(e){}},setScrollLeft:function(scrollLeft){this.options.scrollLeft!==scrollLeft&&(this._scrollLock=!0,this.options.scrollLeft=BI.clamp(scrollLeft||0,0,this._getRealMaxScrollLeft()),this._debounceRelease(),this._calculateChildrenToRender(),this.element.scrollLeft(this.options.scrollLeft))},setScrollTop:function(scrollTop){this.options.scrollTop!==scrollTop&&(this._scrollLock=!0,this.options.scrollTop=BI.clamp(scrollTop||0,0,this._getMaxScrollTop()),this._debounceRelease(),this._calculateChildrenToRender(),this.element.scrollTop(this.options.scrollTop))},setColumnCount:function(columnCount){this.options.columnCount=columnCount},setRowCount:function(rowCount){this.options.rowCount=rowCount},setOverflowX:function(b){var self=this;this.options.overflowX!==!!b&&(this.options.overflowX=!!b,BI.nextTick(function(){self.element.css({overflowX:b?"auto":"hidden"})}))},setOverflowY:function(b){var self=this;this.options.overflowY!==!!b&&(this.options.overflowY=!!b,BI.nextTick(function(){self.element.css({overflowY:b?"auto":"hidden"})}))},getScrollLeft:function(){return this.options.scrollLeft},getScrollTop:function(){return this.options.scrollTop},getMaxScrollLeft:function(){return this._getMaxScrollLeft()},getMaxScrollTop:function(){return this._getMaxScrollTop()},setEstimatedColumnSize:function(width){this.options.estimatedColumnSize=width},setEstimatedRowSize:function(height){this.options.estimatedRowSize=height},_reRange:function(){this.renderRange={}},_clearChildren:function(){this.container._children={},this.container.attr("items",[])},restore:function(){BI.each(this.renderedCells,function(i,cell){cell.el._destroy()}),this._clearChildren(),this.renderedCells=[],this.renderedKeys=[],this.renderRange={},this._scrollLock=!1},populate:function(items){items&&items!==this.options.items&&this.restore(),this._populate(items)}}),BI.GridView.EVENT_SCROLL="EVENT_SCROLL",BI.shortcut("bi.grid_view",BI.GridView),BI.Popover=BI.inherit(BI.Widget,{_constant:{SIZE:{SMALL:"small",NORMAL:"normal",BIG:"big"},HEADER_HEIGHT:40},_defaultConfig:function(){return BI.extend(BI.Popover.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-popover bi-card bi-border-radius",size:"normal",logic:{dynamic:!1},header:null,body:null,footer:null,closable:!0})},render:function(){var self=this,o=this.options;this.startX=0,this.startY=0,this.tracker=new BI.MouseMoveTracker(function(deltaX,deltaY){var size=self._calculateSize(),W=BI.Widget._renderEngine.createElement("body").width(),H=BI.Widget._renderEngine.createElement("body").height();self.startX+=deltaX,self.startY+=deltaY,self.element.css({left:BI.clamp(self.startX,0,W-self.element.width())+"px",top:BI.clamp(self.startY,0,H-self.element.height())+"px"}),BI.Resizers._resize()},function(){self.tracker.releaseMouseMoves()},_global);var items=[{el:{type:"bi.htape",cls:"bi-message-title bi-header-background",ref:function(_ref){self.dragger=_ref},items:[{type:"bi.absolute",items:[{el:BI.isPlainObject(o.header)?BI.createWidget(o.header,{extraCls:"bi-font-bold"}):{type:"bi.label",cls:"bi-font-bold",height:this._constant.HEADER_HEIGHT,text:o.header,title:o.header,textAlign:"left"},left:20,top:0,right:0,bottom:0}]},{el:o.closable?{type:"bi.icon_button",cls:"bi-message-close close-font",height:this._constant.HEADER_HEIGHT,handler:function(){self.close()}}:{type:"bi.layout"},width:56}],height:this._constant.HEADER_HEIGHT},height:this._constant.HEADER_HEIGHT},{el:o.logic.dynamic?{type:"bi.vertical",scrolly:!1,cls:"popover-body",ref:function(){self.body=this},hgap:20,tgap:10,items:[{el:BI.createWidget(o.body)}]}:{type:"bi.absolute",items:[{el:BI.createWidget(o.body),left:20,top:10,right:20,bottom:0}]}}];o.footer&&items.push({el:{type:"bi.absolute",items:[{el:BI.createWidget(o.footer),left:20,top:0,right:20,bottom:0}],height:44},height:44});var size=this._calculateSize();return BI.extend({type:o.logic.dynamic?"bi.vertical":"bi.vtape",items:items,width:size.width},o.logic.dynamic?{type:"bi.vertical",scrolly:!1}:{type:"bi.vtape",height:size.height})},mounted:function(){var self=this,o=this.options;if(this.dragger.element.mousedown(function(e){var pos=self.element.offset();self.startX=pos.left,self.startY=pos.top,self.tracker.captureMouseMoves(e)}),o.logic.dynamic){var size=this._calculateSize(),height=this.element.height(),compareHeight=BI.clamp(height,size.height,600)-(o.footer?84:44);this.body.element.height(compareHeight)}},_calculateSize:function(){var o=this.options,size={};if(BI.isNotNull(o.size))switch(o.size){case this._constant.SIZE.SMALL:size.width=450,size.height=200;break;case this._constant.SIZE.BIG:size.width=900,size.height=500;break;default:size.width=550,size.height=500}return{width:o.width||size.width,height:o.height||size.height}},hide:function(){},open:function(){this.show(),this.fireEvent(BI.Popover.EVENT_OPEN,arguments)},close:function(){this.hide(),this.fireEvent(BI.Popover.EVENT_CLOSE,arguments)},setZindex:function(zindex){this.element.css({"z-index":zindex})},destroyed:function(){}}),BI.shortcut("bi.popover",BI.Popover),BI.BarPopover=BI.inherit(BI.Popover,{_defaultConfig:function(){return BI.extend(BI.BarPopover.superclass._defaultConfig.apply(this,arguments),{btns:[BI.i18nText("BI-Basic_Sure"),BI.i18nText("BI-Basic_Cancel")]})},beforeCreate:function(){var self=this,o=this.options;o.footer||(o.footer={type:"bi.right_vertical_adapt",lgap:10,items:[{type:"bi.button",text:this.options.btns[1],value:1,level:"ignore",handler:function(v){self.fireEvent(BI.Popover.EVENT_CANCEL,v),self.close(v)}},{type:"bi.button",text:this.options.btns[0],warningTitle:o.warningTitle,value:0,handler:function(v){self.fireEvent(BI.Popover.EVENT_CONFIRM,v),self.close(v)}}]})}}),BI.shortcut("bi.bar_popover",BI.BarPopover),BI.Popover.EVENT_CLOSE="EVENT_CLOSE",BI.Popover.EVENT_OPEN="EVENT_OPEN",BI.Popover.EVENT_CANCEL="EVENT_CANCEL",BI.Popover.EVENT_CONFIRM="EVENT_CONFIRM",BI.PopupView=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.PopupView.superclass._defaultConfig.apply(this,arguments),{_baseCls:"bi-popup-view",maxWidth:"auto",minWidth:100,minHeight:24,lgap:0,rgap:0,tgap:0,bgap:0,vgap:0,hgap:0,innerVGap:0,direction:BI.Direction.Top,stopEvent:!1,stopPropagation:!1,logic:{dynamic:!0},tool:!1,tabs:[],buttons:[],el:{type:"bi.button_group",items:[],chooseType:0,behaviors:{},layouts:[{type:"bi.vertical"}]}})},_init:function(){BI.PopupView.superclass._init.apply(this,arguments);var self=this,o=this.options,fn=function(e){e.stopPropagation()},stop=function(e){return e.stopEvent(),!1};this.element.css({"z-index":BI.zIndex_popup,"min-width":o.minWidth+"px","max-width":o.maxWidth+"px"}).bind({click:fn}),this.element.bind("mousewheel",fn),o.stopPropagation&&this.element.bind({mousedown:fn,mouseup:fn,mouseover:fn}),o.stopEvent&&this.element.bind({mousedown:stop,mouseup:stop,mouseover:stop}),this.tool=this._createTool(),this.tab=this._createTab(),this.view=this._createView(),this.toolbar=this._createToolBar(),this.view.on(BI.Controller.EVENT_CHANGE,function(type){self.fireEvent(BI.Controller.EVENT_CHANGE,arguments),type===BI.Events.CLICK&&self.fireEvent(BI.PopupView.EVENT_CHANGE)}),BI.createWidget(BI.extend({element:this},BI.LogicFactory.createLogic(BI.LogicFactory.createLogicTypeByDirection(o.direction),BI.extend({},o.logic,{ +scrolly:!1,lgap:o.lgap,rgap:o.rgap,tgap:o.tgap,bgap:o.bgap,vgap:o.vgap,hgap:o.hgap,items:BI.LogicFactory.createLogicItemsByDirection(o.direction,BI.extend({cls:"list-view-outer bi-card list-view-shadow"},BI.LogicFactory.createLogic(BI.LogicFactory.createLogicTypeByDirection(o.direction),BI.extend({},o.logic,{items:BI.LogicFactory.createLogicItemsByDirection(o.direction,this.tool,this.tab,this.view,this.toolbar)}))))}))))},_createView:function(){var o=this.options;return this.button_group=BI.createWidget(o.el,{type:"bi.button_group",value:o.value}),this.button_group.element.css({"min-height":o.minHeight+"px","padding-top":o.innerVGap+"px","padding-bottom":o.innerVGap+"px"}),this.button_group},_createTool:function(){var o=this.options;if(!1!==o.tool)return BI.createWidget(o.tool)},_createTab:function(){var o=this.options;if(0!==o.tabs.length)return BI.createWidget({type:"bi.center",cls:"list-view-tab",height:25,items:o.tabs,value:o.value})},_createToolBar:function(){var o=this.options;if(0!==o.buttons.length)return BI.createWidget({type:"bi.center",cls:"list-view-toolbar bi-high-light bi-split-top",height:24,items:BI.createItems(o.buttons,{once:!1,shadow:!0,isShadowShowingOnSelected:!0})})},getView:function(){return this.view},populate:function(items){this.view.populate.apply(this.view,arguments)},resetWidth:function(w){this.options.width=w,this.element.width(w)},resetHeight:function(h){var tbHeight=this.toolbar?this.toolbar.attr("height")||24:0,tabHeight=this.tab?this.tab.attr("height")||24:0,toolHeight=(this.tool&&this.tool.attr("height")||24)*(this.tool&&this.tool.isVisible()?1:0),resetHeight=h-tbHeight-tabHeight-toolHeight-2*this.options.innerVGap;this.view.resetHeight?this.view.resetHeight(resetHeight):this.view.element.css({"max-height":resetHeight+"px"})},setValue:function(selectedValues){this.tab&&this.tab.setValue(selectedValues),this.view.setValue(selectedValues)},getValue:function(){return this.view.getValue()}}),BI.PopupView.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.popup_view",BI.PopupView),BI.SearcherView=BI.inherit(BI.Pane,{_defaultConfig:function(){var conf=BI.SearcherView.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{baseCls:(conf.baseCls||"")+" bi-searcher-view bi-card",tipText:BI.i18nText("BI-No_Select"),chooseType:BI.Selection.Single,matcher:{type:"bi.button_group",behaviors:{redmark:function(){return!0}},items:[],layouts:[{type:"bi.vertical"}]},searcher:{type:"bi.button_group",behaviors:{redmark:function(){return!0}},items:[],layouts:[{type:"bi.vertical"}]}})},_init:function(){BI.SearcherView.superclass._init.apply(this,arguments);var self=this,o=this.options;this.matcher=BI.createWidget(o.matcher,{type:"bi.button_group",chooseType:o.chooseType,behaviors:{redmark:function(){return!0}},layouts:[{type:"bi.vertical"}],value:o.value}),this.matcher.on(BI.Controller.EVENT_CHANGE,function(type,val,ob){self.fireEvent(BI.Controller.EVENT_CHANGE,arguments),type===BI.Events.CLICK&&self.fireEvent(BI.SearcherView.EVENT_CHANGE,val,ob)}),this.spliter=BI.createWidget({type:"bi.vertical",height:1,hgap:10,items:[{type:"bi.layout",height:1,cls:"searcher-view-spliter bi-background"}]}),this.searcher=BI.createWidget(o.searcher,{type:"bi.button_group",chooseType:o.chooseType,behaviors:{redmark:function(){return!0}},layouts:[{type:"bi.vertical"}],value:o.value}),this.searcher.on(BI.Controller.EVENT_CHANGE,function(type,val,ob){self.fireEvent(BI.Controller.EVENT_CHANGE,arguments),type===BI.Events.CLICK&&self.fireEvent(BI.SearcherView.EVENT_CHANGE,val,ob)}),BI.createWidget({type:"bi.vertical",element:this,items:[this.matcher,this.spliter,this.searcher]})},startSearch:function(){},stopSearch:function(){},setValue:function(v){this.matcher.setValue(v),this.searcher.setValue(v)},getValue:function(){return this.matcher.getValue().concat(this.searcher.getValue())},populate:function(searchResult,matchResult,keyword){searchResult||(searchResult=[]),matchResult||(matchResult=[]),this.setTipVisible(searchResult.length+matchResult.length===0),this.spliter.setVisible(BI.isNotEmptyArray(matchResult)&&BI.isNotEmptyArray(searchResult)),this.matcher.populate(matchResult,keyword),this.searcher.populate(searchResult,keyword)},empty:function(){this.searcher.empty(),this.matcher.empty()},hasMatched:function(){return this.matcher.getAllButtons().length>0}}),BI.SearcherView.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.searcher_view",BI.SearcherView),BI.ListView=BI.inherit(BI.Widget,{props:function(){return{baseCls:"bi-list-view",overscanHeight:100,blockSize:10,scrollTop:0,el:{},items:[]}},init:function(){var self=this;this.renderedIndex=-1,this.cache={}},render:function(){var self=this,o=this.options;return{type:"bi.vertical",items:[BI.extend({type:"bi.vertical",scrolly:!1,ref:function(){self.container=this}},o.el)],element:this}},mounted:function(){var self=this,o=this.options;this._populate(),this.element.scroll(function(e){o.scrollTop=self.element.scrollTop(),self._calculateBlocksToRender()});var lastWidth=this.element.width(),lastHeight=this.element.height();BI.ResizeDetector.addResizeListener(this,function(){var width=self.element.width(),height=self.element.height();width===lastWidth&&height===lastHeight||(lastWidth=width,lastHeight=height,self._calculateBlocksToRender())})},_renderMoreIf:function(){for(var self=this,o=this.options,height=this.element.height(),minContentHeight=o.scrollTop+height+o.overscanHeight,index=this.cache[this.renderedIndex]&&this.cache[this.renderedIndex].index+o.blockSize||0,cnt=this.renderedIndex+1,lastHeight,getElementHeight=function(){return self.container.element.height()};(lastHeight=getElementHeight())pages&&(groups=pages),dict.index=Math.ceil((curr+(groups>1&&groups!==pages?1:0))/(0===groups?1:groups)),(!o.dynamicShow&&!o.dynamicShowPrevNext||curr>1)&&prev!==!1&&(BI.isKey(prev)?view.push({text:prev,value:"prev",disabled:pages===!1?o.hasPrev(curr)===!1:!(curr>1&&prev!==!1)}):view.push(BI.extend({disabled:pages===!1?o.hasPrev(curr)===!1:!(curr>1&&prev!==!1)},prev))),(!o.dynamicShow&&!o.dynamicShowFirstLast||dict.index>1&&0!==groups)&&first&&(view.push({text:first,value:"first",disabled:!(dict.index>1&&0!==groups)}),dict.index>1&&0!==groups&&view.push({type:"bi.label",cls:"page-ellipsis",text:"…"})),dict.poor=Math.floor((groups-1)/2),dict.start=dict.index>1?curr-dict.poor:1,dict.end=dict.index>1?function(){var max=curr+(groups-dict.poor-1);return max>pages?pages:max}():groups,dict.end-dict.start1&&0!==groups&&pages>groups&&dict.endgroups&&dict.endgroups&&dict.endgroups&&dict.end1},hasNext:function(v){v||(v=1);var o=this.options,pages=this.options.pages;return pages===!1?o.hasNext(v):vlastPage?lastPage:(firstPage=BI.result(o,"firstPage"),vo.pages?o.pages:v,this.currPage=v;this._populate()},getValue:function(){var val=this.button_group.getValue()[0];switch(val){case"prev":return-1;case"next":return 1;case"first":return BI.MIN;case"last":return BI.MAX;default:return val}},attr:function(key,value){BI.Pager.superclass.attr.apply(this,arguments),"curr"===key&&(this.currPage=BI.result(this.options,"curr"))},populate:function(){this._populate()}}),BI.Pager.EVENT_CHANGE="EVENT_CHANGE",BI.Pager.EVENT_AFTER_POPULATE="EVENT_AFTER_POPULATE",BI.shortcut("bi.pager",BI.Pager),BI.A=BI.inherit(BI.Text,{_defaultConfig:function(){var conf=BI.A.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{baseCls:(conf.baseCls||"")+" bi-a display-block",href:"",target:"_blank",el:null,tagName:"a"})},_init:function(){var o=this.options;BI.A.superclass._init.apply(this,arguments),this.element.attr({href:o.href,target:o.target}),o.el&&BI.createWidget(o.el,{element:this})}}),BI.shortcut("bi.a",BI.A),BI.LoadingBar=BI.inherit(BI.Single,{_defaultConfig:function(){var conf=BI.LoadingBar.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{baseCls:(conf.baseCls||"")+" bi-loading-bar bi-tips",height:30,handler:BI.emptyFn})},_init:function(){BI.LoadingBar.superclass._init.apply(this,arguments);var self=this;this.loaded=BI.createWidget({type:"bi.text_button",cls:"loading-text bi-list-item-simple",text:BI.i18nText("BI-Load_More"),width:120,handler:this.options.handler}),this.loaded.on(BI.Controller.EVENT_CHANGE,function(type){self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.loading=BI.createWidget({type:"bi.layout",width:this.options.height,height:this.options.height,cls:"loading-background cursor-default"});var loaded=BI.createWidget({type:"bi.center_adapt",items:[this.loaded]}),loading=BI.createWidget({type:"bi.center_adapt",items:[this.loading]});this.cardLayout=BI.createWidget({type:"bi.card",element:this,items:[{el:loaded,cardName:"loaded"},{el:loading,cardName:"loading"}]}),this.invisible()},_reset:function(){this.visible(),this.loaded.setText(BI.i18nText("BI-Load_More")),this.loaded.enable()},setLoaded:function(){this._reset(),this.cardLayout.showCardByName("loaded")},setEnd:function(){this.setLoaded(),this.loaded.setText(BI.i18nText("BI-No_More_Data")),this.loaded.disable()},setLoading:function(){this._reset(),this.cardLayout.showCardByName("loading")}}),BI.shortcut("bi.loading_bar",BI.LoadingBar),BI.IconButton=BI.inherit(BI.BasicButton,{_defaultConfig:function(){var conf=BI.IconButton.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{_baseCls:(conf._baseCls||"")+" bi-icon-button horizon-center",iconWidth:null,iconHeight:null})},_init:function(){BI.IconButton.superclass._init.apply(this,arguments);var o=this.options;this.element.css({textAlign:"center"}),this.icon=BI.createWidget({type:"bi.icon",width:o.iconWidth,height:o.iconHeight}),BI.isNumber(o.height)&&o.height>0&&BI.isNull(o.iconWidth)&&BI.isNull(o.iconHeight)?(this.element.css("lineHeight",o.height+"px"),BI.createWidget({type:"bi.default",element:this,items:[this.icon]})):(this.element.css("lineHeight","1"),BI.createWidget({element:this,type:"bi.center_adapt",items:[this.icon]}))},doClick:function(){BI.IconButton.superclass.doClick.apply(this,arguments),this.isValid()&&this.fireEvent(BI.IconButton.EVENT_CHANGE,this)}}),BI.IconButton.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.icon_button",BI.IconButton),BI.ImageButton=BI.inherit(BI.BasicButton,{_defaultConfig:function(){var conf=BI.ImageButton.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{baseCls:(conf.baseCls||"")+" bi-image-button",src:"",iconWidth:"100%",iconHeight:"100%"})},_init:function(){BI.ImageButton.superclass._init.apply(this,arguments);var o=this.options;this.image=BI.createWidget({type:"bi.img",width:o.iconWidth,height:o.iconHeight,src:o.src}),BI.isNumber(o.iconWidth)||BI.isNumber(o.iconHeight)?BI.createWidget({type:"bi.center_adapt",element:this,items:[this.image]}):BI.createWidget({type:"bi.adaptive",element:this,items:[this.image],scrollable:!1})},setWidth:function(w){BI.ImageButton.superclass.setWidth.apply(this,arguments),this.options.width=w},setHeight:function(h){BI.ImageButton.superclass.setHeight.apply(this,arguments),this.options.height=h},setImageWidth:function(w){this.image.setWidth(w)},setImageHeight:function(h){this.image.setHeight(h)},getImageWidth:function(){return this.image.element.width()},getImageHeight:function(){return this.image.element.height()},setSrc:function(src){this.options.src=src,this.image.setSrc(src)},getSrc:function(){return this.image.getSrc()},doClick:function(){BI.ImageButton.superclass.doClick.apply(this,arguments),this.isValid()&&this.fireEvent(BI.ImageButton.EVENT_CHANGE,this)}}),BI.ImageButton.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.image_button",BI.ImageButton),BI.Button=BI.inherit(BI.BasicButton,{_defaultConfig:function(props){var conf=BI.Button.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{baseCls:(conf.baseCls||"")+" bi-button"+(BI.isIE()&&BI.isIE9Below()?" hack":""),minWidth:props.block===!0||props.clear===!0?0:80,height:24,shadow:props.clear!==!0,isShadowShowingOnSelected:!0,readonly:!0,iconCls:"",level:"common",block:!1,clear:!1,ghost:!1,textAlign:"center",whiteSpace:"nowrap",textWidth:null,textHeight:null,hgap:props.clear?0:10,vgap:0,tgap:0,bgap:0,lgap:0,rgap:0})},_init:function(){BI.Button.superclass._init.apply(this,arguments);var o=this.options,self=this;!BI.isNumber(o.height)||o.clear||o.block?o.clear||o.block?this.element.css({lineHeight:o.height+"px"}):this.element.css({lineHeight:o.height-2+"px"}):this.element.css({height:o.height+"px",lineHeight:o.height-2+"px"}),BI.isKey(o.iconCls)?(this.icon=BI.createWidget({type:"bi.icon_label",cls:o.iconCls,width:18,height:o.height-2,iconWidth:o.iconWidth,iconHeight:o.iconHeight}),this.text=BI.createWidget({type:"bi.label",text:o.text,value:o.value,height:o.height-2}),BI.createWidget({type:"bi.center_adapt",element:this,hgap:o.hgap,vgap:o.vgap,items:[{type:"bi.horizontal",items:[this.icon,this.text]}]})):this.text=BI.createWidget({type:"bi.label",textAlign:o.textAlign,whiteSpace:o.whiteSpace,textWidth:o.textWidth,textHeight:o.textHeight,hgap:o.hgap,vgap:o.vgap,tgap:o.tgap,bgap:o.bgap,lgap:o.lgap,rgap:o.rgap,element:this,text:o.text,value:o.value}),o.block===!0&&this.element.addClass("block"),o.clear===!0&&this.element.addClass("clear"),o.ghost===!0&&this.element.addClass("ghost"),o.minWidth>0&&this.element.css({"min-width":o.minWidth+"px"})},doClick:function(){BI.Button.superclass.doClick.apply(this,arguments),this.isValid()&&this.fireEvent(BI.Button.EVENT_CHANGE,this)},setText:function(text){BI.Button.superclass.setText.apply(this,arguments),this.text.setText(text)},setValue:function(text){BI.Button.superclass.setValue.apply(this,arguments),this.isReadOnly()||this.text.setValue(text)},doRedMark:function(){this.text.doRedMark.apply(this.text,arguments)},unRedMark:function(){this.text.unRedMark.apply(this.text,arguments)},doHighLight:function(){this.text.doHighLight.apply(this.text,arguments)},unHighLight:function(){this.text.unHighLight.apply(this.text,arguments)},destroy:function(){BI.Button.superclass.destroy.apply(this,arguments)}}),BI.shortcut("bi.button",BI.Button),BI.Button.EVENT_CHANGE="EVENT_CHANGE",BI.TextButton=BI.inherit(BI.BasicButton,{_defaultConfig:function(){var conf=BI.TextButton.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{baseCls:(conf.baseCls||"")+" bi-text-button",textAlign:"center",whiteSpace:"nowrap",textWidth:null,textHeight:null,hgap:0,lgap:0,rgap:0,text:"",py:""})},_init:function(){BI.TextButton.superclass._init.apply(this,arguments);var o=this.options;this.text=BI.createWidget({type:"bi.label",element:this,textAlign:o.textAlign,whiteSpace:o.whiteSpace,textWidth:o.textWidth,textHeight:o.textHeight,width:o.width,height:o.height,hgap:o.hgap,lgap:o.lgap,rgap:o.rgap,text:o.text,value:o.value,py:o.py,keyword:o.keyword})},doClick:function(){BI.TextButton.superclass.doClick.apply(this,arguments),this.isValid()&&this.fireEvent(BI.TextButton.EVENT_CHANGE,this.getValue(),this)},doRedMark:function(){this.text.doRedMark.apply(this.text,arguments)},unRedMark:function(){this.text.unRedMark.apply(this.text,arguments)},doHighLight:function(){this.text.doHighLight.apply(this.text,arguments)},unHighLight:function(){this.text.unHighLight.apply(this.text,arguments)},setText:function(text){BI.TextButton.superclass.setText.apply(this,arguments),text=BI.isArray(text)?text.join(","):text,this.text.setText(text)},setStyle:function(style){this.text.setStyle(style)},setValue:function(text){BI.TextButton.superclass.setValue.apply(this,arguments),this.isReadOnly()||(text=BI.isArray(text)?text.join(","):text,this.text.setValue(text))}}),BI.TextButton.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.text_button",BI.TextButton),BI.BlankIconIconTextItem=BI.inherit(BI.BasicButton,{_defaultConfig:function(){var conf=BI.BlankIconIconTextItem.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{baseCls:(conf.baseCls||"")+" bi-blank-icon-text-item",logic:{dynamic:!1},iconCls1:"close-ha-font",iconCls2:"close-ha-font",blankWidth:0,iconHeight:null,iconWidth:null,textHgap:0,textVgap:0,textLgap:0,textRgap:0})},_init:function(){BI.BlankIconIconTextItem.superclass._init.apply(this,arguments);var o=this.options,c=this._const,blank=BI.createWidget({type:"bi.layout",width:o.blankWidth,height:o.height});this.text=BI.createWidget({type:"bi.label",cls:"list-item-text",textAlign:"left",hgap:o.textHgap,vgap:o.textVgap,lgap:o.textLgap,rgap:o.textRgap,text:o.text,value:o.value,keyword:o.keyword,height:o.height}),this.icon1=BI.createWidget({type:"bi.icon_button",cls:o.iconCls1,forceNotSelected:!0,width:o.height,height:o.height}),this.icon2=BI.createWidget({type:"bi.icon_button",cls:o.iconCls2,forceNotSelected:!0,width:o.height,height:o.height}),BI.createWidget(BI.extend({element:this},BI.LogicFactory.createLogic("horizontal",BI.extend(o.logic,{items:BI.LogicFactory.createLogicItemsByDirection("left",blank,this.icon1,this.icon2,this.text)}))))},doClick:function(){BI.BlankIconIconTextItem.superclass.doClick.apply(this,arguments),this.isValid()&&this.fireEvent(BI.BlankIconIconTextItem.EVENT_CHANGE,this.getValue(),this)},setSelected:function(b){BI.BlankIconIconTextItem.superclass.setSelected.apply(this,arguments),this.icon1.setSelected(b),this.icon2.setSelected(b)},setValue:function(){this.isReadOnly()||this.text.setValue.apply(this.text,arguments)},getValue:function(){return this.text.getValue()},setText:function(){this.text.setText.apply(this.text,arguments)},getText:function(){return this.text.getText()},doRedMark:function(){this.text.doRedMark.apply(this.text,arguments)},unRedMark:function(){this.text.unRedMark.apply(this.text,arguments)},doHighLight:function(){this.text.doHighLight.apply(this.text,arguments)},unHighLight:function(){this.text.unHighLight.apply(this.text,arguments)}}),BI.BlankIconIconTextItem.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.blank_icon_icon_text_item",BI.BlankIconIconTextItem),BI.BlankIconTextIconItem=BI.inherit(BI.BasicButton,{_defaultConfig:function(){var conf=BI.BlankIconTextIconItem.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{baseCls:(conf.baseCls||"")+" bi-blank-icon-text-icon-item",logic:{dynamic:!1},iconCls1:"close-ha-font",iconCls2:"close-ha-font",blankWidth:0,iconHeight:null,iconWidth:null,textHgap:0,textVgap:0,textLgap:0,textRgap:0})},_init:function(){BI.BlankIconTextIconItem.superclass._init.apply(this,arguments);var o=this.options,c=this._const;this.text=BI.createWidget({type:"bi.label",textAlign:"left",hgap:o.textHgap,vgap:o.textVgap,lgap:o.textLgap,rgap:o.textRgap,text:o.text,value:o.value,keyword:o.keyword,height:o.height});var icon1=BI.createWidget({type:"bi.icon_label",cls:o.iconCls1,width:o.height,height:o.height,iconWidth:o.iconWidth,iconHeight:o.iconHeight});BI.createWidget({type:"bi.absolute",element:this,items:[{el:{type:"bi.icon_label",cls:o.iconCls2,width:o.height,height:o.height,iconWidth:o.iconWidth,iconHeight:o.iconHeight},top:0,bottom:0,right:0}]}),BI.createWidget(BI.extend({element:this},BI.LogicFactory.createLogic("horizontal",BI.extend(o.logic,{items:BI.LogicFactory.createLogicItemsByDirection("left",{type:"bi.layout",width:o.blankWidth},icon1,this.text,{type:"bi.layout",width:o.height})}))))},doClick:function(){BI.BlankIconTextIconItem.superclass.doClick.apply(this,arguments),this.isValid()&&this.fireEvent(BI.BlankIconTextIconItem.EVENT_CHANGE,this.getValue(),this)},doRedMark:function(){this.text.doRedMark.apply(this.text,arguments)},unRedMark:function(){this.text.unRedMark.apply(this.text,arguments)},doHighLight:function(){this.text.doHighLight.apply(this.text,arguments)},unHighLight:function(){this.text.unHighLight.apply(this.text,arguments)},setValue:function(){this.isReadOnly()||this.text.setValue.apply(this.text,arguments)},getValue:function(){return this.text.getValue()},setText:function(){this.text.setText.apply(this.text,arguments)},getText:function(){return this.text.getText()}}),BI.BlankIconTextIconItem.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.blank_icon_text_icon_item",BI.BlankIconTextIconItem),BI.BlankIconTextItem=BI.inherit(BI.BasicButton,{_defaultConfig:function(){var conf=BI.BlankIconTextItem.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{baseCls:(conf.baseCls||"")+" bi-blank-icon-text-item",logic:{dynamic:!1},cls:"close-ha-font",blankWidth:0,iconHeight:null,iconWidth:null,textHgap:0,textVgap:0,textLgap:0,textRgap:0})},_init:function(){BI.BlankIconTextItem.superclass._init.apply(this,arguments);var o=this.options,c=this._const,blank=BI.createWidget({type:"bi.layout",width:o.blankWidth});this.text=BI.createWidget({type:"bi.label",cls:"list-item-text",textAlign:"left",hgap:o.textHgap,vgap:o.textVgap,lgap:o.textLgap,rgap:o.textRgap,text:o.text,value:o.value,keyword:o.keyword,height:o.height}),this.icon=BI.createWidget({type:"bi.icon_label",width:o.height,height:o.height,iconWidth:o.iconWidth,iconHeight:o.iconHeight}),BI.createWidget(BI.extend({element:this},BI.LogicFactory.createLogic("horizontal",BI.extend(o.logic,{items:BI.LogicFactory.createLogicItemsByDirection("left",blank,this.icon,this.text)}))))},doClick:function(){BI.BlankIconTextItem.superclass.doClick.apply(this,arguments),this.isValid()&&this.fireEvent(BI.BlankIconTextItem.EVENT_CHANGE,this.getValue(),this)},setValue:function(){this.isReadOnly()||this.text.setValue.apply(this.text,arguments)},getValue:function(){return this.text.getValue()},setText:function(){this.text.setText.apply(this.text,arguments)},getText:function(){return this.text.getText()},doRedMark:function(){this.text.doRedMark.apply(this.text,arguments)},unRedMark:function(){this.text.unRedMark.apply(this.text,arguments)},doHighLight:function(){this.text.doHighLight.apply(this.text,arguments)},unHighLight:function(){this.text.unHighLight.apply(this.text,arguments)}}),BI.BlankIconTextItem.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.blank_icon_text_item",BI.BlankIconTextItem),BI.IconTextIconItem=BI.inherit(BI.BasicButton,{_defaultConfig:function(){var conf=BI.IconTextIconItem.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{baseCls:(conf.baseCls||"")+" bi-icon-text-icon-item",logic:{dynamic:!1},iconCls1:"close-ha-font",iconCls2:"close-ha-font",iconHeight:null,iconWidth:null,textHgap:0,textVgap:0,textLgap:0,textRgap:0})},_init:function(){BI.IconTextIconItem.superclass._init.apply(this,arguments);var o=this.options,c=this._const;this.text=BI.createWidget({type:"bi.label",textAlign:"left",hgap:o.textHgap,vgap:o.textVgap,lgap:o.textLgap,rgap:o.textRgap,text:o.text,value:o.value,keyword:o.keyword,height:o.height});var icon1=BI.createWidget({type:"bi.icon_label",cls:o.iconCls1,width:o.leftIconWrapperWidth,height:o.height,iconWidth:o.iconWidth,iconHeight:o.iconHeight}),blank=BI.createWidget({type:"bi.layout",width:o.height});BI.createWidget({type:"bi.absolute",element:this,items:[{el:{type:"bi.icon_label",cls:o.iconCls2,width:o.rightIconWrapperWidth,height:o.height,iconWidth:o.iconWidth,iconHeight:o.iconHeight},top:0,bottom:0,right:0}]}),BI.createWidget(BI.extend({element:this},BI.LogicFactory.createLogic("horizontal",BI.extend(o.logic,{items:BI.LogicFactory.createLogicItemsByDirection("left",icon1,this.text,blank)}))))},doClick:function(){BI.IconTextIconItem.superclass.doClick.apply(this,arguments),this.isValid()&&this.fireEvent(BI.IconTextIconItem.EVENT_CHANGE,this.getValue(),this)},doRedMark:function(){this.text.doRedMark.apply(this.text,arguments)},unRedMark:function(){this.text.unRedMark.apply(this.text,arguments)},doHighLight:function(){this.text.doHighLight.apply(this.text,arguments)},unHighLight:function(){this.text.unHighLight.apply(this.text,arguments)},setValue:function(){this.isReadOnly()||this.text.setValue.apply(this.text,arguments)},getValue:function(){return this.text.getValue()},setText:function(){this.text.setText.apply(this.text,arguments)},getText:function(){return this.text.getText()}}),BI.IconTextIconItem.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.icon_text_icon_item",BI.IconTextIconItem),BI.IconTextItem=BI.inherit(BI.BasicButton,{_defaultConfig:function(){var conf=BI.IconTextItem.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{baseCls:(conf.baseCls||"")+" bi-icon-text-item",direction:BI.Direction.Left,logic:{dynamic:!1},iconWrapperWidth:null,iconHeight:null,iconWidth:null,textHgap:0,textVgap:0,textLgap:0,textRgap:0})},_init:function(){BI.IconTextItem.superclass._init.apply(this,arguments); +var o=this.options,c=this._const;this.text=BI.createWidget({type:"bi.label",cls:"list-item-text",textAlign:"left",hgap:o.textHgap,vgap:o.textVgap,lgap:o.textLgap,rgap:o.textRgap,text:o.text,value:o.value,keyword:o.keyword,height:o.height}),this.icon=BI.createWidget({type:"bi.icon_label",width:o.iconWrapperWidth||o.height,height:o.height,iconWidth:o.iconWidth,iconHeight:o.iconHeight}),BI.createWidget(BI.extend({element:this},BI.LogicFactory.createLogic(BI.LogicFactory.createLogicTypeByDirection(o.direction),BI.extend(o.logic,{items:BI.LogicFactory.createLogicItemsByDirection(o.direction,this.icon,this.text)}))))},setValue:function(){this.isReadOnly()||this.text.setValue.apply(this.text,arguments)},getValue:function(){return this.text.getValue()},setText:function(){this.text.setText.apply(this.text,arguments)},getText:function(){return this.text.getText()},doClick:function(){BI.IconTextItem.superclass.doClick.apply(this,arguments),this.isValid()&&this.fireEvent(BI.IconTextItem.EVENT_CHANGE,this.getValue(),this)},doRedMark:function(){this.text.doRedMark.apply(this.text,arguments)},unRedMark:function(){this.text.unRedMark.apply(this.text,arguments)},doHighLight:function(){this.text.doHighLight.apply(this.text,arguments)},unHighLight:function(){this.text.unHighLight.apply(this.text,arguments)}}),BI.IconTextItem.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.icon_text_item",BI.IconTextItem),BI.TextIconItem=BI.inherit(BI.BasicButton,{_defaultConfig:function(){var conf=BI.TextIconItem.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{baseCls:(conf.baseCls||"")+" bi-text-icon-item",logic:{dynamic:!1},cls:"close-ha-font",iconHeight:null,iconWidth:null,textHgap:0,textVgap:0,textLgap:0,textRgap:0})},_init:function(){BI.TextIconItem.superclass._init.apply(this,arguments);var o=this.options,c=this._const;this.text=BI.createWidget({type:"bi.label",cls:"list-item-text",textAlign:"left",hgap:o.textHgap,vgap:o.textVgap,lgap:o.textLgap,rgap:o.textRgap,text:o.text,value:o.value,keyword:o.keyword,height:o.height}),this.icon=BI.createWidget({type:"bi.icon_label",width:o.height,height:o.height,iconWidth:o.iconWidth,iconHeight:o.iconHeight}),BI.createWidget(BI.extend({element:this},BI.LogicFactory.createLogic("horizontal",BI.extend(o.logic,{items:BI.LogicFactory.createLogicItemsByDirection("left",this.text,this.icon)}))))},doClick:function(){BI.TextIconItem.superclass.doClick.apply(this,arguments),this.isValid()&&this.fireEvent(BI.TextIconItem.EVENT_CHANGE,this.getValue(),this)},setValue:function(){this.isReadOnly()||this.text.setValue.apply(this.text,arguments)},getValue:function(){return this.text.getValue()},setText:function(){this.text.setText.apply(this.text,arguments)},getText:function(){return this.text.getText()},doRedMark:function(){this.text.doRedMark.apply(this.text,arguments)},unRedMark:function(){this.text.unRedMark.apply(this.text,arguments)},doHighLight:function(){this.text.doHighLight.apply(this.text,arguments)},unHighLight:function(){this.text.unHighLight.apply(this.text,arguments)}}),BI.TextIconItem.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.text_icon_item",BI.TextIconItem),BI.TextItem=BI.inherit(BI.BasicButton,{_defaultConfig:function(){var conf=BI.TextItem.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{baseCls:(conf.baseCls||"")+" bi-text-item",textAlign:"left",whiteSpace:"nowrap",textHgap:0,textVgap:0,textLgap:0,textRgap:0})},_init:function(){BI.TextItem.superclass._init.apply(this,arguments);var o=this.options;this.text=BI.createWidget({type:"bi.label",element:this,textAlign:o.textAlign,whiteSpace:o.whiteSpace,textHeight:"nowrap"==o.whiteSpace?o.height:o.textHeight,height:o.height,hgap:o.textHgap,vgap:o.textVgap,lgap:o.textLgap,rgap:o.textRgap,text:o.text,value:o.value,keyword:o.keyword,py:o.py})},doClick:function(){BI.TextItem.superclass.doClick.apply(this,arguments),this.isValid()&&this.fireEvent(BI.TextItem.EVENT_CHANGE,this.getValue(),this)},doRedMark:function(){this.text.doRedMark.apply(this.text,arguments)},unRedMark:function(){this.text.unRedMark.apply(this.text,arguments)},doHighLight:function(){this.text.doHighLight.apply(this.text,arguments)},unHighLight:function(){this.text.unHighLight.apply(this.text,arguments)},setValue:function(){this.isReadOnly()||this.text.setValue.apply(this.text,arguments)},getValue:function(){return this.text.getValue()},setText:function(){this.text.setText.apply(this.text,arguments)},getText:function(){return this.text.getText()}}),BI.TextItem.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.text_item",BI.TextItem),BI.IconTextIconNode=BI.inherit(BI.NodeButton,{_defaultConfig:function(){var conf=BI.IconTextIconNode.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{baseCls:(conf.baseCls||"")+" bi-icon-text-icon-node",logic:{dynamic:!1},iconCls1:"close-ha-font",iconCls2:"close-ha-font",iconHeight:null,iconWidth:null,textHgap:0,textVgap:0,textLgap:0,textRgap:0})},_init:function(){BI.IconTextIconNode.superclass._init.apply(this,arguments);var o=this.options,c=this._const;this.text=BI.createWidget({type:"bi.label",textAlign:"left",hgap:o.textHgap,vgap:o.textVgap,lgap:o.textLgap,rgap:o.textRgap,text:o.text,value:o.value,keyword:o.keyword,height:o.height});var icon1=BI.createWidget({type:"bi.icon_label",cls:o.iconCls1,width:o.height,height:o.height,iconWidth:o.iconWidth,iconHeight:o.iconHeight}),blank=BI.createWidget({type:"bi.layout",width:o.height,height:o.height});BI.createWidget({type:"bi.absolute",element:this,items:[{el:{type:"bi.icon_label",cls:o.iconCls2,width:o.height,iconWidth:o.iconWidth,iconHeight:o.iconHeight},top:0,bottom:0,right:0}]}),BI.createWidget(BI.extend({element:this},BI.LogicFactory.createLogic("horizontal",BI.extend(o.logic,{items:BI.LogicFactory.createLogicItemsByDirection("left",icon1,this.text,blank)}))))},doClick:function(){BI.IconTextIconNode.superclass.doClick.apply(this,arguments),this.isValid()&&this.fireEvent(BI.IconTextIconNode.EVENT_CHANGE,this.getValue(),this)},doRedMark:function(){this.text.doRedMark.apply(this.text,arguments)},unRedMark:function(){this.text.unRedMark.apply(this.text,arguments)},setValue:function(){this.isReadOnly()||this.text.setValue.apply(this.text,arguments)},getValue:function(){return this.text.getValue()},setText:function(){this.text.setText.apply(this.text,arguments)},getText:function(){return this.text.getText()}}),BI.IconTextIconNode.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.icon_text_icon_node",BI.IconTextIconNode),BI.IconTextNode=BI.inherit(BI.NodeButton,{_defaultConfig:function(){var conf=BI.IconTextNode.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{baseCls:(conf.baseCls||"")+" bi-icon-text-node",logic:{dynamic:!1},cls:"close-ha-font",iconHeight:null,iconWidth:null,textHgap:0,textVgap:0,textLgap:0,textRgap:0})},_init:function(){BI.IconTextNode.superclass._init.apply(this,arguments);var o=this.options,c=this._const;this.text=BI.createWidget({type:"bi.label",cls:"list-item-text",textAlign:"left",hgap:o.textHgap,vgap:o.textVgap,lgap:o.textLgap,rgap:o.textRgap,text:o.text,value:o.value,keyword:o.keyword,height:o.height}),this.icon=BI.createWidget({type:"bi.icon_label",width:o.height,height:o.height,iconWidth:o.iconWidth,iconHeight:o.iconHeight}),BI.createWidget(BI.extend({element:this},BI.LogicFactory.createLogic("horizontal",BI.extend(o.logic,{items:BI.LogicFactory.createLogicItemsByDirection("left",this.icon,this.text)}))))},setValue:function(){this.isReadOnly()||this.text.setValue.apply(this.text,arguments)},getValue:function(){return this.text.getValue()},setText:function(){this.text.setText.apply(this.text,arguments)},getText:function(){return this.text.getText()},doClick:function(){BI.IconTextNode.superclass.doClick.apply(this,arguments),this.isValid()&&this.fireEvent(BI.IconTextNode.EVENT_CHANGE,this.getValue(),this)},doRedMark:function(){this.text.doRedMark.apply(this.text,arguments)},unRedMark:function(){this.text.unRedMark.apply(this.text,arguments)}}),BI.IconTextNode.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.icon_text_node",BI.IconTextNode),BI.TextIconNode=BI.inherit(BI.NodeButton,{_defaultConfig:function(){var conf=BI.TextIconNode.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{baseCls:(conf.baseCls||"")+" bi-text-icon-node",logic:{dynamic:!1},cls:"close-ha-font",iconHeight:null,iconWidth:null,textHgap:0,textVgap:0,textLgap:0,textRgap:0})},_init:function(){BI.TextIconNode.superclass._init.apply(this,arguments);var o=this.options,c=this._const;this.text=BI.createWidget({type:"bi.label",cls:"list-item-text",textAlign:"left",hgap:o.textHgap,vgap:o.textVgap,lgap:o.textLgap,rgap:o.textRgap,text:o.text,value:o.value,keyword:o.keyword,height:o.height}),this.icon=BI.createWidget({type:"bi.icon_label",width:o.height,height:o.height,iconWidth:o.iconWidth,iconHeight:o.iconHeight}),BI.createWidget(BI.extend({element:this},BI.LogicFactory.createLogic("horizontal",BI.extend(o.logic,{items:BI.LogicFactory.createLogicItemsByDirection("left",this.text,this.icon)}))))},doClick:function(){BI.TextIconNode.superclass.doClick.apply(this,arguments),this.isValid()&&this.fireEvent(BI.TextIconNode.EVENT_CHANGE,this.getValue(),this)},setValue:function(){this.isReadOnly()||this.text.setValue.apply(this.text,arguments)},getValue:function(){return this.text.getValue()},setText:function(){this.text.setText.apply(this.text,arguments)},getText:function(){return this.text.getText()},doRedMark:function(){this.text.doRedMark.apply(this.text,arguments)},unRedMark:function(){this.text.unRedMark.apply(this.text,arguments)}}),BI.TextIconNode.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.text_icon_node",BI.TextIconNode),BI.TextNode=BI.inherit(BI.NodeButton,{_defaultConfig:function(){var conf=BI.TextNode.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{baseCls:(conf.baseCls||"")+" bi-text-node",textAlign:"left",whiteSpace:"nowrap",textHgap:0,textVgap:0,textLgap:0,textRgap:0})},_init:function(){BI.TextNode.superclass._init.apply(this,arguments);var o=this.options;this.text=BI.createWidget({type:"bi.label",element:this,textAlign:o.textAlign,whiteSpace:o.whiteSpace,textHeight:"nowrap"==o.whiteSpace?o.height:o.textHeight,height:o.height,hgap:o.textHgap,vgap:o.textVgap,lgap:o.textLgap,rgap:o.textRgap,text:o.text,value:o.value,keyword:o.keyword,py:o.py})},doClick:function(){BI.TextNode.superclass.doClick.apply(this,arguments),this.isValid()&&this.fireEvent(BI.TextNode.EVENT_CHANGE,this.getValue(),this)},doRedMark:function(){this.text.doRedMark.apply(this.text,arguments)},unRedMark:function(){this.text.unRedMark.apply(this.text,arguments)},setValue:function(){this.isReadOnly()||this.text.setValue.apply(this.text,arguments)},getValue:function(){return this.text.getValue()},setText:function(){this.text.setText.apply(this.text,arguments)},getText:function(){return this.text.getText()}}),BI.TextNode.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.text_node",BI.TextNode),BI.Editor=BI.inherit(BI.Single,{_defaultConfig:function(){var conf=BI.Editor.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{baseCls:"bi-editor bi-focus-shadow",hgap:4,vgap:2,lgap:0,rgap:0,tgap:0,bgap:0,tipType:"warning",inputType:"text",validationChecker:BI.emptyFn,quitChecker:BI.emptyFn,allowBlank:!1,watermark:"",errorText:""})},_init:function(){BI.Editor.superclass._init.apply(this,arguments);var self=this,o=this.options;this.editor=this.addWidget(BI.createWidget({type:"bi.input",element:"",root:!0,value:o.value,watermark:o.watermark,validationChecker:o.validationChecker,quitChecker:o.quitChecker,allowBlank:o.allowBlank})),this.editor.element.css({width:"100%",height:"100%",border:"none",outline:"none",padding:"0",margin:"0"}),BI.isKey(this.options.watermark)&&this._assertWaterMark();var _items=[];this.watermark&&_items.push({el:this.watermark,left:3,right:3,top:0,bottom:0}),_items.push({el:this.editor,left:0,right:0,top:0,bottom:0});var items=[{el:{type:"bi.absolute",ref:function(_ref){self.contentWrapper=_ref},items:_items},left:o.hgap+o.lgap,right:o.hgap+o.rgap,top:o.vgap+o.tgap,bottom:o.vgap+o.bgap}];BI.createWidget({type:"bi.absolute",element:this,items:items}),this.editor.on(BI.Controller.EVENT_CHANGE,function(){self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.editor.on(BI.Input.EVENT_FOCUS,function(){self._checkError(),self.element.addClass("bi-editor-focus"),self.fireEvent(BI.Editor.EVENT_FOCUS,arguments)}),this.editor.on(BI.Input.EVENT_BLUR,function(){self._setErrorVisible(!1),self.element.removeClass("bi-editor-focus"),self.fireEvent(BI.Editor.EVENT_BLUR,arguments)}),this.editor.on(BI.Input.EVENT_CLICK,function(){self.fireEvent(BI.Editor.EVENT_CLICK,arguments)}),this.editor.on(BI.Input.EVENT_CHANGE,function(){self.fireEvent(BI.Editor.EVENT_CHANGE,arguments)}),this.editor.on(BI.Input.EVENT_KEY_DOWN,function(v){self.fireEvent(BI.Editor.EVENT_KEY_DOWN,arguments)}),this.editor.on(BI.Input.EVENT_QUICK_DOWN,function(e){e.keyCode!==BI.KeyCode.TAB&&self.watermark&&self.watermark.invisible()}),this.editor.on(BI.Input.EVENT_VALID,function(){self._checkWaterMark(),self._setErrorVisible(!1),self.fireEvent(BI.Editor.EVENT_VALID,arguments)}),this.editor.on(BI.Input.EVENT_ERROR,function(){self._checkWaterMark(),self.fireEvent(BI.Editor.EVENT_ERROR,arguments),self._setErrorVisible(self.isEditing())}),this.editor.on(BI.Input.EVENT_RESTRICT,function(){self._checkWaterMark();var tip=self._setErrorVisible(!0);tip&&tip.element.fadeOut(100,function(){tip.element.fadeIn(100)}),self.fireEvent(BI.Editor.EVENT_RESTRICT,arguments)}),this.editor.on(BI.Input.EVENT_EMPTY,function(){self._checkWaterMark(),self.fireEvent(BI.Editor.EVENT_EMPTY,arguments)}),this.editor.on(BI.Input.EVENT_ENTER,function(){self.fireEvent(BI.Editor.EVENT_ENTER,arguments)}),this.editor.on(BI.Input.EVENT_SPACE,function(){self.fireEvent(BI.Editor.EVENT_SPACE,arguments)}),this.editor.on(BI.Input.EVENT_BACKSPACE,function(){self.fireEvent(BI.Editor.EVENT_BACKSPACE,arguments)}),this.editor.on(BI.Input.EVENT_REMOVE,function(){self.fireEvent(BI.Editor.EVENT_REMOVE,arguments)}),this.editor.on(BI.Input.EVENT_START,function(){self.fireEvent(BI.Editor.EVENT_START,arguments)}),this.editor.on(BI.Input.EVENT_PAUSE,function(){self.fireEvent(BI.Editor.EVENT_PAUSE,arguments)}),this.editor.on(BI.Input.EVENT_STOP,function(){self.fireEvent(BI.Editor.EVENT_STOP,arguments)}),this.editor.on(BI.Input.EVENT_CONFIRM,function(){self.fireEvent(BI.Editor.EVENT_CONFIRM,arguments)}),this.editor.on(BI.Input.EVENT_CHANGE_CONFIRM,function(){self.fireEvent(BI.Editor.EVENT_CHANGE_CONFIRM,arguments)}),this.element.click(function(e){return e.stopPropagation(),!1}),BI.isKey(this.options.value)||BI.isEmptyString(this.options.value)?(this._checkError(),this._checkWaterMark()):this._checkWaterMark()},_checkToolTip:function(){var o=this.options,errorText=o.errorText;BI.isFunction(errorText)&&(errorText=errorText(this.editor.getValue())),BI.isKey(errorText)&&(!this.isEnabled()||this.isValid()||BI.Bubbles.has(this.getName())&&BI.Bubbles.get(this.getName()).isVisible()?this.setTitle(""):this.setTitle(errorText))},_assertWaterMark:function(){var self=this,o=this.options;BI.isNull(this.watermark)&&(this.watermark=BI.createWidget({type:"bi.label",cls:"bi-water-mark",text:this.options.watermark,height:o.height-2*(o.vgap+o.tgap),whiteSpace:"nowrap",textAlign:"left"}),this.watermark.element.bind({mousedown:function(e){self.isEnabled()?self.editor.isEditing()||self.editor.focus():self.editor.isEditing()&&self.editor.blur(),e.stopEvent()}}),this.watermark.element.bind("click",function(e){self.isEnabled()?self.editor.isEditing()||self.editor.focus():self.editor.isEditing()&&self.editor.blur(),e.stopEvent()}))},_checkError:function(){this._setErrorVisible(this.isEnabled()&&!this.isValid()),this._checkToolTip()},_checkWaterMark:function(){var o=this.options;!this.disabledWaterMark&&""===this.editor.getValue()&&BI.isKey(o.watermark)?this.watermark&&this.watermark.visible():this.watermark&&this.watermark.invisible()},setErrorText:function(text){this.options.errorText=text},getErrorText:function(){return this.options.errorText},setWaterMark:function(v){this.options.watermark=v,BI.isNull(this.watermark)&&(this._assertWaterMark(),BI.createWidget({type:"bi.absolute",element:this.contentWrapper,items:[{el:this.watermark,left:3,right:3,top:0,bottom:0}]})),BI.isKey(v)&&this.watermark.setText(v)},_setErrorVisible:function(b){var o=this.options,errorText=o.errorText;if(BI.isFunction(errorText)&&(errorText=errorText(BI.trim(this.editor.getValue()))),!this.disabledError&&BI.isKey(errorText))return BI.Bubbles[b?"show":"hide"](this.getName(),errorText,this,{adjustYOffset:2}),this._checkToolTip(),BI.Bubbles.get(this.getName())},disableError:function(){this.disabledError=!0,this._checkError()},enableError:function(){this.disabledError=!1,this._checkError()},disableWaterMark:function(){this.disabledWaterMark=!0,this._checkWaterMark()},enableWaterMark:function(){this.disabledWaterMark=!1,this._checkWaterMark()},focus:function(){this.element.addClass("text-editor-focus"),this.editor.focus()},blur:function(){this.element.removeClass("text-editor-focus"),this.editor.blur()},selectAll:function(){this.editor.selectAll()},onKeyDown:function(k){this.editor.onKeyDown(k)},setValue:function(v){BI.Editor.superclass.setValue.apply(this,arguments),this.editor.setValue(v),this._checkError(),this._checkWaterMark()},getLastValidValue:function(){return this.editor.getLastValidValue()},getLastChangedValue:function(){return this.editor.getLastChangedValue()},getValue:function(){return this.isValid()?BI.trim(this.editor.getValue()):BI.trim(this.editor.getLastValidValue())},isEditing:function(){return this.editor.isEditing()},isValid:function(){return this.editor.isValid()},destroyed:function(){BI.Bubbles.remove(this.getName())}}),BI.Editor.EVENT_CHANGE="EVENT_CHANGE",BI.Editor.EVENT_FOCUS="EVENT_FOCUS",BI.Editor.EVENT_BLUR="EVENT_BLUR",BI.Editor.EVENT_CLICK="EVENT_CLICK",BI.Editor.EVENT_KEY_DOWN="EVENT_KEY_DOWN",BI.Editor.EVENT_SPACE="EVENT_SPACE",BI.Editor.EVENT_BACKSPACE="EVENT_BACKSPACE",BI.Editor.EVENT_START="EVENT_START",BI.Editor.EVENT_PAUSE="EVENT_PAUSE",BI.Editor.EVENT_STOP="EVENT_STOP",BI.Editor.EVENT_CONFIRM="EVENT_CONFIRM",BI.Editor.EVENT_CHANGE_CONFIRM="EVENT_CHANGE_CONFIRM",BI.Editor.EVENT_VALID="EVENT_VALID",BI.Editor.EVENT_ERROR="EVENT_ERROR",BI.Editor.EVENT_ENTER="EVENT_ENTER",BI.Editor.EVENT_RESTRICT="EVENT_RESTRICT",BI.Editor.EVENT_REMOVE="EVENT_REMOVE",BI.Editor.EVENT_EMPTY="EVENT_EMPTY",BI.shortcut("bi.editor",BI.Editor),BI.MultifileEditor=BI.inherit(BI.Widget,{_defaultConfig:function(){var conf=BI.MultifileEditor.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{baseCls:(conf.baseCls||"")+" bi-multifile-editor",multiple:!1,maxSize:-1,accept:"",url:""})},_init:function(){var self=this,o=this.options;BI.MultifileEditor.superclass._init.apply(this,arguments),this.file=BI.createWidget({type:"bi.file",cls:"multifile-editor",width:"100%",height:"100%",name:o.name,url:o.url,multiple:o.multiple,accept:o.accept,maxSize:o.maxSize,title:o.title}),this.file.on(BI.File.EVENT_CHANGE,function(){self.fireEvent(BI.MultifileEditor.EVENT_CHANGE,arguments)}),this.file.on(BI.File.EVENT_UPLOADSTART,function(){self.fireEvent(BI.MultifileEditor.EVENT_UPLOADSTART,arguments)}),this.file.on(BI.File.EVENT_ERROR,function(){self.fireEvent(BI.MultifileEditor.EVENT_ERROR,arguments)}),this.file.on(BI.File.EVENT_PROGRESS,function(){self.fireEvent(BI.MultifileEditor.EVENT_PROGRESS,arguments)}),this.file.on(BI.File.EVENT_UPLOADED,function(){self.fireEvent(BI.MultifileEditor.EVENT_UPLOADED,arguments)}),BI.createWidget({type:"bi.absolute",element:this,items:[{el:{type:"bi.adaptive",scrollable:!1,items:[this.file]},top:0,right:0,left:0,bottom:0}]})},select:function(){this.file.select()},getValue:function(){return this.file.getValue()},upload:function(){this.file.upload()},reset:function(){this.file.reset()}}),BI.MultifileEditor.EVENT_CHANGE="EVENT_CHANGE",BI.MultifileEditor.EVENT_UPLOADSTART="EVENT_UPLOADSTART",BI.MultifileEditor.EVENT_ERROR="EVENT_ERROR",BI.MultifileEditor.EVENT_PROGRESS="EVENT_PROGRESS",BI.MultifileEditor.EVENT_UPLOADED="EVENT_UPLOADED",BI.shortcut("bi.multifile_editor",BI.MultifileEditor),BI.TextAreaEditor=BI.inherit(BI.Single,{_defaultConfig:function(){return BI.extend(BI.TextAreaEditor.superclass._defaultConfig.apply(),{baseCls:"bi-textarea-editor",value:""})},render:function(){var o=this.options,self=this;this.content=BI.createWidget({type:"bi.layout",tagName:"textarea",width:"100%",height:"100%",cls:"bi-textarea textarea-editor-content display-block"}),this.content.element.css({resize:"none"}),BI.createWidget({type:"bi.absolute",element:this,items:[{el:{type:"bi.adaptive",items:[this.content]},left:4,right:4,top:4,bottom:8}]}),this.content.element.on("input propertychange",function(e){self._checkWaterMark(),self.fireEvent(BI.TextAreaEditor.EVENT_CHANGE)}),this.content.element.focus(function(){self.isValid()&&(self._focus(),self.fireEvent(BI.TextAreaEditor.EVENT_FOCUS)),BI.Widget._renderEngine.createElement(document).bind("mousedown."+self.getName(),function(e){BI.DOM.isExist(self)&&!self.element.__isMouseInBounds__(e)&&(BI.Widget._renderEngine.createElement(document).unbind("mousedown."+self.getName()),self.content.element.blur())})}),this.content.element.blur(function(){self.isValid()&&(self._blur(),self.fireEvent(BI.TextAreaEditor.EVENT_BLUR)),BI.Widget._renderEngine.createElement(document).unbind("mousedown."+self.getName())}),BI.isKey(o.value)&&this.setValue(o.value),BI.isNotNull(o.style)&&this.setStyle(o.style),this._checkWaterMark()},_checkWaterMark:function(){var self=this,o=this.options,val=this.getValue();BI.isNotEmptyString(val)?(this.watermark&&this.watermark.destroy(),this.watermark=null):BI.isNotEmptyString(o.watermark)&&(this.watermark?(this.watermark.setText(o.watermark),this.watermark.setValid(!o.invalid),this.watermark.setEnable(!o.disabled)):(this.watermark=BI.createWidget({type:"bi.text_button",cls:"bi-water-mark cursor-default",textAlign:"left",whiteSpace:"normal",text:o.watermark,invalid:o.invalid,disabled:o.disabled}),this.watermark.on(BI.TextButton.EVENT_CHANGE,function(){self.focus()}),BI.createWidget({type:"bi.absolute",element:this,items:[{el:this.watermark,left:4,top:4,right:0}]})))},_focus:function(){this.content.element.addClass("textarea-editor-focus"),this._checkWaterMark()},_blur:function(){this.content.element.removeClass("textarea-editor-focus"),this._checkWaterMark()},focus:function(){this._focus(),this.content.element.focus()},blur:function(){this._blur(),this.content.element.blur()},getValue:function(){return this.content.element.val()},setValue:function(value){this.content.element.val(value),this._checkWaterMark()},setStyle:function(style){this.style=style,this.element.css(style),this.content.element.css(BI.extend({},style,{color:style.color||BI.DOM.getContrastColor(BI.DOM.isRGBColor(style.backgroundColor)?BI.DOM.rgb2hex(style.backgroundColor):style.backgroundColor)}))},getStyle:function(){return this.style},_setValid:function(b){BI.TextAreaEditor.superclass._setValid.apply(this,arguments)},_setEnable:function(b){BI.TextAreaEditor.superclass._setEnable.apply(this,[b]),this.content&&(this.content.element[0].disabled=!b)}}),BI.TextAreaEditor.EVENT_CHANGE="EVENT_CHANGE",BI.TextAreaEditor.EVENT_BLUR="EVENT_BLUR",BI.TextAreaEditor.EVENT_FOCUS="EVENT_FOCUS",BI.shortcut("bi.textarea_editor",BI.TextAreaEditor),BI.Html=BI.inherit(BI.Single,{props:{baseCls:"bi-html",textAlign:"left",whiteSpace:"normal",lineHeight:null,handler:null,hgap:0,vgap:0,lgap:0,rgap:0,tgap:0,bgap:0,text:"",highLight:!1},render:function(){var self=this,o=this.options;o.hgap+o.lgap>0&&this.element.css({"padding-left":o.hgap+o.lgap+"px"}),o.hgap+o.rgap>0&&this.element.css({"padding-right":o.hgap+o.rgap+"px"}),o.vgap+o.tgap>0&&this.element.css({"padding-top":o.vgap+o.tgap+"px"}),o.vgap+o.bgap>0&&this.element.css({"padding-bottom":o.vgap+o.bgap+"px"}),BI.isNumber(o.height)&&this.element.css({lineHeight:o.height+"px"}),BI.isNumber(o.lineHeight)&&this.element.css({lineHeight:o.lineHeight+"px"}),BI.isWidthOrHeight(o.maxWidth)&&this.element.css({maxWidth:o.maxWidth}),this.element.css({textAlign:o.textAlign,whiteSpace:o.whiteSpace,textOverflow:"nowrap"===o.whiteSpace?"ellipsis":"",overflow:"nowrap"===o.whiteSpace?"":"auto"}),o.handler?(this.text=BI.createWidget({type:"bi.layout",tagName:"span"}),this.text.element.click(function(){o.handler(self.getValue())}),BI.createWidget({type:"bi.default",element:this,items:[this.text]})):this.text=this,BI.isKey(o.text)?this.setText(o.text):BI.isKey(o.value)&&this.setText(o.value),o.highLight&&this.doHighLight()},doHighLight:function(){this.text.element.addClass("bi-high-light")},unHighLight:function(){this.text.element.removeClass("bi-high-light")},setValue:function(text){BI.Html.superclass.setValue.apply(this,arguments),this.isReadOnly()||this.setText(text)},setStyle:function(css){this.text.element.css(css)},setText:function(text){BI.Html.superclass.setText.apply(this,arguments),this.options.text=text,this.text.element.html(text)}}),BI.shortcut("bi.html",BI.Html),BI.Icon=BI.inherit(BI.Single,{_defaultConfig:function(){var conf=BI.Icon.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{tagName:"i",baseCls:(conf.baseCls||"")+" x-icon b-font horizon-center display-block"})},_init:function(){BI.Icon.superclass._init.apply(this,arguments),BI.isIE9Below&&BI.isIE9Below()&&this.element.addClass("hack")}}),BI.shortcut("bi.icon",BI.Icon),BI.Iframe=BI.inherit(BI.Single,{_defaultConfig:function(){var conf=BI.Iframe.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{tagName:"iframe",baseCls:(conf.baseCls||"")+" bi-iframe",src:"",name:"",attributes:{},width:"100%",height:"100%"})},_init:function(){var o=this.options;o.attributes.frameborder="0",o.attributes.src=o.src,o.attributes.name=o.name,BI.Iframe.superclass._init.apply(this,arguments)},setSrc:function(src){this.options.src=src,this.element.attr("src",src)},getSrc:function(){return this.options.src},setName:function(name){this.options.name=name,this.element.attr("name",name)},getName:function(){return this.options.name}}),BI.shortcut("bi.iframe",BI.Iframe),BI.Img=BI.inherit(BI.Single,{_defaultConfig:function(){var conf=BI.Img.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{tagName:"img",baseCls:(conf.baseCls||"")+" bi-img display-block",src:"",attributes:{},width:"100%",height:"100%"})},_init:function(){var o=this.options;o.attributes.src=o.src,BI.Img.superclass._init.apply(this,arguments)},setSrc:function(src){this.options.src=src,this.element.attr("src",src)},getSrc:function(){return this.options.src}}),BI.shortcut("bi.img",BI.Img),BI.ImageCheckbox=BI.inherit(BI.IconButton,{_defaultConfig:function(){var conf=BI.ImageCheckbox.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{baseCls:(conf.baseCls||"")+" bi-image-checkbox check-box-icon",selected:!1,handler:BI.emptyFn,width:16,height:16,iconWidth:16,iconHeight:16})}}),BI.ImageCheckbox.EVENT_CHANGE=BI.IconButton.EVENT_CHANGE,BI.shortcut("bi.image_checkbox",BI.ImageCheckbox),BI.Checkbox=BI.inherit(BI.BasicButton,{props:{baseCls:"bi-checkbox",selected:!1,handler:BI.emptyFn,width:16,height:16,iconWidth:16,iconHeight:16},render:function(){var self=this,o=this.options;return{type:"bi.center_adapt",items:[{type:"bi.default",ref:function(_ref){self.checkbox=_ref},cls:"checkbox-content",width:o.iconWidth-2,height:o.iconHeight-2}]}},_setEnable:function(enable){BI.Checkbox.superclass._setEnable.apply(this,arguments),enable===!0?this.checkbox.element.removeClass("base-disabled disabled"):this.checkbox.element.addClass("base-disabled disabled")},doClick:function(){BI.Checkbox.superclass.doClick.apply(this,arguments),this.isValid()&&this.fireEvent(BI.Checkbox.EVENT_CHANGE)},setSelected:function(b){BI.Checkbox.superclass.setSelected.apply(this,arguments),b?this.checkbox.element.addClass("bi-high-light-background"):this.checkbox.element.removeClass("bi-high-light-background")}}),BI.Checkbox.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.checkbox",BI.Checkbox),function(document){var F=function(item){return function(input){var files=input.files||[input];return files.item||(files.item=item),files}}(function(i){return this[i]}),event={add:document.addEventListener?function(node,name,callback){return node.addEventListener(name,callback,!1),this}:function(node,name,callback){return node.attachEvent("on"+name,callback),this},del:document.removeEventListener?function(node,name,callback){return node.removeEventListener(name,callback,!1),this}:function(node,name,callback){return node.detachEvent("on"+name,callback),this},stop:function(e){return e?(e.stopPropagation?e.stopPropagation():e.cancelBubble=!0,e.preventDefault?e.preventDefault():e.returnValue=!1):self.event&&(event.returnValue=!(event.cancelBubble=!0)),!1}},sendFile=function(toString){var multipart=function(boundary,name,file){return"--".concat(boundary,CRLF,'Content-Disposition: form-data; name="',name,'"; filename="',_global.encodeURIComponent(file.fileName),'"',CRLF,"Content-Type: application/octet-stream",CRLF,CRLF,file.getAsBinary(),CRLF,"--",boundary,"--",CRLF)},isFunction=function(Function){return"[object Function]"===toString.call(Function)},split="onabort.onerror.onloadstart.onprogress".split("."),length=split.length,CRLF="\r\n",xhr=this.XMLHttpRequest?new XMLHttpRequest:new ActiveXObject("Microsoft.XMLHTTP"),sendFile;return sendFile=xhr.upload||xhr.sendAsBinary?function(handler,maxSize,width,height){if(-1'),iframe=handler.iframe||(handler.iframe=document.createElement(''))}catch(e){var form=document.createElement("form"),iframe=handler.iframe||(handler.iframe=document.createElement("iframe"));form.setAttribute("enctype","multipart/form-data"),iframe.setAttribute("name",iframe.id=target),iframe.setAttribute("src",url)}with(iframe.style.position="absolute",iframe.style.left=iframe.style.top="-10000px",iframe.onload=onload,iframe.onerror=function(event){isFunction(handler.onerror)&&handler.onerror(rpe,event||_global.event)},iframe.onreadystatechange=function(){/loaded|complete/i.test(iframe.readyState)?onload():isFunction(handler.onloadprogress)&&(rpe.loadedxhr.status||xhr.status>399)return BI.Msg.toast(BI.i18nText("BI-Upload_File_Error"),{level:"error"}),void self.fireEvent(BI.File.EVENT_ERROR);var error=BI.some(_wrap.attach_array,function(index,attach){if(attach.errorCode)return BI.Msg.toast(attach.errorMsg,{level:"error"}),self.fireEvent(BI.File.EVENT_ERROR,attach),!0});!error&&self.fireEvent(BI.File.EVENT_UPLOADED)},1e3)},_wrap.url=o.url,_wrap.fileType=o.accept,_wrap.attach_array=[],_wrap.attach_names=[],_wrap.attachNum=0},_events:function(wrap){var self=this;return event.add(wrap.dom.input,"change",function(){event.del(wrap.dom.input,"change",arguments.callee);for(var input=wrap.dom.input.cloneNode(!0),i=0,files=F(wrap.dom.input);i0&&self.fireEvent(BI.File.EVENT_CHANGE,{files:wrap.files}),input.value="",wrap.dom.input.parentNode.replaceChild(input,wrap.dom.input),wrap.dom.input=input,event.add(wrap.dom.input,"change",arguments.callee)}),wrap},_wrap:function(){var self=this,o=this.options,input=this.element[0];return o.multiple===!0&&this.element.attr("multiple","multiple"),input.value="",this._events({dom:{input:input,disabled:!1},name:input.name,maxSize:o.maxSize?o.maxSize>>0:-1,files:[],clean:function(){this.files=[]},upload:function(handler){if(handler)for(var key in handler)this[key]=handler[key];return sendFiles(this,this.maxSize),this},hide:function(){this.dom.disabled&&(this.dom.disabled=!1,this.dom.input.removeAttribute("disabled"))},show:function(total,current,totalProp,currentProp){this.dom.disabled||(this.dom.disabled=!0,this.dom.input.setAttribute("disabled","disabled"))}})},select:function(){this.wrap&&BI.Widget._renderEngine.createElement(this.wrap.dom.input).click()},upload:function(handler){this.wrap&&this.wrap.upload(handler)},getValue:function(){return this.wrap?this.wrap.attach_array:[]},reset:function(){this.wrap&&(this.wrap.attach_array=[],this.wrap.attach_names=[],this.wrap.attachNum=0)},_setEnable:function(enable){BI.File.superclass._setEnable.apply(this,arguments),enable===!0?this.element.attr("disabled","disabled"):this.element.removeAttr("disabled")}}),BI.File.EVENT_CHANGE="EVENT_CHANGE",BI.File.EVENT_UPLOADSTART="EVENT_UPLOADSTART",BI.File.EVENT_ERROR="EVENT_ERROR",BI.File.EVENT_PROGRESS="EVENT_PROGRESS",BI.File.EVENT_UPLOADED="EVENT_UPLOADED",BI.shortcut("bi.file",BI.File)}(_global.document||{}),BI.Input=BI.inherit(BI.Single,{_defaultConfig:function(){var conf=BI.Input.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{baseCls:(conf.baseCls||"")+" bi-input display-block overflow-dot",tagName:"input",validationChecker:BI.emptyFn,quitChecker:BI.emptyFn,allowBlank:!1})},_init:function(){BI.Input.superclass._init.apply(this,arguments);var self=this,ctrlKey=!1,keyCode=null,inputEventValid=!1,_keydown=BI.debounce(function(keyCode){self.onKeyDown(keyCode,ctrlKey),self._keydown_=!1},300),_clk=BI.debounce(BI.bind(this._click,this),BI.EVENT_RESPONSE_TIME,{leading:!0,trailing:!1});this._focusDebounce=BI.debounce(BI.bind(this._focus,this),BI.EVENT_RESPONSE_TIME,{leading:!0,trailing:!1}),this._blurDebounce=BI.debounce(BI.bind(this._blur,this),BI.EVENT_RESPONSE_TIME,{leading:!0,trailing:!1}),this.element.keydown(function(e){inputEventValid=!1,ctrlKey=e.ctrlKey||e.metaKey,keyCode=e.keyCode,self.fireEvent(BI.Input.EVENT_QUICK_DOWN,arguments)}).keyup(function(e){keyCode=null,inputEventValid&&e.keyCode===BI.KeyCode.ENTER||(self._keydown_=!0,_keydown(e.keyCode))}).on("input propertychange",function(e){var originalEvent=e.originalEvent;(BI.isNull(originalEvent.propertyName)||"value"===originalEvent.propertyName)&&(inputEventValid=!0,self._keydown_=!0,_keydown(keyCode),keyCode=null)}).click(function(e){e.stopPropagation(),_clk()}).mousedown(function(e){self.element.val(self.element.val())}).focus(function(e){self._focusDebounce()}).focusout(function(e){self._blurDebounce()}),(BI.isKey(this.options.value)||BI.isEmptyString(this.options.value))&&this.setValue(this.options.value)},_focus:function(){this.element.addClass("bi-input-focus"),this._checkValidationOnValueChange(),this._isEditing=!0,""==this.getValue()&&(this.fireEvent(BI.Controller.EVENT_CHANGE,BI.Events.EMPTY,this.getValue(),this),this.fireEvent(BI.Input.EVENT_EMPTY)),this.fireEvent(BI.Input.EVENT_FOCUS)},_blur:function(){function blur(){if(self.isValid()||self.options.quitChecker.apply(self,[BI.trim(self.getValue())])===!1||(self.element.val(self._lastValidValue?self._lastValidValue:""),self._checkValidationOnValueChange(),self._defaultState()),self.element.removeClass("bi-input-focus"),self._isEditing=!1,self._start=!1,self.isValid()){var lastValidValue=self._lastValidValue;self._lastValidValue=self.getValue(),self.fireEvent(BI.Controller.EVENT_CHANGE,BI.Events.CONFIRM,self.getValue(),self),self.fireEvent(BI.Input.EVENT_CONFIRM),self._lastValidValue!==lastValidValue&&self.fireEvent(BI.Input.EVENT_CHANGE_CONFIRM)}self.fireEvent(BI.Input.EVENT_BLUR)}var self=this;self._keydown_===!0?BI.delay(blur,300):blur()},_click:function(){this._isEditing!==!0&&(this.selectAll(),this.fireEvent(BI.Input.EVENT_CLICK))},onClick:function(){this._click()},onKeyDown:function(keyCode,ctrlKey){this.isValid()&&BI.trim(this._lastChangedValue)===BI.trim(this.getValue())||this._checkValidationOnValueChange(),this.isValid()&&""!==BI.trim(this.getValue())&&((BI.trim(this.getValue())===this._lastValue||this._start&&null!=this._lastValue&&""!==this._lastValue)&&(this._pause!==!0||/(\s|\u00A0)$/.test(this.getValue()))||(this._start=!0,this._pause=!1,this.fireEvent(BI.Controller.EVENT_CHANGE,BI.Events.STARTEDIT,this.getValue(),this),this.fireEvent(BI.Input.EVENT_START))),keyCode==BI.KeyCode.ENTER&&(this.isValid()||this.options.quitChecker.apply(this,[BI.trim(this.getValue())])!==!1?(this.blur(),this.fireEvent(BI.Input.EVENT_ENTER)):this.fireEvent(BI.Input.EVENT_RESTRICT)),keyCode==BI.KeyCode.SPACE&&this.fireEvent(BI.Input.EVENT_SPACE),keyCode==BI.KeyCode.BACKSPACE&&""==this._lastValue&&this.fireEvent(BI.Input.EVENT_REMOVE),keyCode!=BI.KeyCode.BACKSPACE&&keyCode!=BI.KeyCode.DELETE||this.fireEvent(BI.Input.EVENT_BACKSPACE),this.fireEvent(BI.Input.EVENT_KEY_DOWN,arguments);var lastValue=this._lastValue;BI.trim(this.getValue())!==BI.trim(this._lastValue||"")&&this._valueChange(),BI.isEndWithBlank(this.getValue())?(this._pause=!0,this.fireEvent(BI.Controller.EVENT_CHANGE,BI.Events.PAUSE,"",this),this.fireEvent(BI.Input.EVENT_PAUSE),this._defaultState()):keyCode!==BI.KeyCode.BACKSPACE&&keyCode!==BI.KeyCode.DELETE||""!==BI.trim(this.getValue())||null===lastValue||""===BI.trim(lastValue)||(this.fireEvent(BI.Controller.EVENT_CHANGE,BI.Events.STOPEDIT,this.getValue(),this),this.fireEvent(BI.Input.EVENT_STOP))},_defaultState:function(){""==this.getValue()&&(this.fireEvent(BI.Controller.EVENT_CHANGE,BI.Events.EMPTY,this.getValue(),this),this.fireEvent(BI.Input.EVENT_EMPTY)),this._lastValue=this.getValue(),this._lastSubmitValue=null},_valueChange:function(){this.isValid()&&BI.trim(this.getValue())!==this._lastSubmitValue&&(this.fireEvent(BI.Controller.EVENT_CHANGE,BI.Events.CHANGE,this.getValue(),this),this.fireEvent(BI.Input.EVENT_CHANGE),this._lastSubmitValue=BI.trim(this.getValue())),""==this.getValue()&&(this.fireEvent(BI.Controller.EVENT_CHANGE,BI.Events.EMPTY,this.getValue(),this),this.fireEvent(BI.Input.EVENT_EMPTY)),this._lastValue=this.getValue()},_checkValidationOnValueChange:function(){var o=this.options,v=this.getValue();this.setValid(o.allowBlank===!0&&""==BI.trim(v)||BI.isNotEmptyString(BI.trim(v))&&o.validationChecker.apply(this,[BI.trim(v)])!==!1)},focus:function(){if(!this.element.is(":visible"))throw new Error("input输入框在不可见下不能focus");!this._isEditing==!0&&(this.element.focus(),this.selectAll())},blur:function(){if(!this.element.is(":visible"))throw new Error("input输入框在不可见下不能blur");this._isEditing===!0&&(this.element.blur(),this._blurDebounce())},selectAll:function(){if(!this.element.is(":visible"))throw new Error("input输入框在不可见下不能select");this.element.select(),this._isEditing=!0},setValue:function(textValue){this.element.val(textValue),BI.nextTick(BI.bind(function(){this._checkValidationOnValueChange(),this._defaultState(),this.isValid()&&(this._lastValidValue=this._lastSubmitValue=this.getValue())},this))},getValue:function(){return this.element.val()||""},isEditing:function(){return this._isEditing},getLastValidValue:function(){return this._lastValidValue},getLastChangedValue:function(){return this._lastChangedValue},_setValid:function(){BI.Input.superclass._setValid.apply(this,arguments),this.isValid()?(this._lastChangedValue=this.getValue(),this.element.removeClass("bi-input-error"),this.fireEvent(BI.Input.EVENT_VALID,BI.trim(this.getValue()),this)):(this._lastChangedValue===this.getValue()&&(this._lastChangedValue=null),this.element.addClass("bi-input-error"),this.fireEvent(BI.Input.EVENT_ERROR,BI.trim(this.getValue()),this))},_setEnable:function(b){BI.Input.superclass._setEnable.apply(this,[b]),this.element[0].disabled=!b}}),BI.Input.EVENT_CHANGE="EVENT_CHANGE",BI.Input.EVENT_FOCUS="EVENT_FOCUS",BI.Input.EVENT_CLICK="EVENT_CLICK",BI.Input.EVENT_BLUR="EVENT_BLUR",BI.Input.EVENT_KEY_DOWN="EVENT_KEY_DOWN",BI.Input.EVENT_QUICK_DOWN="EVENT_QUICK_DOWN",BI.Input.EVENT_SPACE="EVENT_SPACE",BI.Input.EVENT_BACKSPACE="EVENT_BACKSPACE",BI.Input.EVENT_START="EVENT_START",BI.Input.EVENT_PAUSE="EVENT_PAUSE",BI.Input.EVENT_STOP="EVENT_STOP",BI.Input.EVENT_CHANGE_CONFIRM="EVENT_CHANGE_CONFIRM",BI.Input.EVENT_CONFIRM="EVENT_CONFIRM",BI.Input.EVENT_REMOVE="EVENT_REMOVE",BI.Input.EVENT_EMPTY="EVENT_EMPTY",BI.Input.EVENT_VALID="EVENT_VALID",BI.Input.EVENT_ERROR="EVENT_ERROR",BI.Input.EVENT_ENTER="EVENT_ENTER",BI.Input.EVENT_RESTRICT="EVENT_RESTRICT",BI.shortcut("bi.input",BI.Input),BI.ImageRadio=BI.inherit(BI.IconButton,{_defaultConfig:function(){var conf=BI.ImageRadio.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{baseCls:(conf.baseCls||"")+" bi-radio radio-icon",selected:!1,handler:BI.emptyFn,width:16,height:16,iconWidth:16,iconHeight:16})},_init:function(){BI.ImageRadio.superclass._init.apply(this,arguments)},doClick:function(){BI.ImageRadio.superclass.doClick.apply(this,arguments),this.isValid()&&this.fireEvent(BI.ImageRadio.EVENT_CHANGE)}}),BI.ImageRadio.EVENT_CHANGE=BI.IconButton.EVENT_CHANGE,BI.shortcut("bi.image_radio",BI.ImageRadio),BI.Radio=BI.inherit(BI.BasicButton,{props:{baseCls:"bi-radio",selected:!1,handler:BI.emptyFn,width:16,height:16,iconWidth:14,iconHeight:14},render:function(){var self=this,o=this.options;return{type:"bi.center_adapt",element:this.element,items:[{type:"bi.layout",cls:"radio-content",ref:function(_ref){self.radio=_ref},width:o.iconWidth,height:o.iconHeight}]}},_setEnable:function(enable){BI.Radio.superclass._setEnable.apply(this,arguments),enable===!0?this.radio.element.removeClass("base-disabled disabled"):this.radio.element.addClass("base-disabled disabled")},doClick:function(){BI.Radio.superclass.doClick.apply(this,arguments),this.isValid()&&this.fireEvent(BI.Radio.EVENT_CHANGE)},setSelected:function(b){BI.Radio.superclass.setSelected.apply(this,arguments),b?this.radio.element.addClass("bi-high-light-background"):this.radio.element.removeClass("bi-high-light-background")}}),BI.Radio.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.radio",BI.Radio),BI.AbstractLabel=BI.inherit(BI.Single,{_defaultConfig:function(props){var conf=BI.AbstractLabel.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{textAlign:"center",whiteSpace:"nowrap",textWidth:null,textHeight:null,hgap:0,vgap:0,lgap:0,rgap:0,tgap:0,bgap:0,text:"",highLight:!1})},_createJson:function(){var o=this.options;return{type:"bi.text",textAlign:o.textAlign,whiteSpace:o.whiteSpace,lineHeight:o.textHeight,text:o.text,value:o.value,py:o.py,keyword:o.keyword,highLight:o.highLight}},_init:function(){BI.AbstractLabel.superclass._init.apply(this,arguments),"center"===this.options.textAlign?this._createCenterEl():this._createNotCenterEl()},_createCenterEl:function(){var o=this.options,json=this._createJson();return json.textAlign="left",BI.isNumber(o.width)&&o.width>0?BI.isNumber(o.textWidth)&&o.textWidth>0?(json.maxWidth=o.textWidth,BI.isNumber(o.height)&&o.height>0?void BI.createWidget({type:"bi.center_adapt",height:o.height,scrollable:"normal"===o.whiteSpace,element:this,items:[{el:this.text=BI.createWidget(json)}]}):void BI.createWidget({type:"bi.center_adapt",scrollable:"normal"===o.whiteSpace,element:this,items:[{el:this.text=BI.createWidget(json)}]})):"normal"==o.whiteSpace?(BI.extend(json,{hgap:o.hgap,vgap:o.vgap,lgap:o.lgap,rgap:o.rgap,tgap:o.tgap,bgap:o.bgap}),this.text=BI.createWidget(json),void BI.createWidget({type:"bi.center_adapt",scrollable:"normal"===o.whiteSpace,element:this,items:[this.text]})):BI.isNumber(o.height)&&o.height>0?(this.element.css({"line-height":o.height+"px"}),json.textAlign=o.textAlign,void(this.text=BI.createWidget(BI.extend(json,{element:this,hgap:o.hgap,vgap:o.vgap,lgap:o.lgap,rgap:o.rgap,tgap:o.tgap,bgap:o.bgap})))):(BI.extend(json,{hgap:o.hgap,vgap:o.vgap,lgap:o.lgap,rgap:o.rgap,tgap:o.tgap,bgap:o.bgap,maxWidth:"100%"}),this.text=BI.createWidget(json),void BI.createWidget({type:"bi.center_adapt",scrollable:"normal"===o.whiteSpace,element:this,items:[this.text]})):BI.isNumber(o.textWidth)&&o.textWidth>0?(json.maxWidth=o.textWidth,void BI.createWidget({type:"bi.center_adapt",scrollable:"normal"===o.whiteSpace,element:this,items:[{el:this.text=BI.createWidget(json)}]})):"normal"==o.whiteSpace?(BI.extend(json,{hgap:o.hgap,vgap:o.vgap,lgap:o.lgap,rgap:o.rgap,tgap:o.tgap,bgap:o.bgap}),this.text=BI.createWidget(json),void BI.createWidget({type:"bi.center_adapt",scrollable:!0,element:this,items:[this.text]})):BI.isNumber(o.height)&&o.height>0?(this.element.css({"line-height":o.height+"px"}),json.textAlign=o.textAlign,void(this.text=BI.createWidget(BI.extend(json,{element:this,hgap:o.hgap,vgap:o.vgap,lgap:o.lgap,rgap:o.rgap,tgap:o.tgap,bgap:o.bgap})))):(BI.extend(json,{hgap:o.hgap,vgap:o.vgap,lgap:o.lgap,rgap:o.rgap,tgap:o.tgap,bgap:o.bgap}),this.text=BI.createWidget(BI.extend(json,{maxWidth:"100%"})),void BI.createWidget({type:"bi.center_adapt",element:this,items:[this.text]}))},_createNotCenterEl:function(){var o=this.options,adaptLayout="right"===o.textAlign?"bi.right_vertical_adapt":"bi.vertical_adapt",json=this._createJson();return BI.isNumber(o.width)&&o.width>0?BI.isNumber(o.textWidth)&&o.textWidth>0?(json.width=o.textWidth,BI.isNumber(o.height)&&o.height>0?void BI.createWidget({type:adaptLayout,height:o.height,scrollable:"normal"===o.whiteSpace,element:this,items:[{el:this.text=BI.createWidget(json)}]}):void BI.createWidget({type:adaptLayout,scrollable:"normal"===o.whiteSpace,hgap:o.hgap,vgap:o.vgap,lgap:o.lgap,rgap:o.rgap,tgap:o.tgap,bgap:o.bgap,element:this,items:[{el:this.text=BI.createWidget(json)}]})):BI.isNumber(o.height)&&o.height>0?(this.text=BI.createWidget(BI.extend(json,{element:this,hgap:o.hgap,vgap:o.vgap,lgap:o.lgap,rgap:o.rgap,tgap:o.tgap,bgap:o.bgap})),void("normal"!==o.whiteSpace&&this.element.css({"line-height":o.height-2*o.vgap+"px"}))):(json.width=o.width-2*o.hgap-o.lgap-o.rgap,void BI.createWidget({type:adaptLayout,scrollable:"normal"===o.whiteSpace,hgap:o.hgap,vgap:o.vgap,lgap:o.lgap,rgap:o.rgap,tgap:o.tgap,bgap:o.bgap,element:this,items:[{el:this.text=BI.createWidget(json)}]})):BI.isNumber(o.textWidth)&&o.textWidth>0?(json.width=o.textWidth,void BI.createWidget({type:adaptLayout,scrollable:"normal"===o.whiteSpace,hgap:o.hgap,vgap:o.vgap,lgap:o.lgap,rgap:o.rgap,tgap:o.tgap,bgap:o.bgap,element:this,items:[{el:this.text=BI.createWidget(json)}]})):BI.isNumber(o.height)&&o.height>0?("normal"!==o.whiteSpace&&this.element.css({"line-height":o.height-2*o.vgap+"px"}),void(this.text=BI.createWidget(BI.extend(json,{element:this,hgap:o.hgap,vgap:o.vgap,lgap:o.lgap,rgap:o.rgap,tgap:o.tgap,bgap:o.bgap})))):(BI.extend(json,{hgap:o.hgap,vgap:o.vgap,lgap:o.lgap,rgap:o.rgap,tgap:o.tgap,bgap:o.bgap}),this.text=BI.createWidget(BI.extend(json,{maxWidth:"100%"})),void BI.createWidget({type:adaptLayout,element:this,items:[this.text]}))},doRedMark:function(){this.text.doRedMark.apply(this.text,arguments)},unRedMark:function(){this.text.unRedMark.apply(this.text,arguments)},doHighLight:function(){this.text.doHighLight.apply(this.text,arguments)},unHighLight:function(){this.text.unHighLight.apply(this.text,arguments)},setText:function(v){this.options.text=v,this.text.setText(v)},getText:function(){return this.options.text},setStyle:function(css){this.text.setStyle(css)},setValue:function(v){BI.AbstractLabel.superclass.setValue.apply(this,arguments),this.isReadOnly()||this.text.setValue(v)},populate:function(){BI.AbstractLabel.superclass.populate.apply(this,arguments)}}),BI.HtmlLabel=BI.inherit(BI.AbstractLabel,{props:{baseCls:"bi-html-label"},_createJson:function(){var o=this.options;return{type:"bi.html",textAlign:o.textAlign,whiteSpace:o.whiteSpace,lineHeight:o.textHeight,text:o.text,value:o.value}}}),BI.shortcut("bi.html_label",BI.HtmlLabel),BI.IconLabel=BI.inherit(BI.Single,{props:{baseCls:"bi-icon-label horizon-center",iconWidth:null,iconHeight:null},_init:function(){BI.IconLabel.superclass._init.apply(this,arguments);var o=this.options;this.element.css({textAlign:"center"}),this.icon=BI.createWidget({type:"bi.icon",width:o.iconWidth,height:o.iconHeight}),BI.isNumber(o.height)&&o.height>0&&BI.isNull(o.iconWidth)&&BI.isNull(o.iconHeight)?(this.element.css("lineHeight",o.height+"px"),BI.createWidget({type:"bi.default",element:this,items:[this.icon]})):(this.element.css("lineHeight","1"),BI.createWidget({element:this,type:"bi.center_adapt",items:[this.icon]}))}}),BI.shortcut("bi.icon_label",BI.IconLabel),BI.Label=BI.inherit(BI.AbstractLabel,{props:{baseCls:"bi-label",py:"",keyword:""},_createJson:function(){var o=this.options;return{type:"bi.text",textAlign:o.textAlign,whiteSpace:o.whiteSpace,lineHeight:o.textHeight,text:o.text,value:o.value,py:o.py,keyword:o.keyword,highLight:o.highLight}},doRedMark:function(){this.text.doRedMark.apply(this.text,arguments)},unRedMark:function(){this.text.unRedMark.apply(this.text,arguments)}}),BI.shortcut("bi.label",BI.Label),BI.Link=BI.inherit(BI.Label,{_defaultConfig:function(){var conf=BI.Link.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{baseCls:(conf.baseCls||"")+" bi-link display-block",tagName:"a",href:"",target:"_blank"})},_createJson:function(){var o=this.options;return{type:"bi.a",textAlign:o.textAlign,whiteSpace:o.whiteSpace,lineHeight:o.textHeight,text:o.text,keyword:o.keyword,value:o.value,py:o.py,href:o.href,target:o.target}},_init:function(){BI.Link.superclass._init.apply(this,arguments)}}),BI.shortcut("bi.link",BI.Link),BI.Bubble=BI.inherit(BI.Tip,{_defaultConfig:function(){return BI.extend(BI.Bubble.superclass._defaultConfig.apply(this,arguments),{extraCls:"bi-bubble",direction:"top",text:"",level:"error",height:18})},_init:function(){BI.Bubble.superclass._init.apply(this,arguments);var fn=function(e){return e.stopPropagation(),e.stopEvent(),!1};this.element.bind({click:fn,mousedown:fn,mouseup:fn,mouseover:fn,mouseenter:fn,mouseleave:fn,mousemove:fn}),BI.createWidget({type:"bi.left",element:this,items:[this["_"+this.options.direction]()]})},_createBubbleText:function(){var o=this.options;return this.text=BI.createWidget({type:"bi.label",cls:"bubble-text bubble-"+o.level,text:o.text,hgap:5,height:18})},_top:function(){return BI.createWidget({type:"bi.vertical",items:[{el:this._createBubbleText(),height:18},{el:{type:"bi.layout"},height:3}]})},_bottom:function(){return BI.createWidget({type:"bi.vertical",items:[{el:{type:"bi.layout"},height:3},{el:this._createBubbleText(),height:18}]})},_left:function(){return BI.createWidget({type:"bi.right",items:[{el:{type:"bi.layout",width:3,height:18}},{el:this._createBubbleText()}]})},_right:function(){return BI.createWidget({type:"bi.left",items:[{el:{type:"bi.layout",width:3,height:18}},{el:this._createBubbleText()}]})},setText:function(text){this.text.setText(text)}}),BI.shortcut("bi.bubble",BI.Bubble),BI.Toast=BI.inherit(BI.Tip,{_const:{minWidth:200,hgap:10},_defaultConfig:function(){return BI.extend(BI.Toast.superclass._defaultConfig.apply(this,arguments),{extraCls:"bi-toast",text:"",level:"success"})},_init:function(){BI.Toast.superclass._init.apply(this,arguments);var self=this,o=this.options;this.element.css({minWidth:this._const.minWidth+"px"}),this.element.addClass("toast-"+o.level);var fn=function(e){return e.stopPropagation(),e.stopEvent(),!1};this.element.bind({click:fn,mousedown:fn,mouseup:fn,mouseover:fn,mouseenter:fn,mouseleave:fn,mousemove:fn});var cls="close-font";switch(o.level){case"success":cls="toast-success-font";break;case"error":cls="toast-error-font";break;case"warning":cls="toast-warning-font";break;case"normal":default:cls="toast-message-font"}var items=[{type:"bi.icon_label",cls:cls+" toast-icon",width:36},{el:{type:"bi.label",whiteSpace:"normal",text:o.text,textHeight:16,textAlign:"left"},rgap:o.autoClose?this._const.hgap:0}],columnSize=[36,""];o.autoClose===!1&&(items.push({type:"bi.icon_button",cls:"close-font toast-icon",handler:function(){self.destroy()},width:36}),columnSize.push(36)),this.text=BI.createWidget({type:"bi.horizontal_adapt",element:this,items:items,vgap:7,columnSize:columnSize})},setText:function(text){this.text.setText(text)},beforeDestroy:function(){this.fireEvent(BI.Toast.EVENT_DESTORY)}}),BI.Toast.EVENT_DESTORY="EVENT_DESTORY",BI.shortcut("bi.toast",BI.Toast),BI.Tooltip=BI.inherit(BI.Tip,{_const:{hgap:5,vgap:3},_defaultConfig:function(){return BI.extend(BI.Tooltip.superclass._defaultConfig.apply(this,arguments),{extraCls:"bi-tooltip",text:"",level:"success",stopEvent:!1,stopPropagation:!1})},_init:function(){BI.Tooltip.superclass._init.apply(this,arguments);var self=this,o=this.options;this.element.addClass("tooltip-"+o.level);var fn=function(e){o.stopPropagation&&e.stopPropagation(),o.stopEvent&&e.stopEvent()};this.element.bind({click:fn,mousedown:fn,mouseup:fn,mouseover:fn,mouseenter:fn,mouseleave:fn,mousemove:fn});var texts=(o.text+"").split("\n");texts.length>1?BI.createWidget({type:"bi.vertical",element:this,hgap:this._const.hgap,items:BI.map(texts,function(i,text){return{type:"bi.label",textAlign:"left",whiteSpace:"normal",text:text,textHeight:18}})}):this.text=BI.createWidget({type:"bi.label",element:this,textAlign:"left",whiteSpace:"normal",text:o.text,textHeight:18,hgap:this._const.hgap})},setWidth:function(width){this.element.width(width-2*this._const.hgap)},setText:function(text){this.text&&this.text.setText(text)},setLevel:function(level){this.element.removeClass("tooltip-success").removeClass("tooltip-warning"),this.element.addClass("tooltip-"+level)}}),BI.shortcut("bi.tooltip",BI.Tooltip),BI.Trigger=BI.inherit(BI.Single,{_defaultConfig:function(){var conf=BI.Trigger.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{_baseCls:(conf._baseCls||"")+" bi-trigger cursor-pointer",height:24})},_init:function(){BI.Trigger.superclass._init.apply(this,arguments)},setKey:function(){},getKey:function(){}}),BI.CustomTree=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.CustomTree.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-custom-tree",expander:{el:{},popup:{type:"bi.custom_tree"}},items:[],itemsCreator:BI.emptyFn,el:{type:"bi.button_tree",chooseType:0,layouts:[{type:"bi.vertical"}]}})},_init:function(){BI.CustomTree.superclass._init.apply(this,arguments),this.initTree(this.options.items)},_formatItems:function(nodes){var self=this,o=this.options;nodes=BI.Tree.transformToTreeFormat(nodes);var items=[];return BI.each(nodes,function(i,node){if(BI.isNotEmptyArray(node.children)||node.isParent===!0){var item=BI.extend({type:"bi.expander",el:{value:node.value},popup:{type:"bi.custom_tree"}},BI.deepClone(o.expander),{id:node.id,pId:node.pId}),el=BI.stripEL(node);BI.isWidget(el)?item.el=el:(el=BI.clone(el),delete el.children,BI.extend(item.el,el)),item.popup.expander=BI.deepClone(o.expander),item.items=item.popup.items=node.children,item.itemsCreator=item.popup.itemsCreator=function(op){if(BI.isNotNull(op.node))return o.itemsCreator.apply(self,arguments);var args=Array.prototype.slice.call(arguments,0);return args[0].node=node,o.itemsCreator.apply(self,args)},BI.isNull(item.popup.el)&&(item.popup.el=BI.deepClone(o.el)),items.push(item)}else items.push(node)}),items},initTree:function(nodes){var self=this,o=this.options;this.tree=BI.createWidget(o.el,{element:this,items:this._formatItems(nodes),itemsCreator:function(op,callback){o.itemsCreator.apply(this,[op,function(items){var args=Array.prototype.slice.call(arguments,0);args[0]=self._formatItems(items),callback.apply(null,args)}])},value:o.value}),this.tree.on(BI.Controller.EVENT_CHANGE,function(type,val,obj){self.fireEvent(BI.Controller.EVENT_CHANGE,arguments),type===BI.Events.CLICK&&self.fireEvent(BI.CustomTree.EVENT_CHANGE,val,obj)})},stroke:function(nodes){this.populate.apply(this,arguments)},populate:function(nodes){var args=Array.prototype.slice.call(arguments,0);arguments.length>0&&(args[0]=this._formatItems(nodes)),this.tree.populate.apply(this.tree,args)},setValue:function(v){this.tree&&this.tree.setValue(v)},getValue:function(){return this.tree?this.tree.getValue():[]},getAllButtons:function(){return this.tree?this.tree.getAllButtons():[]},getAllLeaves:function(){return this.tree?this.tree.getAllLeaves():[]},getNodeById:function(id){return this.tree&&this.tree.getNodeById(id)},getNodeByValue:function(id){return this.tree&&this.tree.getNodeByValue(id)},empty:function(){this.tree.empty()}}),BI.CustomTree.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.custom_tree",BI.CustomTree),function($){var settings={},roots={},caches={},_consts={className:{BUTTON:"button",LEVEL:"level",ICO_LOADING:"ico_loading",SWITCH:"switch"},event:{NODECREATED:"ztree_nodeCreated",CLICK:"ztree_click",EXPAND:"ztree_expand",COLLAPSE:"ztree_collapse",ASYNC_SUCCESS:"ztree_async_success",ASYNC_ERROR:"ztree_async_error",REMOVE:"ztree_remove",SELECTED:"ztree_selected",UNSELECTED:"ztree_unselected"},id:{A:"_a",ICON:"_ico",SPAN:"_span",SWITCH:"_switch",UL:"_ul"},line:{ROOT:"root",ROOTS:"roots",CENTER:"center",BOTTOM:"bottom",NOLINE:"noline",LINE:"line"},folder:{OPEN:"open",CLOSE:"close",DOCU:"docu"},node:{CURSELECTED:"curSelectedNode"}},_setting={treeId:"",treeObj:null,view:{addDiyDom:null,autoCancelSelected:!0,dblClickExpand:!0,expandSpeed:"fast", +fontCss:{},nameIsHTML:!1,selectedMulti:!0,showIcon:!0,showLine:!0,showTitle:!0,txtSelectedEnable:!1},data:{key:{children:"children",name:"name",title:"",url:"url"},simpleData:{enable:!1,idKey:"id",pIdKey:"pId",rootPId:null},keep:{parent:!1,leaf:!1}},async:{enable:!1,contentType:"application/x-www-form-urlencoded",type:"post",dataType:"text",url:"",autoParam:[],otherParam:[],dataFilter:null},callback:{beforeAsync:null,beforeClick:null,beforeDblClick:null,beforeRightClick:null,beforeMouseDown:null,beforeMouseUp:null,beforeExpand:null,beforeCollapse:null,beforeRemove:null,onAsyncError:null,onAsyncSuccess:null,onNodeCreated:null,onClick:null,onDblClick:null,onRightClick:null,onMouseDown:null,onMouseUp:null,onExpand:null,onCollapse:null,onRemove:null}},_initRoot=function(setting){var r=data.getRoot(setting);r||(r={},data.setRoot(setting,r)),r[setting.data.key.children]=[],r.expandTriggerFlag=!1,r.curSelectedList=[],r.noSelection=!0,r.createdNodes=[],r.zId=0,r._ver=(new Date).getTime()},_initCache=function(setting){var c=data.getCache(setting);c||(c={},data.setCache(setting,c)),c.nodes=[],c.doms=[]},_bindEvent=function(setting){var o=setting.treeObj,c=consts.event;o.bind(c.NODECREATED,function(event,treeId,node){tools.apply(setting.callback.onNodeCreated,[event,treeId,node])}),o.bind(c.CLICK,function(event,srcEvent,treeId,node,clickFlag){tools.apply(setting.callback.onClick,[srcEvent,treeId,node,clickFlag])}),o.bind(c.EXPAND,function(event,treeId,node){tools.apply(setting.callback.onExpand,[event,treeId,node])}),o.bind(c.COLLAPSE,function(event,treeId,node){tools.apply(setting.callback.onCollapse,[event,treeId,node])}),o.bind(c.ASYNC_SUCCESS,function(event,treeId,node,msg){tools.apply(setting.callback.onAsyncSuccess,[event,treeId,node,msg])}),o.bind(c.ASYNC_ERROR,function(event,treeId,node,XMLHttpRequest,textStatus,errorThrown){tools.apply(setting.callback.onAsyncError,[event,treeId,node,XMLHttpRequest,textStatus,errorThrown])}),o.bind(c.REMOVE,function(event,treeId,treeNode){tools.apply(setting.callback.onRemove,[event,treeId,treeNode])}),o.bind(c.SELECTED,function(event,srcEvent,treeId,node){tools.apply(setting.callback.onSelected,[srcEvent,treeId,node])}),o.bind(c.UNSELECTED,function(event,srcEvent,treeId,node){tools.apply(setting.callback.onUnSelected,[srcEvent,treeId,node])})},_unbindEvent=function(setting){var o=setting.treeObj,c=consts.event;o.unbind(c.NODECREATED).unbind(c.CLICK).unbind(c.EXPAND).unbind(c.COLLAPSE).unbind(c.ASYNC_SUCCESS).unbind(c.ASYNC_ERROR).unbind(c.REMOVE).unbind(c.SELECTED).unbind(c.UNSELECTED)},_eventProxy=function(event){var target=event.target,setting=data.getSetting(event.data.treeId),tId="",node=null,nodeEventType="",treeEventType="",nodeEventCallback=null,treeEventCallback=null,tmp=null;if(tools.eqs(event.type,"mousedown")?treeEventType="mousedown":tools.eqs(event.type,"mouseup")?treeEventType="mouseup":tools.eqs(event.type,"contextmenu")?treeEventType="contextmenu":tools.eqs(event.type,"click")?tools.eqs(target.tagName,"span")&&null!==target.getAttribute("treeNode"+consts.id.SWITCH)?(tId=tools.getNodeMainDom(target).id,nodeEventType="switchNode"):(tmp=tools.getMDom(setting,target,[{tagName:"a",attrName:"treeNode"+consts.id.A}]),tmp&&(tId=tools.getNodeMainDom(tmp).id,nodeEventType="clickNode")):tools.eqs(event.type,"dblclick")&&(treeEventType="dblclick",tmp=tools.getMDom(setting,target,[{tagName:"a",attrName:"treeNode"+consts.id.A}]),tmp&&(tId=tools.getNodeMainDom(tmp).id,nodeEventType="switchNode")),treeEventType.length>0&&0==tId.length&&(tmp=tools.getMDom(setting,target,[{tagName:"a",attrName:"treeNode"+consts.id.A}]),tmp&&(tId=tools.getNodeMainDom(tmp).id)),tId.length>0)switch(node=data.getNodeCache(setting,tId),nodeEventType){case"switchNode":node.isParent&&(tools.eqs(event.type,"click")||tools.eqs(event.type,"dblclick")&&tools.apply(setting.view.dblClickExpand,[setting.treeId,node],setting.view.dblClickExpand))?nodeEventCallback=handler.onSwitchNode:nodeEventType="";break;case"clickNode":nodeEventCallback=handler.onClickNode}switch(treeEventType){case"mousedown":treeEventCallback=handler.onZTreeMousedown;break;case"mouseup":treeEventCallback=handler.onZTreeMouseup;break;case"dblclick":treeEventCallback=handler.onZTreeDblclick;break;case"contextmenu":treeEventCallback=handler.onZTreeContextmenu}var proxyResult={stop:!1,node:node,nodeEventType:nodeEventType,nodeEventCallback:nodeEventCallback,treeEventType:treeEventType,treeEventCallback:treeEventCallback};return proxyResult},_initNode=function(setting,level,n,parentNode,isFirstNode,isLastNode,openFlag){if(n){var r=data.getRoot(setting),childKey=setting.data.key.children;n.level=level,n.tId=setting.treeId+"_"+ ++r.zId,n.parentTId=parentNode?parentNode.tId:null,n.open="string"==typeof n.open?tools.eqs(n.open,"true"):!!n.open,n[childKey]&&n[childKey].length>0?(n.isParent=!0,n.zAsync=!0):(n.isParent="string"==typeof n.isParent?tools.eqs(n.isParent,"true"):!!n.isParent,n.open=!(!n.isParent||setting.async.enable)&&n.open,n.zAsync=!n.isParent),n.isFirstNode=isFirstNode,n.isLastNode=isLastNode,n.getParentNode=function(){return data.getNodeCache(setting,n.parentTId)},n.getPreNode=function(){return data.getPreNode(setting,n)},n.getNextNode=function(){return data.getNextNode(setting,n)},n.isAjaxing=!1,data.fixPIdKeyValue(setting,n)}},_init={bind:[_bindEvent],unbind:[_unbindEvent],caches:[_initCache],nodes:[_initNode],proxys:[_eventProxy],roots:[_initRoot],beforeA:[],afterA:[],innerBeforeA:[],innerAfterA:[],zTreeTools:[]},data={addNodeCache:function(setting,node){data.getCache(setting).nodes[data.getNodeCacheId(node.tId)]=node},getNodeCacheId:function(tId){return tId.substring(tId.lastIndexOf("_")+1)},addAfterA:function(afterA){_init.afterA.push(afterA)},addBeforeA:function(beforeA){_init.beforeA.push(beforeA)},addInnerAfterA:function(innerAfterA){_init.innerAfterA.push(innerAfterA)},addInnerBeforeA:function(innerBeforeA){_init.innerBeforeA.push(innerBeforeA)},addInitBind:function(bindEvent){_init.bind.push(bindEvent)},addInitUnBind:function(unbindEvent){_init.unbind.push(unbindEvent)},addInitCache:function(initCache){_init.caches.push(initCache)},addInitNode:function(initNode){_init.nodes.push(initNode)},addInitProxy:function(initProxy,isFirst){isFirst?_init.proxys.splice(0,0,initProxy):_init.proxys.push(initProxy)},addInitRoot:function(initRoot){_init.roots.push(initRoot)},addNodesData:function(setting,parentNode,nodes){var childKey=setting.data.key.children;parentNode[childKey]||(parentNode[childKey]=[]),parentNode[childKey].length>0&&(parentNode[childKey][parentNode[childKey].length-1].isLastNode=!1,view.setNodeLineIcos(setting,parentNode[childKey][parentNode[childKey].length-1])),parentNode.isParent=!0,parentNode[childKey]=parentNode[childKey].concat(nodes)},addSelectedNode:function(setting,node){var root=data.getRoot(setting);data.isSelectedNode(setting,node)||root.curSelectedList.push(node)},addCreatedNode:function(setting,node){if(setting.callback.onNodeCreated||setting.view.addDiyDom){var root=data.getRoot(setting);root.createdNodes.push(node)}},addZTreeTools:function(zTreeTools){_init.zTreeTools.push(zTreeTools)},exSetting:function(s){$.extend(!0,_setting,s)},fixPIdKeyValue:function(setting,node){setting.data.simpleData.enable&&(node[setting.data.simpleData.pIdKey]=node.parentTId?node.getParentNode()[setting.data.simpleData.idKey]:setting.data.simpleData.rootPId)},getAfterA:function(setting,node,array){for(var i=0,j=_init.afterA.length;i-1&&result.push(nodes[i]),result=result.concat(data.getNodesByParamFuzzy(setting,nodes[i][childKey],key,value));return result},getNodesByFilter:function(setting,nodes,filter,isSingle,invokeParam){if(!nodes)return isSingle?null:[];for(var childKey=setting.data.key.children,result=isSingle?null:[],i=0,l=nodes.length;i0)},clone:function(obj){if(null===obj)return null;var o=tools.isArray(obj)?[]:{};for(var i in obj)o[i]=obj[i]instanceof Date?new Date(obj[i].getTime()):"object"==typeof obj[i]?arguments.callee(obj[i]):obj[i];return o},eqs:function(str1,str2){return str1.toLowerCase()===str2.toLowerCase()},isArray:function(arr){return"[object Array]"===Object.prototype.toString.apply(arr)},$:function(node,exp,setting){return exp&&"string"!=typeof exp&&(setting=exp,exp=""),"string"==typeof node?$(node,setting?setting.treeObj.get(0).ownerDocument:null):$("#"+node.tId+exp,setting?setting.treeObj:null)},getMDom:function(setting,curDom,targetExpr){if(!curDom)return null;for(;curDom&&curDom.id!==setting.treeId;){for(var i=0,l=targetExpr.length;curDom.tagName&&i0},uCanDo:function(setting,e){return!0}},view={addNodes:function(setting,parentNode,newNodes,isSilent){if(!setting.data.keep.leaf||!parentNode||parentNode.isParent)if(tools.isArray(newNodes)||(newNodes=[newNodes]),setting.data.simpleData.enable&&(newNodes=data.transformTozTreeFormat(setting,newNodes)),parentNode){var target_switchObj=$$(parentNode,consts.id.SWITCH,setting),target_icoObj=$$(parentNode,consts.id.ICON,setting),target_ulObj=$$(parentNode,consts.id.UL,setting);parentNode.open||(view.replaceSwitchClass(parentNode,target_switchObj,consts.folder.CLOSE),view.replaceIcoClass(parentNode,target_icoObj,consts.folder.CLOSE),parentNode.open=!1,target_ulObj.css({display:"none"})),data.addNodesData(setting,parentNode,newNodes),view.createNodes(setting,parentNode.level+1,newNodes,parentNode),isSilent||view.expandCollapseParentNode(setting,parentNode,!0)}else data.addNodesData(setting,data.getRoot(setting),newNodes),view.createNodes(setting,0,newNodes,null)},appendNodes:function(setting,level,nodes,parentNode,initFlag,openFlag){if(!nodes)return[];for(var html=[],childKey=setting.data.key.children,i=0,l=nodes.length;i0&&(childHtml=view.appendNodes(setting,level+1,node[childKey],node,initFlag,openFlag&&node.open)),openFlag&&(view.makeDOMNodeMainBefore(html,setting,node),view.makeDOMNodeLine(html,setting,node),data.getBeforeA(setting,node,html),view.makeDOMNodeNameBefore(html,setting,node),data.getInnerBeforeA(setting,node,html),view.makeDOMNodeIcon(html,setting,node),data.getInnerAfterA(setting,node,html),view.makeDOMNodeNameAfter(html,setting,node),data.getAfterA(setting,node,html),node.isParent&&node.open&&view.makeUlHtml(setting,node,html,childHtml.join("")),view.makeDOMNodeMainAfter(html,setting,node),data.addCreatedNode(setting,node))}return html},appendParentULDom:function(setting,node){var html=[],nObj=$$(node,setting);!nObj.get(0)&&node.parentTId&&(view.appendParentULDom(setting,node.getParentNode()),nObj=$$(node,setting));var ulObj=$$(node,consts.id.UL,setting);ulObj.get(0)&&ulObj.remove();var childKey=setting.data.key.children,childHtml=view.appendNodes(setting,node.level+1,node[childKey],node,!1,!0);view.makeUlHtml(setting,node,html,childHtml.join("")),nObj.append(html.join(""))},asyncNode:function(setting,node,isSilent,callback){var i,l;if(node&&!node.isParent)return tools.apply(callback),!1;if(node&&node.isAjaxing)return!1;if(0==tools.apply(setting.callback.beforeAsync,[setting.treeId,node],!0))return tools.apply(callback),!1;if(node){node.isAjaxing=!0;var icoObj=$$(node,consts.id.ICON,setting);icoObj.attr({style:"","class":consts.className.BUTTON+" "+consts.className.ICO_LOADING})}var tmpParam={};for(i=0,l=setting.async.autoParam.length;node&&i1&&(spKey=pKey[1],pKey=pKey[0]),tmpParam[spKey]=node[pKey]}if(tools.isArray(setting.async.otherParam))for(i=0,l=setting.async.otherParam.length;i=0;i--)if(n=list[i],node===n||!node&&(!excludeNode||excludeNode!==n)){if($$(n,consts.id.A,setting).removeClass(consts.node.CURSELECTED),node){data.removeSelectedNode(setting,node),setting.treeObj.trigger(consts.event.UNSELECTED,[event,setting.treeId,n]);break}list.splice(i,1),setting.treeObj.trigger(consts.event.UNSELECTED,[event,setting.treeId,n])}},createNodeCallback:function(setting){if(setting.callback.onNodeCreated||setting.view.addDiyDom)for(var root=data.getRoot(setting);root.createdNodes.length>0;){var node=root.createdNodes.shift();tools.apply(setting.view.addDiyDom,[setting.treeId,node]),setting.callback.onNodeCreated&&setting.treeObj.trigger(consts.event.NODECREATED,[setting.treeId,node])}},createNodes:function(setting,level,nodes,parentNode){if(nodes&&0!=nodes.length){var root=data.getRoot(setting),childKey=setting.data.key.children,openFlag=!parentNode||parentNode.open||!!$$(parentNode[childKey][0],setting).get(0);root.createdNodes=[];var zTreeHtml=view.appendNodes(setting,level,nodes,parentNode,!0,openFlag);if(parentNode){var ulObj=$$(parentNode,consts.id.UL,setting);ulObj.get(0)&&ulObj.append(zTreeHtml.join(""))}else setting.treeObj.append(zTreeHtml.join(""));view.createNodeCallback(setting)}},destroy:function(setting){setting&&(data.initCache(setting),data.initRoot(setting),event.unbindTree(setting),event.unbindEvent(setting),setting.treeObj.empty(),delete settings[setting.treeId])},expandCollapseNode:function(setting,node,expandFlag,animateFlag,callback){var root=data.getRoot(setting),childKey=setting.data.key.children;if(!node)return void tools.apply(callback,[]);if(root.expandTriggerFlag){var _callback=callback;callback=function(){_callback&&_callback(),node.open?setting.treeObj.trigger(consts.event.EXPAND,[setting.treeId,node]):setting.treeObj.trigger(consts.event.COLLAPSE,[setting.treeId,node])},root.expandTriggerFlag=!1}if(!node.open&&node.isParent&&(!$$(node,consts.id.UL,setting).get(0)||node[childKey]&&node[childKey].length>0&&!$$(node[childKey][0],setting).get(0))&&(view.appendParentULDom(setting,node),view.createNodeCallback(setting)),node.open==expandFlag)return void tools.apply(callback,[]);var ulObj=$$(node,consts.id.UL,setting),switchObj=$$(node,consts.id.SWITCH,setting),icoObj=$$(node,consts.id.ICON,setting);node.isParent?(node.open=!node.open,node.iconOpen&&node.iconClose&&icoObj.attr("style",view.makeNodeIcoStyle(setting,node)),node.open?(view.replaceSwitchClass(node,switchObj,consts.folder.OPEN),view.replaceIcoClass(node,icoObj,consts.folder.OPEN),0==animateFlag||""==setting.view.expandSpeed?(ulObj.show(),tools.apply(callback,[])):node[childKey]&&node[childKey].length>0?ulObj.slideDown(setting.view.expandSpeed,callback):(ulObj.show(),tools.apply(callback,[]))):(view.replaceSwitchClass(node,switchObj,consts.folder.CLOSE),view.replaceIcoClass(node,icoObj,consts.folder.CLOSE),0!=animateFlag&&""!=setting.view.expandSpeed&&node[childKey]&&node[childKey].length>0?ulObj.slideUp(setting.view.expandSpeed,callback):(ulObj.hide(),tools.apply(callback,[])))):tools.apply(callback,[])},expandCollapseParentNode:function(setting,node,expandFlag,animateFlag,callback){if(node){if(!node.parentTId)return void view.expandCollapseNode(setting,node,expandFlag,animateFlag,callback);view.expandCollapseNode(setting,node,expandFlag,animateFlag),node.parentTId&&view.expandCollapseParentNode(setting,node.getParentNode(),expandFlag,animateFlag,callback)}},expandCollapseSonNode:function(setting,node,expandFlag,animateFlag,callback){var root=data.getRoot(setting),childKey=setting.data.key.children,treeNodes=node?node[childKey]:root[childKey],selfAnimateSign=!node&&animateFlag,expandTriggerFlag=data.getRoot(setting).expandTriggerFlag;if(data.getRoot(setting).expandTriggerFlag=!1,treeNodes)for(var i=0,l=treeNodes.length;i=0;i--)if(node===list[i])return!0;return!1},makeDOMNodeIcon:function(html,setting,node){var nameStr=data.getNodeName(setting,node),name=setting.view.nameIsHTML?nameStr:nameStr.replace(/&/g,"&").replace(//g,">");html.push("",name,"")},makeDOMNodeLine:function(html,setting,node){html.push("")},makeDOMNodeMainAfter:function(html,setting,node){html.push("")},makeDOMNodeMainBefore:function(html,setting,node){html.push("
  • ")},makeDOMNodeNameAfter:function(html,setting,node){html.push("")},makeDOMNodeNameBefore:function(html,setting,node){var title=data.getNodeTitle(setting,node),url=view.makeNodeUrl(setting,node),fontcss=view.makeNodeFontCss(setting,node),fontStyle=[];for(var f in fontcss)fontStyle.push(f,":",fontcss[f],";");html.push("0?"href='"+url+"'":""," target='",view.makeNodeTarget(node),"' style='",fontStyle.join(""),"'"),tools.apply(setting.view.showTitle,[setting.treeId,node],setting.view.showTitle)&&title&&html.push("title='",title.replace(/'/g,"'").replace(//g,">"),"'"),html.push(">")},makeNodeFontCss:function(setting,node){var fontCss=tools.apply(setting.view.fontCss,[setting.treeId,node],setting.view.fontCss);return fontCss&&"function"!=typeof fontCss?fontCss:{}},makeNodeIcoClass:function(setting,node){var icoCss=["ico"];return node.isAjaxing||(icoCss[0]=(node.iconSkin?node.iconSkin+"_":"")+icoCss[0],node.isParent?icoCss.push(node.open?consts.folder.OPEN:consts.folder.CLOSE):icoCss.push(consts.folder.DOCU)),consts.className.BUTTON+" "+icoCss.join("_")},makeNodeIcoStyle:function(setting,node){var icoStyle=[];if(!node.isAjaxing){var icon=node.isParent&&node.iconOpen&&node.iconClose?node.open?node.iconOpen:node.iconClose:node.icon;icon&&icoStyle.push("background:url(",icon,") 0 0 no-repeat;"),0!=setting.view.showIcon&&tools.apply(setting.view.showIcon,[setting.treeId,node],!0)||icoStyle.push("width:0px;height:0px;")}return icoStyle.join("")},makeNodeLineClass:function(setting,node){var lineClass=[];return setting.view.showLine?0==node.level&&node.isFirstNode&&node.isLastNode?lineClass.push(consts.line.ROOT):0==node.level&&node.isFirstNode?lineClass.push(consts.line.ROOTS):node.isLastNode?lineClass.push(consts.line.BOTTOM):lineClass.push(consts.line.CENTER):lineClass.push(consts.line.NOLINE),node.isParent?lineClass.push(node.open?consts.folder.OPEN:consts.folder.CLOSE):lineClass.push(consts.folder.DOCU),view.makeNodeLineClassEx(node)+lineClass.join("_")},makeNodeLineClassEx:function(node){return consts.className.BUTTON+" "+consts.className.LEVEL+node.level+" "+consts.className.SWITCH+" "},makeNodeTarget:function(node){return node.target||"_blank"},makeNodeUrl:function(setting,node){var urlKey=setting.data.key.url;return node[urlKey]?node[urlKey]:null},makeUlHtml:function(setting,node,html,content){html.push("
      "),html.push(content),html.push("
    ")},makeUlLineClass:function(setting,node){return setting.view.showLine&&!node.isLastNode?consts.line.LINE:""},removeChildNodes:function(setting,node){if(node){var childKey=setting.data.key.children,nodes=node[childKey];if(nodes){for(var i=0,l=nodes.length;i0&&(parentNode[childKey][0].isFirstNode=!0)},setLastNode:function(setting,parentNode){var childKey=setting.data.key.children,childLength=parentNode[childKey].length;childLength>0&&(parentNode[childKey][childLength-1].isLastNode=!0)},removeNode:function(setting,node){var root=data.getRoot(setting),childKey=setting.data.key.children,parentNode=node.parentTId?node.getParentNode():root;if(node.isFirstNode=!1,node.isLastNode=!1,node.getPreNode=function(){return null},node.getNextNode=function(){return null},data.getNodeCache(setting,node.tId)){$$(node,setting).remove(),data.removeNodeCache(setting,node),data.removeSelectedNode(setting,node); +for(var i=0,l=parentNode[childKey].length;i0){var newLast=parentNode[childKey][childLength-1];if(tmp_ulObj=$$(newLast,consts.id.UL,setting),tmp_switchObj=$$(newLast,consts.id.SWITCH,setting),tmp_icoObj=$$(newLast,consts.id.ICON,setting),parentNode==root)if(1==parentNode[childKey].length)view.replaceSwitchClass(newLast,tmp_switchObj,consts.line.ROOT);else{var tmp_first_switchObj=$$(parentNode[childKey][0],consts.id.SWITCH,setting);view.replaceSwitchClass(parentNode[childKey][0],tmp_first_switchObj,consts.line.ROOTS),view.replaceSwitchClass(newLast,tmp_switchObj,consts.line.BOTTOM)}else view.replaceSwitchClass(newLast,tmp_switchObj,consts.line.BOTTOM);tmp_ulObj.removeClass(consts.line.LINE)}}else parentNode.isParent=!1,parentNode.open=!1,tmp_ulObj=$$(parentNode,consts.id.UL,setting),tmp_switchObj=$$(parentNode,consts.id.SWITCH,setting),tmp_icoObj=$$(parentNode,consts.id.ICON,setting),view.replaceSwitchClass(parentNode,tmp_switchObj,consts.folder.DOCU),view.replaceIcoClass(parentNode,tmp_icoObj,consts.folder.DOCU),tmp_ulObj.css("display","none")}},replaceIcoClass:function(node,obj,newName){if(obj&&!node.isAjaxing){var tmpName=obj.attr("class");if(void 0!=tmpName){var tmpList=tmpName.split("_");switch(newName){case consts.folder.OPEN:case consts.folder.CLOSE:case consts.folder.DOCU:tmpList[tmpList.length-1]=newName}obj.attr("class",tmpList.join("_"))}}},replaceSwitchClass:function(node,obj,newName){if(obj){var tmpName=obj.attr("class");if(void 0!=tmpName){var tmpList=tmpName.split("_");switch(newName){case consts.line.ROOT:case consts.line.ROOTS:case consts.line.CENTER:case consts.line.BOTTOM:case consts.line.NOLINE:tmpList[0]=view.makeNodeLineClassEx(node)+newName;break;case consts.folder.OPEN:case consts.folder.CLOSE:case consts.folder.DOCU:tmpList[1]=newName}obj.attr("class",tmpList.join("_")),newName!==consts.folder.DOCU?obj.removeAttr("disabled"):obj.attr("disabled","disabled")}}},selectNode:function(setting,node,addFlag){addFlag||view.cancelPreSelectedNode(setting,null,node),$$(node,consts.id.A,setting).addClass(consts.node.CURSELECTED),data.addSelectedNode(setting,node),setting.treeObj.trigger(consts.event.SELECTED,[event,setting.treeId,node])},setNodeFontCss:function(setting,treeNode){var aObj=$$(treeNode,consts.id.A,setting),fontCss=view.makeNodeFontCss(setting,treeNode);fontCss&&aObj.css(fontCss)},setNodeLineIcos:function(setting,node){if(node){var switchObj=$$(node,consts.id.SWITCH,setting),ulObj=$$(node,consts.id.UL,setting),icoObj=$$(node,consts.id.ICON,setting),ulLine=view.makeUlLineClass(setting,node);0==ulLine.length?ulObj.removeClass(consts.line.LINE):ulObj.addClass(ulLine),switchObj.attr("class",view.makeNodeLineClass(setting,node)),node.isParent?switchObj.removeAttr("disabled"):switchObj.attr("disabled","disabled"),icoObj.removeAttr("style"),icoObj.attr("style",view.makeNodeIcoStyle(setting,node)),icoObj.attr("class",view.makeNodeIcoClass(setting,node))}},setNodeName:function(setting,node){var title=data.getNodeTitle(setting,node),nObj=$$(node,consts.id.SPAN,setting);if(nObj.empty(),setting.view.nameIsHTML?nObj.html(data.getNodeName(setting,node)):nObj.text(data.getNodeName(setting,node)),tools.apply(setting.view.showTitle,[setting.treeId,node],setting.view.showTitle)){var aObj=$$(node,consts.id.A,setting);aObj.attr("title",title?title:"")}},setNodeTarget:function(setting,node){var aObj=$$(node,consts.id.A,setting);aObj.attr("target",view.makeNodeTarget(node))},setNodeUrl:function(setting,node){var aObj=$$(node,consts.id.A,setting),url=view.makeNodeUrl(setting,node);null==url||0==url.length?aObj.removeAttr("href"):aObj.attr("href",url)},switchNode:function(setting,node){if(node.open||!tools.canAsync(setting,node))view.expandCollapseNode(setting,node,!node.open);else if(setting.async.enable){if(!view.asyncNode(setting,node))return void view.expandCollapseNode(setting,node,!node.open)}else node&&view.expandCollapseNode(setting,node,!node.open)}};$.fn.zTree={consts:_consts,_z:{tools:tools,view:view,event:event,data:data},getZTreeObj:function(treeId){var o=data.getZTreeTools(treeId);return o?o:null},destroy:function(treeId){if(treeId&&treeId.length>0)view.destroy(data.getSetting(treeId));else for(var s in settings)view.destroy(settings[s])},init:function(obj,zSetting,zNodes){var setting=tools.clone(_setting);$.extend(!0,setting,zSetting),setting.treeId=obj.attr("id"),setting.treeObj=obj,setting.treeObj.empty(),settings[setting.treeId]=setting,"undefined"==typeof document.body.style.maxHeight&&(setting.view.expandSpeed=""),data.initRoot(setting);var root=data.getRoot(setting),childKey=setting.data.key.children;zNodes=zNodes?tools.clone(tools.isArray(zNodes)?zNodes:[zNodes]):[],setting.data.simpleData.enable?root[childKey]=data.transformTozTreeFormat(setting,zNodes):root[childKey]=zNodes,data.initCache(setting),event.unbindTree(setting),event.bindTree(setting),event.unbindEvent(setting),event.bindEvent(setting);var zTreeTools={setting:setting,addNodes:function(parentNode,newNodes,isSilent){function addCallback(){view.addNodes(setting,parentNode,xNewNodes,1==isSilent)}if(!newNodes)return null;if(parentNode||(parentNode=null),parentNode&&!parentNode.isParent&&setting.data.keep.leaf)return null;var xNewNodes=tools.clone(tools.isArray(newNodes)?newNodes:[newNodes]);return tools.canAsync(setting,parentNode)?view.asyncNode(setting,parentNode,isSilent,addCallback):addCallback(),xNewNodes},cancelSelectedNode:function(node){view.cancelPreSelectedNode(setting,node)},destroy:function(){view.destroy(setting)},expandAll:function(expandFlag){return expandFlag=!!expandFlag,view.expandCollapseSonNode(setting,null,expandFlag,!0),expandFlag},expandNode:function(node,expandFlag,sonSign,focus,callbackFlag){if(!node||!node.isParent)return null;if(expandFlag!==!0&&expandFlag!==!1&&(expandFlag=!node.open),callbackFlag=!!callbackFlag,callbackFlag&&expandFlag&&0==tools.apply(setting.callback.beforeExpand,[setting.treeId,node],!0))return null;if(callbackFlag&&!expandFlag&&0==tools.apply(setting.callback.beforeCollapse,[setting.treeId,node],!0))return null;if(expandFlag&&node.parentTId&&view.expandCollapseParentNode(setting,node.getParentNode(),expandFlag,!1),expandFlag===node.open&&!sonSign)return null;if(data.getRoot(setting).expandTriggerFlag=callbackFlag,!tools.canAsync(setting,node)&&sonSign)view.expandCollapseSonNode(setting,node,expandFlag,!0,function(){if(focus!==!1)try{$$(node,setting).focus().blur()}catch(e){}});else if(node.open=!expandFlag,view.switchNode(this.setting,node),focus!==!1)try{$$(node,setting).focus().blur()}catch(e){}return expandFlag},getNodes:function(){return data.getNodes(setting)},getNodeByParam:function(key,value,parentNode){return key?data.getNodeByParam(setting,parentNode?parentNode[setting.data.key.children]:data.getNodes(setting),key,value):null},getNodeByTId:function(tId){return data.getNodeCache(setting,tId)},getNodesByParam:function(key,value,parentNode){return key?data.getNodesByParam(setting,parentNode?parentNode[setting.data.key.children]:data.getNodes(setting),key,value):null},getNodesByParamFuzzy:function(key,value,parentNode){return key?data.getNodesByParamFuzzy(setting,parentNode?parentNode[setting.data.key.children]:data.getNodes(setting),key,value):null},getNodesByFilter:function(filter,isSingle,parentNode,invokeParam){return isSingle=!!isSingle,filter&&"function"==typeof filter?data.getNodesByFilter(setting,parentNode?parentNode[setting.data.key.children]:data.getNodes(setting),filter,isSingle,invokeParam):isSingle?null:[]},getNodeIndex:function(node){if(!node)return null;for(var childKey=setting.data.key.children,parentNode=node.parentTId?node.getParentNode():data.getRoot(setting),i=0,l=parentNode[childKey].length;i0?view.createNodes(setting,0,root[childKey]):setting.async.enable&&setting.async.url&&""!==setting.async.url&&view.asyncNode(setting),zTreeTools}};var zt=$.fn.zTree,$$=tools.$,consts=zt.consts}(BI.jQuery),function($){var _consts={event:{CHECK:"ztree_check"},id:{CHECK:"_check"},checkbox:{STYLE:"checkbox",DEFAULT:"chk",DISABLED:"disable",FALSE:"false",TRUE:"true",FULL:"full",PART:"part",FOCUS:"focus"},radio:{STYLE:"radio",TYPE_ALL:"all",TYPE_LEVEL:"level"}},_setting={check:{enable:!1,autoCheckTrigger:!1,chkStyle:_consts.checkbox.STYLE,nocheckInherit:!1,chkDisabledInherit:!1,radioType:_consts.radio.TYPE_LEVEL,chkboxType:{Y:"ps",N:"ps"}},data:{key:{checked:"checked"}},callback:{beforeCheck:null,onCheck:null}},_initRoot=function(setting){var r=data.getRoot(setting);r.radioCheckedList=[]},_initCache=function(treeId){},_bindEvent=function(setting){var o=setting.treeObj,c=consts.event;o.bind(c.CHECK,function(event,srcEvent,treeId,node){event.srcEvent=srcEvent,tools.apply(setting.callback.onCheck,[event,treeId,node])})},_unbindEvent=function(setting){var o=setting.treeObj,c=consts.event;o.unbind(c.CHECK)},_eventProxy=function(e){var target=e.target,setting=data.getSetting(e.data.treeId),tId="",node=null,nodeEventType="",treeEventType="",nodeEventCallback=null,treeEventCallback=null;if(tools.eqs(e.type,"mouseover")?setting.check.enable&&tools.eqs(target.tagName,"span")&&null!==target.getAttribute("treeNode"+consts.id.CHECK)&&(tId=tools.getNodeMainDom(target).id,nodeEventType="mouseoverCheck"):tools.eqs(e.type,"mouseout")?setting.check.enable&&tools.eqs(target.tagName,"span")&&null!==target.getAttribute("treeNode"+consts.id.CHECK)&&(tId=tools.getNodeMainDom(target).id,nodeEventType="mouseoutCheck"):tools.eqs(e.type,"click")&&setting.check.enable&&tools.eqs(target.tagName,"span")&&null!==target.getAttribute("treeNode"+consts.id.CHECK)&&(tId=tools.getNodeMainDom(target).id,nodeEventType="checkNode"),tId.length>0)switch(node=data.getNodeCache(setting,tId),nodeEventType){case"checkNode":nodeEventCallback=_handler.onCheckNode;break;case"mouseoverCheck":nodeEventCallback=_handler.onMouseoverCheck;break;case"mouseoutCheck":nodeEventCallback=_handler.onMouseoutCheck}var proxyResult={stop:"checkNode"===nodeEventType,node:node,nodeEventType:nodeEventType,nodeEventCallback:nodeEventCallback,treeEventType:treeEventType,treeEventCallback:treeEventCallback};return proxyResult},_initNode=function(setting,level,n,parentNode,isFirstNode,isLastNode,openFlag){if(n){var checkedKey=setting.data.key.checked;if("string"==typeof n[checkedKey]&&(n[checkedKey]=tools.eqs(n[checkedKey],"true")),n[checkedKey]=!!n[checkedKey],n.checkedOld=n[checkedKey],"string"==typeof n.nocheck&&(n.nocheck=tools.eqs(n.nocheck,"true")),n.nocheck=!!n.nocheck||setting.check.nocheckInherit&&parentNode&&!!parentNode.nocheck,"string"==typeof n.chkDisabled&&(n.chkDisabled=tools.eqs(n.chkDisabled,"true")),n.chkDisabled=!!n.chkDisabled||setting.check.chkDisabledInherit&&parentNode&&!!parentNode.chkDisabled,"string"==typeof n.halfCheck&&(n.halfCheck=tools.eqs(n.halfCheck,"true")),n.halfCheck=!!n.halfCheck,n.check_Child_State=-1,n.check_Focus=!1,n.getCheckStatus=function(){return data.getCheckStatus(setting,n)},setting.check.chkStyle==consts.radio.STYLE&&setting.check.radioType==consts.radio.TYPE_ALL&&n[checkedKey]){var r=data.getRoot(setting);r.radioCheckedList.push(n)}}},_beforeA=function(setting,node,html){var checkedKey=setting.data.key.checked;setting.check.enable&&(data.makeChkFlag(setting,node),html.push(""))},_zTreeTools=function(setting,zTreeTools){zTreeTools.checkNode=function(node,checked,checkTypeFlag,callbackFlag){var checkedKey=this.setting.data.key.checked;if(node.chkDisabled!==!0&&(checked!==!0&&checked!==!1&&(checked=!node[checkedKey]),callbackFlag=!!callbackFlag,(node[checkedKey]!==checked||checkTypeFlag)&&(!callbackFlag||0!=tools.apply(this.setting.callback.beforeCheck,[this.setting.treeId,node],!0))&&tools.uCanDo(this.setting)&&this.setting.check.enable&&node.nocheck!==!0)){node[checkedKey]=checked;var checkObj=$$(node,consts.id.CHECK,this.setting);(checkTypeFlag||this.setting.check.chkStyle===consts.radio.STYLE)&&view.checkNodeRelation(this.setting,node),view.setChkClass(this.setting,checkObj,node),view.repairParentChkClassWithSelf(this.setting,node),callbackFlag&&this.setting.treeObj.trigger(consts.event.CHECK,[null,this.setting.treeId,node])}},zTreeTools.checkAllNodes=function(checked){view.repairAllChk(this.setting,!!checked)},zTreeTools.getCheckedNodes=function(checked){var childKey=this.setting.data.key.children;return checked=checked!==!1,data.getTreeCheckedNodes(this.setting,data.getRoot(this.setting)[childKey],checked)},zTreeTools.getChangeCheckedNodes=function(){var childKey=this.setting.data.key.children;return data.getTreeChangeCheckedNodes(this.setting,data.getRoot(this.setting)[childKey])},zTreeTools.setChkDisabled=function(node,disabled,inheritParent,inheritChildren){disabled=!!disabled,inheritParent=!!inheritParent,inheritChildren=!!inheritChildren,view.repairSonChkDisabled(this.setting,node,disabled,inheritChildren),view.repairParentChkDisabled(this.setting,node.getParentNode(),disabled,inheritParent)};var _updateNode=zTreeTools.updateNode;zTreeTools.updateNode=function(node,checkTypeFlag){if(_updateNode&&_updateNode.apply(zTreeTools,arguments),node&&this.setting.check.enable){var nObj=$$(node,this.setting);if(nObj.get(0)&&tools.uCanDo(this.setting)){var checkObj=$$(node,consts.id.CHECK,this.setting);1!=checkTypeFlag&&this.setting.check.chkStyle!==consts.radio.STYLE||view.checkNodeRelation(this.setting,node),view.setChkClass(this.setting,checkObj,node),view.repairParentChkClassWithSelf(this.setting,node)}}}},_data={getRadioCheckedList:function(setting){for(var checkedList=data.getRoot(setting).radioCheckedList,i=0,j=checkedList.length;i-1&&node.check_Child_State<2:node.check_Child_State>0};return r},getTreeCheckedNodes:function(setting,nodes,checked,results){if(!nodes)return[];var childKey=setting.data.key.children,checkedKey=setting.data.key.checked,onlyOne=checked&&setting.check.chkStyle==consts.radio.STYLE&&setting.check.radioType==consts.radio.TYPE_ALL;results=results?results:[];for(var i=0,l=nodes.length;i0));i++);return results},getTreeChangeCheckedNodes:function(setting,nodes,results){if(!nodes)return[];var childKey=setting.data.key.children,checkedKey=setting.data.key.checked;results=results?results:[];for(var i=0,l=nodes.length;i0?2:0,2==tmp){chkFlag=2;break}0==tmp&&(chkFlag=0)}else if(setting.check.chkStyle==consts.checkbox.STYLE){if(tmp=cNode.nocheck===!0||cNode.chkDisabled===!0?cNode.check_Child_State:cNode.halfCheck===!0?1:cNode[checkedKey]?cNode.check_Child_State===-1||2===cNode.check_Child_State?2:1:cNode.check_Child_State>0?1:0,1===tmp){chkFlag=1;break}if(2===tmp&&chkFlag>-1&&i>0&&tmp!==chkFlag){chkFlag=1;break}if(2===chkFlag&&tmp>-1&&tmp<2){chkFlag=1;break}tmp>-1&&(chkFlag=tmp)}}node.check_Child_State=chkFlag}}},_event={},_handler={onCheckNode:function(event,node){if(node.chkDisabled===!0)return!1;var setting=data.getSetting(event.data.treeId),checkedKey=setting.data.key.checked;if(0==tools.apply(setting.callback.beforeCheck,[setting.treeId,node],!0))return!0;node[checkedKey]=!node[checkedKey],view.checkNodeRelation(setting,node);var checkObj=$$(node,consts.id.CHECK,setting);return view.setChkClass(setting,checkObj,node),view.repairParentChkClassWithSelf(setting,node),setting.treeObj.trigger(consts.event.CHECK,[event,setting.treeId,node]),!0},onMouseoverCheck:function(event,node){if(node.chkDisabled===!0)return!1;var setting=data.getSetting(event.data.treeId),checkObj=$$(node,consts.id.CHECK,setting);return node.check_Focus=!0,view.setChkClass(setting,checkObj,node),!0},onMouseoutCheck:function(event,node){if(node.chkDisabled===!0)return!1;var setting=data.getSetting(event.data.treeId),checkObj=$$(node,consts.id.CHECK,setting);return node.check_Focus=!1,view.setChkClass(setting,checkObj,node),!0}},_tools={},_view={checkNodeRelation:function(setting,node){var pNode,i,l,childKey=setting.data.key.children,checkedKey=setting.data.key.checked,r=consts.radio;if(setting.check.chkStyle==r.STYLE){var checkedList=data.getRadioCheckedList(setting);if(node[checkedKey])if(setting.check.radioType==r.TYPE_ALL){for(i=checkedList.length-1;i>=0;i--)pNode=checkedList[i],pNode[checkedKey]&&pNode!=node&&(pNode[checkedKey]=!1,checkedList.splice(i,1),view.setChkClass(setting,$$(pNode,consts.id.CHECK,setting),pNode),pNode.parentTId!=node.parentTId&&view.repairParentChkClassWithSelf(setting,pNode));checkedList.push(node)}else{var parentNode=node.parentTId?node.getParentNode():data.getRoot(setting);for(i=0,l=parentNode[childKey].length;i-1)&&view.setSonNodeCheckBox(setting,node,!0),node[checkedKey]||node[childKey]&&0!=node[childKey].length&&!(setting.check.chkboxType.N.indexOf("s")>-1)||view.setSonNodeCheckBox(setting,node,!1),node[checkedKey]&&setting.check.chkboxType.Y.indexOf("p")>-1&&view.setParentNodeCheckBox(setting,node,!0),!node[checkedKey]&&setting.check.chkboxType.N.indexOf("p")>-1&&view.setParentNodeCheckBox(setting,node,!1)},makeChkClass:function(setting,node){var checkedKey=setting.data.key.checked,c=consts.checkbox,r=consts.radio,checkboxType=setting.check.chkboxType,notEffectByOtherNode=""===checkboxType.Y&&""===checkboxType.N;fullStyle="",node.chkDisabled===!0?fullStyle=c.DISABLED:node.halfCheck?fullStyle=c.PART:setting.check.chkStyle==r.STYLE?fullStyle=node.check_Child_State<1?c.FULL:c.PART:fullStyle=node[checkedKey]?2===node.check_Child_State||node.check_Child_State===-1||notEffectByOtherNode?c.FULL:c.PART:node.check_Child_State<1||notEffectByOtherNode?c.FULL:c.PART;var chkName=setting.check.chkStyle+"_"+(node[checkedKey]?c.TRUE:c.FALSE)+"_"+fullStyle;return chkName=node.check_Focus&&node.chkDisabled!==!0?chkName+"_"+c.FOCUS:chkName,consts.className.BUTTON+" "+c.DEFAULT+" "+chkName},repairAllChk:function(setting,checked){if(setting.check.enable&&setting.check.chkStyle===consts.checkbox.STYLE)for(var checkedKey=setting.data.key.checked,childKey=setting.data.key.children,root=data.getRoot(setting),i=0,l=root[childKey].length;i0?view.repairParentChkClass(setting,node[childKey][0]):view.repairParentChkClass(setting,node)}},repairSonChkDisabled:function(setting,node,chkDisabled,inherit){if(node){var childKey=setting.data.key.children;if(node.chkDisabled!=chkDisabled&&(node.chkDisabled=chkDisabled),view.repairChkClass(setting,node),node[childKey]&&inherit)for(var i=0,l=node[childKey].length;i0){pSign=!1;break}pSign&&view.setParentNodeCheckBox(setting,node.getParentNode(),value,srcNode)}},setSonNodeCheckBox:function(setting,node,value,srcNode){if(node){var childKey=setting.data.key.children,checkedKey=setting.data.key.checked,checkObj=$$(node,consts.id.CHECK,setting);srcNode||(srcNode=node);var hasDisable=!1;if(node[childKey])for(var i=0,l=node[childKey].length;i0?value?2:0:-1)):node.check_Child_State=-1,view.setChkClass(setting,checkObj,node),setting.check.autoCheckTrigger&&node!=srcNode&&node.nocheck!==!0&&node.chkDisabled!==!0&&setting.treeObj.trigger(consts.event.CHECK,[null,setting.treeId,node]))}}},_z={tools:_tools,view:_view,event:_event,data:_data};$.extend(!0,$.fn.zTree.consts,_consts),$.extend(!0,$.fn.zTree._z,_z);var zt=$.fn.zTree,tools=zt._z.tools,consts=zt.consts,view=zt._z.view,data=zt._z.data,event=zt._z.event,$$=tools.$;data.exSetting(_setting),data.addInitBind(_bindEvent),data.addInitUnBind(_unbindEvent),data.addInitCache(_initCache),data.addInitNode(_initNode),data.addInitProxy(_eventProxy,!0),data.addInitRoot(_initRoot),data.addBeforeA(_beforeA),data.addZTreeTools(_zTreeTools);var _createNodes=view.createNodes;view.createNodes=function(setting,level,nodes,parentNode){_createNodes&&_createNodes.apply(view,arguments),nodes&&view.repairParentChkClassWithSelf(setting,parentNode)};var _removeNode=view.removeNode;view.removeNode=function(setting,node){var parentNode=node.getParentNode();_removeNode&&_removeNode.apply(view,arguments),node&&parentNode&&(view.repairChkClass(setting,parentNode),view.repairParentChkClass(setting,parentNode))};var _appendNodes=view.appendNodes;view.appendNodes=function(setting,level,nodes,parentNode,initFlag,openFlag){var html="";return _appendNodes&&(html=_appendNodes.apply(view,arguments)),parentNode&&data.makeChkFlag(setting,parentNode),html}}(BI.jQuery),BI.IconChangeButton=BI.inherit(BI.Single,{_defaultConfig:function(){var conf=BI.IconChangeButton.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{baseCls:"bi-icon-change-button",iconCls:"",iconWidth:null,iconHeight:null,stopEvent:!1,stopPropagation:!1,selected:!1,once:!1,forceSelected:!1,forceNotSelected:!1,disableSelected:!1,shadow:!1,isShadowShowingOnSelected:!1,trigger:null,handler:BI.emptyFn})},_init:function(){BI.IconChangeButton.superclass._init.apply(this,arguments);var self=this,o=this.options;this.button=BI.createWidget({type:"bi.icon_button",element:this,cls:o.iconCls,height:o.height,iconWidth:o.iconWidth,iconHeight:o.iconHeight,stopEvent:o.stopEvent,stopPropagation:o.stopPropagation,selected:o.selected,once:o.once,forceSelected:o.forceSelected,forceNotSelected:o.forceNotSelected,disableSelected:o.disableSelected,shadow:o.shadow,isShadowShowingOnSelected:o.isShadowShowingOnSelected,trigger:o.trigger,handler:o.handler}),this.button.on(BI.Controller.EVENT_CHANGE,function(){self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.button.on(BI.IconButton.EVENT_CHANGE,function(){self.fireEvent(BI.IconChangeButton.EVENT_CHANGE,arguments)})},isSelected:function(){return this.button.isSelected()},setSelected:function(b){this.button.setSelected(b)},setIcon:function(cls){var o=this.options;o.iconCls!==cls&&(this.element.removeClass(o.iconCls).addClass(cls),o.iconCls=cls)}}),BI.IconChangeButton.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.icon_change_button",BI.IconChangeButton),BI.TriggerIconButton=BI.inherit(BI.IconButton,{_defaultConfig:function(){var conf=BI.TriggerIconButton.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{baseCls:(conf.baseCls||"")+" bi-trigger-icon-button",extraCls:"pull-down-font"})}}),BI.TriggerIconButton.EVENT_CHANGE=BI.IconButton.EVENT_CHANGE,BI.shortcut("bi.trigger_icon_button",BI.TriggerIconButton),BI.HalfIconButton=BI.inherit(BI.IconButton,{_defaultConfig:function(){var conf=BI.HalfIconButton.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{extraCls:"bi-half-icon-button check-half-select-icon",height:16,width:16,iconWidth:16,iconHeight:16,selected:!1})}}),BI.HalfIconButton.EVENT_CHANGE=BI.IconButton.EVENT_CHANGE,BI.shortcut("bi.half_icon_button",BI.HalfIconButton),BI.HalfButton=BI.inherit(BI.BasicButton,{_defaultConfig:function(){var conf=BI.HalfIconButton.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{extraCls:"bi-half-button bi-high-light-border",height:14,width:14,selected:!1})},_init:function(){BI.HalfButton.superclass._init.apply(this,arguments),BI.createWidget({type:"bi.center_adapt",element:this.element,items:[{type:"bi.layout",cls:"bi-high-light-background",width:8,height:8}]})},doClick:function(){BI.HalfButton.superclass.doClick.apply(this,arguments),this.isValid()&&this.fireEvent(BI.HalfButton.EVENT_CHANGE)}}),BI.HalfButton.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.half_button",BI.HalfButton),BI.MultiSelectItem=BI.inherit(BI.BasicButton,{_defaultConfig:function(){return BI.extend(BI.MultiSelectItem.superclass._defaultConfig.apply(this,arguments),{extraCls:"bi-multi-select-item",height:24,logic:{dynamic:!1},iconWrapperWidth:26})},_init:function(){BI.MultiSelectItem.superclass._init.apply(this,arguments);var self=this,o=this.options;this.checkbox=BI.createWidget({type:"bi.checkbox"}),this.text=BI.createWidget({type:"bi.label",cls:"list-item-text",textAlign:"left",whiteSpace:"nowrap",textHeight:o.height,height:o.height,hgap:o.hgap,rgap:o.rgap,text:o.text,keyword:o.keyword,value:o.value,py:o.py}),this.checkbox.on(BI.Controller.EVENT_CHANGE,function(type){type===BI.Events.CLICK&&self.setSelected(self.isSelected())}),BI.createWidget(BI.extend({element:this},BI.LogicFactory.createLogic("horizontal",BI.extend(o.logic,{items:BI.LogicFactory.createLogicItemsByDirection("left",{type:"bi.center_adapt",items:[this.checkbox],width:o.iconWrapperWidth},this.text)}))))},doRedMark:function(){this.text.doRedMark.apply(this.text,arguments)},unRedMark:function(){this.text.unRedMark.apply(this.text,arguments)},doClick:function(){BI.MultiSelectItem.superclass.doClick.apply(this,arguments),this.checkbox.setSelected(this.isSelected()),this.isValid()&&this.fireEvent(BI.MultiSelectItem.EVENT_CHANGE,this.getValue(),this)},setSelected:function(v){BI.MultiSelectItem.superclass.setSelected.apply(this,arguments),this.checkbox.setSelected(v)}}),BI.MultiSelectItem.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.multi_select_item",BI.MultiSelectItem),BI.SingleSelectIconTextItem=BI.inherit(BI.Single,{_defaultConfig:function(){return BI.extend(BI.SingleSelectIconTextItem.superclass._defaultConfig.apply(this,arguments),{extraCls:"bi-single-select-icon-text-item bi-list-item-active",iconCls:"",height:24})},_init:function(){BI.SingleSelectIconTextItem.superclass._init.apply(this,arguments);var self=this,o=this.options;this.text=BI.createWidget({type:"bi.icon_text_item",element:this,cls:o.iconCls,once:o.once,iconWrapperWidth:o.iconWrapperWidth,selected:o.selected,height:o.height,iconHeight:o.iconHeight, +iconWidth:o.iconWidth,text:o.text,keyword:o.keyword,value:o.value,py:o.py}),this.text.on(BI.Controller.EVENT_CHANGE,function(){self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)})},isSelected:function(){return this.text.isSelected()},setSelected:function(b){this.text.setSelected(b)},doRedMark:function(){this.text.doRedMark.apply(this.text,arguments)},unRedMark:function(){this.text.unRedMark.apply(this.text,arguments)},doClick:function(){BI.SingleSelectIconTextItem.superclass.doClick.apply(this,arguments)}}),BI.shortcut("bi.single_select_icon_text_item",BI.SingleSelectIconTextItem),BI.SingleSelectItem=BI.inherit(BI.BasicButton,{_defaultConfig:function(){return BI.extend(BI.SingleSelectItem.superclass._defaultConfig.apply(this,arguments),{extraCls:"bi-single-select-item bi-list-item-active",hgap:10,height:24,textAlign:"left"})},_init:function(){BI.SingleSelectItem.superclass._init.apply(this,arguments);var self=this,o=this.options;this.text=BI.createWidget({type:"bi.label",element:this,textAlign:o.textAlign,whiteSpace:"nowrap",textHeight:o.height,height:o.height,hgap:o.hgap,text:o.text,keyword:o.keyword,value:o.value,title:o.title||o.text,warningTitle:o.warningTitle,py:o.py})},doRedMark:function(){this.text.doRedMark.apply(this.text,arguments)},unRedMark:function(){this.text.unRedMark.apply(this.text,arguments)},doClick:function(){BI.SingleSelectItem.superclass.doClick.apply(this,arguments),this.isValid()&&this.fireEvent(BI.SingleSelectItem.EVENT_CHANGE,this.isSelected(),this)},setSelected:function(v){BI.SingleSelectItem.superclass.setSelected.apply(this,arguments)}}),BI.SingleSelectItem.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.single_select_item",BI.SingleSelectItem),BI.SingleSelectRadioItem=BI.inherit(BI.BasicButton,{_defaultConfig:function(){return BI.extend(BI.SingleSelectRadioItem.superclass._defaultConfig.apply(this,arguments),{extraCls:"bi-single-select-radio-item",logic:{dynamic:!1},hgap:10,height:24})},_init:function(){BI.SingleSelectRadioItem.superclass._init.apply(this,arguments);var self=this,o=this.options;this.radio=BI.createWidget({type:"bi.radio"}),this.text=BI.createWidget({type:"bi.label",cls:"list-item-text",textAlign:"left",whiteSpace:"nowrap",textHeight:o.height,height:o.height,hgap:o.hgap,text:o.text,keyword:o.keyword,value:o.value,py:o.py}),BI.createWidget(BI.extend({element:this},BI.LogicFactory.createLogic("horizontal",BI.extend(o.logic,{items:BI.LogicFactory.createLogicItemsByDirection("left",{type:"bi.center_adapt",items:[this.radio],width:16},this.text)}))))},doRedMark:function(){this.text.doRedMark.apply(this.text,arguments)},unRedMark:function(){this.text.unRedMark.apply(this.text,arguments)},doClick:function(){BI.SingleSelectRadioItem.superclass.doClick.apply(this,arguments),this.radio.setSelected(this.isSelected()),this.isValid()&&this.fireEvent(BI.SingleSelectRadioItem.EVENT_CHANGE,this.isSelected(),this)},setSelected:function(v){BI.SingleSelectRadioItem.superclass.setSelected.apply(this,arguments),this.radio.setSelected(v)}}),BI.SingleSelectRadioItem.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.single_select_radio_item",BI.SingleSelectRadioItem),BI.ArrowNode=BI.inherit(BI.NodeButton,{_defaultConfig:function(){var conf=BI.ArrowNode.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{baseCls:(conf.baseCls||"")+" bi-arrow-group-node bi-list-item",logic:{dynamic:!1},id:"",pId:"",open:!1,height:24})},_init:function(){var self=this,o=this.options;BI.ArrowNode.superclass._init.apply(this,arguments),this.checkbox=BI.createWidget({type:"bi.arrow_group_node_checkbox"}),this.text=BI.createWidget({type:"bi.label",textAlign:"left",whiteSpace:"nowrap",textHeight:o.height,height:o.height,hgap:o.hgap,text:o.text,value:o.value,py:o.py}),this.checkbox.on(BI.Controller.EVENT_CHANGE,function(type){type===BI.Events.CLICK&&self.setSelected(self.isSelected()),self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)});var type=BI.LogicFactory.createLogicTypeByDirection(BI.Direction.Left),items=BI.LogicFactory.createLogicItemsByDirection(BI.Direction.Left,{width:16,el:this.checkbox},this.text);BI.createWidget(BI.extend({element:this},BI.LogicFactory.createLogic(type,BI.extend(o.logic,{items:items}))))},doRedMark:function(){this.text.doRedMark.apply(this.text,arguments)},unRedMark:function(){this.text.unRedMark.apply(this.text,arguments)},doClick:function(){BI.ArrowNode.superclass.doClick.apply(this,arguments),this.checkbox.setSelected(this.isOpened())},setText:function(text){BI.ArrowNode.superclass.setText.apply(this,arguments),this.text.setText(text)},setOpened:function(v){BI.ArrowNode.superclass.setOpened.apply(this,arguments),this.checkbox.setSelected(v)}}),BI.shortcut("bi.arrow_group_node",BI.ArrowNode),BI.FirstPlusGroupNode=BI.inherit(BI.NodeButton,{_defaultConfig:function(){var conf=BI.FirstPlusGroupNode.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{baseCls:(conf.baseCls||"")+" bi-first-plus-group-node bi-list-item",logic:{dynamic:!1},id:"",pId:"",open:!1,height:24})},_init:function(){BI.FirstPlusGroupNode.superclass._init.apply(this,arguments);var self=this,o=this.options;this.checkbox=BI.createWidget({type:"bi.first_tree_node_checkbox",stopPropagation:!0}),this.text=BI.createWidget({type:"bi.label",textAlign:"left",whiteSpace:"nowrap",textHeight:o.height,height:o.height,hgap:o.hgap,text:o.text,value:o.value,py:o.py,keyword:o.keyword}),this.checkbox.on(BI.Controller.EVENT_CHANGE,function(type){type===BI.Events.CLICK&&(this.isSelected()?self.triggerExpand():self.triggerCollapse())});var type=BI.LogicFactory.createLogicTypeByDirection(BI.Direction.Left),items=BI.LogicFactory.createLogicItemsByDirection(BI.Direction.Left,{width:24,el:this.checkbox},this.text);BI.createWidget(BI.extend({element:this},BI.LogicFactory.createLogic(type,BI.extend(o.logic,{items:items}))))},doRedMark:function(){this.text.doRedMark.apply(this.text,arguments)},unRedMark:function(){this.text.unRedMark.apply(this.text,arguments)},doClick:function(){BI.FirstPlusGroupNode.superclass.doClick.apply(this,arguments),this.checkbox.setSelected(this.isSelected())},setOpened:function(v){BI.FirstPlusGroupNode.superclass.setOpened.apply(this,arguments),BI.isNotNull(this.checkbox)&&this.checkbox.setSelected(v)}}),BI.shortcut("bi.first_plus_group_node",BI.FirstPlusGroupNode),BI.IconArrowNode=BI.inherit(BI.NodeButton,{_defaultConfig:function(){var conf=BI.IconArrowNode.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{baseCls:(conf.baseCls||"")+" bi-icon-arrow-node bi-list-item",logic:{dynamic:!1},id:"",pId:"",open:!1,height:24,iconHeight:12,iconWidth:12,iconCls:""})},_init:function(){BI.IconArrowNode.superclass._init.apply(this,arguments);var self=this,o=this.options;this.checkbox=BI.createWidget({type:"bi.arrow_group_node_checkbox",width:24,stopPropagation:!0});var icon=BI.createWidget({type:"bi.icon_label",width:24,cls:o.iconCls,iconWidth:o.iconWidth,iconHeight:o.iconHeight});this.text=BI.createWidget({type:"bi.label",textAlign:"left",whiteSpace:"nowrap",textHeight:o.height,height:o.height,hgap:o.hgap,text:o.text,value:o.value,py:o.py}),this.checkbox.on(BI.Controller.EVENT_CHANGE,function(type){type===BI.Events.CLICK&&(this.isSelected()?self.triggerExpand():self.triggerCollapse())});var type=BI.LogicFactory.createLogicTypeByDirection(BI.Direction.Left),items=BI.LogicFactory.createLogicItemsByDirection(BI.Direction.Left,{width:16,el:this.checkbox},{width:16,el:icon},this.text);BI.createWidget(BI.extend({element:this},BI.LogicFactory.createLogic(type,BI.extend(o.logic,{items:items,rgap:5}))))},doRedMark:function(){this.text.doRedMark.apply(this.text,arguments)},unRedMark:function(){this.text.unRedMark.apply(this.text,arguments)},doClick:function(){BI.IconArrowNode.superclass.doClick.apply(this,arguments),this.checkbox.setSelected(this.isSelected())},setOpened:function(v){BI.IconArrowNode.superclass.setOpened.apply(this,arguments),BI.isNotNull(this.checkbox)&&this.checkbox.setSelected(v)}}),BI.shortcut("bi.icon_arrow_node",BI.IconArrowNode),BI.LastPlusGroupNode=BI.inherit(BI.NodeButton,{_defaultConfig:function(){var conf=BI.LastPlusGroupNode.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{baseCls:(conf.baseCls||"")+" bi-last-plus-group-node bi-list-item",logic:{dynamic:!1},id:"",pId:"",open:!1,height:24})},_init:function(){BI.LastPlusGroupNode.superclass._init.apply(this,arguments);var self=this,o=this.options;this.checkbox=BI.createWidget({type:"bi.last_tree_node_checkbox",stopPropagation:!0}),this.text=BI.createWidget({type:"bi.label",textAlign:"left",whiteSpace:"nowrap",textHeight:o.height,height:o.height,hgap:o.hgap,text:o.text,value:o.value,py:o.py,keyword:o.keyword}),this.checkbox.on(BI.Controller.EVENT_CHANGE,function(type){type===BI.Events.CLICK&&(this.isSelected()?self.triggerExpand():self.triggerCollapse())});var type=BI.LogicFactory.createLogicTypeByDirection(BI.Direction.Left),items=BI.LogicFactory.createLogicItemsByDirection(BI.Direction.Left,{width:24,el:this.checkbox},this.text);BI.createWidget(BI.extend({element:this},BI.LogicFactory.createLogic(type,BI.extend(o.logic,{items:items}))))},doRedMark:function(){this.text.doRedMark.apply(this.text,arguments)},unRedMark:function(){this.text.unRedMark.apply(this.text,arguments)},doClick:function(){BI.LastPlusGroupNode.superclass.doClick.apply(this,arguments),this.checkbox.setSelected(this.isSelected())},setOpened:function(v){BI.LastPlusGroupNode.superclass.setOpened.apply(this,arguments),BI.isNotNull(this.checkbox)&&this.checkbox.setSelected(v)}}),BI.shortcut("bi.last_plus_group_node",BI.LastPlusGroupNode),BI.MidPlusGroupNode=BI.inherit(BI.NodeButton,{_defaultConfig:function(){var conf=BI.MidPlusGroupNode.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{baseCls:(conf.baseCls||"")+" bi-mid-plus-group-node bi-list-item",logic:{dynamic:!1},id:"",pId:"",open:!1,height:24})},_init:function(){BI.MidPlusGroupNode.superclass._init.apply(this,arguments);var self=this,o=this.options;this.checkbox=BI.createWidget({type:"bi.mid_tree_node_checkbox",stopPropagation:!0}),this.text=BI.createWidget({type:"bi.label",textAlign:"left",whiteSpace:"nowrap",textHeight:o.height,height:o.height,hgap:o.hgap,text:o.text,value:o.value,py:o.py,keyword:o.keyword}),this.checkbox.on(BI.Controller.EVENT_CHANGE,function(type){type===BI.Events.CLICK&&(this.isSelected()?self.triggerExpand():self.triggerCollapse())});var type=BI.LogicFactory.createLogicTypeByDirection(BI.Direction.Left),items=BI.LogicFactory.createLogicItemsByDirection(BI.Direction.Left,{width:24,el:this.checkbox},this.text);BI.createWidget(BI.extend({element:this},BI.LogicFactory.createLogic(type,BI.extend(o.logic,{items:items}))))},doRedMark:function(){this.text.doRedMark.apply(this.text,arguments)},unRedMark:function(){this.text.unRedMark.apply(this.text,arguments)},doClick:function(){BI.MidPlusGroupNode.superclass.doClick.apply(this,arguments),this.checkbox.setSelected(this.isSelected())},setOpened:function(v){BI.MidPlusGroupNode.superclass.setOpened.apply(this,arguments),BI.isNotNull(this.checkbox)&&this.checkbox.setSelected(v)}}),BI.shortcut("bi.mid_plus_group_node",BI.MidPlusGroupNode),BI.MultiLayerIconArrowNode=BI.inherit(BI.NodeButton,{_defaultConfig:function(){var conf=BI.MultiLayerIconArrowNode.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{extraCls:"bi-multilayer-icon-arrow-node bi-list-item",layer:0,id:"",pId:"",open:!1,height:24,iconHeight:16,iconWidth:16,iconCls:""})},_init:function(){BI.MultiLayerIconArrowNode.superclass._init.apply(this,arguments);var self=this,o=this.options;this.node=BI.createWidget({type:"bi.icon_arrow_node",iconCls:o.iconCls,cls:"bi-list-item-none",id:o.id,pId:o.pId,open:o.open,height:o.height,iconHeight:o.iconHeight,iconWidth:o.iconWidth,hgap:o.hgap,text:o.text,value:o.value,py:o.py}),this.node.on(BI.Controller.EVENT_CHANGE,function(type){self.setSelected(self.isSelected()),self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)});var items=[];BI.count(0,o.layer,function(){items.push({type:"bi.layout",width:15,height:o.height})}),items.push(this.node),BI.createWidget({type:"bi.td",element:this,columnSize:BI.makeArray(o.layer,15),items:[items]})},isOnce:function(){return!0},doRedMark:function(){this.node.doRedMark.apply(this.node,arguments)},unRedMark:function(){this.node.unRedMark.apply(this.node,arguments)},isSelected:function(){return this.node.isSelected()},setSelected:function(b){BI.MultiLayerIconArrowNode.superclass.setSelected.apply(this,arguments),this.node.setSelected(b)},doClick:function(){BI.NodeButton.superclass.doClick.apply(this,arguments),this.node.setSelected(this.isSelected())},setOpened:function(v){BI.MultiLayerIconArrowNode.superclass.setOpened.apply(this,arguments),this.node.setOpened(v)}}),BI.shortcut("bi.multilayer_icon_arrow_node",BI.MultiLayerIconArrowNode),BI.PlusGroupNode=BI.inherit(BI.NodeButton,{_defaultConfig:function(){var conf=BI.PlusGroupNode.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{baseCls:(conf.baseCls||"")+" bi-plus-group-node bi-list-item",logic:{dynamic:!1},id:"",pId:"",open:!1,height:24})},_init:function(){BI.PlusGroupNode.superclass._init.apply(this,arguments);var self=this,o=this.options;this.checkbox=BI.createWidget({type:"bi.tree_node_checkbox"}),this.text=BI.createWidget({type:"bi.label",textAlign:"left",whiteSpace:"nowrap",textHeight:o.height,height:o.height,hgap:o.hgap,text:o.text,value:o.value,keyword:o.keyword,py:o.py}),this.checkbox.on(BI.Controller.EVENT_CHANGE,function(type){type===BI.Events.CLICK&&self.setSelected(self.isSelected()),self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)});var type=BI.LogicFactory.createLogicTypeByDirection(BI.Direction.Left),items=BI.LogicFactory.createLogicItemsByDirection(BI.Direction.Left,{width:24,el:this.checkbox},this.text);BI.createWidget(BI.extend({element:this},BI.LogicFactory.createLogic(type,BI.extend(o.logic,{items:items}))))},doRedMark:function(){this.text.doRedMark.apply(this.text,arguments)},unRedMark:function(){this.text.unRedMark.apply(this.text,arguments)},doClick:function(){BI.PlusGroupNode.superclass.doClick.apply(this,arguments),this.checkbox.setSelected(this.isSelected())},setOpened:function(v){BI.PlusGroupNode.superclass.setOpened.apply(this,arguments),this.checkbox&&this.checkbox.setSelected(v)}}),BI.shortcut("bi.plus_group_node",BI.PlusGroupNode),BI.Switch=BI.inherit(BI.BasicButton,{props:{extraCls:"bi-switch",height:22,width:44,logic:{dynamic:!1}},render:function(){var self=this;return{type:"bi.absolute",ref:function(){self.layout=this},items:[{el:{type:"bi.text_button",cls:"circle-button bi-card"},width:18,height:18,top:2,left:this.options.selected?24:2}]}},setSelected:function(v){BI.Switch.superclass.setSelected.apply(this,arguments),this.layout.attr("items")[0].left=v?24:2,this.layout.resize()},doClick:function(){BI.Switch.superclass.doClick.apply(this,arguments),this.fireEvent(BI.Switch.EVENT_CHANGE)}}),BI.Switch.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.switch",BI.Switch),BI.FirstTreeLeafItem=BI.inherit(BI.BasicButton,{_defaultConfig:function(){return BI.extend(BI.FirstTreeLeafItem.superclass._defaultConfig.apply(this,arguments),{extraCls:"bi-first-tree-leaf-item bi-list-item-active",logic:{dynamic:!1},id:"",pId:"",layer:0,height:24})},_init:function(){BI.FirstTreeLeafItem.superclass._init.apply(this,arguments);var self=this,o=this.options;this.checkbox=BI.createWidget({type:"bi.checkbox"}),this.text=BI.createWidget({type:"bi.label",textAlign:"left",whiteSpace:"nowrap",textHeight:o.height,height:o.height,hgap:o.hgap,text:o.text,value:o.value,py:o.py,keyword:o.keyword}),this.checkbox.on(BI.Controller.EVENT_CHANGE,function(type){type===BI.Events.CLICK&&self.setSelected(self.isSelected()),self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)});var type=BI.LogicFactory.createLogicTypeByDirection(BI.Direction.Left),items=BI.LogicFactory.createLogicItemsByDirection(BI.Direction.Left,0===o.layer?"":{width:12,el:{type:"bi.layout",cls:o.pNode&&o.pNode.isLastNode?"":"base-line-conn-background",width:12,height:o.height}},{width:24,el:{type:"bi.layout",cls:"first-line-conn-background",width:24,height:o.height}},{el:this.text});BI.createWidget(BI.extend({element:this},BI.LogicFactory.createLogic(type,BI.extend(o.logic,{items:items}))))},doRedMark:function(){this.text.doRedMark.apply(this.text,arguments)},unRedMark:function(){this.text.unRedMark.apply(this.text,arguments)},doHighLight:function(){this.text.doHighLight.apply(this.text,arguments)},unHighLight:function(){this.text.unHighLight.apply(this.text,arguments)},getId:function(){return this.options.id},getPId:function(){return this.options.pId},doClick:function(){BI.FirstTreeLeafItem.superclass.doClick.apply(this,arguments),this.checkbox.setSelected(this.isSelected())},setSelected:function(v){BI.FirstTreeLeafItem.superclass.setSelected.apply(this,arguments),this.checkbox.setSelected(v)}}),BI.shortcut("bi.first_tree_leaf_item",BI.FirstTreeLeafItem),BI.IconTreeLeafItem=BI.inherit(BI.BasicButton,{_defaultConfig:function(){return BI.extend(BI.IconTreeLeafItem.superclass._defaultConfig.apply(this,arguments),{extraCls:"bi-icon-tree-leaf-item bi-list-item-active",logic:{dynamic:!1},height:24,iconWidth:16,iconHeight:16,iconCls:""})},_init:function(){BI.IconTreeLeafItem.superclass._init.apply(this,arguments);var self=this,o=this.options,icon=BI.createWidget({type:"bi.center_adapt",width:24,cls:o.iconCls,items:[{type:"bi.icon",width:o.iconWidth,height:o.iconHeight}]});this.text=BI.createWidget({type:"bi.label",textAlign:"left",whiteSpace:"nowrap",textHeight:o.height,height:o.height,hgap:o.hgap,text:o.text,value:o.value,py:o.py});var type=BI.LogicFactory.createLogicTypeByDirection(BI.Direction.Left),items=BI.LogicFactory.createLogicItemsByDirection(BI.Direction.Left,{width:16,el:icon},{el:this.text});BI.createWidget(BI.extend({element:this},BI.LogicFactory.createLogic(type,BI.extend(o.logic,{items:items,hgap:5}))))},doRedMark:function(){this.text.doRedMark.apply(this.text,arguments)},unRedMark:function(){this.text.unRedMark.apply(this.text,arguments)},doHighLight:function(){this.text.doHighLight.apply(this.text,arguments)},unHighLight:function(){this.text.unHighLight.apply(this.text,arguments)},getId:function(){return this.options.id},getPId:function(){return this.options.pId},doClick:function(){BI.IconTreeLeafItem.superclass.doClick.apply(this,arguments)},setSelected:function(v){BI.IconTreeLeafItem.superclass.setSelected.apply(this,arguments)}}),BI.shortcut("bi.icon_tree_leaf_item",BI.IconTreeLeafItem),BI.LastTreeLeafItem=BI.inherit(BI.BasicButton,{_defaultConfig:function(){return BI.extend(BI.LastTreeLeafItem.superclass._defaultConfig.apply(this,arguments),{extraCls:"bi-last-tree-leaf-item bi-list-item-active",logic:{dynamic:!1},id:"",pId:"",layer:0,height:24})},_init:function(){BI.LastTreeLeafItem.superclass._init.apply(this,arguments);var self=this,o=this.options;this.checkbox=BI.createWidget({type:"bi.checkbox"}),this.text=BI.createWidget({type:"bi.label",textAlign:"left",whiteSpace:"nowrap",textHeight:o.height,height:o.height,hgap:o.hgap,text:o.text,value:o.value,py:o.py,keyword:o.keyword}),this.checkbox.on(BI.Controller.EVENT_CHANGE,function(type){type===BI.Events.CLICK&&self.setSelected(self.isSelected()),self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)});var type=BI.LogicFactory.createLogicTypeByDirection(BI.Direction.Left),items=BI.LogicFactory.createLogicItemsByDirection(BI.Direction.Left,0===o.layer?"":{width:12,el:{type:"bi.layout",cls:o.pNode&&o.pNode.isLastNode?"":"base-line-conn-background",width:12,height:o.height}},{width:24,el:{type:"bi.layout",cls:"last-line-conn-background",width:24,height:o.height}},{el:this.text});BI.createWidget(BI.extend({element:this},BI.LogicFactory.createLogic(type,BI.extend(o.logic,{items:items}))))},doRedMark:function(){this.text.doRedMark.apply(this.text,arguments)},unRedMark:function(){this.text.unRedMark.apply(this.text,arguments)},doHighLight:function(){this.text.doHighLight.apply(this.text,arguments)},unHighLight:function(){this.text.unHighLight.apply(this.text,arguments)},getId:function(){return this.options.id},getPId:function(){return this.options.pId},doClick:function(){BI.LastTreeLeafItem.superclass.doClick.apply(this,arguments)},setSelected:function(v){BI.LastTreeLeafItem.superclass.setSelected.apply(this,arguments)}}),BI.shortcut("bi.last_tree_leaf_item",BI.LastTreeLeafItem),BI.MidTreeLeafItem=BI.inherit(BI.BasicButton,{_defaultConfig:function(){return BI.extend(BI.MidTreeLeafItem.superclass._defaultConfig.apply(this,arguments),{extraCls:"bi-mid-tree-leaf-item bi-list-item-active",logic:{dynamic:!1},id:"",pId:"",layer:0,height:24})},_init:function(){BI.MidTreeLeafItem.superclass._init.apply(this,arguments);var self=this,o=this.options;this.checkbox=BI.createWidget({type:"bi.checkbox"}),this.text=BI.createWidget({type:"bi.label",textAlign:"left",whiteSpace:"nowrap",textHeight:o.height,height:o.height,hgap:o.hgap,text:o.text,value:o.value,py:o.py,keyword:o.keyword}),this.checkbox.on(BI.Controller.EVENT_CHANGE,function(type){type===BI.Events.CLICK&&self.setSelected(self.isSelected()),self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)});var type=BI.LogicFactory.createLogicTypeByDirection(BI.Direction.Left),items=BI.LogicFactory.createLogicItemsByDirection(BI.Direction.Left,0===o.layer?"":{width:12,el:{type:"bi.layout",cls:o.pNode&&o.pNode.isLastNode?"":"base-line-conn-background",width:12,height:o.height}},{width:24,el:{type:"bi.layout",cls:"mid-line-conn-background",width:24,height:o.height}},{el:this.text});BI.createWidget(BI.extend({element:this},BI.LogicFactory.createLogic(type,BI.extend(o.logic,{items:items}))))},doRedMark:function(){this.text.doRedMark.apply(this.text,arguments)},unRedMark:function(){this.text.unRedMark.apply(this.text,arguments)},doHighLight:function(){this.text.doHighLight.apply(this.text,arguments)},unHighLight:function(){this.text.unHighLight.apply(this.text,arguments)},getId:function(){return this.options.id},getPId:function(){return this.options.pId},doClick:function(){BI.MidTreeLeafItem.superclass.doClick.apply(this,arguments),this.checkbox.setSelected(this.isSelected())},setSelected:function(v){BI.MidTreeLeafItem.superclass.setSelected.apply(this,arguments),this.checkbox.setSelected(v)}}),BI.shortcut("bi.mid_tree_leaf_item",BI.MidTreeLeafItem),BI.MultiLayerIconTreeLeafItem=BI.inherit(BI.BasicButton,{_defaultConfig:function(){return BI.extend(BI.MultiLayerIconTreeLeafItem.superclass._defaultConfig.apply(this,arguments),{extraCls:"bi-multilayer-icon-tree-leaf-item bi-list-item-active",layer:0,height:24,iconCls:"",iconHeight:16,iconWidth:16})},_init:function(){BI.MultiLayerIconTreeLeafItem.superclass._init.apply(this,arguments);var self=this,o=this.options;this.item=BI.createWidget({type:"bi.icon_tree_leaf_item",cls:"bi-list-item-none",iconCls:o.iconCls,id:o.id,pId:o.pId,isFront:!0,height:o.height,hgap:o.hgap,text:o.text,value:o.value,py:o.py,iconWidth:o.iconWidth,iconHeight:o.iconHeight}),this.item.on(BI.Controller.EVENT_CHANGE,function(type){type!==BI.Events.CLICK&&self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)});var items=[];BI.count(0,o.layer,function(){items.push({type:"bi.layout",width:15,height:o.height})}),items.push(this.item),BI.createWidget({type:"bi.td",element:this,columnSize:BI.makeArray(o.layer,15),items:[items]})},doRedMark:function(){this.item.doRedMark.apply(this.item,arguments)},unRedMark:function(){this.item.unRedMark.apply(this.item,arguments)},doHighLight:function(){this.item.doHighLight.apply(this.item,arguments)},unHighLight:function(){this.item.unHighLight.apply(this.item,arguments)},getId:function(){return this.options.id},getPId:function(){return this.options.pId},doClick:function(){BI.MultiLayerIconTreeLeafItem.superclass.doClick.apply(this,arguments),this.item.setSelected(this.isSelected())},setSelected:function(v){BI.MultiLayerIconTreeLeafItem.superclass.setSelected.apply(this,arguments),this.item.setSelected(v)},getValue:function(){return this.options.value}}),BI.shortcut("bi.multilayer_icon_tree_leaf_item",BI.MultiLayerIconTreeLeafItem),BI.TreeTextLeafItem=BI.inherit(BI.BasicButton,{_defaultConfig:function(){return BI.extend(BI.TreeTextLeafItem.superclass._defaultConfig.apply(this,arguments),{extraCls:"bi-tree-text-leaf-item bi-list-item-active",id:"",pId:"",height:24,hgap:0,lgap:0,rgap:0})},_init:function(){BI.TreeTextLeafItem.superclass._init.apply(this,arguments);var self=this,o=this.options;this.text=BI.createWidget({type:"bi.label",textAlign:"left",whiteSpace:"nowrap",textHeight:o.height,height:o.height,hgap:o.hgap,lgap:o.lgap,rgap:o.hgap,text:o.text,value:o.value,py:o.py}),BI.createWidget({type:"bi.htape",element:this,items:[{el:this.text}]})},doRedMark:function(){this.text.doRedMark.apply(this.text,arguments)},unRedMark:function(){this.text.unRedMark.apply(this.text,arguments)},doHighLight:function(){this.text.doHighLight.apply(this.text,arguments)},unHighLight:function(){this.text.unHighLight.apply(this.text,arguments)},getId:function(){return this.options.id},getPId:function(){return this.options.pId}}),BI.shortcut("bi.tree_text_leaf_item",BI.TreeTextLeafItem),BI.CalendarDateItem=BI.inherit(BI.BasicButton,{render:function(){var self=this,o=this.options;return{type:"bi.absolute",items:[{el:{type:"bi.text_item",cls:"bi-list-item-select",textAlign:"center",whiteSpace:"normal",text:o.text,value:o.value,ref:function(){self.text=this}},left:o.lgap,right:o.rgap,top:0,bottom:0}]}},doHighLight:function(){this.text.doHighLight.apply(this.text,arguments)},unHighLight:function(){this.text.unHighLight.apply(this.text,arguments)},setValue:function(){this.isReadOnly()||this.text.setValue.apply(this.text,arguments)},setSelected:function(b){BI.CalendarDateItem.superclass.setSelected.apply(this,arguments),this.text.setSelected(b)},getValue:function(){return this.text.getValue()}}),BI.shortcut("bi.calendar_date_item",BI.CalendarDateItem),BI.Calendar=BI.inherit(BI.Widget,{_defaultConfig:function(){var conf=BI.Calendar.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{baseCls:"bi-calendar",logic:{dynamic:!1},min:"1900-01-01",max:"2099-12-31",year:2015,month:8,day:25})},_dateCreator:function(Y,M,D){var self=this,o=this.options,log={},De=BI.getDate(),mins=o.min.match(/\d+/g),maxs=o.max.match(/\d+/g);Y<(0|mins[0])&&(Y=0|mins[0]),Y>(0|maxs[0])&&(Y=0|maxs[0]),De.setFullYear(Y,M,D),log.ymd=[De.getFullYear(),De.getMonth(),De.getDate()];var MD=BI.Date._MD.slice(0);MD[1]=BI.isLeapYear(log.ymd[0])?29:28,De.setFullYear(log.ymd[0],log.ymd[1],1),log.FDay=De.getDay();var offSetFDay=(7-BI.StartOfWeek+log.FDay)%7;log.PDay=MD[0===M?11:M-1]-offSetFDay+1,log.NDay=1;var items=[];return BI.each(BI.range(42),function(i){var td={},YY=log.ymd[0],MM=log.ymd[1]+1,DD;i=offSetFDay&&i=0?page%12:(12+page%12)%12;return{year:BI.getDate().getFullYear()+year,month:month+1}}}),BI.shortcut("bi.calendar",BI.Calendar),BI.YearCalendar=BI.inherit(BI.Widget,{_defaultConfig:function(){var conf=BI.YearCalendar.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{baseCls:"bi-year-calendar",behaviors:{},logic:{dynamic:!1},min:"1900-01-01",max:"2099-12-31",year:null})},_yearCreator:function(Y){var o=this.options;Y=0|Y;var start=BI.YearCalendar.getStartYear(Y),items=[],startDate=BI.parseDateTime(o.min,"%Y-%X-%d"),endDate=BI.parseDateTime(o.max,"%Y-%X-%d");return BI.each(BI.range(BI.YearCalendar.INTERVAL),function(i){var td={};BI.checkDateVoid(start+i,1,1,BI.print(BI.getDate(startDate.getFullYear(),0,1),"%Y-%X-%d"),BI.print(BI.getDate(endDate.getFullYear(),0,1),"%Y-%X-%d"))[0]&&(td.disabled=!0),td.text=start+i,items.push(td)}),items},_init:function(){BI.YearCalendar.superclass._init.apply(this,arguments);var self=this,o=this.options;this.currentYear=BI.getDate().getFullYear();var years=this._yearCreator(o.year||this.currentYear),len=years.length,tyears=BI.makeArray(len,""),map=[0,6,1,7,2,8,3,9,4,10,5,11];BI.each(years,function(i,y){tyears[i]=years[map[i]]});var items=[];items.push(tyears.slice(0,2)),items.push(tyears.slice(2,4)),items.push(tyears.slice(4,6)),items.push(tyears.slice(6,8)),items.push(tyears.slice(8,10)),items.push(tyears.slice(10,12)),items=BI.map(items,function(i,item){return BI.map(item,function(j,td){return BI.extend(td,{type:"bi.text_item",cls:"bi-list-item-select",textAlign:"center",whiteSpace:"normal",once:!1,forceSelected:!0,height:24,width:45,value:td.text,disabled:td.disabled})})}),this.years=BI.createWidget({type:"bi.button_group",behaviors:o.behaviors,items:BI.createItems(items,{}),layouts:[BI.LogicFactory.createLogic("table",BI.extend({},o.logic,{columns:2,rows:6,columnSize:[.5,.5],rowSize:24})),{type:"bi.center_adapt",vgap:1}]}),this.years.on(BI.Controller.EVENT_CHANGE,function(){self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),BI.createWidget(BI.extend({element:this},BI.LogicFactory.createLogic("vertical",BI.extend({},o.logic,{items:BI.LogicFactory.createLogicItemsByDirection("top",this.years)}))))},isFrontYear:function(){var o=this.options,Y=o.year; +return Y=0|Y,!!BI.checkDateVoid(BI.YearCalendar.getStartYear(Y)-1,1,1,o.min,o.max)[0]},isFinalYear:function(){var o=this.options,c=this._const,Y=o.year;return Y=0|Y,!!BI.checkDateVoid(BI.YearCalendar.getEndYear(Y)+1,1,1,o.min,o.max)[0]},setValue:function(val){this.years.setValue([val])},getValue:function(){return this.years.getValue()[0]}}),BI.extend(BI.YearCalendar,{INTERVAL:12,getStartYear:function(year){var cur=BI.getDate().getFullYear();return year-((year-cur+3)%BI.YearCalendar.INTERVAL+12)%BI.YearCalendar.INTERVAL},getEndYear:function(year){return BI.YearCalendar.getStartYear(year)+BI.YearCalendar.INTERVAL-1},getPageByYear:function(year){var cur=BI.getDate().getFullYear();return year=BI.YearCalendar.getStartYear(year),(year-cur+3)/BI.YearCalendar.INTERVAL}}),BI.shortcut("bi.year_calendar",BI.YearCalendar),BI.ArrowTreeGroupNodeCheckbox=BI.inherit(BI.IconButton,{_defaultConfig:function(){return BI.extend(BI.ArrowTreeGroupNodeCheckbox.superclass._defaultConfig.apply(this,arguments),{extraCls:"bi-arrow-group-node-checkbox"})},setSelected:function(v){BI.ArrowTreeGroupNodeCheckbox.superclass.setSelected.apply(this,arguments),v?this.element.removeClass("expander-right-font").addClass("expander-down-font"):this.element.removeClass("expander-down-font").addClass("expander-right-font")}}),BI.shortcut("bi.arrow_group_node_checkbox",BI.ArrowTreeGroupNodeCheckbox),BI.CheckingMarkNode=BI.inherit(BI.IconButton,{_defaultConfig:function(){return BI.extend(BI.CheckingMarkNode.superclass._defaultConfig.apply(this,arguments),{extraCls:"check-mark-font"})},_init:function(){BI.CheckingMarkNode.superclass._init.apply(this,arguments),this.setSelected(this.options.selected)},setSelected:function(v){BI.CheckingMarkNode.superclass.setSelected.apply(this,arguments),v===!0?this.element.addClass("check-mark-font"):this.element.removeClass("check-mark-font")}}),BI.shortcut("bi.checking_mark_node",BI.CheckingMarkNode),BI.FirstTreeNodeCheckbox=BI.inherit(BI.IconButton,{_defaultConfig:function(){return BI.extend(BI.FirstTreeNodeCheckbox.superclass._defaultConfig.apply(this,arguments),{extraCls:"tree-collapse-icon-type2",iconWidth:24,iconHeight:24})},setSelected:function(v){BI.FirstTreeNodeCheckbox.superclass.setSelected.apply(this,arguments),v===!0?this.element.addClass("tree-expand-icon-type2"):this.element.removeClass("tree-expand-icon-type2")}}),BI.shortcut("bi.first_tree_node_checkbox",BI.FirstTreeNodeCheckbox),BI.LastTreeNodeCheckbox=BI.inherit(BI.IconButton,{_defaultConfig:function(){return BI.extend(BI.LastTreeNodeCheckbox.superclass._defaultConfig.apply(this,arguments),{extraCls:"tree-collapse-icon-type4",iconWidth:24,iconHeight:24})},setSelected:function(v){BI.LastTreeNodeCheckbox.superclass.setSelected.apply(this,arguments),v===!0?this.element.addClass("tree-expand-icon-type4"):this.element.removeClass("tree-expand-icon-type4")}}),BI.shortcut("bi.last_tree_node_checkbox",BI.LastTreeNodeCheckbox),BI.MidTreeNodeCheckbox=BI.inherit(BI.IconButton,{_defaultConfig:function(){return BI.extend(BI.MidTreeNodeCheckbox.superclass._defaultConfig.apply(this,arguments),{extraCls:"tree-collapse-icon-type3",iconWidth:24,iconHeight:24})},setSelected:function(v){BI.MidTreeNodeCheckbox.superclass.setSelected.apply(this,arguments),v===!0?this.element.addClass("tree-expand-icon-type3"):this.element.removeClass("tree-expand-icon-type3")}}),BI.shortcut("bi.mid_tree_node_checkbox",BI.MidTreeNodeCheckbox),BI.TreeNodeCheckbox=BI.inherit(BI.IconButton,{_defaultConfig:function(){return BI.extend(BI.TreeNodeCheckbox.superclass._defaultConfig.apply(this,arguments),{extraCls:"tree-collapse-icon-type1",iconWidth:24,iconHeight:24})},setSelected:function(v){BI.TreeNodeCheckbox.superclass.setSelected.apply(this,arguments),v?this.element.addClass("tree-expand-icon-type1"):this.element.removeClass("tree-expand-icon-type1")}}),BI.shortcut("bi.tree_node_checkbox",BI.TreeNodeCheckbox),BI.CustomColorChooser=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.CustomColorChooser.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-custom-color-chooser",width:227,height:245})},_init:function(){BI.CustomColorChooser.superclass._init.apply(this,arguments);var self=this,o=this.options;this.editor=BI.createWidget(o.editor,{type:"bi.simple_color_picker_editor"}),this.editor.on(BI.ColorPickerEditor.EVENT_CHANGE,function(){self.setValue(this.getValue())}),this.farbtastic=BI.createWidget({type:"bi.farbtastic"}),this.farbtastic.on(BI.Farbtastic.EVENT_CHANGE,function(){self.setValue(this.getValue())}),BI.createWidget({type:"bi.vtape",element:this,items:[{type:"bi.absolute",items:[{el:this.editor,left:0,top:0,right:0}],height:30},{type:"bi.absolute",items:[{el:this.farbtastic,left:15,right:15,top:7}],height:215}]})},setValue:function(color){this.editor.setValue(color),this.farbtastic.setValue(color)},getValue:function(){return this.editor.getValue()}}),BI.CustomColorChooser.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.custom_color_chooser",BI.CustomColorChooser),BI.ColorChooser=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.ColorChooser.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-color-chooser",value:"",height:24})},_init:function(){BI.ColorChooser.superclass._init.apply(this,arguments);var self=this,o=this.options;this.combo=BI.createWidget({type:"bi.combo",element:this,container:o.container,adjustLength:1,isNeedAdjustWidth:!1,isNeedAdjustHeight:!1,el:BI.extend({type:o.width<=24?"bi.color_chooser_trigger":"bi.long_color_chooser_trigger",ref:function(_ref){self.trigger=_ref},width:o.width-2,height:o.height-2},o.el),popup:{el:BI.extend({type:"bi.color_chooser_popup",ref:function(_ref){self.colorPicker=_ref},listeners:[{eventName:BI.ColorChooserPopup.EVENT_VALUE_CHANGE,action:function(){fn(),self._isRGBColor(self.colorPicker.getValue())||self.combo.hideView()}},{eventName:BI.ColorChooserPopup.EVENT_CHANGE,action:function(){fn(),self.combo.hideView()}}]},o.popup),width:230},value:o.value});var fn=function(){var color=self.colorPicker.getValue();self.trigger.setValue(color)};this.combo.on(BI.Combo.EVENT_AFTER_HIDEVIEW,function(){self.fireEvent(BI.ColorChooser.EVENT_CHANGE,arguments)})},_isRGBColor:function(color){return BI.isNotEmptyString(color)&&"transparent"!==color},isViewVisible:function(){return this.combo.isViewVisible()},hideView:function(){this.combo.hideView()},showView:function(){this.combo.showView()},setValue:function(color){this.combo.setValue(color)},getValue:function(){return this.combo.getValue()}}),BI.ColorChooser.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.color_chooser",BI.ColorChooser),BI.ColorChooserPopup=BI.inherit(BI.Widget,{props:{baseCls:"bi-color-chooser-popup",width:230,height:145,simple:!1},render:function(){var self=this,o=this.options;this.colorEditor=BI.createWidget(o.editor,{type:o.simple?"bi.simple_color_picker_editor":"bi.color_picker_editor",value:o.value,cls:"bi-header-background bi-border-bottom",height:30}),this.colorEditor.on(BI.ColorPickerEditor.EVENT_CHANGE,function(){self.setValue(this.getValue()),self._dealStoreColors(),self.fireEvent(BI.ColorChooserPopup.EVENT_VALUE_CHANGE,arguments)}),this.storeColors=BI.createWidget({type:"bi.color_picker",cls:"bi-border-bottom bi-border-right",items:[this._digestStoreColors(this._getStoreColors())],width:210,height:24,value:o.value}),this.storeColors.on(BI.ColorPicker.EVENT_CHANGE,function(){self.setValue(this.getValue()[0]),self._dealStoreColors(),self.fireEvent(BI.ColorChooserPopup.EVENT_CHANGE,arguments)}),this.colorPicker=BI.createWidget({type:"bi.color_picker",width:210,height:50,value:o.value}),this.colorPicker.on(BI.ColorPicker.EVENT_CHANGE,function(){self.setValue(this.getValue()[0]),self._dealStoreColors(),self.fireEvent(BI.ColorChooserPopup.EVENT_CHANGE,arguments)}),this.customColorChooser=BI.createWidget({type:"bi.custom_color_chooser",editor:o.editor});var panel=BI.createWidget({type:"bi.popup_panel",buttons:[BI.i18nText("BI-Basic_Cancel"),BI.i18nText("BI-Basic_Save")],title:BI.i18nText("BI-Custom_Color"),el:this.customColorChooser,stopPropagation:!1,bgap:-1,rgap:1,lgap:1,minWidth:227});return this.more=BI.createWidget({type:"bi.combo",cls:"bi-border-top",container:null,direction:"right,top",isNeedAdjustHeight:!1,el:{type:"bi.text_item",cls:"color-chooser-popup-more bi-list-item",textAlign:"center",height:24,textLgap:10,text:BI.i18nText("BI-Basic_More")+"..."},popup:panel}),this.more.on(BI.Combo.EVENT_AFTER_POPUPVIEW,function(){self.customColorChooser.setValue(self.getValue())}),panel.on(BI.PopupPanel.EVENT_CLICK_TOOLBAR_BUTTON,function(index){switch(index){case 0:self.more.hideView();break;case 1:self.setValue(self.customColorChooser.getValue()),self._dealStoreColors(),self.more.hideView(),self.fireEvent(BI.ColorChooserPopup.EVENT_CHANGE,arguments)}}),{type:"bi.absolute",items:[{el:{type:"bi.vtape",items:[this.colorEditor,{el:{type:"bi.absolute",items:[{el:this.storeColors,left:10,right:10,top:5}]},height:29},{el:{type:"bi.absolute",items:[{el:this.colorPicker,left:10,right:10,top:5,bottom:5}]},height:60},{el:this.more,height:24}]},left:0,right:0,top:0,bottom:0},{el:{type:"bi.layout",cls:"disable-mask",invisible:!o.disabled,ref:function(){self.mask=this}},left:0,right:0,top:0,bottom:0}]}},mounted:function(){var self=this,o=this.options;BI.isNotNull(o.value)&&this.setValue(o.value)},_setEnable:function(enable){BI.ColorChooserPopup.superclass._setEnable.apply(this,arguments),this.mask.setVisible(!enable)},_dealStoreColors:function(){var color=this.getValue(),colors=this._getStoreColors(),que=new BI.Queue(8);que.fromArray(colors),que.remove(color),que.unshift(color);var array=que.toArray();BI.Cache.setItem("colors",BI.array2String(array)),this.setStoreColors(array)},_digestStoreColors:function(colors){var items=BI.map(colors,function(i,color){return{value:color}});return BI.count(colors.length,8,function(i){items.push({value:"",disabled:!0})}),items},_getStoreColors:function(){var self=this,o=this.options,colorsArray=BI.string2Array(BI.Cache.getItem("colors")||"");return BI.filter(colorsArray,function(idx,color){return!o.simple||self._isRGBColor(color)})},_isRGBColor:function(color){return BI.isNotEmptyString(color)&&"transparent"!==color},setStoreColors:function(colors){BI.isArray(colors)&&this.storeColors.populate([this._digestStoreColors(colors)])},setValue:function(color){this.colorEditor.setValue(color),this.colorPicker.setValue(color),this.storeColors.setValue(color)},getValue:function(){return this.colorEditor.getValue()}}),BI.ColorChooserPopup.EVENT_VALUE_CHANGE="EVENT_VALUE_CHANGE",BI.ColorChooserPopup.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.color_chooser_popup",BI.ColorChooserPopup),BI.SimpleColorChooserPopup=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.SimpleColorChooserPopup.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-color-chooser-popup"})},_init:function(){BI.SimpleColorChooserPopup.superclass._init.apply(this,arguments);var self=this,o=this.options;this.popup=BI.createWidget({type:"bi.color_chooser_popup",value:o.value,element:this,simple:!0}),this.popup.on(BI.ColorChooserPopup.EVENT_CHANGE,function(){self.fireEvent(BI.SimpleColorChooserPopup.EVENT_CHANGE,arguments)}),this.popup.on(BI.ColorChooserPopup.EVENT_VALUE_CHANGE,function(){self.fireEvent(BI.SimpleColorChooserPopup.EVENT_VALUE_CHANGE,arguments)})},setStoreColors:function(colors){this.popup.setStoreColors(colors)},setValue:function(color){this.popup.setValue(color)},getValue:function(){return this.popup.getValue()}}),BI.SimpleColorChooserPopup.EVENT_VALUE_CHANGE="EVENT_VALUE_CHANGE",BI.SimpleColorChooserPopup.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.simple_color_chooser_popup",BI.SimpleColorChooserPopup),BI.SimpleColorChooser=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.SimpleColorChooser.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-simple-color-chooser",value:"#ffffff"})},_init:function(){BI.SimpleColorChooser.superclass._init.apply(this,arguments);var self=this,o=this.options;this.combo=BI.createWidget({type:"bi.color_chooser",element:this,container:o.container,value:o.value,width:o.width,height:o.height,popup:{type:"bi.simple_color_chooser_popup"}}),this.combo.on(BI.ColorChooser.EVENT_CHANGE,function(){self.fireEvent(BI.SimpleColorChooser.EVENT_CHANGE,arguments)})},isViewVisible:function(){return this.combo.isViewVisible()},hideView:function(){this.combo.hideView()},showView:function(){this.combo.showView()},setValue:function(color){this.combo.setValue(color)},getValue:function(){return this.combo.getValue()}}),BI.SimpleColorChooser.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.simple_color_chooser",BI.SimpleColorChooser),BI.ColorChooserTrigger=BI.inherit(BI.Trigger,{_defaultConfig:function(){var conf=BI.ColorChooserTrigger.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{baseCls:(conf.baseCls||"")+" bi-color-chooser-trigger bi-border",height:22})},_init:function(){BI.ColorChooserTrigger.superclass._init.apply(this,arguments),this.colorContainer=BI.createWidget({type:"bi.layout",cls:"color-chooser-trigger-content"+(BI.isIE9Below&&BI.isIE9Below()?" hack":"")});var down=BI.createWidget({type:"bi.icon_button",disableSelected:!0,cls:"icon-combo-down-icon trigger-triangle-font icon-size-12",width:12,height:8});BI.createWidget({type:"bi.absolute",element:this,items:[{el:this.colorContainer,left:3,right:3,top:3,bottom:3},{el:down,right:-1,bottom:1}]}),BI.isNotNull(this.options.value)&&this.setValue(this.options.value)},setValue:function(color){BI.ColorChooserTrigger.superclass.setValue.apply(this,arguments),""===color?this.colorContainer.element.css("background-color","").removeClass("trans-color-background").addClass("auto-color-background"):"transparent"===color?this.colorContainer.element.css("background-color","").removeClass("auto-color-background").addClass("trans-color-background"):this.colorContainer.element.css({"background-color":color}).removeClass("auto-color-background").removeClass("trans-color-background")}}),BI.ColorChooserTrigger.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.color_chooser_trigger",BI.ColorChooserTrigger),BI.LongColorChooserTrigger=BI.inherit(BI.Trigger,{_defaultConfig:function(){var conf=BI.LongColorChooserTrigger.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{baseCls:(conf.baseCls||"")+" bi-color-chooser-trigger bi-border",height:22})},_init:function(){BI.LongColorChooserTrigger.superclass._init.apply(this,arguments);var self=this,o=this.options;this.colorContainer=BI.createWidget({type:"bi.htape",cls:"color-chooser-trigger-content",items:[{type:"bi.icon_change_button",ref:function(_ref){self.changeIcon=_ref},disableSelected:!0,iconCls:"auto-color-icon",width:24,iconWidth:16,iconHeight:16},{el:{type:"bi.label",ref:function(_ref){self.label=_ref},textAlign:"left",hgap:5,height:18,text:BI.i18nText("BI-Basic_Auto")}}]});var down=BI.createWidget({type:"bi.icon_button",disableSelected:!0,cls:"icon-combo-down-icon trigger-triangle-font icon-size-12",width:12,height:8});BI.createWidget({type:"bi.absolute",element:this,items:[{el:this.colorContainer,left:3,right:3,top:3,bottom:3},{el:down,right:3,bottom:3}]}),this.options.value&&this.setValue(this.options.value)},setValue:function(color){BI.LongColorChooserTrigger.superclass.setValue.apply(this,arguments),""===color?(this.colorContainer.element.css("background-color",""),this.changeIcon.setVisible(!0),this.label.setVisible(!0),this.changeIcon.setIcon("auto-color-icon"),this.label.setText(BI.i18nText("BI-Basic_Auto"))):"transparent"===color?(this.colorContainer.element.css("background-color",""),this.changeIcon.setVisible(!0),this.label.setVisible(!0),this.changeIcon.setIcon("trans-color-icon"),this.label.setText(BI.i18nText("BI-Transparent_Color"))):(this.colorContainer.element.css({"background-color":color}),this.changeIcon.setVisible(!1),this.label.setVisible(!1))}}),BI.LongColorChooserTrigger.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.long_color_chooser_trigger",BI.LongColorChooserTrigger),BI.ColorPickerButton=BI.inherit(BI.BasicButton,{_defaultConfig:function(){var conf=BI.ColorPickerButton.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{baseCls:(conf.baseCls||"")+" bi-color-picker-button bi-background bi-border-top bi-border-left"})},_init:function(){BI.ColorPickerButton.superclass._init.apply(this,arguments);var self=this,o=this.options;if(o.value){this.element.css("background-color",o.value);var name=this.getName();this.element.hover(function(){self._createMask(),self.isEnabled()&&BI.Maskers.show(name)},function(){self.isSelected()||BI.Maskers.hide(name)})}},_createMask:function(){var o=this.options,name=this.getName();if(this.isEnabled()&&!BI.Maskers.has(name)){var w=BI.Maskers.make(name,this,{offset:{left:-1,top:-1,right:-1,bottom:-1}});w.element.addClass("color-picker-button-mask").css("background-color",o.value)}},setSelected:function(b){BI.ColorPickerButton.superclass.setSelected.apply(this,arguments),b&&this._createMask(),BI.Maskers[b?"show":"hide"](this.getName())}}),BI.ColorPickerButton.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.color_picker_button",BI.ColorPickerButton),BI.ColorPicker=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.ColorPicker.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-color-picker",items:null})},_items:[[{value:"#ffffff"},{value:"#f2f2f2"},{value:"#e5e5e5"},{value:"#d9d9d9"},{value:"#cccccc"},{value:"#bfbfbf"},{value:"#b2b2b2"},{value:"#a6a6a6"},{value:"#999999"},{value:"#8c8c8c"},{value:"#808080"},{value:"#737373"},{value:"#666666"},{value:"#4d4d4d"},{value:"#333333"},{value:"#000000"}],[{value:"#d8b5a6"},{value:"#ff9e9a"},{value:"#ffc17d"},{value:"#f5e56b"},{value:"#d8e698"},{value:"#e0ebaf"},{value:"#c3d825"},{value:"#bce2e8"},{value:"#85d3cd"},{value:"#bce2e8"},{value:"#a0d8ef"},{value:"#89c3eb"},{value:"#bbc8e6"},{value:"#bbbcde"},{value:"#d6b4cc"},{value:"#fbc0d3"}],[{value:"#bb9581"},{value:"#f37d79"},{value:"#fba74f"},{value:"#ffdb4f"},{value:"#c7dc68"},{value:"#b0ca71"},{value:"#99ab4e"},{value:"#84b9cb"},{value:"#00a3af"},{value:"#2ca9e1"},{value:"#0095d9"},{value:"#4c6cb3"},{value:"#8491c3"},{value:"#a59aca"},{value:"#cc7eb1"},{value:"#e89bb4"}],[{value:"#9d775f"},{value:"#dd4b4b"},{value:"#ef8b07"},{value:"#fcc800"},{value:"#aacf53"},{value:"#82ae46"},{value:"#69821b"},{value:"#59b9c6"},{value:"#2a83a2"},{value:"#007bbb"},{value:"#19448e"},{value:"#274a78"},{value:"#4a488e"},{value:"#7058a3"},{value:"#884898"},{value:"#d47596"}]],_init:function(){BI.ColorPicker.superclass._init.apply(this,arguments);var self=this,o=this.options;this.colors=BI.createWidget({type:"bi.button_group",element:this,items:BI.createItems(o.items||this._items,{type:"bi.color_picker_button",once:!1}),layouts:[{type:"bi.grid"}],value:o.value}),this.colors.on(BI.ButtonGroup.EVENT_CHANGE,function(){self.fireEvent(BI.ColorPicker.EVENT_CHANGE,arguments)})},populate:function(items){var args=[].slice.call(arguments);args[0]=BI.createItems(items,{type:"bi.color_picker_button",once:!1}),this.colors.populate.apply(this.colors,args)},setValue:function(color){this.colors.setValue(color)},getValue:function(){return this.colors.getValue()}}),BI.ColorPicker.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.color_picker",BI.ColorPicker),BI.ColorPickerEditor=BI.inherit(BI.Widget,{constants:{REB_WIDTH:32},_defaultConfig:function(){return BI.extend(BI.ColorPickerEditor.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-color-picker-editor",height:30})},_init:function(){BI.ColorPickerEditor.superclass._init.apply(this,arguments);var self=this,o=this.options,c=this.constants;this.storeValue={},this.colorShow=BI.createWidget({type:"bi.layout",cls:"color-picker-editor-display bi-card bi-border",height:16,width:16});var RGB=BI.createWidgets(BI.createItems([{text:"R"},{text:"G"},{text:"B"}],{type:"bi.label",cls:"color-picker-editor-label",width:20,height:20})),checker=function(v){return BI.isNumeric(v)&&(0|v)>=0&&(0|v)<=255},Ws=BI.createWidgets([{},{},{}],{type:"bi.small_text_editor",cls:"color-picker-editor-input",validationChecker:checker,errorText:BI.i18nText("BI-Color_Picker_Error_Text"),allowBlank:!0,value:255,width:c.REB_WIDTH,height:20});BI.each(Ws,function(i,w){w.on(BI.TextEditor.EVENT_CHANGE,function(){self._checkEditors(),checker(self.storeValue.r)&&checker(self.storeValue.g)&&checker(self.storeValue.b)&&(self.colorShow.element.css("background-color",self.getValue()),self.fireEvent(BI.ColorPickerEditor.EVENT_CHANGE))})}),this.R=Ws[0],this.G=Ws[1],this.B=Ws[2],this.none=BI.createWidget({type:"bi.icon_button",cls:"auto-color-icon",width:16,height:16,iconWidth:16,iconHeight:16,title:BI.i18nText("BI-Basic_Auto")}),this.none.on(BI.IconButton.EVENT_CHANGE,function(){this.isSelected()?(self.lastColor=self.getValue(),self.setValue("")):self.setValue(self.lastColor||"#ffffff"),(self.R.isValid()&&self.G.isValid()&&self.B.isValid()||self._isEmptyRGB())&&(self.colorShow.element.css("background-color",self.getValue()),self.fireEvent(BI.ColorPickerEditor.EVENT_CHANGE))}),this.transparent=BI.createWidget({type:"bi.icon_button",cls:"trans-color-icon",width:16,height:16,iconWidth:16,iconHeight:16,title:BI.i18nText("BI-Transparent_Color")}),this.transparent.on(BI.IconButton.EVENT_CHANGE,function(){this.isSelected()?(self.lastColor=self.getValue(),self.setValue("transparent")):("transparent"===self.lastColor&&(self.lastColor=""),self.setValue(self.lastColor||"#ffffff")),(self.R.isValid()&&self.G.isValid()&&self.B.isValid()||self._isEmptyRGB())&&(self.colorShow.element.css("background-color",self.getValue()),self.fireEvent(BI.ColorPickerEditor.EVENT_CHANGE))}),BI.createWidget({type:"bi.absolute",element:this,items:[{el:{type:"bi.vertical_adapt",items:[{el:this.colorShow,width:16},{el:RGB[0],width:20},{el:this.R,width:c.REB_WIDTH},{el:RGB[1],width:20},{el:this.G,width:c.REB_WIDTH},{el:RGB[2],width:20},{el:this.B,width:c.REB_WIDTH},{el:this.transparent,width:16,lgap:5},{el:this.none,width:16,lgap:5}]},left:10,right:10,top:0,bottom:0}]})},_checkEditors:function(){BI.isEmptyString(this.R.getValue())&&this.R.setValue(0),BI.isEmptyString(this.G.getValue())&&this.G.setValue(0),BI.isEmptyString(this.B.getValue())&&this.B.setValue(0),this.storeValue={r:this.R.getValue()||0,g:this.G.getValue()||0,b:this.B.getValue()||0}},_isEmptyRGB:function(){return BI.isEmptyString(this.storeValue.r)&&BI.isEmptyString(this.storeValue.g)&&BI.isEmptyString(this.storeValue.b)},_showPreColor:function(color){""===color?this.colorShow.element.css("background-color","").removeClass("trans-color-background").addClass("auto-color-normal-background"):"transparent"===color?this.colorShow.element.css("background-color","").removeClass("auto-color-normal-background").addClass("trans-color-background"):this.colorShow.element.css({"background-color":color}).removeClass("auto-color-normal-background").removeClass("trans-color-background")},_setEnable:function(enable){BI.ColorPickerEditor.superclass._setEnable.apply(this,arguments),enable===!0?this.element.removeClass("base-disabled disabled"):enable===!1&&this.element.addClass("base-disabled disabled")},setValue:function(color){if("transparent"===color)return this.transparent.setSelected(!0),this.none.setSelected(!1),this._showPreColor("transparent"),this.R.setValue(""),this.G.setValue(""),this.B.setValue(""),void(this.storeValue={r:"",g:"",b:""});color?this.none.setSelected(!1):(color="",this.none.setSelected(!0)),this.transparent.setSelected(!1),this._showPreColor(color);var json=BI.DOM.rgb2json(BI.DOM.hex2rgb(color));this.storeValue={r:BI.isNull(json.r)?"":json.r,g:BI.isNull(json.r)?"":json.g,b:BI.isNull(json.r)?"":json.b},this.R.setValue(this.storeValue.r),this.G.setValue(this.storeValue.g),this.B.setValue(this.storeValue.b)},getValue:function(){return this._isEmptyRGB()&&this.transparent.isSelected()?"transparent":BI.DOM.rgb2hex(BI.DOM.json2rgb({r:this.storeValue.r,g:this.storeValue.g,b:this.storeValue.b}))}}),BI.ColorPickerEditor.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.color_picker_editor",BI.ColorPickerEditor),BI.SimpleColorPickerEditor=BI.inherit(BI.Widget,{constants:{REB_WIDTH:32},_defaultConfig:function(){return BI.extend(BI.SimpleColorPickerEditor.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-color-picker-editor",height:30})},_init:function(){BI.SimpleColorPickerEditor.superclass._init.apply(this,arguments);var self=this,o=this.options,c=this.constants;this.colorShow=BI.createWidget({type:"bi.layout",cls:"color-picker-editor-display bi-card bi-border",height:16,width:16});var RGB=BI.createWidgets(BI.createItems([{text:"R"},{text:"G"},{text:"B"}],{type:"bi.label",cls:"color-picker-editor-label",width:20,height:20})),checker=function(v){return BI.isNumeric(v)&&(0|v)>=0&&(0|v)<=255},Ws=BI.createWidgets([{},{},{}],{type:"bi.small_text_editor",cls:"color-picker-editor-input",validationChecker:checker,errorText:BI.i18nText("BI-Color_Picker_Error_Text"),allowBlank:!0,value:255,width:c.REB_WIDTH,height:20});BI.each(Ws,function(i,w){w.on(BI.TextEditor.EVENT_CHANGE,function(){self._checkEditors(),self.R.isValid()&&self.G.isValid()&&self.B.isValid()&&(self.colorShow.element.css("background-color",self.getValue()),self.fireEvent(BI.SimpleColorPickerEditor.EVENT_CHANGE))})}),this.R=Ws[0],this.G=Ws[1],this.B=Ws[2],BI.createWidget({type:"bi.vertical_adapt",element:this,items:[{el:this.colorShow,width:16,lgap:20,rgap:15},{el:RGB[0],width:20},{el:this.R,width:c.REB_WIDTH},{el:RGB[1],width:20},{el:this.G,width:c.REB_WIDTH},{el:RGB[2],width:20},{el:this.B,width:c.REB_WIDTH}]})},_checkEditors:function(){BI.isEmptyString(this.R.getValue())&&this.R.setValue(0),BI.isEmptyString(this.G.getValue())&&this.G.setValue(0),BI.isEmptyString(this.B.getValue())&&this.B.setValue(0)},setValue:function(color){this.colorShow.element.css({"background-color":color});var json=BI.DOM.rgb2json(BI.DOM.hex2rgb(color));this.R.setValue(BI.isNull(json.r)?"":json.r),this.G.setValue(BI.isNull(json.g)?"":json.g),this.B.setValue(BI.isNull(json.b)?"":json.b)},getValue:function(){return BI.DOM.rgb2hex(BI.DOM.json2rgb({r:this.R.getValue(),g:this.G.getValue(),b:this.B.getValue()}))}}),BI.SimpleColorPickerEditor.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.simple_color_picker_editor",BI.SimpleColorPickerEditor),BI.Farbtastic=BI.inherit(BI.BasicButton,{constants:{RADIUS:84,SQUARE:100,WIDTH:194},props:{baseCls:"bi-farbtastic",width:195,height:195,stopPropagation:!0,value:"#000000"},render:function(){var self=this;return{type:"bi.absolute",items:[{el:{type:"bi.layout",cls:"",ref:function(_ref){self.colorWrapper=_ref}},top:47,left:47,width:101,height:101},{el:{type:"bi.layout",cls:"wheel",ref:function(_ref){self.wheel=_ref}},left:0,right:0,top:0,bottom:0},{el:{type:"bi.layout",cls:"overlay",ref:function(_ref){self.overlay=_ref}},top:47,left:47,width:101,height:101},{el:{type:"bi.layout",cls:"marker",ref:function(_ref){self.hMarker=_ref},scrollable:!1,width:17,height:17}},{el:{type:"bi.layout",cls:"marker",ref:function(_ref){self.slMarker=_ref},scrollable:!1,width:17,height:17}}]}},mounted:function(){var o=this.options;BI.isKey(o.value)&&this.setValue(o.value)},_unpack:function(color){return 7===color.length?[parseInt("0x"+color.substring(1,3))/255,parseInt("0x"+color.substring(3,5))/255,parseInt("0x"+color.substring(5,7))/255]:4===color.length?[parseInt("0x"+color.substring(1,2))/15,parseInt("0x"+color.substring(2,3))/15,parseInt("0x"+color.substring(3,4))/15]:void 0},_pack:function(rgb){var r=Math.round(255*rgb[0]),g=Math.round(255*rgb[1]),b=Math.round(255*rgb[2]);return"#"+(r<16?"0":"")+r.toString(16)+(g<16?"0":"")+g.toString(16)+(b<16?"0":"")+b.toString(16)},_setColor:function(color){var unpack=this._unpack(color);this.value!==color&&unpack&&(this.value=color,this.rgb=unpack,this.hsl=this._RGBToHSL(this.rgb),this._updateDisplay())},_setHSL:function(hsl){return this.hsl=hsl,this.rgb=this._HSLToRGB(hsl),this.value=this._pack(this.rgb),this._updateDisplay(),this},_HSLToRGB:function(hsl){var m1,m2,r,g,b,h=hsl[0],s=hsl[1],l=hsl[2];return m2=l<=.5?l*(s+1):l+s-l*s,m1=2*l-m2,[this._hueToRGB(m1,m2,h+.33333),this._hueToRGB(m1,m2,h),this._hueToRGB(m1,m2,h-.33333)]},_hueToRGB:function(m1,m2,h){return h=h<0?h+1:h>1?h-1:h,6*h<1?m1+(m2-m1)*h*6:2*h<1?m2:3*h<2?m1+(m2-m1)*(.66666-h)*6:m1},_RGBToHSL:function(rgb){var min,max,delta,h,s,l,r=rgb[0],g=rgb[1],b=rgb[2];return min=Math.min(r,Math.min(g,b)),max=Math.max(r,Math.max(g,b)),delta=max-min,l=(min+max)/2,s=0,l>0&&l<1&&(s=delta/(l<.5?2*l:2-2*l)),h=0,delta>0&&(max==r&&max!=g&&(h+=(g-b)/delta),max==g&&max!=b&&(h+=2+(b-r)/delta),max==b&&max!=r&&(h+=4+(r-g)/delta),h/=6),[h,s,l]},_updateDisplay:function(){var angle=6.28*this.hsl[0];this.hMarker.element.css({left:Math.round(Math.sin(angle)*this.constants.RADIUS+this.constants.WIDTH/2)+"px",top:Math.round(-Math.cos(angle)*this.constants.RADIUS+this.constants.WIDTH/2)+"px"}),this.slMarker.element.css({left:Math.round(this.constants.SQUARE*(.5-this.hsl[1])+this.constants.WIDTH/2)+"px",top:Math.round(this.constants.SQUARE*(.5-this.hsl[2])+this.constants.WIDTH/2)+"px"}),this.colorWrapper.element.css("backgroundColor",this._pack(this._HSLToRGB([this.hsl[0],1,.5]))),this.fireEvent(BI.Farbtastic.EVENT_CHANGE,this.getValue(),this)},_absolutePosition:function(el){var r={x:el.offsetLeft,y:el.offsetTop};if(el.offsetParent){var tmp=this._absolutePosition(el.offsetParent);r.x+=tmp.x,r.y+=tmp.y}return r},_widgetCoords:function(event){var x,y,el=event.target||event.srcElement,reference=this.wheel.element[0];if("undefined"!=typeof event.offsetX){for(var pos={x:event.offsetX,y:event.offsetY},e=el;e;)e.mouseX=pos.x,e.mouseY=pos.y,pos.x+=e.offsetLeft,pos.y+=e.offsetTop,e=e.offsetParent;for(var e=reference,offset={x:0,y:0};e;){if("undefined"!=typeof e.mouseX){x=e.mouseX-offset.x,y=e.mouseY-offset.y;break}offset.x+=e.offsetLeft,offset.y+=e.offsetTop,e=e.offsetParent}for(e=el;e;)e.mouseX=void 0,e.mouseY=void 0,e=e.offsetParent}else{var pos=this._absolutePosition(reference);x=(event.pageX||0)-pos.x,y=(event.pageY||0)-pos.y}return{x:x-this.constants.WIDTH/2,y:y-this.constants.WIDTH/2}},_doMouseMove:function(event){var pos=this._widgetCoords(event);if(this.circleDrag){var hue=Math.atan2(pos.x,-pos.y)/6.28;hue<0&&(hue+=1),this._setHSL([hue,this.hsl[1],this.hsl[2]])}else{var sat=Math.max(0,Math.min(1,-(pos.x/this.constants.SQUARE)+.5)),lum=Math.max(0,Math.min(1,-(pos.y/this.constants.SQUARE)+.5));this._setHSL([this.hsl[0],sat,lum])}},doClick:function(event){var pos=this._widgetCoords(event);return this.circleDrag=2*Math.max(Math.abs(pos.x),Math.abs(pos.y))>this.constants.SQUARE,this._doMouseMove(event),!1},setValue:function(color){this._setColor(color)},getValue:function(){return this.value}}),BI.Farbtastic.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.farbtastic",BI.Farbtastic),BI.BubbleCombo=BI.inherit(BI.Widget,{_const:{TRIANGLE_LENGTH:6},_defaultConfig:function(){return BI.extend(BI.BubbleCombo.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-bubble-combo",trigger:"click",toggle:!0,direction:"bottom,left",isDefaultInit:!1,destroyWhenHide:!1,isNeedAdjustHeight:!0,isNeedAdjustWidth:!0,stopPropagation:!1,adjustLength:0,hideChecker:BI.emptyFn,offsetStyle:"left",el:{},popup:{}})},_init:function(){BI.BubbleCombo.superclass._init.apply(this,arguments);var self=this,o=this.options;this.combo=BI.createWidget({type:"bi.combo",element:this,trigger:o.trigger,toggle:o.toggle,container:o.container,direction:o.direction,isDefaultInit:o.isDefaultInit,destroyWhenHide:o.destroyWhenHide,isNeedAdjustHeight:o.isNeedAdjustHeight,isNeedAdjustWidth:o.isNeedAdjustWidth,adjustLength:this._getAdjustLength(),stopPropagation:o.stopPropagation,adjustXOffset:0,adjustYOffset:0,hideChecker:o.hideChecker,offsetStyle:o.offsetStyle,el:o.el,popup:BI.extend({type:"bi.bubble_popup_view"},o.popup)}),this.combo.on(BI.Combo.EVENT_TRIGGER_CHANGE,function(){self.fireEvent(BI.BubbleCombo.EVENT_TRIGGER_CHANGE,arguments)}),this.combo.on(BI.Combo.EVENT_CHANGE,function(){self.fireEvent(BI.BubbleCombo.EVENT_CHANGE,arguments); +}),this.combo.on(BI.Combo.EVENT_EXPAND,function(){self.fireEvent(BI.BubbleCombo.EVENT_EXPAND,arguments)}),this.combo.on(BI.Combo.EVENT_COLLAPSE,function(){self.fireEvent(BI.BubbleCombo.EVENT_COLLAPSE,arguments)}),this.combo.on(BI.Combo.EVENT_AFTER_INIT,function(){self.fireEvent(BI.BubbleCombo.EVENT_AFTER_INIT,arguments)}),this.combo.on(BI.Combo.EVENT_BEFORE_POPUPVIEW,function(){self.fireEvent(BI.BubbleCombo.EVENT_BEFORE_POPUPVIEW,arguments)}),this.combo.on(BI.Combo.EVENT_AFTER_POPUPVIEW,function(){self._showTriangle(),self.fireEvent(BI.BubbleCombo.EVENT_AFTER_POPUPVIEW,arguments)}),this.combo.on(BI.Combo.EVENT_BEFORE_HIDEVIEW,function(){self._hideTriangle(),self.fireEvent(BI.BubbleCombo.EVENT_BEFORE_HIDEVIEW,arguments)}),this.combo.on(BI.Combo.EVENT_AFTER_HIDEVIEW,function(){self.fireEvent(BI.BubbleCombo.EVENT_AFTER_HIDEVIEW,arguments)})},_getAdjustLength:function(){return this._const.TRIANGLE_LENGTH+this.options.adjustLength},_createTriangle:function(direction){var pos={},op={},adjustLength=this.options.adjustLength,offset=this.element.offset(),left=offset.left,right=offset.left+this.element.outerWidth(),top=offset.top,bottom=offset.top+this.element.outerHeight();switch(direction){case"left":pos={top:top,height:this.element.outerHeight(),left:left-adjustLength-this._const.TRIANGLE_LENGTH},op={width:this._const.TRIANGLE_LENGTH};break;case"right":pos={top:top,height:this.element.outerHeight(),left:right+adjustLength},op={width:this._const.TRIANGLE_LENGTH};break;case"top":pos={left:left,width:this.element.outerWidth(),top:top-adjustLength-this._const.TRIANGLE_LENGTH},op={height:this._const.TRIANGLE_LENGTH};break;case"bottom":pos={left:left,width:this.element.outerWidth(),top:bottom+adjustLength},op={height:this._const.TRIANGLE_LENGTH}}this.triangle&&this.triangle.destroy(),this.triangle=BI.createWidget(op,{type:"bi.center_adapt",cls:"button-combo-triangle-wrapper",items:[{type:"bi.layout",cls:"bubble-combo-triangle-"+direction}]}),pos.el=this.triangle,BI.createWidget({type:"bi.absolute",element:this,items:[pos]})},_createLeftTriangle:function(){this._createTriangle("left")},_createRightTriangle:function(){this._createTriangle("right")},_createTopTriangle:function(){this._createTriangle("top")},_createBottomTriangle:function(){this._createTriangle("bottom")},_showTriangle:function(){var pos=this.combo.getPopupPosition();switch(pos.dir){case"left,top":case"left,bottom":this._createLeftTriangle();break;case"right,top":case"right,bottom":this._createRightTriangle();break;case"top,left":case"top,right":this._createTopTriangle();break;case"bottom,left":case"bottom,right":this._createBottomTriangle()}},_hideTriangle:function(){this.triangle&&this.triangle.destroy(),this.triangle=null},hideView:function(){this._hideTriangle(),this.combo&&this.combo.hideView()},showView:function(){this.combo&&this.combo.showView()},isViewVisible:function(){return this.combo.isViewVisible()}}),BI.BubbleCombo.EVENT_TRIGGER_CHANGE="EVENT_TRIGGER_CHANGE",BI.BubbleCombo.EVENT_CHANGE="EVENT_CHANGE",BI.BubbleCombo.EVENT_EXPAND="EVENT_EXPAND",BI.BubbleCombo.EVENT_COLLAPSE="EVENT_COLLAPSE",BI.BubbleCombo.EVENT_AFTER_INIT="EVENT_AFTER_INIT",BI.BubbleCombo.EVENT_BEFORE_POPUPVIEW="EVENT_BEFORE_POPUPVIEW",BI.BubbleCombo.EVENT_AFTER_POPUPVIEW="EVENT_AFTER_POPUPVIEW",BI.BubbleCombo.EVENT_BEFORE_HIDEVIEW="EVENT_BEFORE_HIDEVIEW",BI.BubbleCombo.EVENT_AFTER_HIDEVIEW="EVENT_AFTER_HIDEVIEW",BI.shortcut("bi.bubble_combo",BI.BubbleCombo),BI.BubblePopupView=BI.inherit(BI.PopupView,{_defaultConfig:function(){var config=BI.BubblePopupView.superclass._defaultConfig.apply(this,arguments);return BI.extend(config,{baseCls:config.baseCls+" bi-bubble-popup-view",minWidth:220,maxWidth:300,minHeight:90})},_init:function(){BI.BubblePopupView.superclass._init.apply(this,arguments)}}),BI.shortcut("bi.bubble_popup_view",BI.BubblePopupView),BI.BubblePopupBarView=BI.inherit(BI.BubblePopupView,{_defaultConfig:function(){return BI.extend(BI.BubblePopupBarView.superclass._defaultConfig.apply(this,arguments),{extraCls:"bi-bubble-bar-popup-view",buttons:[{value:!1,text:BI.i18nText("BI-Basic_Cancel"),ghost:!0},{text:BI.i18nText(BI.i18nText("BI-Basic_Sure")),value:!0}]})},_init:function(){BI.BubblePopupBarView.superclass._init.apply(this,arguments)},_createToolBar:function(){var o=this.options,self=this,items=[];return BI.each(o.buttons,function(i,buttonOpt){BI.isWidget(buttonOpt)?items.push(buttonOpt):items.push(BI.extend({type:"bi.button",height:24,handler:function(v){self.fireEvent(BI.BubblePopupBarView.EVENT_CLICK_TOOLBAR_BUTTON,v)}},buttonOpt))}),BI.createWidget({type:"bi.center",height:44,rgap:15,items:[{type:"bi.right_vertical_adapt",lgap:10,items:items}]})},_createView:function(){var o=this.options,button=BI.createWidget({type:"bi.button_group",items:[o.el],layouts:[{type:"bi.vertical",cls:"bar-popup-container",hgap:15,tgap:10}]});return button.element.css("min-height",o.minHeight-44),button}}),BI.BubblePopupBarView.EVENT_CLICK_TOOLBAR_BUTTON="EVENT_CLICK_TOOLBAR_BUTTON",BI.shortcut("bi.bubble_bar_popup_view",BI.BubblePopupBarView),BI.TextBubblePopupBarView=BI.inherit(BI.Widget,{props:function(){return{baseCls:"bi-text-bubble-bar-popup-view",text:"",buttons:[{level:"ignore",value:!1,stopPropagation:!0,text:BI.i18nText("BI-Basic_Cancel")},{value:!0,stopPropagation:!0,text:BI.i18nText("BI-Basic_Sure")}]}},render:function(){var self=this,o=this.options,buttons=BI.map(o.buttons,function(index,buttonOpt){return BI.isWidget(buttonOpt)?buttonOpt:BI.extend({type:"bi.button",height:24,handler:function(v){self.fireEvent(BI.TextBubblePopupBarView.EVENT_CHANGE,v)}},buttonOpt)});return{type:"bi.bubble_bar_popup_view",minWidth:o.minWidth,maxWidth:o.maxWidth,minHeight:o.minHeight,ref:function(){self.popup=this},el:{type:"bi.label",text:o.text,whiteSpace:"normal",textAlign:"left",ref:function(){self.text=this}},buttons:buttons}},populate:function(v){this.text.setText(v||this.options.text)}}),BI.TextBubblePopupBarView.EVENT_CHANGE="EVENT_CLICK_TOOLBAR_BUTTON",BI.shortcut("bi.text_bubble_bar_popup_view",BI.TextBubblePopupBarView),BI.EditorIconCheckCombo=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.EditorIconCheckCombo.superclass._defaultConfig.apply(this,arguments),{baseClass:"bi-check-editor-combo",width:100,height:24,chooseType:BI.ButtonGroup.CHOOSE_TYPE_SINGLE,validationChecker:BI.emptyFn,quitChecker:BI.emptyFn,allowBlank:!0,watermark:"",errorText:""})},_init:function(){BI.EditorIconCheckCombo.superclass._init.apply(this,arguments);var self=this,o=this.options;this.trigger=BI.createWidget({type:"bi.editor_trigger",items:o.items,height:o.height,validationChecker:o.validationChecker,quitChecker:o.quitChecker,allowBlank:o.allowBlank,watermark:o.watermark,errorText:o.errorText,value:o.value}),this.trigger.on(BI.EditorTrigger.EVENT_CHANGE,function(){self.popup.setValue(this.getValue()),self.fireEvent(BI.EditorIconCheckCombo.EVENT_CHANGE)}),this.popup=BI.createWidget({type:"bi.text_value_check_combo_popup",chooseType:o.chooseType,items:o.items,value:o.value}),this.popup.on(BI.TextValueCheckComboPopup.EVENT_CHANGE,function(){self.setValue(self.popup.getValue()),self.editorIconCheckCombo.hideView(),self.fireEvent(BI.EditorIconCheckCombo.EVENT_CHANGE)}),this.popup.on(BI.Controller.EVENT_CHANGE,function(){self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.editorIconCheckCombo=BI.createWidget({type:"bi.combo",container:o.container,element:this,adjustLength:2,el:this.trigger,popup:{el:this.popup,maxHeight:300}})},setValue:function(v){this.editorIconCheckCombo.setValue(v)},getValue:function(){return this.trigger.getValue()},populate:function(items){this.options.items=items,this.editorIconCheckCombo.populate(items)}}),BI.EditorIconCheckCombo.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.editor_icon_check_combo",BI.EditorIconCheckCombo),BI.IconCombo=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.IconCombo.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-icon-combo",width:24,height:24,el:{},popup:{},minWidth:100,maxWidth:"auto",maxHeight:300,direction:"bottom",adjustLength:3,adjustXOffset:0,adjustYOffset:0,offsetStyle:"left",chooseType:BI.ButtonGroup.CHOOSE_TYPE_SINGLE})},_init:function(){BI.IconCombo.superclass._init.apply(this,arguments);var self=this,o=this.options;this.trigger=BI.createWidget(o.el,{type:"bi.icon_combo_trigger",iconCls:o.iconCls,title:o.title,items:o.items,width:o.width,height:o.height,iconWidth:o.iconWidth,iconHeight:o.iconHeight,value:o.value}),this.popup=BI.createWidget(o.popup,{type:"bi.icon_combo_popup",chooseType:o.chooseType,items:o.items,value:o.value}),this.popup.on(BI.IconComboPopup.EVENT_CHANGE,function(){self.setValue(self.popup.getValue()),self.iconCombo.hideView(),self.fireEvent(BI.IconCombo.EVENT_CHANGE)}),this.popup.on(BI.Controller.EVENT_CHANGE,function(){self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.iconCombo=BI.createWidget({type:"bi.combo",element:this,direction:o.direction,trigger:o.trigger,container:o.container,adjustLength:o.adjustLength,adjustXOffset:o.adjustXOffset,adjustYOffset:o.adjustYOffset,offsetStyle:o.offsetStyle,el:this.trigger,popup:{el:this.popup,maxWidth:o.maxWidth,maxHeight:o.maxHeight,minWidth:o.minWidth}})},showView:function(){this.iconCombo.showView()},hideView:function(){this.iconCombo.hideView()},setValue:function(v){this.trigger.setValue(v),this.popup.setValue(v)},getValue:function(){var value=this.popup.getValue();return BI.isNull(value)?[]:BI.isArray(value)?value:[value]},populate:function(items){this.options.items=items,this.iconCombo.populate(items)}}),BI.IconCombo.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.icon_combo",BI.IconCombo),BI.IconComboPopup=BI.inherit(BI.Pane,{_defaultConfig:function(){return BI.extend(BI.IconComboPopup.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi.icon-combo-popup",chooseType:BI.ButtonGroup.CHOOSE_TYPE_SINGLE})},_init:function(){BI.IconComboPopup.superclass._init.apply(this,arguments);var o=this.options,self=this;this.popup=BI.createWidget({type:"bi.button_group",items:BI.createItems(o.items,{type:"bi.single_select_icon_text_item",height:24}),chooseType:o.chooseType,layouts:[{type:"bi.vertical"}],value:o.value}),this.popup.on(BI.Controller.EVENT_CHANGE,function(type,val,obj){self.fireEvent(BI.Controller.EVENT_CHANGE,arguments),type===BI.Events.CLICK&&self.fireEvent(BI.IconComboPopup.EVENT_CHANGE,val,obj)}),BI.createWidget({type:"bi.vertical",element:this,vgap:5,items:[this.popup]})},populate:function(items){BI.IconComboPopup.superclass.populate.apply(this,arguments),items=BI.createItems(items,{type:"bi.single_select_icon_text_item",height:24}),this.popup.populate(items)},getValue:function(){return this.popup.getValue()},setValue:function(v){this.popup.setValue(v)}}),BI.IconComboPopup.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.icon_combo_popup",BI.IconComboPopup),BI.IconComboTrigger=BI.inherit(BI.Trigger,{_defaultConfig:function(){return BI.extend(BI.IconComboTrigger.superclass._defaultConfig.apply(this,arguments),{extraCls:"bi-icon-combo-trigger",el:{},items:[],iconCls:"",width:24,height:24,isShowDown:!0,value:""})},_init:function(){BI.IconComboTrigger.superclass._init.apply(this,arguments);var o=this.options,self=this,iconCls="";BI.isKey(o.value)&&(iconCls=this._digest(o.value,o.items)),this.button=BI.createWidget(o.el,{type:"bi.icon_change_button",cls:"icon-combo-trigger-icon",iconCls:iconCls,disableSelected:!0,width:o.isShowDown?o.width-12:o.width,height:o.height,iconWidth:o.iconWidth,iconHeight:o.iconHeight,selected:BI.isNotEmptyString(iconCls)}),this.down=BI.createWidget({type:"bi.icon_button",disableSelected:!0,cls:"icon-combo-down-icon trigger-triangle-font font-size-12",width:12,height:8,selected:BI.isNotEmptyString(iconCls)}),this.down.setVisible(o.isShowDown),BI.createWidget({type:"bi.absolute",element:this,items:[{el:this.button,left:0,right:0,top:0,bottom:0},{el:this.down,right:3,bottom:0}]})},_digest:function(v,items){var iconCls="";return v=BI.isArray(v)?v[0]:v,BI.any(items,function(i,item){if(v===item.value)return iconCls=item.iconCls,!0}),iconCls},populate:function(items){var o=this.options;this.options.items=items||[],this.button.setIcon(o.iconCls),this.button.setSelected(!1),this.down.setSelected(!1)},setValue:function(v){BI.IconComboTrigger.superclass.setValue.apply(this,arguments);var o=this.options,iconCls=this._digest(v,this.options.items);v=BI.isArray(v)?v[0]:v,BI.isNotEmptyString(iconCls)?(this.button.setIcon(iconCls),this.button.setSelected(!0),this.down.setSelected(!0)):(this.button.setIcon(o.iconCls),this.button.setSelected(!1),this.down.setSelected(!1))}}),BI.IconComboTrigger.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.icon_combo_trigger",BI.IconComboTrigger),BI.IconTextValueCombo=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.IconTextValueCombo.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-icon-text-value-combo",height:24,iconHeight:null,iconWidth:null,value:"",attributes:{tabIndex:0}})},_init:function(){BI.IconTextValueCombo.superclass._init.apply(this,arguments);var self=this,o=this.options;this.trigger=BI.createWidget({type:"bi.select_icon_text_trigger",cls:"icon-text-value-trigger",items:o.items,height:o.height,text:o.text,iconCls:o.iconCls,value:o.value,iconHeight:o.iconHeight,iconWidth:o.iconWidth,iconWrapperWidth:o.iconWrapperWidth,title:o.title,warningTitle:o.warningTitle}),this.popup=BI.createWidget({type:"bi.icon_text_value_combo_popup",items:o.items,value:o.value,iconHeight:o.iconHeight,iconWidth:o.iconWidth,iconWrapperWidth:o.iconWrapperWidth}),this.popup.on(BI.IconTextValueComboPopup.EVENT_CHANGE,function(){self.setValue(self.popup.getValue()),self.textIconCombo.hideView(),self.fireEvent(BI.IconTextValueCombo.EVENT_CHANGE,arguments)}),this.popup.on(BI.Controller.EVENT_CHANGE,function(){self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.textIconCombo=BI.createWidget({type:"bi.combo",element:this,container:o.container,adjustLength:2,el:this.trigger,popup:{el:this.popup,maxHeight:240,minHeight:25}}),BI.isKey(o.value)&&this.setValue(o.value)},_checkError:function(v){if(BI.isNotNull(v)){v=BI.isArray(v)?v:[v];var result=BI.find(this.options.items,function(idx,item){return BI.contains(v,item.value)});BI.isNull(result)?(this.trigger.options.tipType="warning",this.element.removeClass("combo-error").addClass("combo-error")):(this.trigger.options.tipType="success",this.element.removeClass("combo-error"))}},setValue:function(v){this.trigger.setValue(v),this.popup.setValue(v),this._checkError(v)},getValue:function(){var value=this.popup.getValue();return BI.isNull(value)?[]:BI.isArray(value)?value:[value]},populate:function(items){this.options.items=items,this.textIconCombo.populate(items)}}),BI.IconTextValueCombo.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.icon_text_value_combo",BI.IconTextValueCombo),BI.IconTextValueComboPopup=BI.inherit(BI.Pane,{_defaultConfig:function(){return BI.extend(BI.IconTextValueComboPopup.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-icon-text-icon-popup",behaviors:{redmark:function(){return!0}}})},_init:function(){BI.IconTextValueComboPopup.superclass._init.apply(this,arguments);var o=this.options,self=this;this.popup=BI.createWidget({type:"bi.button_group",items:BI.createItems(o.items,{type:"bi.single_select_icon_text_item",height:24,iconHeight:o.iconHeight,iconWidth:o.iconWidth,iconWrapperWidth:o.iconWrapperWidth}),chooseType:BI.ButtonGroup.CHOOSE_TYPE_SINGLE,layouts:[{type:"bi.vertical"}],behaviors:o.behaviors,value:o.value}),this.popup.on(BI.Controller.EVENT_CHANGE,function(type,val,obj){self.fireEvent(BI.Controller.EVENT_CHANGE,arguments),type===BI.Events.CLICK&&self.fireEvent(BI.IconTextValueComboPopup.EVENT_CHANGE,val,obj)}),this.check(),BI.createWidget({type:"bi.vertical",element:this,vgap:5,items:[this.popup]})},populate:function(items,keyword){BI.IconTextValueComboPopup.superclass.populate.apply(this,arguments);var o=this.options;items=BI.createItems(items,{type:"bi.single_select_icon_text_item",height:24,iconWrapperWidth:o.iconWrapperWidth,iconHeight:o.iconHeight,iconWidth:o.iconWidth}),this.popup.populate(items,keyword)},getValue:function(){return this.popup.getValue()},setValue:function(v){this.popup.setValue(v)}}),BI.IconTextValueComboPopup.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.icon_text_value_combo_popup",BI.IconTextValueComboPopup),BI.SearchTextValueCombo=BI.inherit(BI.Widget,{props:{baseCls:"bi-search-text-value-combo",height:24,text:"",items:[],tipType:"",warningTitle:"",attributes:{tabIndex:0}},render:function(){var self=this,o=this.options;return{type:"bi.absolute",items:[{el:{type:"bi.combo",container:o.container,adjustLength:2,toggle:!1,ref:function(){self.combo=this},el:{type:"bi.search_text_value_trigger",cls:"search-text-value-trigger",ref:function(){self.trigger=this},items:o.items,height:o.height-2,text:o.text,value:o.value,tipType:o.tipType,warningTitle:o.warningTitle,title:o.title,listeners:[{eventName:BI.SearchTextValueTrigger.EVENT_CHANGE,action:function(){self.setValue(this.getValue()),self.combo.hideView(),self.fireEvent(BI.SearchTextValueCombo.EVENT_CHANGE)}}]},popup:{el:{type:"bi.text_value_combo_popup",chooseType:BI.ButtonGroup.CHOOSE_TYPE_SINGLE,value:o.value,items:o.items,ref:function(){self.popup=this,self.trigger.getSearcher().setAdapter(self.popup)},listeners:[{eventName:BI.TextValueComboPopup.EVENT_CHANGE,action:function(){self.setValue(this.getValue()),self.combo.hideView(),self.fireEvent(BI.SearchTextValueCombo.EVENT_CHANGE)}}]},value:o.value,maxHeight:252,minHeight:25},listeners:[{eventName:BI.Combo.EVENT_AFTER_HIDEVIEW,action:function(){self.trigger.stopEditing()}},{eventName:BI.Combo.EVENT_BEFORE_POPUPVIEW,action:function(){self.fireEvent(BI.SearchTextValueCombo.EVENT_BEFORE_POPUPVIEW)}}],hideChecker:function(e){return 0===self.triggerBtn.element.find(e.target).length}},left:0,right:0,bottom:0,top:0},{el:{type:"bi.trigger_icon_button",cls:"trigger-icon-button",ref:function(){self.triggerBtn=this},width:o.height,height:o.height,handler:function(){self.combo.isViewVisible()?self.combo.hideView():self.combo.showView()}},right:0,bottom:0,top:0}]}},mounted:function(){var o=this.options;BI.isKey(o.value)&&this._checkError(o.value)},_checkError:function(v){if(BI.isNotNull(v)){v=BI.isArray(v)?v:[v];var result=BI.find(this.options.items,function(idx,item){return BI.contains(v,item.value)});BI.isNull(result)?(this.element.removeClass("combo-error").addClass("combo-error"),this.trigger.attr("tipType","warning")):(this.element.removeClass("combo-error"),this.trigger.attr("tipType","success"))}},populate:function(items){this.options.items=items,this.combo.populate(items)},setValue:function(v){this.combo.setValue(v),this._checkError(v)},getValue:function(){var value=this.combo.getValue();return BI.isNull(value)?[]:BI.isArray(value)?value:[value]}}),BI.SearchTextValueCombo.EVENT_CHANGE="EVENT_CHANGE",BI.SearchTextValueCombo.EVENT_BEFORE_POPUPVIEW="EVENT_BEFORE_POPUPVIEW",BI.shortcut("bi.search_text_value_combo",BI.SearchTextValueCombo),BI.SearchTextValueComboPopup=BI.inherit(BI.Pane,{props:{baseCls:"bi-search-text-value-popup"},render:function(){var self=this,o=this.options;return{type:"bi.vertical",vgap:5,items:[{type:"bi.button_group",ref:function(){self.popup=this},items:BI.createItems(o.items,{type:"bi.single_select_item",textAlign:o.textAlign,height:24}),chooseType:BI.ButtonGroup.CHOOSE_TYPE_SINGLE,layouts:[{type:"bi.vertical"}],behaviors:{redmark:function(){return!0}},value:o.value,listeners:[{eventName:BI.Controller.EVENT_CHANGE,action:function(type,val,obj){self.fireEvent(BI.Controller.EVENT_CHANGE,arguments),type===BI.Events.CLICK&&self.fireEvent(BI.SearchTextValueComboPopup.EVENT_CHANGE,val,obj)}}]}]}},mounted:function(){this.check()},populate:function(find,match,keyword){var items=BI.concat(find,match);BI.SearchTextValueComboPopup.superclass.populate.apply(this,items),items=BI.createItems(items,{type:"bi.single_select_item",height:24}),this.popup.populate(items,keyword)},getValue:function(){return this.popup.getValue()},setValue:function(v){this.popup.setValue(v)}}),BI.SearchTextValueComboPopup.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.search_text_value_combo_popup",BI.SearchTextValueComboPopup),BI.SearchTextValueTrigger=BI.inherit(BI.Trigger,{props:{extraCls:"bi-search-text-value-trigger bi-border",height:24},render:function(){var self=this,o=this.options;return{type:"bi.htape",items:[{el:{type:"bi.searcher",ref:function(){self.searcher=this},isAutoSearch:!1,el:{type:"bi.state_editor",ref:function(){self.editor=this},defaultText:o.text,text:this._digest(o.value,o.items),value:o.value,height:o.height,tipText:""},popup:{type:"bi.search_text_value_combo_popup",cls:"bi-card",chooseType:BI.ButtonGroup.CHOOSE_TYPE_SINGLE},onSearch:function(obj,callback){var keyword=obj.keyword,finding=BI.Func.getSearchResult(o.items,keyword),matched=finding.match,find=finding.find;callback(find,matched)},listeners:[{eventName:BI.Searcher.EVENT_CHANGE,action:function(){self.fireEvent(BI.SearchTextValueTrigger.EVENT_CHANGE)}}]}},{el:{type:"bi.layout",width:24},width:24}]}},_setState:function(v){this.editor.setState(v)},_digest:function(vals,items){var o=this.options;vals=BI.isArray(vals)?vals:[vals];var result=[],formatItems=BI.Tree.transformToArrayFormat(items);return BI.each(formatItems,function(i,item){BI.deepContains(vals,item.value)&&!BI.contains(result,item.text||item.value)&&result.push(item.text||item.value)}),result.length>0?result.join(","):BI.isFunction(o.text)?o.text():o.text},stopEditing:function(){this.searcher.stopSearch()},getSearcher:function(){return this.searcher},populate:function(items){this.options.items=items},setValue:function(vals){this._setState(this._digest(vals,this.options.items))},getValue:function(){return this.searcher.getValue()}}),BI.SearchTextValueTrigger.EVENT_SEARCHING="EVENT_SEARCHING",BI.SearchTextValueTrigger.EVENT_STOP="EVENT_STOP",BI.SearchTextValueTrigger.EVENT_START="EVENT_START",BI.SearchTextValueTrigger.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.search_text_value_trigger",BI.SearchTextValueTrigger),BI.TextValueCheckCombo=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.TextValueCheckCombo.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-text-value-check-combo",width:100,height:24,chooseType:BI.ButtonGroup.CHOOSE_TYPE_SINGLE,value:"",attributes:{tabIndex:0}})},_init:function(){BI.TextValueCheckCombo.superclass._init.apply(this,arguments);var self=this,o=this.options;this.trigger=BI.createWidget({type:"bi.select_text_trigger",cls:"text-value-trigger",items:o.items,height:o.height,text:o.text,value:o.value}),this.popup=BI.createWidget({type:"bi.text_value_check_combo_popup",chooseType:o.chooseType,items:o.items,value:o.value}),this.popup.on(BI.TextValueCheckComboPopup.EVENT_CHANGE,function(){self.setValue(self.popup.getValue()),self.textIconCheckCombo.hideView(),self.fireEvent(BI.TextValueCheckCombo.EVENT_CHANGE)}),this.popup.on(BI.Controller.EVENT_CHANGE,function(){self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.textIconCheckCombo=BI.createWidget({type:"bi.combo",container:o.container,element:this,adjustLength:2,el:this.trigger,popup:{el:this.popup,maxHeight:300}}),BI.isKey(o.value)&&this.setValue(o.value)},setTitle:function(title){this.trigger.setTitle(title)},setValue:function(v){this.trigger.setValue(v),this.popup.setValue(v)},setWarningTitle:function(title){this.trigger.setWarningTitle(title)},getValue:function(){var value=this.popup.getValue();return BI.isNull(value)?[]:BI.isArray(value)?value:[value]},populate:function(items){this.options.items=items,this.textIconCheckCombo.populate(items)}}),BI.TextValueCheckCombo.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.text_value_check_combo",BI.TextValueCheckCombo),BI.TextValueCheckComboPopup=BI.inherit(BI.Pane,{_defaultConfig:function(){return BI.extend(BI.TextValueCheckComboPopup.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-text-icon-popup",chooseType:BI.ButtonGroup.CHOOSE_TYPE_SINGLE})},_init:function(){BI.TextValueCheckComboPopup.superclass._init.apply(this,arguments);var o=this.options,self=this;this.popup=BI.createWidget({type:"bi.button_group",items:this._formatItems(o.items),chooseType:o.chooseType,layouts:[{type:"bi.vertical"}],value:o.value}),this.popup.on(BI.Controller.EVENT_CHANGE,function(type,val,obj){self.fireEvent(BI.Controller.EVENT_CHANGE,arguments),type===BI.Events.CLICK&&self.fireEvent(BI.TextValueCheckComboPopup.EVENT_CHANGE,val,obj)}),BI.createWidget({type:"bi.vertical",element:this,vgap:5,items:[this.popup]})},_formatItems:function(items){return BI.map(items,function(i,item){return BI.extend({type:"bi.single_select_item",cls:"bi-list-item",height:24},item)})},populate:function(items){BI.TextValueCheckComboPopup.superclass.populate.apply(this,arguments),this.popup.populate(this._formatItems(items))},getValue:function(){return this.popup.getValue()},setValue:function(v){this.popup.setValue(v)}}),BI.TextValueCheckComboPopup.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.text_value_check_combo_popup",BI.TextValueCheckComboPopup),BI.TextValueCombo=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.TextValueCombo.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-text-value-combo",height:24,chooseType:BI.ButtonGroup.CHOOSE_TYPE_SINGLE,text:"",value:"",attributes:{tabIndex:0}})},_init:function(){BI.TextValueCombo.superclass._init.apply(this,arguments);var self=this,o=this.options;this.trigger=BI.createWidget({type:"bi.select_text_trigger",cls:"text-value-trigger",items:o.items,height:o.height,text:o.text,value:o.value,warningTitle:o.warningTitle}),this.popup=BI.createWidget({type:"bi.text_value_combo_popup",chooseType:o.chooseType,value:o.value,items:o.items}),this.popup.on(BI.TextValueComboPopup.EVENT_CHANGE,function(){self.setValue(self.popup.getValue()),self.textIconCombo.hideView(),self.fireEvent(BI.TextValueCombo.EVENT_CHANGE,arguments)}),this.popup.on(BI.Controller.EVENT_CHANGE,function(){self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.textIconCombo=BI.createWidget({type:"bi.combo",container:o.container,element:this,adjustLength:2,el:this.trigger,popup:{el:this.popup,maxHeight:240,minHeight:25}}),BI.isKey(o.value)&&this._checkError(o.value)},_checkError:function(v){if(BI.isNotNull(v)){v=BI.isArray(v)?v:[v];var result=BI.find(this.options.items,function(idx,item){return BI.contains(v,item.value)});BI.isNull(result)?(this.trigger.setTipType("warning"),this.element.removeClass("combo-error").addClass("combo-error")):(this.trigger.setTipType("success"),this.element.removeClass("combo-error"))}},setValue:function(v){this.trigger.setValue(v),this.popup.setValue(v),this._checkError(v)},getValue:function(){var value=this.popup.getValue();return BI.isNull(value)?[]:BI.isArray(value)?value:[value]},populate:function(items){this.options.items=items,this.textIconCombo.populate(items)}}),BI.TextValueCombo.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.text_value_combo",BI.TextValueCombo),BI.SmallTextValueCombo=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.SmallTextValueCombo.superclass._defaultConfig.apply(this,arguments),{width:100,height:20,chooseType:BI.ButtonGroup.CHOOSE_TYPE_SINGLE,el:{},text:""})},_init:function(){BI.SmallTextValueCombo.superclass._init.apply(this,arguments);var self=this,o=this.options;this.trigger=BI.createWidget(o.el,{type:"bi.small_select_text_trigger",items:o.items,height:o.height,text:o.text}),this.popup=BI.createWidget({type:"bi.text_value_combo_popup",chooseType:o.chooseType,items:o.items}),this.popup.on(BI.TextValueComboPopup.EVENT_CHANGE,function(){self.setValue(self.popup.getValue()),self.SmallTextValueCombo.hideView(),self.fireEvent(BI.SmallTextValueCombo.EVENT_CHANGE)}),this.popup.on(BI.Controller.EVENT_CHANGE,function(){self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.SmallTextValueCombo=BI.createWidget({type:"bi.combo",element:this,container:o.container,adjustLength:2,el:this.trigger,popup:{el:this.popup,maxHeight:240,minHeight:25}})},setValue:function(v){this.trigger.setValue(v),this.popup.setValue(v)},getValue:function(){return this.popup.getValue()},populate:function(items){this.options.items=items,this.SmallTextValueCombo.populate(items)}}),BI.SmallTextValueCombo.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.small_text_value_combo",BI.SmallTextValueCombo),BI.TextValueComboPopup=BI.inherit(BI.Pane,{_defaultConfig:function(){return BI.extend(BI.TextValueComboPopup.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-text-icon-popup",chooseType:BI.ButtonGroup.CHOOSE_TYPE_SINGLE})},_init:function(){BI.TextValueComboPopup.superclass._init.apply(this,arguments);var o=this.options,self=this;this.popup=BI.createWidget({type:"bi.button_group",items:BI.createItems(o.items,{type:"bi.single_select_item",textAlign:o.textAlign,height:24}),chooseType:o.chooseType,layouts:[{type:"bi.vertical"}],value:o.value}),this.popup.on(BI.Controller.EVENT_CHANGE,function(type,val,obj){self.fireEvent(BI.Controller.EVENT_CHANGE,arguments),type===BI.Events.CLICK&&self.fireEvent(BI.TextValueComboPopup.EVENT_CHANGE,val,obj)}),this.check(),BI.createWidget({type:"bi.vertical",element:this,vgap:5,items:[this.popup]})},populate:function(items){BI.TextValueComboPopup.superclass.populate.apply(this,arguments),items=BI.createItems(items,{type:"bi.single_select_item",height:24}),this.popup.populate(items)},getValue:function(){return this.popup.getValue()},setValue:function(v){this.popup.setValue(v)}}),BI.TextValueComboPopup.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.text_value_combo_popup",BI.TextValueComboPopup),BI.ClearEditor=BI.inherit(BI.Widget,{_defaultConfig:function(){var conf=BI.ClearEditor.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{baseCls:"bi-clear-editor",height:24,errorText:"",watermark:"",validationChecker:BI.emptyFn,quitChecker:BI.emptyFn})},_init:function(){BI.ClearEditor.superclass._init.apply(this,arguments);var self=this,o=this.options;this.editor=BI.createWidget({type:"bi.editor",height:o.height,watermark:o.watermark,allowBlank:!0,errorText:o.errorText,validationChecker:o.validationChecker,quitChecker:o.quitChecker,value:o.value}),this.clear=BI.createWidget({type:"bi.icon_button",stopEvent:!0,cls:"search-close-h-font"}),this.clear.on(BI.IconButton.EVENT_CHANGE,function(){self.setValue(""),self.fireEvent(BI.Controller.EVENT_CHANGE,BI.Events.STOPEDIT),self.fireEvent(BI.ClearEditor.EVENT_CLEAR)}),BI.createWidget({element:this,type:"bi.htape",items:[{el:this.editor},{el:this.clear,width:24}]}),this.editor.on(BI.Controller.EVENT_CHANGE,function(){self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.editor.on(BI.Editor.EVENT_FOCUS,function(){self.fireEvent(BI.ClearEditor.EVENT_FOCUS)}),this.editor.on(BI.Editor.EVENT_BLUR,function(){self.fireEvent(BI.ClearEditor.EVENT_BLUR)}),this.editor.on(BI.Editor.EVENT_CLICK,function(){self.fireEvent(BI.ClearEditor.EVENT_CLICK)}),this.editor.on(BI.Editor.EVENT_CHANGE,function(){self._checkClear(),self.fireEvent(BI.ClearEditor.EVENT_CHANGE)}),this.editor.on(BI.Editor.EVENT_KEY_DOWN,function(v){self.fireEvent(BI.ClearEditor.EVENT_KEY_DOWN,v)}),this.editor.on(BI.Editor.EVENT_SPACE,function(){self.fireEvent(BI.ClearEditor.EVENT_SPACE)}),this.editor.on(BI.Editor.EVENT_BACKSPACE,function(){self.fireEvent(BI.ClearEditor.EVENT_BACKSPACE)}),this.editor.on(BI.Editor.EVENT_VALID,function(){self.fireEvent(BI.ClearEditor.EVENT_VALID)}),this.editor.on(BI.Editor.EVENT_ERROR,function(){self.fireEvent(BI.ClearEditor.EVENT_ERROR)}),this.editor.on(BI.Editor.EVENT_ENTER,function(){self.fireEvent(BI.ClearEditor.EVENT_ENTER)}),this.editor.on(BI.Editor.EVENT_RESTRICT,function(){self.fireEvent(BI.ClearEditor.EVENT_RESTRICT)}),this.editor.on(BI.Editor.EVENT_EMPTY,function(){self._checkClear(),self.fireEvent(BI.ClearEditor.EVENT_EMPTY)}),this.editor.on(BI.Editor.EVENT_REMOVE,function(){self.fireEvent(BI.ClearEditor.EVENT_REMOVE)}),this.editor.on(BI.Editor.EVENT_CONFIRM,function(){ +self.fireEvent(BI.ClearEditor.EVENT_CONFIRM)}),this.editor.on(BI.Editor.EVENT_CHANGE_CONFIRM,function(){self.fireEvent(BI.ClearEditor.EVENT_CHANGE_CONFIRM)}),this.editor.on(BI.Editor.EVENT_START,function(){self.fireEvent(BI.ClearEditor.EVENT_START)}),this.editor.on(BI.Editor.EVENT_PAUSE,function(){self.fireEvent(BI.ClearEditor.EVENT_PAUSE)}),this.editor.on(BI.Editor.EVENT_STOP,function(){self.fireEvent(BI.ClearEditor.EVENT_STOP)}),BI.isKey(o.value)?this.clear.visible():this.clear.invisible()},_checkClear:function(){this.getValue()?this.clear.visible():this.clear.invisible()},setWaterMark:function(v){this.options.watermark=v,this.editor.setWaterMark(v)},focus:function(){this.editor.focus()},blur:function(){this.editor.blur()},getValue:function(){if(this.isValid()){var res=this.editor.getValue().match(/[\S]+/g);return BI.isNull(res)?"":res[res.length-1]}},setValue:function(v){this.editor.setValue(v),BI.isKey(v)&&this.clear.visible()},isValid:function(){return this.editor.isValid()}}),BI.ClearEditor.EVENT_CHANGE="EVENT_CHANGE",BI.ClearEditor.EVENT_FOCUS="EVENT_FOCUS",BI.ClearEditor.EVENT_BLUR="EVENT_BLUR",BI.ClearEditor.EVENT_CLICK="EVENT_CLICK",BI.ClearEditor.EVENT_KEY_DOWN="EVENT_KEY_DOWN",BI.ClearEditor.EVENT_SPACE="EVENT_SPACE",BI.ClearEditor.EVENT_BACKSPACE="EVENT_BACKSPACE",BI.ClearEditor.EVENT_CLEAR="EVENT_CLEAR",BI.ClearEditor.EVENT_START="EVENT_START",BI.ClearEditor.EVENT_PAUSE="EVENT_PAUSE",BI.ClearEditor.EVENT_STOP="EVENT_STOP",BI.ClearEditor.EVENT_CONFIRM="EVENT_CONFIRM",BI.ClearEditor.EVENT_CHANGE_CONFIRM="EVENT_CHANGE_CONFIRM",BI.ClearEditor.EVENT_VALID="EVENT_VALID",BI.ClearEditor.EVENT_ERROR="EVENT_ERROR",BI.ClearEditor.EVENT_ENTER="EVENT_ENTER",BI.ClearEditor.EVENT_RESTRICT="EVENT_RESTRICT",BI.ClearEditor.EVENT_REMOVE="EVENT_REMOVE",BI.ClearEditor.EVENT_EMPTY="EVENT_EMPTY",BI.shortcut("bi.clear_editor",BI.ClearEditor),BI.ShelterEditor=BI.inherit(BI.Widget,{_defaultConfig:function(){var conf=BI.ShelterEditor.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{baseCls:(conf.baseCls||"")+" bi-shelter-editor",hgap:4,vgap:2,lgap:0,rgap:0,tgap:0,bgap:0,validationChecker:BI.emptyFn,quitChecker:BI.emptyFn,allowBlank:!0,watermark:"",errorText:"",height:24,textAlign:"left"})},_init:function(){BI.ShelterEditor.superclass._init.apply(this,arguments);var self=this,o=this.options;this.editor=BI.createWidget({type:"bi.editor",height:o.height,hgap:o.hgap,vgap:o.vgap,lgap:o.lgap,rgap:o.rgap,tgap:o.tgap,bgap:o.bgap,value:o.value,validationChecker:o.validationChecker,quitChecker:o.quitChecker,allowBlank:o.allowBlank,watermark:o.watermark,errorText:o.errorText}),this.text=BI.createWidget({type:"bi.text_button",cls:"shelter-editor-text",title:o.title,warningTitle:o.warningTitle,tipType:o.tipType,textAlign:o.textAlign,height:o.height,hgap:o.hgap}),BI.createWidget({type:"bi.absolute",element:this,items:[{el:this.text,left:0,right:0,top:0,bottom:0}]}),this.text.on(BI.Controller.EVENT_CHANGE,function(){arguments[2]=self,self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.text.on(BI.TextButton.EVENT_CHANGE,function(){self.fireEvent(BI.ShelterEditor.EVENT_CLICK_LABEL)}),this.editor.on(BI.Controller.EVENT_CHANGE,function(){self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.editor.on(BI.Editor.EVENT_FOCUS,function(){self.fireEvent(BI.ShelterEditor.EVENT_FOCUS,arguments)}),this.editor.on(BI.Editor.EVENT_BLUR,function(){self.fireEvent(BI.ShelterEditor.EVENT_BLUR,arguments)}),this.editor.on(BI.Editor.EVENT_CLICK,function(){self.fireEvent(BI.ShelterEditor.EVENT_CLICK,arguments)}),this.editor.on(BI.Editor.EVENT_CHANGE,function(){self.fireEvent(BI.ShelterEditor.EVENT_CHANGE,arguments)}),this.editor.on(BI.Editor.EVENT_KEY_DOWN,function(v){self.fireEvent(BI.ShelterEditor.EVENT_KEY_DOWN,arguments)}),this.editor.on(BI.Editor.EVENT_VALID,function(){self.fireEvent(BI.ShelterEditor.EVENT_VALID,arguments)}),this.editor.on(BI.Editor.EVENT_CONFIRM,function(){self._showHint(),self._checkText(),self.fireEvent(BI.ShelterEditor.EVENT_CONFIRM,arguments)}),this.editor.on(BI.Editor.EVENT_CHANGE_CONFIRM,function(){self._showHint(),self._checkText(),self.fireEvent(BI.ShelterEditor.EVENT_CHANGE_CONFIRM,arguments)}),this.editor.on(BI.Editor.EVENT_START,function(){self.fireEvent(BI.ShelterEditor.EVENT_START,arguments)}),this.editor.on(BI.Editor.EVENT_PAUSE,function(){self.fireEvent(BI.ShelterEditor.EVENT_PAUSE,arguments)}),this.editor.on(BI.Editor.EVENT_STOP,function(){self.fireEvent(BI.ShelterEditor.EVENT_STOP,arguments)}),this.editor.on(BI.Editor.EVENT_SPACE,function(){self.fireEvent(BI.ShelterEditor.EVENT_SPACE,arguments)}),this.editor.on(BI.Editor.EVENT_ERROR,function(){self._checkText(),self.fireEvent(BI.ShelterEditor.EVENT_ERROR,arguments)}),this.editor.on(BI.Editor.EVENT_ENTER,function(){self.fireEvent(BI.ShelterEditor.EVENT_ENTER,arguments)}),this.editor.on(BI.Editor.EVENT_RESTRICT,function(){self.fireEvent(BI.ShelterEditor.EVENT_RESTRICT,arguments)}),this.editor.on(BI.Editor.EVENT_EMPTY,function(){self.fireEvent(BI.ShelterEditor.EVENT_EMPTY,arguments)}),BI.createWidget({type:"bi.vertical",scrolly:!1,element:this,items:[this.editor]}),this._showHint(),self._checkText(),BI.isKey(o.keyword)&&this.text.doRedMark(o.keyword)},_checkText:function(){var o=this.options;""===this.editor.getValue()?(this.text.setValue(o.watermark||""),this.text.element.addClass("bi-water-mark")):(this.text.setValue(this.editor.getValue()),this.text.element.removeClass("bi-water-mark"))},_showInput:function(){this.editor.visible(),this.text.invisible()},_showHint:function(){this.editor.invisible(),this.text.visible()},setWaterMark:function(v){this.options.watermark=v,this.editor.setWaterMark(v)},setTitle:function(title){this.text.setTitle(title)},setWarningTitle:function(title){this.text.setWarningTitle(title)},focus:function(){this._showInput(),this.editor.focus()},blur:function(){this.editor.blur(),this._showHint(),this._checkText()},doRedMark:function(){""===this.editor.getValue()&&BI.isKey(this.options.watermark)||this.text.doRedMark.apply(this.text,arguments)},unRedMark:function(){this.text.unRedMark.apply(this.text,arguments)},doHighLight:function(){""===this.editor.getValue()&&BI.isKey(this.options.watermark)||this.text.doHighLight.apply(this.text,arguments)},unHighLight:function(){this.text.unHighLight.apply(this.text,arguments)},isValid:function(){return this.editor.isValid()},setErrorText:function(text){this.editor.setErrorText(text)},getErrorText:function(){return this.editor.getErrorText()},isEditing:function(){return this.editor.isEditing()},getLastValidValue:function(){return this.editor.getLastValidValue()},getLastChangedValue:function(){return this.editor.getLastChangedValue()},setTextStyle:function(style){this.text.setStyle(style)},setValue:function(k){var o=this.options;this.editor.setValue(k),this._checkText(),BI.isKey(o.keyword)&&this.text.doRedMark(o.keyword)},getValue:function(){return this.editor.getValue()},getState:function(){return this.text.getValue()},setState:function(v){this._showHint(),this.text.setValue(v)}}),BI.ShelterEditor.EVENT_CHANGE="EVENT_CHANGE",BI.ShelterEditor.EVENT_FOCUS="EVENT_FOCUS",BI.ShelterEditor.EVENT_BLUR="EVENT_BLUR",BI.ShelterEditor.EVENT_CLICK="EVENT_CLICK",BI.ShelterEditor.EVENT_KEY_DOWN="EVENT_KEY_DOWN",BI.ShelterEditor.EVENT_CLICK_LABEL="EVENT_CLICK_LABEL",BI.ShelterEditor.EVENT_START="EVENT_START",BI.ShelterEditor.EVENT_PAUSE="EVENT_PAUSE",BI.ShelterEditor.EVENT_STOP="EVENT_STOP",BI.ShelterEditor.EVENT_CONFIRM="EVENT_CONFIRM",BI.ShelterEditor.EVENT_CHANGE_CONFIRM="EVENT_CHANGE_CONFIRM",BI.ShelterEditor.EVENT_VALID="EVENT_VALID",BI.ShelterEditor.EVENT_ERROR="EVENT_ERROR",BI.ShelterEditor.EVENT_ENTER="EVENT_ENTER",BI.ShelterEditor.EVENT_RESTRICT="EVENT_RESTRICT",BI.ShelterEditor.EVENT_SPACE="EVENT_SPACE",BI.ShelterEditor.EVENT_EMPTY="EVENT_EMPTY",BI.shortcut("bi.shelter_editor",BI.ShelterEditor),BI.SignEditor=BI.inherit(BI.Widget,{_defaultConfig:function(){var conf=BI.SignEditor.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{baseCls:(conf.baseCls||"")+" bi-sign-editor",hgap:4,vgap:2,lgap:0,rgap:0,tgap:0,bgap:0,validationChecker:BI.emptyFn,quitChecker:BI.emptyFn,allowBlank:!0,watermark:"",errorText:"",height:24})},_init:function(){BI.SignEditor.superclass._init.apply(this,arguments);var self=this,o=this.options;this.editor=BI.createWidget({type:"bi.editor",height:o.height,hgap:o.hgap,vgap:o.vgap,lgap:o.lgap,rgap:o.rgap,tgap:o.tgap,bgap:o.bgap,value:o.value,validationChecker:o.validationChecker,quitChecker:o.quitChecker,allowBlank:o.allowBlank,watermark:o.watermark,errorText:o.errorText}),this.text=BI.createWidget({type:"bi.text_button",cls:"sign-editor-text",title:o.title,warningTitle:o.warningTitle,tipType:o.tipType,textAlign:"left",height:o.height,hgap:o.hgap,handler:function(){self._showInput(),self.editor.focus(),self.editor.selectAll()}}),this.text.on(BI.TextButton.EVENT_CHANGE,function(){BI.nextTick(function(){self.fireEvent(BI.SignEditor.EVENT_CLICK_LABEL)})}),BI.createWidget({type:"bi.absolute",element:this,items:[{el:this.text,left:0,right:0,top:0,bottom:0}]}),this.editor.on(BI.Controller.EVENT_CHANGE,function(){self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.editor.on(BI.Editor.EVENT_FOCUS,function(){self.fireEvent(BI.SignEditor.EVENT_FOCUS,arguments)}),this.editor.on(BI.Editor.EVENT_BLUR,function(){self.fireEvent(BI.SignEditor.EVENT_BLUR,arguments)}),this.editor.on(BI.Editor.EVENT_CLICK,function(){self.fireEvent(BI.SignEditor.EVENT_CLICK,arguments)}),this.editor.on(BI.Editor.EVENT_CHANGE,function(){self.fireEvent(BI.SignEditor.EVENT_CHANGE,arguments)}),this.editor.on(BI.Editor.EVENT_KEY_DOWN,function(v){self.fireEvent(BI.SignEditor.EVENT_KEY_DOWN,arguments)}),this.editor.on(BI.Editor.EVENT_VALID,function(){self.fireEvent(BI.SignEditor.EVENT_VALID,arguments)}),this.editor.on(BI.Editor.EVENT_CONFIRM,function(){self._showHint(),self._checkText(),self.fireEvent(BI.SignEditor.EVENT_CONFIRM,arguments)}),this.editor.on(BI.Editor.EVENT_CHANGE_CONFIRM,function(){self._showHint(),self._checkText(),self.fireEvent(BI.SignEditor.EVENT_CHANGE_CONFIRM,arguments)}),this.editor.on(BI.Editor.EVENT_START,function(){self.fireEvent(BI.SignEditor.EVENT_START,arguments)}),this.editor.on(BI.Editor.EVENT_PAUSE,function(){self.fireEvent(BI.SignEditor.EVENT_PAUSE,arguments)}),this.editor.on(BI.Editor.EVENT_STOP,function(){self.fireEvent(BI.SignEditor.EVENT_STOP,arguments)}),this.editor.on(BI.Editor.EVENT_SPACE,function(){self.fireEvent(BI.SignEditor.EVENT_SPACE,arguments)}),this.editor.on(BI.Editor.EVENT_ERROR,function(){self._checkText(),self.fireEvent(BI.SignEditor.EVENT_ERROR,arguments)}),this.editor.on(BI.Editor.EVENT_ENTER,function(){self.fireEvent(BI.SignEditor.EVENT_ENTER,arguments)}),this.editor.on(BI.Editor.EVENT_RESTRICT,function(){self.fireEvent(BI.SignEditor.EVENT_RESTRICT,arguments)}),this.editor.on(BI.Editor.EVENT_EMPTY,function(){self.fireEvent(BI.SignEditor.EVENT_EMPTY,arguments)}),BI.createWidget({type:"bi.vertical",scrolly:!1,element:this,items:[this.editor]}),this._showHint(),self._checkText()},_checkText:function(){var o=this.options;BI.nextTick(BI.bind(function(){""===this.editor.getValue()?(this.text.setValue(o.watermark||""),this.text.element.addClass("bi-water-mark")):(this.text.setValue(this.editor.getValue()),this.text.element.removeClass("bi-water-mark"),BI.isKey(o.keyword)&&this.text.doRedMark(o.keyword))},this))},_showInput:function(){this.editor.visible(),this.text.invisible()},_showHint:function(){this.editor.invisible(),this.text.visible()},setTitle:function(title){this.text.setTitle(title)},setWarningTitle:function(title){this.text.setWarningTitle(title)},setWaterMark:function(v){this.options.watermark=v,this.editor.setWaterMark(v)},focus:function(){this._showInput(),this.editor.focus()},blur:function(){this.editor.blur(),this._showHint(),this._checkText()},doRedMark:function(){""===this.editor.getValue()&&BI.isKey(this.options.watermark)||this.text.doRedMark.apply(this.text,arguments)},unRedMark:function(){this.text.unRedMark.apply(this.text,arguments)},doHighLight:function(){""===this.editor.getValue()&&BI.isKey(this.options.watermark)||this.text.doHighLight.apply(this.text,arguments)},unHighLight:function(){this.text.unHighLight.apply(this.text,arguments)},isValid:function(){return this.editor.isValid()},setErrorText:function(text){this.editor.setErrorText(text)},getErrorText:function(){return this.editor.getErrorText()},isEditing:function(){return this.editor.isEditing()},getLastValidValue:function(){return this.editor.getLastValidValue()},getLastChangedValue:function(){return this.editor.getLastChangedValue()},setValue:function(k){this.editor.setValue(k),this._checkText()},getValue:function(){return this.editor.getValue()},getState:function(){return this.text.getValue()},setState:function(v){this._showHint(),this.text.setValue(v)}}),BI.SignEditor.EVENT_CHANGE="EVENT_CHANGE",BI.SignEditor.EVENT_FOCUS="EVENT_FOCUS",BI.SignEditor.EVENT_BLUR="EVENT_BLUR",BI.SignEditor.EVENT_CLICK="EVENT_CLICK",BI.SignEditor.EVENT_KEY_DOWN="EVENT_KEY_DOWN",BI.SignEditor.EVENT_CLICK_LABEL="EVENT_CLICK_LABEL",BI.SignEditor.EVENT_START="EVENT_START",BI.SignEditor.EVENT_PAUSE="EVENT_PAUSE",BI.SignEditor.EVENT_STOP="EVENT_STOP",BI.SignEditor.EVENT_CONFIRM="EVENT_CONFIRM",BI.SignEditor.EVENT_CHANGE_CONFIRM="EVENT_CHANGE_CONFIRM",BI.SignEditor.EVENT_VALID="EVENT_VALID",BI.SignEditor.EVENT_ERROR="EVENT_ERROR",BI.SignEditor.EVENT_ENTER="EVENT_ENTER",BI.SignEditor.EVENT_RESTRICT="EVENT_RESTRICT",BI.SignEditor.EVENT_SPACE="EVENT_SPACE",BI.SignEditor.EVENT_EMPTY="EVENT_EMPTY",BI.shortcut("bi.sign_editor",BI.SignEditor),BI.StateEditor=BI.inherit(BI.Widget,{_defaultConfig:function(){var conf=BI.StateEditor.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{baseCls:(conf.baseCls||"")+" bi-state-editor",hgap:4,vgap:2,lgap:0,rgap:0,tgap:0,bgap:0,validationChecker:BI.emptyFn,quitChecker:BI.emptyFn,allowBlank:!0,watermark:"",errorText:"",height:24,defaultText:"",text:BI.i18nText("BI-Basic_Unrestricted")})},_init:function(){BI.StateEditor.superclass._init.apply(this,arguments);var self=this,o=this.options;this.editor=BI.createWidget({type:"bi.editor",height:o.height,hgap:o.hgap,vgap:o.vgap,lgap:o.lgap,rgap:o.rgap,tgap:o.tgap,bgap:o.bgap,value:o.value,validationChecker:o.validationChecker,quitChecker:o.quitChecker,allowBlank:o.allowBlank,watermark:o.watermark,errorText:o.errorText}),this.text=BI.createWidget({type:"bi.text_button",cls:"bi-water-mark tip-text-style",textAlign:"left",height:o.height,text:o.text,hgap:o.hgap,handler:function(){self._showInput(),self.editor.focus(),self.editor.setValue("")},title:BI.isNotNull(o.tipText)?o.tipText:function(){var title="";return BI.isString(self.stateValue)&&(title=self.stateValue),BI.isArray(self.stateValue)&&1===self.stateValue.length&&(title=self.stateValue[0]),title},warningTitle:o.warningTitle,tipType:o.tipType}),this.text.on(BI.TextButton.EVENT_CHANGE,function(){BI.nextTick(function(){self.fireEvent(BI.StateEditor.EVENT_CLICK_LABEL)})}),BI.createWidget({type:"bi.absolute",element:this,items:[{el:this.text,left:0,right:0,top:0,bottom:0}]}),this.editor.on(BI.Controller.EVENT_CHANGE,function(){self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.editor.on(BI.Editor.EVENT_FOCUS,function(){self.fireEvent(BI.StateEditor.EVENT_FOCUS,arguments)}),this.editor.on(BI.Editor.EVENT_BLUR,function(){self.fireEvent(BI.StateEditor.EVENT_BLUR,arguments)}),this.editor.on(BI.Editor.EVENT_CLICK,function(){self.fireEvent(BI.StateEditor.EVENT_CLICK,arguments)}),this.editor.on(BI.Editor.EVENT_CHANGE,function(){self.fireEvent(BI.StateEditor.EVENT_CHANGE,arguments)}),this.editor.on(BI.Editor.EVENT_KEY_DOWN,function(v){self.fireEvent(BI.StateEditor.EVENT_KEY_DOWN,arguments)}),this.editor.on(BI.Editor.EVENT_VALID,function(){self.fireEvent(BI.StateEditor.EVENT_VALID,arguments)}),this.editor.on(BI.Editor.EVENT_CONFIRM,function(){self._showHint(),self.fireEvent(BI.StateEditor.EVENT_CONFIRM,arguments)}),this.editor.on(BI.Editor.EVENT_CHANGE_CONFIRM,function(){self._showHint(),self.fireEvent(BI.StateEditor.EVENT_CHANGE_CONFIRM,arguments)}),this.editor.on(BI.Editor.EVENT_START,function(){self.fireEvent(BI.StateEditor.EVENT_START,arguments)}),this.editor.on(BI.Editor.EVENT_PAUSE,function(){self.fireEvent(BI.StateEditor.EVENT_PAUSE,arguments)}),this.editor.on(BI.Editor.EVENT_STOP,function(){self.fireEvent(BI.StateEditor.EVENT_STOP,arguments)}),this.editor.on(BI.Editor.EVENT_SPACE,function(){self.fireEvent(BI.StateEditor.EVENT_SPACE,arguments)}),this.editor.on(BI.Editor.EVENT_ERROR,function(){self.fireEvent(BI.StateEditor.EVENT_ERROR,arguments)}),this.editor.on(BI.Editor.EVENT_ENTER,function(){self.fireEvent(BI.StateEditor.EVENT_ENTER,arguments)}),this.editor.on(BI.Editor.EVENT_RESTRICT,function(){self.fireEvent(BI.StateEditor.EVENT_RESTRICT,arguments)}),this.editor.on(BI.Editor.EVENT_EMPTY,function(){self.fireEvent(BI.StateEditor.EVENT_EMPTY,arguments)}),BI.createWidget({type:"bi.vertical",scrolly:!1,element:this,items:[this.editor]}),this._showHint(),BI.isNotNull(o.text)&&this.setState(o.text)},setWaterMark:function(v){this.options.watermark=v,this.editor.setWaterMark(v)},doRedMark:function(){""===this.editor.getValue()&&BI.isKey(this.options.watermark)||this.text.doRedMark.apply(this.text,arguments)},unRedMark:function(){this.text.unRedMark.apply(this.text,arguments)},doHighLight:function(){""===this.editor.getValue()&&BI.isKey(this.options.watermark)||this.text.doHighLight.apply(this.text,arguments)},unHighLight:function(){this.text.unHighLight.apply(this.text,arguments)},focus:function(){this.options.disabled===!1&&(this._showInput(),this.editor.focus())},blur:function(){this.editor.blur(),this._showHint()},_showInput:function(){this.editor.visible(),this.text.invisible()},_showHint:function(){this.editor.invisible(),this.text.visible()},isValid:function(){return this.editor.isValid()},setErrorText:function(text){this.editor.setErrorText(text)},getErrorText:function(){return this.editor.getErrorText()},isEditing:function(){return this.editor.isEditing()},getLastValidValue:function(){return this.editor.getLastValidValue()},getLastChangedValue:function(){return this.editor.getLastChangedValue()},setValue:function(k){this.editor.setValue(k)},getValue:function(){return this.editor.getValue()},getState:function(){return this.editor.getValue().match(/[^\s]+/g)},setState:function(v){var o=this.options;return BI.StateEditor.superclass.setValue.apply(this,arguments),this.stateValue=v,BI.isNumber(v)?void(v===BI.Selection.All?(this.text.setText(BI.i18nText("BI-Select_All")),this.text.element.removeClass("bi-water-mark")):v===BI.Selection.Multi?(this.text.setText(BI.i18nText("BI-Select_Part")),this.text.element.removeClass("bi-water-mark")):(this.text.setText(BI.isKey(o.defaultText)?o.defaultText:o.text),BI.isKey(o.defaultText)?this.text.element.addClass("bi-water-mark"):this.text.element.removeClass("bi-water-mark"))):BI.isString(v)?(this.text.setText(v),void(BI.isKey(o.defaultText)&&o.defaultText===v?this.text.element.addClass("bi-water-mark"):this.text.element.removeClass("bi-water-mark"))):void(BI.isArray(v)&&(BI.isEmpty(v)?(this.text.setText(BI.isKey(o.defaultText)?o.defaultText:o.text),BI.isKey(o.defaultText)?this.text.element.addClass("bi-water-mark"):this.text.element.removeClass("bi-water-mark")):1===v.length?(this.text.setText(v[0]),this.text.element.removeClass("bi-water-mark")):(this.text.setText(BI.i18nText("BI-Select_Part")),this.text.element.removeClass("bi-water-mark"))))},setTipType:function(v){this.text.options.tipType=v}}),BI.StateEditor.EVENT_CHANGE="EVENT_CHANGE",BI.StateEditor.EVENT_FOCUS="EVENT_FOCUS",BI.StateEditor.EVENT_BLUR="EVENT_BLUR",BI.StateEditor.EVENT_CLICK="EVENT_CLICK",BI.StateEditor.EVENT_KEY_DOWN="EVENT_KEY_DOWN",BI.StateEditor.EVENT_CLICK_LABEL="EVENT_CLICK_LABEL",BI.StateEditor.EVENT_START="EVENT_START",BI.StateEditor.EVENT_PAUSE="EVENT_PAUSE",BI.StateEditor.EVENT_STOP="EVENT_STOP",BI.StateEditor.EVENT_CONFIRM="EVENT_CONFIRM",BI.StateEditor.EVENT_CHANGE_CONFIRM="EVENT_CHANGE_CONFIRM",BI.StateEditor.EVENT_VALID="EVENT_VALID",BI.StateEditor.EVENT_ERROR="EVENT_ERROR",BI.StateEditor.EVENT_ENTER="EVENT_ENTER",BI.StateEditor.EVENT_RESTRICT="EVENT_RESTRICT",BI.StateEditor.EVENT_SPACE="EVENT_SPACE",BI.StateEditor.EVENT_EMPTY="EVENT_EMPTY",BI.shortcut("bi.state_editor",BI.StateEditor),BI.SimpleStateEditor=BI.inherit(BI.Widget,{_defaultConfig:function(){var conf=BI.SimpleStateEditor.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{baseCls:(conf.baseCls||"")+" bi-simple-state-editor",hgap:4,vgap:2,lgap:0,rgap:0,tgap:0,bgap:0,validationChecker:BI.emptyFn,quitChecker:BI.emptyFn,mouseOut:!1,allowBlank:!0,watermark:"",errorText:"",height:24,text:BI.i18nText("BI-Basic_Unrestricted")})},_init:function(){BI.SimpleStateEditor.superclass._init.apply(this,arguments);var self=this,o=this.options;this.editor=BI.createWidget({type:"bi.editor",height:o.height,hgap:o.hgap,vgap:o.vgap,lgap:o.lgap,rgap:o.rgap,tgap:o.tgap,bgap:o.bgap,value:o.value,validationChecker:o.validationChecker,quitChecker:o.quitChecker,allowBlank:o.allowBlank,watermark:o.watermark,errorText:o.errorText}),this.text=BI.createWidget({type:"bi.text_button",cls:"bi-water-mark",textAlign:"left",text:o.text,height:o.height,hgap:o.hgap,handler:function(){self._showInput(),self.editor.focus(),self.editor.setValue("")}}),this.text.on(BI.TextButton.EVENT_CHANGE,function(){BI.nextTick(function(){self.fireEvent(BI.SimpleStateEditor.EVENT_CLICK_LABEL)})}),BI.createWidget({type:"bi.absolute",element:this,items:[{el:this.text,left:0,right:0,top:0,bottom:0}]}),this.editor.on(BI.Controller.EVENT_CHANGE,function(){self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.editor.on(BI.Editor.EVENT_FOCUS,function(){self.fireEvent(BI.SimpleStateEditor.EVENT_FOCUS,arguments)}),this.editor.on(BI.Editor.EVENT_BLUR,function(){self.fireEvent(BI.SimpleStateEditor.EVENT_BLUR,arguments)}),this.editor.on(BI.Editor.EVENT_CLICK,function(){self.fireEvent(BI.SimpleStateEditor.EVENT_CLICK,arguments)}),this.editor.on(BI.Editor.EVENT_CHANGE,function(){self.fireEvent(BI.SimpleStateEditor.EVENT_CHANGE,arguments)}),this.editor.on(BI.Editor.EVENT_KEY_DOWN,function(v){self.fireEvent(BI.SimpleStateEditor.EVENT_KEY_DOWN,arguments)}),this.editor.on(BI.Editor.EVENT_VALID,function(){self.fireEvent(BI.SimpleStateEditor.EVENT_VALID,arguments)}),this.editor.on(BI.Editor.EVENT_CONFIRM,function(){self._showHint(),self.fireEvent(BI.SimpleStateEditor.EVENT_CONFIRM,arguments)}),this.editor.on(BI.Editor.EVENT_CHANGE_CONFIRM,function(){self._showHint(),self.fireEvent(BI.SimpleStateEditor.EVENT_CHANGE_CONFIRM,arguments)}),this.editor.on(BI.Editor.EVENT_START,function(){self.fireEvent(BI.SimpleStateEditor.EVENT_START,arguments)}),this.editor.on(BI.Editor.EVENT_PAUSE,function(){self.fireEvent(BI.SimpleStateEditor.EVENT_PAUSE,arguments)}),this.editor.on(BI.Editor.EVENT_STOP,function(){self.fireEvent(BI.SimpleStateEditor.EVENT_STOP,arguments)}),this.editor.on(BI.Editor.EVENT_SPACE,function(){self.fireEvent(BI.SimpleStateEditor.EVENT_SPACE,arguments)}),this.editor.on(BI.Editor.EVENT_ERROR,function(){self.fireEvent(BI.SimpleStateEditor.EVENT_ERROR,arguments)}),this.editor.on(BI.Editor.EVENT_ENTER,function(){self.fireEvent(BI.SimpleStateEditor.EVENT_ENTER,arguments)}),this.editor.on(BI.Editor.EVENT_RESTRICT,function(){self.fireEvent(BI.SimpleStateEditor.EVENT_RESTRICT,arguments)}),this.editor.on(BI.Editor.EVENT_EMPTY,function(){self.fireEvent(BI.SimpleStateEditor.EVENT_EMPTY,arguments)}),BI.createWidget({type:"bi.vertical",scrolly:!1,element:this,items:[this.editor]}),this._showHint(),BI.isNotNull(o.text)&&this.setState(o.text)},setWaterMark:function(v){this.options.watermark=v,this.editor.setWaterMark(v)},doRedMark:function(){""===this.editor.getValue()&&BI.isKey(this.options.watermark)||this.text.doRedMark.apply(this.text,arguments)},unRedMark:function(){this.text.unRedMark.apply(this.text,arguments)},doHighLight:function(){""===this.editor.getValue()&&BI.isKey(this.options.watermark)||this.text.doHighLight.apply(this.text,arguments)},unHighLight:function(){this.text.unHighLight.apply(this.text,arguments)},focus:function(){this._showInput(),this.editor.focus()},blur:function(){this.editor.blur(),this._showHint()},_showInput:function(){this.editor.visible(),this.text.invisible()},_showHint:function(){this.editor.invisible(),this.text.visible()},isValid:function(){return this.editor.isValid()},setErrorText:function(text){this.editor.setErrorText(text)},getErrorText:function(){return this.editor.getErrorText()},isEditing:function(){return this.editor.isEditing()},getLastValidValue:function(){return this.editor.getLastValidValue()},getLastChangedValue:function(){return this.editor.getLastChangedValue()},setValue:function(k){this.editor.setValue(k)},getValue:function(){return this.editor.getValue()},getState:function(){return this.editor.getValue().match(/[^\s]+/g)},setState:function(v){var o=this.options;return BI.SimpleStateEditor.superclass.setValue.apply(this,arguments),BI.isNumber(v)?void(v===BI.Selection.All?(this.text.setText(BI.i18nText("BI-Already_Selected")),this.text.element.removeClass("bi-water-mark")):v===BI.Selection.Multi?(this.text.setText(BI.i18nText("BI-Already_Selected")),this.text.element.removeClass("bi-water-mark")):(this.text.setText(o.text),this.text.element.addClass("bi-water-mark"))):void(BI.isArray(v)&&1!==v.length?BI.isEmpty(v)?(this.text.setText(o.text),this.text.element.addClass("bi-water-mark")):(this.text.setText(BI.i18nText("BI-Already_Selected")),this.text.element.removeClass("bi-water-mark")):(this.text.setText(v),this.text.setTitle(v),this.text.element.removeClass("bi-water-mark")))}}),BI.SimpleStateEditor.EVENT_CHANGE="EVENT_CHANGE",BI.SimpleStateEditor.EVENT_FOCUS="EVENT_FOCUS",BI.SimpleStateEditor.EVENT_BLUR="EVENT_BLUR",BI.SimpleStateEditor.EVENT_CLICK="EVENT_CLICK",BI.SimpleStateEditor.EVENT_KEY_DOWN="EVENT_KEY_DOWN",BI.SimpleStateEditor.EVENT_CLICK_LABEL="EVENT_CLICK_LABEL",BI.SimpleStateEditor.EVENT_START="EVENT_START",BI.SimpleStateEditor.EVENT_PAUSE="EVENT_PAUSE",BI.SimpleStateEditor.EVENT_STOP="EVENT_STOP",BI.SimpleStateEditor.EVENT_CONFIRM="EVENT_CONFIRM",BI.SimpleStateEditor.EVENT_CHANGE_CONFIRM="EVENT_CHANGE_CONFIRM",BI.SimpleStateEditor.EVENT_VALID="EVENT_VALID",BI.SimpleStateEditor.EVENT_ERROR="EVENT_ERROR",BI.SimpleStateEditor.EVENT_ENTER="EVENT_ENTER",BI.SimpleStateEditor.EVENT_RESTRICT="EVENT_RESTRICT",BI.SimpleStateEditor.EVENT_SPACE="EVENT_SPACE",BI.SimpleStateEditor.EVENT_EMPTY="EVENT_EMPTY",BI.shortcut("bi.simple_state_editor",BI.SimpleStateEditor),BI.MultiPopupView=BI.inherit(BI.PopupView,{_defaultConfig:function(){var conf=BI.MultiPopupView.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{_baseCls:(conf._baseCls||"")+" bi-multi-list-view",buttons:[BI.i18nText("BI-Basic_Sure")]})},_init:function(){BI.MultiPopupView.superclass._init.apply(this,arguments)},_createToolBar:function(){var o=this.options,self=this;if(0!==o.buttons.length){var text=[];return BI.each(o.buttons,function(idx,item){text.push({text:item,value:idx})}),this.buttongroup=BI.createWidget({type:"bi.button_group",cls:"list-view-toolbar bi-high-light bi-split-top",height:24,items:BI.createItems(text,{type:"bi.text_button",once:!1,shadow:!0,isShadowShowingOnSelected:!0}),layouts:[{type:"bi.center",hgap:0,vgap:0}]}),this.buttongroup.on(BI.ButtonGroup.EVENT_CHANGE,function(value,obj){self.fireEvent(BI.MultiPopupView.EVENT_CLICK_TOOLBAR_BUTTON,value,obj)}),this.buttongroup}}}),BI.MultiPopupView.EVENT_CHANGE="EVENT_CHANGE",BI.MultiPopupView.EVENT_CLICK_TOOLBAR_BUTTON="EVENT_CLICK_TOOLBAR_BUTTON",BI.shortcut("bi.multi_popup_view",BI.MultiPopupView),BI.PopupPanel=BI.inherit(BI.MultiPopupView,{_defaultConfig:function(){var conf=BI.PopupPanel.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{baseCls:(conf.baseCls||"")+" bi-popup-panel",title:""})},_init:function(){BI.PopupPanel.superclass._init.apply(this,arguments)},_createTool:function(){var self=this,o=this.options,close=BI.createWidget({type:"bi.icon_button",cls:"close-h-font",width:25,height:25});return close.on(BI.IconButton.EVENT_CHANGE,function(){self.setVisible(!1),self.fireEvent(BI.PopupPanel.EVENT_CLOSE)}),BI.createWidget({type:"bi.htape",cls:"popup-panel-title bi-header-background",height:25,items:[{el:{type:"bi.label",textAlign:"left",text:o.title,height:25,lgap:10}},{el:close,width:25}]})}}),BI.PopupPanel.EVENT_CHANGE="EVENT_CHANGE",BI.PopupPanel.EVENT_CLOSE="EVENT_CLOSE",BI.PopupPanel.EVENT_CLICK_TOOLBAR_BUTTON="EVENT_CLICK_TOOLBAR_BUTTON",BI.shortcut("bi.popup_panel",BI.PopupPanel),BI.ListPane=BI.inherit(BI.Pane,{_defaultConfig:function(){var conf=BI.ListPane.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{baseCls:(conf.baseCls||"")+" bi-list-pane",logic:{dynamic:!0},lgap:0,rgap:0,tgap:0,bgap:0,vgap:0,hgap:0,items:[],itemsCreator:BI.emptyFn,hasNext:BI.emptyFn,onLoaded:BI.emptyFn,el:{type:"bi.button_group"}})},_init:function(){BI.ListPane.superclass._init.apply(this,arguments);var self=this,o=this.options;this.button_group=BI.createWidget(o.el,{type:"bi.button_group",chooseType:BI.ButtonGroup.CHOOSE_TYPE_SINGLE,behaviors:{},items:o.items,itemsCreator:function(op,calback){1===op.times&&(self.empty(),BI.nextTick(function(){self.loading()})),o.itemsCreator(op,function(){calback.apply(self,arguments),1===op.times&&BI.nextTick(function(){self.loaded(),self.check()})})},hasNext:o.hasNext,layouts:[{type:"bi.vertical"}]}),this.button_group.on(BI.Controller.EVENT_CHANGE,function(type,value,obj){self.fireEvent(BI.Controller.EVENT_CHANGE,arguments),type===BI.Events.CLICK&&self.fireEvent(BI.ListPane.EVENT_CHANGE,value,obj)}),this.check(),BI.createWidget(BI.extend({element:this},BI.LogicFactory.createLogic(BI.LogicFactory.createLogicTypeByDirection(BI.Direction.Top),BI.extend({scrolly:!0,lgap:o.lgap,rgap:o.rgap,tgap:o.tgap,bgap:o.bgap,vgap:o.vgap,hgap:o.hgap},o.logic,{items:BI.LogicFactory.createLogicItemsByDirection(BI.Direction.Top,this.button_group)}))))},hasPrev:function(){return this.button_group.hasPrev&&this.button_group.hasPrev()},hasNext:function(){return this.button_group.hasNext&&this.button_group.hasNext()},prependItems:function(items){this.options.items=items.concat(this.options.items),this.button_group.prependItems.apply(this.button_group,arguments),this.check()},addItems:function(items){this.options.items=this.options.items.concat(items),this.button_group.addItems.apply(this.button_group,arguments),this.check()},removeItemAt:function(indexes){indexes=indexes||[],BI.removeAt(this.options.items,indexes),this.button_group.removeItemAt.apply(this.button_group,arguments),this.check()},populate:function(items){var self=this,o=this.options;return 0===arguments.length&&BI.isFunction(this.button_group.attr("itemsCreator"))?void this.button_group.attr("itemsCreator").apply(this,[{times:1},function(){if(0===arguments.length)throw new Error("参数不能为空");self.populate.apply(self,arguments)}]):(BI.ListPane.superclass.populate.apply(this,arguments),void this.button_group.populate.apply(this.button_group,arguments))},empty:function(){this.button_group.empty()},setNotSelectedValue:function(){this.button_group.setNotSelectedValue.apply(this.button_group,arguments)},getNotSelectedValue:function(){return this.button_group.getNotSelectedValue()},setValue:function(){this.button_group.setValue.apply(this.button_group,arguments)},getValue:function(){return this.button_group.getValue.apply(this.button_group,arguments)},getAllButtons:function(){return this.button_group.getAllButtons()},getAllLeaves:function(){return this.button_group.getAllLeaves()},getSelectedButtons:function(){return this.button_group.getSelectedButtons()},getNotSelectedButtons:function(){return this.button_group.getNotSelectedButtons()},getIndexByValue:function(value){return this.button_group.getIndexByValue(value)},getNodeById:function(id){return this.button_group.getNodeById(id); +},getNodeByValue:function(value){return this.button_group.getNodeByValue(value)}}),BI.ListPane.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.list_pane",BI.ListPane),BI.Panel=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.Panel.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-panel bi-border",title:"",titleButtons:[],el:{},logic:{dynamic:!1}})},_init:function(){BI.Panel.superclass._init.apply(this,arguments);var o=this.options;BI.createWidget(BI.extend({element:this},BI.LogicFactory.createLogic("vertical",BI.extend(o.logic,{items:BI.LogicFactory.createLogicItemsByDirection("top",this._createTitle(),this.options.el)}))))},_createTitle:function(){var self=this,o=this.options;return this.text=BI.createWidget({type:"bi.label",cls:"panel-title-text",text:o.title,height:30}),this.button_group=BI.createWidget({type:"bi.button_group",items:o.titleButtons,layouts:[{type:"bi.center_adapt",lgap:10}]}),this.button_group.on(BI.Controller.EVENT_CHANGE,function(){self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.button_group.on(BI.ButtonGroup.EVENT_CHANGE,function(value,obj){self.fireEvent(BI.Panel.EVENT_CHANGE,value,obj)}),{el:{type:"bi.left_right_vertical_adapt",cls:"panel-title bi-header-background bi-border-bottom",height:29,items:{left:[this.text],right:[this.button_group]},lhgap:10,rhgap:10},height:29}},setTitle:function(title){this.text.setValue(title)}}),BI.Panel.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.panel",BI.Panel),BI.LinearSegmentButton=BI.inherit(BI.BasicButton,{props:{extraCls:"bi-line-segment-button bi-list-item-effect",once:!0,readonly:!0,hgap:10,height:25},render:function(){var self=this,o=this.options;return[{type:"bi.label",text:o.text,height:o.height,value:o.value,hgap:o.hgap,ref:function(){self.text=this}},{type:"bi.absolute",items:[{el:{type:"bi.layout",cls:"line-segment-button-line",height:2,ref:function(){self.line=this}},left:0,right:0,bottom:0}]}]},setSelected:function(v){BI.LinearSegmentButton.superclass.setSelected.apply(this,arguments),v?this.line.element.addClass("bi-high-light-background"):this.line.element.removeClass("bi-high-light-background")},setText:function(text){this.text.setText(text)}}),BI.shortcut("bi.linear_segment_button",BI.LinearSegmentButton),BI.LinearSegment=BI.inherit(BI.Widget,{props:{baseCls:"bi-linear-segment bi-split-bottom",items:[],height:29},render:function(){var self=this,o=this.options;return{type:"bi.button_group",items:BI.createItems(o.items,{type:"bi.linear_segment_button",height:o.height-1}),layout:[{type:"bi.center"}],listeners:[{eventName:"__EVENT_CHANGE__",action:function(){self.fireEvent("__EVENT_CHANGE__",arguments)}},{eventName:"EVENT_CHANGE",action:function(){self.fireEvent("EVENT_CHANGE")}}],ref:function(){self.buttonGroup=this}}},setValue:function(v){this.buttonGroup.setValue(v)},setEnabledValue:function(v){this.buttonGroup.setEnabledValue(v)},getValue:function(){return this.buttonGroup.getValue()}}),BI.shortcut("bi.linear_segment",BI.LinearSegment),BI.SelectList=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.SelectList.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-select-list",direction:BI.Direction.Top,logic:{dynamic:!0},items:[],itemsCreator:BI.emptyFn,hasNext:BI.emptyFn,onLoaded:BI.emptyFn,toolbar:{type:"bi.multi_select_bar",iconWrapperWidth:36},el:{type:"bi.list_pane"}})},_init:function(){BI.SelectList.superclass._init.apply(this,arguments);var self=this,o=this.options;this.toolbar=BI.createWidget(o.toolbar),this.allSelected=!1,this.toolbar.on(BI.Controller.EVENT_CHANGE,function(type,value,obj){self.allSelected=this.isSelected(),type===BI.Events.CLICK&&(self.setAllSelected(self.allSelected),self.fireEvent(BI.SelectList.EVENT_CHANGE,value,obj)),self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.list=BI.createWidget(o.el,{type:"bi.list_pane",items:o.items,itemsCreator:function(op,callback){1===op.times&&self.toolbar.setVisible(!1),o.itemsCreator(op,function(items){callback.apply(self,arguments),1===op.times&&(self.toolbar.setVisible(items&&items.length>0),self.toolbar.setEnable(self.isEnabled()&&items&&items.length>0)),self._checkAllSelected()})},onLoaded:o.onLoaded,hasNext:o.hasNext}),this.list.on(BI.Controller.EVENT_CHANGE,function(type,value,obj){type===BI.Events.CLICK&&(self._checkAllSelected(),self.fireEvent(BI.SelectList.EVENT_CHANGE,value,obj)),self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),BI.createWidget(BI.extend({element:this},BI.LogicFactory.createLogic(BI.LogicFactory.createLogicTypeByDirection(o.direction),BI.extend({scrolly:!0},o.logic,{items:BI.LogicFactory.createLogicItemsByDirection(o.direction,this.toolbar,this.list)})))),o.items.length<=0&&(this.toolbar.setVisible(!1),this.toolbar.setEnable(!1)),BI.isNotNull(o.value)&&this.setValue(o.value)},_checkAllSelected:function(){var selectLength=this.list.getValue().length,notSelectLength=this.getAllLeaves().length-selectLength,hasNext=this.list.hasNext(),isAlreadyAllSelected=this.toolbar.isSelected(),isHalf=selectLength>0&&(notSelectLength>0||!isAlreadyAllSelected&&hasNext);isHalf=isHalf||notSelectLength>0&&hasNext&&isAlreadyAllSelected,this.toolbar.setHalfSelected(isHalf),!isHalf&&this.toolbar.setSelected(selectLength>0&¬SelectLength<=0&&(!hasNext||isAlreadyAllSelected))},setAllSelected:function(v){BI.each(this.getAllButtons(),function(i,btn){(btn.setSelected||btn.setAllSelected).apply(btn,[v])}),this.allSelected=!!v,this.toolbar.setSelected(v),this.toolbar.setHalfSelected(!1)},setToolBarVisible:function(b){this.toolbar.setVisible(b)},isAllSelected:function(){return this.allSelected},hasPrev:function(){return this.list.hasPrev()},hasNext:function(){return this.list.hasNext()},prependItems:function(items){this.list.prependItems.apply(this.list,arguments)},addItems:function(items){this.list.addItems.apply(this.list,arguments)},setValue:function(data){var selectAll=data.type===BI.ButtonGroup.CHOOSE_TYPE_ALL;this.setAllSelected(selectAll),this.list[selectAll?"setNotSelectedValue":"setValue"](data.value),this._checkAllSelected()},getValue:function(){return this.isAllSelected()===!1?{type:BI.ButtonGroup.CHOOSE_TYPE_MULTI,value:this.list.getValue(),assist:this.list.getNotSelectedValue()}:{type:BI.ButtonGroup.CHOOSE_TYPE_ALL,value:this.list.getNotSelectedValue(),assist:this.list.getValue()}},empty:function(){this.list.empty()},populate:function(items){this.toolbar.setVisible(!BI.isEmptyArray(items)),this.toolbar.setEnable(this.isEnabled()&&!BI.isEmptyArray(items)),this.list.populate.apply(this.list,arguments),this._checkAllSelected()},_setEnable:function(enable){BI.SelectList.superclass._setEnable.apply(this,arguments),this.toolbar.setEnable(enable)},resetHeight:function(h){var toolHeight=(this.toolbar.element.outerHeight()||25)*(this.toolbar.isVisible()?1:0);this.list.resetHeight?this.list.resetHeight(h-toolHeight):this.list.element.css({"max-height":h-toolHeight+"px"})},setNotSelectedValue:function(){this.list.setNotSelectedValue.apply(this.list,arguments),this._checkAllSelected()},getNotSelectedValue:function(){return this.list.getNotSelectedValue()},getAllButtons:function(){return this.list.getAllButtons()},getAllLeaves:function(){return this.list.getAllLeaves()},getSelectedButtons:function(){return this.list.getSelectedButtons()},getNotSelectedButtons:function(){return this.list.getNotSelectedButtons()},getIndexByValue:function(value){return this.list.getIndexByValue(value)},getNodeById:function(id){return this.list.getNodeById(id)},getNodeByValue:function(value){return this.list.getNodeByValue(value)}}),BI.SelectList.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.select_list",BI.SelectList),BI.LazyLoader=BI.inherit(BI.Widget,{_const:{PAGE:100},_defaultConfig:function(){return BI.extend(BI.LazyLoader.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-lazy-loader",el:{}})},_init:function(){var self=this,o=this.options;BI.LazyLoader.superclass._init.apply(this,arguments);var all=o.items.length;this.loader=BI.createWidget({type:"bi.loader",element:this,el:o.el,itemsCreator:function(options,populate){populate(self._getNextItems(options))},hasNext:function(option){return option.count=1),this.setPagerVisible(v>1)},setValue:function(v){this.pager.setValue(v)},setVPage:function(v){this.pager.setValue(v)},setCount:function(count){this.rowCount.setText(count),this.rowCount.setTitle(count)},getCurrentPage:function(){return this.pager.getCurrentPage()},hasPrev:function(){return this.pager.hasPrev()},hasNext:function(){return this.pager.hasNext()},setPagerVisible:function(b){this.editor.setVisible(b),this.allPages.setVisible(b),this.pager.setVisible(b)},populate:function(){this.pager.populate(),this.setPagerVisible(this.options.pages>1)}}),BI.AllCountPager.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.all_count_pager",BI.AllCountPager),BI.DirectionPager=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.DirectionPager.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-direction-pager",height:24,horizontal:{pages:!1,curr:1,hasPrev:BI.emptyFn,hasNext:BI.emptyFn,firstPage:1,lastPage:BI.emptyFn},vertical:{pages:!1,curr:1,hasPrev:BI.emptyFn,hasNext:BI.emptyFn,firstPage:1,lastPage:BI.emptyFn}})},_init:function(){BI.DirectionPager.superclass._init.apply(this,arguments);var self=this,o=this.options,v=o.vertical,h=o.horizontal;this._createVPager(),this._createHPager(),this.layout=BI.createWidget({type:"bi.absolute",scrollable:!1,element:this,items:[{el:this.vpager,top:0,right:86},{el:this.vlabel,top:0,right:110},{el:this.hpager,top:0,right:0},{el:this.hlabel,top:0,right:24}]})},_createVPager:function(){var self=this,o=this.options,v=o.vertical;this.vlabel=BI.createWidget({type:"bi.label",width:24,height:24,value:v.curr,title:v.curr,invisible:!0}),this.vpager=BI.createWidget({type:"bi.pager",width:72,layouts:[{type:"bi.horizontal",scrollx:!1,rgap:24}],invisible:!0,dynamicShow:!1,pages:v.pages,curr:v.curr,groups:0,first:!1,last:!1,prev:{type:"bi.icon_button",value:"prev",title:BI.i18nText("BI-Up_Page"),warningTitle:BI.i18nText("BI-Current_Is_First_Page"),height:22,width:22,cls:"bi-border bi-border-radius direction-pager-prev column-pre-page-h-font bi-list-item-select2"},next:{type:"bi.icon_button",value:"next",title:BI.i18nText("BI-Down_Page"),warningTitle:BI.i18nText("BI-Current_Is_Last_Page"),height:22,width:22,cls:"bi-border bi-border-radius direction-pager-next column-next-page-h-font bi-list-item-select2"},hasPrev:v.hasPrev,hasNext:v.hasNext,firstPage:v.firstPage,lastPage:v.lastPage}),this.vpager.on(BI.Pager.EVENT_CHANGE,function(){self.fireEvent(BI.DirectionPager.EVENT_CHANGE)}),this.vpager.on(BI.Pager.EVENT_AFTER_POPULATE,function(){self.vlabel.setValue(this.getCurrentPage()),self.vlabel.setTitle(this.getCurrentPage())})},_createHPager:function(){var self=this,o=this.options,h=o.horizontal;this.hlabel=BI.createWidget({type:"bi.label",width:24,height:24,value:h.curr,title:h.curr,invisible:!0}),this.hpager=BI.createWidget({type:"bi.pager",width:72,layouts:[{type:"bi.horizontal",scrollx:!1,rgap:24}],invisible:!0,dynamicShow:!1,pages:h.pages,curr:h.curr,groups:0,first:!1,last:!1,prev:{type:"bi.icon_button",value:"prev",title:BI.i18nText("BI-Left_Page"),warningTitle:BI.i18nText("BI-Current_Is_First_Page"),height:22,width:22,cls:"bi-border bi-border-radius direction-pager-prev row-pre-page-h-font bi-list-item-select2"},next:{type:"bi.icon_button",value:"next",title:BI.i18nText("BI-Right_Page"),warningTitle:BI.i18nText("BI-Current_Is_Last_Page"),height:22,width:22,cls:"bi-border bi-border-radius direction-pager-next row-next-page-h-font bi-list-item-select2"},hasPrev:h.hasPrev,hasNext:h.hasNext,firstPage:h.firstPage,lastPage:h.lastPage}),this.hpager.on(BI.Pager.EVENT_CHANGE,function(){self.fireEvent(BI.DirectionPager.EVENT_CHANGE)}),this.hpager.on(BI.Pager.EVENT_AFTER_POPULATE,function(){self.hlabel.setValue(this.getCurrentPage()),self.hlabel.setTitle(this.getCurrentPage())})},getVPage:function(){return this.vpager.getCurrentPage()},getHPage:function(){return this.hpager.getCurrentPage()},setVPage:function(v){this.vpager.setValue(v),this.vlabel.setValue(v),this.vlabel.setTitle(v)},setHPage:function(v){this.hpager.setValue(v),this.hlabel.setValue(v),this.hlabel.setTitle(v)},hasVNext:function(){return this.vpager.hasNext()},hasHNext:function(){return this.hpager.hasNext()},hasVPrev:function(){return this.vpager.hasPrev()},hasHPrev:function(){return this.hpager.hasPrev()},setHPagerVisible:function(b){this.hpager.setVisible(b),this.hlabel.setVisible(b)},setVPagerVisible:function(b){this.vpager.setVisible(b),this.vlabel.setVisible(b)},populate:function(){this.vpager.populate(),this.hpager.populate();var vShow=!1,hShow=!1;this.hasHNext()||this.hasHPrev()?(this.setHPagerVisible(!0),hShow=!0):this.setHPagerVisible(!1),this.hasVNext()||this.hasVPrev()?(this.setVPagerVisible(!0),vShow=!0):this.setVPagerVisible(!1),this.setVisible(hShow||vShow);var num=[86,110,0,24],items=this.layout.attr("items");vShow===!0&&hShow===!0?(items[0].right=num[0],items[1].right=num[1],items[2].right=num[2],items[3].right=num[3]):vShow===!0?(items[0].right=num[2],items[1].right=num[3]):hShow===!0&&(items[2].right=num[2],items[3].right=num[3]),this.layout.attr("items",items),this.layout.resize()},clear:function(){this.vpager.attr("curr",1),this.hpager.attr("curr",1)}}),BI.DirectionPager.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.direction_pager",BI.DirectionPager),BI.DetailPager=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.DetailPager.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-detail-pager",behaviors:{},layouts:[{type:"bi.horizontal",hgap:10,vgap:0}],dynamicShow:!0,dynamicShowFirstLast:!1,dynamicShowPrevNext:!1,pages:!1,curr:function(){return 1},groups:0,jump:BI.emptyFn,first:!1,last:!1,prev:"上一页",next:"下一页",firstPage:1,lastPage:function(){return 1},hasPrev:BI.emptyFn,hasNext:BI.emptyFn})},_init:function(){BI.DetailPager.superclass._init.apply(this,arguments);var self=this;this.currPage=BI.result(this.options,"curr"),this._lock=!1,this._debouce=BI.debounce(function(){self._lock=!1},300),this._populate()},_populate:function(){var self=this,o=this.options,view=[],dict={};this.empty();var pages=BI.result(o,"pages"),curr=BI.result(this,"currPage"),groups=BI.result(o,"groups"),first=BI.result(o,"first"),last=BI.result(o,"last"),prev=BI.result(o,"prev"),next=BI.result(o,"next");pages===!1?(groups=0,first=!1,last=!1):groups>pages&&(groups=pages),dict.index=Math.ceil((curr+(groups>1&&groups!==pages?1:0))/(0===groups?1:groups)),(!o.dynamicShow&&!o.dynamicShowPrevNext||curr>1)&&prev!==!1&&(BI.isKey(prev)?view.push({text:prev,value:"prev",disabled:pages===!1?o.hasPrev(curr)===!1:!(curr>1&&prev!==!1)}):view.push(BI.extend({disabled:pages===!1?o.hasPrev(curr)===!1:!(curr>1&&prev!==!1)},prev))),(!o.dynamicShow&&!o.dynamicShowFirstLast||dict.index>1&&0!==groups)&&first&&(view.push({text:first,value:"first",disabled:!(dict.index>1&&0!==groups)}),dict.index>1&&0!==groups&&view.push({type:"bi.label",cls:"page-ellipsis",text:"…"})),dict.poor=Math.floor((groups-1)/2),dict.start=dict.index>1?curr-dict.poor:1,dict.end=dict.index>1?function(){var max=curr+(groups-dict.poor-1);return max>pages?pages:max}():groups,dict.end-dict.start1&&0!==groups&&pages>groups&&dict.endgroups&&dict.endgroups&&dict.endgroups&&dict.end1},hasNext:function(v){v||(v=1);var o=this.options,pages=this.options.pages;return pages===!1?o.hasNext(v):vlastPage?lastPage:(firstPage=BI.result(o,"firstPage"),vo.pages?o.pages:v,this.currPage=v;this._populate()},getValue:function(){var val=this.button_group.getValue()[0];switch(val){case"prev":return-1;case"next":return 1;case"first":return BI.MIN;case"last":return BI.MAX;default:return val}},attr:function(key,value){BI.DetailPager.superclass.attr.apply(this,arguments),"curr"===key&&(this.currPage=BI.result(this.options,"curr"))},populate:function(){this._populate()}}),BI.DetailPager.EVENT_CHANGE="EVENT_CHANGE",BI.DetailPager.EVENT_AFTER_POPULATE="EVENT_AFTER_POPULATE",BI.shortcut("bi.detail_pager",BI.DetailPager),BI.SegmentButton=BI.inherit(BI.BasicButton,{_defaultConfig:function(){var conf=BI.SegmentButton.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{baseCls:(conf.baseCls||"")+" bi-segment-button bi-list-item-select",shadow:!0,readonly:!0,hgap:5})},_init:function(){BI.SegmentButton.superclass._init.apply(this,arguments);var opts=this.options,self=this;this.text=BI.createWidget({type:"bi.label",element:this,textHeight:opts.height,whiteSpace:opts.whiteSpace,text:opts.text,value:opts.value,hgap:opts.hgap})},setSelected:function(){BI.SegmentButton.superclass.setSelected.apply(this,arguments)},setText:function(text){BI.SegmentButton.superclass.setText.apply(this,arguments),this.text.setText(text)},destroy:function(){BI.SegmentButton.superclass.destroy.apply(this,arguments)}}),BI.shortcut("bi.segment_button",BI.SegmentButton),BI.Segment=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.Segment.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-segment",items:[],height:24})},_init:function(){BI.Segment.superclass._init.apply(this,arguments);var self=this,o=this.options;this.buttonGroup=BI.createWidget({element:this,type:"bi.button_group",value:o.value,items:BI.createItems(o.items,{type:"bi.segment_button",height:o.height-2,whiteSpace:o.whiteSpace}),layout:[{type:"bi.center"}]}),this.buttonGroup.on(BI.Controller.EVENT_CHANGE,function(){self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.buttonGroup.on(BI.ButtonGroup.EVENT_CHANGE,function(value,obj){self.fireEvent(BI.Segment.EVENT_CHANGE,value,obj)})},_setEnable:function(enable){BI.Segment.superclass._setEnable.apply(this,arguments),enable===!0?this.element.removeClass("base-disabled disabled"):enable===!1&&this.element.addClass("base-disabled disabled")},setValue:function(v){this.buttonGroup.setValue(v)},setEnabledValue:function(v){this.buttonGroup.setEnabledValue(v)},getValue:function(){return this.buttonGroup.getValue()}}),BI.Segment.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.segment",BI.Segment),BI.MultiSelectBar=BI.inherit(BI.BasicButton,{_defaultConfig:function(){return BI.extend(BI.MultiSelectBar.superclass._defaultConfig.apply(this,arguments),{extraCls:"bi-multi-select-bar",height:25,text:BI.i18nText("BI-Select_All"),isAllCheckedBySelectedValue:BI.emptyFn,disableSelected:!0,isHalfCheckedBySelectedValue:function(selectedValues){return selectedValues.length>0},halfSelected:!1,iconWrapperWidth:26})},_init:function(){BI.MultiSelectBar.superclass._init.apply(this,arguments);var self=this,o=this.options,isSelect=o.selected===!0,isHalfSelect=!o.selected&&o.halfSelected;this.checkbox=BI.createWidget({type:"bi.checkbox",stopPropagation:!0,handler:function(){self.setSelected(self.isSelected())},selected:isSelect, +invisible:isHalfSelect}),this.half=BI.createWidget({type:"bi.half_icon_button",stopPropagation:!0,handler:function(){self.setSelected(!0)},invisible:isSelect||!isHalfSelect}),this.checkbox.on(BI.Controller.EVENT_CHANGE,function(){self.fireEvent(BI.Controller.EVENT_CHANGE,BI.Events.CLICK,self.isSelected(),self)}),this.checkbox.on(BI.Checkbox.EVENT_CHANGE,function(){self.fireEvent(BI.MultiSelectBar.EVENT_CHANGE,self.isSelected(),self)}),this.half.on(BI.Controller.EVENT_CHANGE,function(){self.fireEvent(BI.Controller.EVENT_CHANGE,BI.Events.CLICK,self.isSelected(),self)}),this.half.on(BI.HalfIconButton.EVENT_CHANGE,function(){self.fireEvent(BI.MultiSelectBar.EVENT_CHANGE,self.isSelected(),self)}),this.text=BI.createWidget({type:"bi.label",textAlign:"left",whiteSpace:"nowrap",textHeight:o.height,height:o.height,hgap:o.hgap,text:o.text,keyword:o.keyword,value:o.value,py:o.py}),BI.createWidget({type:"bi.htape",element:this,items:[{width:o.iconWrapperWidth,el:{type:"bi.center_adapt",items:[this.checkbox,this.half]}},{el:this.text}]})},_setSelected:function(v){this.checkbox.setSelected(!!v)},beforeClick:function(){var isHalf=this.isHalfSelected(),isSelected=this.isSelected();isHalf===!0?this.setSelected(!0):this.setSelected(!isSelected)},setSelected:function(v){this.checkbox.setSelected(v),this.setHalfSelected(!1)},setHalfSelected:function(b){this.halfSelected=!!b,b===!0?(this.checkbox.setSelected(!1),this.half.visible(),this.checkbox.invisible()):(this.half.invisible(),this.checkbox.visible())},isHalfSelected:function(){return!this.isSelected()&&!!this.halfSelected},isSelected:function(){return this.checkbox.isSelected()},setValue:function(selectedValues){BI.MultiSelectBar.superclass.setValue.apply(this,arguments);var isAllChecked=this.options.isAllCheckedBySelectedValue.apply(this,arguments);this._setSelected(isAllChecked),!isAllChecked&&this.setHalfSelected(this.options.isHalfCheckedBySelectedValue.apply(this,arguments))},doClick:function(){BI.MultiSelectBar.superclass.doClick.apply(this,arguments),this.isValid()&&this.fireEvent(BI.MultiSelectBar.EVENT_CHANGE,this.isSelected(),this)}}),BI.MultiSelectBar.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.multi_select_bar",BI.MultiSelectBar),BI.LevelTree=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.LevelTree.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-level-tree",el:{chooseType:0},expander:{},items:[],value:""})},_init:function(){BI.LevelTree.superclass._init.apply(this,arguments),this.initTree(this.options.items)},_formatItems:function(nodes,layer,pNode){var self=this;return BI.each(nodes,function(i,node){var extend={layer:layer};BI.isKey(node.id)||(node.id=BI.UUID()),extend.pNode=pNode,node.isParent===!0||node.parent===!0||BI.isNotEmptyArray(node.children)?(extend.type="bi.mid_plus_group_node",i===nodes.length-1&&(extend.type="bi.last_plus_group_node",extend.isLastNode=!0),0!==i||pNode||(extend.type="bi.first_plus_group_node"),0===i&&i===nodes.length-1&&(extend.type="bi.plus_group_node"),BI.defaults(node,extend),self._formatItems(node.children,layer+1,node)):(extend.type="bi.mid_tree_leaf_item",0!==i||pNode||(extend.type="bi.first_tree_leaf_item"),i===nodes.length-1&&(extend.type="bi.last_tree_leaf_item"),BI.defaults(node,extend))}),nodes},_assertId:function(sNodes){BI.each(sNodes,function(i,node){BI.isKey(node.id)||(node.id=BI.UUID())})},initTree:function(nodes){var self=this,o=this.options;this.empty(),this._assertId(nodes),this.tree=BI.createWidget({type:"bi.custom_tree",element:this,expander:BI.extend({el:{},popup:{type:"bi.custom_tree"}},o.expander),items:this._formatItems(BI.Tree.transformToTreeFormat(nodes),0),value:o.value,el:BI.extend({type:"bi.button_tree",chooseType:0,layouts:[{type:"bi.vertical"}]},o.el)}),this.tree.on(BI.Controller.EVENT_CHANGE,function(type,value,ob){self.fireEvent(BI.Controller.EVENT_CHANGE,arguments),type===BI.Events.CLICK&&self.fireEvent(BI.LevelTree.EVENT_CHANGE,value,ob)})},stroke:function(nodes){this.tree.stroke.apply(this.tree,arguments)},populate:function(items,keyword){items=this._formatItems(BI.Tree.transformToTreeFormat(items),0),this.tree.populate(items,keyword)},setValue:function(v){this.tree.setValue(v)},getValue:function(){return this.tree.getValue()},getAllLeaves:function(){return this.tree.getAllLeaves()},getNodeById:function(id){return this.tree.getNodeById(id)},getNodeByValue:function(id){return this.tree.getNodeByValue(id)}}),BI.LevelTree.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.level_tree",BI.LevelTree),BI.DisplayTree=BI.inherit(BI.TreeView,{_defaultConfig:function(){return BI.extend(BI.DisplayTree.superclass._defaultConfig.apply(this,arguments),{extraCls:"bi-display-tree"})},_init:function(){BI.DisplayTree.superclass._init.apply(this,arguments)},_configSetting:function(){function beforeCollapse(treeId,treeNode){return!1}var setting={view:{selectedMulti:!1,dblClickExpand:!1,showIcon:!1,nameIsHTML:!0,showTitle:!1},data:{key:{title:"title",name:"text"},simpleData:{enable:!0}},callback:{beforeCollapse:beforeCollapse}};return setting},_dealWidthNodes:function(nodes){nodes=BI.DisplayTree.superclass._dealWidthNodes.apply(this,arguments);var self=this,o=this.options;return BI.each(nodes,function(i,node){node.isParent=node.isParent||node.parent,null==node.text&&node.count>0&&(node.text=node.value+"("+BI.i18nText("BI-Basic_Altogether")+node.count+BI.i18nText("BI-Basic_Count")+")")}),nodes},initTree:function(nodes,setting){var setting=setting||this._configSetting();this.nodes=BI.$.fn.zTree.init(this.tree.element,setting,nodes)},destroy:function(){BI.DisplayTree.superclass.destroy.apply(this,arguments)}}),BI.DisplayTree.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.display_tree",BI.DisplayTree),BI.ListDisplayTree=BI.inherit(BI.ListTreeView,{_defaultConfig:function(){return BI.extend(BI.ListDisplayTree.superclass._defaultConfig.apply(this,arguments),{extraCls:"bi-list-display-tree"})},_init:function(){BI.ListDisplayTree.superclass._init.apply(this,arguments)},_configSetting:function(){function beforeCollapse(treeId,treeNode){return!1}function getFont(treeId,node){return node.isLeaf?{}:{color:"#999999"}}var setting={view:{selectedMulti:!1,dblClickExpand:!1,showIcon:!1,nameIsHTML:!0,showTitle:!1,fontCss:getFont},data:{key:{title:"title",name:"text"},simpleData:{enable:!0}},callback:{beforeCollapse:beforeCollapse}};return setting},_dealWidthNodes:function(nodes){nodes=BI.ListDisplayTree.superclass._dealWidthNodes.apply(this,arguments);var self=this,o=this.options;return BI.each(nodes,function(i,node){node.isParent=node.isParent||node.parent,null==node.text&&node.count>0&&(node.text=node.value+"("+BI.i18nText("BI-Basic_Altogether")+node.count+BI.i18nText("BI-Basic_Count")+")")}),nodes},initTree:function(nodes,setting){var setting=setting||this._configSetting();this.nodes=BI.$.fn.zTree.init(this.tree.element,setting,nodes)},destroy:function(){BI.ListDisplayTree.superclass.destroy.apply(this,arguments)}}),BI.ListDisplayTree.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.list_display_tree",BI.ListDisplayTree),BI.SimpleTreeView=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.SimpleTreeView.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-simple-tree",itemsCreator:BI.emptyFn,items:null})},_init:function(){BI.SimpleTreeView.superclass._init.apply(this,arguments);var self=this,o=this.options;this.structure=new BI.Tree,this.tree=BI.createWidget({type:"bi.tree_view",element:this,itemsCreator:function(op,callback){var fn=function(items){callback({items:items}),self.structure.initTree(BI.Tree.transformToTreeFormat(items))};BI.isNotNull(o.items)?fn(o.items):o.itemsCreator(op,fn)}}),this.tree.on(BI.TreeView.EVENT_CHANGE,function(){self.fireEvent(BI.SimpleTreeView.EVENT_CHANGE,arguments)}),BI.isNotEmptyArray(o.items)&&this.populate(),BI.isNotNull(o.value)&&this.setValue(o.value)},populate:function(items,keyword){items&&(this.options.items=items),this.tree.stroke({keyword:keyword})},_digest:function(v){v||(v=[]);var self=this,map={},selected=[];return BI.each(v,function(i,val){var node=self.structure.search(val,"value");if(node){var p=node;for(p=p.getParent(),p&&(map[p.value]||(map[p.value]=0),map[p.value]++);p&&p.getChildrenLength()<=map[p.value];)selected.push(p.value),p=p.getParent(),p&&(map[p.value]||(map[p.value]=0),map[p.value]++)}}),BI.makeObject(v.concat(selected))},setValue:function(v){this.tree.setValue(this._digest(v))},_getValue:function(){var self=this,result=[],val=this.tree.getValue(),track=function(nodes){BI.each(nodes,function(key,node){BI.isEmpty(node)?result.push(key):track(node)})};return track(val),result},empty:function(){this.tree.empty()},getValue:function(){var self=this,result=[],val=this._getValue();return BI.each(val,function(i,key){var target=self.structure.search(key,"value");target&&self.structure._traverse(target,function(node){node.isLeaf()&&result.push(node.value)})}),result}}),BI.SimpleTreeView.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.simple_tree",BI.SimpleTreeView),BI.EditorTrigger=BI.inherit(BI.Trigger,{_const:{hgap:4},_defaultConfig:function(){var conf=BI.EditorTrigger.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{baseCls:(conf.baseCls||"")+" bi-editor-trigger bi-border",height:24,validationChecker:BI.emptyFn,quitChecker:BI.emptyFn,allowBlank:!1,watermark:"",errorText:""})},_init:function(){this.options.height-=2,BI.EditorTrigger.superclass._init.apply(this,arguments);var self=this,o=this.options,c=this._const;this.editor=BI.createWidget({type:"bi.sign_editor",height:o.height,value:o.value,validationChecker:o.validationChecker,quitChecker:o.quitChecker,allowBlank:o.allowBlank,watermark:o.watermark,errorText:o.errorText,title:function(){return self.getValue()}}),this.editor.on(BI.Controller.EVENT_CHANGE,function(){self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.editor.on(BI.SignEditor.EVENT_CHANGE,function(){self.fireEvent(BI.EditorTrigger.EVENT_CHANGE,arguments)}),BI.createWidget({element:this,type:"bi.htape",items:[{el:this.editor},{el:{type:"bi.trigger_icon_button",width:o.triggerWidth||o.height},width:o.triggerWidth||o.height}]})},getValue:function(){return this.editor.getValue()},setValue:function(value){this.editor.setValue(value)},setText:function(text){this.editor.setState(text)}}),BI.EditorTrigger.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.editor_trigger",BI.EditorTrigger),BI.IconTrigger=BI.inherit(BI.Trigger,{_defaultConfig:function(){return BI.extend(BI.IconTrigger.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-icon-trigger",extraCls:"pull-down-font",el:{},height:24})},_init:function(){var o=this.options;BI.IconTrigger.superclass._init.apply(this,arguments),this.iconButton=BI.createWidget(o.el,{type:"bi.trigger_icon_button",element:this,width:o.width,height:o.height,extraCls:o.extraCls})}}),BI.shortcut("bi.icon_trigger",BI.IconTrigger),BI.IconTextTrigger=BI.inherit(BI.Trigger,{_const:{hgap:4},_defaultConfig:function(){var conf=BI.IconTextTrigger.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{baseCls:(conf.baseCls||"")+" bi-text-trigger",height:24,iconHeight:null,iconWidth:null,textCls:""})},_init:function(){BI.IconTextTrigger.superclass._init.apply(this,arguments);var self=this,o=this.options,c=this._const;this.text=BI.createWidget({type:"bi.label",cls:"select-text-label"+(BI.isKey(o.textCls)?" "+o.textCls:""),textAlign:"left",height:o.height,text:o.text}),this.trigerButton=BI.createWidget({type:"bi.trigger_icon_button",width:o.triggerWidth||o.height}),BI.createWidget({element:this,type:"bi.htape",ref:function(_ref){self.wrapper=_ref},items:[{el:{type:"bi.icon_change_button",cls:"icon-combo-trigger-icon",iconCls:o.iconCls,ref:function(_ref){self.icon=_ref},iconHeight:o.iconHeight,iconWidth:o.iconWidth,disableSelected:!0},width:BI.isEmptyString(o.iconCls)?0:o.iconWrapperWidth||o.height},{el:this.text,lgap:BI.isEmptyString(o.iconCls)?5:0},{el:this.trigerButton,width:o.triggerWidth||o.height}]})},setValue:function(value){this.text.setValue(value)},setIcon:function(iconCls){var o=this.options;this.icon.setIcon(iconCls);var iconItem=this.wrapper.attr("items")[0],textItem=this.wrapper.attr("items")[1];BI.isNull(iconCls)||BI.isEmptyString(iconCls)?0!==iconItem.width&&(iconItem.width=0,textItem.lgap=5,this.wrapper.resize()):iconItem.width!==(o.iconWrapperWidth||o.height)&&(iconItem.width=o.iconWrapperWidth||o.height,textItem.lgap=0,this.wrapper.resize())},setTextCls:function(cls){var o=this.options,oldCls=o.textCls;o.textCls=cls,this.text.element.removeClass(oldCls).addClass(cls)},setText:function(text){this.text.setText(text)}}),BI.shortcut("bi.icon_text_trigger",BI.IconTextTrigger),BI.SelectIconTextTrigger=BI.inherit(BI.Trigger,{_defaultConfig:function(){return BI.extend(BI.SelectIconTextTrigger.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-select-text-trigger bi-border",height:24,iconHeight:null,iconWidth:null,iconCls:""})},_init:function(){this.options.height-=2,BI.SelectIconTextTrigger.superclass._init.apply(this,arguments);var self=this,o=this.options,obj=this._digist(o.value,o.items);this.trigger=BI.createWidget({type:"bi.icon_text_trigger",element:this,text:obj.text,textCls:obj.textCls,iconCls:obj.iconCls,height:o.height,iconHeight:o.iconHeight,iconWidth:o.iconWidth,iconWrapperWidth:o.iconWrapperWidth})},_digist:function(vals,items){var o=this.options;vals=BI.isArray(vals)?vals:[vals];var result,formatItems=BI.Tree.transformToArrayFormat(items);return BI.any(formatItems,function(i,item){if(BI.deepContains(vals,item.value))return result={text:item.text||item.value,iconCls:item.iconCls},!0}),BI.isNotNull(result)?{text:result.text,textCls:"",iconCls:result.iconCls}:{text:BI.isFunction(o.text)?o.text():o.text,textCls:"bi-water-mark",iconCls:o.iconCls}},setValue:function(vals){var obj=this._digist(vals,this.options.items);this.trigger.setText(obj.text),this.trigger.setIcon(obj.iconCls),this.trigger.setTextCls(obj.textCls)},populate:function(items){this.options.items=items}}),BI.shortcut("bi.select_icon_text_trigger",BI.SelectIconTextTrigger),BI.TextTrigger=BI.inherit(BI.Trigger,{_const:{hgap:4},_defaultConfig:function(){var conf=BI.TextTrigger.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{baseCls:(conf.baseCls||"")+" bi-text-trigger",height:24,textCls:""})},_init:function(){BI.TextTrigger.superclass._init.apply(this,arguments);var self=this,o=this.options,c=this._const;this.text=BI.createWidget({type:"bi.label",cls:"select-text-label"+(BI.isKey(o.textCls)?" "+o.textCls:""),textAlign:"left",height:o.height,text:o.text,title:function(){return self.text.getText()},tipType:o.tipType,warningTitle:o.warningTitle,hgap:c.hgap,readonly:o.readonly}),this.trigerButton=BI.createWidget({type:"bi.trigger_icon_button",width:o.triggerWidth||o.height}),BI.createWidget({element:this,type:"bi.htape",items:[{el:this.text},{el:this.trigerButton,width:o.triggerWidth||o.height}]})},setTextCls:function(cls){var o=this.options,oldCls=o.textCls;o.textCls=cls,this.text.element.removeClass(oldCls).addClass(cls)},setText:function(text){this.text.setText(text)},setTipType:function(v){this.text.options.tipType=v}}),BI.shortcut("bi.text_trigger",BI.TextTrigger),BI.SelectTextTrigger=BI.inherit(BI.Trigger,{_defaultConfig:function(){return BI.extend(BI.SelectTextTrigger.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-select-text-trigger bi-border bi-focus-shadow",height:24})},_init:function(){this.options.height-=2,BI.SelectTextTrigger.superclass._init.apply(this,arguments);var self=this,o=this.options,obj=this._digest(o.value,o.items);this.trigger=BI.createWidget({type:"bi.text_trigger",element:this,height:o.height,readonly:o.readonly,text:obj.text,textCls:obj.textCls,tipType:o.tipType,warningTitle:o.warningTitle})},_digest:function(vals,items){var o=this.options;vals=BI.isArray(vals)?vals:[vals];var result=[],formatItems=BI.Tree.transformToArrayFormat(items);return BI.each(formatItems,function(i,item){BI.deepContains(vals,item.value)&&!BI.contains(result,item.text||item.value)&&result.push(item.text||item.value)}),result.length>0?{textCls:"",text:result.join(",")}:{textCls:"bi-water-mark",text:BI.isFunction(o.text)?o.text():o.text}},setValue:function(vals){var formatValue=this._digest(vals,this.options.items);this.trigger.setTextCls(formatValue.textCls),this.trigger.setText(formatValue.text)},setTipType:function(v){this.trigger.setTipType(v)},populate:function(items){this.options.items=items}}),BI.shortcut("bi.select_text_trigger",BI.SelectTextTrigger),BI.SmallSelectTextTrigger=BI.inherit(BI.Trigger,{_defaultConfig:function(){return BI.extend(BI.SmallSelectTextTrigger.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-small-select-text-trigger bi-border",height:20})},_init:function(){this.options.height-=2,BI.SmallSelectTextTrigger.superclass._init.apply(this,arguments);var self=this,o=this.options,obj=this._digest(o.value,o.items);this.trigger=BI.createWidget({type:"bi.small_text_trigger",element:this,height:o.height-2,text:obj.text,cls:obj.cls})},_digest:function(vals,items){var o=this.options;vals=BI.isArray(vals)?vals:[vals];var result=[],formatItems=BI.Tree.transformToArrayFormat(items);return BI.each(formatItems,function(i,item){BI.deepContains(vals,item.value)&&!BI.contains(result,item.text||item.value)&&result.push(item.text||item.value)}),result.length>0?{cls:"",text:result.join(",")}:{cls:"bi-water-mark",text:o.text}},setValue:function(vals){var formatValue=this._digest(vals,this.options.items);this.trigger.element.removeClass("bi-water-mark").addClass(formatValue.cls),this.trigger.setText(formatValue.text)},populate:function(items){this.options.items=items}}),BI.shortcut("bi.small_select_text_trigger",BI.SmallSelectTextTrigger),BI.SmallTextTrigger=BI.inherit(BI.Trigger,{_const:{hgap:4},_defaultConfig:function(){var conf=BI.SmallTextTrigger.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{baseCls:(conf.baseCls||"")+" bi-text-trigger",height:20})},_init:function(){BI.SmallTextTrigger.superclass._init.apply(this,arguments);var self=this,o=this.options,c=this._const;this.text=BI.createWidget({type:"bi.label",textAlign:"left",height:o.height,text:o.text,hgap:c.hgap}),this.trigerButton=BI.createWidget({type:"bi.trigger_icon_button",width:o.triggerWidth||o.height}),BI.createWidget({element:this,type:"bi.htape",items:[{el:this.text},{el:this.trigerButton,width:o.triggerWidth||o.height}]})},setValue:function(value){this.text.setValue(value)},setText:function(text){this.text.setText(text)}}),BI.shortcut("bi.small_text_trigger",BI.SmallTextTrigger),BI.MonthDateCombo=BI.inherit(BI.Trigger,{_defaultConfig:function(){return BI.extend(BI.MonthDateCombo.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-month-combo",height:24,container:null})},_init:function(){BI.MonthDateCombo.superclass._init.apply(this,arguments);var self=this,o=this.options;this.trigger=BI.createWidget({type:"bi.date_triangle_trigger"}),this.popup=BI.createWidget({type:"bi.month_popup",behaviors:o.behaviors}),this.popup.on(BI.YearPopup.EVENT_CHANGE,function(){self.setValue(self.popup.getValue())}),this.combo=BI.createWidget({type:"bi.combo",offsetStyle:"center",container:o.container,element:this,isNeedAdjustHeight:!1,isNeedAdjustWidth:!1,el:this.trigger,popup:{minWidth:85,stopPropagation:!1,el:this.popup}}),this.combo.on(BI.Combo.EVENT_CHANGE,function(){self.combo.hideView(),self.fireEvent(BI.MonthDateCombo.EVENT_CHANGE)}),this.combo.on(BI.Combo.EVENT_BEFORE_POPUPVIEW,function(){self.doBehavior()})},setValue:function(v){this.trigger.setValue(v),this.popup.setValue(v)},getValue:function(){return this.popup.getValue()}}),BI.MonthDateCombo.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.month_date_combo",BI.MonthDateCombo),BI.YearDateCombo=BI.inherit(BI.Trigger,{_defaultConfig:function(){return BI.extend(BI.YearDateCombo.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-year-combo",min:"1900-01-01",max:"2099-12-31",behaviors:{},height:24,container:null})},_init:function(){BI.YearDateCombo.superclass._init.apply(this,arguments);var self=this,o=this.options;this.trigger=BI.createWidget({type:"bi.date_triangle_trigger"}),this.popup=BI.createWidget({type:"bi.year_popup",behaviors:o.behaviors,min:o.min,max:o.max}),this.popup.on(BI.YearPopup.EVENT_CHANGE,function(){self.setValue(self.popup.getValue()),self.combo.hideView(),self.fireEvent(BI.YearDateCombo.EVENT_CHANGE)}),this.combo=BI.createWidget({type:"bi.combo",offsetStyle:"center",element:this,container:o.container,isNeedAdjustHeight:!1,isNeedAdjustWidth:!1,el:this.trigger,popup:{minWidth:100,stopPropagation:!1,el:this.popup}}),this.combo.on(BI.Combo.EVENT_CHANGE,function(){self.fireEvent(BI.YearDateCombo.EVENT_CHANGE)}),this.combo.on(BI.Combo.EVENT_BEFORE_POPUPVIEW,function(){self.doBehavior()})},setValue:function(v){this.trigger.setValue(v),this.popup.setValue(v)},getValue:function(){return this.popup.getValue()}}),BI.YearDateCombo.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.year_date_combo",BI.YearDateCombo),BI.DatePicker=BI.inherit(BI.Widget,{_defaultConfig:function(){var conf=BI.DatePicker.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{baseCls:"bi-date-picker",height:40,min:"1900-01-01",max:"2099-12-31"})},_init:function(){BI.DatePicker.superclass._init.apply(this,arguments);var self=this,o=this.options;this._year=BI.getDate().getFullYear(),this._month=BI.getDate().getMonth()+1,this.left=BI.createWidget({type:"bi.icon_button",cls:"pre-page-h-font",width:24,height:24}),this.left.on(BI.IconButton.EVENT_CHANGE,function(){1===self._month?self.setValue({year:self.year.getValue()-1,month:12}):self.setValue({year:self.year.getValue(),month:self.month.getValue()-1}),self.fireEvent(BI.DatePicker.EVENT_CHANGE),self._checkLeftValid(),self._checkRightValid()}),this.right=BI.createWidget({type:"bi.icon_button",cls:"next-page-h-font",width:24,height:24}),this.right.on(BI.IconButton.EVENT_CHANGE,function(){12===self._month?self.setValue({year:self.year.getValue()+1,month:1}):self.setValue({year:self.year.getValue(),month:self.month.getValue()+1}),self.fireEvent(BI.DatePicker.EVENT_CHANGE),self._checkLeftValid(),self._checkRightValid()}),this.year=BI.createWidget({type:"bi.year_date_combo",behaviors:o.behaviors,min:o.min,max:o.max}),this.year.on(BI.YearDateCombo.EVENT_CHANGE,function(){self.setValue({year:self.year.getValue(),month:self.month.getValue()}),self.fireEvent(BI.DatePicker.EVENT_CHANGE)}),this.month=BI.createWidget({type:"bi.month_date_combo",behaviors:o.behaviors}),this.month.on(BI.MonthDateCombo.EVENT_CHANGE,function(){self.setValue({year:self.year.getValue(),month:self.month.getValue()}),self.fireEvent(BI.DatePicker.EVENT_CHANGE)}),BI.createWidget({type:"bi.htape",element:this,items:[{el:{type:"bi.center_adapt",items:[this.left]},width:24},{type:"bi.center_adapt",items:[{el:{type:"bi.horizontal",width:120,rgap:10,items:[{el:this.year,lgap:10},this.month]}}]},{el:{type:"bi.center_adapt",items:[this.right]},width:24}]}),this.setValue({year:this._year,month:this._month})},_checkLeftValid:function(){var o=this.options,valid=!(1===this._month&&this._year===BI.parseDateTime(o.min,"%Y-%X-%d").getFullYear());return this.left.setEnable(valid),valid},_checkRightValid:function(){var o=this.options,valid=!(12===this._month&&this._year===BI.parseDateTime(o.max,"%Y-%X-%d").getFullYear());return this.right.setEnable(valid),valid},setValue:function(ob){this._year=BI.parseInt(ob.year),this._month=BI.parseInt(ob.month),this.year.setValue(ob.year),this.month.setValue(ob.month),this._checkLeftValid(),this._checkRightValid()},getValue:function(){return{year:this.year.getValue(),month:this.month.getValue()}}}),BI.DatePicker.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.date_picker",BI.DatePicker),BI.YearPicker=BI.inherit(BI.Widget,{_defaultConfig:function(){var conf=BI.YearPicker.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{baseCls:"bi-year-picker",behaviors:{},height:40,min:"1900-01-01",max:"2099-12-31"})},_init:function(){BI.YearPicker.superclass._init.apply(this,arguments);var self=this,o=this.options;this._year=BI.getDate().getFullYear(),this.left=BI.createWidget({type:"bi.icon_button",cls:"pre-page-h-font",width:25,height:25}),this.left.on(BI.IconButton.EVENT_CHANGE,function(){self.setValue(self.year.getValue()-1),self.fireEvent(BI.YearPicker.EVENT_CHANGE),self._checkLeftValid(),self._checkRightValid()}),this.right=BI.createWidget({type:"bi.icon_button",cls:"next-page-h-font",width:25,height:25}),this.right.on(BI.IconButton.EVENT_CHANGE,function(){self.setValue(self.year.getValue()+1),self.fireEvent(BI.YearPicker.EVENT_CHANGE),self._checkLeftValid(),self._checkRightValid()}),this.year=BI.createWidget({type:"bi.year_date_combo",min:o.min,behaviors:o.behaviors,max:o.max}),this.year.on(BI.YearDateCombo.EVENT_CHANGE,function(){self.setValue(self.year.getValue()),self.fireEvent(BI.YearPicker.EVENT_CHANGE)}),BI.createWidget({type:"bi.htape",element:this,items:[{el:{type:"bi.center_adapt",items:[this.left]},width:25},{type:"bi.center_adapt",items:[{el:{type:"bi.horizontal_float",width:50,items:[{el:this.year}]}}]},{el:{type:"bi.center_adapt",items:[this.right]},width:25}]}),this.setValue({year:this._year})},_checkLeftValid:function(){var o=this.options,valid=!(this._year===BI.parseDateTime(o.min,"%Y-%X-%d").getFullYear());return this.left.setEnable(valid),valid},_checkRightValid:function(){var o=this.options,valid=!(this._year===BI.parseDateTime(o.max,"%Y-%X-%d").getFullYear());return this.right.setEnable(valid),valid},setValue:function(v){this._year=v,this.year.setValue(v),this._checkLeftValid(),this._checkRightValid()},getValue:function(){return this.year.getValue()}}),BI.YearPicker.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.year_picker",BI.YearPicker),BI.DateCalendarPopup=BI.inherit(BI.Widget,{_defaultConfig:function(){var conf=BI.DateCalendarPopup.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{baseCls:"bi-date-calendar-popup",min:"1900-01-01",max:"2099-12-31",selectedTime:null})},_createNav:function(v){var date=BI.Calendar.getDateJSONByPage(v),calendar=BI.createWidget({type:"bi.calendar",logic:{dynamic:!0},min:this.options.min,max:this.options.max,year:date.year,month:date.month,day:1});return calendar},_init:function(){BI.DateCalendarPopup.superclass._init.apply(this,arguments);var self=this,o=this.options;this.today=BI.getDate(),this._year=this.today.getFullYear(),this._month=this.today.getMonth()+1,this._day=this.today.getDate(),this.selectedTime=o.selectedTime||{year:this._year,month:this._month,day:this._day},this.datePicker=BI.createWidget({type:"bi.date_picker",behaviors:o.behaviors,min:o.min,max:o.max}),this.calendar=BI.createWidget({direction:"top",logic:{dynamic:!0},type:"bi.navigation",tab:this.datePicker,cardCreator:BI.bind(this._createNav,this),afterCardCreated:function(){},afterCardShow:function(){this.setValue(self.selectedTime)}}),this.datePicker.on(BI.DatePicker.EVENT_CHANGE,function(){self.selectedTime=self.datePicker.getValue(),self.selectedTime.day=1,self.calendar.setSelect(BI.Calendar.getPageByDateJSON(self.selectedTime))}),this.calendar.on(BI.Navigation.EVENT_CHANGE,function(){self.selectedTime=self.calendar.getValue(),self.setValue(self.selectedTime),self.fireEvent(BI.DateCalendarPopup.EVENT_CHANGE)}),BI.createWidget({type:"bi.absolute",element:this,items:[{el:this.calendar,left:5,right:5},{el:{type:"bi.layout",cls:"bi-split-top"},height:1,top:40,left:0,right:0}]})},setValue:function(timeOb){this.datePicker.setValue(timeOb),this.calendar.setSelect(BI.Calendar.getPageByDateJSON(timeOb)),this.calendar.setValue(timeOb),this.selectedTime=timeOb},getValue:function(){return this.selectedTime}}),BI.DateCalendarPopup.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.date_calendar_popup",BI.DateCalendarPopup),BI.MonthPopup=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.MonthPopup.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-month-popup",behaviors:{}})},_init:function(){BI.MonthPopup.superclass._init.apply(this,arguments);var self=this,o=this.options,month=[1,7,2,8,3,9,4,10,5,11,6,12],items=[];items.push(month.slice(0,2)),items.push(month.slice(2,4)),items.push(month.slice(4,6)),items.push(month.slice(6,8)),items.push(month.slice(8,10)),items.push(month.slice(10,12)),items=BI.map(items,function(i,item){return BI.map(item,function(j,td){return{type:"bi.text_item",cls:"bi-list-item-select",textAlign:"center",whiteSpace:"nowrap",once:!1,forceSelected:!0,height:23,width:38,value:td,text:td}})}),this.month=BI.createWidget({type:"bi.button_group",element:this,behaviors:o.behaviors,items:BI.createItems(items,{}),layouts:[BI.LogicFactory.createLogic("table",BI.extend({dynamic:!0},{columns:2,rows:6,columnSize:[.5,.5],rowSize:25})),{type:"bi.center_adapt",vgap:1,hgap:2}],value:o.value}),this.month.on(BI.Controller.EVENT_CHANGE,function(type){self.fireEvent(BI.Controller.EVENT_CHANGE,arguments),type===BI.Events.CLICK&&self.fireEvent(BI.MonthPopup.EVENT_CHANGE)})},getValue:function(){return this.month.getValue()[0]},setValue:function(v){v=BI.parseInt(v),this.month.setValue([v])}}),BI.MonthPopup.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.month_popup",BI.MonthPopup),BI.YearPopup=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.YearPopup.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-year-popup",behaviors:{},min:"1900-01-01",max:"2099-12-31"})},_createYearCalendar:function(v){var o=this.options,y=this._year,calendar=BI.createWidget({type:"bi.year_calendar",behaviors:o.behaviors,min:o.min,max:o.max,logic:{dynamic:!0},year:y+12*v});return calendar.setValue(this._year),calendar},_init:function(){BI.YearPopup.superclass._init.apply(this,arguments);var self=this,o=this.options;this.selectedYear=this._year=BI.getDate().getFullYear();var backBtn=BI.createWidget({type:"bi.icon_button",cls:"pre-page-h-font",width:24,height:24,value:-1}),preBtn=BI.createWidget({type:"bi.icon_button",cls:"next-page-h-font",width:24,height:24,value:1});this.navigation=BI.createWidget({type:"bi.navigation",element:this,single:!0,logic:{dynamic:!0},tab:{cls:"year-popup-navigation bi-high-light bi-split-top",height:24,items:[backBtn,preBtn]},cardCreator:BI.bind(this._createYearCalendar,this),afterCardShow:function(){this.setValue(self.selectedYear);var calendar=this.getSelectedCard();backBtn.setEnable(!calendar.isFrontYear()),preBtn.setEnable(!calendar.isFinalYear())}}),this.navigation.on(BI.Navigation.EVENT_CHANGE,function(){self.selectedYear=this.getValue(),self.fireEvent(BI.Controller.EVENT_CHANGE,arguments),self.fireEvent(BI.YearPopup.EVENT_CHANGE,self.selectedYear)}),BI.isKey(o.value)&&this.setValue(o.value)},getValue:function(){return this.selectedYear},setValue:function(v){var o=this.options;v=BI.parseInt(v);var startDate=BI.parseDateTime(o.min,"%Y-%X-%d"),endDate=BI.parseDateTime(o.max,"%Y-%X-%d");BI.checkDateVoid(v,1,1,BI.print(BI.getDate(startDate.getFullYear(),0,1),"%Y-%X-%d"),BI.print(BI.getDate(endDate.getFullYear(),0,1),"%Y-%X-%d"))[0]?(v=BI.getDate().getFullYear(),this.selectedYear="",this.navigation.setSelect(BI.YearCalendar.getPageByYear(v)),this.navigation.setValue("")):(this.selectedYear=v,this.navigation.setSelect(BI.YearCalendar.getPageByYear(v)),this.navigation.setValue(v))}}),BI.YearPopup.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.year_popup",BI.YearPopup),BI.DateTriangleTrigger=BI.inherit(BI.Trigger,{_const:{height:24,iconWidth:12,iconHeight:12},_defaultConfig:function(){return BI.extend(BI.DateTriangleTrigger.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-date-triangle-trigger pull-down-ha-font cursor-pointer",height:24})},_init:function(){BI.DateTriangleTrigger.superclass._init.apply(this,arguments);var o=this.options,c=this._const;this.text=BI.createWidget({type:"bi.label",cls:"list-item-text",textAlign:"right",text:o.text,value:o.value,height:c.height}),BI.createWidget({type:"bi.vertical_adapt",element:this,items:[{el:this.text, +rgap:5},{type:"bi.icon_label",width:16}]})},setValue:function(v){this.text.setValue(v)},getValue:function(){return this.text.getValue()},setText:function(v){this.text.setText(v)},getText:function(){return this.item.getText()},getKey:function(){}}),BI.shortcut("bi.date_triangle_trigger",BI.DateTriangleTrigger),BI.StaticDatePaneCard=BI.inherit(BI.Widget,{_defaultConfig:function(){var conf=BI.StaticDatePaneCard.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{baseCls:"bi-date-pane",min:"1900-01-01",max:"2099-12-31",selectedTime:null})},_init:function(){BI.StaticDatePaneCard.superclass._init.apply(this,arguments);var self=this,o=this.options;this.today=BI.getDate(),this._year=this.today.getFullYear(),this._month=this.today.getMonth()+1,this.selectedTime=o.selectedTime||{year:this._year,month:this._month},this.datePicker=BI.createWidget({type:"bi.date_picker",behaviors:o.behaviors,min:o.min,max:o.max}),this.datePicker.on(BI.DatePicker.EVENT_CHANGE,function(){var value=self.datePicker.getValue(),monthDay=BI.getMonthDays(BI.getDate(value.year,value.month-1,1)),day=self.selectedTime.day||0;day>monthDay&&(day=monthDay),self.selectedTime={year:value.year,month:value.month},0!==day&&(self.selectedTime.day=day),self.calendar.setSelect(BI.Calendar.getPageByDateJSON(self.selectedTime)),self.calendar.setValue(self.selectedTime),0!==day&&self.fireEvent(BI.DateCalendarPopup.EVENT_CHANGE)}),this.calendar=BI.createWidget({direction:"custom",type:"bi.navigation",tab:this.datePicker,cardCreator:BI.bind(this._createNav,this)}),this.calendar.on(BI.Navigation.EVENT_CHANGE,function(){self.selectedTime=self.calendar.getValue(),self.calendar.empty(),self.setValue(self.selectedTime),self.fireEvent(BI.DateCalendarPopup.EVENT_CHANGE)}),this.setValue(o.selectedTime),BI.createWidget({type:"bi.vtape",element:this,items:[{el:this.datePicker,height:40},this.calendar],hgap:10}),BI.createWidget({type:"bi.absolute",element:this,items:[{el:{type:"bi.layout",cls:"bi-split-top"},height:1,top:40,left:0,right:0}]})},_createNav:function(v){var date=BI.Calendar.getDateJSONByPage(v),calendar=BI.createWidget({type:"bi.calendar",logic:{dynamic:!1},min:this.options.min,max:this.options.max,year:date.year,month:date.month,day:this.selectedTime.day});return calendar},_getNewCurrentDate:function(){var today=BI.getDate();return{year:today.getFullYear(),month:today.getMonth()+1}},_setCalenderValue:function(date){this.calendar.setSelect(BI.Calendar.getPageByDateJSON(date)),this.calendar.setValue(date),this.selectedTime=date},_setDatePicker:function(timeOb){BI.isNull(timeOb)||BI.isNull(timeOb.year)||BI.isNull(timeOb.month)?this.datePicker.setValue(this._getNewCurrentDate()):this.datePicker.setValue(timeOb)},_setCalendar:function(timeOb){BI.isNull(timeOb)||BI.isNull(timeOb.day)?(this.calendar.empty(),this._setCalenderValue(this._getNewCurrentDate())):this._setCalenderValue(timeOb)},setValue:function(timeOb){this._setDatePicker(timeOb),this._setCalendar(timeOb)},getValue:function(){return this.selectedTime}}),BI.shortcut("bi.static_date_pane_card",BI.StaticDatePaneCard),BI.DynamicDatePane=BI.inherit(BI.Widget,{props:{baseCls:"bi-dynamic-date-pane"},render:function(){var self=this,o=this.options;return{type:"bi.vtape",items:[{el:{type:"bi.linear_segment",cls:"bi-split-bottom",height:30,items:BI.createItems([{text:BI.i18nText("BI-Multi_Date_YMD"),value:BI.DynamicDatePane.Static},{text:BI.i18nText("BI-Basic_Dynamic_Title"),value:BI.DynamicDatePane.Dynamic}],{textAlign:"center"}),listeners:[{eventName:BI.ButtonGroup.EVENT_CHANGE,action:function(){var value=this.getValue()[0];switch(self.dateTab.setSelect(value),value){case BI.DynamicDatePane.Static:var date=BI.DynamicDateHelper.getCalculation(self.dynamicPane.getValue());self.ymd.setValue({year:date.getFullYear(),month:date.getMonth()+1,day:date.getDate()});break;case BI.DynamicDatePane.Dynamic:self.dynamicPane.setValue({year:0})}self.fireEvent("EVENT_CHANGE")}}],ref:function(){self.switcher=this}},height:30},{type:"bi.tab",ref:function(){self.dateTab=this},showIndex:BI.DynamicDatePane.Static,cardCreator:function(v){switch(v){case BI.DynamicDatePane.Static:return{type:"bi.static_date_pane_card",behaviors:o.behaviors,listeners:[{eventName:"EVENT_CHANGE",action:function(){self.fireEvent("EVENT_CHANGE")}}],ref:function(){self.ymd=this}};case BI.DynamicDatePane.Dynamic:default:return{type:"bi.dynamic_date_card",listeners:[{eventName:"EVENT_CHANGE",action:function(){self._checkValue(self.getValue())&&self.fireEvent("EVENT_CHANGE")}}],ref:function(){self.dynamicPane=this}}}}}]}},mounted:function(){this.setValue(this.options.value)},_checkValueValid:function(value){return BI.isNull(value)||BI.isEmptyObject(value)||BI.isEmptyString(value)},_checkValue:function(v){switch(v.type){case BI.DynamicDateCombo.Dynamic:return BI.isNotEmptyObject(v.value);case BI.DynamicDateCombo.Static:default:return!0}},setValue:function(v){v=v||{};var type=v.type||BI.DynamicDateCombo.Static,value=v.value||v;switch(this.switcher.setValue(type),this.dateTab.setSelect(type),type){case BI.DynamicDateCombo.Dynamic:this.dynamicPane.setValue(value);break;case BI.DynamicDateCombo.Static:default:if(this._checkValueValid(value)){var date=BI.getDate();this.ymd.setValue({year:date.getFullYear(),month:date.getMonth()+1})}else this.ymd.setValue(value)}},getValue:function(){return{type:this.dateTab.getSelect(),value:this.dateTab.getValue()}}}),BI.shortcut("bi.dynamic_date_pane",BI.DynamicDatePane),BI.extend(BI.DynamicDatePane,{Static:1,Dynamic:2}),BI.DateTimeCombo=BI.inherit(BI.Single,{constants:{popupHeight:290,popupWidth:270,comboAdjustHeight:1,border:1},_defaultConfig:function(){return BI.extend(BI.DateTimeCombo.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-date-time-combo bi-border bi-border-radius",width:200,height:24,minDate:"1900-01-01",maxDate:"2099-12-31"})},_init:function(){BI.DateTimeCombo.superclass._init.apply(this,arguments);var self=this,opts=this.options,date=BI.getDate();this.storeValue=BI.isNotNull(opts.value)?opts.value:{year:date.getFullYear(),month:date.getMonth()+1,day:date.getDate(),hour:date.getHours(),minute:date.getMinutes(),second:date.getSeconds()},this.trigger=BI.createWidget({type:"bi.date_time_trigger",min:opts.minDate,max:opts.maxDate,value:opts.value}),this.popup=BI.createWidget({type:"bi.date_time_popup",behaviors:opts.behaviors,min:opts.minDate,max:opts.maxDate,value:opts.value}),self.setValue(this.storeValue),this.popup.on(BI.DateTimePopup.BUTTON_CANCEL_EVENT_CHANGE,function(){self.setValue(self.storeValue),self.hidePopupView(),self.fireEvent(BI.DateTimeCombo.EVENT_CANCEL)}),this.popup.on(BI.DateTimePopup.BUTTON_OK_EVENT_CHANGE,function(){self.storeValue=self.popup.getValue(),self.setValue(self.storeValue),self.hidePopupView(),self.fireEvent(BI.DateTimeCombo.EVENT_CONFIRM)}),this.combo=BI.createWidget({type:"bi.combo",container:opts.container,toggle:!1,isNeedAdjustHeight:!1,isNeedAdjustWidth:!1,el:this.trigger,adjustLength:this.constants.comboAdjustHeight,popup:{el:this.popup,width:this.constants.popupWidth,stopPropagation:!1},hideChecker:function(e){return 0===triggerBtn.element.find(e.target).length}}),this.combo.on(BI.Combo.EVENT_BEFORE_POPUPVIEW,function(){self.popup.setValue(self.storeValue),self.fireEvent(BI.DateTimeCombo.EVENT_BEFORE_POPUPVIEW)});var triggerBtn=BI.createWidget({type:"bi.icon_button",cls:"bi-trigger-icon-button date-font",width:24,height:24});triggerBtn.on(BI.IconButton.EVENT_CHANGE,function(){self.combo.isViewVisible()||self.combo.showView()}),BI.createWidget({type:"bi.htape",element:this,items:[{type:"bi.absolute",items:[{el:this.combo,top:0,left:0,right:0,bottom:0},{el:triggerBtn,top:0,right:0}]}]})},setValue:function(v){this.storeValue=v,this.popup.setValue(v),this.trigger.setValue(v)},getValue:function(){return this.storeValue},hidePopupView:function(){this.combo.hideView()}}),BI.DateTimeCombo.EVENT_CANCEL="EVENT_CANCEL",BI.DateTimeCombo.EVENT_CONFIRM="EVENT_CONFIRM",BI.DateTimeCombo.EVENT_CHANGE="EVENT_CHANGE",BI.DateTimeCombo.EVENT_BEFORE_POPUPVIEW="EVENT_BEFORE_POPUPVIEW",BI.shortcut("bi.date_time_combo",BI.DateTimeCombo),BI.DateTimePopup=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.DateTimePopup.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-date-time-popup",width:268,height:374})},_init:function(){BI.DateTimePopup.superclass._init.apply(this,arguments);var self=this,opts=this.options;this.cancelButton=BI.createWidget({type:"bi.text_button",cls:"multidate-popup-button bi-border-top bi-border-right",shadow:!0,text:BI.i18nText("BI-Basic_Cancel")}),this.cancelButton.on(BI.TextButton.EVENT_CHANGE,function(){self.fireEvent(BI.DateTimePopup.BUTTON_CANCEL_EVENT_CHANGE)}),this.okButton=BI.createWidget({type:"bi.text_button",cls:"multidate-popup-button bi-border-top",shadow:!0,text:BI.i18nText("BI-Basic_OK")}),this.okButton.on(BI.TextButton.EVENT_CHANGE,function(){self.fireEvent(BI.DateTimePopup.BUTTON_OK_EVENT_CHANGE)}),this.dateCombo=BI.createWidget({type:"bi.date_calendar_popup",behaviors:opts.behaviors,min:self.options.min,max:self.options.max}),self.dateCombo.on(BI.DateCalendarPopup.EVENT_CHANGE,function(){self.fireEvent(BI.DateTimePopup.CALENDAR_EVENT_CHANGE)}),this.dateButton=BI.createWidget({type:"bi.grid",items:[[this.cancelButton,this.okButton]]}),BI.createWidget({element:this,type:"bi.vtape",items:[{el:this.dateCombo},{el:{type:"bi.center_adapt",cls:"bi-split-top",items:[{type:"bi.dynamic_date_time_select",ref:function(_ref){self.timeSelect=_ref}}]},height:50},{el:this.dateButton,height:30}]}),this.setValue(opts.value)},setValue:function(v){var value=v,date;BI.isNull(value)?(date=BI.getDate(),this.dateCombo.setValue({year:date.getFullYear(),month:date.getMonth()+1,day:date.getDate()}),this.timeSelect.setValue({hour:date.getHours(),minute:date.getMinutes(),second:date.getSeconds()})):(this.dateCombo.setValue({year:value.year,month:value.month,day:value.day}),this.timeSelect.setValue({hour:value.hour,minute:value.minute,second:value.second}))},getValue:function(){return BI.extend({year:this.dateCombo.getValue().year,month:this.dateCombo.getValue().month,day:this.dateCombo.getValue().day},this.timeSelect.getValue())}}),BI.DateTimePopup.BUTTON_OK_EVENT_CHANGE="BUTTON_OK_EVENT_CHANGE",BI.DateTimePopup.BUTTON_CANCEL_EVENT_CHANGE="BUTTON_CANCEL_EVENT_CHANGE",BI.DateTimePopup.CALENDAR_EVENT_CHANGE="CALENDAR_EVENT_CHANGE",BI.shortcut("bi.date_time_popup",BI.DateTimePopup),BI.DateTimeTrigger=BI.inherit(BI.Trigger,{_const:{hgap:4},_defaultConfig:function(){return BI.extend(BI.DateTimeTrigger.superclass._defaultConfig.apply(this,arguments),{extraCls:"bi-date-time-trigger",min:"1900-01-01",max:"2099-12-31",height:24,width:200})},_init:function(){BI.DateTimeTrigger.superclass._init.apply(this,arguments);var self=this,o=this.options,c=this._const;this.text=BI.createWidget({type:"bi.label",textAlign:"left",height:o.height,width:o.width,hgap:c.hgap}),BI.createWidget({type:"bi.htape",element:this,items:[{el:this.text},{el:BI.createWidget(),width:o.height}]}),this.setValue(o.value)},_printTime:function(v){return v<10?"0"+v:v},setValue:function(v){var self=this,value=v,dateStr;if(BI.isNull(value))value=BI.getDate(),dateStr=BI.print(value,"%Y-%X-%d %H:%M:%S");else{var date=BI.getDate(value.year,value.month-1,value.day,value.hour,value.minute,value.second);dateStr=BI.print(date,"%Y-%X-%d %H:%M:%S")}this.text.setText(dateStr),this.text.setTitle(dateStr)}}),BI.shortcut("bi.date_time_trigger",BI.DateTimeTrigger),BI.StaticDateTimePaneCard=BI.inherit(BI.Widget,{_defaultConfig:function(){var conf=BI.StaticDateTimePaneCard.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{baseCls:"bi-date-time-pane",min:"1900-01-01",max:"2099-12-31",selectedTime:null})},_init:function(){BI.StaticDateTimePaneCard.superclass._init.apply(this,arguments);var self=this,o=this.options;this.today=BI.getDate(),this._year=this.today.getFullYear(),this._month=this.today.getMonth()+1,this.selectedTime=o.selectedTime||{year:this._year,month:this._month},this.datePicker=BI.createWidget({type:"bi.date_picker",behaviors:o.behaviors,min:o.min,max:o.max}),this.datePicker.on(BI.DatePicker.EVENT_CHANGE,function(){var value=self.datePicker.getValue(),monthDay=BI.getMonthDays(BI.getDate(value.year,value.month-1,1)),day=self.selectedTime.day||0;day>monthDay&&(day=monthDay),self.selectedTime=BI.extend(self.selectedTime,{year:value.year,month:value.month,day:day}),0!==day&&(self.selectedTime.day=day),self.calendar.setSelect(BI.Calendar.getPageByDateJSON(self.selectedTime)),self.calendar.setValue(self.selectedTime),0!==day&&self.fireEvent(BI.DateCalendarPopup.EVENT_CHANGE)}),this.calendar=BI.createWidget({direction:"custom",type:"bi.navigation",tab:this.datePicker,cardCreator:BI.bind(this._createNav,this)}),this.calendar.on(BI.Navigation.EVENT_CHANGE,function(){self.selectedTime=BI.extend(self.calendar.getValue(),self.timeSelect.getValue()),self.calendar.empty(),self.setValue(self.selectedTime),self.fireEvent(BI.DateCalendarPopup.EVENT_CHANGE)}),BI.createWidget({type:"bi.vtape",element:this,hgap:10,items:[{el:this.datePicker,height:40},this.calendar,{el:{type:"bi.dynamic_date_time_select",cls:"bi-split-top",ref:function(){self.timeSelect=this},listeners:[{eventName:BI.DynamicDateTimeSelect.EVENT_CONFIRM,action:function(){self.selectedTime=BI.extend(self.calendar.getValue(),self.timeSelect.getValue()),self.fireEvent("EVENT_CHANGE")}}]},height:40}]}),BI.createWidget({type:"bi.absolute",element:this,items:[{el:{type:"bi.layout",cls:"bi-split-top"},height:1,top:40,left:0,right:0}]}),this.setValue(o.selectedTime)},_createNav:function(v){var date=BI.Calendar.getDateJSONByPage(v),calendar=BI.createWidget({type:"bi.calendar",logic:{dynamic:!1},min:this.options.min,max:this.options.max,year:date.year,month:date.month,day:this.selectedTime.day});return calendar},_getNewCurrentDate:function(){var today=BI.getDate();return{year:today.getFullYear(),month:today.getMonth()+1}},_setCalenderValue:function(date){this.calendar.setSelect(BI.Calendar.getPageByDateJSON(date)),this.calendar.setValue(date),this.selectedTime=BI.extend({},this.timeSelect.getValue(),date)},_setDatePicker:function(timeOb){BI.isNull(timeOb)||BI.isNull(timeOb.year)||BI.isNull(timeOb.month)?this.datePicker.setValue(this._getNewCurrentDate()):this.datePicker.setValue(timeOb)},_setCalendar:function(timeOb){BI.isNull(timeOb)||BI.isNull(timeOb.day)?(this.calendar.empty(),this._setCalenderValue(this._getNewCurrentDate())):this._setCalenderValue(timeOb)},setValue:function(timeOb){timeOb=timeOb||{},this._setDatePicker(timeOb),this._setCalendar(timeOb),this.timeSelect.setValue({hour:timeOb.hour,minute:timeOb.minute,second:timeOb.second})},getValue:function(){return this.selectedTime}}),BI.shortcut("bi.static_date_time_pane_card",BI.StaticDateTimePaneCard),BI.DynamicDateTimePane=BI.inherit(BI.Widget,{props:{baseCls:"bi-dynamic-date-pane"},render:function(){var self=this,o=this.options;return{type:"bi.vtape",items:[{el:{type:"bi.linear_segment",cls:"bi-split-bottom",height:30,items:BI.createItems([{text:BI.i18nText("BI-Multi_Date_YMD"),value:BI.DynamicDateTimePane.Static},{text:BI.i18nText("BI-Basic_Dynamic_Title"),value:BI.DynamicDateTimePane.Dynamic}],{textAlign:"center"}),listeners:[{eventName:BI.ButtonGroup.EVENT_CHANGE,action:function(){var value=this.getValue()[0];switch(self.dateTab.setSelect(value),value){case BI.DynamicDateTimePane.Static:var date=BI.DynamicDateHelper.getCalculation(self.dynamicPane.getValue());self.ymd.setValue({year:date.getFullYear(),month:date.getMonth()+1,day:date.getDate()});break;case BI.DynamicDateTimePane.Dynamic:self.dynamicPane.setValue({year:0})}}}],ref:function(){self.switcher=this}},height:30},{type:"bi.tab",ref:function(){self.dateTab=this},showIndex:BI.DynamicDateTimePane.Static,cardCreator:function(v){switch(v){case BI.DynamicDateTimePane.Static:return{type:"bi.static_date_time_pane_card",behaviors:o.behaviors,listeners:[{eventName:"EVENT_CHANGE",action:function(){self.fireEvent("EVENT_CHANGE")}}],ref:function(){self.ymd=this}};case BI.DynamicDateTimePane.Dynamic:default:return{type:"bi.dynamic_date_card",listeners:[{eventName:"EVENT_CHANGE",action:function(){self._checkValue(self.getValue())&&self.fireEvent("EVENT_CHANGE")}}],ref:function(){self.dynamicPane=this}}}}}]}},mounted:function(){this.setValue(this.options.value)},_checkValueValid:function(value){return BI.isNull(value)||BI.isEmptyObject(value)||BI.isEmptyString(value)},_checkValue:function(v){switch(v.type){case BI.DynamicDateCombo.Dynamic:return BI.isNotEmptyObject(v.value);case BI.DynamicDateCombo.Static:default:return!0}},setValue:function(v){v=v||{};var type=v.type||BI.DynamicDateTimePane.Static,value=v.value||v;switch(this.switcher.setValue(type),this.dateTab.setSelect(type),type){case BI.DynamicDateTimePane.Dynamic:this.dynamicPane.setValue(value);break;case BI.DynamicDateTimePane.Static:default:if(this._checkValueValid(value)){var date=BI.getDate();this.ymd.setValue({year:date.getFullYear(),month:date.getMonth()+1})}else this.ymd.setValue(value)}},getValue:function(){return{type:this.dateTab.getSelect(),value:this.dateTab.getValue()}}}),BI.shortcut("bi.dynamic_date_time_pane",BI.DynamicDateTimePane),BI.extend(BI.DynamicDateTimePane,{Static:1,Dynamic:2}),BI.DownListCombo=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.DownListCombo.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-down-list-combo",height:24,items:[],adjustLength:0,direction:"bottom",trigger:"click",container:null,stopPropagation:!1,el:{}})},_init:function(){BI.DownListCombo.superclass._init.apply(this,arguments);var self=this,o=this.options;this.popupview=BI.createWidget({type:"bi.down_list_popup",items:o.items,chooseType:o.chooseType,value:o.value}),this.popupview.on(BI.DownListPopup.EVENT_CHANGE,function(value){self.fireEvent(BI.DownListCombo.EVENT_CHANGE,value),self.downlistcombo.hideView()}),this.popupview.on(BI.DownListPopup.EVENT_SON_VALUE_CHANGE,function(value,fatherValue){self.fireEvent(BI.DownListCombo.EVENT_SON_VALUE_CHANGE,value,fatherValue),self.downlistcombo.hideView()}),this.downlistcombo=BI.createWidget({element:this,type:"bi.combo",trigger:o.trigger,isNeedAdjustWidth:!1,container:o.container,adjustLength:o.adjustLength,direction:o.direction,stopPropagation:o.stopPropagation,el:BI.createWidget(o.el,{type:"bi.icon_trigger",extraCls:o.iconCls,width:o.width,height:o.height}),popup:{el:this.popupview,stopPropagation:o.stopPropagation,maxHeight:1e3,minWidth:140}}),this.downlistcombo.on(BI.Combo.EVENT_BEFORE_POPUPVIEW,function(){self.fireEvent(BI.DownListCombo.EVENT_BEFORE_POPUPVIEW)})},hideView:function(){this.downlistcombo.hideView()},showView:function(e){this.downlistcombo.showView(e)},populate:function(items){this.popupview.populate(items)},setValue:function(v){this.popupview.setValue(v)},getValue:function(){return this.popupview.getValue()}}),BI.DownListCombo.EVENT_CHANGE="EVENT_CHANGE",BI.DownListCombo.EVENT_SON_VALUE_CHANGE="EVENT_SON_VALUE_CHANGE",BI.DownListCombo.EVENT_BEFORE_POPUPVIEW="EVENT_BEFORE_POPUPVIEW",BI.shortcut("bi.down_list_combo",BI.DownListCombo),BI.DownListGroup=BI.inherit(BI.Widget,{constants:{iconCls:"check-mark-ha-font"},_defaultConfig:function(){return BI.extend(BI.DownListGroup.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-down-list-group",items:[{el:{}}]})},_init:function(){BI.DownListGroup.superclass._init.apply(this,arguments);var o=this.options,self=this;this.downlistgroup=BI.createWidget({element:this,type:"bi.button_tree",items:o.items,chooseType:0,layouts:[{type:"bi.vertical",hgap:0,vgap:0}],value:o.value}),this.downlistgroup.on(BI.Controller.EVENT_CHANGE,function(type){self.fireEvent(BI.Controller.EVENT_CHANGE,arguments),type===BI.Events.CLICK&&self.fireEvent(BI.DownListGroup.EVENT_CHANGE,arguments)})},getValue:function(){return this.downlistgroup.getValue()},setValue:function(v){this.downlistgroup.setValue(v)}}),BI.DownListGroup.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.down_list_group",BI.DownListGroup),BI.DownListItem=BI.inherit(BI.BasicButton,{_defaultConfig:function(){var conf=BI.DownListItem.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{baseCls:"bi-down-list-item bi-list-item-active",cls:"",height:24,logic:{dynamic:!0},selected:!1,iconHeight:null,iconWidth:null,textHgap:0,textVgap:0,textLgap:0,textRgap:0})},_init:function(){BI.DownListItem.superclass._init.apply(this,arguments);var self=this,o=this.options;this.text=BI.createWidget({type:"bi.label",cls:"list-item-text",textAlign:"left",hgap:o.textHgap,vgap:o.textVgap,lgap:o.textLgap,rgap:o.textRgap,text:o.text,value:o.value,keyword:o.keyword,height:o.height}),this.icon=BI.createWidget({type:"bi.center_adapt",width:36,height:o.height,items:[{el:{type:"bi.icon",width:o.iconWidth,height:o.iconHeight}}]}),BI.createWidget(BI.extend({element:this},BI.LogicFactory.createLogic(BI.LogicFactory.createLogicTypeByDirection(BI.Direction.Left),BI.extend(o.logic,{items:BI.LogicFactory.createLogicItemsByDirection(BI.Direction.Left,this.icon,this.text)}))))},setValue:function(){this.isReadOnly()||this.text.setValue.apply(this.text,arguments)},getValue:function(){return this.text.getValue()},setText:function(){this.text.setText.apply(this.text,arguments)},getText:function(){return this.text.getText()},doClick:function(){BI.DownListItem.superclass.doClick.apply(this,arguments),this.isValid()&&this.fireEvent(BI.DownListItem.EVENT_CHANGE,this.getValue(),this)},doRedMark:function(){this.text.doRedMark.apply(this.text,arguments)},unRedMark:function(){this.text.unRedMark.apply(this.text,arguments)},doHighLight:function(){this.text.doHighLight.apply(this.text,arguments)},unHighLight:function(){this.text.unHighLight.apply(this.text,arguments)}}),BI.DownListItem.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.down_list_item",BI.DownListItem),BI.DownListGroupItem=BI.inherit(BI.BasicButton,{_defaultConfig:function(){var conf=BI.DownListGroupItem.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{baseCls:(conf.baseCls||"")+" bi-down-list-group-item",logic:{dynamic:!1},iconCls1:"dot-e-font",iconCls2:"pull-right-e-font"})},_init:function(){BI.DownListGroupItem.superclass._init.apply(this,arguments);var o=this.options,self=this;this.text=BI.createWidget({type:"bi.label",cls:"list-group-item-text",textAlign:"left",text:o.text,value:o.value,height:o.height}),this.icon1=BI.createWidget({type:"bi.icon_button",cls:o.iconCls1,width:36,disableSelected:!0,selected:this._digest(o.value)}),this.icon2=BI.createWidget({type:"bi.icon_button",cls:o.iconCls2,width:24,forceNotSelected:!0});var blank=BI.createWidget({type:"bi.layout",width:24});BI.createWidget({type:"bi.absolute",element:this,items:[{el:this.icon2,top:0,bottom:0,right:0}]}),BI.createWidget(BI.extend({element:this},BI.LogicFactory.createLogic("horizontal",BI.extend(o.logic,{items:BI.LogicFactory.createLogicItemsByDirection("left",this.icon1,this.text,blank)})))),this.element.hover(function(){self.isEnabled()&&self.hover()},function(){self.isEnabled()&&self.dishover()})},_digest:function(v){var self=this,o=this.options;return v=BI.isArray(v)?v:[v],BI.any(v,function(idx,value){return BI.contains(o.childValues,value)})},hover:function(){BI.DownListGroupItem.superclass.hover.apply(this,arguments),this.icon1.element.addClass("hover"),this.icon2.element.addClass("hover")},dishover:function(){BI.DownListGroupItem.superclass.dishover.apply(this,arguments),this.icon1.element.removeClass("hover"),this.icon2.element.removeClass("hover")},doClick:function(){BI.DownListGroupItem.superclass.doClick.apply(this,arguments),this.isValid()&&this.fireEvent(BI.DownListGroupItem.EVENT_CHANGE,this.getValue())},doRedMark:function(){this.text.doRedMark.apply(this.text,arguments)},unRedMark:function(){this.text.unRedMark.apply(this.text,arguments)},setValue:function(v){this.icon1.setSelected(this._digest(v))}}),BI.DownListGroupItem.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.down_list_group_item",BI.DownListGroupItem),BI.DownListPopup=BI.inherit(BI.Pane,{constants:{nextIcon:"pull-right-e-font",height:24,iconHeight:12,iconWidth:12,hgap:0,vgap:0,border:1},_defaultConfig:function(){var conf=BI.DownListPopup.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{baseCls:"bi-down-list-popup",items:[],chooseType:BI.Selection.Multi})},_init:function(){BI.DownListPopup.superclass._init.apply(this,arguments),this.singleValues=[],this.childValueMap={},this.fatherValueMap={},this.items=BI.deepClone(this.options.items);var self=this,o=this.options,children=this._createChildren(this.items);this.popup=BI.createWidget({type:"bi.button_tree",items:BI.createItems(children,{},{adjustLength:-2}),layouts:[{type:"bi.vertical",hgap:this.constants.hgap,vgap:this.constants.vgap}],value:this._digest(o.value),chooseType:o.chooseType}),this.popup.on(BI.ButtonTree.EVENT_CHANGE,function(value,object){var changedValue=value;if(BI.isNotNull(self.childValueMap[value])?(changedValue=self.childValueMap[value],self.fireEvent(BI.DownListPopup.EVENT_SON_VALUE_CHANGE,changedValue,self.fatherValueMap[value])):self.fireEvent(BI.DownListPopup.EVENT_CHANGE,changedValue,object),!BI.contains(self.singleValues,changedValue)){var item=self.getValue(),result=[];BI.each(item,function(i,valueObject){valueObject.value!=changedValue&&result.push(valueObject)}),self.setValue(result)}}),BI.createWidget({type:"bi.vertical",element:this,items:[this.popup],vgap:5})},_createChildren:function(items){var self=this,result=[];return BI.each(items,function(i,it){var item_done={type:"bi.down_list_group",items:[]};if(BI.each(it,function(i,item){BI.isNotEmptyArray(item.children)&&!BI.isEmpty(item.el)?(item.type="bi.combo_group",item.isDefaultInit=!0,item.cls="down-list-group",item.trigger="hover",item.isNeedAdjustWidth=!1,item.el.title=item.el.title||item.el.text,item.el.type="bi.down_list_group_item",item.el.logic={dynamic:!0},item.el.height=self.constants.height,item.el.iconCls2=self.constants.nextIcon,item.popup={lgap:1,el:{type:"bi.button_tree",chooseType:0,layouts:[{type:"bi.vertical"}]},innerVGap:5,maxHeight:378},item.el.childValues=[],BI.each(item.children,function(i,child){var fatherValue=BI.deepClone(item.el.value),childValue=BI.deepClone(child.value);self.singleValues.push(child.value),child.type="bi.down_list_item",child.extraCls=" child-down-list-item",child.title=child.title||child.text,child.textRgap=10,child.isNeedAdjustWidth=!1,child.logic={dynamic:!0},child.father=fatherValue,self.fatherValueMap[self._createChildValue(fatherValue,childValue)]=fatherValue,self.childValueMap[self._createChildValue(fatherValue,childValue)]=childValue,child.value=self._createChildValue(fatherValue,childValue),item.el.childValues.push(child.value)})):(item.type="bi.down_list_item",item.title=item.title||item.text,item.textRgap=10,item.isNeedAdjustWidth=!1,item.logic={dynamic:!0});var el_done={};el_done.el=item,item_done.items.push(el_done)}),self._isGroup(item_done.items)&&BI.each(item_done.items,function(i,item){self.singleValues.push(item.el.value)}),result.push(item_done),self._needSpliter(i,items.length)){var spliter_container=BI.createWidget({type:"bi.vertical",items:[{el:{type:"bi.layout",cls:"bi-down-list-spliter bi-split-top cursor-pointer",height:0}}],cls:"bi-down-list-spliter-container cursor-pointer",vgap:5,lgap:10,rgap:0});result.push(spliter_container)}}),result},_isGroup:function(i){return i.length>1},_needSpliter:function(i,itemLength){return i0?1:0}},setValue:function(v){v=v||{},this.position=v.position||BI.DynamicDateCard.OFFSET.CURRENT;var values=[],valuesItems=[];BI.isNotNull(v.year)&&(values.push(BI.DynamicDateCard.TYPE.YEAR),valuesItems.push(this._createValue(BI.DynamicDateCard.TYPE.YEAR,v.year))),BI.isNotNull(v.quarter)&&(values.push(BI.DynamicDateCard.TYPE.QUARTER),valuesItems.push(this._createValue(BI.DynamicDateCard.TYPE.QUARTER,v.quarter))),BI.isNotNull(v.month)&&(values.push(BI.DynamicDateCard.TYPE.MONTH),valuesItems.push(this._createValue(BI.DynamicDateCard.TYPE.MONTH,v.month))),BI.isNotNull(v.week)&&(values.push(BI.DynamicDateCard.TYPE.WEEK),valuesItems.push(this._createValue(BI.DynamicDateCard.TYPE.WEEK,v.week))),BI.isNotNull(v.day)&&(values.push(BI.DynamicDateCard.TYPE.DAY),valuesItems.push(this._createValue(BI.DynamicDateCard.TYPE.DAY,v.day))),BI.isNotNull(v.workDay)&&(values.push(BI.DynamicDateCard.TYPE.WORK_DAY),valuesItems.push(this._createValue(BI.DynamicDateCard.TYPE.WORK_DAY,v.workDay))),this.checkgroup.setValue(values),this.workDayBox.setSelected(BI.isNotNull(v.workDay)),this.resultPane.populate(this._getParamJson(valuesItems,v.position))},getValue:function(){var self=this,valueMap={},selectValues=this.checkgroup.getValue(),buttons=this.resultPane.getAllButtons();if(0!==selectValues.length&&BI.each(buttons,function(idx,button){var value=button.getValue();switch(value.dateType){case BI.DynamicDateCard.TYPE.YEAR:valueMap.year=0===value.offset?-value.value:value.value;break;case BI.DynamicDateCard.TYPE.QUARTER:valueMap.quarter=0===value.offset?-value.value:value.value;break;case BI.DynamicDateCard.TYPE.MONTH:valueMap.month=0===value.offset?-value.value:value.value;break;case BI.DynamicDateCard.TYPE.WEEK:valueMap.week=0===value.offset?-value.value:value.value;break;case BI.DynamicDateCard.TYPE.DAY:valueMap.day=0===value.offset?-value.value:value.value}BI.isNull(value.dateType)&&(valueMap.position=self.position||BI.DynamicDateCard.OFFSET.CURRENT)}),this.workDayBox.isSelected()){var value=buttons[0].getValue();valueMap.workDay=0===value.offset?-value.value:value.value}return valueMap}}),BI.shortcut("bi.dynamic_date_card",BI.DynamicDateCard),BI.extend(BI.DynamicDateCard,{TYPE:{YEAR:1,QUARTER:2,MONTH:3,WEEK:4,DAY:5,WORK_DAY:6},OFFSET:{CURRENT:1,BEGIN:2,END:3}}),BI.DynamicDateCombo=BI.inherit(BI.Single,{constants:{popupHeight:259,popupWidth:270,comboAdjustHeight:1,border:1},props:{baseCls:"bi-dynamic-date-combo bi-border bi-focus-shadow bi-border-radius",height:22,minDate:"1900-01-01",maxDate:"2099-12-31",format:"",allowEdit:!0},render:function(){var self=this,opts=this.options;this.storeTriggerValue="";var date=BI.getDate();return this.storeValue=opts.value,{type:"bi.htape",items:[{el:{type:"bi.icon_button",cls:"bi-trigger-icon-button date-change-h-font",width:opts.height,height:opts.height,ref:function(){self.changeIcon=this}},width:opts.height},{type:"bi.absolute",items:[{el:{type:"bi.combo",container:opts.container,ref:function(){self.combo=this},toggle:!1,isNeedAdjustHeight:!1,isNeedAdjustWidth:!1,el:{type:"bi.dynamic_date_trigger",min:opts.minDate,max:opts.maxDate,format:opts.format,allowEdit:opts.allowEdit,watermark:opts.watermark,height:opts.height,value:opts.value,ref:function(){self.trigger=this},listeners:[{eventName:BI.DynamicDateTrigger.EVENT_KEY_DOWN,action:function(){self.combo.isViewVisible()&&self.combo.hideView(),self.fireEvent(BI.DynamicDateCombo.EVENT_KEY_DOWN,arguments)}},{eventName:BI.DynamicDateTrigger.EVENT_STOP,action:function(){self.combo.isViewVisible()||self.combo.showView()}},{eventName:BI.DynamicDateTrigger.EVENT_FOCUS,action:function(){self.storeTriggerValue=self.trigger.getKey(),self.combo.isViewVisible()||self.combo.showView(),self.fireEvent(BI.DynamicDateCombo.EVENT_FOCUS)}},{eventName:BI.DynamicDateTrigger.EVENT_BLUR,action:function(){self.fireEvent(BI.DynamicDateCombo.EVENT_BLUR)}},{eventName:BI.DynamicDateTrigger.EVENT_ERROR,action:function(){self.storeValue={type:BI.DynamicDateCombo.Static,value:{year:date.getFullYear(),month:date.getMonth()+1}},self.fireEvent(BI.DynamicDateCombo.EVENT_ERROR)}},{eventName:BI.DynamicDateTrigger.EVENT_VALID,action:function(){self.fireEvent(BI.DynamicDateCombo.EVENT_VALID)}},{eventName:BI.DynamicDateTrigger.EVENT_CHANGE,action:function(){self.fireEvent(BI.DynamicDateCombo.EVENT_CHANGE)}},{eventName:BI.DynamicDateTrigger.EVENT_CONFIRM,action:function(){if(!self.combo.isViewVisible()){var dateStore=self.storeTriggerValue,dateObj=self.trigger.getKey();BI.isNotEmptyString(dateObj)&&!BI.isEqual(dateObj,dateStore)?(self.storeValue=self.trigger.getValue(),self.setValue(self.trigger.getValue())):BI.isEmptyString(dateObj)&&(self.storeValue=null,self.trigger.setValue()),self._checkDynamicValue(self.storeValue),self.fireEvent(BI.DynamicDateCombo.EVENT_CONFIRM)}}}]},adjustLength:this.constants.comboAdjustHeight,popup:{el:{type:"bi.dynamic_date_popup",behaviors:opts.behaviors,min:opts.minDate,max:opts.maxDate,value:opts.value,ref:function(){self.popup=this},listeners:[{eventName:BI.DynamicDatePopup.BUTTON_CLEAR_EVENT_CHANGE,action:function(){self.setValue(),self.combo.hideView(),self.fireEvent(BI.DynamicDateCombo.EVENT_CONFIRM)}},{eventName:BI.DynamicDatePopup.BUTTON_lABEL_EVENT_CHANGE,action:function(){var date=BI.getDate();self.setValue({type:BI.DynamicDateCombo.Static,value:{year:date.getFullYear(),month:date.getMonth()+1,day:date.getDate()}}),self.combo.hideView(),self.fireEvent(BI.DynamicDateCombo.EVENT_CONFIRM)}},{eventName:BI.DynamicDatePopup.BUTTON_OK_EVENT_CHANGE,action:function(){var value=self.popup.getValue();self._checkValue(value)&&self.setValue(value),self.combo.hideView(),self.fireEvent(BI.DynamicDateCombo.EVENT_CONFIRM)}},{eventName:BI.DynamicDatePopup.EVENT_CHANGE,action:function(){self.setValue(self.popup.getValue()),self.combo.hideView(),self.fireEvent(BI.DynamicDateCombo.EVENT_CONFIRM)}}]},stopPropagation:!1},hideChecker:function(e){return 0===self.triggerBtn.element.find(e.target).length},listeners:[{eventName:BI.Combo.EVENT_BEFORE_POPUPVIEW,action:function(){self.popup.setValue(self.storeValue),self.fireEvent(BI.DynamicDateCombo.EVENT_BEFORE_POPUPVIEW)}}]},top:0,left:0,right:0,bottom:0},{el:{type:"bi.icon_button",cls:"bi-trigger-icon-button date-font",width:opts.height,height:opts.height,listeners:[{eventName:BI.IconButton.EVENT_CHANGE,action:function(){self.combo.isViewVisible()||self.combo.showView()}}],ref:function(){self.triggerBtn=this}},top:0,right:0}]}],ref:function(_ref){self.comboWrapper=_ref}}},mounted:function(){this._checkDynamicValue(this.storeValue)},_checkDynamicValue:function(v){var o=this.options,type=null;switch(BI.isNotNull(v)&&(type=v.type),type){case BI.DynamicDateCombo.Dynamic:this.changeIcon.setVisible(!0),this.comboWrapper.attr("items")[0].width=o.height,this.comboWrapper.resize();break;default:this.comboWrapper.attr("items")[0].width=0,this.comboWrapper.resize(),this.changeIcon.setVisible(!1)}},_checkValue:function(v){switch(v.type){case BI.DynamicDateCombo.Dynamic:return BI.isNotEmptyObject(v.value);case BI.DynamicDateCombo.Static:default:return!0}},_defaultState:function(){},setValue:function(v){this.storeValue=v,this.trigger.setValue(v),this._checkDynamicValue(v)},getValue:function(){return this.storeValue},getKey:function(){return this.trigger.getKey()},hidePopupView:function(){this.combo.hideView()}}),BI.DynamicDateCombo.EVENT_KEY_DOWN="EVENT_KEY_DOWN",BI.DynamicDateCombo.EVENT_CONFIRM="EVENT_CONFIRM",BI.DynamicDateCombo.EVENT_FOCUS="EVENT_FOCUS",BI.DynamicDateCombo.EVENT_BLUR="EVENT_BLUR",BI.DynamicDateCombo.EVENT_CHANGE="EVENT_CHANGE",BI.DynamicDateCombo.EVENT_VALID="EVENT_VALID",BI.DynamicDateCombo.EVENT_ERROR="EVENT_ERROR",BI.DynamicDateCombo.EVENT_BEFORE_POPUPVIEW="EVENT_BEFORE_POPUPVIEW",BI.shortcut("bi.dynamic_date_combo",BI.DynamicDateCombo),BI.extend(BI.DynamicDateCombo,{Static:1,Dynamic:2}),BI.DynamicDateParamItem=BI.inherit(BI.Widget,{props:{baseCls:"bi-dynamic-date-param-item",dateType:BI.DynamicDateCard.TYPE.YEAR,value:0,offset:0,height:24},render:function(){var self=this,o=this.options;return{type:"bi.htape",items:[{el:{type:"bi.sign_editor",cls:"bi-border",height:22,validationChecker:function(v){return BI.isNaturalNumber(v)},value:o.value,ref:function(){self.editor=this},errorText:function(v){return BI.isEmptyString(v)?BI.i18nText("BI-Basic_Please_Input_Content"):BI.i18nText("BI-Please_Input_Natural_Number")},allowBlank:!1,listeners:[{eventName:BI.SignEditor.EVENT_CONFIRM,action:function(){self.fireEvent(BI.DynamicDateParamItem.EVENT_CHANGE)}}]},width:60},{el:{type:"bi.label",height:24,text:this._getText()},width:o.dateType===BI.DynamicDateCard.TYPE.WORK_DAY?60:20},{type:"bi.text_value_combo",height:24,items:[{text:BI.i18nText("BI-Basic_Front"),value:0},{text:BI.i18nText("BI-Basic_Behind"),value:1}],ref:function(){self.offsetCombo=this},container:null,value:o.offset,listeners:[{eventName:BI.TextValueCombo.EVENT_CHANGE,action:function(){self.fireEvent(BI.DynamicDateParamItem.EVENT_CHANGE)}}]}]}},_getText:function(){var text="";switch(this.options.dateType){case BI.DynamicDateCard.TYPE.YEAR:text=BI.i18nText("BI-Basic_Year");break;case BI.DynamicDateCard.TYPE.QUARTER:text=BI.i18nText("BI-Basic_Single_Quarter");break;case BI.DynamicDateCard.TYPE.MONTH:text=BI.i18nText("BI-Basic_Month");break;case BI.DynamicDateCard.TYPE.WEEK:text=BI.i18nText("BI-Basic_Week");break;case BI.DynamicDateCard.TYPE.DAY:text=BI.i18nText("BI-Basic_Day");break;case BI.DynamicDateCard.TYPE.WORK_DAY:default:text=BI.i18nText("BI-Basic_Work_Day")}return text},setValue:function(v){v=v||{},v.value=v.value||0,v.offset=v.offset||0,this.editor.setValue(v.value),this.offsetCombo.setValue(v.offset)},getValue:function(){return{dateType:this.options.dateType,value:this.editor.getValue(),offset:this.offsetCombo.getValue()[0]}}}),BI.DynamicDateParamItem.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.dynamic_date_param_item",BI.DynamicDateParamItem),BI.DynamicDatePopup=BI.inherit(BI.Widget,{constants:{tabHeight:30,buttonHeight:24},props:{baseCls:"bi-dynamic-date-popup",width:248,height:344},_init:function(){BI.DynamicDatePopup.superclass._init.apply(this,arguments);var self=this,opts=this.options,c=this.constants;this.storeValue={type:BI.DynamicDateCombo.Static},BI.createWidget({element:this,type:"bi.vtape",items:[{el:this._getTabJson()},{el:{type:"bi.grid",items:[[{type:"bi.text_button",cls:"bi-high-light bi-split-top",shadow:!0,text:BI.i18nText("BI-Basic_Clear"),textHeight:c.buttonHeight-1,listeners:[{eventName:BI.TextButton.EVENT_CHANGE,action:function(){self.fireEvent(BI.DynamicDatePopup.BUTTON_CLEAR_EVENT_CHANGE)}}]},{type:"bi.text_button",cls:"bi-split-left bi-split-right bi-high-light bi-split-top",shadow:!0,textHeight:c.buttonHeight-1,text:BI.i18nText("BI-Multi_Date_Today"),ref:function(){self.textButton=this},listeners:[{eventName:BI.TextButton.EVENT_CHANGE,action:function(){self.fireEvent(BI.DynamicDatePopup.BUTTON_lABEL_EVENT_CHANGE)}}]},{type:"bi.text_button",cls:"bi-high-light bi-split-top",textHeight:c.buttonHeight-1,shadow:!0,text:BI.i18nText("BI-Basic_OK"),listeners:[{eventName:BI.TextButton.EVENT_CHANGE,action:function(){self.fireEvent(BI.DynamicDatePopup.BUTTON_OK_EVENT_CHANGE)}}]}]]},height:24}]}),this.setValue(opts.value)},_getTabJson:function(){var self=this,o=this.options;return{type:"bi.tab",ref:function(){self.dateTab=this},tab:{type:"bi.linear_segment",cls:"bi-split-bottom",height:this.constants.tabHeight,items:BI.createItems([{text:BI.i18nText("BI-Multi_Date_YMD"),value:BI.DynamicDateCombo.Static},{text:BI.i18nText("BI-Basic_Dynamic_Title"),value:BI.DynamicDateCombo.Dynamic}],{textAlign:"center"})},cardCreator:function(v){switch(v){case BI.DynamicDateCombo.Dynamic:return{type:"bi.dynamic_date_card",listeners:[{eventName:"EVENT_CHANGE",action:function(){self._setInnerValue(self.year,v)}}],ref:function(){self.dynamicPane=this}};case BI.DynamicDateCombo.Static:default:return{type:"bi.date_calendar_popup",behaviors:o.behaviors,min:self.options.min,max:self.options.max,listeners:[{eventName:BI.DateCalendarPopup.EVENT_CHANGE,action:function(){self.fireEvent(BI.DynamicDatePopup.EVENT_CHANGE)}}],ref:function(){self.ymd=this}}}},listeners:[{eventName:BI.Tab.EVENT_CHANGE,action:function(){var v=self.dateTab.getSelect();switch(v){case BI.DynamicDateCombo.Static:var date=BI.DynamicDateHelper.getCalculation(self.dynamicPane.getValue());self.ymd.setValue({year:date.getFullYear(),month:date.getMonth()+1,day:date.getDate()}),self._setInnerValue();break;case BI.DynamicDateCombo.Dynamic:default:self.storeValue&&self.storeValue.type===BI.DynamicDateCombo.Dynamic?self.dynamicPane.setValue(self.storeValue.value):self.dynamicPane.setValue({year:0}),self._setInnerValue()}}}]}},_setInnerValue:function(){if(this.dateTab.getSelect()===BI.DynamicDateCombo.Static)this.textButton.setValue(BI.i18nText("BI-Multi_Date_Today")),this.textButton.setEnable(!0);else{var date=BI.DynamicDateHelper.getCalculation(this.dynamicPane.getValue());date=BI.print(date,"%Y-%X-%d"),this.textButton.setValue(date),this.textButton.setEnable(!1)}},_checkValueValid:function(value){return BI.isNull(value)||BI.isEmptyObject(value)||BI.isEmptyString(value)},setValue:function(v){this.storeValue=v;var self=this,type,value;switch(v=v||{},type=v.type||BI.DynamicDateCombo.Static,value=v.value||v,this.dateTab.setSelect(type),type){case BI.DynamicDateCombo.Dynamic:this.dynamicPane.setValue(value),self._setInnerValue();break;case BI.DynamicDateCombo.Static:default:if(this._checkValueValid(value)){var date=BI.getDate();this.ymd.setValue({year:date.getFullYear(),month:date.getMonth()+1,day:date.getDate()}),this.textButton.setValue(BI.i18nText("BI-Multi_Date_Today"))}else this.ymd.setValue(value),this.textButton.setValue(BI.i18nText("BI-Multi_Date_Today"));this.textButton.setEnable(!0)}},getValue:function(){return{type:this.dateTab.getSelect(),value:this.dateTab.getValue()}}}),BI.DynamicDatePopup.EVENT_CHANGE="EVENT_CHANGE",BI.DynamicDatePopup.BUTTON_OK_EVENT_CHANGE="BUTTON_OK_EVENT_CHANGE",BI.DynamicDatePopup.BUTTON_lABEL_EVENT_CHANGE="BUTTON_lABEL_EVENT_CHANGE",BI.DynamicDatePopup.BUTTON_CLEAR_EVENT_CHANGE="BUTTON_CLEAR_EVENT_CHANGE",BI.shortcut("bi.dynamic_date_popup",BI.DynamicDatePopup),BI.DynamicDateTrigger=BI.inherit(BI.Trigger,{_const:{hgap:4,vgap:2,yearLength:4,yearMonthLength:6,yearFullMonthLength:7,compareFormat:"%Y-%X-%d"},props:{extraCls:"bi-date-trigger",min:"1900-01-01",max:"2099-12-31",height:24,format:"",allowEdit:!0,watermark:""},_init:function(){BI.DynamicDateTrigger.superclass._init.apply(this,arguments);var self=this,o=this.options,c=this._const;this.storeTriggerValue="",this.editor=BI.createWidget({type:"bi.sign_editor",height:o.height,validationChecker:function(v){var formatStr=self._getStandardDateStr(v),date=formatStr.match(/\d+/g);return!BI.isKey(o.format)&&self._autoAppend(v,date),self._dateCheck(formatStr)&&BI.checkDateLegal(formatStr)&&self._checkVoid({year:0|date[0],month:0|date[1],day:0|date[2]})},quitChecker:function(){return!1},hgap:c.hgap,vgap:c.vgap,allowBlank:!0,watermark:BI.isKey(o.watermark)?o.watermark:BI.i18nText("BI-Basic_Unrestricted"),errorText:function(){var str="";return BI.isKey(o.format)||(str=self.editor.isEditing()?BI.i18nText("BI-Date_Trigger_Error_Text"):BI.i18nText("BI-Year_Trigger_Invalid_Text")),str},title:BI.bind(this._getTitle,this)}),this.editor.on(BI.SignEditor.EVENT_KEY_DOWN,function(){self.fireEvent(BI.DynamicDateTrigger.EVENT_KEY_DOWN,arguments)}),this.editor.on(BI.SignEditor.EVENT_FOCUS,function(){self.storeTriggerValue=self.getKey(),self.fireEvent(BI.DynamicDateTrigger.EVENT_FOCUS)}),this.editor.on(BI.SignEditor.EVENT_BLUR,function(){self.fireEvent(BI.DynamicDateTrigger.EVENT_BLUR)}),this.editor.on(BI.SignEditor.EVENT_STOP,function(){self.fireEvent(BI.DynamicDateTrigger.EVENT_STOP)}),this.editor.on(BI.SignEditor.EVENT_VALID,function(){self.fireEvent(BI.DynamicDateTrigger.EVENT_VALID)}),this.editor.on(BI.SignEditor.EVENT_ERROR,function(){self.fireEvent(BI.DynamicDateTrigger.EVENT_ERROR)}),this.editor.on(BI.SignEditor.EVENT_CONFIRM,function(){var value=self.editor.getValue();if(BI.isNotNull(value)&&self.editor.setState(value),BI.isNotEmptyString(value)&&!BI.isEqual(self.storeTriggerValue,self.getKey())){var formatStr=self._getStandardDateStr(value),date=formatStr.match(/\d+/g);self.storeValue={type:BI.DynamicDateCombo.Static,value:{year:0|date[0],month:0|date[1],day:0|date[2]}}}self.fireEvent(BI.DynamicDateTrigger.EVENT_CONFIRM)}),this.editor.on(BI.SignEditor.EVENT_SPACE,function(){self.editor.isValid()&&self.editor.blur()}),this.editor.on(BI.SignEditor.EVENT_START,function(){self.fireEvent(BI.DynamicDateTrigger.EVENT_START)}),this.editor.on(BI.SignEditor.EVENT_CHANGE,function(){self.fireEvent(BI.DynamicDateTrigger.EVENT_CHANGE)}),BI.createWidget({type:"bi.htape",element:this,items:[{el:this.editor},{el:BI.createWidget(),width:24}]}),!o.allowEdit&&BI.createWidget({type:"bi.absolute",element:this,items:[{el:{type:"bi.text",title:BI.bind(this._getTitle,this)},left:0,right:24,top:0,bottom:0}]}),this.setValue(o.value)},_getTitle:function(){var storeValue=this.storeValue||{},type=storeValue.type||BI.DynamicDateCombo.Static,value=storeValue.value;switch(type){case BI.DynamicDateCombo.Dynamic:var text=this._getText(value),date=BI.getDate();date=BI.DynamicDateHelper.getCalculation(value);var dateStr=BI.print(date,this._getFormatString());return BI.isEmptyString(text)?dateStr:text+":"+dateStr;case BI.DynamicDateCombo.Static:default:return BI.isNull(value)||BI.isNull(value.day)?"":BI.print(BI.getDate(value.year,value.month-1,value.day),this._getFormatString())}},_getStandardDateStr:function(v){var c=this._const,result=[0,1,2],formatArray=this._getFormatString().match(/%./g);BI.each(formatArray,function(idx,v){switch(v){case"%Y":case"%y":result[0]=idx;break;case"%X":case"%x":result[1]=idx;break;case"%d":case"%e":default:result[2]=idx}});var date=BI.parseDateTime(v,this._getFormatString());BI.print(date,this._getFormatString())===v&&(v=BI.print(date,c.compareFormat),result=[0,1,2]);var dateArray=v.match(/\d+/g),newArray=[];return BI.each(dateArray,function(idx){newArray[idx]=dateArray[result[idx]]}),newArray.length===result.length&&2===newArray[0].length?BI.print(BI.parseDateTime(newArray.join("-"),c.compareFormat),c.compareFormat):newArray.join("-")},_getFormatString:function(){return this.options.format||this._const.compareFormat},_dateCheck:function(date){return BI.print(BI.parseDateTime(date,"%Y-%x-%d"),"%Y-%x-%d")===date||BI.print(BI.parseDateTime(date,"%Y-%X-%d"),"%Y-%X-%d")===date||BI.print(BI.parseDateTime(date,"%Y-%x-%e"),"%Y-%x-%e")===date||BI.print(BI.parseDateTime(date,"%Y-%X-%e"),"%Y-%X-%e")===date},_checkVoid:function(obj){return!BI.checkDateVoid(obj.year,obj.month,obj.day,this.options.min,this.options.max)[0]},_autoAppend:function(v,dateObj){if(BI.isNotNull(dateObj)&&BI.checkDateLegal(v))switch(v.length){case this._const.yearLength:this._yearCheck(v)&&this.editor.setValue(v+"-");break;case this._const.yearMonthLength:case this._const.yearFullMonthLength:var splitMonth=v.split("-")[1];(BI.isNotNull(splitMonth)&&2===splitMonth.length||this._monthCheck(v))&&this.editor.setValue(v+"-")}},_yearCheck:function(v){var date=BI.print(BI.parseDateTime(v,this._getFormatString()),this._const.compareFormat);return BI.print(BI.parseDateTime(v,"%Y"),"%Y")===v&&date>=this.options.min&&date<=this.options.max},_monthCheck:function(v){var date=BI.parseDateTime(v,this._getFormatString()),dateStr=BI.print(date,this._const.compareFormat);return date.getMonth()>=0&&(BI.print(BI.parseDateTime(v,"%Y-%X"),"%Y-%X")===v||BI.print(BI.parseDateTime(v,"%Y-%x"),"%Y-%x")===v)&&dateStr>=this.options.min&&dateStr<=this.options.max},_setInnerValue:function(date){var dateStr=BI.print(date,this._getFormatString());this.editor.setState(dateStr),this.editor.setValue(dateStr)},_getText:function(obj){function getPositionText(baseText,position){switch(position){case BI.DynamicDateCard.OFFSET.BEGIN:return baseText+BI.i18nText("BI-Basic_Begin_Start");case BI.DynamicDateCard.OFFSET.END:return baseText+BI.i18nText("BI-Basic_End_Stop");case BI.DynamicDateCard.OFFSET.CURRENT:default:return BI.i18nText("BI-Basic_Current_Day")}}var value="",endText="";return BI.isNotNull(obj.year)&&(0!==BI.parseInt(obj.year)&&(value+=Math.abs(obj.year)+BI.i18nText("BI-Basic_Year")+(obj.year<0?BI.i18nText("BI-Basic_Front"):BI.i18nText("BI-Basic_Behind"))),endText=getPositionText(BI.i18nText("BI-Basic_Year"),obj.position)),BI.isNotNull(obj.quarter)&&(0!==BI.parseInt(obj.quarter)&&(value+=Math.abs(obj.quarter)+BI.i18nText("BI-Basic_Single_Quarter")+(obj.quarter<0?BI.i18nText("BI-Basic_Front"):BI.i18nText("BI-Basic_Behind"))),endText=getPositionText(BI.i18nText("BI-Basic_Single_Quarter"),obj.position)),BI.isNotNull(obj.month)&&(0!==BI.parseInt(obj.month)&&(value+=Math.abs(obj.month)+BI.i18nText("BI-Basic_Month")+(obj.month<0?BI.i18nText("BI-Basic_Front"):BI.i18nText("BI-Basic_Behind"))),endText=getPositionText(BI.i18nText("BI-Basic_Month"),obj.position)),BI.isNotNull(obj.week)&&(0!==BI.parseInt(obj.week)&&(value+=Math.abs(obj.week)+BI.i18nText("BI-Basic_Week")+(obj.week<0?BI.i18nText("BI-Basic_Front"):BI.i18nText("BI-Basic_Behind"))),endText=getPositionText(BI.i18nText("BI-Basic_Week"),obj.position)),BI.isNotNull(obj.day)&&(0!==BI.parseInt(obj.day)&&(value+=Math.abs(obj.day)+BI.i18nText("BI-Basic_Day")+(obj.day<0?BI.i18nText("BI-Basic_Front"):BI.i18nText("BI-Basic_Behind"))),endText=1===BI.size(obj)?getPositionText(BI.i18nText("BI-Basic_Month"),obj.position):""),BI.isNotNull(obj.workDay)&&0!==BI.parseInt(obj.workDay)&&(value+=Math.abs(obj.workDay)+BI.i18nText("BI-Basic_Work_Day")+(obj.workDay<0?BI.i18nText("BI-Basic_Front"):BI.i18nText("BI-Basic_Behind"))),value+endText},setValue:function(v){var type,value,self=this,date=BI.getDate();switch(this.storeValue=v,BI.isNotNull(v)&&(type=v.type||BI.DynamicDateCombo.Static,value=v.value||v),type){case BI.DynamicDateCombo.Dynamic:var text=this._getText(value);date=BI.DynamicDateHelper.getCalculation(value),this._setInnerValue(date,text);break;case BI.DynamicDateCombo.Static:default:if(BI.isNull(value)||BI.isNull(value.day))this.editor.setState(""),this.editor.setValue("");else{var dateStr=BI.print(BI.getDate(value.year,value.month-1,value.day),this._getFormatString());this.editor.setState(dateStr),this.editor.setValue(dateStr)}}},getKey:function(){return this.editor.getValue()},getValue:function(){return this.storeValue}}),BI.DynamicDateTrigger.EVENT_BLUR="EVENT_BLUR",BI.DynamicDateTrigger.EVENT_FOCUS="EVENT_FOCUS",BI.DynamicDateTrigger.EVENT_START="EVENT_START",BI.DynamicDateTrigger.EVENT_STOP="EVENT_STOP",BI.DynamicDateTrigger.EVENT_CONFIRM="EVENT_CONFIRM",BI.DynamicDateTrigger.EVENT_CHANGE="EVENT_CHANGE",BI.DynamicDateTrigger.EVENT_VALID="EVENT_VALID",BI.DynamicDateTrigger.EVENT_ERROR="EVENT_ERROR",BI.DynamicDateTrigger.EVENT_TRIGGER_CLICK="EVENT_TRIGGER_CLICK",BI.DynamicDateTrigger.EVENT_KEY_DOWN="EVENT_KEY_DOWN",BI.shortcut("bi.dynamic_date_trigger",BI.DynamicDateTrigger),BI.DynamicDateTimeCombo=BI.inherit(BI.Single,{constants:{popupHeight:259,popupWidth:270,comboAdjustHeight:1,border:1},props:{baseCls:"bi-dynamic-date-combo bi-border bi-focus-shadow bi-border-radius",height:22,minDate:"1900-01-01",maxDate:"2099-12-31",format:"",allowEdit:!0},render:function(){var self=this,opts=this.options;this.storeTriggerValue="";var date=BI.getDate();return this.storeValue=opts.value,{type:"bi.htape",items:[{el:{type:"bi.icon_button",cls:"bi-trigger-icon-button date-change-h-font",width:opts.height,height:opts.height,ref:function(){self.changeIcon=this}},width:opts.height},{type:"bi.absolute",items:[{el:{type:"bi.combo",container:opts.container,ref:function(){self.combo=this},toggle:!1,isNeedAdjustHeight:!1,isNeedAdjustWidth:!1,el:{type:"bi.dynamic_date_time_trigger",min:opts.minDate,max:opts.maxDate,allowEdit:opts.allowEdit,watermark:opts.watermark,format:opts.format,height:opts.height,value:opts.value,ref:function(){self.trigger=this},listeners:[{eventName:BI.DynamicDateTimeTrigger.EVENT_KEY_DOWN,action:function(){self.combo.isViewVisible()&&self.combo.hideView(),self.fireEvent(BI.DynamicDateTimeCombo.EVENT_KEY_DOWN,arguments)}},{eventName:BI.DynamicDateTimeTrigger.EVENT_STOP,action:function(){self.combo.isViewVisible()||self.combo.showView()}},{eventName:BI.DynamicDateTimeTrigger.EVENT_TRIGGER_CLICK,action:function(){self.combo.toggle()}},{eventName:BI.DynamicDateTimeTrigger.EVENT_FOCUS,action:function(){self.storeTriggerValue=self.trigger.getKey(),self.combo.isViewVisible()||self.combo.showView(),self.fireEvent(BI.DynamicDateTimeCombo.EVENT_FOCUS)}},{eventName:BI.DynamicDateTimeTrigger.EVENT_BLUR,action:function(){self.fireEvent(BI.DynamicDateTimeCombo.EVENT_BLUR)}},{eventName:BI.DynamicDateTimeTrigger.EVENT_ERROR,action:function(){self.storeValue={type:BI.DynamicDateTimeCombo.Static,value:{year:date.getFullYear(),month:date.getMonth()+1}},self.fireEvent(BI.DynamicDateTimeCombo.EVENT_ERROR)}},{eventName:BI.DynamicDateTimeTrigger.EVENT_VALID,action:function(){self.fireEvent(BI.DynamicDateTimeCombo.EVENT_VALID)}},{eventName:BI.DynamicDateTimeTrigger.EVENT_CHANGE,action:function(){self.fireEvent(BI.DynamicDateTimeCombo.EVENT_CHANGE)}},{eventName:BI.DynamicDateTimeTrigger.EVENT_CONFIRM,action:function(){if(!self.combo.isViewVisible()){var dateStore=self.storeTriggerValue,dateObj=self.trigger.getKey();BI.isNotEmptyString(dateObj)&&!BI.isEqual(dateObj,dateStore)?(self.storeValue=self.trigger.getValue(),self.setValue(self.trigger.getValue())):BI.isEmptyString(dateObj)&&(self.storeValue=null,self.trigger.setValue()),self._checkDynamicValue(self.storeValue),self.fireEvent(BI.DynamicDateTimeCombo.EVENT_CONFIRM)}}}]},adjustLength:this.constants.comboAdjustHeight,popup:{el:{type:"bi.dynamic_date_time_popup",behaviors:opts.behaviors,min:opts.minDate,max:opts.maxDate,value:opts.value,ref:function(){self.popup=this},listeners:[{eventName:BI.DynamicDateTimePopup.BUTTON_CLEAR_EVENT_CHANGE,action:function(){self.setValue(),self.combo.hideView(),self.fireEvent(BI.DynamicDateTimeCombo.EVENT_CONFIRM)}},{eventName:BI.DynamicDateTimePopup.BUTTON_lABEL_EVENT_CHANGE,action:function(){var date=BI.getDate();self.setValue({type:BI.DynamicDateTimeCombo.Static,value:{year:date.getFullYear(),month:date.getMonth()+1,day:date.getDate(),hour:0,minute:0,second:0}}),self.combo.hideView(),self.fireEvent(BI.DynamicDateTimeCombo.EVENT_CONFIRM)}},{eventName:BI.DynamicDateTimePopup.BUTTON_OK_EVENT_CHANGE,action:function(){var value=self.popup.getValue();self._checkValue(value)&&self.setValue(value),self.combo.hideView(),self.fireEvent(BI.DynamicDateTimeCombo.EVENT_CONFIRM)}},{eventName:BI.DynamicDateTimePopup.EVENT_CHANGE,action:function(){self.setValue(self.popup.getValue()),self.combo.hideView(),self.fireEvent(BI.DynamicDateTimeCombo.EVENT_CONFIRM)}}]},stopPropagation:!1},listeners:[{eventName:BI.Combo.EVENT_BEFORE_POPUPVIEW,action:function(){self.popup.setValue(self.storeValue),self.fireEvent(BI.DynamicDateTimeCombo.EVENT_BEFORE_POPUPVIEW)}}],hideChecker:function(e){return 0===self.triggerBtn.element.find(e.target).length}},top:0,left:0,right:0,bottom:0},{el:{type:"bi.icon_button",cls:"bi-trigger-icon-button date-font",width:opts.height,height:opts.height,listeners:[{eventName:BI.IconButton.EVENT_CHANGE,action:function(){self.combo.isViewVisible()||self.combo.showView()}}],ref:function(){self.triggerBtn=this}},top:0,right:0}]}],ref:function(_ref){self.comboWrapper=_ref}}},mounted:function(){this._checkDynamicValue(this.storeValue)},_checkDynamicValue:function(v){var o=this.options,type=null;switch(BI.isNotNull(v)&&(type=v.type),type){case BI.DynamicDateTimeCombo.Dynamic:this.changeIcon.setVisible(!0),this.comboWrapper.attr("items")[0].width=o.height,this.comboWrapper.resize();break;default:this.comboWrapper.attr("items")[0].width=0,this.comboWrapper.resize(),this.changeIcon.setVisible(!1)}},_checkValue:function(v){switch(v.type){ +case BI.DynamicDateCombo.Dynamic:return BI.isNotEmptyObject(v.value);case BI.DynamicDateCombo.Static:default:return!0}},setValue:function(v){this.storeValue=v,this.trigger.setValue(v),this._checkDynamicValue(v)},getValue:function(){return this.storeValue},getKey:function(){return this.trigger.getKey()},hidePopupView:function(){this.combo.hideView()},isValid:function(){return this.trigger.isValid()}}),BI.DynamicDateTimeCombo.EVENT_KEY_DOWN="EVENT_KEY_DOWN",BI.DynamicDateTimeCombo.EVENT_CONFIRM="EVENT_CONFIRM",BI.DynamicDateTimeCombo.EVENT_FOCUS="EVENT_FOCUS",BI.DynamicDateTimeCombo.EVENT_BLUR="EVENT_BLUR",BI.DynamicDateTimeCombo.EVENT_CHANGE="EVENT_CHANGE",BI.DynamicDateTimeCombo.EVENT_VALID="EVENT_VALID",BI.DynamicDateTimeCombo.EVENT_ERROR="EVENT_ERROR",BI.DynamicDateTimeCombo.EVENT_BEFORE_POPUPVIEW="EVENT_BEFORE_POPUPVIEW",BI.shortcut("bi.dynamic_date_time_combo",BI.DynamicDateTimeCombo),BI.extend(BI.DynamicDateTimeCombo,{Static:1,Dynamic:2}),BI.DynamicDateTimePopup=BI.inherit(BI.Widget,{constants:{tabHeight:30,buttonHeight:24},props:{baseCls:"bi-dynamic-date-time-popup",width:248,height:385},_init:function(){BI.DynamicDateTimePopup.superclass._init.apply(this,arguments);var self=this,opts=this.options,c=this.constants;this.storeValue={type:BI.DynamicDateCombo.Static},BI.createWidget({element:this,type:"bi.vtape",items:[{el:this._getTabJson()},{el:{type:"bi.grid",items:[[{type:"bi.text_button",cls:"bi-high-light bi-split-top",textHeight:c.buttonHeight-1,shadow:!0,text:BI.i18nText("BI-Basic_Clear"),listeners:[{eventName:BI.TextButton.EVENT_CHANGE,action:function(){self.fireEvent(BI.DynamicDateTimePopup.BUTTON_CLEAR_EVENT_CHANGE)}}]},{type:"bi.text_button",cls:"bi-split-left bi-split-right bi-high-light bi-split-top",textHeight:c.buttonHeight-1,shadow:!0,text:BI.i18nText("BI-Multi_Date_Today"),ref:function(){self.textButton=this},listeners:[{eventName:BI.TextButton.EVENT_CHANGE,action:function(){self.fireEvent(BI.DynamicDateTimePopup.BUTTON_lABEL_EVENT_CHANGE)}}]},{type:"bi.text_button",cls:"bi-high-light bi-split-top",textHeight:c.buttonHeight-1,shadow:!0,text:BI.i18nText("BI-Basic_OK"),listeners:[{eventName:BI.TextButton.EVENT_CHANGE,action:function(){self.fireEvent(BI.DynamicDateTimePopup.BUTTON_OK_EVENT_CHANGE)}}]}]]},height:24}]}),this.setValue(opts.value)},_getTabJson:function(){var self=this,o=this.options;return{type:"bi.tab",ref:function(){self.dateTab=this},tab:{type:"bi.linear_segment",cls:"bi-split-bottom",height:this.constants.tabHeight,items:BI.createItems([{text:BI.i18nText("BI-Multi_Date_YMD"),value:BI.DynamicDateCombo.Static},{text:BI.i18nText("BI-Basic_Dynamic_Title"),value:BI.DynamicDateCombo.Dynamic}],{textAlign:"center"})},cardCreator:function(v){switch(v){case BI.DynamicDateCombo.Dynamic:return{type:"bi.dynamic_date_card",listeners:[{eventName:"EVENT_CHANGE",action:function(){self._setInnerValue(self.year,v)}}],ref:function(){self.dynamicPane=this}};case BI.DynamicDateCombo.Static:default:return{type:"bi.vtape",items:[{type:"bi.date_calendar_popup",behaviors:o.behaviors,min:self.options.min,max:self.options.max,ref:function(){self.ymd=this}},{el:{type:"bi.dynamic_date_time_select",cls:"bi-split-top",ref:function(){self.timeSelect=this}},height:40}]}}},listeners:[{eventName:BI.Tab.EVENT_CHANGE,action:function(){var v=self.dateTab.getSelect();switch(v){case BI.DynamicDateCombo.Static:var date=BI.DynamicDateHelper.getCalculation(self.dynamicPane.getValue());self.ymd.setValue({year:date.getFullYear(),month:date.getMonth()+1,day:date.getDate()}),self.timeSelect.setValue(),self._setInnerValue();break;case BI.DynamicDateCombo.Dynamic:default:self.storeValue&&self.storeValue.type===BI.DynamicDateCombo.Dynamic?self.dynamicPane.setValue(self.storeValue.value):self.dynamicPane.setValue({year:0}),self._setInnerValue()}}}]}},_setInnerValue:function(){if(this.dateTab.getSelect()===BI.DynamicDateCombo.Static)this.textButton.setValue(BI.i18nText("BI-Multi_Date_Today")),this.textButton.setEnable(!0);else{var date=BI.DynamicDateHelper.getCalculation(this.dynamicPane.getValue());date=BI.print(date,"%Y-%X-%d"),this.textButton.setValue(date),this.textButton.setEnable(!1)}},_checkValueValid:function(value){return BI.isNull(value)||BI.isEmptyObject(value)||BI.isEmptyString(value)},setValue:function(v){this.storeValue=v;var self=this,type,value;switch(v=v||{},type=v.type||BI.DynamicDateCombo.Static,value=v.value||v,this.dateTab.setSelect(type),type){case BI.DynamicDateCombo.Dynamic:this.dynamicPane.setValue(value),self._setInnerValue();break;case BI.DynamicDateCombo.Static:default:if(this._checkValueValid(value)){var date=BI.getDate();this.ymd.setValue({year:date.getFullYear(),month:date.getMonth()+1,day:date.getDate()}),this.timeSelect.setValue(),this.textButton.setValue(BI.i18nText("BI-Multi_Date_Today"))}else this.ymd.setValue(value),this.timeSelect.setValue({hour:value.hour,minute:value.minute,second:value.second}),this.textButton.setValue(BI.i18nText("BI-Multi_Date_Today"));this.textButton.setEnable(!0)}},getValue:function(){var type=this.dateTab.getSelect();return{type:type,value:type===BI.DynamicDateTimeCombo.Static?BI.extend(this.ymd.getValue(),this.timeSelect.getValue()):this.dynamicPane.getValue()}}}),BI.DynamicDateTimePopup.EVENT_CHANGE="EVENT_CHANGE",BI.DynamicDateTimePopup.BUTTON_OK_EVENT_CHANGE="BUTTON_OK_EVENT_CHANGE",BI.DynamicDateTimePopup.BUTTON_lABEL_EVENT_CHANGE="BUTTON_lABEL_EVENT_CHANGE",BI.DynamicDateTimePopup.BUTTON_CLEAR_EVENT_CHANGE="BUTTON_CLEAR_EVENT_CHANGE",BI.shortcut("bi.dynamic_date_time_popup",BI.DynamicDateTimePopup),BI.DynamicDateTimeSelect=BI.inherit(BI.Widget,{props:{baseCls:"bi-date-time-select"},render:function(){var self=this;return{type:"bi.center_adapt",items:[{type:"bi.vertical_adapt",items:[{el:{type:"bi.number_editor",ref:function(){self.hour=this},validationChecker:function(v){return BI.isNaturalNumber(v)&&BI.parseInt(v)<24},errorText:function(v){return BI.isNumeric(v)?BI.i18nText("BI-Basic_Input_From_To_Number",'"00-23"'):BI.i18nText("BI-Numerical_Interval_Input_Data")},listeners:[{eventName:BI.SignEditor.EVENT_CONFIRM,action:function(){var value=this.getValue();self._checkHour(value),this.setValue(self._formatValueToDoubleDigit(value)),self.fireEvent(BI.DynamicDateTimeSelect.EVENT_CONFIRM)}},{eventName:BI.SignEditor.EVENT_CHANGE,action:function(){var value=self._autoSwitch(this.getValue(),BI.DynamicDateTimeSelect.HOUR);this.setValue(value)}}],width:60,height:24}},{type:"bi.label",text:":",width:20},{type:"bi.number_editor",ref:function(){self.minute=this},validationChecker:function(v){return BI.isNaturalNumber(v)&&BI.parseInt(v)<60},errorText:function(v){return BI.isNumeric(v)?BI.i18nText("BI-Basic_Input_From_To_Number",'"00-59"'):BI.i18nText("BI-Numerical_Interval_Input_Data")},listeners:[{eventName:BI.SignEditor.EVENT_CONFIRM,action:function(){var value=this.getValue();self._checkMinute(value),this.setValue(self._formatValueToDoubleDigit(value),BI.DynamicDateTimeSelect.MINUTE),self.fireEvent(BI.DynamicDateTimeSelect.EVENT_CONFIRM)}},{eventName:BI.SignEditor.EVENT_CHANGE,action:function(){var value=self._autoSwitch(this.getValue(),BI.DynamicDateTimeSelect.MINUTE);this.setValue(value)}}],width:60,height:24},{type:"bi.label",text:":",width:20},{type:"bi.number_editor",ref:function(){self.second=this},validationChecker:function(v){return BI.isNaturalNumber(v)&&BI.parseInt(v)<60},errorText:function(v){return BI.isNumeric(v)?BI.i18nText("BI-Basic_Input_From_To_Number",'"00-59"'):BI.i18nText("BI-Numerical_Interval_Input_Data")},listeners:[{eventName:BI.SignEditor.EVENT_CONFIRM,action:function(){var value=this.getValue();self._checkSecond(value),this.setValue(self._formatValueToDoubleDigit(value)),self.fireEvent(BI.DynamicDateTimeSelect.EVENT_CONFIRM)}}],width:60,height:24}]}]}},_checkBorder:function(v){v=v||{},this._checkHour(v.hour),this._checkMinute(v.minute),this._checkSecond(v.second)},_checkHour:function(value){this.hour.setDownEnable(BI.parseInt(value)>0),this.hour.setUpEnable(BI.parseInt(value)<23)},_checkMinute:function(value){this.minute.setDownEnable(BI.parseInt(value)>0),this.minute.setUpEnable(BI.parseInt(value)<59)},_checkSecond:function(value){this.second.setDownEnable(BI.parseInt(value)>0),this.second.setUpEnable(BI.parseInt(value)<59)},_autoSwitch:function(v,type){var limit=0,value=v+"";switch(type){case BI.DynamicDateTimeSelect.HOUR:limit=2;break;case BI.DynamicDateTimeSelect.MINUTE:limit=5}if(1===value.length&&BI.parseInt(value)>limit&&(value="0"+value),2===value.length)switch(type){case BI.DynamicDateTimeSelect.HOUR:this.hour.isEditing()&&this.minute.focus();break;case BI.DynamicDateTimeSelect.MINUTE:this.minute.isEditing()&&this.second.focus();break;case BI.DynamicDateTimeSelect.SECOND:}return value},_formatValueToDoubleDigit:function(v){(BI.isNull(v)||BI.isEmptyString(v))&&(v=0);var value=BI.parseInt(v);return value<10&&(value="0"+value),value},_assertValue:function(v){return v=v||{},v.hour=this._formatValueToDoubleDigit(v.hour)||"00",v.minute=this._formatValueToDoubleDigit(v.minute)||"00",v.second=this._formatValueToDoubleDigit(v.second)||"00",v},getValue:function(){return{hour:BI.parseInt(this.hour.getValue()),minute:BI.parseInt(this.minute.getValue()),second:BI.parseInt(this.second.getValue())}},setValue:function(v){v=this._assertValue(v),this.hour.setValue(v.hour),this.minute.setValue(v.minute),this.second.setValue(v.second),this._checkBorder(v)}}),BI.DynamicDateTimeSelect.EVENT_CONFIRM="EVENT_CONFIRM",BI.shortcut("bi.dynamic_date_time_select",BI.DynamicDateTimeSelect),BI.extend(BI.DynamicDateTimeSelect,{HOUR:1,MINUTE:2,SECOND:3}),BI.DynamicDateTimeTrigger=BI.inherit(BI.Trigger,{_const:{hgap:4,vgap:2,yearLength:4,yearMonthLength:6,yearFullMonthLength:7,compareFormat:"%Y-%X-%d %H:%M:%S"},props:{extraCls:"bi-date-time-trigger",min:"1900-01-01",max:"2099-12-31",height:24,format:"",allowEdit:!0,watermark:""},_init:function(){BI.DynamicDateTimeTrigger.superclass._init.apply(this,arguments);var self=this,o=this.options,c=this._const;this.storeTriggerValue="",this.editor=BI.createWidget({type:"bi.sign_editor",height:o.height,validationChecker:function(v){var formatStr=self._getStandardDateStr(v),date=formatStr.match(/\d+/g);return!BI.isKey(o.format)&&self._autoAppend(v,date),self._dateCheck(formatStr)&&BI.checkDateLegal(formatStr)&&self._checkVoid({year:0|date[0],month:0|date[1],day:0|date[2]})},quitChecker:function(){return!1},hgap:c.hgap,vgap:c.vgap,allowBlank:!0,watermark:BI.isKey(o.watermark)?o.watermark:BI.i18nText("BI-Basic_Unrestricted"),errorText:function(){var str="";return BI.isKey(o.format)||(str=self.editor.isEditing()?BI.i18nText("BI-Basic_Date_Time_Error_Text"):BI.i18nText("BI-Year_Trigger_Invalid_Text")),str},title:BI.bind(this._getTitle,this)}),this.editor.on(BI.SignEditor.EVENT_KEY_DOWN,function(){self.fireEvent(BI.DynamicDateTimeTrigger.EVENT_KEY_DOWN,arguments)}),this.editor.on(BI.SignEditor.EVENT_FOCUS,function(){self.storeTriggerValue=self.getKey(),self.fireEvent(BI.DynamicDateTimeTrigger.EVENT_FOCUS)}),this.editor.on(BI.SignEditor.EVENT_BLUR,function(){self.fireEvent(BI.DynamicDateTimeTrigger.EVENT_BLUR)}),this.editor.on(BI.SignEditor.EVENT_STOP,function(){self.fireEvent(BI.DynamicDateTimeTrigger.EVENT_STOP)}),this.editor.on(BI.SignEditor.EVENT_VALID,function(){self.fireEvent(BI.DynamicDateTimeTrigger.EVENT_VALID)}),this.editor.on(BI.SignEditor.EVENT_ERROR,function(){self.fireEvent(BI.DynamicDateTimeTrigger.EVENT_ERROR)}),this.editor.on(BI.SignEditor.EVENT_CONFIRM,function(){var value=self.editor.getValue();if(BI.isNotNull(value)&&self.editor.setState(value),BI.isNotEmptyString(value)&&!BI.isEqual(self.storeTriggerValue,self.getKey())){var formatStr=self._getStandardDateStr(value),date=formatStr.match(/\d+/g);self.storeValue={type:BI.DynamicDateCombo.Static,value:{year:0|date[0],month:0|date[1],day:0|date[2],hour:0|date[3],minute:0|date[4],second:0|date[5]}}}self.fireEvent(BI.DynamicDateTimeTrigger.EVENT_CONFIRM)}),this.editor.on(BI.SignEditor.EVENT_START,function(){self.fireEvent(BI.DynamicDateTimeTrigger.EVENT_START)}),this.editor.on(BI.SignEditor.EVENT_CHANGE,function(){self.fireEvent(BI.DynamicDateTimeTrigger.EVENT_CHANGE)}),BI.createWidget({type:"bi.htape",element:this,items:[{el:this.editor},{el:BI.createWidget(),width:24}]}),!o.allowEdit&&BI.createWidget({type:"bi.absolute",element:this,items:[{el:{type:"bi.text",title:BI.bind(this._getTitle,this)},left:0,right:24,top:0,bottom:0}]}),this.setValue(o.value)},_getTitle:function(){var storeValue=this.storeValue||{},type=storeValue.type||BI.DynamicDateCombo.Static,value=storeValue.value;switch(type){case BI.DynamicDateCombo.Dynamic:var text=this._getText(value),date=BI.DynamicDateHelper.getCalculation(value),dateStr=BI.print(date,this._getFormatString());return BI.isEmptyString(text)?dateStr:text+":"+dateStr;case BI.DynamicDateCombo.Static:default:return BI.isNull(value)||BI.isNull(value.day)?"":BI.print(BI.getDate(value.year,value.month-1,value.day,value.hour||0,value.minute||0,value.second||0),this._getFormatString())}},_getStandardDateStr:function(v){var c=this._const,result=[],hasSecond=!1,formatArray=this._getFormatString().match(/%./g);BI.each(formatArray,function(idx,v){switch(v){case"%Y":case"%y":result[0]=idx;break;case"%X":case"%x":result[1]=idx;break;case"%d":case"%e":result[2]=idx;break;case"%S":hasSecond=!0}});var date=BI.parseDateTime(v,this._getFormatString());BI.print(date,this._getFormatString())===v&&(v=BI.print(date,c.compareFormat),result=[0,1,2]);var dateArray=v.match(/\d+/g)||[],newArray=[];BI.each(dateArray.slice(0,3),function(idx){newArray[idx]=dateArray[result[idx]]});var suffixArray=dateArray.slice(3);BI.each(suffixArray,function(idx,v){BI.isNumeric(v)&&1===v.length&&(suffixArray[idx]="0"+v)}),2!==suffixArray.length||hasSecond||suffixArray.push("00");var suffixString=suffixArray.join(":"),dateString=newArray.slice(0,3).join("-");return BI.isNotEmptyString(suffixString)&&(dateString+=" "+suffixString),dateString},_getFormatString:function(){return this.options.format||this._const.compareFormat},_dateCheck:function(date){return BI.print(BI.parseDateTime(date,"%Y-%x-%d %H:%M:%S"),"%Y-%x-%d %H:%M:%S")===date||BI.print(BI.parseDateTime(date,"%Y-%X-%d %H:%M:%S"),"%Y-%X-%d %H:%M:%S")===date||BI.print(BI.parseDateTime(date,"%Y-%x-%e %H:%M:%S"),"%Y-%x-%e %H:%M:%S")===date||BI.print(BI.parseDateTime(date,"%Y-%X-%e %H:%M:%S"),"%Y-%X-%e %H:%M:%S")===date||BI.print(BI.parseDateTime(date,"%Y-%x-%d"),"%Y-%x-%d")===date||BI.print(BI.parseDateTime(date,"%Y-%X-%d"),"%Y-%X-%d")===date||BI.print(BI.parseDateTime(date,"%Y-%x-%e"),"%Y-%x-%e")===date||BI.print(BI.parseDateTime(date,"%Y-%X-%e"),"%Y-%X-%e")===date},_checkVoid:function(obj){return!BI.checkDateVoid(obj.year,obj.month,obj.day,this.options.min,this.options.max)[0]},_autoAppend:function(v,dateObj){if(BI.isNotNull(dateObj)&&BI.checkDateLegal(v))switch(v.length){case this._const.yearLength:this._yearCheck(v)&&this.editor.setValue(v+"-");break;case this._const.yearMonthLength:case this._const.yearFullMonthLength:var splitMonth=v.split("-")[1];(BI.isNotNull(splitMonth)&&2===splitMonth.length||this._monthCheck(v))&&this.editor.setValue(v+"-")}},_yearCheck:function(v){var date=BI.print(BI.parseDateTime(v,"%Y-%X-%d"),"%Y-%X-%d");return BI.print(BI.parseDateTime(v,"%Y"),"%Y")===v&&date>=this.options.min&&date<=this.options.max},_monthCheck:function(v){var date=BI.parseDateTime(v,"%Y-%X-%d"),dateStr=BI.print(date,"%Y-%X-%d");return date.getMonth()>0&&(BI.print(BI.parseDateTime(v,"%Y-%X"),"%Y-%X")===v||BI.print(BI.parseDateTime(v,"%Y-%x"),"%Y-%x")===v)&&dateStr>=this.options.min&&dateStr<=this.options.max},_setInnerValue:function(date){var dateStr=BI.print(date,this._getFormatString());this.editor.setState(dateStr),this.editor.setValue(dateStr)},_getText:function(obj){function getPositionText(baseText,position){switch(position){case BI.DynamicDateCard.OFFSET.BEGIN:return baseText+BI.i18nText("BI-Basic_Begin_Start");case BI.DynamicDateCard.OFFSET.END:return baseText+BI.i18nText("BI-Basic_End_Stop");case BI.DynamicDateCard.OFFSET.CURRENT:default:return BI.i18nText("BI-Basic_Current_Day")}}var value="",endText="";return BI.isNotNull(obj.year)&&(0!==BI.parseInt(obj.year)&&(value+=Math.abs(obj.year)+BI.i18nText("BI-Basic_Year")+(obj.year<0?BI.i18nText("BI-Basic_Front"):BI.i18nText("BI-Basic_Behind"))),endText=getPositionText(BI.i18nText("BI-Basic_Year"),obj.position)),BI.isNotNull(obj.quarter)&&(0!==BI.parseInt(obj.quarter)&&(value+=Math.abs(obj.quarter)+BI.i18nText("BI-Basic_Single_Quarter")+(obj.quarter<0?BI.i18nText("BI-Basic_Front"):BI.i18nText("BI-Basic_Behind"))),endText=getPositionText(BI.i18nText("BI-Basic_Single_Quarter"),obj.position)),BI.isNotNull(obj.month)&&(0!==BI.parseInt(obj.month)&&(value+=Math.abs(obj.month)+BI.i18nText("BI-Basic_Month")+(obj.month<0?BI.i18nText("BI-Basic_Front"):BI.i18nText("BI-Basic_Behind"))),endText=getPositionText(BI.i18nText("BI-Basic_Month"),obj.position)),BI.isNotNull(obj.week)&&(0!==BI.parseInt(obj.week)&&(value+=Math.abs(obj.week)+BI.i18nText("BI-Basic_Week")+(obj.week<0?BI.i18nText("BI-Basic_Front"):BI.i18nText("BI-Basic_Behind"))),endText=getPositionText(BI.i18nText("BI-Basic_Week"),obj.position)),BI.isNotNull(obj.day)&&(0!==BI.parseInt(obj.day)&&(value+=Math.abs(obj.day)+BI.i18nText("BI-Basic_Day")+(obj.day<0?BI.i18nText("BI-Basic_Front"):BI.i18nText("BI-Basic_Behind"))),endText=1===BI.size(obj)?getPositionText(BI.i18nText("BI-Basic_Month"),obj.position):""),BI.isNotNull(obj.workDay)&&0!==BI.parseInt(obj.workDay)&&(value+=Math.abs(obj.workDay)+BI.i18nText("BI-Basic_Work_Day")+(obj.workDay<0?BI.i18nText("BI-Basic_Front"):BI.i18nText("BI-Basic_Behind"))),value+endText},setValue:function(v){var type,value,self=this,date=BI.getDate();switch(this.storeValue=v,BI.isNotNull(v)&&(type=v.type||BI.DynamicDateCombo.Static,value=v.value||v),type){case BI.DynamicDateCombo.Dynamic:var text=this._getText(value);date=BI.DynamicDateHelper.getCalculation(value),this._setInnerValue(date,text);break;case BI.DynamicDateCombo.Static:default:if(BI.isNull(value)||BI.isNull(value.day))this.editor.setState(""),this.editor.setValue("");else{var dateStr=BI.print(BI.getDate(value.year,value.month-1,value.day,value.hour||0,value.minute||0,value.second||0),this._getFormatString());this.editor.setState(dateStr),this.editor.setValue(dateStr)}}},getKey:function(){return this.editor.getValue()},getValue:function(){return this.storeValue},isValid:function(){return this.editor.isValid()}}),BI.DynamicDateTimeTrigger.EVENT_BLUR="EVENT_BLUR",BI.DynamicDateTimeTrigger.EVENT_FOCUS="EVENT_FOCUS",BI.DynamicDateTimeTrigger.EVENT_START="EVENT_START",BI.DynamicDateTimeTrigger.EVENT_STOP="EVENT_STOP",BI.DynamicDateTimeTrigger.EVENT_CONFIRM="EVENT_CONFIRM",BI.DynamicDateTimeTrigger.EVENT_CHANGE="EVENT_CHANGE",BI.DynamicDateTimeTrigger.EVENT_VALID="EVENT_VALID",BI.DynamicDateTimeTrigger.EVENT_ERROR="EVENT_ERROR",BI.DynamicDateTimeTrigger.EVENT_TRIGGER_CLICK="EVENT_TRIGGER_CLICK",BI.DynamicDateTimeTrigger.EVENT_KEY_DOWN="EVENT_KEY_DOWN",BI.shortcut("bi.dynamic_date_time_trigger",BI.DynamicDateTimeTrigger),BI.SearchEditor=BI.inherit(BI.Widget,{_defaultConfig:function(){var conf=BI.SearchEditor.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{baseCls:"bi-search-editor bi-border bi-focus-shadow",height:24,errorText:"",watermark:BI.i18nText("BI-Basic_Search"),validationChecker:BI.emptyFn,quitChecker:BI.emptyFn})},_init:function(){this.options.height-=2,BI.SearchEditor.superclass._init.apply(this,arguments);var self=this,o=this.options;this.editor=BI.createWidget({type:"bi.editor",height:o.height,watermark:o.watermark,allowBlank:!0,hgap:1,errorText:o.errorText,validationChecker:o.validationChecker,quitChecker:o.quitChecker,value:o.value}),this.clear=BI.createWidget({type:"bi.icon_button",stopEvent:!0,cls:"close-font"}),this.clear.on(BI.IconButton.EVENT_CHANGE,function(){self.setValue(""),self.fireEvent(BI.Controller.EVENT_CHANGE,BI.Events.STOPEDIT),self.fireEvent(BI.SearchEditor.EVENT_CHANGE),self.fireEvent(BI.SearchEditor.EVENT_CLEAR)}),BI.createWidget({element:this,type:"bi.htape",items:[{el:{type:"bi.icon_label",cls:"search-font"},width:24},{el:self.editor},{el:this.clear,width:24}]}),this.editor.on(BI.Controller.EVENT_CHANGE,function(){self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.editor.on(BI.Editor.EVENT_FOCUS,function(){self.fireEvent(BI.SearchEditor.EVENT_FOCUS)}),this.editor.on(BI.Editor.EVENT_BLUR,function(){self.fireEvent(BI.SearchEditor.EVENT_BLUR)}),this.editor.on(BI.Editor.EVENT_CLICK,function(){self.fireEvent(BI.SearchEditor.EVENT_CLICK)}),this.editor.on(BI.Editor.EVENT_CHANGE,function(){self._checkClear(),self.fireEvent(BI.SearchEditor.EVENT_CHANGE)}),this.editor.on(BI.Editor.EVENT_KEY_DOWN,function(v){self.fireEvent(BI.SearchEditor.EVENT_KEY_DOWN,v)}),this.editor.on(BI.Editor.EVENT_SPACE,function(){self.fireEvent(BI.SearchEditor.EVENT_SPACE)}),this.editor.on(BI.Editor.EVENT_BACKSPACE,function(){self.fireEvent(BI.SearchEditor.EVENT_BACKSPACE)}),this.editor.on(BI.Editor.EVENT_VALID,function(){self.fireEvent(BI.SearchEditor.EVENT_VALID)}),this.editor.on(BI.Editor.EVENT_ERROR,function(){self.fireEvent(BI.SearchEditor.EVENT_ERROR)}),this.editor.on(BI.Editor.EVENT_ENTER,function(){self.fireEvent(BI.SearchEditor.EVENT_ENTER)}),this.editor.on(BI.Editor.EVENT_RESTRICT,function(){self.fireEvent(BI.SearchEditor.EVENT_RESTRICT)}),this.editor.on(BI.Editor.EVENT_EMPTY,function(){self._checkClear(),self.fireEvent(BI.SearchEditor.EVENT_EMPTY)}),this.editor.on(BI.Editor.EVENT_REMOVE,function(){self.fireEvent(BI.SearchEditor.EVENT_REMOVE)}),this.editor.on(BI.Editor.EVENT_CONFIRM,function(){self.fireEvent(BI.SearchEditor.EVENT_CONFIRM)}),this.editor.on(BI.Editor.EVENT_CHANGE_CONFIRM,function(){self.fireEvent(BI.SearchEditor.EVENT_CHANGE_CONFIRM)}),this.editor.on(BI.Editor.EVENT_START,function(){self.fireEvent(BI.SearchEditor.EVENT_START)}),this.editor.on(BI.Editor.EVENT_PAUSE,function(){self.fireEvent(BI.SearchEditor.EVENT_PAUSE)}),this.editor.on(BI.Editor.EVENT_STOP,function(){self.fireEvent(BI.SearchEditor.EVENT_STOP)}),this.clear.invisible()},_checkClear:function(){this.getValue()?this.clear.visible():this.clear.invisible()},setWaterMark:function(v){this.options.watermark=v,this.editor.setWaterMark(v)},focus:function(){this.editor.focus()},blur:function(){this.editor.blur()},getValue:function(){if(this.isValid()){var res=this.editor.getValue().match(/[\S]+/g);return BI.isNull(res)?"":res[res.length-1]}},getKeywords:function(){var val=this.editor.getLastChangedValue(),keywords=val.match(/[\S]+/g);return BI.isEndWithBlank(val)?keywords.concat([" "]):keywords},getLastValidValue:function(){return this.editor.getLastValidValue()},getLastChangedValue:function(){return this.editor.getLastChangedValue()},setValue:function(v){this.editor.setValue(v),BI.isKey(v)&&this.clear.visible()},isEditing:function(){return this.editor.isEditing()},isValid:function(){return this.editor.isValid()}}),BI.SearchEditor.EVENT_CHANGE="EVENT_CHANGE",BI.SearchEditor.EVENT_FOCUS="EVENT_FOCUS",BI.SearchEditor.EVENT_BLUR="EVENT_BLUR",BI.SearchEditor.EVENT_CLICK="EVENT_CLICK",BI.SearchEditor.EVENT_KEY_DOWN="EVENT_KEY_DOWN",BI.SearchEditor.EVENT_SPACE="EVENT_SPACE",BI.SearchEditor.EVENT_BACKSPACE="EVENT_BACKSPACE",BI.SearchEditor.EVENT_CLEAR="EVENT_CLEAR",BI.SearchEditor.EVENT_START="EVENT_START",BI.SearchEditor.EVENT_PAUSE="EVENT_PAUSE",BI.SearchEditor.EVENT_STOP="EVENT_STOP",BI.SearchEditor.EVENT_CONFIRM="EVENT_CONFIRM",BI.SearchEditor.EVENT_CHANGE_CONFIRM="EVENT_CHANGE_CONFIRM",BI.SearchEditor.EVENT_VALID="EVENT_VALID",BI.SearchEditor.EVENT_ERROR="EVENT_ERROR",BI.SearchEditor.EVENT_ENTER="EVENT_ENTER",BI.SearchEditor.EVENT_RESTRICT="EVENT_RESTRICT",BI.SearchEditor.EVENT_REMOVE="EVENT_REMOVE",BI.SearchEditor.EVENT_EMPTY="EVENT_EMPTY",BI.shortcut("bi.search_editor",BI.SearchEditor),BI.SmallSearchEditor=BI.inherit(BI.SearchEditor,{_defaultConfig:function(){var conf=BI.SmallSearchEditor.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{baseCls:(conf.baseCls||"")+" bi-small-search-editor",height:20})},_init:function(){BI.SmallSearchEditor.superclass._init.apply(this,arguments)}}),BI.shortcut("bi.small_search_editor",BI.SmallSearchEditor),BI.TextEditor=BI.inherit(BI.Widget,{_defaultConfig:function(){var conf=BI.TextEditor.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{extraCls:"bi-text-editor bi-border bi-focus-shadow",hgap:4,vgap:2,lgap:0,rgap:0,tgap:0,bgap:0,validationChecker:BI.emptyFn,quitChecker:BI.emptyFn,allowBlank:!1,watermark:"",errorText:"",height:24})},_init:function(){BI.TextEditor.superclass._init.apply(this,arguments);var self=this,o=this.options;BI.isNumber(o.height)&&this.element.css({height:o.height-2}),BI.isNumber(o.width)&&this.element.css({width:o.width-2}),this.editor=BI.createWidget({type:"bi.editor",height:o.height-2,hgap:o.hgap,vgap:o.vgap,lgap:o.lgap,rgap:o.rgap,tgap:o.tgap,bgap:o.bgap,value:o.value,title:o.title,tipType:o.tipType,validationChecker:o.validationChecker,quitChecker:o.quitChecker,allowBlank:o.allowBlank,watermark:o.watermark,errorText:o.errorText}),this.editor.on(BI.Controller.EVENT_CHANGE,function(){self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.editor.on(BI.Editor.EVENT_FOCUS,function(){self.fireEvent(BI.TextEditor.EVENT_FOCUS)}),this.editor.on(BI.Editor.EVENT_BLUR,function(){self.fireEvent(BI.TextEditor.EVENT_BLUR)}),this.editor.on(BI.Editor.EVENT_CLICK,function(){self.fireEvent(BI.TextEditor.EVENT_CLICK)}),this.editor.on(BI.Editor.EVENT_CHANGE,function(){self.fireEvent(BI.TextEditor.EVENT_CHANGE)}),this.editor.on(BI.Editor.EVENT_KEY_DOWN,function(v){self.fireEvent(BI.TextEditor.EVENT_KEY_DOWN)}),this.editor.on(BI.Editor.EVENT_SPACE,function(v){self.fireEvent(BI.TextEditor.EVENT_SPACE)}),this.editor.on(BI.Editor.EVENT_BACKSPACE,function(v){self.fireEvent(BI.TextEditor.EVENT_BACKSPACE)}),this.editor.on(BI.Editor.EVENT_VALID,function(){self.fireEvent(BI.TextEditor.EVENT_VALID)}),this.editor.on(BI.Editor.EVENT_CONFIRM,function(){self.fireEvent(BI.TextEditor.EVENT_CONFIRM)}),this.editor.on(BI.Editor.EVENT_CHANGE_CONFIRM,function(){self.fireEvent(BI.TextEditor.EVENT_CHANGE_CONFIRM)}),this.editor.on(BI.Editor.EVENT_REMOVE,function(v){self.fireEvent(BI.TextEditor.EVENT_REMOVE)}),this.editor.on(BI.Editor.EVENT_START,function(){self.fireEvent(BI.TextEditor.EVENT_START)}),this.editor.on(BI.Editor.EVENT_PAUSE,function(){self.fireEvent(BI.TextEditor.EVENT_PAUSE)}),this.editor.on(BI.Editor.EVENT_STOP,function(){self.fireEvent(BI.TextEditor.EVENT_STOP)}),this.editor.on(BI.Editor.EVENT_ERROR,function(){self.fireEvent(BI.TextEditor.EVENT_ERROR,arguments)}),this.editor.on(BI.Editor.EVENT_ENTER,function(){self.fireEvent(BI.TextEditor.EVENT_ENTER)}),this.editor.on(BI.Editor.EVENT_RESTRICT,function(){self.fireEvent(BI.TextEditor.EVENT_RESTRICT)}),this.editor.on(BI.Editor.EVENT_EMPTY,function(){self.fireEvent(BI.TextEditor.EVENT_EMPTY)}),BI.createWidget({type:"bi.vertical",scrolly:!1,element:this,items:[this.editor]})},setWaterMark:function(v){this.options.watermark=v,this.editor.setWaterMark(v)},focus:function(){this.editor.focus()},blur:function(){this.editor.blur()},setErrorText:function(text){this.editor.setErrorText(text)},getErrorText:function(){return this.editor.getErrorText()},isValid:function(){return this.editor.isValid()},setValue:function(v){this.editor.setValue(v)},getValue:function(){return this.editor.getValue()}}),BI.TextEditor.EVENT_CHANGE="EVENT_CHANGE",BI.TextEditor.EVENT_FOCUS="EVENT_FOCUS",BI.TextEditor.EVENT_BLUR="EVENT_BLUR",BI.TextEditor.EVENT_CLICK="EVENT_CLICK",BI.TextEditor.EVENT_KEY_DOWN="EVENT_KEY_DOWN",BI.TextEditor.EVENT_SPACE="EVENT_SPACE",BI.TextEditor.EVENT_BACKSPACE="EVENT_BACKSPACE",BI.TextEditor.EVENT_START="EVENT_START",BI.TextEditor.EVENT_PAUSE="EVENT_PAUSE",BI.TextEditor.EVENT_STOP="EVENT_STOP",BI.TextEditor.EVENT_CONFIRM="EVENT_CONFIRM",BI.TextEditor.EVENT_CHANGE_CONFIRM="EVENT_CHANGE_CONFIRM",BI.TextEditor.EVENT_VALID="EVENT_VALID",BI.TextEditor.EVENT_ERROR="EVENT_ERROR",BI.TextEditor.EVENT_ENTER="EVENT_ENTER",BI.TextEditor.EVENT_RESTRICT="EVENT_RESTRICT",BI.TextEditor.EVENT_REMOVE="EVENT_REMOVE",BI.TextEditor.EVENT_EMPTY="EVENT_EMPTY",BI.shortcut("bi.text_editor",BI.TextEditor),BI.SmallTextEditor=BI.inherit(BI.TextEditor,{_defaultConfig:function(){var conf=BI.SmallTextEditor.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{baseCls:(conf.baseCls||"")+" bi-small-text-editor",height:20})},_init:function(){BI.SmallTextEditor.superclass._init.apply(this,arguments)}}),BI.shortcut("bi.small_text_editor",BI.SmallTextEditor),BI.IntervalSlider=BI.inherit(BI.Single,{_constant:{EDITOR_WIDTH:58,EDITOR_R_GAP:60,EDITOR_HEIGHT:30,SLIDER_WIDTH_HALF:15,SLIDER_WIDTH:30,SLIDER_HEIGHT:30,TRACK_HEIGHT:24},props:{baseCls:"bi-interval-slider bi-slider-track",digit:!1,unit:""},render:function(){var self=this,c=this._constant;return this.enable=!1,this.valueOne="",this.valueTwo="",this.calculation=new BI.AccurateCalculationModel,this.grayTrack=BI.createWidget({type:"bi.layout",cls:"gray-track",height:6}),this.blueTrack=BI.createWidget({type:"bi.layout",cls:"blue-track bi-high-light-background",height:6}),this.track=this._createTrackWrapper(),this.labelOne=BI.createWidget({type:"bi.sign_text_editor",cls:"slider-editor-button",text:this.options.unit,allowBlank:!1,width:c.EDITOR_WIDTH,validationChecker:function(v){return self._checkValidation(v)}}),this.labelOne.element.hover(function(){self.labelOne.element.removeClass("bi-border").addClass("bi-border")},function(){self.labelOne.element.removeClass("bi-border")}),this.labelOne.on(BI.Editor.EVENT_CONFIRM,function(){var oldValueOne=self.valueOne,v=BI.parseFloat(this.getValue());self.valueOne=v;var percent=self._getPercentByValue(v),significantPercent=BI.parseFloat(percent.toFixed(1));self._setSliderOnePosition(significantPercent),self._setBlueTrack(),self._checkLabelPosition(oldValueOne,self.valueTwo,self.valueOne,self.valueTwo),self.fireEvent(BI.IntervalSlider.EVENT_CHANGE)}),this.labelTwo=BI.createWidget({type:"bi.sign_text_editor",cls:"slider-editor-button",text:this.options.unit,allowBlank:!1,width:c.EDITOR_WIDTH,validationChecker:function(v){return self._checkValidation(v)}}),this.labelTwo.element.hover(function(){self.labelTwo.element.removeClass("bi-border").addClass("bi-border")},function(){self.labelTwo.element.removeClass("bi-border")}),this.labelTwo.on(BI.Editor.EVENT_CONFIRM,function(){var oldValueTwo=self.valueTwo,v=BI.parseFloat(this.getValue());self.valueTwo=v;var percent=self._getPercentByValue(v),significantPercent=BI.parseFloat(percent.toFixed(1));self._setSliderTwoPosition(significantPercent),self._setBlueTrack(),self._checkLabelPosition(self.valueOne,oldValueTwo,self.valueOne,self.valueTwo),self.fireEvent(BI.IntervalSlider.EVENT_CHANGE)}),this.sliderOne=BI.createWidget({type:"bi.single_slider_button"}),this.sliderTwo=BI.createWidget({type:"bi.single_slider_button"}),this._draggable(this.sliderOne,!0),this._draggable(this.sliderTwo,!1),this._setVisible(!1),{type:"bi.absolute",element:this,items:[{el:{type:"bi.vertical",items:[{type:"bi.absolute",items:[{el:this.track,width:"100%",height:c.TRACK_HEIGHT}]}],hgap:7,height:c.TRACK_HEIGHT},top:23,left:0,width:"100%"},this._createLabelWrapper(),this._createSliderWrapper()]}},_rePosBySizeAfterMove:function(size,isLeft){var o=this.options,percent=100*size/this._getGrayTrackLength(),significantPercent=BI.parseFloat(percent.toFixed(1)),v=this._getValueByPercent(significantPercent);v=this._assertValue(v),v=o.digit===!1?v:v.toFixed(o.digit);var oldValueOne=this.valueOne,oldValueTwo=this.valueTwo;isLeft?(this._setSliderOnePosition(significantPercent),this.labelOne.setValue(v),this.valueOne=v,this._checkLabelPosition(oldValueOne,oldValueTwo,v,this.valueTwo)):(this._setSliderTwoPosition(significantPercent),this.labelTwo.setValue(v),this.valueTwo=v,this._checkLabelPosition(oldValueOne,oldValueTwo,this.valueOne,v)),this._setBlueTrack()},_rePosBySizeAfterStop:function(size,isLeft){var percent=100*size/this._getGrayTrackLength(),significantPercent=BI.parseFloat(percent.toFixed(1)); +isLeft?this._setSliderOnePosition(significantPercent):this._setSliderTwoPosition(significantPercent)},_draggable:function(widget,isLeft){function optimizeSize(s){return BI.clamp(s,0,self._getGrayTrackLength())}var self=this,o=this.options,startDrag=!1,size=0,offset=0,defaultSize=0,mouseMoveTracker=new BI.MouseMoveTracker(function(deltaX){mouseMoveTracker.isDragging()&&(startDrag=!0,offset+=deltaX,size=optimizeSize(defaultSize+offset),widget.element.addClass("dragging"),self._rePosBySizeAfterMove(size,isLeft))},function(){startDrag===!0&&(size=optimizeSize(size),self._rePosBySizeAfterStop(size,isLeft),size=0,offset=0,defaultSize=size,startDrag=!1),widget.element.removeClass("dragging"),mouseMoveTracker.releaseMouseMoves(),self.fireEvent(BI.IntervalSlider.EVENT_CHANGE)},window);widget.element.on("mousedown",function(event){widget.isEnabled()&&(defaultSize=this.offsetLeft,optimizeSize(defaultSize),mouseMoveTracker.captureMouseMoves(event))})},_createLabelWrapper:function(){var c=this._constant;return{el:{type:"bi.vertical",items:[{type:"bi.absolute",items:[{el:this.labelOne,top:0,left:"0%"}]},{type:"bi.absolute",items:[{el:this.labelTwo,top:0,left:"100%"}]}],rgap:c.EDITOR_R_GAP,height:c.SLIDER_HEIGHT},top:0,left:0,width:"100%"}},_createSliderWrapper:function(){var c=this._constant;return{el:{type:"bi.vertical",items:[{type:"bi.absolute",items:[{el:this.sliderOne,top:0,left:"0%"}]},{type:"bi.absolute",items:[{el:this.sliderTwo,top:0,left:"100%"}]}],hgap:c.SLIDER_WIDTH_HALF,height:c.SLIDER_HEIGHT},top:20,left:0,width:"100%"}},_createTrackWrapper:function(){return BI.createWidget({type:"bi.absolute",items:[{el:{type:"bi.vertical",items:[{type:"bi.absolute",items:[{el:this.grayTrack,top:0,left:0,width:"100%"},{el:this.blueTrack,top:0,left:0,width:"0%"}]}],hgap:8,height:8},top:8,left:0,width:"100%"}]})},_checkValidation:function(v){var o=this.options,valid=!1,dotText=(v+"").split(".")[1];return BI.isEmptyString(dotText)||BI.isNumeric(v)&&!(BI.isNull(v)||vthis.max)&&(o.digit===!1?valid=!0:(dotText=dotText||"",valid=dotText.length===o.digit)),valid},_checkOverlap:function(){var labelOneLeft=this.labelOne.element[0].offsetLeft,labelTwoLeft=this.labelTwo.element[0].offsetLeft;labelOneLeft<=labelTwoLeft?labelTwoLeft-labelOneLeft<90?this.labelTwo.element.css({top:40}):this.labelTwo.element.css({top:0}):labelOneLeft-labelTwoLeft<90?this.labelTwo.element.css({top:40}):this.labelTwo.element.css({top:0})},_checkLabelPosition:function(oldValueOne,oldValueTwo,valueOne,valueTwo,isLeft){if(oldValueOne=BI.parseFloat(oldValueOne),oldValueTwo=BI.parseFloat(oldValueTwo),valueOne=BI.parseFloat(valueOne),valueTwo=BI.parseFloat(valueTwo),oldValueOne<=oldValueTwo&&valueOne>valueTwo||oldValueOne>=oldValueTwo&&valueOne-1){arr=pre.split("e");var decimalPartLength=BI.size(arr[0].split(".")[1]),sciencePartLength=BI.parseInt(arr[1].substring(1));return decimalPartLength-sciencePartLength}return arr=pre.split("."),arr.length>1?arr[1].length:0},_assertValue:function(value){return value<=this.min?this.min:value>=this.max?this.max:value},_setEnable:function(b){BI.IntervalSlider.superclass._setEnable.apply(this,[b]),b?this.blueTrack.element.removeClass("disabled-blue-track").addClass("blue-track"):this.blueTrack.element.removeClass("blue-track").addClass("disabled-blue-track")},getValue:function(){return this.valueOne<=this.valueTwo?{min:this.valueOne,max:this.valueTwo}:{min:this.valueTwo,max:this.valueOne}},setMinAndMax:function(v){var minNumber=BI.parseFloat(v.min),maxNumber=BI.parseFloat(v.max);!isNaN(minNumber)&&!isNaN(maxNumber)&&maxNumber>=minNumber&&(this.min=minNumber,this.max=maxNumber,this.valueOne=minNumber,this.valueTwo=maxNumber,this.precision=this._getPrecision(),this._setDraggableEnable(!0)),maxNumber===minNumber&&this._setDraggableEnable(!1)},setValue:function(v){var o=this.options,valueOne=BI.parseFloat(v.min),valueTwo=BI.parseFloat(v.max);valueOne=o.digit===!1?valueOne:valueOne.toFixed(o.digit),valueTwo=o.digit===!1?valueTwo:valueTwo.toFixed(o.digit),isNaN(valueOne)||isNaN(valueTwo)||(this._checkValidation(valueOne)&&(this.valueOne=this.valueOne<=this.valueTwo?valueOne:valueTwo),this._checkValidation(valueTwo)&&(this.valueTwo=this.valueOne<=this.valueTwo?valueTwo:valueOne),valueOnethis.max&&(this.valueTwo=this.max))},reset:function(){this._setVisible(!1),this.enable=!1,this.valueOne="",this.valueTwo="",this.min=NaN,this.max=NaN,this._setBlueTrackWidth(0)},populate:function(){isNaN(this.min)||isNaN(this.max)||(this.enable=!0,this._setVisible(!0),this._setErrorText(),(BI.isNumeric(this.valueOne)||BI.isNotEmptyString(this.valueOne))&&(BI.isNumeric(this.valueTwo)||BI.isNotEmptyString(this.valueTwo))?(this.labelOne.setValue(this.valueOne),this.labelTwo.setValue(this.valueTwo),this._setAllPosition(this._getPercentByValue(this.valueOne),this._getPercentByValue(this.valueTwo))):(this.labelOne.setValue(this.min),this.labelTwo.setValue(this.max),this._setAllPosition(0,100)))}}),BI.IntervalSlider.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.interval_slider",BI.IntervalSlider),BI.AccurateCalculationModel=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.AccurateCalculationModel.superclass._defaultConfig.apply(this,arguments),{baseCls:""})},_init:function(){BI.AccurateCalculationModel.superclass._init.apply(this,arguments)},_getMagnitude:function(n){for(var magnitude="1",i=0;i0)var needAddZero=stringNumber2;else{var needAddZero=stringNumber1;magnitudeDiff=0-magnitudeDiff}for(var i=0;i=num2.numDecimal.length?num1.numDecimal.length:num2.numDecimal.length}function addZero(resultTemp,length){for(var diff=length-resultTemp.length,i=0;i=BI.parseInt(stringNumber2.numDecimal))var decimalResultTemp=(BI.parseInt(stringNumber1.numDecimal)-BI.parseInt(stringNumber2.numDecimal)).toString(),decimalResult=addZero(decimalResultTemp,decimalMaxLength);else{integerResult--;var borrow=this._getMagnitude(decimalMaxLength),decimalResultTemp=(borrow+BI.parseInt(stringNumber1.numDecimal)-BI.parseInt(stringNumber2.numDecimal)).toString(),decimalResult=addZero(decimalResultTemp,decimalMaxLength)}var result=integerResult+"."+decimalResult;return BI.parseFloat(result)},_accurateAddition:function(num1,num2){function addZero(resultTemp,length){for(var diff=length-resultTemp.length,i=0;in)var integerResult=stringNumber.numInteger.slice(0,stringNumber.numInteger.length-n),partDecimalResult=stringNumber.numInteger.slice(-n);else var integerResult="0",partDecimalResult=addZero(stringNumber.numInteger,n);var result=integerResult+"."+partDecimalResult+stringNumber.numDecimal;return BI.parseFloat(result)},accurateSubtraction:function(num1,num2){return num1>=0&&num2>=0?num1>=num2?this._accurateSubtraction(num1,num2):-this._accurateSubtraction(num2,num1):num1>=0&&num2<0?this._accurateAddition(num1,-num2):num1<0&&num2>=0?-this._accurateAddition(-num1,num2):num1<0&&num2<0?num1>=num2?this._accurateSubtraction(-num2,-num1):this._accurateSubtraction(-num1,-num2):void 0},accurateAddition:function(num1,num2){return num1>=0&&num2>=0?this._accurateAddition(num1,num2):num1>=0&&num2<0?this.accurateSubtraction(num1,-num2):num1<0&&num2>=0?this.accurateSubtraction(num2,-num1):num1<0&&num2<0?-this._accurateAddition(-num1,-num2):void 0},accurateMultiplication:function(num1,num2){return num1>=0&&num2>=0?this._accurateMultiplication(num1,num2):num1>=0&&num2<0?-this._accurateMultiplication(num1,-num2):num1<0&&num2>=0?-this._accurateMultiplication(-num1,num2):num1<0&&num2<0?this._accurateMultiplication(-num1,-num2):void 0},accurateDivisionTenExponent:function(num1,n){return num1>=0?this._accurateDivisionTenExponent(num1,n):-this._accurateDivisionTenExponent(-num1,n)}}),BI.DownListCombo=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.DownListCombo.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-multilayer-down-list-combo",height:24,items:[],adjustLength:0,direction:"bottom",trigger:"click",container:null,stopPropagation:!1,el:{}})},_init:function(){BI.DownListCombo.superclass._init.apply(this,arguments);var self=this,o=this.options;this.popupview=BI.createWidget({type:"bi.multi_layer_down_list_popup",items:o.items,chooseType:o.chooseType,value:o.value}),this.popupview.on(BI.DownListPopup.EVENT_CHANGE,function(value){self.fireEvent(BI.DownListCombo.EVENT_CHANGE,value),self.downlistcombo.hideView()}),this.popupview.on(BI.DownListPopup.EVENT_SON_VALUE_CHANGE,function(value,fatherValue){self.fireEvent(BI.DownListCombo.EVENT_SON_VALUE_CHANGE,value,fatherValue),self.downlistcombo.hideView()}),this.downlistcombo=BI.createWidget({element:this,type:"bi.combo",trigger:o.trigger,isNeedAdjustWidth:!1,container:o.container,adjustLength:o.adjustLength,direction:o.direction,stopPropagation:o.stopPropagation,el:BI.createWidget(o.el,{type:"bi.icon_trigger",extraCls:o.iconCls?o.iconCls:"pull-down-font",width:o.width,height:o.height}),popup:{el:this.popupview,stopPropagation:o.stopPropagation,maxHeight:1e3}}),this.downlistcombo.on(BI.Combo.EVENT_BEFORE_POPUPVIEW,function(){self.fireEvent(BI.DownListCombo.EVENT_BEFORE_POPUPVIEW)})},hideView:function(){this.downlistcombo.hideView()},showView:function(e){this.downlistcombo.showView(e)},populate:function(items){this.popupview.populate(items)},setValue:function(v){this.popupview.setValue(v)},getValue:function(){return this.popupview.getValue()}}),BI.DownListCombo.EVENT_CHANGE="EVENT_CHANGE",BI.DownListCombo.EVENT_SON_VALUE_CHANGE="EVENT_SON_VALUE_CHANGE",BI.DownListCombo.EVENT_BEFORE_POPUPVIEW="EVENT_BEFORE_POPUPVIEW",BI.shortcut("bi.multi_layer_down_list_combo",BI.DownListCombo),BI.MultiLayerDownListPopup=BI.inherit(BI.Pane,{constants:{nextIcon:"pull-right-e-font",height:25,iconHeight:12,iconWidth:12,hgap:0,vgap:0,border:1},_defaultConfig:function(){var conf=BI.MultiLayerDownListPopup.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{baseCls:"bi-down-list-popup",items:[],chooseType:BI.Selection.Multi})},_init:function(){BI.MultiLayerDownListPopup.superclass._init.apply(this,arguments),this.singleValues=[],this.childValueMap={},this.fatherValueMap={};var self=this,o=this.options,children=this._createPopupItems(o.items);this.popup=BI.createWidget({type:"bi.button_tree",items:BI.createItems(children,{},{adjustLength:-2}),layouts:[{type:"bi.vertical",hgap:this.constants.hgap,vgap:this.constants.vgap}],value:this._digest(o.value),chooseType:o.chooseType}),this.popup.on(BI.ButtonTree.EVENT_CHANGE,function(value,object){var changedValue=value;if(BI.isNotNull(self.childValueMap[value])){changedValue=self.childValueMap[value];var fatherValue=self.fatherValueMap[value],fatherArrayValue=(fatherValue+"").split("_");self.fireEvent(BI.MultiLayerDownListPopup.EVENT_SON_VALUE_CHANGE,changedValue,fatherArrayValue.length>1?fatherArrayValue:fatherValue)}else self.fireEvent(BI.MultiLayerDownListPopup.EVENT_CHANGE,changedValue,object);if(!BI.contains(self.singleValues,changedValue)){var item=self.getValue(),result=[];BI.each(item,function(i,valueObject){valueObject.value!=changedValue&&result.push(valueObject)}),self.setValue(result)}}),BI.createWidget({type:"bi.vertical",element:this,items:[this.popup],vgap:5})},_createPopupItems:function(items){var self=this,result=[];return BI.each(items,function(i,it){var item_done={type:"bi.down_list_group",items:[]};if(BI.each(it,function(i,item){BI.isNotEmptyArray(item.children)&&!BI.isEmpty(item.el)?(item.type="bi.combo_group",item.cls="down-list-group",item.trigger="hover",item.isNeedAdjustWidth=!1,item.el.title=item.el.title||item.el.text,item.el.type="bi.down_list_group_item",item.el.logic={dynamic:!0},item.el.height=self.constants.height,item.el.iconCls2=self.constants.nextIcon,item.popup={lgap:1,el:{type:"bi.button_tree",chooseType:0,layouts:[{type:"bi.vertical"}]},innerVGap:5},item.el.childValues=[],BI.each(item.children,function(i,child){child=child.el?BI.extend(child.el,{children:child.children}):child;var fatherValue=BI.deepClone(item.el.value),childValue=BI.deepClone(child.value);self.singleValues.push(child.value),child.type="bi.down_list_item",child.extraCls=" child-down-list-item",child.title=child.title||child.text,child.textRgap=10,child.isNeedAdjustWidth=!1,child.logic={dynamic:!0},child.father=fatherValue,self.fatherValueMap[self._createChildValue(fatherValue,childValue)]=fatherValue,self.childValueMap[self._createChildValue(fatherValue,childValue)]=childValue,child.value=self._createChildValue(fatherValue,childValue),item.el.childValues.push(child.value),BI.isNotEmptyArray(child.children)&&(child.type="bi.down_list_group_item",self._createChildren(child),child.height=self.constants.height,child.iconCls2=self.constants.nextIcon,item.el.childValues=BI.concat(item.el.childValues,child.childValues))})):(item.type="bi.down_list_item",item.title=item.title||item.text,item.textRgap=10,item.isNeedAdjustWidth=!1,item.logic={dynamic:!0});var el_done={};el_done.el=item,item_done.items.push(el_done)}),self._isGroup(item_done.items)&&BI.each(item_done.items,function(i,item){self.singleValues.push(item.el.value)}),result.push(item_done),self._needSpliter(i,items.length)){var spliter_container=BI.createWidget({type:"bi.vertical",items:[{el:{type:"bi.layout",cls:"bi-down-list-spliter bi-border-top cursor-pointer",height:0}}],cls:"bi-down-list-spliter-container cursor-pointer",vgap:5,lgap:10});result.push(spliter_container)}}),result},_createChildren:function(child){var self=this;child.childValues=[],BI.each(child.children,function(i,c){var fatherValue=BI.deepClone(child.value),childValue=BI.deepClone(c.value);c.type="bi.down_list_item",c.title=c.title||c.text,c.textRgap=10,c.isNeedAdjustWidth=!1,c.logic={dynamic:!0},c.father=fatherValue,self.fatherValueMap[self._createChildValue(fatherValue,childValue)]=fatherValue,self.childValueMap[self._createChildValue(fatherValue,childValue)]=childValue,c.value=self._createChildValue(fatherValue,childValue),child.childValues.push(c.value)})},_isGroup:function(i){return i.length>1},_needSpliter:function(i,itemLength){return i1?fatherArrayValue:fartherValue}else valueItem.value=value;result.push(valueItem)}),result}}),BI.MultiLayerDownListPopup.EVENT_CHANGE="EVENT_CHANGE",BI.MultiLayerDownListPopup.EVENT_SON_VALUE_CHANGE="EVENT_SON_VALUE_CHANGE",BI.shortcut("bi.multi_layer_down_list_popup",BI.MultiLayerDownListPopup),BI.MultiLayerSelectTreeCombo=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.MultiLayerSelectTreeCombo.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-multilayer-select-tree-combo",isDefaultInit:!1,height:24,text:"",itemsCreator:BI.emptyFn,items:[],value:"",attributes:{tabIndex:0},allowEdit:!1,allowSearchValue:!1,allowInsertValue:!1})},render:function(){var self=this,o=this.options,combo=o.itemsCreator===BI.emptyFn?this._getSyncConfig():this._getAsyncConfig();return o.allowEdit||o.itemsCreator!==BI.emptyFn?{type:"bi.absolute",items:[{el:combo,left:0,right:0,top:0,bottom:0},{el:{type:"bi.trigger_icon_button",cls:"trigger-icon-button",ref:function(_ref){self.triggerBtn=_ref},width:o.height,height:o.height,handler:function(){self.combo.isViewVisible()?self.combo.hideView():self.combo.showView()}},right:0,bottom:0,top:0}]}:combo},_getBaseConfig:function(){var self=this,o=this.options;return{type:"bi.combo",container:o.container,adjustLength:2,ref:function(_ref){self.combo=_ref},popup:{el:{type:"bi.multilayer_select_tree_popup",isDefaultInit:o.isDefaultInit,itemsCreator:o.itemsCreator,items:o.items,ref:function(_ref){self.trigger&&self.trigger.getSearcher().setAdapter(_ref)},listeners:[{eventName:BI.MultiLayerSelectTreePopup.EVENT_CHANGE,action:function(){self.setValue(this.getValue()),self.combo.hideView(),self.fireEvent(BI.MultiLayerSelectTreeCombo.EVENT_CHANGE)}}]},value:o.value,maxHeight:400,minHeight:240}}},_getSearchConfig:function(){var self=this,o=this.options;return{el:{type:"bi.multilayer_select_tree_trigger",allowInsertValue:o.allowInsertValue,allowSearchValue:o.allowSearchValue,allowEdit:o.allowEdit,cls:"multilayer-select-tree-trigger",ref:function(_ref){self.trigger=_ref},items:o.items,itemsCreator:o.itemsCreator,valueFormatter:o.valueFormatter,watermark:o.watermark,height:o.height-2,text:o.text,value:o.value,tipType:o.tipType,warningTitle:o.warningTitle,title:o.title,listeners:[{eventName:BI.MultiLayerSelectTreeTrigger.EVENT_CHANGE,action:function(){self.setValue(this.getValue()),self.combo.hideView(),self.fireEvent(BI.MultiLayerSelectTreeCombo.EVENT_CHANGE)}},{eventName:BI.MultiLayerSelectTreeTrigger.EVENT_FOCUS,action:function(){self.fireEvent(BI.MultiLayerSelectTreeCombo.EVENT_FOCUS)}},{eventName:BI.MultiLayerSelectTreeTrigger.EVENT_BLUR,action:function(){self.fireEvent(BI.MultiLayerSelectTreeCombo.EVENT_BLUR)}},{eventName:BI.MultiLayerSelectTreeTrigger.EVENT_SEARCHING,action:function(){self.fireEvent(BI.MultiLayerSelectTreeCombo.EVENT_SEARCHING)}},{eventName:BI.MultiLayerSelectTreeTrigger.EVENT_ADD_ITEM,action:function(){var value=self.trigger.getSearcher().getKeyword();self.combo.setValue([value]),self.combo.hideView()}}]},hideChecker:function(e){return 0===self.triggerBtn.element.find(e.target).length},listeners:[{eventName:BI.Combo.EVENT_AFTER_HIDEVIEW,action:function(){self.trigger.stopEditing()}}]}},_getSyncConfig:function(){var o=this.options,baseConfig=this._getBaseConfig();return BI.extend(baseConfig,o.allowEdit?this._getSearchConfig():{el:{type:"bi.single_tree_trigger",text:o.text,height:o.height,items:o.items,value:o.value}})},_getAsyncConfig:function(){var config=this._getBaseConfig();return BI.extend(config,this._getSearchConfig())},setValue:function(v){v=BI.isArray(v)?v:[v],this.combo.setValue(v)},getValue:function(){return this.combo.getValue()},populate:function(items){this.combo.populate(items)}}),BI.MultiLayerSelectTreeCombo.EVENT_SEARCHING="EVENT_SEARCHING",BI.MultiLayerSelectTreeCombo.EVENT_BLUR="EVENT_BLUR",BI.MultiLayerSelectTreeCombo.EVENT_FOCUS="EVENT_FOCUS",BI.MultiLayerSelectTreeCombo.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.multilayer_select_tree_combo",BI.MultiLayerSelectTreeCombo),BI.MultiLayerSelectTreeInsertSearchPane=BI.inherit(BI.Widget,{props:function(){return{baseCls:"bi-multilayer-select-tree-popup",tipText:BI.i18nText("BI-No_Selected_Item"),isDefaultInit:!1,itemsCreator:BI.emptyFn,items:[],value:""}},render:function(){var self=this,o=this.options;return this.tree=BI.createWidget({type:"bi.multilayer_select_level_tree",isDefaultInit:o.isDefaultInit,items:o.items,itemsCreator:o.itemsCreator===BI.emptyFn?BI.emptyFn:function(op,callback){o.itemsCreator(op,function(res){callback(res),self.setKeyword(o.keywordGetter())})},keywordGetter:o.keywordGetter,value:o.value,scrollable:null,listeners:[{eventName:BI.Controller.EVENT_CHANGE,action:function(){self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}},{eventName:BI.MultiLayerSelectLevelTree.EVENT_CHANGE,action:function(){self.fireEvent(BI.MultiLayerSelectTreeInsertSearchPane.EVENT_CHANGE)}}]}),{type:"bi.vertical",scrolly:!1,scrollable:!0,vgap:5,items:[{type:"bi.text_button",invisible:!0,text:BI.i18nText("BI-Basic_Click_To_Add_Text",""),height:24,cls:"bi-high-light",hgap:5,ref:function(_ref){self.addNotMatchTip=_ref},handler:function(){self.fireEvent(BI.MultiLayerSelectTreeInsertSearchPane.EVENT_ADD_ITEM,o.keywordGetter())}},this.tree]}},setKeyword:function(keyword){var showTip=BI.isEmptyArray(this.tree.getAllLeaves());this.addNotMatchTip.setVisible(showTip),showTip&&this.addNotMatchTip.setText(BI.i18nText("BI-Basic_Click_To_Add_Text",keyword))},getValue:function(){return this.tree.getValue()},setValue:function(v){v=BI.isArray(v)?v:[v],this.tree.setValue(v)},populate:function(items){this.tree.populate(items)}}),BI.MultiLayerSelectTreeInsertSearchPane.EVENT_ADD_ITEM="EVENT_ADD_ITEM",BI.MultiLayerSelectTreeInsertSearchPane.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.multilayer_select_tree_insert_search_pane",BI.MultiLayerSelectTreeInsertSearchPane),BI.MultiLayerSelectLevelTree=BI.inherit(BI.Pane,{_defaultConfig:function(){return BI.extend(BI.MultiLayerSelectLevelTree.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-multilayer-select-level-tree",isDefaultInit:!1,items:[],itemsCreator:BI.emptyFn,keywordGetter:BI.emptyFn,value:"",scrollable:!0})},_init:function(){var o=this.options;BI.MultiLayerSelectLevelTree.superclass._init.apply(this,arguments),this.storeValue=o.value,this.initTree(this.options.items),this.check()},_formatItems:function(nodes,layer,pNode){var self=this,o=this.options,keyword=o.keywordGetter();return BI.each(nodes,function(i,node){var extend={};node.layer=layer,BI.isKey(node.id)||(node.id=BI.UUID()),node.keyword=node.keyword||keyword,extend.pNode=pNode,node.isParent===!0||node.parent===!0||BI.isNotEmptyArray(node.children)?(extend.type="bi.multilayer_select_tree_mid_plus_group_node",i===nodes.length-1&&(extend.type="bi.multilayer_select_tree_last_plus_group_node",extend.isLastNode=!0),0!==i||pNode||(extend.type="bi.multilayer_select_tree_first_plus_group_node"),0!==i||i!==nodes.length-1||pNode||(extend.type="bi.multilayer_select_tree_plus_group_node"),BI.defaults(node,extend),self._formatItems(node.children,layer+1,node)):(extend.type="bi.multilayer_single_tree_mid_tree_leaf_item",0!==i||pNode||(extend.type="bi.multilayer_single_tree_first_tree_leaf_item"),i===nodes.length-1&&(extend.type="bi.multilayer_single_tree_last_tree_leaf_item"),BI.defaults(node,extend))}),nodes},_assertId:function(sNodes){BI.each(sNodes,function(i,node){node.id=node.id||BI.UUID()})},initTree:function(nodes){var self=this,o=this.options,hasNext=!1;this.empty(),this._assertId(nodes),this.tree=BI.createWidget({type:"bi.custom_tree",cls:"tree-view display-table",expander:{type:"bi.select_tree_expander",isDefaultInit:o.isDefaultInit,el:{},popup:{type:"bi.custom_tree"}},items:this._formatItems(BI.Tree.transformToTreeFormat(nodes),0),itemsCreator:function(op,callback){1===op.times&&!op.node&&BI.nextTick(function(){self.loading()}),o.itemsCreator(op,function(ob){hasNext=ob.hasNext,1===op.times&&!op.node&&self._populate(ob.items),callback(self._formatItems(BI.Tree.transformToTreeFormat(ob.items),op.node?op.node.layer+1:0,op.node)),self.setValue(self.storeValue),1===op.times&&!op.node&&BI.nextTick(function(){self.loaded()})})},value:o.value,el:{type:"bi.loader",isDefaultInit:o.itemsCreator!==BI.emptyFn,el:{type:"bi.button_tree",chooseType:o.chooseType,behaviors:o.behaviors,layouts:[{type:"bi.vertical"}]},hasNext:function(){return hasNext}}}),this.tree.on(BI.Controller.EVENT_CHANGE,function(type,value){self.fireEvent(BI.Controller.EVENT_CHANGE,arguments),type===BI.Events.CLICK&&(self.setValue(value),self.fireEvent(BI.MultiLayerSelectLevelTree.EVENT_CHANGE,arguments))}),BI.createWidget({type:"bi.adaptive",element:this,scrollable:o.scrollable,items:[this.tree]})},_populate:function(){BI.MultiLayerSelectLevelTree.superclass.populate.apply(this,arguments)},populate:function(nodes){this._populate(nodes),BI.isNull(nodes)?this.tree.populate():this.tree.populate(this._formatItems(BI.Tree.transformToTreeFormat(nodes),0))},setValue:function(v){this.options.chooseType===BI.Selection.None||(this.storeValue=v,this.tree.setValue(v))},getValue:function(){return BI.isArray(this.storeValue)?this.storeValue:BI.isNull(this.storeValue)?[]:[this.storeValue]},getAllLeaves:function(){return this.tree.getAllLeaves()},getNodeById:function(id){return this.tree.getNodeById(id)},getNodeByValue:function(id){return this.tree.getNodeByValue(id)}}),BI.MultiLayerSelectLevelTree.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.multilayer_select_level_tree",BI.MultiLayerSelectLevelTree),BI.MultiLayerSelectTreePopup=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.MultiLayerSelectTreePopup.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-multilayer-select-tree-popup",tipText:BI.i18nText("BI-No_Selected_Item"),isDefaultInit:!1,itemsCreator:BI.emptyFn,items:[],value:""})},_init:function(){BI.MultiLayerSelectTreePopup.superclass._init.apply(this,arguments);var self=this,o=this.options;this.tree=BI.createWidget({type:"bi.multilayer_select_level_tree",isDefaultInit:o.isDefaultInit,items:o.items,itemsCreator:o.itemsCreator,keywordGetter:o.keywordGetter,value:o.value,scrollable:null}),BI.createWidget({type:"bi.vertical",scrolly:!1,scrollable:!0,element:this,vgap:5,items:[this.tree]}),this.tree.on(BI.Controller.EVENT_CHANGE,function(){self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.tree.on(BI.MultiLayerSelectLevelTree.EVENT_CHANGE,function(){self.fireEvent(BI.MultiLayerSelectTreePopup.EVENT_CHANGE)})},getValue:function(){return this.tree.getValue(); +},setValue:function(v){v=BI.isArray(v)?v:[v],this.tree.setValue(v)},populate:function(items){this.tree.populate(items)}}),BI.MultiLayerSelectTreePopup.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.multilayer_select_tree_popup",BI.MultiLayerSelectTreePopup),BI.MultiLayerSelectTreeTrigger=BI.inherit(BI.Trigger,{props:function(){return{extraCls:"bi-multi-layer-select-tree-trigger bi-border bi-focus-shadow",height:24,valueFormatter:function(v){return v},itemsCreator:BI.emptyFn,watermark:BI.i18nText("BI-Basic_Search"),allowSearchValue:!1}},render:function(){var self=this,o=this.options;o.itemsCreator===BI.emptyFn&&this._initData();var content={type:"bi.htape",items:[{el:{type:"bi.searcher",ref:function(){self.searcher=this},isAutoSearch:!1,el:{type:"bi.state_editor",ref:function(){self.editor=this},defaultText:o.text,text:this._digest(o.value),value:o.value,height:o.height,tipText:"",watermark:o.watermark,listeners:[{eventName:BI.StateEditor.EVENT_FOCUS,action:function(){self.fireEvent(BI.MultiLayerSelectTreeTrigger.EVENT_FOCUS)}},{eventName:BI.StateEditor.EVENT_BLUR,action:function(){self.fireEvent(BI.MultiLayerSelectTreeTrigger.EVENT_BLUR)}},{eventName:BI.StateEditor.EVENT_CHANGE,action:function(){self.fireEvent(BI.MultiLayerSelectTreeTrigger.EVENT_SEARCHING)}}]},popup:{type:o.allowInsertValue?"bi.multilayer_select_tree_insert_search_pane":"bi.multilayer_select_tree_popup",itemsCreator:o.itemsCreator===BI.emptyFn?BI.emptyFn:function(op,callback){op.keyword=self.editor.getValue(),o.itemsCreator(op,callback)},keywordGetter:function(){return self.editor.getValue()},cls:"bi-card",listeners:[{eventName:BI.MultiLayerSelectTreeInsertSearchPane.EVENT_ADD_ITEM,action:function(){self.options.text=self.getSearcher().getKeyword(),self.fireEvent(BI.MultiLayerSelectTreeTrigger.EVENT_ADD_ITEM)}}],ref:function(_ref){self.popup=_ref}},onSearch:function(obj,callback){var keyword=obj.keyword;o.itemsCreator===BI.emptyFn?(callback(self._getSearchItems(keyword)),o.allowInsertValue&&self.popup.setKeyword(keyword)):callback()},listeners:[{eventName:BI.Searcher.EVENT_CHANGE,action:function(){self.fireEvent(BI.MultiLayerSelectTreeTrigger.EVENT_CHANGE)}}]}},{el:{type:"bi.layout",width:24},width:24}]};return o.allowEdit?content:{type:"bi.absolute",items:[{el:content,left:0,right:0,top:0,bottom:0},{el:{type:"bi.layout"},left:0,right:24,top:0,bottom:0}]}},_initData:function(){var o=this.options;this.tree=new BI.Tree,this.nodes=BI.Tree.treeFormat(BI.deepClone(o.items)),this.tree.initTree(this.nodes)},_getSearchItems:function(keyword){var self=this,o=this.options,items=[];return this.tree.traverse(function(node){var find=BI.Func.getSearchResult(self.tree.isRoot(node)?[]:BI.concat([node.text],o.allowSearchValue?[node.value]:[]),keyword);if(find.find.length>0||find.match.length>0)return items.push(node),!0}),this._fillTreeStructure4Search(items,"id")},_createJson:function(node,open){return{id:node.id,pId:node.pId,text:node.text,value:node.value,isParent:BI.isNotEmptyArray(node.children),open:open}},_getChildren:function(node){var self=this;node.children=node.children||[];var nodes=[];return BI.each(node.children,function(idx,child){var children=self._getChildren(child);nodes=nodes.concat(children)}),node.children.concat(nodes)},_fillTreeStructure4Search:function(leaves){var self=this,result=[],queue=[];for(BI.each(leaves,function(idx,node){queue.push({pId:node.pId}),result.push(node),result=result.concat(self._getChildren(node))});BI.isNotEmptyArray(queue);){var node=queue.pop(),pNode=this.tree.search(this.tree.getRoot(),node.pId,"id");null!=pNode&&(pNode.open=!0,queue.push({pId:pNode.pId}),result.push(pNode))}return BI.uniqBy(BI.map(result,function(idx,node){return self._createJson(node,node.open)}),"id")},_digest:function(v){var o=this.options;if(o.itemsCreator===BI.emptyFn){var result=BI.find(o.items,function(i,item){return item.value===v});return BI.isNotNull(result)?result.text:o.text}return o.valueFormatter(v)},stopEditing:function(){this.searcher.stopSearch()},getSearcher:function(){return this.searcher},populate:function(items){this.options.items=items,this._initData(items)},setValue:function(v){this.editor.setState(this._digest(v[0]))},getValue:function(){return this.searcher.getValue()}}),BI.MultiLayerSelectTreeTrigger.EVENT_FOCUS="EVENT_FOCUS",BI.MultiLayerSelectTreeTrigger.EVENT_BLUR="EVENT_BLUR",BI.MultiLayerSelectTreeTrigger.EVENT_SEARCHING="EVENT_SEARCHING",BI.MultiLayerSelectTreeTrigger.EVENT_STOP="EVENT_STOP",BI.MultiLayerSelectTreeTrigger.EVENT_START="EVENT_START",BI.MultiLayerSelectTreeTrigger.EVENT_CHANGE="EVENT_CHANGE",BI.MultiLayerSelectTreeTrigger.EVENT_ADD_ITEM="EVENT_ADD_ITEM",BI.shortcut("bi.multilayer_select_tree_trigger",BI.MultiLayerSelectTreeTrigger),BI.MultiLayerSelectTreeFirstPlusGroupNode=BI.inherit(BI.NodeButton,{_defaultConfig:function(){var conf=BI.MultiLayerSelectTreeFirstPlusGroupNode.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{extraCls:"bi-multilayer-select-tree-first-plus-group-node bi-list-item-active",layer:0,id:"",pId:"",readonly:!0,open:!1,height:24})},_init:function(){BI.MultiLayerSelectTreeFirstPlusGroupNode.superclass._init.apply(this,arguments);var self=this,o=this.options;this.node=BI.createWidget({type:"bi.select_tree_first_plus_group_node",cls:"bi-list-item-none",stopPropagation:!0,logic:{dynamic:!0},id:o.id,pId:o.pId,keyword:o.keyword,open:o.open,height:o.height,hgap:o.hgap,text:o.text,value:o.value,py:o.py}),this.node.on(BI.Controller.EVENT_CHANGE,function(type){self.setSelected(self.isSelected()),self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)});for(var needBlankLayers=[],pNode=o.pNode;pNode;)pNode.isLastNode&&needBlankLayers.push(pNode.layer),pNode=pNode.pNode;var items=[];BI.count(0,o.layer,function(index){items.push({type:"bi.layout",cls:BI.contains(needBlankLayers,index)?"":"base-line-conn-background",width:12,height:o.height})}),items.push(this.node),BI.createWidget({type:"bi.td",element:this,columnSize:BI.makeArray(o.layer,12),items:[items]})},isOnce:function(){return!0},doRedMark:function(){this.node.doRedMark.apply(this.node,arguments)},unRedMark:function(){this.node.unRedMark.apply(this.node,arguments)},isSelected:function(){return this.node.isSelected()},setSelected:function(b){BI.MultiLayerSelectTreeFirstPlusGroupNode.superclass.setSelected.apply(this,arguments),this.node.setSelected(b)},doClick:function(){BI.NodeButton.superclass.doClick.apply(this,arguments),this.node.setSelected(this.isSelected())},setOpened:function(v){BI.MultiLayerSelectTreeFirstPlusGroupNode.superclass.setOpened.apply(this,arguments),this.node.setOpened(v)}}),BI.shortcut("bi.multilayer_select_tree_first_plus_group_node",BI.MultiLayerSelectTreeFirstPlusGroupNode),BI.MultiLayerSelectTreeLastPlusGroupNode=BI.inherit(BI.NodeButton,{_defaultConfig:function(){var conf=BI.MultiLayerSelectTreeLastPlusGroupNode.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{extraCls:"bi-multilayer-select-tree-last-plus-group-node bi-list-item-active",layer:0,id:"",pId:"",readonly:!0,open:!1,height:24})},_init:function(){BI.MultiLayerSelectTreeLastPlusGroupNode.superclass._init.apply(this,arguments);var self=this,o=this.options;this.node=BI.createWidget({type:"bi.select_tree_last_plus_group_node",cls:"bi-list-item-none",stopPropagation:!0,logic:{dynamic:!0},id:o.id,pId:o.pId,keyword:o.keyword,open:o.open,height:o.height,hgap:o.hgap,text:o.text,value:o.value,py:o.py}),this.node.on(BI.Controller.EVENT_CHANGE,function(type){self.setSelected(self.isSelected()),self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)});for(var needBlankLayers=[],pNode=o.pNode;pNode;)pNode.isLastNode&&needBlankLayers.push(pNode.layer),pNode=pNode.pNode;var items=[];BI.count(0,o.layer,function(index){items.push({type:"bi.layout",cls:BI.contains(needBlankLayers,index)?"":"base-line-conn-background",width:12,height:o.height})}),items.push(this.node),BI.createWidget({type:"bi.td",element:this,columnSize:BI.makeArray(o.layer,12),items:[items]})},doRedMark:function(){this.node.doRedMark.apply(this.node,arguments)},unRedMark:function(){this.node.unRedMark.apply(this.node,arguments)},isSelected:function(){return this.node.isSelected()},setSelected:function(b){BI.MultiLayerSelectTreeLastPlusGroupNode.superclass.setSelected.apply(this,arguments),this.node.setSelected(b)},doClick:function(){BI.MultiLayerSelectTreeLastPlusGroupNode.superclass.doClick.apply(this,arguments),this.node.setSelected(this.isSelected())},setOpened:function(v){BI.MultiLayerSelectTreeLastPlusGroupNode.superclass.setOpened.apply(this,arguments),this.node.setOpened(v)}}),BI.shortcut("bi.multilayer_select_tree_last_plus_group_node",BI.MultiLayerSelectTreeLastPlusGroupNode),BI.MultiLayerSelectTreeMidPlusGroupNode=BI.inherit(BI.NodeButton,{_defaultConfig:function(){var conf=BI.MultiLayerSelectTreeMidPlusGroupNode.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{extraCls:"bi-multilayer-select-tree-mid-plus-group-node bi-list-item-active",layer:0,id:"",pId:"",readonly:!0,open:!1,height:24})},_init:function(){BI.MultiLayerSelectTreeMidPlusGroupNode.superclass._init.apply(this,arguments);var self=this,o=this.options;this.node=BI.createWidget({type:"bi.select_tree_mid_plus_group_node",cls:"bi-list-item-none",stopPropagation:!0,logic:{dynamic:!0},id:o.id,pId:o.pId,keyword:o.keyword,open:o.open,height:o.height,hgap:o.hgap,text:o.text,value:o.value,py:o.py}),this.node.on(BI.Controller.EVENT_CHANGE,function(type){self.setSelected(self.isSelected()),self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)});for(var needBlankLayers=[],pNode=o.pNode;pNode;)pNode.isLastNode&&needBlankLayers.push(pNode.layer),pNode=pNode.pNode;var items=[];BI.count(0,o.layer,function(index){items.push({type:"bi.layout",cls:BI.contains(needBlankLayers,index)?"":"base-line-conn-background",width:12,height:o.height})}),items.push(this.node),BI.createWidget({type:"bi.td",element:this,columnSize:BI.makeArray(o.layer,12),items:[items]})},doRedMark:function(){this.node.doRedMark.apply(this.node,arguments)},unRedMark:function(){this.node.unRedMark.apply(this.node,arguments)},isSelected:function(){return this.node.isSelected()},setSelected:function(b){BI.MultiLayerSelectTreeMidPlusGroupNode.superclass.setSelected.apply(this,arguments),this.node.setSelected(b)},doClick:function(){BI.MultiLayerSelectTreeMidPlusGroupNode.superclass.doClick.apply(this,arguments),this.node.setSelected(this.isSelected())},setOpened:function(v){BI.MultiLayerSelectTreeMidPlusGroupNode.superclass.setOpened.apply(this,arguments),this.node.setOpened(v)}}),BI.shortcut("bi.multilayer_select_tree_mid_plus_group_node",BI.MultiLayerSelectTreeMidPlusGroupNode),BI.MultiLayerSelectTreePlusGroupNode=BI.inherit(BI.NodeButton,{_defaultConfig:function(){var conf=BI.MultiLayerSelectTreePlusGroupNode.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{extraCls:"bi-multilayer-select-tree-first-plus-group-node bi-list-item-active",layer:0,id:"",pId:"",readonly:!0,open:!1,height:24})},_init:function(){BI.MultiLayerSelectTreePlusGroupNode.superclass._init.apply(this,arguments);var self=this,o=this.options;this.node=BI.createWidget({type:"bi.select_tree_plus_group_node",cls:"bi-list-item-none",stopPropagation:!0,logic:{dynamic:!0},id:o.id,pId:o.pId,keyword:o.keyword,open:o.open,height:o.height,hgap:o.hgap,text:o.text,value:o.value,py:o.py}),this.node.on(BI.Controller.EVENT_CHANGE,function(type){self.setSelected(self.isSelected()),self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)});for(var needBlankLayers=[],pNode=o.pNode;pNode;)pNode.isLastNode&&needBlankLayers.push(pNode.layer),pNode=pNode.pNode;var items=[];BI.count(0,o.layer,function(index){items.push({type:"bi.layout",cls:BI.contains(needBlankLayers,index)?"":"base-line-conn-background",width:12,height:o.height})}),items.push(this.node),BI.createWidget({type:"bi.td",element:this,columnSize:BI.makeArray(o.layer,12),items:[items]})},isOnce:function(){return!0},doRedMark:function(){this.node.doRedMark.apply(this.node,arguments)},unRedMark:function(){this.node.unRedMark.apply(this.node,arguments)},isSelected:function(){return this.node.isSelected()},setSelected:function(b){BI.MultiLayerSelectTreePlusGroupNode.superclass.setSelected.apply(this,arguments),this.node.setSelected(b)},doClick:function(){BI.NodeButton.superclass.doClick.apply(this,arguments),this.node.setSelected(this.isSelected())},setOpened:function(v){BI.MultiLayerSelectTreePlusGroupNode.superclass.setOpened.apply(this,arguments),this.node.setOpened(v)}}),BI.shortcut("bi.multilayer_select_tree_plus_group_node",BI.MultiLayerSelectTreePlusGroupNode),BI.MultiLayerSingleTreeCombo=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.MultiLayerSingleTreeCombo.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-multilayer-single-tree-combo",isDefaultInit:!1,height:24,text:"",itemsCreator:BI.emptyFn,items:[],value:"",attributes:{tabIndex:0},allowEdit:!1,allowSearchValue:!1,allowInsertValue:!1})},render:function(){var self=this,o=this.options,combo=o.itemsCreator===BI.emptyFn?this._getSyncConfig():this._getAsyncConfig();return o.allowEdit||o.itemsCreator!==BI.emptyFn?{type:"bi.absolute",items:[{el:combo,left:0,right:0,top:0,bottom:0},{el:{type:"bi.trigger_icon_button",cls:"trigger-icon-button",ref:function(_ref){self.triggerBtn=_ref},width:o.height,height:o.height,handler:function(){self.combo.isViewVisible()?self.combo.hideView():self.combo.showView()}},right:0,bottom:0,top:0}]}:combo},_getBaseConfig:function(){var self=this,o=this.options;return{type:"bi.combo",container:o.container,adjustLength:2,ref:function(_ref){self.combo=_ref},popup:{el:{type:"bi.multilayer_single_tree_popup",isDefaultInit:o.isDefaultInit,itemsCreator:o.itemsCreator,items:o.items,ref:function(_ref){self.trigger&&self.trigger.getSearcher().setAdapter(_ref)},listeners:[{eventName:BI.MultiLayerSingleTreePopup.EVENT_CHANGE,action:function(){self.setValue(this.getValue()),self.combo.hideView(),self.fireEvent(BI.MultiLayerSingleTreeCombo.EVENT_CHANGE)}}]},value:o.value,maxHeight:400,minHeight:240}}},_getSearchConfig:function(){var self=this,o=this.options;return{el:{type:"bi.multilayer_single_tree_trigger",allowInsertValue:o.allowInsertValue,allowSearchValue:o.allowSearchValue,allowEdit:o.allowEdit,cls:"multilayer-single-tree-trigger",ref:function(_ref){self.trigger=_ref},watermark:o.watermark,items:o.items,itemsCreator:o.itemsCreator,valueFormatter:o.valueFormatter,height:o.height-2,text:o.text,value:o.value,tipType:o.tipType,warningTitle:o.warningTitle,title:o.title,listeners:[{eventName:BI.MultiLayerSingleTreeTrigger.EVENT_CHANGE,action:function(){self.setValue(this.getValue()),self.combo.hideView(),self.fireEvent(BI.MultiLayerSingleTreeCombo.EVENT_CHANGE)}},{eventName:BI.MultiLayerSingleTreeTrigger.EVENT_FOCUS,action:function(){self.fireEvent(BI.MultiLayerSingleTreeCombo.EVENT_FOCUS)}},{eventName:BI.MultiLayerSingleTreeTrigger.EVENT_BLUR,action:function(){self.fireEvent(BI.MultiLayerSingleTreeCombo.EVENT_BLUR)}},{eventName:BI.MultiLayerSingleTreeTrigger.EVENT_SEARCHING,action:function(){self.fireEvent(BI.MultiLayerSingleTreeCombo.EVENT_SEARCHING)}},{eventName:BI.MultiLayerSingleTreeTrigger.EVENT_ADD_ITEM,action:function(){var value=self.trigger.getSearcher().getKeyword();self.combo.setValue([value]),self.combo.hideView()}}]},hideChecker:function(e){return 0===self.triggerBtn.element.find(e.target).length},listeners:[{eventName:BI.Combo.EVENT_AFTER_HIDEVIEW,action:function(){self.trigger.stopEditing()}}]}},_getSyncConfig:function(){var o=this.options,baseConfig=this._getBaseConfig();return BI.extend(baseConfig,o.allowEdit?this._getSearchConfig():{el:{type:"bi.single_tree_trigger",text:o.text,height:o.height,items:o.items,value:o.value}})},_getAsyncConfig:function(){var config=this._getBaseConfig();return BI.extend(config,this._getSearchConfig())},setValue:function(v){v=BI.isArray(v)?v:[v],this.combo.setValue(v)},getValue:function(){return this.combo.getValue()},populate:function(items){this.combo.populate(items)}}),BI.MultiLayerSingleTreeCombo.EVENT_SEARCHING="EVENT_SEARCHING",BI.MultiLayerSingleTreeCombo.EVENT_BLUR="EVENT_BLUR",BI.MultiLayerSingleTreeCombo.EVENT_FOCUS="EVENT_FOCUS",BI.MultiLayerSingleTreeCombo.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.multilayer_single_tree_combo",BI.MultiLayerSingleTreeCombo),BI.MultiLayerSingleTreeInsertSearchPane=BI.inherit(BI.Widget,{props:function(){return{baseCls:"bi-multilayer-single-tree-popup",tipText:BI.i18nText("BI-No_Selected_Item"),isDefaultInit:!1,itemsCreator:BI.emptyFn,items:[],value:""}},render:function(){var self=this,o=this.options;return this.tree=BI.createWidget({type:"bi.multilayer_select_level_tree",isDefaultInit:o.isDefaultInit,items:o.items,itemsCreator:o.itemsCreator===BI.emptyFn?BI.emptyFn:function(op,callback){o.itemsCreator(op,function(res){callback(res),self.setKeyword(o.keywordGetter())})},keywordGetter:o.keywordGetter,value:o.value,scrollable:null,listeners:[{eventName:BI.Controller.EVENT_CHANGE,action:function(){self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}},{eventName:BI.MultiLayerSelectLevelTree.EVENT_CHANGE,action:function(){self.fireEvent(BI.MultiLayerSingleTreeInsertSearchPane.EVENT_CHANGE)}}]}),{type:"bi.vertical",scrolly:!1,scrollable:!0,vgap:5,items:[{type:"bi.text_button",invisible:!0,text:BI.i18nText("BI-Basic_Click_To_Add_Text",""),height:24,cls:"bi-high-light",hgap:5,ref:function(_ref){self.addNotMatchTip=_ref},handler:function(){self.fireEvent(BI.MultiLayerSingleTreeInsertSearchPane.EVENT_ADD_ITEM,o.keywordGetter())}},this.tree]}},setKeyword:function(keyword){var showTip=BI.isEmptyArray(this.tree.getAllLeaves());this.addNotMatchTip.setVisible(showTip),showTip&&this.addNotMatchTip.setText(BI.i18nText("BI-Basic_Click_To_Add_Text",keyword))},getValue:function(){return this.tree.getValue()},setValue:function(v){v=BI.isArray(v)?v:[v],this.tree.setValue(v)},populate:function(items){this.tree.populate(items)}}),BI.MultiLayerSingleTreeInsertSearchPane.EVENT_ADD_ITEM="EVENT_ADD_ITEM",BI.MultiLayerSingleTreeInsertSearchPane.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.multilayer_single_tree_insert_search_pane",BI.MultiLayerSingleTreeInsertSearchPane),BI.MultiLayerSingleLevelTree=BI.inherit(BI.Pane,{_defaultConfig:function(){return BI.extend(BI.MultiLayerSingleLevelTree.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-multilayer-single-level-tree",isDefaultInit:!1,items:[],itemsCreator:BI.emptyFn,keywordGetter:BI.emptyFn,chooseType:BI.Selection.Single,scrollable:!0})},_init:function(){var o=this.options;BI.MultiLayerSingleLevelTree.superclass._init.apply(this,arguments),this.storeValue=o.value,this.initTree(this.options.items),this.check()},_formatItems:function(nodes,layer,pNode){var self=this,o=this.options,keyword=o.keywordGetter();return BI.each(nodes,function(i,node){var extend={};node.layer=layer,BI.isKey(node.id)||(node.id=BI.UUID()),node.keyword=node.keyword||keyword,extend.pNode=pNode,node.isParent===!0||node.parent===!0||BI.isNotEmptyArray(node.children)?(extend.type="bi.multilayer_single_tree_mid_plus_group_node",i===nodes.length-1&&(extend.type="bi.multilayer_single_tree_last_plus_group_node",extend.isLastNode=!0),0!==i||pNode||(extend.type="bi.multilayer_single_tree_first_plus_group_node"),0!==i||i!==nodes.length-1||pNode||(extend.type="bi.multilayer_single_tree_plus_group_node"),BI.defaults(node,extend),self._formatItems(node.children,layer+1,node)):(extend.type="bi.multilayer_single_tree_mid_tree_leaf_item",0!==i||pNode||(extend.type="bi.multilayer_single_tree_first_tree_leaf_item"),i===nodes.length-1&&(extend.type="bi.multilayer_single_tree_last_tree_leaf_item"),BI.defaults(node,extend))}),nodes},_assertId:function(sNodes){BI.each(sNodes,function(i,node){node.id=node.id||BI.UUID()})},initTree:function(nodes){var self=this,o=this.options,hasNext=!1;this.empty(),this._assertId(nodes),this.tree=BI.createWidget({type:"bi.custom_tree",cls:"tree-view display-table",expander:{isDefaultInit:o.isDefaultInit,el:{},popup:{type:"bi.custom_tree"}},items:this._formatItems(BI.Tree.transformToTreeFormat(nodes),0),value:o.value,itemsCreator:function(op,callback){1===op.times&&!op.node&&BI.nextTick(function(){self.loading()}),o.itemsCreator(op,function(ob){hasNext=ob.hasNext,1===op.times&&!op.node&&self._populate(ob.items),callback(self._formatItems(BI.Tree.transformToTreeFormat(ob.items),op.node?op.node.layer+1:0,op.node)),self.setValue(self.storeValue),1===op.times&&!op.node&&BI.nextTick(function(){self.loaded()})})},el:{type:"bi.loader",isDefaultInit:o.itemsCreator!==BI.emptyFn,el:{type:"bi.button_tree",chooseType:o.chooseType,behaviors:o.behaviors,layouts:[{type:"bi.vertical"}]},hasNext:function(){return hasNext}}}),this.tree.on(BI.Controller.EVENT_CHANGE,function(type,v){self.fireEvent(BI.Controller.EVENT_CHANGE,arguments),type===BI.Events.CLICK&&(self.setValue(v),self.fireEvent(BI.MultiLayerSingleLevelTree.EVENT_CHANGE,v))}),BI.createWidget({type:"bi.adaptive",element:this,scrollable:o.scrollable,items:[this.tree]})},_populate:function(){BI.MultiLayerSelectLevelTree.superclass.populate.apply(this,arguments)},populate:function(nodes){this._populate(nodes),BI.isNull(nodes)?this.tree.populate():this.tree.populate(this._formatItems(BI.Tree.transformToTreeFormat(nodes),0))},setValue:function(v){this.options.chooseType===BI.Selection.None||(this.storeValue=v,this.tree.setValue(v))},getValue:function(){return BI.isArray(this.storeValue)?this.storeValue:BI.isNull(this.storeValue)?[]:[this.storeValue]},getAllLeaves:function(){return this.tree.getAllLeaves()},getNodeById:function(id){return this.tree.getNodeById(id)},getNodeByValue:function(id){return this.tree.getNodeByValue(id)}}),BI.MultiLayerSingleLevelTree.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.multilayer_single_level_tree",BI.MultiLayerSingleLevelTree),BI.MultiLayerSingleTreePopup=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.MultiLayerSingleTreePopup.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-multilayer-singletree-popup",tipText:BI.i18nText("BI-No_Selected_Item"),isDefaultInit:!1,itemsCreator:BI.emptyFn,items:[]})},_init:function(){BI.MultiLayerSingleTreePopup.superclass._init.apply(this,arguments);var self=this,o=this.options;this.tree=BI.createWidget({type:"bi.multilayer_single_level_tree",isDefaultInit:o.isDefaultInit,items:o.items,itemsCreator:o.itemsCreator,keywordGetter:o.keywordGetter,value:o.value,scrollable:null}),BI.createWidget({type:"bi.vertical",scrolly:!1,scrollable:!0,element:this,vgap:5,items:[this.tree]}),this.tree.on(BI.Controller.EVENT_CHANGE,function(){self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.tree.on(BI.MultiLayerSingleLevelTree.EVENT_CHANGE,function(){self.fireEvent(BI.MultiLayerSingleTreePopup.EVENT_CHANGE)})},getValue:function(){return this.tree.getValue()},setValue:function(v){v=BI.isArray(v)?v:[v],this.tree.setValue(v)},populate:function(items){this.tree.populate(items)}}),BI.MultiLayerSingleTreePopup.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.multilayer_single_tree_popup",BI.MultiLayerSingleTreePopup),BI.MultiLayerSingleTreeTrigger=BI.inherit(BI.Trigger,{props:function(){return{extraCls:"bi-multi-layer-single-tree-trigger bi-border bi-focus-shadow",height:24,valueFormatter:function(v){return v},itemsCreator:BI.emptyFn,watermark:BI.i18nText("BI-Basic_Search"),allowSearchValue:!1}},render:function(){var self=this,o=this.options;o.itemsCreator===BI.emptyFn&&this._initData();var content={type:"bi.htape",items:[{el:{type:"bi.searcher",ref:function(){self.searcher=this},isAutoSearch:!1,el:{type:"bi.state_editor",ref:function(){self.editor=this},defaultText:o.text,text:this._digest(o.value),value:o.value,height:o.height,tipText:"",watermark:o.watermark,listeners:[{eventName:BI.StateEditor.EVENT_FOCUS,action:function(){self.fireEvent(BI.MultiLayerSingleTreeTrigger.EVENT_FOCUS)}},{eventName:BI.StateEditor.EVENT_BLUR,action:function(){self.fireEvent(BI.MultiLayerSingleTreeTrigger.EVENT_BLUR)}},{eventName:BI.StateEditor.EVENT_CHANGE,action:function(){self.fireEvent(BI.MultiLayerSingleTreeTrigger.EVENT_SEARCHING)}}]},popup:{type:o.allowInsertValue?"bi.multilayer_single_tree_insert_search_pane":"bi.multilayer_single_tree_popup",itemsCreator:o.itemsCreator===BI.emptyFn?BI.emptyFn:function(op,callback){op.keyword=self.editor.getValue(),o.itemsCreator(op,callback)},keywordGetter:function(){return self.editor.getValue()},cls:"bi-card",listeners:[{eventName:BI.MultiLayerSingleTreeInsertSearchPane.EVENT_ADD_ITEM,action:function(){self.options.text=self.getSearcher().getKeyword(),self.fireEvent(BI.MultiLayerSingleTreeTrigger.EVENT_ADD_ITEM)}}],ref:function(_ref){self.popup=_ref}},onSearch:function(obj,callback){var keyword=obj.keyword;o.itemsCreator===BI.emptyFn?(callback(self._getSearchItems(keyword)),o.allowInsertValue&&self.popup.setKeyword(keyword)):callback()},listeners:[{eventName:BI.Searcher.EVENT_CHANGE,action:function(){self.fireEvent(BI.MultiLayerSingleTreeTrigger.EVENT_CHANGE)}}]}},{el:{type:"bi.layout",width:24},width:24}]};return o.allowEdit?content:{type:"bi.absolute",items:[{el:content,left:0,right:0,top:0,bottom:0},{el:{type:"bi.layout"},left:0,right:24,top:0,bottom:0}]}},_initData:function(){var o=this.options;this.tree=new BI.Tree,this.nodes=BI.Tree.treeFormat(BI.deepClone(o.items)),this.tree.initTree(this.nodes)},_getSearchItems:function(keyword){var self=this,o=this.options,items=[];return this.tree.traverse(function(node){var find=BI.Func.getSearchResult(self.tree.isRoot(node)?[]:BI.concat([node.text],o.allowSearchValue?[node.value]:[]),keyword);if(find.find.length>0||find.match.length>0)return items.push(node),!0}),this._fillTreeStructure4Search(items,"id")},_createJson:function(node,open){return{id:node.id,pId:node.pId,text:node.text,value:node.value,isParent:BI.isNotEmptyArray(node.children),open:open}},_getChildren:function(node){var self=this;node.children=node.children||[];var nodes=[];return BI.each(node.children,function(idx,child){var children=self._getChildren(child);nodes=nodes.concat(children)}),node.children.concat(nodes)},_fillTreeStructure4Search:function(leaves){var self=this,result=[],queue=[];for(BI.each(leaves,function(idx,node){queue.push({pId:node.pId}),result.push(node),result=result.concat(self._getChildren(node))});BI.isNotEmptyArray(queue);){var node=queue.pop(),pNode=this.tree.search(this.tree.getRoot(),node.pId,"id");null!=pNode&&(pNode.open=!0,queue.push({pId:pNode.pId}),result.push(pNode))}return BI.uniqBy(BI.map(result,function(idx,node){return self._createJson(node,node.open)}),"id")},_digest:function(v){var o=this.options;if(o.itemsCreator===BI.emptyFn){var result=BI.find(o.items,function(i,item){return item.value===v});return BI.isNotNull(result)?result.text:o.text}return o.valueFormatter(v)},stopEditing:function(){this.searcher.stopSearch()},getSearcher:function(){return this.searcher},populate:function(items){this.options.items=items,this._initData()},setValue:function(v){this.editor.setState(this._digest(v[0]))},getValue:function(){return this.searcher.getValue()}}),BI.MultiLayerSingleTreeTrigger.EVENT_FOCUS="EVENT_FOCUS",BI.MultiLayerSingleTreeTrigger.EVENT_BLUR="EVENT_BLUR",BI.MultiLayerSingleTreeTrigger.EVENT_SEARCHING="EVENT_SEARCHING",BI.MultiLayerSingleTreeTrigger.EVENT_STOP="EVENT_STOP",BI.MultiLayerSingleTreeTrigger.EVENT_START="EVENT_START",BI.MultiLayerSingleTreeTrigger.EVENT_CHANGE="EVENT_CHANGE",BI.MultiLayerSingleTreeTrigger.EVENT_ADD_ITEM="EVENT_ADD_ITEM",BI.shortcut("bi.multilayer_single_tree_trigger",BI.MultiLayerSingleTreeTrigger),BI.MultiLayerSingleTreeFirstPlusGroupNode=BI.inherit(BI.NodeButton,{_defaultConfig:function(){var conf=BI.MultiLayerSingleTreeFirstPlusGroupNode.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{extraCls:"bi-multilayer-single-tree-first-plus-group-node bi-list-item",layer:0,id:"",pId:"",open:!1,height:24})},_init:function(){BI.MultiLayerSingleTreeFirstPlusGroupNode.superclass._init.apply(this,arguments);var self=this,o=this.options;this.node=this._createNode();for(var needBlankLayers=[],pNode=o.pNode;pNode;)pNode.isLastNode&&needBlankLayers.push(pNode.layer),pNode=pNode.pNode;var items=[];BI.count(0,o.layer,function(index){items.push({type:"bi.layout",cls:BI.contains(needBlankLayers,index)?"":"base-line-conn-background",width:12,height:o.height})}),items.push(this.node),BI.createWidget({type:"bi.td",element:this,columnSize:BI.makeArray(o.layer,12),items:[items]})},doRedMark:function(){this.node.doRedMark.apply(this.node,arguments)},unRedMark:function(){this.node.unRedMark.apply(this.node,arguments)},doClick:function(){BI.MultiLayerSingleTreeFirstPlusGroupNode.superclass.doClick.apply(this,arguments),this.node.setSelected(this.isSelected())},setOpened:function(v){BI.MultiLayerSingleTreeFirstPlusGroupNode.superclass.setOpened.apply(this,arguments),BI.isNotNull(this.node)&&this.node.setOpened(v)},_createNode:function(){var self=this,o=this.options;return BI.createWidget({type:"bi.first_plus_group_node",cls:"bi-list-item-none",logic:{dynamic:!0},id:o.id,pId:o.pId,open:o.open,isLastNode:o.isLastNode,height:o.height,hgap:o.hgap,text:o.text,value:o.value,py:o.py,keyword:o.keyword,listeners:[{eventName:BI.Controller.EVENT_CHANGE,action:function(type){type!==BI.Events.CLICK&&self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}}]})}}),BI.shortcut("bi.multilayer_single_tree_first_plus_group_node",BI.MultiLayerSingleTreeFirstPlusGroupNode),BI.MultiLayerSingleTreeLastPlusGroupNode=BI.inherit(BI.NodeButton,{_defaultConfig:function(){var conf=BI.MultiLayerSingleTreeLastPlusGroupNode.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{extraCls:"bi-multilayer-single-tree-last-plus-group-node bi-list-item",layer:0,id:"",pId:"",open:!1,height:24})},_init:function(){BI.MultiLayerSingleTreeLastPlusGroupNode.superclass._init.apply(this,arguments);var self=this,o=this.options;this.node=this._createNode();for(var needBlankLayers=[],pNode=o.pNode;pNode;)pNode.isLastNode&&needBlankLayers.push(pNode.layer),pNode=pNode.pNode;var items=[];BI.count(0,o.layer,function(index){items.push({type:"bi.layout",cls:BI.contains(needBlankLayers,index)?"":"base-line-conn-background",width:12,height:o.height})}),items.push(this.node),BI.createWidget({type:"bi.td",element:this,columnSize:BI.makeArray(o.layer,12),items:[items]})},doRedMark:function(){this.node.doRedMark.apply(this.node,arguments)},unRedMark:function(){this.node.unRedMark.apply(this.node,arguments)},doClick:function(){BI.MultiLayerSingleTreeLastPlusGroupNode.superclass.doClick.apply(this,arguments),this.node.setSelected(this.isSelected())},setOpened:function(v){BI.MultiLayerSingleTreeLastPlusGroupNode.superclass.setOpened.apply(this,arguments),BI.isNotNull(this.node)&&this.node.setOpened(v)},_createNode:function(){var self=this,o=this.options;return BI.createWidget({type:"bi.last_plus_group_node",cls:"bi-list-item-none",logic:{dynamic:!0},id:o.id,pId:o.pId,open:o.open,height:o.height,hgap:o.hgap,text:o.text,value:o.value,py:o.py,keyword:o.keyword,listeners:[{eventName:BI.Controller.EVENT_CHANGE,action:function(type){type!==BI.Events.CLICK&&self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}}]})}}),BI.shortcut("bi.multilayer_single_tree_last_plus_group_node",BI.MultiLayerSingleTreeLastPlusGroupNode),BI.MultiLayerSingleTreeMidPlusGroupNode=BI.inherit(BI.NodeButton,{_defaultConfig:function(){var conf=BI.MultiLayerSingleTreeMidPlusGroupNode.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{extraCls:"bi-multilayer-single-tree-mid-plus-group-node bi-list-item",layer:0,id:"",pId:"",open:!1,height:24})},_init:function(){BI.MultiLayerSingleTreeMidPlusGroupNode.superclass._init.apply(this,arguments);var self=this,o=this.options;this.node=this._createNode();for(var needBlankLayers=[],pNode=o.pNode;pNode;)pNode.isLastNode&&needBlankLayers.push(pNode.layer),pNode=pNode.pNode;var items=[];BI.count(0,o.layer,function(index){items.push({type:"bi.layout",cls:BI.contains(needBlankLayers,index)?"":"base-line-conn-background", +width:12,height:o.height})}),items.push(this.node),BI.createWidget({type:"bi.td",element:this,columnSize:BI.makeArray(o.layer,12),items:[items]})},doRedMark:function(){this.node.doRedMark.apply(this.node,arguments)},unRedMark:function(){this.node.unRedMark.apply(this.node,arguments)},doClick:function(){BI.MultiLayerSingleTreeMidPlusGroupNode.superclass.doClick.apply(this,arguments),this.node.setSelected(this.isSelected())},setOpened:function(v){BI.MultiLayerSingleTreeMidPlusGroupNode.superclass.setOpened.apply(this,arguments),BI.isNotNull(this.node)&&this.node.setOpened(v)},_createNode:function(){var self=this,o=this.options;return BI.createWidget({type:"bi.mid_plus_group_node",cls:"bi-list-item-none",logic:{dynamic:!0},id:o.id,pId:o.pId,open:o.open,height:o.height,hgap:o.hgap,text:o.text,value:o.value,py:o.py,keyword:o.keyword,listeners:[{eventName:BI.Controller.EVENT_CHANGE,action:function(type){type!==BI.Events.CLICK&&self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}}]})}}),BI.shortcut("bi.multilayer_single_tree_mid_plus_group_node",BI.MultiLayerSingleTreeMidPlusGroupNode),BI.MultiLayerSingleTreePlusGroupNode=BI.inherit(BI.NodeButton,{_defaultConfig:function(){var conf=BI.MultiLayerSingleTreePlusGroupNode.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{extraCls:"bi-multilayer-single-tree-plus-group-node bi-list-item",layer:0,id:"",pId:"",open:!1,height:24})},_init:function(){BI.MultiLayerSingleTreePlusGroupNode.superclass._init.apply(this,arguments);var self=this,o=this.options;this.node=this._createNode();for(var needBlankLayers=[],pNode=o.pNode;pNode;)pNode.isLastNode&&needBlankLayers.push(pNode.layer),pNode=pNode.pNode;var items=[];BI.count(0,o.layer,function(index){items.push({type:"bi.layout",cls:BI.contains(needBlankLayers,index)?"":"base-line-conn-background",width:12,height:o.height})}),items.push(this.node),BI.createWidget({type:"bi.td",element:this,columnSize:BI.makeArray(o.layer,12),items:[items]})},doRedMark:function(){this.node.doRedMark.apply(this.node,arguments)},unRedMark:function(){this.node.unRedMark.apply(this.node,arguments)},doClick:function(){BI.MultiLayerSingleTreePlusGroupNode.superclass.doClick.apply(this,arguments),this.node.setSelected(this.isSelected())},setOpened:function(v){BI.MultiLayerSingleTreePlusGroupNode.superclass.setOpened.apply(this,arguments),BI.isNotNull(this.node)&&this.node.setOpened(v)},_createNode:function(){var self=this,o=this.options;return BI.createWidget({type:"bi.plus_group_node",cls:"bi-list-item-none",logic:{dynamic:!0},id:o.id,pId:o.pId,open:o.open,isLastNode:o.isLastNode,height:o.height,hgap:o.hgap,text:o.text,value:o.value,py:o.py,keyword:o.keyword,listeners:[{eventName:BI.Controller.EVENT_CHANGE,action:function(type){type!==BI.Events.CLICK&&self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}}]})}}),BI.shortcut("bi.multilayer_single_tree_plus_group_node",BI.MultiLayerSingleTreePlusGroupNode),BI.MultiLayerSingleTreeFirstTreeLeafItem=BI.inherit(BI.BasicButton,{_defaultConfig:function(){return BI.extend(BI.MultiLayerSingleTreeFirstTreeLeafItem.superclass._defaultConfig.apply(this,arguments),{extraCls:"bi-multilayer-single-tree-first-tree-leaf-item bi-list-item-active",logic:{dynamic:!1},layer:0,id:"",pId:"",height:24})},_init:function(){BI.MultiLayerSingleTreeFirstTreeLeafItem.superclass._init.apply(this,arguments);var self=this,o=this.options;this.item=BI.createWidget({type:"bi.first_tree_leaf_item",cls:"bi-list-item-none",logic:{dynamic:!0},id:o.id,pId:o.pId,height:o.height,hgap:o.hgap,text:o.text,value:o.value,py:o.py,keyword:o.keyword}),this.item.on(BI.Controller.EVENT_CHANGE,function(type){type!==BI.Events.CLICK&&self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)});for(var needBlankLayers=[],pNode=o.pNode;pNode;)pNode.isLastNode&&needBlankLayers.push(pNode.layer),pNode=pNode.pNode;var items=[];BI.count(0,o.layer,function(index){items.push({type:"bi.layout",cls:BI.contains(needBlankLayers,index)?"":"base-line-conn-background",width:12,height:o.height})}),items.push(this.item),BI.createWidget({type:"bi.td",element:this,columnSize:BI.makeArray(o.layer,12),items:[items]})},doHighLight:function(){this.item.doHighLight.apply(this.item,arguments)},unHighLight:function(){this.item.unHighLight.apply(this.item,arguments)},getId:function(){return this.options.id},getPId:function(){return this.options.pId},doClick:function(){BI.MultiLayerSingleTreeFirstTreeLeafItem.superclass.doClick.apply(this,arguments),this.item.setSelected(this.isSelected())},setSelected:function(v){BI.MultiLayerSingleTreeFirstTreeLeafItem.superclass.setSelected.apply(this,arguments),this.item.setSelected(v)}}),BI.shortcut("bi.multilayer_single_tree_first_tree_leaf_item",BI.MultiLayerSingleTreeFirstTreeLeafItem),BI.MultiLayerSingleTreeLastTreeLeafItem=BI.inherit(BI.BasicButton,{_defaultConfig:function(){return BI.extend(BI.MultiLayerSingleTreeLastTreeLeafItem.superclass._defaultConfig.apply(this,arguments),{extraCls:"bi-multilayer-single-tree-last-tree-leaf-item bi-list-item-active",logic:{dynamic:!1},layer:0,id:"",pId:"",height:24})},_init:function(){BI.MultiLayerSingleTreeLastTreeLeafItem.superclass._init.apply(this,arguments);var self=this,o=this.options;this.item=BI.createWidget({type:"bi.last_tree_leaf_item",cls:"bi-list-item-none",logic:{dynamic:!0},id:o.id,pId:o.pId,height:o.height,hgap:o.hgap,text:o.text,value:o.value,py:o.py,keyword:o.keyword}),this.item.on(BI.Controller.EVENT_CHANGE,function(type){type!==BI.Events.CLICK&&self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)});for(var needBlankLayers=[],pNode=o.pNode;pNode;)pNode.isLastNode&&needBlankLayers.push(pNode.layer),pNode=pNode.pNode;var items=[];BI.count(0,o.layer,function(index){items.push({type:"bi.layout",cls:BI.contains(needBlankLayers,index)?"":"base-line-conn-background",width:12,height:o.height})}),items.push(this.item),BI.createWidget({type:"bi.td",element:this,columnSize:BI.makeArray(o.layer,12),items:[items]})},doHighLight:function(){this.item.doHighLight.apply(this.item,arguments)},unHighLight:function(){this.item.unHighLight.apply(this.item,arguments)},getId:function(){return this.options.id},getPId:function(){return this.options.pId},doClick:function(){BI.MultiLayerSingleTreeLastTreeLeafItem.superclass.doClick.apply(this,arguments),this.item.setSelected(this.isSelected())},setSelected:function(v){BI.MultiLayerSingleTreeLastTreeLeafItem.superclass.setSelected.apply(this,arguments),this.item.setSelected(v)}}),BI.shortcut("bi.multilayer_single_tree_last_tree_leaf_item",BI.MultiLayerSingleTreeLastTreeLeafItem),BI.MultiLayerSingleTreeMidTreeLeafItem=BI.inherit(BI.BasicButton,{_defaultConfig:function(){return BI.extend(BI.MultiLayerSingleTreeMidTreeLeafItem.superclass._defaultConfig.apply(this,arguments),{extraCls:"bi-multilayer-single-tree-mid-tree-leaf-item bi-list-item-active",logic:{dynamic:!1},layer:0,id:"",pId:"",height:24})},_init:function(){BI.MultiLayerSingleTreeMidTreeLeafItem.superclass._init.apply(this,arguments);var self=this,o=this.options;this.item=BI.createWidget({type:"bi.mid_tree_leaf_item",cls:"bi-list-item-none",logic:{dynamic:!0},id:o.id,pId:o.pId,height:o.height,hgap:o.hgap,text:o.text,value:o.value,py:o.py,keyword:o.keyword}),this.item.on(BI.Controller.EVENT_CHANGE,function(type){type!==BI.Events.CLICK&&self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)});for(var needBlankLayers=[],pNode=o.pNode;pNode;)pNode.isLastNode&&needBlankLayers.push(pNode.layer),pNode=pNode.pNode;var items=[];BI.count(0,o.layer,function(index){items.push({type:"bi.layout",cls:BI.contains(needBlankLayers,index)?"":"base-line-conn-background",width:12,height:o.height})}),items.push(this.item),BI.createWidget({type:"bi.td",element:this,columnSize:BI.makeArray(o.layer,12),items:[items]})},doHighLight:function(){this.item.doHighLight.apply(this.item,arguments)},unHighLight:function(){this.item.unHighLight.apply(this.item,arguments)},getId:function(){return this.options.id},getPId:function(){return this.options.pId},doClick:function(){BI.MultiLayerSingleTreeMidTreeLeafItem.superclass.doClick.apply(this,arguments),this.item.setSelected(this.isSelected())},setSelected:function(v){BI.MultiLayerSingleTreeMidTreeLeafItem.superclass.setSelected.apply(this,arguments),this.item.setSelected(v)}}),BI.shortcut("bi.multilayer_single_tree_mid_tree_leaf_item",BI.MultiLayerSingleTreeMidTreeLeafItem),BI.MultiSelectCheckPane=BI.inherit(BI.Widget,{constants:{height:12,lgap:10,tgap:10,bgap:5},_defaultConfig:function(){return BI.extend(BI.MultiSelectCheckPane.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-multi-select-check-pane bi-background",items:[],itemsCreator:BI.emptyFn,valueFormatter:BI.emptyFn,onClickContinueSelect:BI.emptyFn})},_init:function(){BI.MultiSelectCheckPane.superclass._init.apply(this,arguments);var self=this,opts=this.options;this.storeValue=opts.value||{},this.display=BI.createWidget({type:"bi.display_selected_list",items:opts.items,itemsCreator:function(op,callback){return op=BI.extend(op||{},{selectedValues:self.storeValue.value}),self.storeValue.type===BI.Selection.Multi?void callback({items:BI.map(self.storeValue.value,function(i,v){var txt=opts.valueFormatter(v)||v;return{text:txt,value:v,title:txt}})}):void opts.itemsCreator(op,callback)}}),this.continueSelect=BI.createWidget({type:"bi.text_button",text:BI.i18nText("BI-Continue_Select"),cls:"multi-select-check-selected bi-high-light"}),this.continueSelect.on(BI.TextButton.EVENT_CHANGE,function(){opts.onClickContinueSelect()}),BI.createWidget({type:"bi.vtape",element:this,items:[{height:this.constants.height,el:{type:"bi.vertical_adapt",cls:"multi-select-continue-select",items:[{el:{type:"bi.label",text:BI.i18nText("BI-Selected_Data")},lgap:this.constants.lgap},{el:this.continueSelect,lgap:this.constants.lgap}]},tgap:this.constants.tgap},{height:"fill",el:this.display,tgap:this.constants.bgap}]})},setValue:function(v){this.storeValue=v||{}},empty:function(){this.display.empty()},populate:function(){this.display.populate.apply(this.display,arguments)}}),BI.shortcut("bi.multi_select_check_pane",BI.MultiSelectCheckPane),BI.DisplaySelectedList=BI.inherit(BI.Pane,{constants:{height:24,lgap:10},_defaultConfig:function(){return BI.extend(BI.DisplaySelectedList.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-display-list",itemsCreator:BI.emptyFn,items:[]})},_init:function(){BI.DisplaySelectedList.superclass._init.apply(this,arguments);var self=this,opts=this.options;this.hasNext=!1,this.button_group=BI.createWidget({type:"bi.list_pane",element:this,el:{type:"bi.loader",isDefaultInit:!1,logic:{dynamic:!0,scrolly:!0},items:this._createItems(opts.items),chooseType:BI.ButtonGroup.CHOOSE_TYPE_MULTI,layouts:[{type:"bi.vertical",lgap:10}]},itemsCreator:function(options,callback){opts.itemsCreator(options,function(ob){self.hasNext=!!ob.hasNext,callback(self._createItems(ob.items))})},hasNext:function(){return self.hasNext}})},_createItems:function(items){return BI.createItems(items,{type:"bi.icon_text_item",cls:"cursor-default check-font icon-size-12 display-list-item bi-tips",once:!0,invalid:!0,selected:!0,height:this.constants.height,logic:{dynamic:!0}})},empty:function(){this.button_group.empty()},populate:function(items){0===arguments.length?this.button_group.populate():this.button_group.populate(this._createItems(items))}}),BI.shortcut("bi.display_selected_list",BI.DisplaySelectedList),BI.MultiSelectCombo=BI.inherit(BI.Single,{_defaultConfig:function(){return BI.extend(BI.MultiSelectCombo.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-multi-select-combo",itemsCreator:BI.emptyFn,valueFormatter:BI.emptyFn,height:24,attributes:{tabIndex:0},allowEdit:!0})},_init:function(){BI.MultiSelectCombo.superclass._init.apply(this,arguments);var self=this,o=this.options,assertShowValue=function(){BI.isKey(self._startValue)&&(self.storeValue.type===BI.Selection.All?BI.remove(self.storeValue.value,self._startValue):BI.pushDistinct(self.storeValue.value,self._startValue)),self.trigger.getSearcher().setState(self.storeValue),self.numberCounter.setButtonChecked(self.storeValue)};this.storeValue=o.value||{},this._assertValue(this.storeValue),this.requesting=!1,this.trigger=BI.createWidget({type:"bi.multi_select_trigger",allowEdit:o.allowEdit,height:o.height,text:o.text,masker:{offset:{left:0,top:0,right:0,bottom:25}},valueFormatter:o.valueFormatter,itemsCreator:BI.bind(this._itemsCreator4Trigger,this),value:this.storeValue}),this.trigger.on(BI.MultiSelectTrigger.EVENT_FOCUS,function(){self.fireEvent(BI.MultiSelectCombo.EVENT_FOCUS)}),this.trigger.on(BI.MultiSelectTrigger.EVENT_BLUR,function(){self.fireEvent(BI.MultiSelectCombo.EVENT_BLUR)}),this.trigger.on(BI.MultiSelectTrigger.EVENT_START,function(){self._setStartValue(""),this.getSearcher().setValue(self.storeValue)}),this.trigger.on(BI.MultiSelectTrigger.EVENT_STOP,function(){self._setStartValue(""),self.fireEvent(BI.MultiSelectCombo.EVENT_STOP)}),this.trigger.on(BI.MultiSelectTrigger.EVENT_PAUSE,function(){if(this.getSearcher().hasMatched()){var keyword=this.getSearcher().getKeyword();self._join({type:BI.Selection.Multi,value:[keyword]},function(){self.combo.setValue(self.storeValue),self._setStartValue(keyword),assertShowValue(),self.populate(),self._setStartValue("")})}}),this.trigger.on(BI.MultiSelectTrigger.EVENT_SEARCHING,function(keywords){var last=BI.last(keywords);keywords=BI.initial(keywords||[]),keywords.length>0&&self._joinKeywords(keywords,function(){BI.isEndWithBlank(last)?(self.combo.setValue(self.storeValue),assertShowValue(),self.combo.populate(),self._setStartValue("")):(self.combo.setValue(self.storeValue),assertShowValue())}),self.fireEvent(BI.MultiSelectCombo.EVENT_SEARCHING)}),this.trigger.on(BI.MultiSelectTrigger.EVENT_CHANGE,function(value,obj){obj instanceof BI.MultiSelectBar?self._joinAll(this.getValue(),function(){assertShowValue()}):self._join(this.getValue(),function(){assertShowValue()}),self.fireEvent(BI.MultiSelectCombo.EVENT_CLICK_ITEM)}),this.trigger.on(BI.MultiSelectTrigger.EVENT_BEFORE_COUNTER_POPUPVIEW,function(){self.numberCounter.updateSelectedValue(self.storeValue)}),this.trigger.on(BI.MultiSelectTrigger.EVENT_COUNTER_CLICK,function(){self.combo.isViewVisible()||self.combo.showView()}),this.combo=BI.createWidget({type:"bi.combo",toggle:!1,container:o.container,el:this.trigger,adjustLength:1,popup:{type:"bi.multi_select_popup_view",ref:function(){self.popup=this,self.trigger.setAdapter(this),self.numberCounter.setAdapter(this)},listeners:[{eventName:BI.MultiSelectPopupView.EVENT_CHANGE,action:function(){self.storeValue=this.getValue(),self._adjust(function(){assertShowValue()}),self.fireEvent(BI.MultiSelectCombo.EVENT_CLICK_ITEM)}},{eventName:BI.MultiSelectPopupView.EVENT_CLICK_CONFIRM,action:function(){self._defaultState()}},{eventName:BI.MultiSelectPopupView.EVENT_CLICK_CLEAR,action:function(){self.setValue(),self._defaultState()}}],itemsCreator:o.itemsCreator,valueFormatter:o.valueFormatter,onLoaded:function(){BI.nextTick(function(){self.combo.adjustWidth(),self.combo.adjustHeight(),self.numberCounter.adjustView(),self.trigger.getSearcher().adjustView()})}},value:o.value,hideChecker:function(e){return 0===triggerBtn.element.find(e.target).length&&0===self.numberCounter.element.find(e.target).length}}),this.combo.on(BI.Combo.EVENT_BEFORE_POPUPVIEW,function(){this.setValue(self.storeValue),BI.nextTick(function(){self.populate()})}),this.wants2Quit=!1,this.combo.on(BI.Combo.EVENT_AFTER_HIDEVIEW,function(){self._stopEditing(),self.requesting===!0?self.wants2Quit=!0:self.fireEvent(BI.MultiSelectCombo.EVENT_CONFIRM)});var triggerBtn=BI.createWidget({type:"bi.trigger_icon_button",width:o.height,height:o.height,cls:"multi-select-trigger-icon-button"});triggerBtn.on(BI.TriggerIconButton.EVENT_CHANGE,function(){self.numberCounter.hideView(),self.combo.isViewVisible()?self.combo.hideView():self.combo.showView()}),this.numberCounter=BI.createWidget({type:"bi.multi_select_check_selected_switcher",masker:{offset:{left:0,top:0,right:0,bottom:25}},valueFormatter:o.valueFormatter,itemsCreator:BI.bind(this._itemsCreator4Trigger,this),value:this.storeValue}),this.numberCounter.on(BI.MultiSelectCheckSelectedSwitcher.EVENT_TRIGGER_CHANGE,function(){self.combo.isViewVisible()||self.combo.showView()}),this.numberCounter.on(BI.MultiSelectCheckSelectedSwitcher.EVENT_BEFORE_POPUPVIEW,function(){this.updateSelectedValue(self.storeValue)}),this.numberCounter.on(BI.Events.VIEW,function(b){BI.nextTick(function(){self.trigger.refreshPlaceHolderWidth(b===!0?self.numberCounter.element.outerWidth()+8:0)})}),this.trigger.element.click(function(e){self.trigger.element.find(e.target).length>0&&self.numberCounter.hideView()}),BI.createWidget({type:"bi.absolute",element:this,items:[{el:this.combo,left:0,right:0,top:0,bottom:0},{el:triggerBtn,right:0,top:0,bottom:0},{el:{type:"bi.vertical_adapt",items:[this.numberCounter]},right:o.height,top:0,height:o.height}]})},_itemsCreator4Trigger:function(op,callback){var self=this,o=this.options;o.itemsCreator(op,function(res){1===op.times&&BI.isNotNull(op.keywords)&&self.trigger.setValue(BI.deepClone(self.getValue())),callback.apply(self,arguments)})},_stopEditing:function(){this.trigger.stopEditing(),this.numberCounter.hideView()},_defaultState:function(){this._stopEditing(),this.combo.hideView()},_assertValue:function(val){val||(val={}),val.type||(val.type=BI.Selection.Multi),val.value||(val.value=[])},_makeMap:function(values){return BI.makeObject(values||[])},_joinKeywords:function(keywords,callback){function digest(items){var selectedMap=self._makeMap(items);BI.each(keywords,function(i,val){BI.isNotNull(selectedMap[val])&&(self.storeValue.type===BI.Selection.Multi?BI.pushDistinct(self.storeValue.value,val):BI.remove(self.storeValue.value,val))}),self._adjust(callback)}var self=this,o=this.options;this._assertValue(this.storeValue),this.requesting=!0,o.itemsCreator({type:BI.MultiSelectCombo.REQ_GET_ALL_DATA,keywords:keywords},function(ob){var values=BI.map(ob.items,"value");digest(values)})},_joinAll:function(res,callback){var self=this,o=this.options;this._assertValue(res),this.requesting=!0,o.itemsCreator({type:BI.MultiSelectCombo.REQ_GET_ALL_DATA,keywords:[this.trigger.getKey()]},function(ob){var items=BI.map(ob.items,"value");if(self.storeValue.type===res.type){var change=!1,map=self._makeMap(self.storeValue.value);return BI.each(items,function(i,v){BI.isNotNull(map[v])&&(change=!0,self.storeValue.assist&&self.storeValue.assist.push(map[v]),delete map[v])}),change&&(self.storeValue.value=BI.values(map)),void self._adjust(callback)}var selectedMap=self._makeMap(self.storeValue.value),notSelectedMap=self._makeMap(res.value),newItems=[];BI.each(items,function(i,item){BI.isNotNull(selectedMap[items[i]])&&(self.storeValue.assist&&self.storeValue.assist.push(selectedMap[items[i]]),delete selectedMap[items[i]]),BI.isNull(notSelectedMap[items[i]])&&(BI.remove(self.storeValue.assist,item),newItems.push(item))}),self.storeValue.value=newItems.concat(BI.values(selectedMap)),self._adjust(callback)})},_adjust:function(callback){function adjust(){self.wants2Quit===!0&&(self.fireEvent(BI.MultiSelectCombo.EVENT_CONFIRM),self.wants2Quit=!1),self.requesting=!1}var self=this,o=this.options;adjust(),callback()},_join:function(res,callback){var self=this,o=this.options;if(this._assertValue(res),this._assertValue(this.storeValue),this.storeValue.type===res.type){var map=this._makeMap(this.storeValue.value);BI.each(res.value,function(i,v){map[v]||(self.storeValue.value.push(v),BI.remove(self.storeValue.assist,v),map[v]=v)});var change=!1;return BI.each(res.assist,function(i,v){BI.isNotNull(map[v])&&(change=!0,self.storeValue.assist&&self.storeValue.assist.push(map[v]),delete map[v])}),change&&(this.storeValue.value=BI.values(map)),void self._adjust(callback)}this._joinAll(res,callback)},_setStartValue:function(value){this._startValue=value,this.popup.setStartValue(value)},setValue:function(v){this.storeValue=v||{},this._assertValue(this.storeValue),this.combo.setValue(this.storeValue),this.numberCounter.setValue(this.storeValue)},getValue:function(){return BI.deepClone(this.storeValue)},populate:function(){this.combo.populate.apply(this.combo,arguments)}}),BI.extend(BI.MultiSelectCombo,{REQ_GET_DATA_LENGTH:1,REQ_GET_ALL_DATA:-1}),BI.MultiSelectCombo.EVENT_BLUR="EVENT_BLUR",BI.MultiSelectCombo.EVENT_FOCUS="EVENT_FOCUS",BI.MultiSelectCombo.EVENT_STOP="EVENT_STOP",BI.MultiSelectCombo.EVENT_SEARCHING="EVENT_SEARCHING",BI.MultiSelectCombo.EVENT_CLICK_ITEM="EVENT_CLICK_ITEM",BI.MultiSelectCombo.EVENT_CONFIRM="EVENT_CONFIRM",BI.shortcut("bi.multi_select_combo",BI.MultiSelectCombo),BI.MultiSelectInsertCombo=BI.inherit(BI.Single,{_defaultConfig:function(){return BI.extend(BI.MultiSelectInsertCombo.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-multi-select-insert-combo",itemsCreator:BI.emptyFn,valueFormatter:BI.emptyFn,height:24,attributes:{tabIndex:0},allowEdit:!0})},_init:function(){BI.MultiSelectInsertCombo.superclass._init.apply(this,arguments);var self=this,o=this.options,assertShowValue=function(){BI.isKey(self._startValue)&&(self.storeValue.type===BI.Selection.All?BI.remove(self.storeValue.value,self._startValue):BI.pushDistinct(self.storeValue.value,self._startValue)),self.trigger.getSearcher().setState(self.storeValue),self.numberCounter.setButtonChecked(self.storeValue)};this.storeValue=o.value||{},this.requesting=!1,this.trigger=BI.createWidget({type:"bi.multi_select_insert_trigger",allowEdit:o.allowEdit,height:o.height,text:o.text,watermark:o.watermark,masker:{offset:{left:0,top:0,right:0,bottom:25}},valueFormatter:o.valueFormatter,itemsCreator:BI.bind(this._itemsCreator4Trigger,this),value:o.value}),this.trigger.on(BI.MultiSelectInsertTrigger.EVENT_FOCUS,function(){self.fireEvent(BI.MultiSelectInsertCombo.EVENT_FOCUS)}),this.trigger.on(BI.MultiSelectInsertTrigger.EVENT_BLUR,function(){self.fireEvent(BI.MultiSelectInsertCombo.EVENT_BLUR)}),this.trigger.on(BI.MultiSelectInsertTrigger.EVENT_START,function(){self._setStartValue(""),this.getSearcher().setValue(self.storeValue)}),this.trigger.on(BI.MultiSelectInsertTrigger.EVENT_STOP,function(){self._setStartValue(""),self.fireEvent(BI.MultiSelectInsertCombo.EVENT_STOP)}),this.trigger.on(BI.MultiSelectInsertTrigger.EVENT_PAUSE,function(){this.getSearcher().hasMatched()&&self._addItem(assertShowValue)}),this.trigger.on(BI.MultiSelectInsertTrigger.EVENT_ADD_ITEM,function(){this.getSearcher().hasMatched()||(self._addItem(assertShowValue),self._stopEditing())}),this.trigger.on(BI.MultiSelectInsertTrigger.EVENT_SEARCHING,function(keywords){var last=BI.last(keywords);keywords=BI.initial(keywords||[]),keywords.length>0&&self._joinKeywords(keywords,function(){BI.isEndWithBlank(last)?(self.combo.setValue(self.storeValue),assertShowValue(),self.combo.populate(),self._setStartValue("")):(self.combo.setValue(self.storeValue),assertShowValue())}),self.fireEvent(BI.MultiSelectInsertCombo.EVENT_SEARCHING)}),this.trigger.on(BI.MultiSelectInsertTrigger.EVENT_CHANGE,function(value,obj){obj instanceof BI.MultiSelectBar?self._joinAll(this.getValue(),function(){assertShowValue()}):self._join(this.getValue(),function(){assertShowValue()}),self.fireEvent(BI.MultiSelectInsertCombo.EVENT_CLICK_ITEM)}),this.trigger.on(BI.MultiSelectInsertTrigger.EVENT_BEFORE_COUNTER_POPUPVIEW,function(){self.numberCounter.updateSelectedValue(self.storeValue)}),this.trigger.on(BI.MultiSelectInsertTrigger.EVENT_COUNTER_CLICK,function(){self.combo.isViewVisible()||self.combo.showView()}),this.combo=BI.createWidget({type:"bi.combo",toggle:!1,el:this.trigger,adjustLength:1,container:o.container,popup:{type:"bi.multi_select_popup_view",ref:function(){self.popup=this,self.trigger.setAdapter(this),self.numberCounter.setAdapter(this)},listeners:[{eventName:BI.MultiSelectPopupView.EVENT_CHANGE,action:function(){self.storeValue=this.getValue(),self._adjust(function(){assertShowValue()}),self.fireEvent(BI.MultiSelectInsertCombo.EVENT_CLICK_ITEM)}},{eventName:BI.MultiSelectPopupView.EVENT_CLICK_CONFIRM,action:function(){self._defaultState()}},{eventName:BI.MultiSelectPopupView.EVENT_CLICK_CLEAR,action:function(){self.setValue(),self._defaultState()}}],itemsCreator:o.itemsCreator,valueFormatter:o.valueFormatter,onLoaded:function(){BI.nextTick(function(){self.combo.adjustWidth(),self.combo.adjustHeight(),self.numberCounter.adjustView(),self.trigger.getSearcher().adjustView()})}},value:o.value,hideChecker:function(e){return 0===triggerBtn.element.find(e.target).length&&0===self.numberCounter.element.find(e.target).length}}),this.combo.on(BI.Combo.EVENT_BEFORE_POPUPVIEW,function(){this.setValue(self.storeValue),BI.nextTick(function(){self.populate()})}),this.wants2Quit=!1,this.combo.on(BI.Combo.EVENT_AFTER_HIDEVIEW,function(){self._stopEditing(),self.requesting===!0?self.wants2Quit=!0:self.fireEvent(BI.MultiSelectInsertCombo.EVENT_CONFIRM)});var triggerBtn=BI.createWidget({type:"bi.trigger_icon_button",width:o.height,height:o.height,cls:"multi-select-trigger-icon-button"});triggerBtn.on(BI.TriggerIconButton.EVENT_CHANGE,function(){self.numberCounter.hideView(),self.combo.isViewVisible()?self.combo.hideView():self.combo.showView()}),this.numberCounter=BI.createWidget({type:"bi.multi_select_check_selected_switcher",masker:{offset:{left:0,top:0,right:0,bottom:25}},valueFormatter:o.valueFormatter,itemsCreator:BI.bind(this._itemsCreator4Trigger,this),value:o.value}),this.numberCounter.on(BI.MultiSelectCheckSelectedSwitcher.EVENT_TRIGGER_CHANGE,function(){self.combo.isViewVisible()||self.combo.showView()}),this.numberCounter.on(BI.MultiSelectCheckSelectedSwitcher.EVENT_BEFORE_POPUPVIEW,function(){this.updateSelectedValue(self.storeValue)}),this.numberCounter.on(BI.Events.VIEW,function(b){BI.nextTick(function(){self.trigger.refreshPlaceHolderWidth(b===!0?self.numberCounter.element.outerWidth()+8:0)})}),this.trigger.element.click(function(e){self.trigger.element.find(e.target).length>0&&self.numberCounter.hideView()}),BI.createWidget({type:"bi.absolute",element:this,items:[{el:this.combo,left:0,right:0,top:0,bottom:0},{el:triggerBtn,right:0,top:0,bottom:0},{el:{type:"bi.vertical_adapt",items:[this.numberCounter]},right:o.height,top:0,height:o.height}]})},_itemsCreator4Trigger:function(op,callback){var self=this,o=this.options;o.itemsCreator(op,function(res){1===op.times&&BI.isNotNull(op.keywords)&&self.trigger.setValue(BI.deepClone(self.getValue())),callback.apply(self,arguments)})},_addItem:function(assertShowValue){var self=this,keyword=this.trigger.getSearcher().getKeyword();this._join({type:BI.Selection.Multi,value:[keyword]},function(){self.storeValue.type===BI.Selection.Multi&&BI.pushDistinct(self.storeValue.value,keyword),self.combo.setValue(self.storeValue),self._setStartValue(keyword),assertShowValue(),self.populate(),self._setStartValue("")})},_stopEditing:function(){this.trigger.stopEditing(),this.numberCounter.hideView()},_defaultState:function(){this._stopEditing(),this.combo.hideView()},_assertValue:function(val){val||(val={}),val.type||(val.type=BI.Selection.Multi),val.value||(val.value=[])},_makeMap:function(values){return BI.makeObject(values||[])},_joinKeywords:function(keywords,callback){function digest(items){var selectedMap=self._makeMap(items);BI.each(keywords,function(i,val){BI.isNotNull(selectedMap[val])&&(self.storeValue.type===BI.Selection.Multi?BI.pushDistinct(self.storeValue.value,val):BI.remove(self.storeValue.value,val))}),self._adjust(callback)}var self=this,o=this.options;this._assertValue(this.storeValue),this.requesting=!0,o.itemsCreator({type:BI.MultiSelectInsertCombo.REQ_GET_ALL_DATA,keywords:keywords},function(ob){var values=BI.map(ob.items,"value");digest(values)})},_joinAll:function(res,callback){var self=this,o=this.options;this._assertValue(res),this.requesting=!0,o.itemsCreator({type:BI.MultiSelectInsertCombo.REQ_GET_ALL_DATA,keywords:[this.trigger.getKey()]},function(ob){var items=BI.map(ob.items,"value");if(self.storeValue.type===res.type){var change=!1,map=self._makeMap(self.storeValue.value);return BI.each(items,function(i,v){BI.isNotNull(map[v])&&(change=!0,self.storeValue.assist&&self.storeValue.assist.push(map[v]),delete map[v])}),change&&(self.storeValue.value=BI.values(map)),void self._adjust(callback)}var selectedMap=self._makeMap(self.storeValue.value),notSelectedMap=self._makeMap(res.value),newItems=[];BI.each(items,function(i,item){BI.isNotNull(selectedMap[items[i]])&&(self.storeValue.assist&&self.storeValue.assist.push(selectedMap[items[i]]),delete selectedMap[items[i]]),BI.isNull(notSelectedMap[items[i]])&&(BI.remove(self.storeValue.assist,item),newItems.push(item))}),self.storeValue.value=newItems.concat(BI.values(selectedMap)),self._adjust(callback)})},_adjust:function(callback){function adjust(){self.wants2Quit===!0&&(self.fireEvent(BI.MultiSelectInsertCombo.EVENT_CONFIRM),self.wants2Quit=!1),self.requesting=!1}var self=this,o=this.options;adjust(),callback()},_join:function(res,callback){var self=this,o=this.options;if(this._assertValue(res),this._assertValue(this.storeValue),this.storeValue.type===res.type){var map=this._makeMap(this.storeValue.value);BI.each(res.value,function(i,v){map[v]||(self.storeValue.value.push(v),BI.remove(self.storeValue.assist,v),map[v]=v)});var change=!1;return BI.each(res.assist,function(i,v){BI.isNotNull(map[v])&&(change=!0,self.storeValue.assist&&self.storeValue.assist.push(map[v]),delete map[v])}),change&&(this.storeValue.value=BI.values(map)),void self._adjust(callback)}this._joinAll(res,callback)},_setStartValue:function(value){this._startValue=value,this.popup.setStartValue(value)},setValue:function(v){this.storeValue=v||{},this._assertValue(this.storeValue),this.combo.setValue(this.storeValue),this.numberCounter.setValue(this.storeValue)},getValue:function(){return BI.deepClone(this.storeValue)},populate:function(){this.combo.populate.apply(this.combo,arguments)}}),BI.extend(BI.MultiSelectInsertCombo,{REQ_GET_DATA_LENGTH:1,REQ_GET_ALL_DATA:-1}),BI.MultiSelectInsertCombo.EVENT_FOCUS="EVENT_FOCUS",BI.MultiSelectInsertCombo.EVENT_BLUR="EVENT_BLUR",BI.MultiSelectInsertCombo.EVENT_STOP="EVENT_STOP",BI.MultiSelectInsertCombo.EVENT_SEARCHING="EVENT_SEARCHING",BI.MultiSelectInsertCombo.EVENT_CLICK_ITEM="EVENT_CLICK_ITEM",BI.MultiSelectInsertCombo.EVENT_CONFIRM="EVENT_CONFIRM",BI.shortcut("bi.multi_select_insert_combo",BI.MultiSelectInsertCombo),BI.MultiSelectInsertNoBarCombo=BI.inherit(BI.Single,{_defaultConfig:function(){return BI.extend(BI.MultiSelectInsertNoBarCombo.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-multi-select-insert-combo",itemsCreator:BI.emptyFn,valueFormatter:BI.emptyFn,height:24,attributes:{tabIndex:0}})},_init:function(){BI.MultiSelectInsertNoBarCombo.superclass._init.apply(this,arguments);var self=this,o=this.options,assertShowValue=function(){BI.isKey(self._startValue)&&(self.storeValue.type===BI.Selection.All?BI.remove(self.storeValue.value,self._startValue):BI.pushDistinct(self.storeValue.value,self._startValue)),self.trigger.getSearcher().setState(self.storeValue),self.numberCounter.setButtonChecked(self.storeValue)};this.storeValue={type:BI.Selection.Multi,value:o.value||[]},this.requesting=!1,this.trigger=BI.createWidget({type:"bi.multi_select_insert_trigger",height:o.height,text:o.text,masker:{offset:{left:0,top:0,right:0,bottom:25}},valueFormatter:o.valueFormatter,itemsCreator:BI.bind(this._itemsCreator4Trigger,this),value:{type:BI.Selection.Multi,value:o.value}}),this.trigger.on(BI.MultiSelectInsertTrigger.EVENT_START,function(){self._setStartValue(""),this.getSearcher().setValue(self.storeValue)}),this.trigger.on(BI.MultiSelectInsertTrigger.EVENT_STOP,function(){self._setStartValue("")}),this.trigger.on(BI.MultiSelectInsertTrigger.EVENT_PAUSE,function(){this.getSearcher().hasMatched()&&self._addItem(assertShowValue)}),this.trigger.on(BI.MultiSelectInsertTrigger.EVENT_ADD_ITEM,function(){this.getSearcher().hasMatched()||(self._addItem(assertShowValue),self._stopEditing())}),this.trigger.on(BI.MultiSelectInsertTrigger.EVENT_SEARCHING,function(keywords){ +var last=BI.last(keywords);keywords=BI.initial(keywords||[]),keywords.length>0&&self._joinKeywords(keywords,function(){BI.isEndWithBlank(last)?(self.combo.setValue(self.storeValue),assertShowValue(),self.combo.populate(),self._setStartValue("")):(self.combo.setValue(self.storeValue),assertShowValue())})}),this.trigger.on(BI.MultiSelectInsertTrigger.EVENT_CHANGE,function(value,obj){obj instanceof BI.MultiSelectBar?self._joinAll(this.getValue(),function(){assertShowValue()}):self._join(this.getValue(),function(){assertShowValue()})}),this.trigger.on(BI.MultiSelectInsertTrigger.EVENT_BEFORE_COUNTER_POPUPVIEW,function(){self.numberCounter.updateSelectedValue(self.storeValue)}),this.trigger.on(BI.MultiSelectInsertTrigger.EVENT_COUNTER_CLICK,function(){self.combo.isViewVisible()||self.combo.showView()}),this.combo=BI.createWidget({type:"bi.combo",toggle:!1,container:o.container,el:this.trigger,adjustLength:1,popup:{type:"bi.multi_select_no_bar_popup_view",ref:function(){self.popup=this,self.trigger.setAdapter(this),self.numberCounter.setAdapter(this)},listeners:[{eventName:BI.MultiSelectPopupView.EVENT_CHANGE,action:function(){self.storeValue=this.getValue(),self._adjust(function(){assertShowValue()})}},{eventName:BI.MultiSelectPopupView.EVENT_CLICK_CONFIRM,action:function(){self._defaultState()}},{eventName:BI.MultiSelectPopupView.EVENT_CLICK_CLEAR,action:function(){self.setValue(),self._defaultState()}}],itemsCreator:o.itemsCreator,valueFormatter:o.valueFormatter,onLoaded:function(){BI.nextTick(function(){self.combo.adjustWidth(),self.combo.adjustHeight(),self.numberCounter.adjustView(),self.trigger.getSearcher().adjustView()})}},value:{type:BI.Selection.Multi,value:o.value},hideChecker:function(e){return 0===triggerBtn.element.find(e.target).length&&0===self.numberCounter.element.find(e.target).length}}),this.combo.on(BI.Combo.EVENT_BEFORE_POPUPVIEW,function(){this.setValue(self.storeValue),BI.nextTick(function(){self.populate()})}),this.wants2Quit=!1,this.combo.on(BI.Combo.EVENT_AFTER_HIDEVIEW,function(){self._stopEditing(),self.requesting===!0?self.wants2Quit=!0:self.fireEvent(BI.MultiSelectInsertNoBarCombo.EVENT_CONFIRM)});var triggerBtn=BI.createWidget({type:"bi.trigger_icon_button",width:o.height,height:o.height,cls:"multi-select-trigger-icon-button"});triggerBtn.on(BI.TriggerIconButton.EVENT_CHANGE,function(){self.numberCounter.hideView(),self.combo.isViewVisible()?self.combo.hideView():self.combo.showView()}),this.numberCounter=BI.createWidget({type:"bi.multi_select_check_selected_switcher",masker:{offset:{left:0,top:0,right:0,bottom:25}},valueFormatter:o.valueFormatter,itemsCreator:BI.bind(this._itemsCreator4Trigger,this),value:{type:BI.Selection.Multi,value:o.value}}),this.numberCounter.on(BI.MultiSelectCheckSelectedSwitcher.EVENT_TRIGGER_CHANGE,function(){self.combo.isViewVisible()||self.combo.showView()}),this.numberCounter.on(BI.MultiSelectCheckSelectedSwitcher.EVENT_BEFORE_POPUPVIEW,function(){this.updateSelectedValue(self.storeValue)}),this.numberCounter.on(BI.Events.VIEW,function(b){BI.nextTick(function(){self.trigger.refreshPlaceHolderWidth(b===!0?self.numberCounter.element.outerWidth()+8:0)})}),this.trigger.element.click(function(e){self.trigger.element.find(e.target).length>0&&self.numberCounter.hideView()}),BI.createWidget({type:"bi.absolute",element:this,items:[{el:this.combo,left:0,right:0,top:0,bottom:0},{el:triggerBtn,right:0,top:0,bottom:0},{el:{type:"bi.vertical_adapt",items:[this.numberCounter]},right:o.height,top:0,height:o.height}]})},_itemsCreator4Trigger:function(op,callback){var self=this,o=this.options;o.itemsCreator(op,function(res){1===op.times&&BI.isNotNull(op.keywords)&&self.trigger.setValue(BI.deepClone(self.getValue())),callback.apply(self,arguments)})},_addItem:function(assertShowValue){var self=this,keyword=this.trigger.getSearcher().getKeyword();this._join({type:BI.Selection.Multi,value:[keyword]},function(){self.storeValue.type===BI.Selection.Multi&&BI.pushDistinct(self.storeValue.value,keyword),self.combo.setValue(self.storeValue),self._setStartValue(keyword),assertShowValue(),self.populate(),self._setStartValue("")})},_stopEditing:function(){this.trigger.stopEditing(),this.numberCounter.hideView()},_defaultState:function(){this._stopEditing(),this.combo.hideView()},_assertValue:function(val){val||(val={}),val.type||(val.type=BI.Selection.Multi),val.value||(val.value=[])},_makeMap:function(values){return BI.makeObject(values||[])},_joinKeywords:function(keywords,callback){function digest(items){var selectedMap=self._makeMap(items);BI.each(keywords,function(i,val){BI.isNotNull(selectedMap[val])&&(self.storeValue.type===BI.Selection.Multi?BI.pushDistinct(self.storeValue.value,val):BI.remove(self.storeValue.value,val))}),self._adjust(callback)}var self=this,o=this.options;this._assertValue(this.storeValue),this.requesting=!0,o.itemsCreator({type:BI.MultiSelectInsertNoBarCombo.REQ_GET_ALL_DATA,keywords:keywords},function(ob){var values=BI.map(ob.items,"value");digest(values)})},_joinAll:function(res,callback){var self=this,o=this.options;this._assertValue(res),this.requesting=!0,o.itemsCreator({type:BI.MultiSelectInsertNoBarCombo.REQ_GET_ALL_DATA,keywords:[this.trigger.getKey()]},function(ob){var items=BI.map(ob.items,"value");if(self.storeValue.type===res.type){var change=!1,map=self._makeMap(self.storeValue.value);return BI.each(items,function(i,v){BI.isNotNull(map[v])&&(change=!0,self.storeValue.assist&&self.storeValue.assist.push(map[v]),delete map[v])}),change&&(self.storeValue.value=BI.values(map)),void self._adjust(callback)}var selectedMap=self._makeMap(self.storeValue.value),notSelectedMap=self._makeMap(res.value),newItems=[];BI.each(items,function(i,item){BI.isNotNull(selectedMap[items[i]])&&(self.storeValue.assist&&self.storeValue.assist.push(selectedMap[items[i]]),delete selectedMap[items[i]]),BI.isNull(notSelectedMap[items[i]])&&(BI.remove(self.storeValue.assist,item),newItems.push(item))}),self.storeValue.value=newItems.concat(BI.values(selectedMap)),self._adjust(callback)})},_adjust:function(callback){function adjust(){self.wants2Quit===!0&&(self.fireEvent(BI.MultiSelectInsertNoBarCombo.EVENT_CONFIRM),self.wants2Quit=!1),self.requesting=!1}var self=this,o=this.options;adjust(),callback()},_join:function(res,callback){var self=this,o=this.options;if(this._assertValue(res),this._assertValue(this.storeValue),this.storeValue.type===res.type){var map=this._makeMap(this.storeValue.value);BI.each(res.value,function(i,v){map[v]||(self.storeValue.value.push(v),BI.remove(self.storeValue.assist,v),map[v]=v)});var change=!1;return BI.each(res.assist,function(i,v){BI.isNotNull(map[v])&&(change=!0,self.storeValue.assist&&self.storeValue.assist.push(map[v]),delete map[v])}),change&&(this.storeValue.value=BI.values(map)),void self._adjust(callback)}this._joinAll(res,callback)},_setStartValue:function(value){this._startValue=value,this.popup.setStartValue(value)},setValue:function(v){this.storeValue={type:BI.Selection.Multi,value:v||[]},this.combo.setValue(this.storeValue),this.numberCounter.setValue(this.storeValue)},getValue:function(){return BI.deepClone(this.storeValue.value)},populate:function(){this.combo.populate.apply(this.combo,arguments)}}),BI.extend(BI.MultiSelectInsertNoBarCombo,{REQ_GET_DATA_LENGTH:1,REQ_GET_ALL_DATA:-1}),BI.MultiSelectInsertNoBarCombo.EVENT_CONFIRM="EVENT_CONFIRM",BI.shortcut("bi.multi_select_insert_no_bar_combo",BI.MultiSelectInsertNoBarCombo),BI.MultiSelectInsertTrigger=BI.inherit(BI.Trigger,{constants:{height:14,rgap:4,lgap:4},_defaultConfig:function(){return BI.extend(BI.MultiSelectInsertTrigger.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-multi-select-trigger bi-border bi-border-radius",itemsCreator:BI.emptyFn,valueFormatter:BI.emptyFn,searcher:{},switcher:{},adapter:null,masker:{},allowEdit:!0})},_init:function(){BI.MultiSelectInsertTrigger.superclass._init.apply(this,arguments);var self=this,o=this.options;o.height&&this.setHeight(o.height-2),this.searcher=BI.createWidget(o.searcher,{type:"bi.multi_select_insert_searcher",height:o.height,text:o.text,itemsCreator:o.itemsCreator,valueFormatter:o.valueFormatter,watermark:o.watermark,popup:{},adapter:o.adapter,masker:o.masker,value:o.value}),this.searcher.on(BI.MultiSelectInsertSearcher.EVENT_START,function(){self.fireEvent(BI.MultiSelectInsertTrigger.EVENT_START)}),this.searcher.on(BI.MultiSelectInsertSearcher.EVENT_ADD_ITEM,function(){self.fireEvent(BI.MultiSelectInsertTrigger.EVENT_ADD_ITEM)}),this.searcher.on(BI.MultiSelectInsertSearcher.EVENT_PAUSE,function(){self.fireEvent(BI.MultiSelectInsertTrigger.EVENT_PAUSE)}),this.searcher.on(BI.MultiSelectInsertSearcher.EVENT_SEARCHING,function(){self.fireEvent(BI.MultiSelectInsertTrigger.EVENT_SEARCHING,arguments)}),this.searcher.on(BI.MultiSelectInsertSearcher.EVENT_STOP,function(){self.fireEvent(BI.MultiSelectInsertTrigger.EVENT_STOP)}),this.searcher.on(BI.MultiSelectInsertSearcher.EVENT_CHANGE,function(){self.fireEvent(BI.MultiSelectInsertTrigger.EVENT_CHANGE,arguments)}),this.searcher.on(BI.MultiSelectInsertSearcher.EVENT_BLUR,function(){self.fireEvent(BI.MultiSelectInsertTrigger.EVENT_BLUR)}),this.searcher.on(BI.MultiSelectInsertSearcher.EVENT_FOCUS,function(){self.fireEvent(BI.MultiSelectInsertTrigger.EVENT_FOCUS)}),this.wrapNumberCounter=BI.createWidget({type:"bi.layout"}),this.wrapper=BI.createWidget({type:"bi.htape",element:this,items:[{el:this.searcher,width:"fill"},{el:this.wrapNumberCounter,width:0},{el:BI.createWidget(),width:24}]}),!o.allowEdit&&BI.createWidget({type:"bi.absolute",element:this,items:[{el:{type:"bi.layout"},left:0,right:24,top:0,bottom:0}]})},refreshPlaceHolderWidth:function(width){this.wrapper.attr("items")[1].width=width,this.wrapper.resize()},getSearcher:function(){return this.searcher},stopEditing:function(){this.searcher.stopSearch()},setAdapter:function(adapter){this.searcher.setAdapter(adapter)},setValue:function(ob){this.searcher.setValue(ob)},getKey:function(){return this.searcher.getKey()},getValue:function(){return this.searcher.getValue()}}),BI.MultiSelectInsertTrigger.EVENT_TRIGGER_CLICK="EVENT_TRIGGER_CLICK",BI.MultiSelectInsertTrigger.EVENT_COUNTER_CLICK="EVENT_COUNTER_CLICK",BI.MultiSelectInsertTrigger.EVENT_CHANGE="EVENT_CHANGE",BI.MultiSelectInsertTrigger.EVENT_START="EVENT_START",BI.MultiSelectInsertTrigger.EVENT_STOP="EVENT_STOP",BI.MultiSelectInsertTrigger.EVENT_PAUSE="EVENT_PAUSE",BI.MultiSelectInsertTrigger.EVENT_SEARCHING="EVENT_SEARCHING",BI.MultiSelectInsertTrigger.EVENT_BEFORE_COUNTER_POPUPVIEW="EVENT_BEFORE_COUNTER_POPUPVIEW",BI.MultiSelectInsertTrigger.EVENT_ADD_ITEM="EVENT_ADD_ITEM",BI.MultiSelectInsertTrigger.EVENT_FOCUS="EVENT_FOCUS",BI.MultiSelectInsertTrigger.EVENT_BLUR="EVENT_BLUR",BI.shortcut("bi.multi_select_insert_trigger",BI.MultiSelectInsertTrigger),BI.MultiSelectLoader=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.MultiSelectLoader.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-multi-select-loader",logic:{dynamic:!0},el:{height:400},valueFormatter:BI.emptyFn,itemsCreator:BI.emptyFn,onLoaded:BI.emptyFn})},_init:function(){BI.MultiSelectLoader.superclass._init.apply(this,arguments);var self=this,opts=this.options,hasNext=!1;this.storeValue=opts.value||{},this._assertValue(this.storeValue),this.button_group=BI.createWidget({type:"bi.select_list",logic:opts.logic,toolbar:{type:"bi.multi_select_bar",cls:"bi-list-item-active",iconWrapperWidth:36},el:BI.extend({onLoaded:opts.onLoaded,el:{type:"bi.loader",isDefaultInit:!1,logic:{dynamic:!0,scrolly:!0},el:{chooseType:BI.ButtonGroup.CHOOSE_TYPE_MULTI,behaviors:{redmark:function(){return!0}},layouts:[{type:"bi.vertical"}]}}},opts.el),itemsCreator:function(op,callback){var startValue=self._startValue;self.storeValue&&(op=BI.extend(op||{},{selectedValues:BI.isKey(startValue)&&self.storeValue.type===BI.Selection.Multi?self.storeValue.value.concat(startValue):self.storeValue.value})),opts.itemsCreator(op,function(ob){hasNext=ob.hasNext;var firstItems=[];if(1===op.times&&self.storeValue){var json=BI.map(self.storeValue.value,function(i,v){var txt=opts.valueFormatter(v)||v;return{text:txt,value:v,title:txt,selected:self.storeValue.type===BI.Selection.Multi}});if(BI.isKey(self._startValue)&&!BI.contains(self.storeValue.value,self._startValue)){var txt=opts.valueFormatter(startValue)||startValue;json.unshift({text:txt,value:startValue,title:txt,selected:!0})}firstItems=self._createItems(json)}callback(firstItems.concat(self._createItems(ob.items)),ob.keyword||""),1===op.times&&self.storeValue&&(BI.isKey(startValue)&&(self.storeValue.type===BI.Selection.All?BI.remove(self.storeValue.value,startValue):BI.pushDistinct(self.storeValue.value,startValue)),self.setValue(self.storeValue)),1===op.times&&self._scrollToTop()})},hasNext:function(){return hasNext},value:this.storeValue}),BI.createWidget(BI.extend({element:this},BI.LogicFactory.createLogic(BI.LogicFactory.createLogicTypeByDirection(BI.Direction.Top),BI.extend({scrolly:!0,vgap:5},opts.logic,{items:BI.LogicFactory.createLogicItemsByDirection(BI.Direction.Top,this.button_group)})))),this.button_group.on(BI.Controller.EVENT_CHANGE,function(){self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.button_group.on(BI.SelectList.EVENT_CHANGE,function(){self.fireEvent(BI.MultiSelectLoader.EVENT_CHANGE,arguments)})},_createItems:function(items){return BI.createItems(items,{type:"bi.multi_select_item",logic:this.options.logic,cls:"bi-list-item-active",height:24,selected:this.isAllSelected(),iconWrapperWidth:36})},_scrollToTop:function(){var self=this;BI.delay(function(){self.button_group.element.scrollTop(0)},30)},isAllSelected:function(){return this.button_group.isAllSelected()},_assertValue:function(val){val||(val={}),val.type||(val.type=BI.Selection.Multi),val.value||(val.value=[])},setStartValue:function(v){this._startValue=v},setValue:function(v){this.storeValue=v||{},this._assertValue(this.storeValue),this.button_group.setValue(this.storeValue)},getValue:function(){return this.button_group.getValue()},getAllButtons:function(){return this.button_group.getAllButtons()},empty:function(){this.button_group.empty()},populate:function(items){arguments[0]=this._createItems(items),this.button_group.populate.apply(this.button_group,arguments)},resetHeight:function(h){this.button_group.resetHeight(h-10)},resetWidth:function(w){this.button_group.resetWidth(w)}}),BI.MultiSelectLoader.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.multi_select_loader",BI.MultiSelectLoader),BI.MultiSelectNoBarLoader=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.MultiSelectNoBarLoader.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-multi-select-loader",logic:{dynamic:!0},el:{height:400},valueFormatter:BI.emptyFn,itemsCreator:BI.emptyFn,onLoaded:BI.emptyFn})},_init:function(){BI.MultiSelectNoBarLoader.superclass._init.apply(this,arguments);var self=this,opts=this.options,hasNext=!1;this.storeValue=opts.value||{},this._assertValue(this.storeValue),this.button_group=BI.createWidget(BI.extend({type:"bi.list_pane",onLoaded:opts.onLoaded,el:{type:"bi.loader",isDefaultInit:!1,logic:{dynamic:!0,scrolly:!0},el:{chooseType:BI.ButtonGroup.CHOOSE_TYPE_MULTI,behaviors:{redmark:function(){return!0}},layouts:[{type:"bi.vertical"}]}},itemsCreator:function(op,callback){var startValue=self._startValue;self.storeValue&&(op=BI.extend(op||{},{selectedValues:BI.isKey(startValue)&&self.storeValue.type===BI.Selection.Multi?self.storeValue.value.concat(startValue):self.storeValue.value})),opts.itemsCreator(op,function(ob){hasNext=ob.hasNext;var firstItems=[];if(1===op.times&&self.storeValue){var json=BI.map(self.storeValue.value,function(i,v){var txt=opts.valueFormatter(v)||v;return{text:txt,value:v,title:txt,selected:self.storeValue.type===BI.Selection.Multi}});if(BI.isKey(self._startValue)&&!BI.contains(self.storeValue.value,self._startValue)){var txt=opts.valueFormatter(startValue)||startValue;json.unshift({text:txt,value:startValue,title:txt,selected:!0})}firstItems=self._createItems(json)}callback(firstItems.concat(self._createItems(ob.items)),ob.keyword||""),1===op.times&&self.storeValue&&(BI.isKey(startValue)&&(self.storeValue.type===BI.Selection.All?BI.remove(self.storeValue.value,startValue):BI.pushDistinct(self.storeValue.value,startValue)),self.setValue(self.storeValue)),1===op.times&&self._scrollToTop()})},hasNext:function(){return hasNext},value:this.storeValue},opts.el)),BI.createWidget({type:"bi.vertical",element:this,items:[this.button_group],vgap:5}),this.button_group.on(BI.Controller.EVENT_CHANGE,function(){self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.button_group.on(BI.SelectList.EVENT_CHANGE,function(){self.fireEvent(BI.MultiSelectNoBarLoader.EVENT_CHANGE,arguments)})},_createItems:function(items){return BI.createItems(items,{type:"bi.multi_select_item",cls:"bi-list-item-active",logic:this.options.logic,height:24,iconWrapperWidth:36})},_scrollToTop:function(){var self=this;BI.delay(function(){self.button_group.element.scrollTop(0)},30)},_assertValue:function(val){val||(val={}),val.type||(val.type=BI.Selection.Multi),val.value||(val.value=[])},setStartValue:function(v){this._startValue=v},setValue:function(v){this.storeValue=v||{},this._assertValue(this.storeValue),this.button_group.setValue(this.storeValue.value)},getValue:function(){return{type:BI.Selection.Multi,value:this.button_group.getValue()}},getAllButtons:function(){return this.button_group.getAllButtons()},empty:function(){this.button_group.empty()},populate:function(items){arguments[0]=this._createItems(items),this.button_group.populate.apply(this.button_group,arguments)},resetHeight:function(h){this.button_group.element.css({"max-height":h+"px"})},resetWidth:function(){}}),BI.MultiSelectNoBarLoader.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.multi_select_no_bar_loader",BI.MultiSelectNoBarLoader),BI.MultiSelectPopupView=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.MultiSelectPopupView.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-multi-select-popup-view",maxWidth:"auto",minWidth:135,maxHeight:400,valueFormatter:BI.emptyFn,itemsCreator:BI.emptyFn,onLoaded:BI.emptyFn})},_init:function(){BI.MultiSelectPopupView.superclass._init.apply(this,arguments);var self=this,opts=this.options;this.loader=BI.createWidget({type:"bi.multi_select_loader",itemsCreator:opts.itemsCreator,valueFormatter:opts.valueFormatter,onLoaded:opts.onLoaded,value:opts.value}),this.popupView=BI.createWidget({type:"bi.multi_popup_view",stopPropagation:!1,maxWidth:opts.maxWidth,minWidth:opts.minWidth,maxHeight:opts.maxHeight,element:this,buttons:[BI.i18nText("BI-Basic_Clears"),BI.i18nText("BI-Basic_Sure")],el:this.loader,value:opts.value}),this.popupView.on(BI.MultiPopupView.EVENT_CHANGE,function(){self.fireEvent(BI.MultiSelectPopupView.EVENT_CHANGE)}),this.popupView.on(BI.MultiPopupView.EVENT_CLICK_TOOLBAR_BUTTON,function(index){switch(index){case 0:self.fireEvent(BI.MultiSelectPopupView.EVENT_CLICK_CLEAR);break;case 1:self.fireEvent(BI.MultiSelectPopupView.EVENT_CLICK_CONFIRM)}})},isAllSelected:function(){return this.loader.isAllSelected()},setStartValue:function(v){this.loader.setStartValue(v)},setValue:function(v){this.popupView.setValue(v)},getValue:function(){return this.popupView.getValue()},populate:function(items){this.popupView.populate.apply(this.popupView,arguments)},resetHeight:function(h){this.popupView.resetHeight(h)},resetWidth:function(w){this.popupView.resetWidth(w)}}),BI.MultiSelectPopupView.EVENT_CHANGE="EVENT_CHANGE",BI.MultiSelectPopupView.EVENT_CLICK_CONFIRM="EVENT_CLICK_CONFIRM",BI.MultiSelectPopupView.EVENT_CLICK_CLEAR="EVENT_CLICK_CLEAR",BI.shortcut("bi.multi_select_popup_view",BI.MultiSelectPopupView),BI.MultiSelectNoBarPopupView=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.MultiSelectNoBarPopupView.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-multi-select-popup-view",maxWidth:"auto",minWidth:135,maxHeight:400,valueFormatter:BI.emptyFn,itemsCreator:BI.emptyFn,onLoaded:BI.emptyFn})},_init:function(){BI.MultiSelectNoBarPopupView.superclass._init.apply(this,arguments);var self=this,opts=this.options;this.loader=BI.createWidget({type:"bi.multi_select_no_bar_loader",itemsCreator:opts.itemsCreator,valueFormatter:opts.valueFormatter,onLoaded:opts.onLoaded,value:opts.value}),this.popupView=BI.createWidget({type:"bi.multi_popup_view",stopPropagation:!1,maxWidth:opts.maxWidth,minWidth:opts.minWidth,maxHeight:opts.maxHeight,element:this,buttons:[BI.i18nText("BI-Basic_Clears"),BI.i18nText("BI-Basic_Sure")],el:this.loader,value:opts.value}),this.popupView.on(BI.MultiPopupView.EVENT_CHANGE,function(){self.fireEvent(BI.MultiSelectNoBarPopupView.EVENT_CHANGE)}),this.popupView.on(BI.MultiPopupView.EVENT_CLICK_TOOLBAR_BUTTON,function(index){switch(index){case 0:self.fireEvent(BI.MultiSelectNoBarPopupView.EVENT_CLICK_CLEAR);break;case 1:self.fireEvent(BI.MultiSelectNoBarPopupView.EVENT_CLICK_CONFIRM)}})},setStartValue:function(v){this.loader.setStartValue(v)},setValue:function(v){this.popupView.setValue(v)},getValue:function(){return this.popupView.getValue()},populate:function(items){this.popupView.populate.apply(this.popupView,arguments)},resetHeight:function(h){this.popupView.resetHeight(h)},resetWidth:function(w){this.popupView.resetWidth(w)}}),BI.MultiSelectNoBarPopupView.EVENT_CHANGE="EVENT_CHANGE",BI.MultiSelectNoBarPopupView.EVENT_CLICK_CONFIRM="EVENT_CLICK_CONFIRM",BI.MultiSelectNoBarPopupView.EVENT_CLICK_CLEAR="EVENT_CLICK_CLEAR",BI.shortcut("bi.multi_select_no_bar_popup_view",BI.MultiSelectNoBarPopupView),BI.MultiSelectTrigger=BI.inherit(BI.Trigger,{constants:{height:14,rgap:4,lgap:4},_defaultConfig:function(){return BI.extend(BI.MultiSelectTrigger.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-multi-select-trigger bi-border bi-border-radius",itemsCreator:BI.emptyFn,valueFormatter:BI.emptyFn,searcher:{},switcher:{},adapter:null,masker:{},allowEdit:!0})},_init:function(){BI.MultiSelectTrigger.superclass._init.apply(this,arguments);var self=this,o=this.options;o.height&&this.setHeight(o.height-2),this.searcher=BI.createWidget(o.searcher,{type:"bi.multi_select_searcher",height:o.height,text:o.text,itemsCreator:o.itemsCreator,valueFormatter:o.valueFormatter,watermark:o.watermark,popup:{},adapter:o.adapter,masker:o.masker,value:o.value}),this.searcher.on(BI.MultiSelectSearcher.EVENT_START,function(){self.fireEvent(BI.MultiSelectTrigger.EVENT_START)}),this.searcher.on(BI.MultiSelectSearcher.EVENT_PAUSE,function(){self.fireEvent(BI.MultiSelectTrigger.EVENT_PAUSE)}),this.searcher.on(BI.MultiSelectSearcher.EVENT_SEARCHING,function(){self.fireEvent(BI.MultiSelectTrigger.EVENT_SEARCHING,arguments)}),this.searcher.on(BI.MultiSelectSearcher.EVENT_STOP,function(){self.fireEvent(BI.MultiSelectTrigger.EVENT_STOP)}),this.searcher.on(BI.MultiSelectSearcher.EVENT_CHANGE,function(){self.fireEvent(BI.MultiSelectTrigger.EVENT_CHANGE,arguments)}),this.searcher.on(BI.MultiSelectSearcher.EVENT_BLUR,function(){self.fireEvent(BI.MultiSelectTrigger.EVENT_BLUR)}),this.searcher.on(BI.MultiSelectSearcher.EVENT_FOCUS,function(){self.fireEvent(BI.MultiSelectTrigger.EVENT_FOCUS)}),this.wrapNumberCounter=BI.createWidget({type:"bi.layout"}),this.wrapper=BI.createWidget({type:"bi.htape",element:this,items:[{el:this.searcher,width:"fill"},{el:this.wrapNumberCounter,width:0},{el:BI.createWidget(),width:24}]}),!o.allowEdit&&BI.createWidget({type:"bi.absolute",element:this,items:[{el:{type:"bi.layout"},left:0,right:24,top:0,bottom:0}]})},refreshPlaceHolderWidth:function(width){this.wrapper.attr("items")[1].width=width,this.wrapper.resize()},getSearcher:function(){return this.searcher},stopEditing:function(){this.searcher.stopSearch()},setAdapter:function(adapter){this.searcher.setAdapter(adapter)},setValue:function(ob){this.searcher.setValue(ob)},getKey:function(){return this.searcher.getKey()},getValue:function(){return this.searcher.getValue()}}),BI.MultiSelectTrigger.EVENT_TRIGGER_CLICK="EVENT_TRIGGER_CLICK",BI.MultiSelectTrigger.EVENT_COUNTER_CLICK="EVENT_COUNTER_CLICK",BI.MultiSelectTrigger.EVENT_CHANGE="EVENT_CHANGE",BI.MultiSelectTrigger.EVENT_START="EVENT_START",BI.MultiSelectTrigger.EVENT_STOP="EVENT_STOP",BI.MultiSelectTrigger.EVENT_PAUSE="EVENT_PAUSE",BI.MultiSelectTrigger.EVENT_SEARCHING="EVENT_SEARCHING",BI.MultiSelectTrigger.EVENT_BEFORE_COUNTER_POPUPVIEW="EVENT_BEFORE_COUNTER_POPUPVIEW",BI.MultiSelectTrigger.EVENT_BLUR="EVENT_BLUR",BI.MultiSelectTrigger.EVENT_FOCUS="EVENT_FOCUS",BI.shortcut("bi.multi_select_trigger",BI.MultiSelectTrigger),BI.MultiSelectSearchInsertPane=BI.inherit(BI.Widget,{constants:{height:24,lgap:10,tgap:5},_defaultConfig:function(){return BI.extend(BI.MultiSelectSearchInsertPane.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-multi-select-search-pane bi-card",itemsCreator:BI.emptyFn,valueFormatter:BI.emptyFn,keywordGetter:BI.emptyFn})},_init:function(){BI.MultiSelectSearchInsertPane.superclass._init.apply(this,arguments);var self=this,o=this.options;this.tooltipClick=BI.createWidget({type:"bi.label",invisible:!0,text:BI.i18nText("BI-Click_Blank_To_Select"),cls:"multi-select-toolbar",height:this.constants.height}),this.addNotMatchTip=BI.createWidget({type:"bi.text_button",invisible:!0,text:BI.i18nText("BI-Basic_Click_To_Add_Text",""),height:this.constants.height,cls:"bi-high-light",hgap:5,handler:function(){self.fireEvent(BI.MultiSelectSearchInsertPane.EVENT_ADD_ITEM,o.keywordGetter())}}),this.loader=BI.createWidget({type:"bi.multi_select_search_loader",keywordGetter:o.keywordGetter,valueFormatter:o.valueFormatter,itemsCreator:function(op,callback){o.itemsCreator.apply(self,[op,function(res){callback(res),self.setKeyword(o.keywordGetter())}])},value:o.value}),this.loader.on(BI.Controller.EVENT_CHANGE,function(){self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.resizer=BI.createWidget({type:"bi.vtape",element:this,items:[{type:"bi.vertical",items:[this.tooltipClick,this.addNotMatchTip],height:this.constants.height},{el:this.loader}]})},setKeyword:function(keyword){var btn,isMatchTipVisible=this.loader.getAllButtons().length>0&&(btn=this.loader.getAllButtons()[0])&&keyword===btn.getValue();this.tooltipClick.setVisible(isMatchTipVisible),this.addNotMatchTip.setVisible(!isMatchTipVisible),!isMatchTipVisible&&this.addNotMatchTip.setText(BI.i18nText("BI-Basic_Click_To_Add_Text",keyword))},isAllSelected:function(){return this.loader.isAllSelected()},hasMatched:function(){return this.tooltipClick.isVisible()},setValue:function(v){this.loader.setValue(v)},getValue:function(){return this.loader.getValue()},empty:function(){this.loader.empty()},populate:function(items){this.loader.populate.apply(this.loader,arguments)}}),BI.MultiSelectSearchInsertPane.EVENT_CHANGE="EVENT_CHANGE",BI.MultiSelectSearchInsertPane.EVENT_ADD_ITEM="EVENT_ADD_ITEM",BI.shortcut("bi.multi_select_search_insert_pane",BI.MultiSelectSearchInsertPane),BI.MultiSelectSearchLoader=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.MultiSelectSearchLoader.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-multi-select-search-loader",itemsCreator:BI.emptyFn,keywordGetter:BI.emptyFn,valueFormatter:BI.emptyFn})},_init:function(){BI.MultiSelectSearchLoader.superclass._init.apply(this,arguments);var self=this,opts=this.options,hasNext=!1;this.storeValue=BI.deepClone(opts.value),this.button_group=BI.createWidget({type:"bi.select_list",toolbar:{type:"bi.multi_select_bar",cls:"bi-list-item-active",iconWrapperWidth:36},element:this,logic:{dynamic:!1},value:opts.value,el:{tipText:BI.i18nText("BI-No_Select"),el:{type:"bi.loader",isDefaultInit:!1,logic:{dynamic:!0,scrolly:!0},el:{chooseType:BI.ButtonGroup.CHOOSE_TYPE_MULTI,behaviors:{redmark:function(){return!0}},layouts:[{type:"bi.vertical"}]}}},itemsCreator:function(op,callback){self.storeValue&&(op=BI.extend(op||{},{selectedValues:self.storeValue.value})),opts.itemsCreator(op,function(ob){var keyword=ob.keyword=opts.keywordGetter();hasNext=ob.hasNext;var firstItems=[];if(1===op.times&&self.storeValue){var json=self._filterValues(self.storeValue);firstItems=self._createItems(json)}callback(firstItems.concat(self._createItems(ob.items)),keyword),1===op.times&&self.storeValue&&self.setValue(self.storeValue)})},hasNext:function(){return hasNext}}),this.button_group.on(BI.Controller.EVENT_CHANGE,function(){self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.button_group.on(BI.SelectList.EVENT_CHANGE,function(){self.fireEvent(BI.MultiSelectSearchLoader.EVENT_CHANGE,arguments)})},_createItems:function(items){return BI.createItems(items,{type:"bi.multi_select_item",logic:{dynamic:!1},height:24,selected:this.isAllSelected(),cls:"bi-list-item-active",iconWrapperWidth:36})},isAllSelected:function(){return this.button_group.isAllSelected()},_filterValues:function(src){var o=this.options,keyword=o.keywordGetter(),values=BI.deepClone(src.value)||[],newValues=BI.map(values,function(i,v){return{text:o.valueFormatter(v)||v,value:v}});if(BI.isKey(keyword)){var search=BI.Func.getSearchResult(newValues,keyword);values=search.match.concat(search.find)}return BI.map(values,function(i,v){return{text:v.text,title:v.text,value:v.value,selected:src.type===BI.Selection.All}})},setValue:function(v){this.storeValue=BI.deepClone(v),this.button_group.setValue(v)},getValue:function(){return this.button_group.getValue()},getAllButtons:function(){return this.button_group.getAllButtons()},empty:function(){this.button_group.empty()},populate:function(items){this.button_group.populate.apply(this.button_group,arguments)},resetHeight:function(h){this.button_group.resetHeight(h)},resetWidth:function(w){this.button_group.resetWidth(w)}}),BI.MultiSelectSearchLoader.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.multi_select_search_loader",BI.MultiSelectSearchLoader),BI.MultiSelectSearchPane=BI.inherit(BI.Widget,{constants:{height:24,lgap:10,tgap:5},_defaultConfig:function(){return BI.extend(BI.MultiSelectSearchPane.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-multi-select-search-pane bi-card",itemsCreator:BI.emptyFn,valueFormatter:BI.emptyFn,keywordGetter:BI.emptyFn})},_init:function(){BI.MultiSelectSearchPane.superclass._init.apply(this,arguments);var self=this,o=this.options;this.tooltipClick=BI.createWidget({type:"bi.label",invisible:!0,text:BI.i18nText("BI-Click_Blank_To_Select"),cls:"multi-select-toolbar",height:this.constants.height}),this.loader=BI.createWidget({type:"bi.multi_select_search_loader",keywordGetter:o.keywordGetter,valueFormatter:o.valueFormatter,itemsCreator:function(op,callback){o.itemsCreator.apply(self,[op,function(res){callback(res),self.setKeyword(o.keywordGetter())}])},value:o.value}),this.loader.on(BI.Controller.EVENT_CHANGE,function(){self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.resizer=BI.createWidget({type:"bi.vtape",element:this,items:[{el:this.tooltipClick,height:0},{el:this.loader}]}),this.tooltipClick.setVisible(!1)},setKeyword:function(keyword){var btn,isVisible=this.loader.getAllButtons().length>0&&(btn=this.loader.getAllButtons()[0])&&keyword===btn.getValue();isVisible!==this.tooltipClick.isVisible()&&(this.tooltipClick.setVisible(isVisible),this.resizer.attr("items")[0].height=isVisible?this.constants.height:0,this.resizer.resize())},isAllSelected:function(){return this.loader.isAllSelected()},hasMatched:function(){return this.tooltipClick.isVisible()},setValue:function(v){this.loader.setValue(v)},getValue:function(){return this.loader.getValue()},empty:function(){this.loader.empty()},populate:function(items){this.loader.populate.apply(this.loader,arguments)}}),BI.MultiSelectSearchPane.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.multi_select_search_pane",BI.MultiSelectSearchPane),BI.MultiSelectCheckSelectedButton=BI.inherit(BI.Single,{_defaultConfig:function(){return BI.extend(BI.MultiSelectCheckSelectedButton.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-multi-select-check-selected-button", +itemsCreator:BI.emptyFn})},_init:function(){BI.MultiSelectCheckSelectedButton.superclass._init.apply(this,arguments);var self=this,o=this.options;this.numberCounter=BI.createWidget({type:"bi.text_button",element:this,hgap:4,text:"0",textAlign:"center",textHeight:16,cls:"bi-high-light-background count-tip"}),this.numberCounter.on(BI.Controller.EVENT_CHANGE,function(){self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.numberCounter.on(BI.TextButton.EVENT_CHANGE,function(){self.fireEvent(BI.MultiSelectCheckSelectedButton.EVENT_CHANGE,arguments)}),this.numberCounter.element.hover(function(){self.numberCounter.setTag(self.numberCounter.getText()),self.numberCounter.setText(BI.i18nText("BI-Check_Selected"))},function(){self.numberCounter.setText(self.numberCounter.getTag())}),this.setVisible(!1),BI.isNotNull(o.value)&&this.setValue(o.value)},setValue:function(ob){var self=this,o=this.options;return ob||(ob={}),ob.type||(ob.type=BI.Selection.Multi),ob.value||(ob.value=[]),ob.type===BI.Selection.All?void o.itemsCreator({type:BI.MultiSelectCombo.REQ_GET_DATA_LENGTH},function(res){var length=res.count-ob.value.length;BI.nextTick(function(){self.numberCounter.setText(length),self.setVisible(length>0)})}):void BI.nextTick(function(){self.numberCounter.setText(ob.value.length),self.setVisible(ob.value.length>0)})},getValue:function(){}}),BI.MultiSelectCheckSelectedButton.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.multi_select_check_selected_button",BI.MultiSelectCheckSelectedButton),BI.MultiSelectEditor=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.MultiSelectEditor.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-multi-select-editor",el:{},watermark:BI.i18nText("BI-Basic_Search")})},_init:function(){BI.MultiSelectEditor.superclass._init.apply(this,arguments);var self=this,o=this.options;this.editor=BI.createWidget(o.el,{type:"bi.state_editor",element:this,height:o.height,watermark:o.watermark,allowBlank:!0,value:o.value,defaultText:o.text,text:o.text,tipType:o.tipType,warningTitle:o.warningTitle}),this.editor.on(BI.Controller.EVENT_CHANGE,function(){self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.editor.on(BI.StateEditor.EVENT_PAUSE,function(){self.fireEvent(BI.MultiSelectEditor.EVENT_PAUSE)}),this.editor.on(BI.StateEditor.EVENT_FOCUS,function(){self.fireEvent(BI.MultiSelectEditor.EVENT_FOCUS)}),this.editor.on(BI.StateEditor.EVENT_BLUR,function(){self.fireEvent(BI.MultiSelectEditor.EVENT_BLUR)})},focus:function(){this.editor.focus()},blur:function(){this.editor.blur()},setState:function(state){this.editor.setState(state)},setValue:function(v){this.editor.setValue(v)},setTipType:function(v){this.editor.setTipType(v)},getValue:function(){var v=this.editor.getState();return BI.isArray(v)&&v.length>0?v[v.length-1]:""},getKeywords:function(){var val=this.editor.getLastChangedValue(),keywords=val.match(/[\S]+/g);return BI.isEndWithBlank(val)?keywords.concat([" "]):keywords},populate:function(items){}}),BI.MultiSelectEditor.EVENT_FOCUS="EVENT_FOCUS",BI.MultiSelectEditor.EVENT_BLUR="EVENT_BLUR",BI.MultiSelectEditor.EVENT_PAUSE="EVENT_PAUSE",BI.shortcut("bi.multi_select_editor",BI.MultiSelectEditor),BI.MultiSelectInsertSearcher=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.MultiSelectInsertSearcher.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-multi-select-searcher",itemsCreator:BI.emptyFn,el:{},popup:{},valueFormatter:BI.emptyFn,adapter:null,masker:{},text:BI.i18nText("BI-Basic_Please_Select")})},_init:function(){BI.MultiSelectInsertSearcher.superclass._init.apply(this,arguments);var self=this,o=this.options;this.editor=BI.createWidget(o.el,{type:"bi.multi_select_editor",watermark:o.watermark,height:o.height,text:o.text,listeners:[{eventName:BI.MultiSelectEditor.EVENT_FOCUS,action:function(){self.fireEvent(BI.MultiSelectInsertSearcher.EVENT_FOCUS)}},{eventName:BI.MultiSelectEditor.EVENT_BLUR,action:function(){self.fireEvent(BI.MultiSelectInsertSearcher.EVENT_BLUR)}}]}),this.searcher=BI.createWidget({type:"bi.searcher",element:this,height:o.height,isAutoSearch:!1,isAutoSync:!1,onSearch:function(op,callback){callback()},el:this.editor,popup:BI.extend({type:"bi.multi_select_search_insert_pane",valueFormatter:o.valueFormatter,keywordGetter:function(){return self.editor.getValue()},itemsCreator:function(op,callback){var keyword=self.editor.getValue();op.keywords=[keyword],this.setKeyword(keyword),o.itemsCreator(op,callback)},value:o.value,listeners:[{eventName:BI.MultiSelectSearchInsertPane.EVENT_ADD_ITEM,action:function(){self.fireEvent(BI.MultiSelectInsertSearcher.EVENT_ADD_ITEM)}}]},o.popup),adapter:o.adapter,masker:o.masker}),this.searcher.on(BI.Searcher.EVENT_START,function(){self.fireEvent(BI.MultiSelectInsertSearcher.EVENT_START)}),this.searcher.on(BI.Searcher.EVENT_PAUSE,function(){this.hasMatched(),self.fireEvent(BI.MultiSelectInsertSearcher.EVENT_PAUSE)}),this.searcher.on(BI.Searcher.EVENT_STOP,function(){self.fireEvent(BI.MultiSelectInsertSearcher.EVENT_STOP)}),this.searcher.on(BI.Searcher.EVENT_CHANGE,function(){self.fireEvent(BI.MultiSelectInsertSearcher.EVENT_CHANGE,arguments)}),this.searcher.on(BI.Searcher.EVENT_SEARCHING,function(){var keywords=this.getKeywords();self.fireEvent(BI.MultiSelectInsertSearcher.EVENT_SEARCHING,keywords)}),BI.isNotNull(o.value)&&this.setState(o.value)},adjustView:function(){this.searcher.adjustView()},isSearching:function(){return this.searcher.isSearching()},stopSearch:function(){this.searcher.stopSearch()},getKeyword:function(){return this.editor.getValue()},hasMatched:function(){return this.searcher.hasMatched()},hasChecked:function(){return this.searcher.getView()&&this.searcher.getView().hasChecked()},setAdapter:function(adapter){this.searcher.setAdapter(adapter)},setState:function(ob){var o=this.options;if(ob||(ob={}),ob.value||(ob.value=[]),ob.type===BI.Selection.All)if(0===ob.value.length)this.editor.setState(BI.Selection.All);else if(BI.size(ob.assist)<=20){var state="";BI.each(ob.assist,function(i,v){state+=0===i?""+(o.valueFormatter(v+"")||v):","+(o.valueFormatter(v+"")||v)}),this.editor.setState(state)}else this.editor.setState(BI.Selection.Multi);else if(0===ob.value.length)this.editor.setState(BI.Selection.None);else if(BI.size(ob.value)<=20){var state="";BI.each(ob.value,function(i,v){state+=0===i?""+(o.valueFormatter(v+"")||v):","+(o.valueFormatter(v+"")||v)}),this.editor.setState(state)}else this.editor.setState(BI.Selection.Multi)},setValue:function(ob){this.setState(ob),this.searcher.setValue(ob)},getKey:function(){return this.editor.getValue()},getValue:function(){return this.searcher.getValue()},populate:function(items){this.searcher.populate.apply(this.searcher,arguments)}}),BI.MultiSelectInsertSearcher.EVENT_BEFORE_POPUPVIEW="EVENT_BEFORE_POPUPVIEW",BI.MultiSelectInsertSearcher.EVENT_CHANGE="EVENT_CHANGE",BI.MultiSelectInsertSearcher.EVENT_START="EVENT_START",BI.MultiSelectInsertSearcher.EVENT_STOP="EVENT_STOP",BI.MultiSelectInsertSearcher.EVENT_PAUSE="EVENT_PAUSE",BI.MultiSelectInsertSearcher.EVENT_SEARCHING="EVENT_SEARCHING",BI.MultiSelectInsertSearcher.EVENT_ADD_ITEM="EVENT_ADD_ITEM",BI.MultiSelectInsertSearcher.EVENT_FOCUS="EVENT_FOCUS",BI.MultiSelectInsertSearcher.EVENT_BLUR="EVENT_BLUR",BI.shortcut("bi.multi_select_insert_searcher",BI.MultiSelectInsertSearcher),BI.MultiSelectSearcher=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.MultiSelectSearcher.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-multi-select-searcher",itemsCreator:BI.emptyFn,el:{},popup:{},valueFormatter:BI.emptyFn,adapter:null,masker:{},text:BI.i18nText("BI-Basic_Please_Select")})},_init:function(){BI.MultiSelectSearcher.superclass._init.apply(this,arguments);var self=this,o=this.options;this.editor=BI.createWidget(o.el,{type:"bi.multi_select_editor",height:o.height,text:o.text,listeners:[{eventName:BI.MultiSelectEditor.EVENT_FOCUS,action:function(){self.fireEvent(BI.MultiSelectSearcher.EVENT_FOCUS)}},{eventName:BI.MultiSelectEditor.EVENT_BLUR,action:function(){self.fireEvent(BI.MultiSelectSearcher.EVENT_BLUR)}}]}),this.searcher=BI.createWidget({type:"bi.searcher",element:this,height:o.height,isAutoSearch:!1,isAutoSync:!1,onSearch:function(op,callback){callback()},el:this.editor,popup:BI.extend({type:"bi.multi_select_search_pane",valueFormatter:o.valueFormatter,keywordGetter:function(){return self.editor.getValue()},itemsCreator:function(op,callback){var keyword=self.editor.getValue();op.keywords=[keyword],this.setKeyword(keyword),o.itemsCreator(op,callback)},value:o.value},o.popup),adapter:o.adapter,masker:o.masker}),this.searcher.on(BI.Searcher.EVENT_START,function(){self.fireEvent(BI.MultiSelectSearcher.EVENT_START)}),this.searcher.on(BI.Searcher.EVENT_PAUSE,function(){this.hasMatched(),self.fireEvent(BI.MultiSelectSearcher.EVENT_PAUSE)}),this.searcher.on(BI.Searcher.EVENT_STOP,function(){self.fireEvent(BI.MultiSelectSearcher.EVENT_STOP)}),this.searcher.on(BI.Searcher.EVENT_CHANGE,function(){self.fireEvent(BI.MultiSelectSearcher.EVENT_CHANGE,arguments)}),this.searcher.on(BI.Searcher.EVENT_SEARCHING,function(){var keywords=this.getKeywords();self.fireEvent(BI.MultiSelectSearcher.EVENT_SEARCHING,keywords)}),BI.isNotNull(o.value)&&this.setState(o.value)},adjustView:function(){this.searcher.adjustView()},isSearching:function(){return this.searcher.isSearching()},stopSearch:function(){this.searcher.stopSearch()},getKeyword:function(){return this.editor.getValue()},hasMatched:function(){return this.searcher.hasMatched()},hasChecked:function(){return this.searcher.getView()&&this.searcher.getView().hasChecked()},setAdapter:function(adapter){this.searcher.setAdapter(adapter)},setState:function(ob){var o=this.options;if(ob||(ob={}),ob.value||(ob.value=[]),ob.type===BI.Selection.All)if(0===ob.value.length)this.editor.setState(BI.Selection.All);else if(BI.size(ob.assist)<=20){var state="";BI.each(ob.assist,function(i,v){state+=0===i?""+(o.valueFormatter(v+"")||v):","+(o.valueFormatter(v+"")||v)}),this.editor.setState(state)}else this.editor.setState(BI.Selection.Multi);else if(0===ob.value.length)this.editor.setState(BI.Selection.None);else if(BI.size(ob.value)<=20){var state="";BI.each(ob.value,function(i,v){state+=0===i?""+(o.valueFormatter(v+"")||v):","+(o.valueFormatter(v+"")||v)}),this.editor.setState(state)}else this.editor.setState(BI.Selection.Multi)},setValue:function(ob){this.setState(ob),this.searcher.setValue(ob)},getKey:function(){return this.editor.getValue()},getValue:function(){return this.searcher.getValue()},populate:function(items){this.searcher.populate.apply(this.searcher,arguments)}}),BI.MultiSelectSearcher.EVENT_BEFORE_POPUPVIEW="EVENT_BEFORE_POPUPVIEW",BI.MultiSelectSearcher.EVENT_CHANGE="EVENT_CHANGE",BI.MultiSelectSearcher.EVENT_START="EVENT_START",BI.MultiSelectSearcher.EVENT_STOP="EVENT_STOP",BI.MultiSelectSearcher.EVENT_PAUSE="EVENT_PAUSE",BI.MultiSelectSearcher.EVENT_SEARCHING="EVENT_SEARCHING",BI.MultiSelectSearcher.EVENT_FOCUS="EVENT_FOCUS",BI.MultiSelectSearcher.EVENT_BLUR="EVENT_BLUR",BI.shortcut("bi.multi_select_searcher",BI.MultiSelectSearcher),BI.MultiSelectCheckSelectedSwitcher=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.MultiSelectCheckSelectedSwitcher.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-multi-select-check-selected-switcher",itemsCreator:BI.emptyFn,valueFormatter:BI.emptyFn,el:{},popup:{},adapter:null,masker:{}})},_init:function(){BI.MultiSelectCheckSelectedSwitcher.superclass._init.apply(this,arguments);var self=this,o=this.options;this.button=BI.createWidget(o.el,{type:"bi.multi_select_check_selected_button",itemsCreator:o.itemsCreator,value:o.value}),this.button.on(BI.Events.VIEW,function(){self.fireEvent(BI.Events.VIEW,arguments)}),this.switcher=BI.createWidget({type:"bi.switcher",toggle:!1,element:this,el:this.button,popup:BI.extend({type:"bi.multi_select_check_pane",valueFormatter:o.valueFormatter,itemsCreator:o.itemsCreator,onClickContinueSelect:function(){self.switcher.hideView()},ref:function(_ref){self.checkPane=_ref},value:o.value},o.popup),adapter:o.adapter,masker:o.masker}),this.switcher.on(BI.Switcher.EVENT_TRIGGER_CHANGE,function(){self.fireEvent(BI.MultiSelectCheckSelectedSwitcher.EVENT_TRIGGER_CHANGE)}),this.switcher.on(BI.Switcher.EVENT_BEFORE_POPUPVIEW,function(){self.fireEvent(BI.MultiSelectCheckSelectedSwitcher.EVENT_BEFORE_POPUPVIEW)}),this.switcher.on(BI.Switcher.EVENT_AFTER_POPUPVIEW,function(){var me=this;BI.nextTick(function(){me.populate()})})},adjustView:function(){this.switcher.adjustView()},hideView:function(){this.switcher.empty(),this.switcher.hideView()},setAdapter:function(adapter){this.switcher.setAdapter(adapter)},setValue:function(v){this.switcher.setValue(v)},updateSelectedValue:function(v){this.checkPane.setValue(v)},setButtonChecked:function(v){this.button.setValue(v)},getValue:function(){},populate:function(items){this.switcher.populate.apply(this.switcher,arguments)}}),BI.MultiSelectCheckSelectedSwitcher.EVENT_TRIGGER_CHANGE="EVENT_TRIGGER_CHANGE",BI.MultiSelectCheckSelectedSwitcher.EVENT_BEFORE_POPUPVIEW="EVENT_BEFORE_POPUPVIEW",BI.shortcut("bi.multi_select_check_selected_switcher",BI.MultiSelectCheckSelectedSwitcher),BI.MultiSelectInsertList=BI.inherit(BI.Single,{_defaultConfig:function(){return BI.extend(BI.MultiSelectInsertList.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-multi-select-insert-list",itemsCreator:BI.emptyFn,valueFormatter:BI.emptyFn})},_init:function(){BI.MultiSelectInsertList.superclass._init.apply(this,arguments);var self=this,o=this.options;this.storeValue=o.value||{};var assertShowValue=function(){BI.isKey(self._startValue)&&(self.storeValue.type===BI.Selection.All?BI.remove(self.storeValue.value,self._startValue):BI.pushDistinct(self.storeValue.value,self._startValue))};this.adapter=BI.createWidget({type:"bi.multi_select_loader",cls:"popup-multi-select-list bi-border-left bi-border-right bi-border-bottom",itemsCreator:o.itemsCreator,valueFormatter:o.valueFormatter,logic:{dynamic:!0},el:{},value:o.value}),this.adapter.on(BI.MultiSelectLoader.EVENT_CHANGE,function(){self.storeValue=this.getValue(),assertShowValue(),self.fireEvent(BI.MultiSelectInsertList.EVENT_CHANGE)}),this.searcherPane=BI.createWidget({type:"bi.multi_select_search_insert_pane",cls:"bi-border-left bi-border-right bi-border-bottom",valueFormatter:o.valueFormatter,keywordGetter:function(){return self.trigger.getKeyword()},itemsCreator:function(op,callback){op.keywords=[self.trigger.getKeyword()],this.setKeyword(op.keywords[0]),o.itemsCreator(op,callback)},listeners:[{eventName:BI.MultiSelectSearchInsertPane.EVENT_ADD_ITEM,action:function(){var keyword=self.trigger.getKeyword();self.trigger.hasMatched()||(self.storeValue.type===BI.Selection.Multi&&BI.pushDistinct(self.storeValue.value,keyword),self._showAdapter(),self.adapter.setValue(self.storeValue),self.adapter.populate(),self.storeValue.type===BI.Selection.Multi&&self.fireEvent(BI.MultiSelectInsertList.EVENT_CHANGE))}}]}),this.searcherPane.setVisible(!1),this.trigger=BI.createWidget({type:"bi.searcher",isAutoSearch:!1,isAutoSync:!1,onSearch:function(op,callback){callback()},adapter:this.adapter,popup:this.searcherPane,height:200,masker:!1,listeners:[{eventName:BI.Searcher.EVENT_START,action:function(){self._showSearcherPane(),self._setStartValue(""),this.setValue(BI.deepClone(self.storeValue))}},{eventName:BI.Searcher.EVENT_STOP,action:function(){self._showAdapter(),self._setStartValue(""),self.adapter.setValue(self.storeValue),self.adapter.populate()}},{eventName:BI.Searcher.EVENT_PAUSE,action:function(){var keyword=this.getKeyword();this.hasMatched()&&self._join({type:BI.Selection.Multi,value:[keyword]},function(){self.storeValue.type===BI.Selection.Multi&&BI.pushDistinct(self.storeValue.value,keyword),self._showAdapter(),self.adapter.setValue(self.storeValue),self._setStartValue(keyword),assertShowValue(),self.adapter.populate(),self._setStartValue(""),self.fireEvent(BI.MultiSelectInsertList.EVENT_CHANGE)}),self._showAdapter()}},{eventName:BI.Searcher.EVENT_SEARCHING,action:function(){var keywords=this.getKeywords(),last=BI.last(keywords);keywords=BI.initial(keywords||[]),keywords.length>0&&self._joinKeywords(keywords,function(){BI.isEndWithBlank(last)?(self.adapter.setValue(self.storeValue),assertShowValue(),self.adapter.populate(),self._setStartValue("")):(self.adapter.setValue(self.storeValue),assertShowValue()),self.fireEvent(BI.MultiSelectInsertList.EVENT_CHANGE)})}},{eventName:BI.Searcher.EVENT_CHANGE,action:function(value,obj){obj instanceof BI.MultiSelectBar?self._joinAll(this.getValue(),function(){assertShowValue(),self.fireEvent(BI.MultiSelectInsertList.EVENT_CHANGE)}):self._join(this.getValue(),function(){assertShowValue(),self.fireEvent(BI.MultiSelectInsertList.EVENT_CHANGE)})}}],value:o.value}),BI.createWidget({type:"bi.vtape",element:this,items:[{el:this.trigger,height:24},{el:this.adapter,height:"fill"}]}),BI.createWidget({type:"bi.absolute",element:this,items:[{el:this.searcherPane,top:30,bottom:0,left:0,right:0}]})},_showAdapter:function(){this.adapter.setVisible(!0),this.searcherPane.setVisible(!1)},_showSearcherPane:function(){this.searcherPane.setVisible(!0),this.adapter.setVisible(!1)},_defaultState:function(){this.trigger.stopEditing()},_assertValue:function(val){val||(val={}),val.type||(val.type=BI.Selection.Multi),val.value||(val.value=[])},_makeMap:function(values){return BI.makeObject(values||[])},_joinKeywords:function(keywords,callback){function digest(items){var selectedMap=self._makeMap(items);BI.each(keywords,function(i,val){BI.isNotNull(selectedMap[val])&&(self.storeValue.type===BI.Selection.Multi?BI.pushDistinct(self.storeValue.value,val):BI.remove(self.storeValue.value,val))}),callback()}var self=this,o=this.options;this._assertValue(this.storeValue),o.itemsCreator({type:BI.MultiSelectInsertList.REQ_GET_ALL_DATA,keywords:keywords},function(ob){var values=BI.map(ob.items,"value");digest(values)})},_joinAll:function(res,callback){var self=this,o=this.options;this._assertValue(res),o.itemsCreator({type:BI.MultiSelectInsertList.REQ_GET_ALL_DATA,keywords:[self.trigger.getKeyword()]},function(ob){var items=BI.map(ob.items,"value");if(self.storeValue.type===res.type){var change=!1,map=self._makeMap(self.storeValue.value);return BI.each(items,function(i,v){BI.isNotNull(map[v])&&(change=!0,delete map[v])}),change&&(self.storeValue.value=BI.values(map)),void callback()}var selectedMap=self._makeMap(self.storeValue.value),notSelectedMap=self._makeMap(res.value),newItems=[];BI.each(items,function(i,item){BI.isNotNull(selectedMap[items[i]])&&delete selectedMap[items[i]],BI.isNull(notSelectedMap[items[i]])&&newItems.push(item)}),self.storeValue.value=newItems.concat(BI.values(selectedMap)),callback()})},_join:function(res,callback){var self=this,o=this.options;if(this._assertValue(res),this._assertValue(this.storeValue),this.storeValue.type===res.type){var map=this._makeMap(this.storeValue.value);BI.each(res.value,function(i,v){map[v]||(self.storeValue.value.push(v),map[v]=v)});var change=!1;return BI.each(res.assist,function(i,v){BI.isNotNull(map[v])&&(change=!0,delete map[v])}),change&&(this.storeValue.value=BI.values(map)),void callback()}this._joinAll(res,callback)},_setStartValue:function(value){this._startValue=value,this.adapter.setStartValue(value)},isAllSelected:function(){return this.adapter.isAllSelected()},resize:function(){},setValue:function(v){this.storeValue=v||{},this._assertValue(this.storeValue),this.adapter.setValue(this.storeValue),this.trigger.setValue(this.storeValue)},getValue:function(){return BI.deepClone(this.storeValue)},populate:function(){this.adapter.populate.apply(this.adapter,arguments),this.trigger.populate.apply(this.trigger,arguments)}}),BI.extend(BI.MultiSelectInsertList,{REQ_GET_DATA_LENGTH:1,REQ_GET_ALL_DATA:-1}),BI.MultiSelectInsertList.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.multi_select_insert_list",BI.MultiSelectInsertList),BI.MultiSelectInsertNoBarList=BI.inherit(BI.Single,{_defaultConfig:function(){return BI.extend(BI.MultiSelectInsertNoBarList.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-multi-select-insert-list",itemsCreator:BI.emptyFn,valueFormatter:BI.emptyFn})},_init:function(){BI.MultiSelectInsertNoBarList.superclass._init.apply(this,arguments);var self=this,o=this.options;this.storeValue={type:BI.Selection.Multi,value:o.value||[]};var assertShowValue=function(){BI.isKey(self._startValue)&&(self.storeValue.type===BI.Selection.All?BI.remove(self.storeValue.value,self._startValue):BI.pushDistinct(self.storeValue.value,self._startValue))};this.adapter=BI.createWidget({type:"bi.multi_select_no_bar_loader",cls:"popup-multi-select-list bi-border-left bi-border-right bi-border-bottom",itemsCreator:o.itemsCreator,valueFormatter:o.valueFormatter,logic:{dynamic:!1},el:{},value:{type:BI.Selection.Multi,value:o.value||[]}}),this.adapter.on(BI.MultiSelectLoader.EVENT_CHANGE,function(){self.storeValue=this.getValue(),assertShowValue(),self.fireEvent(BI.MultiSelectInsertNoBarList.EVENT_CHANGE)}),this.searcherPane=BI.createWidget({type:"bi.multi_select_search_insert_pane",cls:"bi-border-left bi-border-right bi-border-bottom",valueFormatter:o.valueFormatter,keywordGetter:function(){return self.trigger.getKeyword()},itemsCreator:function(op,callback){op.keywords=[self.trigger.getKeyword()],this.setKeyword(op.keywords[0]),o.itemsCreator(op,callback)},listeners:[{eventName:BI.MultiSelectSearchInsertPane.EVENT_ADD_ITEM,action:function(){var keyword=self.trigger.getKeyword();self.trigger.hasMatched()||(self.storeValue.type===BI.Selection.Multi&&BI.pushDistinct(self.storeValue.value,keyword),self._showAdapter(),self.adapter.setValue(self.storeValue),self.adapter.populate(),self.storeValue.type===BI.Selection.Multi&&self.fireEvent(BI.MultiSelectInsertNoBarList.EVENT_CHANGE))}}]}),this.searcherPane.setVisible(!1),this.trigger=BI.createWidget({type:"bi.searcher",isAutoSearch:!1,isAutoSync:!1,onSearch:function(op,callback){callback()},adapter:this.adapter,popup:this.searcherPane,height:200,masker:!1,listeners:[{eventName:BI.Searcher.EVENT_START,action:function(){self._showSearcherPane(),self._setStartValue(""),this.setValue(BI.deepClone(self.storeValue))}},{eventName:BI.Searcher.EVENT_STOP,action:function(){self._showAdapter(),self._setStartValue(""),self.adapter.setValue(self.storeValue),self.adapter.populate()}},{eventName:BI.Searcher.EVENT_PAUSE,action:function(){var keyword=this.getKeyword();this.hasMatched()&&self._join({type:BI.Selection.Multi,value:[keyword]},function(){self.storeValue.type===BI.Selection.Multi&&BI.pushDistinct(self.storeValue.value,keyword),self._showAdapter(),self.adapter.setValue(self.storeValue),self._setStartValue(keyword),assertShowValue(),self.adapter.populate(),self._setStartValue(""),self.fireEvent(BI.MultiSelectInsertNoBarList.EVENT_CHANGE)})}},{eventName:BI.Searcher.EVENT_SEARCHING,action:function(){var keywords=this.getKeywords(),last=BI.last(keywords);keywords=BI.initial(keywords||[]),keywords.length>0&&self._joinKeywords(keywords,function(){BI.isEndWithBlank(last)?(self.adapter.setValue(self.storeValue),assertShowValue(),self.adapter.populate(),self._setStartValue("")):(self.adapter.setValue(self.storeValue),assertShowValue()),self.fireEvent(BI.MultiSelectInsertNoBarList.EVENT_CHANGE)})}},{eventName:BI.Searcher.EVENT_CHANGE,action:function(value,obj){obj instanceof BI.MultiSelectBar?self._joinAll(this.getValue(),function(){assertShowValue(),self.fireEvent(BI.MultiSelectInsertNoBarList.EVENT_CHANGE)}):self._join(this.getValue(),function(){assertShowValue(),self.fireEvent(BI.MultiSelectInsertNoBarList.EVENT_CHANGE)})}}],value:{type:BI.Selection.Multi,value:o.value||[]}}),BI.createWidget({type:"bi.vtape",element:this,items:[{el:this.trigger,height:24},{el:this.adapter,height:"fill"}]}),BI.createWidget({type:"bi.absolute",element:this,items:[{el:this.searcherPane,top:30,bottom:0,left:0,right:0}]})},_showAdapter:function(){this.adapter.setVisible(!0),this.searcherPane.setVisible(!1)},_showSearcherPane:function(){this.searcherPane.setVisible(!0),this.adapter.setVisible(!1)},_defaultState:function(){this.trigger.stopEditing()},_assertValue:function(val){val||(val={}),val.type||(val.type=BI.Selection.Multi),val.value||(val.value=[])},_makeMap:function(values){return BI.makeObject(values||[])},_joinKeywords:function(keywords,callback){function digest(items){var selectedMap=self._makeMap(items);BI.each(keywords,function(i,val){BI.isNotNull(selectedMap[val])&&(self.storeValue.type===BI.Selection.Multi?BI.pushDistinct(self.storeValue.value,val):BI.remove(self.storeValue.value,val))}),callback()}var self=this,o=this.options;this._assertValue(this.storeValue),o.itemsCreator({type:BI.MultiSelectInsertNoBarList.REQ_GET_ALL_DATA,keywords:keywords},function(ob){var values=BI.map(ob.items,"value");digest(values)})},_joinAll:function(res,callback){var self=this,o=this.options;this._assertValue(res),o.itemsCreator({type:BI.MultiSelectInsertNoBarList.REQ_GET_ALL_DATA,keywords:[self.trigger.getKeyword()]},function(ob){var items=BI.map(ob.items,"value");if(self.storeValue.type===res.type){var change=!1,map=self._makeMap(self.storeValue.value);return BI.each(items,function(i,v){BI.isNotNull(map[v])&&(change=!0,delete map[v])}),change&&(self.storeValue.value=BI.values(map)),void callback()}var selectedMap=self._makeMap(self.storeValue.value),notSelectedMap=self._makeMap(res.value),newItems=[];BI.each(items,function(i,item){BI.isNotNull(selectedMap[items[i]])&&delete selectedMap[items[i]],BI.isNull(notSelectedMap[items[i]])&&newItems.push(item)}),self.storeValue.value=newItems.concat(BI.values(selectedMap)),callback()})},_join:function(res,callback){var self=this,o=this.options;if(this._assertValue(res),this._assertValue(this.storeValue),this.storeValue.type===res.type){var map=this._makeMap(this.storeValue.value);BI.each(res.value,function(i,v){map[v]||(self.storeValue.value.push(v),map[v]=v)});var change=!1;return BI.each(res.assist,function(i,v){BI.isNotNull(map[v])&&(change=!0,delete map[v])}),change&&(this.storeValue.value=BI.values(map)),void callback()}this._joinAll(res,callback)},_setStartValue:function(value){this._startValue=value,this.adapter.setStartValue(value)},isAllSelected:function(){return this.adapter.isAllSelected()},resize:function(){},setValue:function(v){this.storeValue={type:BI.Selection.Multi,value:v||[]},this.adapter.setValue(this.storeValue),this.trigger.setValue(this.storeValue)},getValue:function(){return BI.deepClone(this.storeValue.value)},populate:function(){this.adapter.populate.apply(this.adapter,arguments),this.trigger.populate.apply(this.trigger,arguments)}}),BI.extend(BI.MultiSelectInsertNoBarList,{REQ_GET_DATA_LENGTH:1,REQ_GET_ALL_DATA:-1}),BI.MultiSelectInsertNoBarList.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.multi_select_insert_no_bar_list",BI.MultiSelectInsertNoBarList),BI.MultiSelectList=BI.inherit(BI.Widget,{_constant:{EDITOR_HEIGHT:24},_defaultConfig:function(){return BI.extend(BI.MultiSelectList.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-multi-select-list",itemsCreator:BI.emptyFn,valueFormatter:BI.emptyFn})},_init:function(){BI.MultiSelectList.superclass._init.apply(this,arguments);var self=this,o=this.options;this.storeValue={};var assertShowValue=function(){BI.isKey(self._startValue)&&(self.storeValue.type===BI.Selection.All?BI.remove(self.storeValue.value,self._startValue):BI.pushDistinct(self.storeValue.value,self._startValue))};this.adapter=BI.createWidget({type:"bi.multi_select_loader",cls:"popup-multi-select-list bi-border-left bi-border-right bi-border-bottom",itemsCreator:o.itemsCreator,valueFormatter:o.valueFormatter,logic:{dynamic:!1},el:{}}),this.adapter.on(BI.MultiSelectLoader.EVENT_CHANGE,function(){self.storeValue=this.getValue(),self._adjust(function(){assertShowValue(),self.fireEvent(BI.MultiSelectList.EVENT_CHANGE)})}),this.searcherPane=BI.createWidget({type:"bi.multi_select_search_pane",cls:"bi-border-left bi-border-right bi-border-bottom",valueFormatter:o.valueFormatter,keywordGetter:function(){return self.trigger.getKeyword()},itemsCreator:function(op,callback){op.keywords=[self.trigger.getKeyword()],this.setKeyword(op.keywords[0]),o.itemsCreator(op,callback)}}),this.searcherPane.setVisible(!1),this.trigger=BI.createWidget({type:"bi.searcher",isAutoSearch:!1,isAutoSync:!1,onSearch:function(op,callback){callback()},adapter:this.adapter,popup:this.searcherPane,height:200,masker:!1,listeners:[{eventName:BI.Searcher.EVENT_START,action:function(){self._showSearcherPane(),self._setStartValue(""),this.setValue(BI.deepClone(self.storeValue))}},{eventName:BI.Searcher.EVENT_STOP,action:function(){self._showAdapter(),self._setStartValue(""),self.adapter.setValue(self.storeValue),self.adapter.populate()}},{eventName:BI.Searcher.EVENT_PAUSE,action:function(){var keyword=this.getKeyword();this.hasMatched()&&self._join({type:BI.Selection.Multi,value:[keyword]},function(){self._showAdapter(),self.adapter.setValue(self.storeValue),self._setStartValue(keyword),assertShowValue(),self.adapter.populate(),self._setStartValue(""),self.fireEvent(BI.MultiSelectList.EVENT_CHANGE)})}},{eventName:BI.Searcher.EVENT_SEARCHING,action:function(){var keywords=this.getKeyword(),last=BI.last(keywords);keywords=BI.initial(keywords||[]),keywords.length>0&&self._joinKeywords(keywords,function(){BI.isEndWithBlank(last)?(self.adapter.setValue(self.storeValue),assertShowValue(),self.adapter.populate(),self._setStartValue("")):(self.adapter.setValue(self.storeValue),assertShowValue()),self.fireEvent(BI.MultiSelectList.EVENT_CHANGE)})}},{eventName:BI.Searcher.EVENT_CHANGE,action:function(value,obj){obj instanceof BI.MultiSelectBar?self._joinAll(this.getValue(),function(){assertShowValue(),self.fireEvent(BI.MultiSelectList.EVENT_CHANGE)}):self._join(this.getValue(),function(){assertShowValue(),self.fireEvent(BI.MultiSelectList.EVENT_CHANGE)})}}]}),BI.createWidget({type:"bi.vtape",element:this,items:[{el:this.trigger,height:this._constant.EDITOR_HEIGHT},{el:this.adapter,height:"fill"}]}),BI.createWidget({type:"bi.absolute",element:this,items:[{el:this.searcherPane,top:this._constant.EDITOR_HEIGHT,bottom:0,left:0,right:0}]})},_showAdapter:function(){this.adapter.setVisible(!0),this.searcherPane.setVisible(!1)},_showSearcherPane:function(){this.searcherPane.setVisible(!0),this.adapter.setVisible(!1)},_defaultState:function(){this.trigger.stopEditing()},_assertValue:function(val){val||(val={}),val.type||(val.type=BI.Selection.Multi),val.value||(val.value=[])},_makeMap:function(values){return BI.makeObject(values||[])},_joinKeywords:function(keywords,callback){function digest(items){var selectedMap=self._makeMap(items);BI.each(keywords,function(i,val){BI.isNotNull(selectedMap[val])&&(self.storeValue.type===BI.Selection.Multi?BI.pushDistinct(self.storeValue.value,val):BI.remove(self.storeValue.value,val))}),self._adjust(callback)}var self=this,o=this.options;this._assertValue(this.storeValue),o.itemsCreator({type:BI.MultiSelectList.REQ_GET_ALL_DATA,keywords:keywords},function(ob){var values=BI.map(ob.items,"value");digest(values)})},_joinAll:function(res,callback){var self=this,o=this.options;this._assertValue(res),o.itemsCreator({type:BI.MultiSelectList.REQ_GET_ALL_DATA,keywords:[this.trigger.getKey()]},function(ob){var items=BI.map(ob.items,"value");if(self.storeValue.type===res.type){var change=!1,map=self._makeMap(self.storeValue.value);return BI.each(items,function(i,v){BI.isNotNull(map[v])&&(change=!0,delete map[v])}),change&&(self.storeValue.value=BI.values(map)),void self._adjust(callback)}var selectedMap=self._makeMap(self.storeValue.value),notSelectedMap=self._makeMap(res.value),newItems=[];BI.each(items,function(i,item){BI.isNotNull(selectedMap[items[i]])&&delete selectedMap[items[i]],BI.isNull(notSelectedMap[items[i]])&&newItems.push(item)}),self.storeValue.value=newItems.concat(BI.values(selectedMap)),self._adjust(callback)})},_adjust:function(callback){ +function adjust(){self.storeValue.type===BI.Selection.All&&self.storeValue.value.length>=self._count?self.storeValue={type:BI.Selection.Multi,value:[]}:self.storeValue.type===BI.Selection.Multi&&self.storeValue.value.length>=self._count&&(self.storeValue={type:BI.Selection.All,value:[]})}var self=this,o=this.options;this._count?(adjust(),callback()):o.itemsCreator({type:BI.MultiSelectList.REQ_GET_DATA_LENGTH},function(res){self._count=res.count,adjust(),callback()})},_join:function(res,callback){var self=this,o=this.options;if(this._assertValue(res),this._assertValue(this.storeValue),this.storeValue.type===res.type){var map=this._makeMap(this.storeValue.value);BI.each(res.value,function(i,v){map[v]||(self.storeValue.value.push(v),map[v]=v)});var change=!1;return BI.each(res.assist,function(i,v){BI.isNotNull(map[v])&&(change=!0,delete map[v])}),change&&(this.storeValue.value=BI.values(map)),void self._adjust(callback)}this._joinAll(res,callback)},_setStartValue:function(value){this._startValue=value,this.adapter.setStartValue(value)},isAllSelected:function(){return this.adapter.isAllSelected()},resize:function(){},setValue:function(v){this.storeValue=v||{},this._assertValue(this.storeValue),this.adapter.setValue(this.storeValue),this.trigger.setValue(this.storeValue)},getValue:function(){return BI.deepClone(this.storeValue)},populate:function(){this.adapter.populate.apply(this.adapter,arguments),this.trigger.populate.apply(this.trigger,arguments)}}),BI.extend(BI.MultiSelectList,{REQ_GET_DATA_LENGTH:1,REQ_GET_ALL_DATA:-1}),BI.MultiSelectList.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.multi_select_list",BI.MultiSelectList),BI.MultiSelectTree=BI.inherit(BI.Single,{_constant:{EDITOR_HEIGHT:24},_defaultConfig:function(){return BI.extend(BI.MultiSelectTree.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-multi-select-tree",itemsCreator:BI.emptyFn})},_init:function(){BI.MultiSelectTree.superclass._init.apply(this,arguments);var self=this,o=this.options;this.storeValue={value:{}},this.adapter=BI.createWidget({type:"bi.multi_select_tree_popup",itemsCreator:o.itemsCreator}),this.adapter.on(BI.MultiSelectTreePopup.EVENT_CHANGE,function(){self.searcher.isSearching()?self.storeValue={value:self.searcherPane.getValue()}:self.storeValue={value:self.adapter.getValue()},self.setSelectedValue(self.storeValue.value),self.fireEvent(BI.MultiSelectTree.EVENT_CHANGE)}),this.searcherPane=BI.createWidget({type:"bi.multi_tree_search_pane",cls:"bi-border-left bi-border-right bi-border-bottom",keywordGetter:function(){return self.searcher.getKeyword()},itemsCreator:function(op,callback){op.keyword=self.searcher.getKeyword(),o.itemsCreator(op,callback)}}),this.searcherPane.setVisible(!1),this.searcher=BI.createWidget({type:"bi.searcher",isAutoSearch:!1,isAutoSync:!1,onSearch:function(op,callback){callback({keyword:self.searcher.getKeyword()})},adapter:this.adapter,popup:this.searcherPane,masker:!1,listeners:[{eventName:BI.Searcher.EVENT_START,action:function(){self._showSearcherPane()}},{eventName:BI.Searcher.EVENT_STOP,action:function(){self._showAdapter(),BI.nextTick(function(){self.adapter.populate()})}},{eventName:BI.Searcher.EVENT_CHANGE,action:function(){self.searcher.isSearching()?self.storeValue={value:self.searcherPane.getValue()}:self.storeValue={value:self.adapter.getValue()},self.setSelectedValue(self.storeValue.value),self.fireEvent(BI.MultiSelectTree.EVENT_CHANGE)}},{eventName:BI.Searcher.EVENT_PAUSE,action:function(){self._showAdapter()}}]}),BI.createWidget({type:"bi.vtape",element:this,items:[{el:this.searcher,height:this._constant.EDITOR_HEIGHT},{el:this.adapter,height:"fill"}]}),BI.createWidget({type:"bi.absolute",element:this,items:[{el:this.searcherPane,top:this._constant.EDITOR_HEIGHT,bottom:0,left:0,right:0}]})},_showAdapter:function(){this.adapter.setVisible(!0),this.searcherPane.setVisible(!1)},_showSearcherPane:function(){this.searcherPane.setVisible(!0),this.adapter.setVisible(!1)},resize:function(){},setSelectedValue:function(v){this.storeValue.value=v||{},this.adapter.setSelectedValue(v),this.searcherPane.setSelectedValue(v),this.searcher.setValue({value:v||{}})},setValue:function(v){this.adapter.setValue(v)},stopSearch:function(){this.searcher.stopSearch()},updateValue:function(v){this.adapter.updateValue(v)},getValue:function(){return this.storeValue.value},populate:function(){this.searcher.populate.apply(this.searcher,arguments),this.adapter.populate.apply(this.adapter,arguments)}}),BI.MultiSelectTree.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.multi_select_tree",BI.MultiSelectTree),BI.MultiSelectTreePopup=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.MultiSelectTreePopup.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-multi-select-tree-popup bi-border-left bi-border-right bi-border-bottom",itemsCreator:BI.emptyFn})},_init:function(){BI.MultiSelectTreePopup.superclass._init.apply(this,arguments);var self=this,o=this.options;this.popup=BI.createWidget({type:"bi.async_tree",element:this,itemsCreator:o.itemsCreator}),this.popup.on(BI.TreeView.EVENT_AFTERINIT,function(){self.fireEvent(BI.MultiSelectTreePopup.EVENT_AFTER_INIT)}),this.popup.on(BI.TreeView.EVENT_CHANGE,function(){self.fireEvent(BI.MultiSelectTreePopup.EVENT_CHANGE)})},hasChecked:function(){return this.popup.hasChecked()},getValue:function(){return this.popup.getValue()},setValue:function(v){v||(v={}),this.popup.setValue(v)},setSelectedValue:function(v){v||(v={}),this.popup.setSelectedValue(v)},updateValue:function(v){this.popup.updateValue(v),this.popup.refresh()},populate:function(config){this.popup.stroke(config)}}),BI.MultiSelectTreePopup.EVENT_AFTER_INIT="EVENT_AFTER_INIT",BI.MultiSelectTreePopup.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.multi_select_tree_popup",BI.MultiSelectTreePopup),BI.MultiTreeCheckPane=BI.inherit(BI.Pane,{constants:{height:25,lgap:10,tgap:5},_defaultConfig:function(){return BI.extend(BI.MultiTreeCheckPane.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-multi-tree-check-pane bi-background",onClickContinueSelect:BI.emptyFn,el:{type:"bi.display_tree"}})},_init:function(){BI.MultiTreeCheckPane.superclass._init.apply(this,arguments);var self=this,opts=this.options;this.selectedValues={};var continueSelect=BI.createWidget({type:"bi.text_button",text:BI.i18nText("BI-Continue_Select"),cls:"multi-tree-check-selected"});continueSelect.on(BI.TextButton.EVENT_CHANGE,function(){opts.onClickContinueSelect(),BI.nextTick(function(){self.empty()})});var backToPopup=BI.createWidget({type:"bi.left",cls:"multi-tree-continue-select",items:[{el:{type:"bi.label",text:BI.i18nText("BI-Selected_Data")},lgap:this.constants.lgap,tgap:this.constants.tgap},{el:continueSelect,lgap:this.constants.lgap,tgap:this.constants.tgap}]});this.display=BI.createWidget(opts.el,{type:"bi.display_tree",cls:"bi-multi-tree-display",itemsCreator:function(op,callback){op.type=BI.TreeView.REQ_TYPE_GET_SELECTED_DATA,opts.itemsCreator(op,callback)},value:(opts.value||{}).value}),this.display.on(BI.Events.AFTERINIT,function(){self.fireEvent(BI.Events.AFTERINIT)}),this.display.on(BI.TreeView.EVENT_INIT,function(){backToPopup.setVisible(!1)}),this.display.on(BI.TreeView.EVENT_AFTERINIT,function(){backToPopup.setVisible(!0)}),BI.createWidget({type:"bi.vtape",element:this,items:[{height:this.constants.height,el:backToPopup},{height:"fill",el:this.display}]})},empty:function(){this.display.empty()},populate:function(configs){this.display.stroke(configs)},setValue:function(v){v||(v={}),this.display.setSelectedValue(v.value)},getValue:function(){}}),BI.MultiTreeCheckPane.EVENT_CONTINUE_CLICK="EVENT_CONTINUE_CLICK",BI.shortcut("bi.multi_tree_check_pane",BI.MultiTreeCheckPane),BI.MultiTreeCombo=BI.inherit(BI.Single,{constants:{offset:{top:0,left:0,right:0,bottom:25}},_defaultConfig:function(){return BI.extend(BI.MultiTreeCombo.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-multi-tree-combo",itemsCreator:BI.emptyFn,valueFormatter:BI.emptyFn,height:24})},_init:function(){function showCounter(){isSearching()?self.storeValue={value:self.trigger.getValue()}:isPopupView()&&(self.storeValue={value:self.combo.getValue()}),self.trigger.setValue(self.storeValue),self.numberCounter.setValue(self.storeValue)}BI.MultiTreeCombo.superclass._init.apply(this,arguments);var self=this,o=this.options,isInit=!1,want2showCounter=!1;this.storeValue={value:o.value||{}},this.trigger=BI.createWidget({type:"bi.multi_select_trigger",height:o.height,valueFormatter:o.valueFormatter,text:o.text,watermark:o.watermark,masker:{offset:this.constants.offset},searcher:{type:"bi.multi_tree_searcher",itemsCreator:o.itemsCreator},value:{value:o.value||{}}}),this.combo=BI.createWidget({type:"bi.combo",toggle:!1,container:o.container,el:this.trigger,adjustLength:1,popup:{type:"bi.multi_tree_popup_view",ref:function(){self.popup=this,self.trigger.setAdapter(this),self.numberCounter.setAdapter(this)},listeners:[{eventName:BI.MultiTreePopup.EVENT_AFTERINIT,action:function(){self.numberCounter.adjustView(),isInit=!0,want2showCounter===!0&&showCounter()}},{eventName:BI.MultiTreePopup.EVENT_CHANGE,action:function(){change=!0;var val={type:BI.Selection.Multi,value:this.hasChecked()?this.getValue():{}};self.trigger.getSearcher().setState(val),self.numberCounter.setButtonChecked(val),self.fireEvent(BI.MultiTreeCombo.EVENT_CLICK_ITEM)}},{eventName:BI.MultiTreePopup.EVENT_CLICK_CONFIRM,action:function(){self.combo.hideView()}},{eventName:BI.MultiTreePopup.EVENT_CLICK_CLEAR,action:function(){clear=!0,self.setValue(),self._defaultState()}}],itemsCreator:o.itemsCreator,onLoaded:function(){BI.nextTick(function(){self.numberCounter.adjustView(),self.trigger.getSearcher().adjustView()})}},value:{value:o.value||{}},hideChecker:function(e){return 0===triggerBtn.element.find(e.target).length&&0===self.numberCounter.element.find(e.target).length}});var change=!1,clear=!1,isSearching=function(){return self.trigger.getSearcher().isSearching()},isPopupView=function(){return self.combo.isViewVisible()};this.trigger.on(BI.MultiSelectTrigger.EVENT_FOCUS,function(){self.fireEvent(BI.MultiTreeCombo.EVENT_FOCUS)}),this.trigger.on(BI.MultiSelectTrigger.EVENT_BLUR,function(){self.fireEvent(BI.MultiTreeCombo.EVENT_BLUR)}),this.trigger.on(BI.MultiSelectTrigger.EVENT_START,function(){self.storeValue={value:self.combo.getValue()},this.setValue(self.storeValue),self.numberCounter.setValue(self.storeValue)}),this.trigger.on(BI.MultiSelectTrigger.EVENT_STOP,function(){self.storeValue={value:this.getValue()},self.combo.setValue(self.storeValue),self.numberCounter.setValue(self.storeValue),BI.nextTick(function(){isPopupView()&&self.combo.populate()}),self.fireEvent(BI.MultiTreeCombo.EVENT_STOP)}),this.trigger.on(BI.MultiSelectTrigger.EVENT_SEARCHING,function(){self.fireEvent(BI.MultiTreeCombo.EVENT_SEARCHING)}),this.trigger.on(BI.MultiSelectTrigger.EVENT_TRIGGER_CLICK,function(){self.combo.toggle()}),this.trigger.on(BI.MultiSelectTrigger.EVENT_COUNTER_CLICK,function(){self.combo.isViewVisible()||self.combo.showView()}),this.trigger.on(BI.MultiSelectTrigger.EVENT_CHANGE,function(){var checked=this.getSearcher().hasChecked(),val={type:BI.Selection.Multi,value:checked?{1:1}:{}};this.getSearcher().setState(checked?BI.Selection.Multi:BI.Selection.None),self.numberCounter.setButtonChecked(val),self.fireEvent(BI.MultiTreeCombo.EVENT_CLICK_ITEM)}),this.combo.on(BI.Combo.EVENT_BEFORE_POPUPVIEW,function(){isSearching()||(change===!0&&(self.storeValue={value:self.combo.getValue()},change=!1),self.combo.setValue(self.storeValue),self.numberCounter.setValue(self.storeValue),self.populate())}),this.combo.on(BI.Combo.EVENT_BEFORE_HIDEVIEW,function(){isSearching()?(self._stopEditing(),self.fireEvent(BI.MultiTreeCombo.EVENT_CONFIRM)):isPopupView()&&(self._stopEditing(),self.storeValue={value:self.combo.getValue()},clear===!0&&(self.storeValue={value:{}}),self.fireEvent(BI.MultiTreeCombo.EVENT_CONFIRM)),clear=!1,change=!1});var triggerBtn=BI.createWidget({type:"bi.trigger_icon_button",width:o.height,height:o.height,cls:"multi-select-trigger-icon-button"});triggerBtn.on(BI.TriggerIconButton.EVENT_CHANGE,function(){self.numberCounter.hideView(),self.combo.isViewVisible()?self.combo.hideView():self.combo.showView()}),this.numberCounter=BI.createWidget({type:"bi.multi_select_check_selected_switcher",el:{type:"bi.multi_tree_check_selected_button"},popup:{type:"bi.multi_tree_check_pane"},masker:{offset:this.constants.offset},itemsCreator:o.itemsCreator,valueFormatter:o.valueFormatter,value:{value:o.value||{}}}),this.numberCounter.on(BI.MultiSelectCheckSelectedSwitcher.EVENT_TRIGGER_CHANGE,function(){self.combo.isViewVisible()||self.combo.showView()}),this.numberCounter.on(BI.MultiSelectCheckSelectedSwitcher.EVENT_BEFORE_POPUPVIEW,function(){want2showCounter===!1&&(want2showCounter=!0),isInit===!0&&(want2showCounter=null,showCounter())}),this.numberCounter.on(BI.Events.VIEW,function(b){BI.nextTick(function(){self.trigger.refreshPlaceHolderWidth(b===!0?self.numberCounter.element.outerWidth()+8:0)})}),this.trigger.element.click(function(e){self.trigger.element.find(e.target).length>0&&self.numberCounter.hideView()}),BI.createWidget({type:"bi.absolute",element:this,items:[{el:this.combo,left:0,right:0,top:0,bottom:0},{el:triggerBtn,right:0,top:0,bottom:0},{el:{type:"bi.vertical_adapt",items:[this.numberCounter]},right:o.height,top:0,height:o.height}]})},_stopEditing:function(){this.trigger.stopEditing(),this.numberCounter.hideView()},_defaultState:function(){this._stopEditing(),this.combo.hideView()},setValue:function(v){this.storeValue.value=v||{},this.combo.setValue({value:v||{}}),this.numberCounter.setValue({value:v||{}})},getValue:function(){return BI.deepClone(this.storeValue.value)},populate:function(){this.combo.populate.apply(this.combo,arguments)}}),BI.MultiTreeCombo.EVENT_FOCUS="EVENT_FOCUS",BI.MultiTreeCombo.EVENT_BLUR="EVENT_BLUR",BI.MultiTreeCombo.EVENT_STOP="EVENT_STOP",BI.MultiTreeCombo.EVENT_SEARCHING="EVENT_SEARCHING",BI.MultiTreeCombo.EVENT_CLICK_ITEM="EVENT_CLICK_ITEM",BI.MultiTreeCombo.EVENT_CONFIRM="EVENT_CONFIRM",BI.shortcut("bi.multi_tree_combo",BI.MultiTreeCombo),BI.MultiTreeInsertCombo=BI.inherit(BI.Single,{constants:{offset:{top:0,left:0,right:0,bottom:25}},_defaultConfig:function(){return BI.extend(BI.MultiTreeInsertCombo.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-multi-tree-insert-combo",itemsCreator:BI.emptyFn,valueFormatter:BI.emptyFn,height:24,allowEdit:!0})},_init:function(){function showCounter(){isSearching()?self.storeValue={value:self.trigger.getValue()}:isPopupView()&&(self.storeValue={value:self.combo.getValue()}),self.trigger.setValue(self.storeValue),self.numberCounter.setValue(self.storeValue)}BI.MultiTreeInsertCombo.superclass._init.apply(this,arguments);var self=this,o=this.options,isInit=!1,want2showCounter=!1;this.storeValue={value:o.value||{}},this.trigger=BI.createWidget({type:"bi.multi_select_trigger",allowEdit:o.allowEdit,height:o.height,valueFormatter:o.valueFormatter,masker:{offset:this.constants.offset},searcher:{type:"bi.multi_tree_searcher",text:o.text,watermark:o.watermark,itemsCreator:o.itemsCreator,popup:{type:"bi.multi_tree_search_insert_pane",listeners:[{eventName:BI.MultiTreeSearchInsertPane.EVENT_ADD_ITEM,action:function(){self.storeValue.value[self.trigger.getSearcher().getKeyword()]={},self._assertShowValue(),self.combo.setValue(self.storeValue),self.numberCounter.setValue(self.storeValue),self._stopEditing()}}]}},value:{value:o.value||{}}}),this.combo=BI.createWidget({type:"bi.combo",toggle:!1,container:o.container,el:this.trigger,adjustLength:1,popup:{type:"bi.multi_tree_popup_view",ref:function(){self.popup=this,self.trigger.setAdapter(this),self.numberCounter.setAdapter(this)},listeners:[{eventName:BI.MultiTreePopup.EVENT_AFTERINIT,action:function(){self.numberCounter.adjustView(),isInit=!0,want2showCounter===!0&&showCounter()}},{eventName:BI.MultiTreePopup.EVENT_CHANGE,action:function(){change=!0;var val={type:BI.Selection.Multi,value:this.hasChecked()?this.getValue():{}};self.trigger.getSearcher().setState(val),self.numberCounter.setButtonChecked(val),self.fireEvent(BI.MultiTreeInsertCombo.EVENT_CLICK_ITEM,self.combo.getValue())}},{eventName:BI.MultiTreePopup.EVENT_CLICK_CONFIRM,action:function(){self.combo.hideView()}},{eventName:BI.MultiTreePopup.EVENT_CLICK_CLEAR,action:function(){clear=!0,self.setValue(),self._defaultState()}}],itemsCreator:o.itemsCreator,onLoaded:function(){BI.nextTick(function(){self.numberCounter.adjustView(),self.trigger.getSearcher().adjustView()})}},value:{value:o.value||{}},hideChecker:function(e){return 0===triggerBtn.element.find(e.target).length&&0===self.numberCounter.element.find(e.target).length}});var change=!1,clear=!1,isSearching=function(){return self.trigger.getSearcher().isSearching()},isPopupView=function(){return self.combo.isViewVisible()};this.trigger.on(BI.MultiSelectTrigger.EVENT_FOCUS,function(){self.fireEvent(BI.MultiTreeInsertCombo.EVENT_FOCUS)}),this.trigger.on(BI.MultiSelectTrigger.EVENT_BLUR,function(){self.fireEvent(BI.MultiTreeInsertCombo.EVENT_BLUR)}),this.trigger.on(BI.MultiSelectTrigger.EVENT_START,function(){self.storeValue={value:self.combo.getValue()},this.setValue(self.storeValue),self.numberCounter.setValue(self.storeValue)}),this.trigger.on(BI.MultiSelectTrigger.EVENT_STOP,function(){self.storeValue={value:this.getValue()},self.combo.setValue(self.storeValue),self.numberCounter.setValue(self.storeValue),BI.nextTick(function(){isPopupView()&&self.combo.populate()}),self.fireEvent(BI.MultiTreeInsertCombo.EVENT_STOP)}),this.trigger.on(BI.MultiSelectTrigger.EVENT_SEARCHING,function(){self.fireEvent(BI.MultiTreeInsertCombo.EVENT_SEARCHING)}),this.trigger.on(BI.MultiSelectTrigger.EVENT_TRIGGER_CLICK,function(){self.combo.toggle()}),this.trigger.on(BI.MultiSelectTrigger.EVENT_CHANGE,function(){var checked=this.getSearcher().hasChecked(),val={type:BI.Selection.Multi,value:checked?{1:1}:{}};this.getSearcher().setState(checked?BI.Selection.Multi:BI.Selection.None),self.numberCounter.setButtonChecked(val),self.fireEvent(BI.MultiTreeInsertCombo.EVENT_CLICK_ITEM,self.combo.getValue())}),this.combo.on(BI.Combo.EVENT_BEFORE_POPUPVIEW,function(){isSearching()||(change===!0&&(self.storeValue={value:self.combo.getValue()},change=!1),self.combo.setValue(self.storeValue),self.numberCounter.setValue(self.storeValue),self.populate())}),this.combo.on(BI.Combo.EVENT_BEFORE_HIDEVIEW,function(){isSearching()?(self._stopEditing(),self.fireEvent(BI.MultiTreeInsertCombo.EVENT_CONFIRM)):isPopupView()&&(self._stopEditing(),self.storeValue={value:self.combo.getValue()},clear===!0&&(self.storeValue={value:{}}),self.fireEvent(BI.MultiTreeInsertCombo.EVENT_CONFIRM)),clear=!1,change=!1});var triggerBtn=BI.createWidget({type:"bi.trigger_icon_button",width:o.height,height:o.height,cls:"multi-select-trigger-icon-button"});triggerBtn.on(BI.TriggerIconButton.EVENT_CHANGE,function(){self.numberCounter.hideView(),self.combo.isViewVisible()?self.combo.hideView():self.combo.showView()}),this.numberCounter=BI.createWidget({type:"bi.multi_select_check_selected_switcher",el:{type:"bi.multi_tree_check_selected_button"},popup:{type:"bi.multi_tree_check_pane"},itemsCreator:o.itemsCreator,masker:{offset:this.constants.offset},valueFormatter:o.valueFormatter,value:o.value}),this.numberCounter.on(BI.MultiSelectCheckSelectedSwitcher.EVENT_TRIGGER_CHANGE,function(){self.combo.isViewVisible()||self.combo.showView()}),this.numberCounter.on(BI.MultiSelectCheckSelectedSwitcher.EVENT_BEFORE_POPUPVIEW,function(){want2showCounter===!1&&(want2showCounter=!0),isInit===!0&&(want2showCounter=null,showCounter())}),this.numberCounter.on(BI.Events.VIEW,function(b){BI.nextTick(function(){self.trigger.refreshPlaceHolderWidth(b===!0?self.numberCounter.element.outerWidth()+8:0)})}),this.trigger.element.click(function(e){self.trigger.element.find(e.target).length>0&&self.numberCounter.hideView()}),BI.createWidget({type:"bi.absolute",element:this,items:[{el:this.combo,left:0,right:0,top:0,bottom:0},{el:triggerBtn,right:0,top:0,bottom:0},{el:{type:"bi.vertical_adapt",items:[this.numberCounter]},right:o.height,top:0,height:o.height}]})},_assertShowValue:function(){this.trigger.getSearcher().setState(this.storeValue),this.numberCounter.setButtonChecked(this.storeValue)},_stopEditing:function(){this.trigger.stopEditing(),this.numberCounter.hideView()},_defaultState:function(){this._stopEditing(),this.combo.hideView()},setValue:function(v){this.storeValue.value=v||{},this.combo.setValue({value:v||{}}),this.numberCounter.setValue({value:v||{}})},getValue:function(){return BI.deepClone(this.storeValue.value)},populate:function(){this.combo.populate.apply(this.combo,arguments)}}),BI.MultiTreeInsertCombo.EVENT_FOCUS="EVENT_FOCUS",BI.MultiTreeInsertCombo.EVENT_BLUR="EVENT_BLUR",BI.MultiTreeInsertCombo.EVENT_STOP="EVENT_STOP",BI.MultiTreeInsertCombo.EVENT_CLICK_ITEM="EVENT_CLICK_ITEM",BI.MultiTreeInsertCombo.EVENT_SEARCHING="EVENT_SEARCHING",BI.MultiTreeInsertCombo.EVENT_CONFIRM="EVENT_CONFIRM",BI.shortcut("bi.multi_tree_insert_combo",BI.MultiTreeInsertCombo),BI.MultiTreeListCombo=BI.inherit(BI.Single,{constants:{offset:{top:0,left:0,right:0,bottom:25}},_defaultConfig:function(){return BI.extend(BI.MultiTreeListCombo.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-multi-tree-list-combo",itemsCreator:BI.emptyFn,valueFormatter:BI.emptyFn,height:24,allowEdit:!0,allowInsertValue:!0})},_init:function(){function showCounter(){isSearching()?self.storeValue={value:self.trigger.getValue()}:isPopupView()&&(self.storeValue={value:self.combo.getValue()}),self.trigger.setValue(self.storeValue),self.numberCounter.setValue(self.storeValue)}BI.MultiTreeListCombo.superclass._init.apply(this,arguments);var self=this,o=this.options,isInit=!1,want2showCounter=!1;this.storeValue={value:o.value||[]},this.trigger=BI.createWidget({type:"bi.multi_select_trigger",allowEdit:o.allowEdit,text:o.text,watermark:o.watermark,height:o.height,valueFormatter:o.valueFormatter,masker:{offset:this.constants.offset},searcher:{type:"bi.multi_list_tree_searcher",itemsCreator:o.itemsCreator,popup:{type:o.allowInsertValue?"bi.multi_tree_search_insert_pane":"bi.multi_tree_search_pane",el:{type:"bi.list_part_tree"},listeners:[{eventName:BI.MultiTreeSearchInsertPane.EVENT_ADD_ITEM,action:function(){self.storeValue.value.unshift([self.trigger.getSearcher().getKeyword()]),self._assertShowValue(),self.combo.setValue(self.storeValue),self.numberCounter.setValue(self.storeValue),self._stopEditing()}}]}},switcher:{el:{type:"bi.multi_tree_check_selected_button"},popup:{type:"bi.multi_tree_check_pane",el:{type:"bi.list_display_tree"},itemsCreator:o.itemsCreator}},value:{value:o.value||{}}}),this.combo=BI.createWidget({type:"bi.combo",toggle:!1,container:o.container,el:this.trigger,adjustLength:1,popup:{type:"bi.multi_tree_popup_view",ref:function(){self.popup=this,self.trigger.setAdapter(this),self.numberCounter.setAdapter(this)},el:{type:"bi.list_async_tree"},listeners:[{eventName:BI.MultiTreePopup.EVENT_AFTERINIT,action:function(){self.numberCounter.adjustView(),isInit=!0,want2showCounter===!0&&showCounter()}},{eventName:BI.MultiTreePopup.EVENT_CHANGE,action:function(){change=!0;var val={type:BI.Selection.Multi,value:this.hasChecked()?this.getValue():[]};self.trigger.getSearcher().setState(val),self.numberCounter.setButtonChecked(val),self.fireEvent(BI.MultiTreeListCombo.EVENT_CLICK_ITEM,self.combo.getValue())}},{eventName:BI.MultiTreePopup.EVENT_CLICK_CONFIRM,action:function(){self.combo.hideView()}},{eventName:BI.MultiTreePopup.EVENT_CLICK_CLEAR,action:function(){clear=!0,self.setValue(),self._defaultState()}}],itemsCreator:o.itemsCreator,onLoaded:function(){BI.nextTick(function(){self.numberCounter.adjustView(),self.trigger.getSearcher().adjustView()})}},value:{value:o.value||{}},hideChecker:function(e){return 0===triggerBtn.element.find(e.target).length&&0===self.numberCounter.element.find(e.target).length}});var change=!1,clear=!1,isSearching=function(){return self.trigger.getSearcher().isSearching()},isPopupView=function(){return self.combo.isViewVisible()};this.trigger.on(BI.MultiSelectTrigger.EVENT_FOCUS,function(){self.fireEvent(BI.MultiTreeListCombo.EVENT_FOCUS)}),this.trigger.on(BI.MultiSelectTrigger.EVENT_BLUR,function(){self.fireEvent(BI.MultiTreeListCombo.EVENT_BLUR)}),this.trigger.on(BI.MultiSelectTrigger.EVENT_START,function(){self.storeValue={value:self.combo.getValue()},this.setValue(self.storeValue),self.numberCounter.setValue(self.storeValue)}),this.trigger.on(BI.MultiSelectTrigger.EVENT_STOP,function(){self.storeValue={value:this.getValue()},self.combo.setValue(self.storeValue),self.numberCounter.setValue(self.storeValue),BI.nextTick(function(){isPopupView()&&self.combo.populate()}),self.fireEvent(BI.MultiTreeListCombo.EVENT_STOP)}),this.trigger.on(BI.MultiSelectTrigger.EVENT_SEARCHING,function(){self.fireEvent(BI.MultiTreeListCombo.EVENT_SEARCHING)}),this.trigger.on(BI.MultiSelectTrigger.EVENT_TRIGGER_CLICK,function(){self.combo.toggle()}),this.trigger.on(BI.MultiSelectTrigger.EVENT_CHANGE,function(){var checked=this.getSearcher().hasChecked(),val={type:BI.Selection.Multi,value:checked?{1:1}:{}};this.getSearcher().setState(checked?BI.Selection.Multi:BI.Selection.None),self.numberCounter.setButtonChecked(val),self.fireEvent(BI.MultiTreeListCombo.EVENT_CLICK_ITEM,self.combo.getValue())}),this.combo.on(BI.Combo.EVENT_BEFORE_POPUPVIEW,function(){isSearching()||(change===!0&&(self.storeValue={value:self.combo.getValue()},change=!1),self.combo.setValue(self.storeValue),self.numberCounter.setValue(self.storeValue),self.populate())}),this.combo.on(BI.Combo.EVENT_BEFORE_HIDEVIEW,function(){isSearching()?(self.trigger.stopEditing(),self.fireEvent(BI.MultiTreeListCombo.EVENT_CONFIRM)):isPopupView()&&(self._stopEditing(),self.storeValue={value:self.combo.getValue()},clear===!0&&(self.storeValue={value:[]}),self.fireEvent(BI.MultiTreeListCombo.EVENT_CONFIRM)),clear=!1,change=!1});var triggerBtn=BI.createWidget({type:"bi.trigger_icon_button",width:o.height,height:o.height,cls:"multi-select-trigger-icon-button"});triggerBtn.on(BI.TriggerIconButton.EVENT_CHANGE,function(){self.numberCounter.hideView(),self.combo.isViewVisible()?self.combo.hideView():self.combo.showView()}),this.numberCounter=BI.createWidget({type:"bi.multi_select_check_selected_switcher",el:{type:"bi.multi_tree_check_selected_button"},popup:{type:"bi.multi_tree_check_pane"},itemsCreator:o.itemsCreator,masker:{offset:{left:0,top:0,right:0,bottom:25}},valueFormatter:o.valueFormatter,value:o.value}),this.numberCounter.on(BI.MultiSelectCheckSelectedSwitcher.EVENT_TRIGGER_CHANGE,function(){self.combo.isViewVisible()||self.combo.showView()}),this.numberCounter.on(BI.MultiSelectCheckSelectedSwitcher.EVENT_BEFORE_POPUPVIEW,function(){want2showCounter===!1&&(want2showCounter=!0),isInit===!0&&(want2showCounter=null,showCounter())}),this.numberCounter.on(BI.Events.VIEW,function(b){BI.nextTick(function(){self.trigger.refreshPlaceHolderWidth(b===!0?self.numberCounter.element.outerWidth()+8:0)})}),this.trigger.element.click(function(e){self.trigger.element.find(e.target).length>0&&self.numberCounter.hideView()}),BI.createWidget({type:"bi.absolute",element:this,items:[{el:this.combo,left:0,right:0,top:0,bottom:0},{el:triggerBtn,right:0,top:0,bottom:0},{el:{type:"bi.vertical_adapt",items:[this.numberCounter]},right:o.height,top:0,height:o.height}]})},_assertShowValue:function(){this.trigger.getSearcher().setState(this.storeValue),this.numberCounter.setButtonChecked(this.storeValue)},_stopEditing:function(){this.trigger.stopEditing(),this.numberCounter.hideView()},_defaultState:function(){this._stopEditing(),this.combo.hideView()},setValue:function(v){this.storeValue.value=v||[],this.combo.setValue({value:v||[]}),this.numberCounter.setValue({value:v||[]})},getValue:function(){return BI.deepClone(this.storeValue.value)},populate:function(){this.combo.populate.apply(this.combo,arguments)}}),BI.MultiTreeListCombo.EVENT_FOCUS="EVENT_FOCUS",BI.MultiTreeListCombo.EVENT_BLUR="EVENT_BLUR",BI.MultiTreeListCombo.EVENT_STOP="EVENT_STOP",BI.MultiTreeListCombo.EVENT_CLICK_ITEM="EVENT_CLICK_ITEM",BI.MultiTreeListCombo.EVENT_SEARCHING="EVENT_SEARCHING",BI.MultiTreeListCombo.EVENT_CONFIRM="EVENT_CONFIRM",BI.shortcut("bi.multi_tree_list_combo",BI.MultiTreeListCombo),BI.MultiTreePopup=BI.inherit(BI.Pane,{_defaultConfig:function(){return BI.extend(BI.MultiTreePopup.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-multi-tree-popup",maxWidth:"auto",minWidth:140,maxHeight:400,onLoaded:BI.emptyFn,el:{type:"bi.async_tree"}})},_init:function(){BI.MultiTreePopup.superclass._init.apply(this,arguments);var self=this,opts=this.options,v=opts.value;this.selectedValues={},this.tree=BI.createWidget(opts.el,{type:"bi.async_tree",height:400,cls:"popup-view-tree",itemsCreator:opts.itemsCreator,onLoaded:opts.onLoaded,value:v.value||{}}),this.popupView=BI.createWidget({type:"bi.multi_popup_view",element:this,stopPropagation:!1,maxWidth:opts.maxWidth,minWidth:opts.minWidth,maxHeight:opts.maxHeight,buttons:[BI.i18nText("BI-Basic_Clears"),BI.i18nText("BI-Basic_Sure")],el:this.tree}),this.popupView.on(BI.MultiPopupView.EVENT_CLICK_TOOLBAR_BUTTON,function(index){switch(index){case 0:self.fireEvent(BI.MultiTreePopup.EVENT_CLICK_CLEAR);break;case 1:self.fireEvent(BI.MultiTreePopup.EVENT_CLICK_CONFIRM)}}),this.tree.on(BI.TreeView.EVENT_CHANGE,function(){self.fireEvent(BI.MultiTreePopup.EVENT_CHANGE)}),this.tree.on(BI.TreeView.EVENT_AFTERINIT,function(){self.fireEvent(BI.MultiTreePopup.EVENT_AFTERINIT)})},getValue:function(){return this.tree.getValue()},setValue:function(v){v||(v={}),this.tree.setSelectedValue(v.value)},populate:function(config){this.tree.stroke(config)},hasChecked:function(){return this.tree.hasChecked()},resetHeight:function(h){this.popupView.resetHeight(h)},resetWidth:function(w){this.popupView.resetWidth(w)}}),BI.MultiTreePopup.EVENT_CHANGE="EVENT_CHANGE",BI.MultiTreePopup.EVENT_CLICK_CONFIRM="EVENT_CLICK_CONFIRM",BI.MultiTreePopup.EVENT_CLICK_CLEAR="EVENT_CLICK_CLEAR",BI.MultiTreePopup.EVENT_AFTERINIT="EVENT_AFTERINIT",BI.shortcut("bi.multi_tree_popup_view",BI.MultiTreePopup),BI.MultiTreeCheckSelectedButton=BI.inherit(BI.Single,{_defaultConfig:function(){return BI.extend(BI.MultiTreeCheckSelectedButton.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-multi-tree-check-selected-button",itemsCreator:BI.emptyFn})},_init:function(){BI.MultiTreeCheckSelectedButton.superclass._init.apply(this,arguments);var self=this;this.indicator=BI.createWidget({type:"bi.icon_button",cls:"check-font trigger-check-selected icon-size-12",width:15,height:15,stopPropagation:!0}),this.checkSelected=BI.createWidget({type:"bi.text_button",cls:"trigger-check-selected",invisible:!0,hgap:4,text:BI.i18nText("BI-Check_Selected"),textAlign:"center",textHeight:15}),this.checkSelected.on(BI.Controller.EVENT_CHANGE,function(){self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.checkSelected.on(BI.TextButton.EVENT_CHANGE,function(){self.fireEvent(BI.MultiSelectCheckSelectedButton.EVENT_CHANGE,arguments)}),BI.createWidget({type:"bi.horizontal",element:this,items:[this.indicator,this.checkSelected]}),this.element.hover(function(){self.indicator.setVisible(!1),self.checkSelected.setVisible(!0)},function(){self.indicator.setVisible(!0),self.checkSelected.setVisible(!1)}),this.setVisible(!1)},setValue:function(v){v||(v={});var show=BI.size(v.value)>0;this.setVisible(show),show&&(this.indicator.setVisible(!0),this.checkSelected.setVisible(!1))}}),BI.MultiTreeCheckSelectedButton.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.multi_tree_check_selected_button",BI.MultiTreeCheckSelectedButton),BI.MultiTreeSearchInsertPane=BI.inherit(BI.Widget,{constants:{height:24},props:{baseCls:"bi-multi-tree-search-insert-pane bi-card",itemsCreator:BI.emptyFn,keywordGetter:BI.emptyFn,el:{type:"bi.part_tree"}},render:function(){var self=this,opts=this.options;return{ +type:"bi.absolute",items:[{el:{type:"bi.text_button",invisible:!0,ref:function(_ref){self.addTip=_ref},text:BI.i18nText("BI-Basic_Click_To_Add_Text",""),height:this.constants.height,cls:"bi-high-light",handler:function(){self.fireEvent(BI.MultiTreeSearchInsertPane.EVENT_ADD_ITEM,opts.keywordGetter())}},top:5,left:0,right:0},{el:BI.extend({type:"bi.part_tree",tipText:BI.i18nText("BI-No_Select"),itemsCreator:function(op,callback){op.keyword=opts.keywordGetter(),opts.itemsCreator(op,function(res){callback(res),self.setKeyword(opts.keywordGetter(),res.items)})},ref:function(_ref){self.partTree=_ref},value:opts.value,listeners:[{eventName:BI.Controller.EVENT_CHANGE,action:function(){self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}},{eventName:BI.TreeView.EVENT_CHANGE,action:function(){self.fireEvent(BI.MultiTreeSearchInsertPane.EVENT_CHANGE)}}]},opts.el),left:0,top:0,bottom:0,right:0}]}},setKeyword:function(keyword,nodes){var isAddTipVisible=BI.isEmptyArray(nodes);this.addTip.setVisible(isAddTipVisible),this.partTree.setVisible(!isAddTipVisible),isAddTipVisible&&this.addTip.setText(BI.i18nText("BI-Basic_Click_To_Add_Text",keyword))},hasChecked:function(){return this.partTree.hasChecked()},setValue:function(v){this.setSelectedValue(v.value)},setSelectedValue:function(v){v||(v={}),this.partTree.setSelectedValue(v)},getValue:function(){return this.partTree.getValue()},empty:function(){this.partTree.empty()},populate:function(op){this.partTree.stroke.apply(this.partTree,arguments)}}),BI.MultiTreeSearchInsertPane.EVENT_CHANGE="EVENT_CHANGE",BI.MultiTreeSearchInsertPane.EVENT_CLICK_CONFIRM="EVENT_CLICK_CONFIRM",BI.MultiTreeSearchInsertPane.EVENT_CLICK_CLEAR="EVENT_CLICK_CLEAR",BI.MultiTreeSearchInsertPane.EVENT_ADD_ITEM="EVENT_ADD_ITEM",BI.shortcut("bi.multi_tree_search_insert_pane",BI.MultiTreeSearchInsertPane),BI.MultiTreeSearchPane=BI.inherit(BI.Pane,{_defaultConfig:function(){return BI.extend(BI.MultiTreeSearchPane.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-multi-tree-search-pane bi-card",itemsCreator:BI.emptyFn,keywordGetter:BI.emptyFn})},_init:function(){BI.MultiTreeSearchPane.superclass._init.apply(this,arguments);var self=this,opts=this.options;this.partTree=BI.createWidget({type:"bi.part_tree",element:this,tipText:BI.i18nText("BI-No_Select"),itemsCreator:function(op,callback){op.keyword=opts.keywordGetter(),opts.itemsCreator(op,callback)},value:opts.value}),this.partTree.on(BI.Controller.EVENT_CHANGE,function(){self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.partTree.on(BI.TreeView.EVENT_CHANGE,function(){self.fireEvent(BI.MultiTreeSearchPane.EVENT_CHANGE)})},hasChecked:function(){return this.partTree.hasChecked()},setValue:function(v){this.setSelectedValue(v.value)},setSelectedValue:function(v){v||(v={}),this.partTree.setSelectedValue(v)},getValue:function(){return this.partTree.getValue()},empty:function(){this.partTree.empty()},populate:function(op){this.partTree.stroke.apply(this.partTree,arguments)}}),BI.MultiTreeSearchPane.EVENT_CHANGE="EVENT_CHANGE",BI.MultiTreeSearchPane.EVENT_CLICK_CONFIRM="EVENT_CLICK_CONFIRM",BI.MultiTreeSearchPane.EVENT_CLICK_CLEAR="EVENT_CLICK_CLEAR",BI.shortcut("bi.multi_tree_search_pane",BI.MultiTreeSearchPane),BI.MultiListTreeSearcher=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.MultiListTreeSearcher.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-multi-tree-searcher",itemsCreator:BI.emptyFn,valueFormatter:function(v){return v},popup:{},adapter:null,masker:{}})},_init:function(){BI.MultiListTreeSearcher.superclass._init.apply(this,arguments);var self=this,o=this.options;this.editor=BI.createWidget({type:"bi.multi_select_editor",height:o.height,el:{type:"bi.simple_state_editor",height:o.height}}),this.searcher=BI.createWidget({type:"bi.searcher",element:this,isAutoSearch:!1,isAutoSync:!1,onSearch:function(op,callback){callback({keyword:self.editor.getValue()})},el:this.editor,popup:BI.extend({type:"bi.multi_tree_search_pane",keywordGetter:function(){return self.editor.getValue()},itemsCreator:function(op,callback){op.keyword=self.editor.getValue(),o.itemsCreator(op,callback)},value:o.value},o.popup),adapter:o.adapter,masker:o.masker}),this.searcher.on(BI.Searcher.EVENT_START,function(){self.fireEvent(BI.MultiListTreeSearcher.EVENT_START)}),this.searcher.on(BI.Searcher.EVENT_PAUSE,function(){this.hasMatched(),self.fireEvent(BI.MultiListTreeSearcher.EVENT_PAUSE)}),this.searcher.on(BI.Searcher.EVENT_STOP,function(){self.fireEvent(BI.MultiListTreeSearcher.EVENT_STOP)}),this.searcher.on(BI.Searcher.EVENT_CHANGE,function(){self.fireEvent(BI.MultiListTreeSearcher.EVENT_CHANGE,arguments)}),BI.isNotNull(o.value)&&this.setState(o.value)},adjustView:function(){this.searcher.adjustView()},setAdapter:function(adapter){this.searcher.setAdapter(adapter)},isSearching:function(){return this.searcher.isSearching()},stopSearch:function(){this.searcher.stopSearch()},getKeyword:function(){return this.editor.getValue()},hasMatched:function(){return this.searcher.hasMatched()},hasChecked:function(){return this.searcher.getView()&&this.searcher.getView().hasChecked()},setState:function(ob){var o=this.options;ob||(ob={}),ob.value||(ob.value=[]);var count=0;if(BI.isNumber(ob))this.editor.setState(ob);else if(0===BI.size(ob.value))this.editor.setState(BI.Selection.None);else{var text="";BI.each(ob.value,function(idx,path){var childValue=BI.last(path);text+=(o.valueFormatter(childValue+"")||childValue)+"; ",count++}),count>20?this.editor.setState(BI.Selection.Multi):this.editor.setState(text)}},setValue:function(ob){this.setState(ob),this.searcher.setValue(ob)},getKey:function(){return this.editor.getValue()},getValue:function(){return this.searcher.getValue()},populate:function(items){this.searcher.populate.apply(this.searcher,arguments)}}),BI.MultiListTreeSearcher.EVENT_BEFORE_POPUPVIEW="EVENT_BEFORE_POPUPVIEW",BI.MultiListTreeSearcher.EVENT_CHANGE="EVENT_CHANGE",BI.MultiListTreeSearcher.EVENT_START="EVENT_START",BI.MultiListTreeSearcher.EVENT_STOP="EVENT_STOP",BI.MultiListTreeSearcher.EVENT_PAUSE="EVENT_PAUSE",BI.shortcut("bi.multi_list_tree_searcher",BI.MultiListTreeSearcher),BI.MultiTreeSearcher=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.MultiTreeSearcher.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-multi-tree-searcher",itemsCreator:BI.emptyFn,valueFormatter:function(v){return v},popup:{},adapter:null,masker:{}})},_init:function(){BI.MultiTreeSearcher.superclass._init.apply(this,arguments);var self=this,o=this.options;this.editor=BI.createWidget({type:"bi.multi_select_editor",watermark:o.watermark,height:o.height,el:{type:"bi.simple_state_editor",text:o.text,height:o.height},listeners:[{eventName:BI.MultiSelectEditor.EVENT_FOCUS,action:function(){self.fireEvent(BI.MultiSelectSearcher.EVENT_FOCUS)}},{eventName:BI.MultiSelectEditor.EVENT_BLUR,action:function(){self.fireEvent(BI.MultiSelectSearcher.EVENT_BLUR)}}]}),this.searcher=BI.createWidget({type:"bi.searcher",element:this,isAutoSearch:!1,isAutoSync:!1,onSearch:function(op,callback){callback({keyword:self.editor.getValue()})},el:this.editor,popup:BI.extend({type:"bi.multi_tree_search_pane",keywordGetter:function(){return self.editor.getValue()},itemsCreator:function(op,callback){op.keyword=self.editor.getValue(),o.itemsCreator(op,callback)},value:o.value},o.popup),adapter:o.adapter,masker:o.masker}),this.searcher.on(BI.Searcher.EVENT_START,function(){self.fireEvent(BI.MultiTreeSearcher.EVENT_START)}),this.searcher.on(BI.Searcher.EVENT_PAUSE,function(){this.hasMatched(),self.fireEvent(BI.MultiTreeSearcher.EVENT_PAUSE)}),this.searcher.on(BI.Searcher.EVENT_STOP,function(){self.fireEvent(BI.MultiTreeSearcher.EVENT_STOP)}),this.searcher.on(BI.Searcher.EVENT_CHANGE,function(){self.fireEvent(BI.MultiTreeSearcher.EVENT_CHANGE,arguments)}),this.searcher.on(BI.Searcher.EVENT_SEARCHING,function(){var keywords=this.getKeywords();self.fireEvent(BI.MultiTreeSearcher.EVENT_SEARCHING,keywords)}),BI.isNotNull(o.value)&&this.setState(o.value)},adjustView:function(){this.searcher.adjustView()},setAdapter:function(adapter){this.searcher.setAdapter(adapter)},isSearching:function(){return this.searcher.isSearching()},stopSearch:function(){this.searcher.stopSearch()},getKeyword:function(){return this.editor.getValue()},hasMatched:function(){return this.searcher.hasMatched()},hasChecked:function(){return this.searcher.getView()&&this.searcher.getView().hasChecked()},setState:function(ob){function getChildrenNode(ob){var text="",index=0,size=BI.size(ob);return BI.each(ob,function(name,children){index++;var childNodes=getChildrenNode(children);text+=(o.valueFormatter(name+"")||name)+(""===childNodes?"":":"+childNodes)+(index===size?"":","),""===childNodes&&count++}),text}var o=this.options;ob||(ob={}),ob.value||(ob.value={});var count=0;if(BI.isNumber(ob))this.editor.setState(ob);else if(0===BI.size(ob.value))this.editor.setState(BI.Selection.None);else{var text="";BI.each(ob.value,function(name,children){var childNodes=getChildrenNode(children);text+=(o.valueFormatter(name+"")||name)+(""===childNodes?"":":"+childNodes)+"; ",""===childNodes&&count++}),count>20?this.editor.setState(BI.Selection.Multi):this.editor.setState(text)}},setValue:function(ob){this.setState(ob),this.searcher.setValue(ob)},getKey:function(){return this.editor.getValue()},getValue:function(){return this.searcher.getValue()},populate:function(items){this.searcher.populate.apply(this.searcher,arguments)}}),BI.MultiTreeSearcher.EVENT_SEARCHING="EVENT_SEARCHING",BI.MultiTreeSearcher.EVENT_BEFORE_POPUPVIEW="EVENT_BEFORE_POPUPVIEW",BI.MultiTreeSearcher.EVENT_CHANGE="EVENT_CHANGE",BI.MultiTreeSearcher.EVENT_START="EVENT_START",BI.MultiTreeSearcher.EVENT_STOP="EVENT_STOP",BI.MultiTreeSearcher.EVENT_PAUSE="EVENT_PAUSE",BI.shortcut("bi.multi_tree_searcher",BI.MultiTreeSearcher),BI.NumberEditor=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.NumberEditor.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-number-editor bi-border bi-focus-shadow",validationChecker:function(){return!0},valueFormatter:function(v){return v},value:0,allowBlank:!1,errorText:"",step:1})},_init:function(){BI.NumberEditor.superclass._init.apply(this,arguments);var self=this,o=this.options;this.editor=BI.createWidget({type:"bi.sign_editor",height:o.height-2,allowBlank:o.allowBlank,value:o.valueFormatter(o.value),validationChecker:o.validationChecker,errorText:o.errorText}),this.editor.on(BI.TextEditor.EVENT_CHANGE,function(){self.fireEvent(BI.NumberEditor.EVENT_CHANGE)}),this.editor.on(BI.TextEditor.EVENT_ERROR,function(){o.value=BI.parseFloat(this.getLastValidValue())}),this.editor.on(BI.TextEditor.EVENT_VALID,function(){o.value=BI.parseFloat(this.getValue())}),this.editor.on(BI.TextEditor.EVENT_CONFIRM,function(){self.fireEvent(BI.NumberEditor.EVENT_CONFIRM)}),this.topBtn=BI.createWidget({type:"bi.icon_button",forceNotSelected:!0,trigger:"lclick,",cls:"add-up-font top-button bi-border-left bi-list-item-active2 icon-size-12"}),this.topBtn.on(BI.IconButton.EVENT_CHANGE,function(){self._finetuning(o.step),self.fireEvent(BI.NumberEditor.EVENT_CHANGE),self.fireEvent(BI.NumberEditor.EVENT_CONFIRM)}),this.bottomBtn=BI.createWidget({type:"bi.icon_button",trigger:"lclick,",forceNotSelected:!0,cls:"minus-down-font bottom-button bi-border-left bi-list-item-active2 icon-size-12"}),this.bottomBtn.on(BI.IconButton.EVENT_CHANGE,function(){self._finetuning(-o.step),self.fireEvent(BI.NumberEditor.EVENT_CHANGE),self.fireEvent(BI.NumberEditor.EVENT_CONFIRM)}),BI.createWidget({type:"bi.htape",height:o.height-2,element:this,items:[this.editor,{el:{type:"bi.grid",columns:1,rows:2,items:[{column:0,row:0,el:this.topBtn},{column:0,row:1,el:this.bottomBtn}]},width:23}]})},focus:function(){this.editor.focus()},isEditing:function(){return this.editor.isEditing()},_finetuning:function(add){var v=BI.parseFloat(this.getValue());this.setValue(BI.add(v,add))},setUpEnable:function(v){this.topBtn.setEnable(!!v)},setDownEnable:function(v){this.bottomBtn.setEnable(!!v)},getLastValidValue:function(){return this.editor.getLastValidValue()},getLastChangedValue:function(){return this.editor.getLastChangedValue()},getValue:function(){return this.options.value},setValue:function(v){var o=this.options;o.value=v,this.editor.setValue(o.valueFormatter(v))}}),BI.NumberEditor.EVENT_CONFIRM="EVENT_CONFIRM",BI.NumberEditor.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.number_editor",BI.NumberEditor),BI.NumberInterval=BI.inherit(BI.Single,{constants:{typeError:"typeBubble",numberError:"numberBubble",signalError:"signalBubble",editorWidth:114,columns:5,width:24,rows:1,numberErrorCls:"number-error",border:1,less:0,less_equal:1,numTip:"",adjustYOffset:2},_defaultConfig:function(){var conf=BI.NumberInterval.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{extraCls:"bi-number-interval"+(BI.isIE()&&BI.getIEVersion()<10?" hack":""),height:24,validation:"valid",closeMin:!0,allowBlank:!0,watermark:BI.i18nText("BI-Basic_Unrestricted")})},_init:function(){var self=this,c=this.constants,o=this.options;BI.NumberInterval.superclass._init.apply(this,arguments),this.smallEditor=BI.createWidget({type:"bi.number_interval_single_editor",height:o.height-2,watermark:o.watermark,allowBlank:o.allowBlank,value:o.min,level:"warning",tipType:"success",title:function(){return self.smallEditor&&self.smallEditor.getValue()},quitChecker:function(){return!1},validationChecker:function(v){return!!BI.isNumeric(v)||(self.smallEditorBubbleType=c.typeError,!1)},cls:"number-interval-small-editor bi-border"}),this.smallTip=BI.createWidget({type:"bi.label",text:o.numTip,height:o.height-2,invisible:!0}),BI.createWidget({type:"bi.absolute",element:this.smallEditor.element,items:[{el:this.smallTip,top:0,right:5}]}),this.bigEditor=BI.createWidget({type:"bi.number_interval_single_editor",height:o.height-2,watermark:o.watermark,allowBlank:o.allowBlank,value:o.max,level:"warning",tipType:"success",title:function(){return self.bigEditor&&self.bigEditor.getValue()},quitChecker:function(){return!1},validationChecker:function(v){return!!BI.isNumeric(v)||(self.bigEditorBubbleType=c.typeError,!1)},cls:"number-interval-big-editor bi-border"}),this.bigTip=BI.createWidget({type:"bi.label",text:o.numTip,height:o.height-2,invisible:!0}),BI.createWidget({type:"bi.absolute",element:this.bigEditor.element,items:[{el:this.bigTip,top:0,right:5}]}),this.smallCombo=BI.createWidget({type:"bi.icon_combo",cls:"number-interval-small-combo bi-border-top bi-border-bottom bi-border-right",height:o.height-2,items:[{text:"("+BI.i18nText("BI-Less_Than")+")",iconCls:"less-font",value:0},{text:"("+BI.i18nText("BI-Less_And_Equal")+")",value:1,iconCls:"less-equal-font"}]}),o.closeMin===!0?this.smallCombo.setValue(1):this.smallCombo.setValue(0),this.bigCombo=BI.createWidget({type:"bi.icon_combo",cls:"number-interval-big-combo bi-border-top bi-border-bottom bi-border-left",height:o.height-2,items:[{text:"("+BI.i18nText("BI-Less_Than")+")",iconCls:"less-font",value:0},{text:"("+BI.i18nText("BI-Less_And_Equal")+")",value:1,iconCls:"less-equal-font"}]}),o.closeMax===!0?this.bigCombo.setValue(1):this.bigCombo.setValue(0),this.label=BI.createWidget({type:"bi.label",text:BI.i18nText("BI-Basic_Value"),textHeight:o.height-2*c.border,width:c.width-2*c.border,height:o.height-2*c.border,level:"warning",tipType:"warning"}),this.left=BI.createWidget({type:"bi.htape",items:[{el:self.smallEditor},{el:self.smallCombo,width:c.width-c.border}]}),this.right=BI.createWidget({type:"bi.htape",items:[{el:self.bigCombo,width:c.width-c.border},{el:self.bigEditor,lgap:1}]}),BI.createWidget({element:self,type:"bi.center",hgap:15,height:o.height,items:[{type:"bi.absolute",items:[{el:self.left,left:-15,right:0,top:0,bottom:0}]},{type:"bi.absolute",items:[{el:self.right,left:0,right:-15,top:0,bottom:0}]}]}),BI.createWidget({element:self,type:"bi.horizontal_auto",items:[self.label]}),self._setValidEvent(self.bigEditor,c.bigEditor),self._setValidEvent(self.smallEditor,c.smallEditor),self._setErrorEvent(self.bigEditor,c.bigEditor),self._setErrorEvent(self.smallEditor,c.smallEditor),self._setBlurEvent(self.bigEditor),self._setBlurEvent(self.smallEditor),self._setFocusEvent(self.bigEditor),self._setFocusEvent(self.smallEditor),self._setComboValueChangedEvent(self.bigCombo),self._setComboValueChangedEvent(self.smallCombo),self._setEditorValueChangedEvent(self.bigEditor),self._setEditorValueChangedEvent(self.smallEditor),self._checkValidation()},_checkValidation:function(){var self=this,c=this.constants,o=this.options;if(self._setTitle(""),BI.Bubbles.hide(c.typeError),BI.Bubbles.hide(c.numberError),BI.Bubbles.hide(c.signalError),!self.smallEditor.isValid()||!self.bigEditor.isValid())return self.element.removeClass("number-error"),o.validation="invalid",c.typeError;if(BI.isEmptyString(self.smallEditor.getValue())||BI.isEmptyString(self.bigEditor.getValue()))return self.element.removeClass("number-error"),o.validation="valid","";var smallValue=parseFloat(self.smallEditor.getValue()),bigValue=parseFloat(self.bigEditor.getValue()),bigComboValue=self.bigCombo.getValue(),smallComboValue=self.smallCombo.getValue();return bigComboValue[0]===c.less_equal&&smallComboValue[0]===c.less_equal?smallValue>bigValue?(self.element.addClass("number-error"),o.validation="invalid",c.numberError):(self.element.removeClass("number-error"),o.validation="valid",""):smallValue>bigValue?(self.element.addClass("number-error"),o.validation="invalid",c.numberError):smallValue===bigValue?(self.element.addClass("number-error"),o.validation="invalid",c.signalError):(self.element.removeClass("number-error"),o.validation="valid","")},_setTitle:function(v){var self=this;self.bigEditor.setTitle(v),self.smallEditor.setTitle(v),self.label.setTitle(v)},_setFocusEvent:function(w){var self=this,c=this.constants;w.on(BI.NumberIntervalSingleEidtor.EVENT_FOCUS,function(){switch(self._setTitle(""),self._checkValidation()){case c.typeError:BI.Bubbles.show(c.typeError,BI.i18nText("BI-Numerical_Interval_Input_Data"),self,{offsetStyle:"left",adjustYOffset:c.adjustYOffset});break;case c.numberError:BI.Bubbles.show(c.numberError,BI.i18nText("BI-Numerical_Interval_Number_Value"),self,{offsetStyle:"left",adjustYOffset:c.adjustYOffset});break;case c.signalError:BI.Bubbles.show(c.signalError,BI.i18nText("BI-Numerical_Interval_Signal_Value"),self,{offsetStyle:"left",adjustYOffset:c.adjustYOffset});break;default:return}})},_setBlurEvent:function(w){var c=this.constants,self=this;w.on(BI.NumberIntervalSingleEidtor.EVENT_BLUR,function(){switch(BI.Bubbles.hide(c.typeError),BI.Bubbles.hide(c.numberError),BI.Bubbles.hide(c.signalError),self._checkValidation()){case c.typeError:self._setTitle(BI.i18nText("BI-Numerical_Interval_Input_Data"));break;case c.numberError:self._setTitle(BI.i18nText("BI-Numerical_Interval_Number_Value"));break;case c.signalError:self._setTitle(BI.i18nText("BI-Numerical_Interval_Signal_Value"));break;default:self._setTitle("")}})},_setErrorEvent:function(w){var c=this.constants,self=this;w.on(BI.NumberIntervalSingleEidtor.EVENT_ERROR,function(){self._checkValidation(),BI.Bubbles.show(c.typeError,BI.i18nText("BI-Numerical_Interval_Input_Data"),self,{offsetStyle:"left",adjustYOffset:c.adjustYOffset}),self.fireEvent(BI.NumberInterval.EVENT_ERROR)})},_setValidEvent:function(w){var self=this,c=this.constants;w.on(BI.NumberIntervalSingleEidtor.EVENT_VALID,function(){switch(self._checkValidation()){case c.numberError:BI.Bubbles.show(c.numberError,BI.i18nText("BI-Numerical_Interval_Number_Value"),self,{offsetStyle:"left",adjustYOffset:c.adjustYOffset}),self.fireEvent(BI.NumberInterval.EVENT_ERROR);break;case c.signalError:BI.Bubbles.show(c.signalError,BI.i18nText("BI-Numerical_Interval_Signal_Value"),self,{offsetStyle:"left",adjustYOffset:c.adjustYOffset}),self.fireEvent(BI.NumberInterval.EVENT_ERROR);break;default:self.fireEvent(BI.NumberInterval.EVENT_VALID)}})},_setEditorValueChangedEvent:function(w){var self=this,c=this.constants;w.on(BI.NumberIntervalSingleEidtor.EVENT_CHANGE,function(){switch(self._checkValidation()){case c.typeError:BI.Bubbles.show(c.typeError,BI.i18nText("BI-Numerical_Interval_Input_Data"),self,{offsetStyle:"left",adjustYOffset:c.adjustYOffset});break;case c.numberError:BI.Bubbles.show(c.numberError,BI.i18nText("BI-Numerical_Interval_Number_Value"),self,{offsetStyle:"left",adjustYOffset:c.adjustYOffset});break;case c.signalError:BI.Bubbles.show(c.signalError,BI.i18nText("BI-Numerical_Interval_Signal_Value"),self,{offsetStyle:"left",adjustYOffset:c.adjustYOffset})}self.fireEvent(BI.NumberInterval.EVENT_CHANGE)}),w.on(BI.NumberIntervalSingleEidtor.EVENT_CONFIRM,function(){self.fireEvent(BI.NumberInterval.EVENT_CONFIRM)})},_setComboValueChangedEvent:function(w){var self=this,c=this.constants;w.on(BI.IconCombo.EVENT_CHANGE,function(){switch(self._checkValidation()){case c.typeError:self._setTitle(BI.i18nText("BI-Numerical_Interval_Input_Data")),self.fireEvent(BI.NumberInterval.EVENT_ERROR);break;case c.numberError:self._setTitle(BI.i18nText("BI-Numerical_Interval_Number_Value")),self.fireEvent(BI.NumberInterval.EVENT_ERROR);break;case c.signalError:self._setTitle(BI.i18nText("BI-Numerical_Interval_Signal_Value")),self.fireEvent(BI.NumberInterval.EVENT_ERROR);break;default:self.fireEvent(BI.NumberInterval.EVENT_CHANGE),self.fireEvent(BI.NumberInterval.EVENT_CONFIRM),self.fireEvent(BI.NumberInterval.EVENT_VALID)}})},isStateValid:function(){return"valid"===this.options.validation},setMinEnable:function(b){this.smallEditor.setEnable(b)},setCloseMinEnable:function(b){this.smallCombo.setEnable(b)},setMaxEnable:function(b){this.bigEditor.setEnable(b)},setCloseMaxEnable:function(b){this.bigCombo.setEnable(b)},showNumTip:function(){this.smallTip.setVisible(!0),this.bigTip.setVisible(!0)},hideNumTip:function(){this.smallTip.setVisible(!1),this.bigTip.setVisible(!1)},setNumTip:function(numTip){this.smallTip.setText(numTip),this.bigTip.setText(numTip)},getNumTip:function(){return this.smallTip.getText()},setValue:function(data){data=data||{};var self=this,combo_value;(BI.isNumeric(data.min)||BI.isEmptyString(data.min))&&self.smallEditor.setValue(data.min),BI.isNotNull(data.min)||self.smallEditor.setValue(""),(BI.isNumeric(data.max)||BI.isEmptyString(data.max))&&self.bigEditor.setValue(data.max),BI.isNotNull(data.max)||self.bigEditor.setValue(""),BI.isNull(data.closeMin)||(combo_value=data.closeMin===!0?1:0,self.smallCombo.setValue(combo_value)),BI.isNull(data.closeMax)||(combo_value=data.closeMax===!0?1:0,self.bigCombo.setValue(combo_value)),this._checkValidation()},getValue:function(){var self=this,value={},minComboValue=self.smallCombo.getValue(),maxComboValue=self.bigCombo.getValue();return value.min=self.smallEditor.getValue(),value.max=self.bigEditor.getValue(),0===minComboValue[0]?value.closeMin=!1:value.closeMin=!0,0===maxComboValue[0]?value.closeMax=!1:value.closeMax=!0,value},destroyed:function(){var c=this.constants;BI.Bubbles.remove(c.typeError),BI.Bubbles.remove(c.numberError),BI.Bubbles.remove(c.signalError)}}),BI.NumberInterval.EVENT_CHANGE="EVENT_CHANGE",BI.NumberInterval.EVENT_CONFIRM="EVENT_CONFIRM",BI.NumberInterval.EVENT_VALID="EVENT_VALID",BI.NumberInterval.EVENT_ERROR="EVENT_ERROR",BI.shortcut("bi.number_interval",BI.NumberInterval),BI.NumberIntervalSingleEidtor=BI.inherit(BI.Single,{props:{baseCls:"bi-number-interval-single-editor",tipType:"success",title:""},render:function(){var self=this,o=this.options;return{type:"bi.vertical",items:[{type:"bi.editor",ref:function(_ref){self.editor=_ref},height:o.height-2,watermark:o.watermark,allowBlank:o.allowBlank,value:o.value,level:o.level,quitChecker:o.quitChecker,validationChecker:o.validationChecker,listeners:[{eventName:BI.Editor.EVENT_ERROR,action:function(){self.fireEvent(BI.NumberIntervalSingleEidtor.EVENT_ERROR,arguments)}},{eventName:BI.Editor.EVENT_FOCUS,action:function(){self.fireEvent(BI.NumberIntervalSingleEidtor.EVENT_FOCUS,arguments)}},{eventName:BI.Editor.EVENT_BLUR,action:function(){self.fireEvent(BI.NumberIntervalSingleEidtor.EVENT_BLUR,arguments)}},{eventName:BI.Editor.EVENT_VALID,action:function(){self.fireEvent(BI.NumberIntervalSingleEidtor.EVENT_VALID,arguments)}},{eventName:BI.Editor.EVENT_CHANGE,action:function(){self.fireEvent(BI.NumberIntervalSingleEidtor.EVENT_CHANGE,arguments)}},{eventName:BI.Editor.EVENT_CONFIRM,action:function(){self.fireEvent(BI.NumberIntervalSingleEidtor.EVENT_CONFIRM,arguments)}},{eventName:BI.Editor.EVENT_CHANGE_CONFIRM,action:function(){self.fireEvent(BI.NumberIntervalSingleEidtor.EVENT_CHANGE_CONFIRM,arguments)}}]}]}},isValid:function(){return this.editor.isValid()},getValue:function(){return this.editor.getValue()},setTitle:function(v){return this.editor.setTitle(v)},setValue:function(v){return this.editor.setValue(v)}}),BI.NumberIntervalSingleEidtor.EVENT_FOCUS="EVENT_FOCUS",BI.NumberIntervalSingleEidtor.EVENT_BLUR="EVENT_BLUR",BI.NumberIntervalSingleEidtor.EVENT_ERROR="EVENT_ERROR",BI.NumberIntervalSingleEidtor.EVENT_VALID="EVENT_VALID",BI.NumberIntervalSingleEidtor.EVENT_CHANGE="EVENT_CHANGE",BI.NumberIntervalSingleEidtor.EVENT_CHANGE_CONFIRM="EVENT_CHANGE_CONFIRM",BI.NumberIntervalSingleEidtor.EVENT_CONFIRM="EVENT_CONFIRM",BI.shortcut("bi.number_interval_single_editor",BI.NumberIntervalSingleEidtor),BI.SearchMultiTextValueCombo=BI.inherit(BI.Single,{_defaultConfig:function(){return BI.extend(BI.SearchMultiTextValueCombo.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-multi-select-combo bi-search-multi-text-value-combo",height:24,items:[]})},_init:function(){BI.SearchMultiTextValueCombo.superclass._init.apply(this,arguments);var self=this,o=this.options,assertShowValue=function(){BI.isKey(self._startValue)&&(self.storeValue.type===BI.Selection.All?BI.remove(self.storeValue.value,self._startValue):BI.pushDistinct(self.storeValue.value,self._startValue)),self._updateAllValue(),self._checkError(),self.trigger.getSearcher().setState(self.storeValue),self.trigger.getCounter().setButtonChecked(self.storeValue)};this.storeValue=BI.deepClone(o.value||{}),this._updateAllValue(),this._assertValue(this.storeValue),this._checkError(),this.requesting=!1,this.trigger=BI.createWidget({type:"bi.search_multi_select_trigger",text:o.text,height:o.height,masker:{offset:{left:0,top:0,right:0,bottom:25}},allValueGetter:function(){return self.allValue},valueFormatter:o.valueFormatter,itemsCreator:function(op,callback){self._itemsCreator(op,function(res){1===op.times&&BI.isNotNull(op.keywords)&&self.trigger.setValue(BI.deepClone(self.getValue())),callback.apply(self,arguments)})},value:this.storeValue,warningTitle:o.warningTitle}),this.trigger.on(BI.MultiSelectTrigger.EVENT_START,function(){self._setStartValue(""),this.getSearcher().setValue(self.storeValue)}),this.trigger.on(BI.MultiSelectTrigger.EVENT_STOP,function(){self._setStartValue("")}),this.trigger.on(BI.MultiSelectTrigger.EVENT_PAUSE,function(){if(this.getSearcher().hasMatched()){var keyword=this.getSearcher().getKeyword();self._join({type:BI.Selection.Multi,value:[keyword]},function(){self.combo.setValue(self.storeValue),self._setStartValue(keyword),assertShowValue(),self._populate(),self._setStartValue("")})}}),this.trigger.on(BI.MultiSelectTrigger.EVENT_SEARCHING,function(keywords){var last=BI.last(keywords);keywords=BI.initial(keywords||[]),keywords.length>0&&self._joinKeywords(keywords,function(){BI.isEndWithBlank(last)?(self.combo.setValue(self.storeValue),assertShowValue(),self.combo.populate(),self._setStartValue("")):(self.combo.setValue(self.storeValue),assertShowValue())})}),this.trigger.on(BI.MultiSelectTrigger.EVENT_CHANGE,function(value,obj){obj instanceof BI.MultiSelectBar?self._joinAll(this.getValue(),function(){assertShowValue()}):self._join(this.getValue(),function(){assertShowValue()})}),this.trigger.on(BI.MultiSelectTrigger.EVENT_BEFORE_COUNTER_POPUPVIEW,function(){this.getCounter().setValue(self.storeValue)}),this.trigger.on(BI.MultiSelectTrigger.EVENT_COUNTER_CLICK,function(){self.combo.isViewVisible()||self.combo.showView()}),this.combo=BI.createWidget({type:"bi.combo",toggle:!1,container:o.container,el:this.trigger,adjustLength:1,popup:{type:"bi.search_multi_select_popup_view",ref:function(){self.popup=this,self.trigger.setAdapter(this)},listeners:[{eventName:BI.MultiSelectPopupView.EVENT_CHANGE,action:function(){self.storeValue=this.getValue(),self._adjust(function(){assertShowValue()})}},{eventName:BI.MultiSelectPopupView.EVENT_CLICK_CONFIRM,action:function(){self._defaultState()}},{eventName:BI.MultiSelectPopupView.EVENT_CLICK_CLEAR,action:function(){self.setValue(),self._defaultState()}}],itemsCreator:BI.bind(self._itemsCreator,this),valueFormatter:o.valueFormatter,onLoaded:function(){BI.nextTick(function(){self.combo.adjustWidth(),self.combo.adjustHeight(),self.trigger.getCounter().adjustView(),self.trigger.getSearcher().adjustView()})}},value:o.value,hideChecker:function(e){return 0===triggerBtn.element.find(e.target).length}}),this.combo.on(BI.Combo.EVENT_BEFORE_POPUPVIEW,function(){this.setValue(self.storeValue),BI.nextTick(function(){self._populate()})}),this.wants2Quit=!1,this.combo.on(BI.Combo.EVENT_AFTER_HIDEVIEW,function(){self.trigger.stopEditing(),self.requesting===!0?self.wants2Quit=!0:(assertShowValue(),self.fireEvent(BI.SearchMultiTextValueCombo.EVENT_CONFIRM))});var triggerBtn=BI.createWidget({type:"bi.trigger_icon_button",width:o.height,height:o.height,cls:"multi-select-trigger-icon-button"});triggerBtn.on(BI.TriggerIconButton.EVENT_CHANGE,function(){self.trigger.getCounter().hideView(),self.combo.isViewVisible()?self.combo.hideView():self.combo.showView()}),BI.createWidget({type:"bi.absolute",element:this,items:[{el:this.combo,left:0,right:0,top:0,bottom:0},{el:triggerBtn,right:0,top:0,bottom:0}]}),this._checkError()},_defaultState:function(){this.trigger.stopEditing(),this.combo.hideView()},_assertValue:function(val){var o=this.options;val||(val={}),val.type||(val.type=BI.Selection.Multi),val.value||(val.value=[]),BI.remove(val.value,function(idx,value){return!BI.contains(BI.map(o.items,"value"),value)})},_makeMap:function(values){return BI.makeObject(values||[])},_joinKeywords:function(keywords,callback){function digest(items){var selectedMap=self._makeMap(items);BI.each(keywords,function(i,val){BI.isNotNull(selectedMap[val])&&(self.storeValue.type===BI.Selection.Multi?BI.pushDistinct(self.storeValue.value,val):BI.remove(self.storeValue.value,val))}),self._adjust(callback)}var self=this,o=this.options;this._assertValue(this.storeValue),this.requesting=!0,this._itemsCreator({type:BI.SearchMultiTextValueCombo.REQ_GET_ALL_DATA,keywords:keywords},function(ob){var values=BI.map(ob.items,"value");digest(values)})},_joinAll:function(res,callback){var self=this,o=this.options;this._assertValue(res),this.requesting=!0,this._itemsCreator({type:BI.SearchMultiTextValueCombo.REQ_GET_ALL_DATA,keywords:[this.trigger.getKey()]},function(ob){var items=BI.map(ob.items,"value");if(self.storeValue.type===res.type){var change=!1,map=self._makeMap(self.storeValue.value);return BI.each(items,function(i,v){BI.isNotNull(map[v])&&(change=!0,self.storeValue.assist&&self.storeValue.assist.push(map[v]),delete map[v])}),change&&(self.storeValue.value=BI.values(map)),void self._adjust(callback)}var selectedMap=self._makeMap(self.storeValue.value),notSelectedMap=self._makeMap(res.value),newItems=[];BI.each(items,function(i,item){BI.isNotNull(selectedMap[items[i]])&&(self.storeValue.assist&&self.storeValue.assist.push(selectedMap[items[i]]),delete selectedMap[items[i]]),BI.isNull(notSelectedMap[items[i]])&&(BI.remove(self.storeValue.assist,item),newItems.push(item))}),self.storeValue.value=newItems.concat(BI.values(selectedMap)),self._adjust(callback)})},_adjust:function(callback){function adjust(){self.storeValue.type===BI.Selection.All&&self.storeValue.value.length>=self._count?self.storeValue={type:BI.Selection.Multi,value:[]}:self.storeValue.type===BI.Selection.Multi&&self.storeValue.value.length>=self._count&&(self.storeValue={ +type:BI.Selection.All,value:[]}),self._updateAllValue(),self._checkError(),self.wants2Quit===!0&&(self.fireEvent(BI.SearchMultiTextValueCombo.EVENT_CONFIRM),self.wants2Quit=!1),self.requesting=!1}var self=this,o=this.options;this._count?(adjust(),callback()):this._itemsCreator({type:BI.SearchMultiTextValueCombo.REQ_GET_DATA_LENGTH},function(res){self._count=res.count,adjust(),callback()})},_join:function(res,callback){var self=this,o=this.options;if(this._assertValue(res),this._assertValue(this.storeValue),this.storeValue.type===res.type){var map=this._makeMap(this.storeValue.value);BI.each(res.value,function(i,v){map[v]||(self.storeValue.value.push(v),BI.remove(self.storeValue.assist,v),map[v]=v)});var change=!1;return BI.each(res.assist,function(i,v){BI.isNotNull(map[v])&&(change=!0,self.storeValue.assist&&self.storeValue.assist.push(map[v]),delete map[v])}),change&&(this.storeValue.value=BI.values(map)),void self._adjust(callback)}this._joinAll(res,callback)},_setStartValue:function(value){this._startValue=value,this.popup.setStartValue(value)},_getItemsByTimes:function(items,times){for(var res=[],i=100*(times-1);items[i]&&i<100*times;i++)res.push(items[i]);return res},_hasNextByTimes:function(items,times){return 100*times0&&self.numberCounter.hideView()})},getCounter:function(){return this.numberCounter},getSearcher:function(){return this.searcher},stopEditing:function(){this.searcher.stopSearch(),this.numberCounter.hideView()},setAdapter:function(adapter){this.searcher.setAdapter(adapter),this.numberCounter.setAdapter(adapter)},setValue:function(ob){this.searcher.setValue(ob),this.numberCounter.setValue(ob)},setTipType:function(v){this.searcher.setTipType(v)},getKey:function(){return this.searcher.getKey()},getValue:function(){return this.searcher.getValue()}}),BI.SearchMultiSelectTrigger.EVENT_TRIGGER_CLICK="EVENT_TRIGGER_CLICK",BI.SearchMultiSelectTrigger.EVENT_COUNTER_CLICK="EVENT_COUNTER_CLICK",BI.SearchMultiSelectTrigger.EVENT_CHANGE="EVENT_CHANGE",BI.SearchMultiSelectTrigger.EVENT_START="EVENT_START",BI.SearchMultiSelectTrigger.EVENT_STOP="EVENT_STOP",BI.SearchMultiSelectTrigger.EVENT_PAUSE="EVENT_PAUSE",BI.SearchMultiSelectTrigger.EVENT_SEARCHING="EVENT_SEARCHING",BI.SearchMultiSelectTrigger.EVENT_BEFORE_COUNTER_POPUPVIEW="EVENT_BEFORE_COUNTER_POPUPVIEW",BI.shortcut("bi.search_multi_select_trigger",BI.SearchMultiSelectTrigger),BI.SearchMultiSelectLoader=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.SearchMultiSelectLoader.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-multi-select-loader",logic:{dynamic:!0},el:{height:400},valueFormatter:BI.emptyFn,itemsCreator:BI.emptyFn,onLoaded:BI.emptyFn})},_init:function(){BI.SearchMultiSelectLoader.superclass._init.apply(this,arguments);var self=this,opts=this.options,hasNext=!1;this.storeValue=opts.value||{},this._assertValue(this.storeValue),this.button_group=BI.createWidget({type:"bi.select_list",element:this,logic:opts.logic,el:BI.extend({onLoaded:opts.onLoaded,el:{type:"bi.loader",isDefaultInit:!1,logic:{dynamic:!0,scrolly:!0},el:{chooseType:BI.ButtonGroup.CHOOSE_TYPE_MULTI,behaviors:{redmark:function(){return!0}},layouts:[{type:"bi.vertical"}]}}},opts.el),itemsCreator:function(op,callback){var startValue=self._startValue;self.storeValue&&(op=BI.extend(op||{},{selectedValues:BI.isKey(startValue)&&self.storeValue.type===BI.Selection.Multi?self.storeValue.value.concat(startValue):self.storeValue.value})),opts.itemsCreator(op,function(ob){hasNext=ob.hasNext;var firstItems=[];if(1===op.times&&self.storeValue){var json=BI.map(self.storeValue.value,function(i,v){var txt=opts.valueFormatter(v)||v;return{text:txt,value:v,title:txt,selected:self.storeValue.type===BI.Selection.Multi}});if(BI.isKey(self._startValue)&&!BI.contains(self.storeValue.value,self._startValue)){var txt=opts.valueFormatter(startValue)||startValue;json.unshift({text:txt,value:startValue,title:txt,selected:!0})}firstItems=self._createItems(json)}callback(firstItems.concat(self._createItems(ob.items)),ob.keyword||""),1===op.times&&self.storeValue&&(BI.isKey(startValue)&&(self.storeValue.type===BI.Selection.All?BI.remove(self.storeValue.value,startValue):BI.pushDistinct(self.storeValue.value,startValue)),self.setValue(self.storeValue)),1===op.times&&self._scrollToTop()})},hasNext:function(){return hasNext},value:this.storeValue}),this.button_group.on(BI.Controller.EVENT_CHANGE,function(){self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.button_group.on(BI.SelectList.EVENT_CHANGE,function(){self.fireEvent(BI.SearchMultiSelectLoader.EVENT_CHANGE,arguments)})},_createItems:function(items){return BI.createItems(items,{type:"bi.multi_select_item",logic:this.options.logic,cls:"bi-list-item-active",height:24,selected:this.isAllSelected(),iconWrapperWidth:36})},_scrollToTop:function(){var self=this;BI.delay(function(){self.button_group.element.scrollTop(0)},30)},isAllSelected:function(){return this.button_group.isAllSelected()},_assertValue:function(val){val||(val={}),val.type||(val.type=BI.Selection.Multi),val.value||(val.value=[])},setStartValue:function(v){this._startValue=v},setValue:function(v){this.storeValue=v||{},this._assertValue(this.storeValue),this.button_group.setValue(this.storeValue)},getValue:function(){return this.button_group.getValue()},getAllButtons:function(){return this.button_group.getAllButtons()},empty:function(){this.button_group.empty()},populate:function(items){arguments[0]=this._createItems(items),this.button_group.populate.apply(this.button_group,arguments)},resetHeight:function(h){this.button_group.resetHeight(h)},resetWidth:function(w){this.button_group.resetWidth(w)}}),BI.SearchMultiSelectLoader.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.search_multi_select_loader",BI.SearchMultiSelectLoader),BI.SearchMultiSelectPopupView=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.SearchMultiSelectPopupView.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-multi-select-popup-view",maxWidth:"auto",minWidth:135,maxHeight:400,valueFormatter:BI.emptyFn,itemsCreator:BI.emptyFn,onLoaded:BI.emptyFn})},_init:function(){BI.SearchMultiSelectPopupView.superclass._init.apply(this,arguments);var self=this,opts=this.options;this.loader=BI.createWidget({type:"bi.search_multi_select_loader",itemsCreator:opts.itemsCreator,valueFormatter:opts.valueFormatter,onLoaded:opts.onLoaded,value:opts.value}),this.popupView=BI.createWidget({type:"bi.multi_popup_view",stopPropagation:!1,maxWidth:opts.maxWidth,minWidth:opts.minWidth,maxHeight:opts.maxHeight,element:this,buttons:[BI.i18nText("BI-Basic_Clears"),BI.i18nText("BI-Basic_Sure")],el:this.loader,value:opts.value}),this.popupView.on(BI.MultiPopupView.EVENT_CHANGE,function(){self.fireEvent(BI.SearchMultiSelectPopupView.EVENT_CHANGE)}),this.popupView.on(BI.MultiPopupView.EVENT_CLICK_TOOLBAR_BUTTON,function(index){switch(index){case 0:self.fireEvent(BI.SearchMultiSelectPopupView.EVENT_CLICK_CLEAR);break;case 1:self.fireEvent(BI.SearchMultiSelectPopupView.EVENT_CLICK_CONFIRM)}})},isAllSelected:function(){return this.loader.isAllSelected()},setStartValue:function(v){this.loader.setStartValue(v)},setValue:function(v){this.popupView.setValue(v)},getValue:function(){return this.popupView.getValue()},populate:function(items){this.popupView.populate.apply(this.popupView,arguments)},resetHeight:function(h){this.popupView.resetHeight(h)},resetWidth:function(w){this.popupView.resetWidth(w)}}),BI.SearchMultiSelectPopupView.EVENT_CHANGE="EVENT_CHANGE",BI.SearchMultiSelectPopupView.EVENT_CLICK_CONFIRM="EVENT_CLICK_CONFIRM",BI.SearchMultiSelectPopupView.EVENT_CLICK_CLEAR="EVENT_CLICK_CLEAR",BI.shortcut("bi.search_multi_select_popup_view",BI.SearchMultiSelectPopupView),BI.SearchMultiSelectSearcher=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.SearchMultiSelectSearcher.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-multi-select-searcher",itemsCreator:BI.emptyFn,el:{},popup:{},valueFormatter:BI.emptyFn,adapter:null,masker:{}})},_init:function(){BI.SearchMultiSelectSearcher.superclass._init.apply(this,arguments);var self=this,o=this.options;this.editor=BI.createWidget(o.el,{type:"bi.multi_select_editor",height:o.height,text:o.text,tipType:o.tipType,warningTitle:o.warningTitle}),this.searcher=BI.createWidget({type:"bi.searcher",element:this,height:o.height,isAutoSearch:!1,isAutoSync:!1,onSearch:function(op,callback){callback()},el:this.editor,popup:BI.extend({type:"bi.multi_select_search_pane",valueFormatter:o.valueFormatter,keywordGetter:function(){return self.editor.getValue()},itemsCreator:function(op,callback){var keyword=self.editor.getValue();op.keywords=[keyword],this.setKeyword(keyword),o.itemsCreator(op,callback)},value:o.value},o.popup),adapter:o.adapter,masker:o.masker}),this.searcher.on(BI.Searcher.EVENT_START,function(){self.fireEvent(BI.SearchMultiSelectSearcher.EVENT_START)}),this.searcher.on(BI.Searcher.EVENT_PAUSE,function(){this.hasMatched(),self.fireEvent(BI.SearchMultiSelectSearcher.EVENT_PAUSE)}),this.searcher.on(BI.Searcher.EVENT_STOP,function(){self.fireEvent(BI.SearchMultiSelectSearcher.EVENT_STOP)}),this.searcher.on(BI.Searcher.EVENT_CHANGE,function(){self.fireEvent(BI.SearchMultiSelectSearcher.EVENT_CHANGE,arguments)}),this.searcher.on(BI.Searcher.EVENT_SEARCHING,function(){var keywords=this.getKeywords();self.fireEvent(BI.SearchMultiSelectSearcher.EVENT_SEARCHING,keywords)}),BI.isNotNull(o.value)&&this.setState(o.value)},adjustView:function(){this.searcher.adjustView()},isSearching:function(){return this.searcher.isSearching()},stopSearch:function(){this.searcher.stopSearch()},getKeyword:function(){return this.editor.getValue()},hasMatched:function(){return this.searcher.hasMatched()},hasChecked:function(){return this.searcher.getView()&&this.searcher.getView().hasChecked()},setAdapter:function(adapter){this.searcher.setAdapter(adapter)},setState:function(obj){var o=this.options,ob={};if(ob.type=obj.type,ob.value=o.allValueGetter()||[],ob.assist=obj.assist,ob.type===BI.Selection.All)if(0===ob.value.length)this.editor.setState(BI.Selection.All);else if(BI.size(ob.assist)<=20){var state="";BI.each(ob.assist,function(i,v){state+=0===i?""+(o.valueFormatter(v+"")||v):","+(o.valueFormatter(v+"")||v)}),this.editor.setState(state)}else this.editor.setState(BI.Selection.Multi);else if(0===ob.value.length)this.editor.setState(BI.Selection.None);else if(BI.size(ob.value)<=20){var state="";BI.each(ob.value,function(i,v){state+=0===i?""+(o.valueFormatter(v+"")||v):","+(o.valueFormatter(v+"")||v)}),this.editor.setState(state)}else this.editor.setState(BI.Selection.Multi)},setTipType:function(v){this.editor.setTipType(v)},setValue:function(ob){this.setState(ob),this.searcher.setValue(ob)},getKey:function(){return this.editor.getValue()},getValue:function(){return this.searcher.getValue()},populate:function(items){this.searcher.populate.apply(this.searcher,arguments)}}),BI.SearchMultiSelectSearcher.EVENT_BEFORE_POPUPVIEW="EVENT_BEFORE_POPUPVIEW",BI.SearchMultiSelectSearcher.EVENT_CHANGE="EVENT_CHANGE",BI.SearchMultiSelectSearcher.EVENT_START="EVENT_START",BI.SearchMultiSelectSearcher.EVENT_STOP="EVENT_STOP",BI.SearchMultiSelectSearcher.EVENT_PAUSE="EVENT_PAUSE",BI.SearchMultiSelectSearcher.EVENT_SEARCHING="EVENT_SEARCHING",BI.shortcut("bi.search_multi_select_searcher",BI.SearchMultiSelectSearcher),BI.SelectTreeFirstPlusGroupNode=BI.inherit(BI.NodeButton,{_defaultConfig:function(){var conf=BI.SelectTreeFirstPlusGroupNode.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{baseCls:(conf.baseCls||"")+" bi-select-tree-first-plus-group-node bi-list-item-active",logic:{dynamic:!1},id:"",pId:"",readonly:!0,open:!1,height:24})},_init:function(){BI.SelectTreeFirstPlusGroupNode.superclass._init.apply(this,arguments);var self=this,o=this.options;this.checkbox=BI.createWidget({type:"bi.first_tree_node_checkbox",stopPropagation:!0}),this.text=BI.createWidget({type:"bi.label",textAlign:"left",whiteSpace:"nowrap",textHeight:o.height,height:o.height,hgap:o.hgap,text:o.text,value:o.value,keyword:o.keyword,py:o.py}),this.checkbox.on(BI.Controller.EVENT_CHANGE,function(type){type===BI.Events.CLICK&&(this.isSelected()?self.triggerExpand():self.triggerCollapse())});var type=BI.LogicFactory.createLogicTypeByDirection(BI.Direction.Left),items=BI.LogicFactory.createLogicItemsByDirection(BI.Direction.Left,{width:24,el:this.checkbox},this.text);BI.createWidget(BI.extend({element:this},BI.LogicFactory.createLogic(type,BI.extend(o.logic,{items:items}))))},isOnce:function(){return!0},doRedMark:function(){this.text.doRedMark.apply(this.text,arguments)},unRedMark:function(){this.text.unRedMark.apply(this.text,arguments)},doClick:function(){BI.NodeButton.superclass.doClick.apply(this,arguments)},setOpened:function(v){BI.SelectTreeFirstPlusGroupNode.superclass.setOpened.apply(this,arguments),BI.isNotNull(this.checkbox)&&this.checkbox.setSelected(v)}}),BI.shortcut("bi.select_tree_first_plus_group_node",BI.SelectTreeFirstPlusGroupNode),BI.SelectTreeLastPlusGroupNode=BI.inherit(BI.NodeButton,{_defaultConfig:function(){var conf=BI.SelectTreeLastPlusGroupNode.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{baseCls:(conf.baseCls||"")+" bi-select-tree-last-plus-group-node bi-list-item-active",logic:{dynamic:!1},id:"",pId:"",readonly:!0,open:!1,height:24})},_init:function(){BI.SelectTreeLastPlusGroupNode.superclass._init.apply(this,arguments);var self=this,o=this.options;this.checkbox=BI.createWidget({type:"bi.last_tree_node_checkbox",stopPropagation:!0}),this.text=BI.createWidget({type:"bi.label",textAlign:"left",whiteSpace:"nowrap",textHeight:o.height,height:o.height,hgap:o.hgap,text:o.text,value:o.value,keyword:o.keyword,py:o.py}),this.checkbox.on(BI.Controller.EVENT_CHANGE,function(type){type===BI.Events.CLICK&&(this.isSelected()?self.triggerExpand():self.triggerCollapse())});var type=BI.LogicFactory.createLogicTypeByDirection(BI.Direction.Left),items=BI.LogicFactory.createLogicItemsByDirection(BI.Direction.Left,{width:24,el:this.checkbox},this.text);BI.createWidget(BI.extend({element:this},BI.LogicFactory.createLogic(type,BI.extend(o.logic,{items:items}))))},isOnce:function(){return!0},doRedMark:function(){this.text.doRedMark.apply(this.text,arguments)},unRedMark:function(){this.text.unRedMark.apply(this.text,arguments)},doClick:function(){BI.NodeButton.superclass.doClick.apply(this,arguments)},setOpened:function(v){BI.SelectTreeLastPlusGroupNode.superclass.setOpened.apply(this,arguments),BI.isNotNull(this.checkbox)&&this.checkbox.setSelected(v)}}),BI.shortcut("bi.select_tree_last_plus_group_node",BI.SelectTreeLastPlusGroupNode),BI.SelectTreeMidPlusGroupNode=BI.inherit(BI.NodeButton,{_defaultConfig:function(){var conf=BI.SelectTreeMidPlusGroupNode.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{baseCls:(conf.baseCls||"")+" bi-select-tree-mid-plus-group-node bi-list-item-active",logic:{dynamic:!1},id:"",pId:"",readonly:!0,open:!1,height:24})},_init:function(){BI.SelectTreeMidPlusGroupNode.superclass._init.apply(this,arguments);var self=this,o=this.options;this.checkbox=BI.createWidget({type:"bi.mid_tree_node_checkbox",stopPropagation:!0}),this.text=BI.createWidget({type:"bi.label",textAlign:"left",whiteSpace:"nowrap",textHeight:o.height,height:o.height,hgap:o.hgap,text:o.text,value:o.value,keyword:o.keyword,py:o.py}),this.checkbox.on(BI.Controller.EVENT_CHANGE,function(type){type===BI.Events.CLICK&&(this.isSelected()?self.triggerExpand():self.triggerCollapse())});var type=BI.LogicFactory.createLogicTypeByDirection(BI.Direction.Left),items=BI.LogicFactory.createLogicItemsByDirection(BI.Direction.Left,{width:24,el:this.checkbox},this.text);BI.createWidget(BI.extend({element:this},BI.LogicFactory.createLogic(type,BI.extend(o.logic,{items:items}))))},isOnce:function(){return!0},doRedMark:function(){this.text.doRedMark.apply(this.text,arguments)},unRedMark:function(){this.text.unRedMark.apply(this.text,arguments)},doClick:function(){BI.NodeButton.superclass.doClick.apply(this,arguments)},setOpened:function(v){BI.SelectTreeMidPlusGroupNode.superclass.setOpened.apply(this,arguments),BI.isNotNull(this.checkbox)&&this.checkbox.setSelected(v)}}),BI.shortcut("bi.select_tree_mid_plus_group_node",BI.SelectTreeMidPlusGroupNode),BI.SelectTreePlusGroupNode=BI.inherit(BI.NodeButton,{_defaultConfig:function(){var conf=BI.SelectTreePlusGroupNode.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{baseCls:(conf.baseCls||"")+" bi-select-tree-plus-group-node bi-list-item-active",logic:{dynamic:!1},id:"",pId:"",readonly:!0,open:!1,height:24})},_init:function(){BI.SelectTreePlusGroupNode.superclass._init.apply(this,arguments);var self=this,o=this.options;this.checkbox=BI.createWidget({type:"bi.tree_node_checkbox",stopPropagation:!0}),this.text=BI.createWidget({type:"bi.label",textAlign:"left",whiteSpace:"nowrap",textHeight:o.height,height:o.height,hgap:o.hgap,text:o.text,value:o.value,keyword:o.keyword,py:o.py}),this.checkbox.on(BI.Controller.EVENT_CHANGE,function(type){type===BI.Events.CLICK&&(this.isSelected()?self.triggerExpand():self.triggerCollapse())});var type=BI.LogicFactory.createLogicTypeByDirection(BI.Direction.Left),items=BI.LogicFactory.createLogicItemsByDirection(BI.Direction.Left,{width:24,el:this.checkbox},this.text);BI.createWidget(BI.extend({element:this},BI.LogicFactory.createLogic(type,BI.extend(o.logic,{items:items}))))},isOnce:function(){return!0},doRedMark:function(){this.text.doRedMark.apply(this.text,arguments)},unRedMark:function(){this.text.unRedMark.apply(this.text,arguments)},doClick:function(){BI.NodeButton.superclass.doClick.apply(this,arguments)},setOpened:function(v){BI.SelectTreePlusGroupNode.superclass.setOpened.apply(this,arguments),BI.isNotNull(this.checkbox)&&this.checkbox.setSelected(v)}}),BI.shortcut("bi.select_tree_plus_group_node",BI.SelectTreePlusGroupNode),BI.SelectTreeCombo=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.SelectTreeCombo.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-select-tree-combo",height:24,text:"",items:[],value:"",attributes:{tabIndex:0}})},_init:function(){BI.SelectTreeCombo.superclass._init.apply(this,arguments);var self=this,o=this.options;this.trigger=BI.createWidget({type:"bi.single_tree_trigger",text:o.text,height:o.height,items:o.items,value:o.value}),this.popup=BI.createWidget({type:"bi.select_level_tree",items:o.items,value:o.value}),this.combo=BI.createWidget({type:"bi.combo",container:o.container,element:this,adjustLength:2,el:this.trigger,popup:{el:this.popup}}),this.combo.on(BI.Controller.EVENT_CHANGE,function(){self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.popup.on(BI.SingleTreePopup.EVENT_CHANGE,function(){self.setValue(self.popup.getValue()),self.combo.hideView()})},setValue:function(v){v=BI.isArray(v)?v:[v],this.trigger.setValue(v),this.popup.setValue(v)},getValue:function(){return this.popup.getValue()},populate:function(items){this.combo.populate(items)}}),BI.shortcut("bi.select_tree_combo",BI.SelectTreeCombo),BI.SelectTreeExpander=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.SelectTreeExpander.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-select-tree-expander",trigger:"",toggle:!0,direction:"bottom",isDefaultInit:!0,el:{},popup:{}})},_init:function(){BI.SelectTreeExpander.superclass._init.apply(this,arguments);var self=this,o=this.options;this.trigger=BI.createWidget(o.el),this.trigger.on(BI.Controller.EVENT_CHANGE,function(type){type===BI.Events.CLICK&&this.isSelected()&&self.expander.setValue([]),self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.expander=BI.createWidget({type:"bi.expander",element:this,trigger:o.trigger,toggle:o.toggle,direction:o.direction,isDefaultInit:o.isDefaultInit,el:this.trigger,popup:o.popup}),this.expander.on(BI.Controller.EVENT_CHANGE,function(type){type===BI.Events.CLICK&&self.trigger.setSelected(!1),self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)})},getAllLeaves:function(){return this.expander.getAllLeaves()},setValue:function(v){BI.contains(v,this.trigger.getValue())?(this.trigger.setSelected(!0),this.expander.setValue([])):(this.trigger.setSelected(!1),this.expander.setValue(v))},getValue:function(){return this.trigger.isSelected()?[this.trigger.getValue()]:this.expander.getValue()},populate:function(items){this.expander.populate(items)}}),BI.shortcut("bi.select_tree_expander",BI.SelectTreeExpander),BI.SelectTreePopup=BI.inherit(BI.Pane,{_defaultConfig:function(){return BI.extend(BI.SelectTreePopup.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-select-level-tree",tipText:BI.i18nText("BI-No_Selected_Item"),items:[],value:""})},_formatItems:function(nodes,layer,pNode){var self=this;return BI.each(nodes,function(i,node){var extend={layer:layer};node.id=node.id||BI.UUID(),extend.pNode=pNode,node.isParent===!0||node.parent===!0||BI.isNotEmptyArray(node.children)?(extend.type="bi.select_tree_mid_plus_group_node",i===nodes.length-1&&(extend.type="bi.select_tree_last_plus_group_node",extend.isLastNode=!0),0!==i||pNode||(extend.type="bi.select_tree_first_plus_group_node"),0===i&&i===nodes.length-1&&(extend.type="bi.select_tree_plus_group_node"),BI.defaults(node,extend),self._formatItems(node.children,layer+1,node)):(extend.type="bi.mid_tree_leaf_item",0!==i||pNode||(extend.type="bi.first_tree_leaf_item"),i===nodes.length-1&&(extend.type="bi.last_tree_leaf_item"),BI.defaults(node,extend))}),nodes},_init:function(){BI.SelectTreePopup.superclass._init.apply(this,arguments);var self=this,o=this.options;this.tree=BI.createWidget({type:"bi.level_tree",expander:{type:"bi.select_tree_expander",isDefaultInit:!0},items:this._formatItems(BI.Tree.transformToTreeFormat(o.items),0),value:o.value,chooseType:BI.Selection.Single}),BI.createWidget({type:"bi.vertical",element:this,vgap:5,items:[this.tree]}),this.tree.on(BI.Controller.EVENT_CHANGE,function(){self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.tree.on(BI.LevelTree.EVENT_CHANGE,function(){self.fireEvent(BI.SelectTreePopup.EVENT_CHANGE)}),this.check()},getValue:function(){return this.tree.getValue()},setValue:function(v){v=BI.isArray(v)?v:[v],this.tree.setValue(v)},populate:function(items){BI.SelectTreePopup.superclass.populate.apply(this,arguments),this.tree.populate(this._formatItems(BI.Tree.transformToTreeFormat(items)))}}),BI.SelectTreePopup.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.select_level_tree",BI.SelectTreePopup),BI.SingleSelectSearchLoader=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.SingleSelectSearchLoader.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-single-select-search-loader",allowNoSelect:!1,itemsCreator:BI.emptyFn,keywordGetter:BI.emptyFn,valueFormatter:BI.emptyFn})},_init:function(){BI.SingleSelectSearchLoader.superclass._init.apply(this,arguments);var self=this,opts=this.options,hasNext=!1;this.button_group=BI.createWidget({type:"bi.single_select_list",allowNoSelect:opts.allowNoSelect,element:this,logic:{dynamic:!1},value:opts.value,el:{tipText:BI.i18nText("BI-No_Select"),el:{type:"bi.loader",isDefaultInit:!1,logic:{dynamic:!0,scrolly:!0},el:{chooseType:BI.ButtonGroup.CHOOSE_TYPE_SINGLE,behaviors:{redmark:function(){return!0}},layouts:[{type:"bi.vertical"}]}}},itemsCreator:function(op,callback){self.storeValue&&(op=BI.extend(op||{},{selectedValues:[self.storeValue]})),opts.itemsCreator(op,function(ob){var keyword=ob.keyword=opts.keywordGetter();hasNext=ob.hasNext;var firstItems=[];if(1===op.times&&BI.isNotNull(self.storeValue)){var json=self._filterValues(self.storeValue);firstItems=self._createItems(json)}callback(firstItems.concat(self._createItems(ob.items)),keyword||""),1===op.times&&self.storeValue&&self.setValue(self.storeValue)})},hasNext:function(){return hasNext}}),this.button_group.on(BI.Controller.EVENT_CHANGE,function(){self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.button_group.on(BI.SingleSelectList.EVENT_CHANGE,function(){self.fireEvent(BI.SingleSelectSearchLoader.EVENT_CHANGE,arguments)})},_createItems:function(items){return BI.createItems(items,{type:this.options.allowNoSelect?"bi.single_select_item":"bi.single_select_combo_item",cls:"bi-list-item-active",logic:{dynamic:!1},height:25,selected:!1})},_filterValues:function(src){var o=this.options,keyword=o.keywordGetter(),values=src||[],newValues=BI.map(BI.isArray(values)?values:[values],function(i,v){return{text:o.valueFormatter(v)||v,value:v}});if(BI.isKey(keyword)){var search=BI.Func.getSearchResult(newValues,keyword);values=search.match.concat(search.find)}return BI.map(values,function(i,v){return{text:v.text,title:v.text,value:v.value,selected:!1}})},setValue:function(v){this.storeValue=v,this.button_group.setValue(v)},getValue:function(){return this.button_group.getValue()},getAllButtons:function(){return this.button_group.getAllButtons()},empty:function(){this.button_group.empty()},populate:function(items){this.button_group.populate.apply(this.button_group,arguments)},resetHeight:function(h){this.button_group.resetHeight(h)},resetWidth:function(w){this.button_group.resetWidth(w)}}),BI.SingleSelectSearchLoader.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.single_select_search_loader",BI.SingleSelectSearchLoader),BI.SingleSelectSearchInsertPane=BI.inherit(BI.Widget,{constants:{height:25,lgap:10,tgap:5},_defaultConfig:function(){return BI.extend(BI.SingleSelectSearchInsertPane.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-single-select-search-pane bi-card",allowNoSelect:!1,itemsCreator:BI.emptyFn,valueFormatter:BI.emptyFn,keywordGetter:BI.emptyFn})},_init:function(){BI.SingleSelectSearchInsertPane.superclass._init.apply(this,arguments);var self=this,o=this.options;this.tooltipClick=BI.createWidget({type:"bi.label",invisible:!0,text:BI.i18nText("BI-Click_Blank_To_Select"),cls:"multi-select-toolbar",height:this.constants.height}),this.addNotMatchTip=BI.createWidget({type:"bi.text_button",invisible:!0,text:BI.i18nText("BI-Basic_Click_To_Add_Text",""),height:this.constants.height,cls:"bi-high-light",hgap:5,handler:function(){self.fireEvent(BI.SingleSelectSearchInsertPane.EVENT_ADD_ITEM,o.keywordGetter())}}),this.loader=BI.createWidget({type:"bi.single_select_search_loader",allowNoSelect:o.allowNoSelect,keywordGetter:o.keywordGetter,valueFormatter:o.valueFormatter,itemsCreator:function(op,callback){o.itemsCreator.apply(self,[op,function(res){callback(res),self.setKeyword(o.keywordGetter())}])},value:o.value}),this.loader.on(BI.Controller.EVENT_CHANGE,function(){self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.resizer=BI.createWidget({type:"bi.vtape",element:this,items:[{type:"bi.vertical",items:[this.tooltipClick,this.addNotMatchTip],height:this.constants.height},{el:this.loader}]})},setKeyword:function(keyword){var btn,isMatchTipVisible=this.loader.getAllButtons().length>0&&(btn=this.loader.getAllButtons()[0])&&keyword===btn.getValue();this.tooltipClick.setVisible(isMatchTipVisible),this.addNotMatchTip.setVisible(!isMatchTipVisible),!isMatchTipVisible&&this.addNotMatchTip.setText(BI.i18nText("BI-Basic_Click_To_Add_Text",keyword))},hasMatched:function(){return this.tooltipClick.isVisible()},setValue:function(v){this.loader.setValue(v)},getValue:function(){return this.loader.getValue()},empty:function(){this.loader.empty()},populate:function(items){this.loader.populate.apply(this.loader,arguments); +}}),BI.SingleSelectSearchInsertPane.EVENT_CHANGE="EVENT_CHANGE",BI.SingleSelectSearchInsertPane.EVENT_ADD_ITEM="EVENT_ADD_ITEM",BI.shortcut("bi.single_select_search_insert_pane",BI.SingleSelectSearchInsertPane),BI.SingleSelectSearchPane=BI.inherit(BI.Widget,{constants:{height:25,lgap:10,tgap:5},_defaultConfig:function(){return BI.extend(BI.SingleSelectSearchPane.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-single-select-search-pane bi-card",allowNoSelect:!1,itemsCreator:BI.emptyFn,valueFormatter:BI.emptyFn,keywordGetter:BI.emptyFn})},_init:function(){BI.SingleSelectSearchPane.superclass._init.apply(this,arguments);var self=this,o=this.options;this.tooltipClick=BI.createWidget({type:"bi.label",invisible:!0,text:BI.i18nText("BI-Click_Blank_To_Select"),cls:"multi-select-toolbar",height:this.constants.height}),this.loader=BI.createWidget({type:"bi.single_select_search_loader",allowNoSelect:o.allowNoSelect,keywordGetter:o.keywordGetter,valueFormatter:o.valueFormatter,itemsCreator:function(op,callback){o.itemsCreator.apply(self,[op,function(res){callback(res),self.setKeyword(o.keywordGetter())}])},value:o.value}),this.loader.on(BI.Controller.EVENT_CHANGE,function(){self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.resizer=BI.createWidget({type:"bi.vtape",element:this,items:[{el:this.tooltipClick,height:0},{el:this.loader}]}),this.tooltipClick.setVisible(!1)},setKeyword:function(keyword){var btn,isVisible=this.loader.getAllButtons().length>0&&(btn=this.loader.getAllButtons()[0])&&keyword===btn.getValue();isVisible!==this.tooltipClick.isVisible()&&(this.tooltipClick.setVisible(isVisible),this.resizer.attr("items")[0].height=isVisible?this.constants.height:0,this.resizer.resize())},hasMatched:function(){return this.tooltipClick.isVisible()},setValue:function(v){this.loader.setValue(v)},getValue:function(){return this.loader.getValue()},empty:function(){this.loader.empty()},populate:function(items){this.loader.populate.apply(this.loader,arguments)}}),BI.SingleSelectSearchPane.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.single_select_search_pane",BI.SingleSelectSearchPane),BI.SingleSelectCombo=BI.inherit(BI.Single,{_defaultConfig:function(){return BI.extend(BI.SingleSelectCombo.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-single-select-combo",allowNoSelect:!1,itemsCreator:BI.emptyFn,valueFormatter:BI.emptyFn,height:24,attributes:{tabIndex:0},allowEdit:!0})},_init:function(){BI.SingleSelectCombo.superclass._init.apply(this,arguments);var self=this,o=this.options,assertShowValue=function(){BI.isKey(self._startValue)&&(self.storeValue=self._startValue),self.trigger.getSearcher().setState(self.storeValue)};this.storeValue=o.value,this.requesting=!1,this.trigger=BI.createWidget({type:"bi.single_select_trigger",height:o.height,allowNoSelect:o.allowNoSelect,allowEdit:o.allowEdit,valueFormatter:o.valueFormatter,itemsCreator:function(op,callback){o.itemsCreator(op,function(res){1===op.times&&BI.isNotNull(op.keywords)&&self.trigger.setValue(self.getValue()),callback.apply(self,arguments)})},text:o.text,value:this.storeValue}),this.trigger.on(BI.SingleSelectTrigger.EVENT_FOCUS,function(){self.fireEvent(BI.SingleSelectCombo.EVENT_FOCUS)}),this.trigger.on(BI.SingleSelectTrigger.EVENT_BLUR,function(){self.fireEvent(BI.SingleSelectCombo.EVENT_BLUR)}),this.trigger.on(BI.SingleSelectTrigger.EVENT_START,function(){self._setStartValue(),this.getSearcher().setValue(self.storeValue)}),this.trigger.on(BI.SingleSelectTrigger.EVENT_STOP,function(){self._setStartValue(),self.fireEvent(BI.SingleSelectCombo.EVENT_STOP)}),this.trigger.on(BI.SingleSelectTrigger.EVENT_PAUSE,function(){if(this.getSearcher().hasMatched()){var keyword=this.getSearcher().getKeyword();self.combo.setValue(self.storeValue),self._setStartValue(keyword),assertShowValue(),self.populate(),self._setStartValue()}}),this.trigger.on(BI.SingleSelectTrigger.EVENT_SEARCHING,function(keywords){var last=BI.last(keywords);keywords=BI.initial(keywords||[]),keywords.length>0&&self._joinKeywords(keywords,function(){BI.isEndWithBlank(last)?(self.combo.setValue(self.storeValue),assertShowValue(),self.combo.populate(),self._setStartValue()):(self.combo.setValue(self.storeValue),assertShowValue())}),self.fireEvent(BI.SingleSelectCombo.EVENT_SEARCHING)}),this.trigger.on(BI.SingleSelectTrigger.EVENT_CHANGE,function(value,obj){self.storeValue=this.getValue(),assertShowValue(),self._defaultState()}),this.trigger.on(BI.SingleSelectTrigger.EVENT_COUNTER_CLICK,function(){self.combo.isViewVisible()||self.combo.showView()}),this.combo=BI.createWidget({type:"bi.combo",container:o.container,toggle:!1,el:this.trigger,adjustLength:1,popup:{type:"bi.single_select_popup_view",allowNoSelect:o.allowNoSelect,ref:function(){self.popup=this,self.trigger.setAdapter(this)},listeners:[{eventName:BI.SingleSelectPopupView.EVENT_CHANGE,action:function(){self.storeValue=this.getValue(),self._adjust(function(){assertShowValue(),self._defaultState()}),self.fireEvent(BI.SingleSelectCombo.EVENT_CLICK_ITEM)}}],itemsCreator:o.itemsCreator,valueFormatter:o.valueFormatter,onLoaded:function(){BI.nextTick(function(){self.combo.adjustWidth(),self.combo.adjustHeight(),self.trigger.getSearcher().adjustView()})}},hideChecker:function(e){return 0===triggerBtn.element.find(e.target).length},value:o.value}),this.combo.on(BI.Combo.EVENT_BEFORE_POPUPVIEW,function(){this.setValue(self.storeValue),BI.nextTick(function(){self.populate()})}),this.wants2Quit=!1,this.combo.on(BI.Combo.EVENT_AFTER_HIDEVIEW,function(){self.trigger.stopEditing(),self.requesting===!0?self.wants2Quit=!0:self.fireEvent(BI.SingleSelectCombo.EVENT_CONFIRM)});var triggerBtn=BI.createWidget({type:"bi.trigger_icon_button",width:o.height,height:o.height,cls:"single-select-trigger-icon-button"});triggerBtn.on(BI.TriggerIconButton.EVENT_CHANGE,function(){self.combo.isViewVisible()?self.combo.hideView():self.combo.showView()}),BI.createWidget({type:"bi.absolute",element:this,items:[{el:this.combo,left:0,right:0,top:0,bottom:0},{el:triggerBtn,right:0,top:0,bottom:0}]})},_defaultState:function(){this.trigger.stopEditing(),this.combo.hideView()},_assertValue:function(val){},_makeMap:function(values){return BI.makeObject(values||[])},_joinKeywords:function(keywords,callback){function digest(items){var selectedMap=self._makeMap(items);BI.each(keywords,function(i,val){BI.isNotNull(selectedMap[val])&&BI.remove(self.storeValue.value,val)}),self._adjust(callback)}var self=this,o=this.options;this._assertValue(this.storeValue),this.requesting=!0,o.itemsCreator({type:BI.SingleSelectCombo.REQ_GET_ALL_DATA,keywords:keywords},function(ob){var values=BI.map(ob.items,"value");digest(values)})},_adjust:function(callback){function adjust(){self.wants2Quit===!0&&(self.fireEvent(BI.SingleSelectCombo.EVENT_CONFIRM),self.wants2Quit=!1),self.requesting=!1}var self=this,o=this.options;this._count?(adjust(),callback()):o.itemsCreator({type:BI.SingleSelectCombo.REQ_GET_DATA_LENGTH},function(res){self._count=res.count,adjust(),callback()})},_setStartValue:function(value){this._startValue=value,this.popup.setStartValue(value)},setValue:function(v){this.storeValue=v,this._assertValue(this.storeValue),this.combo.setValue(this.storeValue)},getValue:function(){return this.storeValue},populate:function(){this._count=null,this.combo.populate.apply(this.combo,arguments)}}),BI.extend(BI.SingleSelectCombo,{REQ_GET_DATA_LENGTH:0,REQ_GET_ALL_DATA:-1}),BI.SingleSelectCombo.EVENT_BLUR="EVENT_BLUR",BI.SingleSelectCombo.EVENT_FOCUS="EVENT_FOCUS",BI.SingleSelectCombo.EVENT_STOP="EVENT_STOP",BI.SingleSelectCombo.EVENT_SEARCHING="EVENT_SEARCHING",BI.SingleSelectCombo.EVENT_CLICK_ITEM="EVENT_CLICK_ITEM",BI.SingleSelectCombo.EVENT_CONFIRM="EVENT_CONFIRM",BI.shortcut("bi.single_select_combo",BI.SingleSelectCombo),BI.SingleSelectInsertCombo=BI.inherit(BI.Single,{_defaultConfig:function(){return BI.extend(BI.SingleSelectInsertCombo.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-single-select-combo",allowNoSelect:!1,itemsCreator:BI.emptyFn,valueFormatter:BI.emptyFn,height:24,attributes:{tabIndex:0},allowEdit:!0})},_init:function(){BI.SingleSelectInsertCombo.superclass._init.apply(this,arguments);var self=this,o=this.options,assertShowValue=function(){BI.isKey(self._startValue)&&(self.storeValue=self._startValue),self.trigger.getSearcher().setState(self.storeValue)};this.storeValue=o.value,this.requesting=!1,this.trigger=BI.createWidget({type:"bi.single_select_trigger",height:o.height,allowNoSelect:o.allowNoSelect,allowEdit:o.allowEdit,valueFormatter:o.valueFormatter,itemsCreator:function(op,callback){o.itemsCreator(op,function(res){1===op.times&&BI.isNotNull(op.keywords)&&self.trigger.setValue(self.getValue()),callback.apply(self,arguments)})},text:o.text,value:this.storeValue,searcher:{popup:{type:"bi.single_select_search_insert_pane",listeners:[{eventName:BI.SingleSelectSearchInsertPane.EVENT_ADD_ITEM,action:function(){self.trigger.getSearcher().hasMatched()||(self.storeValue=self.trigger.getSearcher().getKeyword(),assertShowValue(),self._defaultState())}}]}}}),this.trigger.on(BI.SingleSelectTrigger.EVENT_FOCUS,function(){self.fireEvent(BI.SingleSelectInsertCombo.EVENT_FOCUS)}),this.trigger.on(BI.SingleSelectTrigger.EVENT_BLUR,function(){self.fireEvent(BI.SingleSelectInsertCombo.EVENT_BLUR)}),this.trigger.on(BI.SingleSelectTrigger.EVENT_START,function(){self._setStartValue(),this.getSearcher().setValue(self.storeValue)}),this.trigger.on(BI.SingleSelectTrigger.EVENT_STOP,function(){self._setStartValue(),self.fireEvent(BI.SingleSelectInsertCombo.EVENT_STOP)}),this.trigger.on(BI.SingleSelectTrigger.EVENT_PAUSE,function(){if(this.getSearcher().hasMatched()){var keyword=this.getSearcher().getKeyword();self.storeValue=keyword,self.combo.setValue(self.storeValue),self._setStartValue(keyword),assertShowValue(),self.populate(),self._setStartValue()}}),this.trigger.on(BI.SingleSelectTrigger.EVENT_SEARCHING,function(keywords){var last=BI.last(keywords);keywords=BI.initial(keywords||[]),keywords.length>0&&self._joinKeywords(keywords,function(){BI.isEndWithBlank(last)?(self.combo.setValue(self.storeValue),assertShowValue(),self.combo.populate(),self._setStartValue()):(self.combo.setValue(self.storeValue),assertShowValue())}),self.fireEvent(BI.SingleSelectInsertCombo.EVENT_SEARCHING)}),this.trigger.on(BI.SingleSelectTrigger.EVENT_CHANGE,function(value,obj){self.storeValue=this.getValue(),assertShowValue(),self._defaultState()}),this.trigger.on(BI.SingleSelectTrigger.EVENT_COUNTER_CLICK,function(){self.combo.isViewVisible()||self.combo.showView()}),this.combo=BI.createWidget({type:"bi.combo",container:o.container,toggle:!1,el:this.trigger,adjustLength:1,popup:{type:"bi.single_select_popup_view",allowNoSelect:o.allowNoSelect,ref:function(){self.popup=this,self.trigger.setAdapter(this)},listeners:[{eventName:BI.SingleSelectPopupView.EVENT_CHANGE,action:function(){self.storeValue=this.getValue(),self._adjust(function(){assertShowValue(),self._defaultState()}),self.fireEvent(BI.SingleSelectInsertCombo.EVENT_CLICK_ITEM)}}],itemsCreator:o.itemsCreator,valueFormatter:o.valueFormatter,onLoaded:function(){BI.nextTick(function(){self.combo.adjustWidth(),self.combo.adjustHeight(),self.trigger.getSearcher().adjustView()})}},hideChecker:function(e){return 0===triggerBtn.element.find(e.target).length},value:o.value}),this.combo.on(BI.Combo.EVENT_BEFORE_POPUPVIEW,function(){this.setValue(self.storeValue),BI.nextTick(function(){self.populate()})}),this.wants2Quit=!1,this.combo.on(BI.Combo.EVENT_AFTER_HIDEVIEW,function(){self.trigger.stopEditing(),self.requesting===!0?self.wants2Quit=!0:self.fireEvent(BI.SingleSelectInsertCombo.EVENT_CONFIRM)});var triggerBtn=BI.createWidget({type:"bi.trigger_icon_button",width:o.height,height:o.height,cls:"single-select-trigger-icon-button"});triggerBtn.on(BI.TriggerIconButton.EVENT_CHANGE,function(){self.combo.isViewVisible()?self.combo.hideView():self.combo.showView()}),BI.createWidget({type:"bi.absolute",element:this,items:[{el:this.combo,left:0,right:0,top:0,bottom:0},{el:triggerBtn,right:0,top:0,bottom:0}]})},_defaultState:function(){this.trigger.stopEditing(),this.combo.hideView()},_assertValue:function(val){},_makeMap:function(values){return BI.makeObject(values||[])},_joinKeywords:function(keywords,callback){function digest(items){var selectedMap=self._makeMap(items);BI.each(keywords,function(i,val){BI.isNotNull(selectedMap[val])&&BI.remove(self.storeValue.value,val)}),self._adjust(callback)}var self=this,o=this.options;this._assertValue(this.storeValue),this.requesting=!0,o.itemsCreator({type:BI.SingleSelectInsertCombo.REQ_GET_ALL_DATA,keywords:keywords},function(ob){var values=BI.map(ob.items,"value");digest(values)})},_adjust:function(callback){function adjust(){self.wants2Quit===!0&&(self.fireEvent(BI.SingleSelectInsertCombo.EVENT_CONFIRM),self.wants2Quit=!1),self.requesting=!1}var self=this,o=this.options;adjust(),callback()},_setStartValue:function(value){this._startValue=value,this.popup.setStartValue(value)},setValue:function(v){this.storeValue=v,this._assertValue(this.storeValue),this.combo.setValue(this.storeValue)},getValue:function(){return this.storeValue},populate:function(){this.combo.populate.apply(this.combo,arguments)}}),BI.extend(BI.SingleSelectInsertCombo,{REQ_GET_DATA_LENGTH:0,REQ_GET_ALL_DATA:-1}),BI.SingleSelectInsertCombo.EVENT_FOCUS="EVENT_FOCUS",BI.SingleSelectInsertCombo.EVENT_BLUR="EVENT_BLUR",BI.SingleSelectInsertCombo.EVENT_STOP="EVENT_STOP",BI.SingleSelectInsertCombo.EVENT_SEARCHING="EVENT_SEARCHING",BI.SingleSelectInsertCombo.EVENT_CLICK_ITEM="EVENT_CLICK_ITEM",BI.SingleSelectInsertCombo.EVENT_CONFIRM="EVENT_CONFIRM",BI.shortcut("bi.single_select_insert_combo",BI.SingleSelectInsertCombo),BI.SingleSelectComboItem=BI.inherit(BI.BasicButton,{_defaultConfig:function(){return BI.extend(BI.SingleSelectComboItem.superclass._defaultConfig.apply(this,arguments),{extraCls:"bi-single-select-radio-item",logic:{dynamic:!1},height:24})},_init:function(){BI.SingleSelectComboItem.superclass._init.apply(this,arguments);var self=this,o=this.options;this.radio=BI.createWidget({type:"bi.radio"}),this.text=BI.createWidget({type:"bi.label",cls:"list-item-text",textAlign:"left",whiteSpace:"nowrap",textHeight:o.height,height:o.height,hgap:o.hgap,text:o.text,keyword:o.keyword,value:o.value,py:o.py}),BI.createWidget(BI.extend({element:this},BI.LogicFactory.createLogic("horizontal",BI.extend(o.logic,{items:BI.LogicFactory.createLogicItemsByDirection("left",{type:"bi.center_adapt",items:[this.radio],width:26},this.text)}))))},doRedMark:function(){this.text.doRedMark.apply(this.text,arguments)},unRedMark:function(){this.text.unRedMark.apply(this.text,arguments)},doClick:function(){BI.SingleSelectComboItem.superclass.doClick.apply(this,arguments),this.radio.setSelected(this.isSelected()),this.isValid()&&this.fireEvent(BI.SingleSelectComboItem.EVENT_CHANGE,this.isSelected(),this)},setSelected:function(v){BI.SingleSelectComboItem.superclass.setSelected.apply(this,arguments),this.radio.setSelected(v)}}),BI.SingleSelectComboItem.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.single_select_combo_item",BI.SingleSelectComboItem),BI.SingleSelectList=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.SingleSelectList.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-select-list",direction:BI.Direction.Top,logic:{dynamic:!0},items:[],itemsCreator:BI.emptyFn,hasNext:BI.emptyFn,onLoaded:BI.emptyFn,el:{type:"bi.list_pane"},allowNoSelect:!1})},_init:function(){BI.SingleSelectList.superclass._init.apply(this,arguments);var self=this,o=this.options;this.list=BI.createWidget(o.el,{type:"bi.list_pane",items:o.items,itemsCreator:function(op,callback){1===op.times&&self.toolbar&&self.toolbar.setVisible(!1),o.itemsCreator(op,function(items){callback.apply(self,arguments),1===op.times&&(self.toolbar&&self.toolbar.setVisible(items&&items.length>0),self.toolbar&&self.toolbar.setEnable(items&&items.length>0))})},onLoaded:o.onLoaded,hasNext:o.hasNext,value:o.value}),this.list.on(BI.Controller.EVENT_CHANGE,function(type,value,obj){type===BI.Events.CLICK&&self.fireEvent(BI.SingleSelectList.EVENT_CHANGE,value,obj),self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),BI.createWidget(BI.extend({element:this},BI.LogicFactory.createLogic(BI.LogicFactory.createLogicTypeByDirection(o.direction),BI.extend({scrolly:!0},o.logic,{items:o.allowNoSelect?BI.LogicFactory.createLogicItemsByDirection(o.direction,{type:"bi.single_select_item",cls:"bi-list-item-active",height:24,forceNotSelected:!0,text:BI.i18nText("BI-Basic_No_Select"),ref:function(_ref){self.toolbar=_ref},listeners:[{eventName:BI.Controller.EVENT_CHANGE,action:function(type){type===BI.Events.CLICK&&(self.list.setValue(),self.fireEvent(BI.SingleSelectList.EVENT_CHANGE)),self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}}]},this.list):BI.LogicFactory.createLogicItemsByDirection(o.direction,this.list)}))))},hasPrev:function(){return this.list.hasPrev()},hasNext:function(){return this.list.hasNext()},prependItems:function(items){this.list.prependItems.apply(this.list,arguments)},addItems:function(items){this.list.addItems.apply(this.list,arguments)},setValue:function(v){this.list.setValue([v])},getValue:function(){return this.list.getValue()[0]},empty:function(){this.list.empty()},populate:function(items){this.list.populate.apply(this.list,arguments)},resetHeight:function(h){this.list.resetHeight?this.list.resetHeight(h):this.list.element.css({"max-height":h+"px"})},setNotSelectedValue:function(){this.list.setNotSelectedValue.apply(this.list,arguments)},getNotSelectedValue:function(){return this.list.getNotSelectedValue()},getAllButtons:function(){return this.list.getAllButtons()},getAllLeaves:function(){return this.list.getAllLeaves()},getSelectedButtons:function(){return this.list.getSelectedButtons()},getNotSelectedButtons:function(){return this.list.getNotSelectedButtons()},getIndexByValue:function(value){return this.list.getIndexByValue(value)},getNodeById:function(id){return this.list.getNodeById(id)},getNodeByValue:function(value){return this.list.getNodeByValue(value)}}),BI.SingleSelectList.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.single_select_list",BI.SingleSelectList),BI.SingleSelectLoader=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.SingleSelectLoader.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-single-select-loader",logic:{dynamic:!0},el:{height:400},allowNoSelect:!1,valueFormatter:BI.emptyFn,itemsCreator:BI.emptyFn,onLoaded:BI.emptyFn})},_init:function(){BI.SingleSelectLoader.superclass._init.apply(this,arguments);var self=this,opts=this.options,hasNext=!1;this.storeValue=opts.value,this.button_group=BI.createWidget({type:"bi.single_select_list",allowNoSelect:opts.allowNoSelect,logic:opts.logic,el:BI.extend({onLoaded:opts.onLoaded,el:{type:"bi.loader",isDefaultInit:!1,logic:{dynamic:!0,scrolly:!0},el:{chooseType:BI.ButtonGroup.CHOOSE_TYPE_SINGLE,behaviors:{redmark:function(){return!0}},layouts:[{type:"bi.vertical"}]}}},opts.el),itemsCreator:function(op,callback){var startValue=self._startValue;BI.isNotNull(self.storeValue)&&(op=BI.extend(op||{},{selectedValues:[self.storeValue]})),opts.itemsCreator(op,function(ob){hasNext=ob.hasNext;var firstItems=[];if(1===op.times&&BI.isNotNull(self.storeValue)){var json=BI.map([self.storeValue],function(i,v){var txt=opts.valueFormatter(v)||v;return{text:txt,value:v,title:txt,selected:!0}});firstItems=self._createItems(json)}callback(firstItems.concat(self._createItems(ob.items)),ob.keyword||""),1===op.times&&self.storeValue&&(BI.isKey(startValue)&&(self.storeValue=startValue),self.setValue(self.storeValue)),1===op.times&&self._scrollToTop()})},hasNext:function(){return hasNext},value:this.storeValue}),BI.createWidget({type:"bi.vertical",element:this,items:[this.button_group],vgap:5}),this.button_group.on(BI.Controller.EVENT_CHANGE,function(){self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.button_group.on(BI.SingleSelectList.EVENT_CHANGE,function(){self.fireEvent(BI.SingleSelectLoader.EVENT_CHANGE,arguments)})},_createItems:function(items){return BI.createItems(items,{type:this.options.allowNoSelect?"bi.single_select_item":"bi.single_select_combo_item",logic:this.options.logic,cls:"bi-list-item-active",height:24,selected:!1})},_scrollToTop:function(){var self=this;BI.delay(function(){self.button_group.element.scrollTop(0)},30)},_assertValue:function(val){},setStartValue:function(v){this._startValue=v},setValue:function(v){this.storeValue=v,this._assertValue(this.storeValue),this.button_group.setValue(this.storeValue)},getValue:function(){return this.button_group.getValue()},getAllButtons:function(){return this.button_group.getAllButtons()},empty:function(){this.button_group.empty()},populate:function(items){this.button_group.populate.apply(this.button_group,arguments)},resetHeight:function(h){this.button_group.resetHeight(h)},resetWidth:function(w){this.button_group.resetWidth(w)}}),BI.SingleSelectLoader.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.single_select_loader",BI.SingleSelectLoader),BI.SingleSelectPopupView=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.SingleSelectPopupView.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-single-select-popup-view",allowNoSelect:!1,maxWidth:"auto",minWidth:135,maxHeight:400,valueFormatter:BI.emptyFn,itemsCreator:BI.emptyFn,onLoaded:BI.emptyFn})},_init:function(){BI.SingleSelectPopupView.superclass._init.apply(this,arguments);var self=this,opts=this.options;this.loader=BI.createWidget({type:"bi.single_select_loader",allowNoSelect:opts.allowNoSelect,itemsCreator:opts.itemsCreator,valueFormatter:opts.valueFormatter,onLoaded:opts.onLoaded,value:opts.value}),this.popupView=BI.createWidget({type:"bi.popup_view",stopPropagation:!1,maxWidth:opts.maxWidth,minWidth:opts.minWidth,maxHeight:opts.maxHeight,element:this,el:this.loader,value:opts.value}),this.popupView.on(BI.MultiPopupView.EVENT_CHANGE,function(){self.fireEvent(BI.SingleSelectPopupView.EVENT_CHANGE)})},setStartValue:function(v){this.loader.setStartValue(v)},setValue:function(v){this.popupView.setValue(v)},getValue:function(){return this.popupView.getValue()},populate:function(items){this.popupView.populate.apply(this.popupView,arguments)},resetHeight:function(h){this.popupView.resetHeight(h)},resetWidth:function(w){this.popupView.resetWidth(w)}}),BI.SingleSelectPopupView.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.single_select_popup_view",BI.SingleSelectPopupView),BI.SingleSelectTrigger=BI.inherit(BI.Trigger,{constants:{height:14,rgap:4,lgap:4},_defaultConfig:function(){return BI.extend(BI.SingleSelectTrigger.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-single-select-trigger bi-border bi-border-radius",allowNoSelect:!1,itemsCreator:BI.emptyFn,valueFormatter:BI.emptyFn,searcher:{},switcher:{},adapter:null,masker:{},allowEdit:!0})},_init:function(){BI.SingleSelectTrigger.superclass._init.apply(this,arguments);var self=this,o=this.options;o.height&&this.setHeight(o.height-2),this.searcher=BI.createWidget(o.searcher,{type:"bi.single_select_searcher",allowNoSelect:o.allowNoSelect,text:o.text,height:o.height,itemsCreator:o.itemsCreator,valueFormatter:o.valueFormatter,popup:{},adapter:o.adapter,masker:o.masker,value:o.value}),this.searcher.on(BI.SingleSelectSearcher.EVENT_START,function(){self.fireEvent(BI.SingleSelectTrigger.EVENT_START)}),this.searcher.on(BI.SingleSelectSearcher.EVENT_PAUSE,function(){self.fireEvent(BI.SingleSelectTrigger.EVENT_PAUSE)}),this.searcher.on(BI.SingleSelectSearcher.EVENT_SEARCHING,function(){self.fireEvent(BI.SingleSelectTrigger.EVENT_SEARCHING,arguments)}),this.searcher.on(BI.SingleSelectSearcher.EVENT_STOP,function(){self.fireEvent(BI.SingleSelectTrigger.EVENT_STOP)}),this.searcher.on(BI.SingleSelectSearcher.EVENT_CHANGE,function(){self.fireEvent(BI.SingleSelectTrigger.EVENT_CHANGE,arguments)}),this.searcher.on(BI.SingleSelectSearcher.EVENT_FOCUS,function(){self.fireEvent(BI.SingleSelectTrigger.EVENT_FOCUS)}),this.searcher.on(BI.SingleSelectSearcher.EVENT_BLUR,function(){self.fireEvent(BI.SingleSelectTrigger.EVENT_BLUR,arguments)});var wrapper=BI.createWidget({type:"bi.htape",element:this,items:[{el:this.searcher,width:"fill"},{el:BI.createWidget(),width:24}]});!o.allowEdit&&BI.createWidget({type:"bi.absolute",element:this,items:[{el:{type:"bi.layout"},left:0,right:24,top:0,bottom:0}]})},getSearcher:function(){return this.searcher},stopEditing:function(){this.searcher.stopSearch()},setAdapter:function(adapter){this.searcher.setAdapter(adapter)},setValue:function(v){this.searcher.setValue(v)},getKey:function(){return this.searcher.getKey()},getValue:function(){return this.searcher.getValue()}}),BI.SingleSelectTrigger.EVENT_TRIGGER_CLICK="EVENT_TRIGGER_CLICK",BI.SingleSelectTrigger.EVENT_COUNTER_CLICK="EVENT_COUNTER_CLICK",BI.SingleSelectTrigger.EVENT_CHANGE="EVENT_CHANGE",BI.SingleSelectTrigger.EVENT_START="EVENT_START",BI.SingleSelectTrigger.EVENT_STOP="EVENT_STOP",BI.SingleSelectTrigger.EVENT_PAUSE="EVENT_PAUSE",BI.SingleSelectTrigger.EVENT_SEARCHING="EVENT_SEARCHING",BI.SingleSelectTrigger.EVENT_BEFORE_COUNTER_POPUPVIEW="EVENT_BEFORE_COUNTER_POPUPVIEW",BI.SingleSelectTrigger.EVENT_FOCUS="EVENT_FOCUS",BI.SingleSelectTrigger.EVENT_BLUR="EVENT_BLUR",BI.shortcut("bi.single_select_trigger",BI.SingleSelectTrigger),BI.SingleSelectInsertList=BI.inherit(BI.Single,{_defaultConfig:function(){return BI.extend(BI.SingleSelectInsertList.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-multi-select-insert-list",allowNoSelect:!1,itemsCreator:BI.emptyFn,valueFormatter:BI.emptyFn})},_init:function(){BI.SingleSelectInsertList.superclass._init.apply(this,arguments);var self=this,o=this.options;this.storeValue=o.value;var assertShowValue=function(){BI.isKey(self._startValue)&&(self.storeValue=self._startValue)};this.adapter=BI.createWidget({type:"bi.single_select_loader",allowNoSelect:o.allowNoSelect,cls:"popup-single-select-list bi-border-left bi-border-right bi-border-bottom",itemsCreator:o.itemsCreator,valueFormatter:o.valueFormatter,logic:{dynamic:!0},el:{},value:o.value}),this.adapter.on(BI.SingleSelectLoader.EVENT_CHANGE,function(){self.storeValue=this.getValue(),assertShowValue(),self.fireEvent(BI.SingleSelectInsertList.EVENT_CHANGE)}),this.searcherPane=BI.createWidget({type:"bi.single_select_search_pane",allowNoSelect:o.allowNoSelect,cls:"bi-border-left bi-border-right bi-border-bottom",valueFormatter:o.valueFormatter,keywordGetter:function(){return self.trigger.getKeyword()},itemsCreator:function(op,callback){op.keywords=[self.trigger.getKeyword()],this.setKeyword(op.keywords[0]),o.itemsCreator(op,callback)}}),this.searcherPane.setVisible(!1),this.trigger=BI.createWidget({type:"bi.searcher",isAutoSearch:!1,isAutoSync:!1,onSearch:function(op,callback){callback()},adapter:this.adapter,popup:this.searcherPane,height:200,masker:!1,value:o.value,listeners:[{eventName:BI.Searcher.EVENT_START,action:function(){self._showSearcherPane(),self._setStartValue(),this.setValue(BI.deepClone(self.storeValue))}},{eventName:BI.Searcher.EVENT_STOP,action:function(){self._showAdapter(),self._setStartValue(),self.adapter.setValue(self.storeValue),self.adapter.populate()}},{eventName:BI.Searcher.EVENT_PAUSE,action:function(){var keyword=this.getKeyword();self.storeValue=keyword,self._showAdapter(),self.adapter.setValue(self.storeValue),self._setStartValue(keyword),assertShowValue(),self.adapter.populate(),self._setStartValue(),self.fireEvent(BI.SingleSelectInsertList.EVENT_CHANGE)}},{eventName:BI.Searcher.EVENT_SEARCHING,action:function(){var keywords=this.getKeyword(),last=BI.last(keywords);keywords=BI.initial(keywords||[]),keywords.length>0&&self._joinKeywords(keywords,function(){BI.isEndWithBlank(last)?(self.adapter.setValue(self.storeValue),assertShowValue(),self.adapter.populate(),self._setStartValue()):(self.adapter.setValue(self.storeValue),assertShowValue())})}},{eventName:BI.Searcher.EVENT_CHANGE,action:function(){self.storeValue=this.getValue(),self.fireEvent(BI.SingleSelectInsertList.EVENT_CHANGE)}}]}),BI.createWidget({type:"bi.vtape",element:this,items:[{el:this.trigger,height:24},{el:this.adapter,height:"fill"}]}),BI.createWidget({type:"bi.absolute",element:this,items:[{el:this.searcherPane,top:24,bottom:0,left:0,right:0}]})},_showAdapter:function(){this.adapter.setVisible(!0),this.searcherPane.setVisible(!1)},_showSearcherPane:function(){this.searcherPane.setVisible(!0),this.adapter.setVisible(!1)},_defaultState:function(){this.trigger.stopEditing()},_assertValue:function(){},_makeMap:function(values){return BI.makeObject(values||[])},_joinKeywords:function(keywords,callback){function digest(items){var selectedMap=self._makeMap(items);BI.each(keywords,function(i,val){BI.isNotNull(selectedMap[val])&&(self.storeValue.type===BI.Selection.Single?BI.pushDistinct(self.storeValue.value,val):BI.remove(self.storeValue.value,val))}),callback()}var self=this,o=this.options;this._assertValue(this.storeValue),this._allData?digest(this._allData):o.itemsCreator({type:BI.SingleSelectInsertList.REQ_GET_ALL_DATA},function(ob){self._allData=BI.map(ob.items,"value"),digest(self._allData)})},_setStartValue:function(value){this._startValue=value,this.adapter.setStartValue(value)},isAllSelected:function(){return this.adapter.isAllSelected()},resize:function(){},setValue:function(v){this.storeValue=v,this.adapter.setValue(this.storeValue),this.trigger.setValue(this.storeValue)},getValue:function(){return BI.deepClone(this.storeValue)},populate:function(){this._count=null,this._allData=null,this.adapter.populate.apply(this.adapter,arguments),this.trigger.populate.apply(this.trigger,arguments)}}),BI.extend(BI.SingleSelectInsertList,{REQ_GET_DATA_LENGTH:0,REQ_GET_ALL_DATA:-1}),BI.SingleSelectInsertList.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.single_select_insert_list",BI.SingleSelectInsertList),BI.SingleSelectEditor=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.SingleSelectEditor.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-single-select-editor",el:{},text:BI.i18nText("BI-Basic_Please_Select")})},_init:function(){BI.SingleSelectEditor.superclass._init.apply(this,arguments);var self=this,o=this.options;this.editor=BI.createWidget(o.el,{type:"bi.state_editor",element:this,height:o.height,watermark:BI.i18nText("BI-Basic_Search"),allowBlank:!0,value:o.value,defaultText:o.text,text:o.text}),this.editor.on(BI.Controller.EVENT_CHANGE,function(){self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.editor.on(BI.StateEditor.EVENT_PAUSE,function(){self.fireEvent(BI.SingleSelectEditor.EVENT_PAUSE)}),this.editor.on(BI.StateEditor.EVENT_FOCUS,function(){self.fireEvent(BI.SingleSelectEditor.EVENT_FOCUS)}),this.editor.on(BI.StateEditor.EVENT_BLUR,function(){self.fireEvent(BI.SingleSelectEditor.EVENT_BLUR)})},focus:function(){this.editor.focus()},blur:function(){this.editor.blur()},setState:function(state){this.editor.setState(state)},setValue:function(v){this.editor.setValue(v)},getValue:function(){var v=this.editor.getState();return BI.isArray(v)&&v.length>0?v[v.length-1]:""},getKeywords:function(){var val=this.editor.getLastChangedValue(),keywords=val.match(/[\S]+/g);return BI.isEndWithBlank(val)?keywords.concat([" "]):keywords},populate:function(items){}}),BI.SingleSelectEditor.EVENT_FOCUS="EVENT_FOCUS",BI.SingleSelectEditor.EVENT_BLUR="EVENT_BLUR",BI.SingleSelectEditor.EVENT_PAUSE="EVENT_PAUSE",BI.shortcut("bi.single_select_editor",BI.SingleSelectEditor),BI.SingleSelectSearcher=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.SingleSelectSearcher.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-single-select-searcher",itemsCreator:BI.emptyFn,el:{},popup:{},valueFormatter:BI.emptyFn,adapter:null,masker:{},allowNoSelect:!1})},_init:function(){BI.SingleSelectSearcher.superclass._init.apply(this,arguments);var self=this,o=this.options;this.editor=BI.createWidget(o.el,{type:"bi.single_select_editor", +height:o.height,text:o.text,listeners:[{eventName:BI.SingleSelectEditor.EVENT_FOCUS,action:function(){self.fireEvent(BI.SingleSelectSearcher.EVENT_FOCUS)}},{eventName:BI.SingleSelectEditor.EVENT_BLUR,action:function(){self.fireEvent(BI.SingleSelectSearcher.EVENT_BLUR)}}]}),this.searcher=BI.createWidget({type:"bi.searcher",element:this,height:o.height,isAutoSearch:!1,isAutoSync:!1,onSearch:function(op,callback){callback()},el:this.editor,popup:BI.extend({type:"bi.single_select_search_pane",allowNoSelect:o.allowNoSelect,valueFormatter:o.valueFormatter,keywordGetter:function(){return self.editor.getValue()},itemsCreator:function(op,callback){var keyword=self.editor.getValue();op.keywords=[keyword],this.setKeyword(keyword),o.itemsCreator(op,callback)},value:o.value},o.popup),adapter:o.adapter,masker:o.masker}),this.searcher.on(BI.Searcher.EVENT_START,function(){self.fireEvent(BI.SingleSelectSearcher.EVENT_START)}),this.searcher.on(BI.Searcher.EVENT_PAUSE,function(){this.hasMatched(),self.fireEvent(BI.SingleSelectSearcher.EVENT_PAUSE)}),this.searcher.on(BI.Searcher.EVENT_STOP,function(){self.fireEvent(BI.SingleSelectSearcher.EVENT_STOP)}),this.searcher.on(BI.Searcher.EVENT_CHANGE,function(){self.fireEvent(BI.SingleSelectSearcher.EVENT_CHANGE,arguments)}),this.searcher.on(BI.Searcher.EVENT_SEARCHING,function(){var keywords=this.getKeywords();self.fireEvent(BI.SingleSelectSearcher.EVENT_SEARCHING,keywords)}),BI.isNotNull(o.value)&&this.setState(o.value)},adjustView:function(){this.searcher.adjustView()},isSearching:function(){return this.searcher.isSearching()},stopSearch:function(){this.searcher.stopSearch()},getKeyword:function(){return this.editor.getValue()},hasMatched:function(){return this.searcher.hasMatched()},hasChecked:function(){return this.searcher.getView()&&this.searcher.getView().hasChecked()},setAdapter:function(adapter){this.searcher.setAdapter(adapter)},setState:function(v){var o=this.options;BI.isNull(v)?this.editor.setState(BI.Selection.None):this.editor.setState(o.valueFormatter(v+"")||v+"")},setValue:function(ob){this.setState(ob),this.searcher.setValue(ob)},getKey:function(){return this.editor.getValue()},getValue:function(){return this.searcher.getValue()},populate:function(items){this.searcher.populate.apply(this.searcher,arguments)}}),BI.SingleSelectSearcher.EVENT_FOCUS="EVENT_FOCUS",BI.SingleSelectSearcher.EVENT_BLUR="EVENT_BLUR",BI.SingleSelectSearcher.EVENT_BEFORE_POPUPVIEW="EVENT_BEFORE_POPUPVIEW",BI.SingleSelectSearcher.EVENT_CHANGE="EVENT_CHANGE",BI.SingleSelectSearcher.EVENT_START="EVENT_START",BI.SingleSelectSearcher.EVENT_STOP="EVENT_STOP",BI.SingleSelectSearcher.EVENT_PAUSE="EVENT_PAUSE",BI.SingleSelectSearcher.EVENT_SEARCHING="EVENT_SEARCHING",BI.shortcut("bi.single_select_searcher",BI.SingleSelectSearcher),BI.SignTextEditor=BI.inherit(BI.Widget,{_defaultConfig:function(){var conf=BI.SignTextEditor.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{baseCls:(conf.baseCls||"")+" bi-sign-initial-editor",validationChecker:BI.emptyFn,text:"",height:24})},_init:function(){BI.SignTextEditor.superclass._init.apply(this,arguments);var self=this,o=this.options;this.editor=BI.createWidget({type:"bi.editor",height:o.height,hgap:4,vgap:2,value:o.value,validationChecker:o.validationChecker,allowBlank:!1}),this.text=BI.createWidget({type:"bi.text_button",cls:"sign-editor-text",title:function(){return self.getValue()},textAlign:o.textAlign,height:o.height,hgap:4,handler:function(){self._showInput(),self.editor.focus(),self.editor.selectAll()}}),this.text.on(BI.TextButton.EVENT_CHANGE,function(){BI.nextTick(function(){self.fireEvent(BI.SignTextEditor.EVENT_CLICK_LABEL)})}),BI.createWidget({type:"bi.absolute",element:this,items:[{el:this.text,left:0,right:0,top:0,bottom:0}]}),this.editor.on(BI.Controller.EVENT_CHANGE,function(){self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.editor.on(BI.Editor.EVENT_CONFIRM,function(){self._showHint(),self._checkText(),self.fireEvent(BI.SignTextEditor.EVENT_CONFIRM,arguments)}),this.editor.on(BI.Editor.EVENT_CHANGE_CONFIRM,function(){self._showHint(),self._checkText(),self.fireEvent(BI.SignTextEditor.EVENT_CHANGE_CONFIRM,arguments)}),this.editor.on(BI.Editor.EVENT_ERROR,function(){self._checkText()}),BI.createWidget({type:"bi.vertical",scrolly:!1,element:this,items:[this.editor]}),this._showHint(),self._checkText()},_checkText:function(){var o=this.options;BI.nextTick(BI.bind(function(){if(""===this.editor.getValue())this.text.setValue(o.watermark||""),this.text.element.addClass("bi-water-mark");else{var v=this.editor.getValue();v=BI.isEmpty(v)||v==o.text?o.text:v+o.text,this.text.setValue(v),this.text.element.removeClass("bi-water-mark")}},this))},_showInput:function(){this.editor.visible(),this.text.invisible()},_showHint:function(){this.editor.invisible(),this.text.visible()},setTitle:function(title){this.text.setTitle(title)},setWarningTitle:function(title){this.text.setWarningTitle(title)},focus:function(){this._showInput(),this.editor.focus()},blur:function(){this.editor.blur(),this._showHint(),this._checkText()},doRedMark:function(){""===this.editor.getValue()&&BI.isKey(this.options.watermark)||this.text.doRedMark.apply(this.text,arguments)},unRedMark:function(){this.text.unRedMark.apply(this.text,arguments)},doHighLight:function(){""===this.editor.getValue()&&BI.isKey(this.options.watermark)||this.text.doHighLight.apply(this.text,arguments)},unHighLight:function(){this.text.unHighLight.apply(this.text,arguments)},isValid:function(){return this.editor.isValid()},setErrorText:function(text){this.editor.setErrorText(text)},getErrorText:function(){return this.editor.getErrorText()},isEditing:function(){return this.editor.isEditing()},getLastValidValue:function(){return this.editor.getLastValidValue()},getLastChangedValue:function(){return this.editor.getLastChangedValue()},setValue:function(v){this.editor.setValue(v),this._checkText()},getValue:function(){return this.editor.getValue()},getState:function(){return this.text.getValue()},setState:function(v){var o=this.options;this._showHint(),v=BI.isEmpty(v)||v==o.text?o.text:v+o.text,this.text.setValue(v)}}),BI.SignTextEditor.EVENT_CONFIRM="EVENT_CONFIRM",BI.SignTextEditor.EVENT_CHANGE_CONFIRM="EVENT_CHANGE_CONFIRM",BI.SignTextEditor.EVENT_CLICK_LABEL="EVENT_CLICK_LABEL",BI.shortcut("bi.sign_text_editor",BI.SignTextEditor),BI.SliderIconButton=BI.inherit(BI.Widget,{props:{baseCls:"bi-single-slider-button"},constants:{LARGE_SIZE:16,NORMAL_SIZE:12,LARGE_OFFSET:4,NORMAL_OFFSET:6},render:function(){var self=this;return{type:"bi.absolute",ref:function(){self.wrapper=this},items:[{el:{type:"bi.text_button",cls:"slider-button bi-high-light-border",ref:function(){self.slider=this}}}]}}}),BI.shortcut("bi.single_slider_button",BI.SliderIconButton),BI.SingleSlider=BI.inherit(BI.Single,{_constant:{EDITOR_WIDTH:90,EDITOR_HEIGHT:30,SLIDER_WIDTH_HALF:15,SLIDER_WIDTH:30,SLIDER_HEIGHT:30,TRACK_HEIGHT:24},props:{baseCls:"bi-single-slider bi-slider-track",digit:!1,unit:""},render:function(){var self=this,o=this.options,c=this._constant;this.enable=!1,this.value="",this.grayTrack=BI.createWidget({type:"bi.layout",cls:"gray-track",height:6}),this.blueTrack=BI.createWidget({type:"bi.layout",cls:"blue-track bi-high-light-background",height:6}),this.track=this._createTrackWrapper(),this.slider=BI.createWidget({type:"bi.single_slider_button"}),this._draggable(this.slider);var sliderVertical=BI.createWidget({type:"bi.vertical",items:[{type:"bi.absolute",items:[this.slider]}],hgap:c.SLIDER_WIDTH_HALF,height:c.SLIDER_HEIGHT});return sliderVertical.element.click(function(e){if(self.enable&&self.isEnabled()){var offset=e.clientX-self.element.offset().left-c.SLIDER_WIDTH_HALF,trackLength=self.track.element[0].scrollWidth,percent=0;offset<0&&(percent=0),offset>0&&offsettrackLength-c.SLIDER_WIDTH&&(percent=100);var significantPercent=BI.parseFloat(percent.toFixed(1));self._setAllPosition(significantPercent);var v=self._getValueByPercent(significantPercent);v=o.digit===!1?v:v.toFixed(o.digit),self.label.setValue(v),self.value=v,self.fireEvent(BI.SingleSlider.EVENT_CHANGE)}}),this.label=BI.createWidget({type:"bi.sign_text_editor",cls:"slider-editor-button",text:o.unit,width:c.EDITOR_WIDTH-2,allowBlank:!1,textAlign:"center",validationChecker:function(v){return self._checkValidation(v)}}),this.label.element.hover(function(){self.label.element.removeClass("bi-border").addClass("bi-border")},function(){self.label.element.removeClass("bi-border")}),this.label.on(BI.SignEditor.EVENT_CONFIRM,function(){var v=BI.parseFloat(this.getValue()),percent=self._getPercentByValue(v),significantPercent=BI.parseFloat(percent.toFixed(1));self._setAllPosition(significantPercent),this.setValue(v),self.value=v,self.fireEvent(BI.SingleSlider.EVENT_CHANGE)}),this._setVisible(!1),{type:"bi.absolute",items:[{el:{type:"bi.vertical",items:[{type:"bi.absolute",items:[{el:this.track,width:"100%",height:c.TRACK_HEIGHT}]}],hgap:7,height:c.TRACK_HEIGHT},top:23,left:0,width:"100%"},{el:sliderVertical,top:20,left:0,width:"100%"},{el:{type:"bi.vertical",items:[{type:"bi.horizontal_auto",items:[this.label]}],height:c.EDITOR_HEIGHT},top:0,left:0,width:"100%"}]}},_draggable:function(widget){function optimizeSize(s){return BI.clamp(s,0,self._getGrayTrackLength())}var self=this,o=this.options,startDrag=!1,size=0,offset=0,defaultSize=0,mouseMoveTracker=new BI.MouseMoveTracker(function(deltaX){if(mouseMoveTracker.isDragging()){startDrag=!0,offset+=deltaX,size=optimizeSize(defaultSize+offset),widget.element.addClass("dragging");var percent=100*size/self._getGrayTrackLength(),significantPercent=BI.parseFloat(percent.toFixed(1));self._setBlueTrack(significantPercent),self._setLabelPosition(significantPercent),self._setSliderPosition(significantPercent);var v=self._getValueByPercent(significantPercent);v=o.digit===!1?v:v.toFixed(o.digit),self.label.setValue(v),self.value=v}},function(){if(startDrag===!0){size=optimizeSize(size);var percent=100*size/self._getGrayTrackLength(),significantPercent=BI.parseFloat(percent.toFixed(1));self._setSliderPosition(significantPercent),size=0,offset=0,defaultSize=size,startDrag=!1}widget.element.removeClass("dragging"),mouseMoveTracker.releaseMouseMoves(),self.fireEvent(BI.SingleSlider.EVENT_CHANGE)},window);widget.element.on("mousedown",function(event){widget.isEnabled()&&(defaultSize=this.offsetLeft,optimizeSize(defaultSize),mouseMoveTracker.captureMouseMoves(event))})},_createTrackWrapper:function(){return BI.createWidget({type:"bi.absolute",items:[{el:{type:"bi.vertical",items:[{type:"bi.absolute",items:[{el:this.grayTrack,top:0,left:0,width:"100%"},{el:this.blueTrack,top:0,left:0,width:"0%"}]}],hgap:8,height:8},top:8,left:0,width:"100%"}]})},_checkValidation:function(v){var o=this.options,valid=!1;if(BI.isNumeric(v)&&!(BI.isNull(v)||vthis.max))if(o.digit===!1)valid=!0;else{var dotText=(v+"").split(".")[1]||"";valid=dotText.length===o.digit}return valid},_setBlueTrack:function(percent){this.blueTrack.element.css({width:percent+"%"})},_setLabelPosition:function(percent){},_setSliderPosition:function(percent){this.slider.element.css({left:percent+"%"})},_setAllPosition:function(percent){this._setSliderPosition(percent),this._setLabelPosition(percent),this._setBlueTrack(percent)},_setVisible:function(visible){this.slider.setVisible(visible),this.label.setVisible(visible)},_getGrayTrackLength:function(){return this.grayTrack.element[0].scrollWidth},_getValueByPercent:function(percent){var thousandth=BI.parseInt(10*percent);return(this.max-this.min)*thousandth/1e3+this.min},_getPercentByValue:function(v){return 100*(v-this.min)/(this.max-this.min)},getValue:function(){return this.value},setValue:function(v){var o=this.options;v=BI.parseFloat(v),v=o.digit===!1?v:v.toFixed(o.digit),isNaN(v)||(this._checkValidation(v)&&(this.value=v),v>this.max&&(this.value=this.max),vminNumber&&(this.min=minNumber,this.max=maxNumber)},reset:function(){this._setVisible(!1),this.enable=!1,this.value="",this.min=0,this.max=0,this._setBlueTrack(0)},populate:function(){isNaN(this.min)||isNaN(this.max)||(this._setVisible(!0),this.enable=!0,this.label.setErrorText(BI.i18nText("BI-Basic_Please_Enter_Number_Between",this.min,this.max)),BI.isNumeric(this.value)||BI.isNotEmptyString(this.value)?(this.label.setValue(this.value),this._setAllPosition(this._getPercentByValue(this.value))):(this.label.setValue(this.max),this._setAllPosition(100)))}}),BI.SingleSlider.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.single_slider",BI.SingleSlider),BI.SingleSliderLabel=BI.inherit(BI.Single,{_constant:{EDITOR_WIDTH:90,EDITOR_HEIGHT:20,HEIGHT:20,SLIDER_WIDTH_HALF:15,SLIDER_WIDTH:30,SLIDER_HEIGHT:30,TRACK_HEIGHT:24},_defaultConfig:function(){return BI.extend(BI.SingleSliderLabel.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-single-slider-label bi-slider-track",digit:!1,unit:""})},_init:function(){BI.SingleSliderLabel.superclass._init.apply(this,arguments);var self=this,o=this.options,c=this._constant;this.enable=!1,this.value="",this.grayTrack=BI.createWidget({type:"bi.layout",cls:"gray-track",height:6}),this.blueTrack=BI.createWidget({type:"bi.layout",cls:"blue-track bi-high-light-background",height:6}),this.track=this._createTrackWrapper(),this.slider=BI.createWidget({type:"bi.single_slider_button"}),this._draggable(this.slider);var sliderVertical=BI.createWidget({type:"bi.vertical",items:[{type:"bi.absolute",items:[this.slider]}],hgap:c.SLIDER_WIDTH_HALF,height:c.SLIDER_HEIGHT});sliderVertical.element.click(function(e){if(self.enable&&self.isEnabled()){var offset=e.clientX-self.element.offset().left-c.SLIDER_WIDTH_HALF,trackLength=self.track.element[0].scrollWidth,percent=0;offset<0&&(percent=0),offset>0&&offsettrackLength-c.SLIDER_WIDTH&&(percent=100);var significantPercent=BI.parseFloat(percent.toFixed(1));self._setAllPosition(significantPercent);var v=self._getValueByPercent(significantPercent);v=o.digit===!1?v:v.toFixed(o.digit),self.label.setText(v+o.unit),self.value=v,self.fireEvent(BI.SingleSliderLabel.EVENT_CHANGE)}}),this.label=BI.createWidget({type:"bi.label",height:c.HEIGHT,width:c.EDITOR_WIDTH-2}),this._setVisible(!1),BI.createWidget({type:"bi.absolute",element:this,items:[{el:{type:"bi.vertical",items:[{type:"bi.absolute",items:[{el:this.track,width:"100%",height:c.TRACK_HEIGHT}]}],hgap:7,height:c.TRACK_HEIGHT},top:13,left:0,width:"100%"},{el:sliderVertical,top:10,left:0,width:"100%"},{el:{type:"bi.vertical",items:[{type:"bi.horizontal_auto",items:[this.label]}],height:c.EDITOR_HEIGHT},top:0,left:0,width:"100%"}]})},_draggable:function(widget){function optimizeSize(s){return BI.clamp(s,0,self._getGrayTrackLength())}var self=this,o=this.options,startDrag=!1,size=0,offset=0,defaultSize=0,mouseMoveTracker=new BI.MouseMoveTracker(function(deltaX){if(mouseMoveTracker.isDragging()){startDrag=!0,offset+=deltaX,size=optimizeSize(defaultSize+offset),widget.element.addClass("dragging");var percent=100*size/self._getGrayTrackLength(),significantPercent=BI.parseFloat(percent.toFixed(1));self._setBlueTrack(significantPercent),self._setLabelPosition(significantPercent),self._setSliderPosition(significantPercent);var v=self._getValueByPercent(significantPercent);v=o.digit===!1?v:v.toFixed(o.digit),self.label.setValue(v+o.unit),self.value=v,self.fireEvent(BI.SingleSliderLabel.EVENT_CHANGE)}},function(){if(startDrag===!0){size=optimizeSize(size);var percent=100*size/self._getGrayTrackLength(),significantPercent=BI.parseFloat(percent.toFixed(1));self._setSliderPosition(significantPercent),size=0,offset=0,defaultSize=size,startDrag=!1}widget.element.removeClass("dragging"),mouseMoveTracker.releaseMouseMoves(),self.fireEvent(BI.SingleSliderLabel.EVENT_CHANGE)},window);widget.element.on("mousedown",function(event){widget.isEnabled()&&(defaultSize=this.offsetLeft,optimizeSize(defaultSize),mouseMoveTracker.captureMouseMoves(event))})},_createTrackWrapper:function(){return BI.createWidget({type:"bi.absolute",items:[{el:{type:"bi.vertical",items:[{type:"bi.absolute",items:[{el:this.grayTrack,top:0,left:0,width:"100%"},{el:this.blueTrack,top:0,left:0,width:"0%"}]}],hgap:8,height:8},top:8,left:0,width:"100%"}]})},_checkValidation:function(v){return BI.isNumeric(v)&&!(BI.isNull(v)||vthis.max)},_setBlueTrack:function(percent){this.blueTrack.element.css({width:percent+"%"})},_setLabelPosition:function(percent){},_setSliderPosition:function(percent){this.slider.element.css({left:percent+"%"})},_setAllPosition:function(percent){this._setSliderPosition(percent),this._setLabelPosition(percent),this._setBlueTrack(percent)},_setVisible:function(visible){this.slider.setVisible(visible),this.label.setVisible(visible)},_getGrayTrackLength:function(){return this.grayTrack.element[0].scrollWidth},_getValueByPercent:function(percent){var thousandth=BI.parseInt(10*percent);return(this.max-this.min)*thousandth/1e3+this.min},_getPercentByValue:function(v){return 100*(v-this.min)/(this.max-this.min)},_setEnable:function(b){BI.SingleSliderLabel.superclass._setEnable.apply(this,[b]),b?this.blueTrack.element.removeClass("disabled-blue-track").addClass("blue-track"):this.blueTrack.element.removeClass("blue-track").addClass("disabled-blue-track")},getValue:function(){return this.value},setValue:function(v){var o=this.options;v=BI.parseFloat(v),v=o.digit===!1?v:v.toFixed(o.digit),isNaN(v)||(this._checkValidation(v)&&(this.value=v),v>this.max&&(this.value=this.max),vminNumber&&(this.min=minNumber,this.max=maxNumber)},reset:function(){this._setVisible(!1),this.enable=!1,this.value="",this.min=0,this.max=0,this._setBlueTrack(0)},populate:function(){var o=this.options;isNaN(this.min)||isNaN(this.max)||(this._setVisible(!0),this.enable=!0,BI.isNumeric(this.value)||BI.isNotEmptyString(this.value)?(this.label.setValue(this.value+o.unit),this._setAllPosition(this._getPercentByValue(this.value))):(this.label.setValue(this.max+o.unit),this._setAllPosition(100)))}}),BI.SingleSliderLabel.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.single_slider_label",BI.SingleSliderLabel),BI.SingleSliderNormal=BI.inherit(BI.Single,{_constant:{HEIGHT:28,SLIDER_WIDTH_HALF:15,SLIDER_WIDTH:30,SLIDER_HEIGHT:30,TRACK_HEIGHT:24},props:{baseCls:"bi-single-slider-normal bi-slider-track",minMax:{min:0,max:100}},render:function(){var self=this,c=this._constant,track=this._createTrack();this.slider=BI.createWidget({type:"bi.single_slider_button"}),this._draggable(this.slider);var sliderVertical=BI.createWidget({type:"bi.vertical",items:[{type:"bi.absolute",items:[this.slider]}],hgap:c.SLIDER_WIDTH_HALF,height:c.SLIDER_HEIGHT});return sliderVertical.element.click(function(e){if(self.enable&&self.isEnabled()){var offset=e.clientX-self.element.offset().left-c.SLIDER_WIDTH_HALF,trackLength=self.track.element[0].scrollWidth,percent=0;offset<0&&(percent=0),offset>0&&offsettrackLength-c.SLIDER_WIDTH&&(percent=100);var significantPercent=BI.parseFloat(percent.toFixed(1));self._setAllPosition(significantPercent);var v=self._getValueByPercent(significantPercent);self.value=v,self.fireEvent(BI.SingleSlider.EVENT_CHANGE)}}),{type:"bi.absolute",element:this,items:[{el:{type:"bi.vertical",items:[{type:"bi.absolute",items:[{el:track,width:"100%",height:c.TRACK_HEIGHT}]}],hgap:7,height:c.TRACK_HEIGHT},top:3,left:0,width:"100%"},{el:sliderVertical,top:0,left:0,width:"100%"}]}},_draggable:function(widget){function optimizeSize(s){return BI.clamp(s,0,self._getGrayTrackLength())}var self=this,o=this.options,startDrag=!1,size=0,offset=0,defaultSize=0,mouseMoveTracker=new BI.MouseMoveTracker(function(deltaX){if(mouseMoveTracker.isDragging()){startDrag=!0,offset+=deltaX,size=optimizeSize(defaultSize+offset),widget.element.addClass("dragging");var percent=100*size/self._getGrayTrackLength(),significantPercent=BI.parseFloat(percent.toFixed(1));self._setBlueTrack(significantPercent),self._setSliderPosition(significantPercent);var v=self._getValueByPercent(significantPercent);v=o.digit===!1?v:v.toFixed(o.digit),self.value=v,self.fireEvent(BI.SingleSliderNormal.EVENT_DRAG,v)}},function(){if(startDrag===!0){size=optimizeSize(size);var percent=100*size/self._getGrayTrackLength(),significantPercent=BI.parseFloat(percent.toFixed(1));self._setSliderPosition(significantPercent),size=0,offset=0,defaultSize=size,startDrag=!1}widget.element.removeClass("dragging"),mouseMoveTracker.releaseMouseMoves(),self.fireEvent(BI.SingleSlider.EVENT_CHANGE)},window);widget.element.on("mousedown",function(event){widget.isEnabled()&&(defaultSize=this.offsetLeft,optimizeSize(defaultSize),mouseMoveTracker.captureMouseMoves(event))})},_createTrack:function(){var self=this,c=this._constant;return this.grayTrack=BI.createWidget({type:"bi.layout",cls:"gray-track",height:6}),this.blueTrack=BI.createWidget({type:"bi.layout",cls:"blue-track bi-high-light-background",height:6}),this.options.color&&this.blueTrack.element.css({"background-color":this.options.color}),{type:"bi.absolute",items:[{el:{type:"bi.vertical",items:[{type:"bi.absolute",items:[{el:this.grayTrack,top:0,left:0,width:"100%"},{el:this.blueTrack,top:0,left:0,width:"0%"}]}],hgap:8,height:8},top:8,left:0,width:"100%"}],ref:function(ref){self.track=ref}}},_checkValidation:function(v){return!(BI.isNull(v)||vthis.max)},_setBlueTrack:function(percent){this.blueTrack.element.css({width:percent+"%"})},_setSliderPosition:function(percent){this.slider.element.css({left:percent+"%"})},_setAllPosition:function(percent){this._setSliderPosition(percent),this._setBlueTrack(percent)},_setVisible:function(visible){this.slider.setVisible(visible)},_getGrayTrackLength:function(){return this.grayTrack.element[0].scrollWidth},_getValueByPercent:function(percent){var thousandth=BI.parseInt(10*percent);return(this.max-this.min)*thousandth/1e3+this.min},_getPercentByValue:function(v){return 100*(v-this.min)/(this.max-this.min)},_setEnable:function(b){BI.SingleSliderNormal.superclass._setEnable.apply(this,[b]),b?this.blueTrack.element.removeClass("disabled-blue-track").addClass("blue-track"):this.blueTrack.element.removeClass("blue-track").addClass("disabled-blue-track")},getValue:function(){return this.value},setValue:function(v){var value=BI.parseFloat(v);isNaN(value)||(this._checkValidation(value)&&(this.value=value),value>this.max&&(this.value=this.max),valueminNumber&&(this.min=minNumber,this.max=maxNumber)},reset:function(){this._setVisible(!1),this.enable=!1,this.value="",this.min=0,this.max=0,this._setBlueTrack(0)},populate:function(){isNaN(this.min)||isNaN(this.max)||(this._setVisible(!0),this.enable=!0,BI.isNumeric(this.value)||BI.isNotEmptyString(this.value)?this._setAllPosition(this._getPercentByValue(this.value)):this._setAllPosition(100))}}),BI.SingleSliderNormal.EVENT_DRAG="EVENT_DRAG",BI.shortcut("bi.single_slider_normal",BI.SingleSliderNormal),BI.SingleTreeCombo=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.SingleTreeCombo.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-single-tree-combo",trigger:{},height:24,text:"",items:[],value:"",attributes:{tabIndex:0}})},_init:function(){BI.SingleTreeCombo.superclass._init.apply(this,arguments);var self=this,o=this.options;this.trigger=BI.createWidget(BI.extend({type:"bi.single_tree_trigger",text:o.text,height:o.height,items:o.items,value:o.value},o.trigger)),this.popup=BI.createWidget({type:"bi.single_level_tree",items:o.items,value:o.value}),this.combo=BI.createWidget({type:"bi.combo",container:o.container,element:this,adjustLength:2,el:this.trigger,popup:{el:this.popup}}),this.combo.on(BI.Controller.EVENT_CHANGE,function(){self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.combo.on(BI.Combo.EVENT_BEFORE_POPUPVIEW,function(){self.fireEvent(BI.SingleTreeCombo.EVENT_BEFORE_POPUPVIEW,arguments)}),this.popup.on(BI.SingleTreePopup.EVENT_CHANGE,function(){self.setValue(self.popup.getValue()),self.combo.hideView(),self.fireEvent(BI.SingleTreeCombo.EVENT_CHANGE)})},populate:function(items){this.combo.populate(items)},setValue:function(v){v=BI.isArray(v)?v:[v],this.trigger.setValue(v),this.popup.setValue(v)},getValue:function(){return this.popup.getValue()}}),BI.SingleTreeCombo.EVENT_CHANGE="EVENT_CHANGE",BI.SingleTreeCombo.EVENT_BEFORE_POPUPVIEW="EVENT_BEFORE_POPUPVIEW",BI.shortcut("bi.single_tree_combo",BI.SingleTreeCombo),BI.SingleTreePopup=BI.inherit(BI.Pane,{_defaultConfig:function(){return BI.extend(BI.SingleTreePopup.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-single-level-tree",tipText:BI.i18nText("BI-No_Selected_Item"),items:[],value:""})},_init:function(){BI.SingleTreePopup.superclass._init.apply(this,arguments);var self=this,o=this.options;this.tree=BI.createWidget({type:"bi.level_tree",expander:{isDefaultInit:!0},items:o.items,value:o.value,chooseType:BI.Selection.Single}),BI.createWidget({type:"bi.vertical",element:this,vgap:5,items:[this.tree]}),this.tree.on(BI.Controller.EVENT_CHANGE,function(){self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.tree.on(BI.LevelTree.EVENT_CHANGE,function(){self.fireEvent(BI.SingleTreePopup.EVENT_CHANGE)}),this.check()},getValue:function(){return this.tree.getValue()},setValue:function(v){v=BI.isArray(v)?v:[v],this.tree.setValue(v)},populate:function(items){BI.SingleTreePopup.superclass.populate.apply(this,arguments),this.tree.populate(items)}}),BI.SingleTreePopup.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.single_level_tree",BI.SingleTreePopup),BI.SingleTreeTrigger=BI.inherit(BI.Trigger,{_defaultConfig:function(){return BI.extend(BI.SingleTreeTrigger.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-single-tree-trigger",height:24,text:"",items:[],value:""})},_init:function(){BI.SingleTreeTrigger.superclass._init.apply(this,arguments);var self=this,o=this.options;this.trigger=BI.createWidget({type:"bi.select_text_trigger",element:this,text:o.text,items:o.items,height:o.height,value:o.value})},_checkTitle:function(){var self=this,val=this.getValue();BI.any(this.options.items,function(i,item){if(BI.contains(val,item.value))return self.trigger.setTitle(item.text||item.value),!0})},setValue:function(v){v=BI.isArray(v)?v:[v],this.options.value=v,this.trigger.setValue(v),this._checkTitle()},getValue:function(){return this.options.value||[]},populate:function(items){BI.SingleTreeTrigger.superclass.populate.apply(this,arguments),this.trigger.populate(items)}}),BI.shortcut("bi.single_tree_trigger",BI.SingleTreeTrigger),BI.TextValueDownListCombo=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.TextValueDownListCombo.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-text-value-down-list-combo",height:24,attributes:{tabIndex:0}})},_init:function(){BI.TextValueDownListCombo.superclass._init.apply(this,arguments);var self=this,o=this.options;this._createValueMap();var value;BI.isNotNull(o.value)&&(value=this._digest(o.value)),this.trigger=BI.createWidget({type:"bi.down_list_select_text_trigger",cls:"text-value-down-list-trigger",height:o.height,items:o.items,text:o.text,value:value}),this.combo=BI.createWidget({type:"bi.down_list_combo",element:this,chooseType:BI.Selection.Single,adjustLength:2,height:o.height,el:this.trigger,value:BI.isNull(value)?[]:[value],items:BI.deepClone(o.items)}),this.combo.on(BI.DownListCombo.EVENT_CHANGE,function(){var currentVal=self.combo.getValue()[0].value;currentVal!==self.value&&(self.setValue(currentVal),self.fireEvent(BI.TextValueDownListCombo.EVENT_CHANGE))}),this.combo.on(BI.DownListCombo.EVENT_SON_VALUE_CHANGE,function(){var currentVal=self.combo.getValue()[0].childValue;currentVal!==self.value&&(self.setValue(currentVal),self.fireEvent(BI.TextValueDownListCombo.EVENT_CHANGE))})},_createValueMap:function(){var self=this;this.valueMap={},BI.each(BI.flatten(this.options.items),function(idx,item){BI.has(item,"el")?BI.each(item.children,function(id,it){self.valueMap[it.value]={value:item.el.value,childValue:it.value}}):self.valueMap[item.value]={value:item.value}})},_digest:function(v){return this.value=v,this.valueMap[v]},setValue:function(v){v=this._digest(v),this.combo.setValue([v]),this.trigger.setValue(v)},getValue:function(){var v=this.combo.getValue()[0];return[v.childValue||v.value]},populate:function(items){this.options.items=BI.flatten(items),this.combo.populate(items),this._createValueMap()}}),BI.TextValueDownListCombo.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.text_value_down_list_combo",BI.TextValueDownListCombo),BI.DownListSelectTextTrigger=BI.inherit(BI.Trigger,{_defaultConfig:function(){return BI.extend(BI.DownListSelectTextTrigger.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-down-list-select-text-trigger",height:24,text:""})},_init:function(){BI.DownListSelectTextTrigger.superclass._init.apply(this,arguments);var o=this.options;this.trigger=BI.createWidget({type:"bi.select_text_trigger",element:this,height:o.height,items:this._formatItemArray(o.items),text:o.text,value:BI.isNull(o.value)?"":o.value.childValue||o.value.value})},_formatItemArray:function(){var sourceArray=BI.flatten(BI.deepClone(this.options.items)),targetArray=[];return BI.each(sourceArray,function(idx,item){BI.has(item,"el")?(BI.each(item.children,function(id,it){it.text=item.el.text+"("+it.text+")"}),targetArray=BI.concat(targetArray,item.children)):targetArray.push(item)}),targetArray},setValue:function(vals){this.trigger.setValue(vals.childValue||vals.value)},populate:function(items){this.trigger.populate(this._formatItemArray(items))}}),BI.shortcut("bi.down_list_select_text_trigger",BI.DownListSelectTextTrigger),!function(){BI.TimePopup=BI.inherit(BI.Widget,{props:{baseCls:"bi-date-time-popup",height:68},render:function(){var self=this,o=this.options;return{type:"bi.vtape",items:[{el:{type:"bi.center_adapt",cls:"bi-split-top",items:[{type:"bi.dynamic_date_time_select",value:o.value,ref:function(_ref){self.timeSelect=_ref}}]},hgap:10,height:44},{el:{type:"bi.grid",items:[[{type:"bi.text_button",cls:"bi-high-light bi-split-top",shadow:!0,text:BI.i18nText("BI-Basic_Clears"),listeners:[{eventName:BI.TextButton.EVENT_CHANGE,action:function(){self.fireEvent(BI.TimePopup.BUTTON_CLEAR_EVENT_CHANGE)}}]},{type:"bi.text_button",cls:"bi-split-left bi-split-right bi-high-light bi-split-top",shadow:!0,text:BI.i18nText("BI-Basic_Now"),listeners:[{eventName:BI.TextButton.EVENT_CHANGE,action:function(){self.fireEvent(BI.TimePopup.BUTTON_NOW_EVENT_CHANGE)}}]},{type:"bi.text_button",cls:"bi-high-light bi-split-top",shadow:!0,text:BI.i18nText("BI-Basic_OK"),listeners:[{eventName:BI.TextButton.EVENT_CHANGE,action:function(){self.fireEvent(BI.TimePopup.BUTTON_OK_EVENT_CHANGE)}}]}]]},height:24}]}},setValue:function(value){this._checkValueValid(value)?this.timeSelect.setValue():this.timeSelect.setValue({hour:value.hour,minute:value.minute,second:value.second})},getValue:function(){return this.timeSelect.getValue()},_checkValueValid:function(value){return BI.isNull(value)||BI.isEmptyObject(value)||BI.isEmptyString(value)}}),BI.TimePopup.BUTTON_OK_EVENT_CHANGE="BUTTON_OK_EVENT_CHANGE", +BI.TimePopup.BUTTON_CLEAR_EVENT_CHANGE="BUTTON_CLEAR_EVENT_CHANGE",BI.TimePopup.BUTTON_NOW_EVENT_CHANGE="BUTTON_NOW_EVENT_CHANGE",BI.TimePopup.CALENDAR_EVENT_CHANGE="CALENDAR_EVENT_CHANGE",BI.shortcut("bi.time_popup",BI.TimePopup)}(),!function(){BI.TimeCombo=BI.inherit(BI.Single,{constants:{popupHeight:80,popupWidth:240,comboAdjustHeight:1,border:1},props:{baseCls:"bi-time-combo bi-border bi-border-radius bi-focus-shadow",width:78,height:22,format:"",allowEdit:!1},render:function(){var self=this,opts=this.options;this.storeTriggerValue="",this.storeValue=opts.value;var popup={type:"bi.time_popup",value:opts.value,listeners:[{eventName:BI.TimePopup.BUTTON_CLEAR_EVENT_CHANGE,action:function(){self.setValue(),self.hidePopupView(),self.fireEvent(BI.TimeCombo.EVENT_CONFIRM)}},{eventName:BI.TimePopup.BUTTON_OK_EVENT_CHANGE,action:function(){self.setValue(self.popup.getValue()),self.hidePopupView(),self.fireEvent(BI.TimeCombo.EVENT_CONFIRM)}},{eventName:BI.TimePopup.BUTTON_NOW_EVENT_CHANGE,action:function(){self._setNowTime()}}],ref:function(_ref){self.popup=_ref}};return{type:"bi.htape",items:[{type:"bi.absolute",items:[{el:{type:"bi.combo",container:opts.container,toggle:!1,isNeedAdjustHeight:!1,isNeedAdjustWidth:!1,el:{type:"bi.time_trigger",height:opts.height,allowEdit:opts.allowEdit,watermark:opts.watermark,format:opts.format,value:opts.value,ref:function(_ref){self.trigger=_ref},listeners:[{eventName:"EVENT_KEY_DOWN",action:function(){self.combo.isViewVisible()&&self.combo.hideView(),self.fireEvent(BI.TimeCombo.EVENT_KEY_DOWN,arguments)}},{eventName:"EVENT_STOP",action:function(){self.combo.isViewVisible()||self.combo.showView()}},{eventName:"EVENT_FOCUS",action:function(){self.storeTriggerValue=self.trigger.getKey(),self.combo.isViewVisible()||self.combo.showView(),self.fireEvent("EVENT_FOCUS")}},{eventName:"EVENT_BLUR",action:function(){self.fireEvent("EVENT_BLUR")}},{eventName:"EVENT_ERROR",action:function(){var date=BI.getDate();self.storeValue={hour:date.getHours(),minute:date.getMinutes(),second:date.getSeconds()},self.fireEvent("EVENT_ERROR")}},{eventName:"EVENT_VALID",action:function(){self.fireEvent("EVENT_VALID")}},{eventName:"EVENT_CHANGE",action:function(){self.fireEvent("EVENT_CHANGE")}},{eventName:"EVENT_CONFIRM",action:function(){if(!self.combo.isViewVisible()){var dateStore=self.storeTriggerValue,dateObj=self.trigger.getKey();BI.isNotEmptyString(dateObj)&&!BI.isEqual(dateObj,dateStore)?(self.storeValue=self.trigger.getValue(),self.setValue(self.trigger.getValue())):BI.isEmptyString(dateObj)&&(self.storeValue=null,self.trigger.setValue()),self.fireEvent("EVENT_CONFIRM")}}}]},adjustLength:this.constants.comboAdjustHeight,popup:{el:popup,width:this.constants.popupWidth,stopPropagation:!1},hideChecker:function(e){return 0===self.triggerBtn.element.find(e.target).length},listeners:[{eventName:BI.Combo.EVENT_BEFORE_POPUPVIEW,action:function(){self.popup.setValue(self.storeValue),self.fireEvent(BI.TimeCombo.EVENT_BEFORE_POPUPVIEW)}}],ref:function(_ref){self.combo=_ref}},top:0,left:0,right:22,bottom:0},{el:{type:"bi.icon_button",cls:"bi-trigger-icon-button time-font icon-size-16",width:22,height:22,listeners:[{eventName:BI.IconButton.EVENT_CHANGE,action:function(){self.combo.isViewVisible()||self.combo.showView()}}],ref:function(_ref){self.triggerBtn=_ref}},top:0,right:0}]}]}},setValue:function(v){this.storeValue=v,this.trigger.setValue(v)},getValue:function(){return this.storeValue},hidePopupView:function(){this.combo.hideView()},_setNowTime:function(){var date=BI.getDate(),nowTome={hour:date.getHours(),minute:date.getMinutes(),second:date.getSeconds()};this.setValue(nowTome),this.hidePopupView(),this.fireEvent(BI.TimeCombo.EVENT_CONFIRM)}}),BI.TimeCombo.EVENT_KEY_DOWN="EVENT_KEY_DOWN",BI.TimeCombo.EVENT_CONFIRM="EVENT_CONFIRM",BI.TimeCombo.EVENT_CHANGE="EVENT_CHANGE",BI.TimeCombo.EVENT_VALID="EVENT_VALID",BI.TimeCombo.EVENT_ERROR="EVENT_ERROR",BI.TimeCombo.EVENT_BEFORE_POPUPVIEW="EVENT_BEFORE_POPUPVIEW",BI.shortcut("bi.time_combo",BI.TimeCombo)}(),!function(){BI.TimeTrigger=BI.inherit(BI.Trigger,{_const:{COMPARE_FORMAT:"%H:%M:%S",COMPLETE_COMPARE_FORMAT:"%Y-%M-%d %H:%M:%S %P",FORMAT_ARRAY:["%H:%M:%S","%I:%M:%S","%l:%M:%S","%k:%M:%S","%l:%M:%S %p","%l:%M:%S %P","%H:%M:%S %p","%H:%M:%S %P","%l:%M","%k:%M","%I:%M","%H:%M","%M:%S"],DEFAULT_DATE_STRING:"2000-01-01"},props:{extraCls:"bi-time-trigger",value:{},format:"",allowEdit:!1},render:function(){var self=this,o=this.options;return this.storeTriggerValue="",this.storeValue=o.value,{type:"bi.absolute",items:[{el:{type:"bi.sign_editor",height:o.height,validationChecker:function(v){return self._dateCheck(v)},quitChecker:function(){return!1},ref:function(_ref){self.editor=_ref},value:this._formatValue(o.value),hgap:4,allowBlank:!0,watermark:BI.isKey(o.watermark)?o.watermark:BI.i18nText("BI-Basic_Unrestricted"),title:BI.bind(this._getTitle,this),listeners:[{eventName:"EVENT_KEY_DOWN",action:function(){self.fireEvent("EVENT_KEY_DOWN",arguments)}},{eventName:"EVENT_FOCUS",action:function(){self.storeTriggerValue=self.getKey(),self.fireEvent("EVENT_FOCUS")}},{eventName:"EVENT_BLUR",action:function(){self.fireEvent("EVENT_BLUR")}},{eventName:"EVENT_STOP",action:function(){self.fireEvent("EVENT_STOP")}},{eventName:"EVENT_VALID",action:function(){self.fireEvent("EVENT_VALID")}},{eventName:"EVENT_ERROR",action:function(){self.fireEvent("EVENT_ERROR")}},{eventName:"EVENT_CONFIRM",action:function(){var value=self.editor.getValue();if(BI.isNotNull(value)&&self.editor.setState(value),BI.isNotEmptyString(value)&&!BI.isEqual(self.storeTriggerValue,self.getKey())){var date=value.match(/\d+/g);self.storeValue={hour:0|date[0],minute:0|date[1],second:0|date[2]}}self.fireEvent("EVENT_CONFIRM")}},{eventName:"EVENT_START",action:function(){self.fireEvent("EVENT_START")}},{eventName:"EVENT_CHANGE",action:function(){self.fireEvent("EVENT_CHANGE")}}]},left:0,right:0,top:0,bottom:0},{el:{type:"bi.text",invisible:o.allowEdit,cls:"show-text",title:BI.bind(this._getTitle,this),hgap:4},left:0,right:0,top:0,bottom:0}]}},_dateCheck:function(date){var c=this._const;return BI.any(c.FORMAT_ARRAY,function(idx,format){return BI.print(BI.parseDateTime(c.DEFAULT_DATE_STRING+" "+date,c.COMPLETE_COMPARE_FORMAT),format)===date})},_getTitle:function(){var storeValue=this.storeValue||{},date=BI.getDate();return BI.print(BI.getDate(date.getFullYear(),0,1,storeValue.hour,storeValue.minute,storeValue.second),this._getFormatString())},_getFormatString:function(){return this.options.format||this._const.COMPARE_FORMAT},_formatValue:function(v){var now=BI.getDate();return BI.isNotEmptyObject(v)?BI.print(BI.getDate(now.getFullYear(),now.getMonth(),now.getDay(),v.hour,v.minute,v.second),this._getFormatString()):""},getKey:function(){return this.editor.getValue()},setValue:function(v){this.storeValue=v,this.editor.setValue(this._formatValue(v))},getValue:function(){return this.storeValue}}),BI.shortcut("bi.time_trigger",BI.TimeTrigger)}(),BI.DateInterval=BI.inherit(BI.Single,{constants:{height:24,width:24,lgap:15,offset:0,timeErrorCls:"time-error"},_defaultConfig:function(){var conf=BI.DateInterval.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{extraCls:"bi-date-interval",minDate:"1900-01-01",maxDate:"2099-12-31"})},_init:function(){var self=this,o=this.options;BI.DateInterval.superclass._init.apply(this,arguments),o.value=o.value||{},this.left=this._createCombo(o.value.start),this.right=this._createCombo(o.value.end),this.label=BI.createWidget({type:"bi.label",height:this.constants.height,width:this.constants.width,text:"-"}),BI.createWidget({element:self,type:"bi.center",height:this.constants.height,items:[{type:"bi.absolute",items:[{el:self.left,left:this.constants.offset,right:this.constants.width/2,top:0,bottom:0}]},{type:"bi.absolute",items:[{el:self.right,left:this.constants.width/2,right:this.constants.offset,top:0,bottom:0}]}]}),BI.createWidget({type:"bi.horizontal_auto",element:this,items:[self.label]})},_createCombo:function(v){var self=this,o=this.options,combo=BI.createWidget({type:"bi.dynamic_date_combo",behaviors:o.behaviors,value:v});return combo.on(BI.DynamicDateCombo.EVENT_ERROR,function(){self._clearTitle(),BI.Bubbles.hide("error"),self.element.removeClass(self.constants.timeErrorCls),self.fireEvent(BI.DateInterval.EVENT_ERROR)}),combo.on(BI.DynamicDateCombo.EVENT_VALID,function(){BI.Bubbles.hide("error");var smallDate=self.left.getKey(),bigDate=self.right.getKey();self._check(smallDate,bigDate)&&self._compare(smallDate,bigDate)?(self._setTitle(BI.i18nText("BI-Time_Interval_Error_Text")),self.element.addClass(self.constants.timeErrorCls),BI.Bubbles.show("error",BI.i18nText("BI-Time_Interval_Error_Text"),self,{offsetStyle:"center"}),self.fireEvent(BI.DateInterval.EVENT_ERROR)):(self._clearTitle(),self.element.removeClass(self.constants.timeErrorCls))}),combo.on(BI.DynamicDateCombo.EVENT_FOCUS,function(){BI.Bubbles.hide("error");var smallDate=self.left.getKey(),bigDate=self.right.getKey();self._check(smallDate,bigDate)&&self._compare(smallDate,bigDate)?(self._setTitle(BI.i18nText("BI-Time_Interval_Error_Text")),self.element.addClass(self.constants.timeErrorCls),BI.Bubbles.show("error",BI.i18nText("BI-Time_Interval_Error_Text"),self,{offsetStyle:"center"}),self.fireEvent(BI.DateInterval.EVENT_ERROR)):(self._clearTitle(),self.element.removeClass(self.constants.timeErrorCls))}),combo.on(BI.DynamicDateCombo.EVENT_BEFORE_POPUPVIEW,function(){self.left.hidePopupView(),self.right.hidePopupView()}),combo.on(BI.DynamicDateCombo.EVENT_CONFIRM,function(){BI.Bubbles.hide("error");var smallDate=self.left.getKey(),bigDate=self.right.getKey();self._check(smallDate,bigDate)&&self._compare(smallDate,bigDate)?(self._setTitle(BI.i18nText("BI-Time_Interval_Error_Text")),self.element.addClass(self.constants.timeErrorCls),self.fireEvent(BI.DateInterval.EVENT_ERROR)):(self._clearTitle(),self.element.removeClass(self.constants.timeErrorCls),self.fireEvent(BI.DateInterval.EVENT_CHANGE))}),combo},_dateCheck:function(date){return BI.print(BI.parseDateTime(date,"%Y-%x-%d"),"%Y-%x-%d")===date||BI.print(BI.parseDateTime(date,"%Y-%X-%d"),"%Y-%X-%d")===date||BI.print(BI.parseDateTime(date,"%Y-%x-%e"),"%Y-%x-%e")===date||BI.print(BI.parseDateTime(date,"%Y-%X-%e"),"%Y-%X-%e")===date},_checkVoid:function(obj){var o=this.options;return!BI.checkDateVoid(obj.year,obj.month,obj.day,o.minDate,o.maxDate)[0]},_check:function(smallDate,bigDate){var smallObj=smallDate.match(/\d+/g),bigObj=bigDate.match(/\d+/g);return this._dateCheck(smallDate)&&BI.checkDateLegal(smallDate)&&this._checkVoid({year:smallObj[0],month:smallObj[1],day:smallObj[2]})&&this._dateCheck(bigDate)&&BI.checkDateLegal(bigDate)&&this._checkVoid({year:bigObj[0],month:bigObj[1],day:bigObj[2]})},_compare:function(smallDate,bigDate){return smallDate=BI.print(BI.parseDateTime(smallDate,"%Y-%X-%d"),"%Y-%X-%d"),bigDate=BI.print(BI.parseDateTime(bigDate,"%Y-%X-%d"),"%Y-%X-%d"),BI.isNotNull(smallDate)&&BI.isNotNull(bigDate)&&smallDate>bigDate},_setTitle:function(v){this.left.setTitle(v),this.right.setTitle(v),this.label.setTitle(v)},_clearTitle:function(){this.left.setTitle(""),this.right.setTitle(""),this.label.setTitle("")},setValue:function(date){date=date||{},this.left.setValue(date.start),this.right.setValue(date.end)},getValue:function(){return{start:this.left.getValue(),end:this.right.getValue()}}}),BI.DateInterval.EVENT_VALID="EVENT_VALID",BI.DateInterval.EVENT_ERROR="EVENT_ERROR",BI.DateInterval.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.date_interval",BI.DateInterval),BI.TimeInterval=BI.inherit(BI.Single,{constants:{height:24,width:24,lgap:15,offset:0,timeErrorCls:"time-error"},_defaultConfig:function(){var conf=BI.TimeInterval.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{extraCls:"bi-time-interval",minDate:"1900-01-01",maxDate:"2099-12-31"})},_init:function(){var self=this,o=this.options;BI.TimeInterval.superclass._init.apply(this,arguments),o.value=o.value||{},this.left=this._createCombo(o.value.start),this.right=this._createCombo(o.value.end),this.label=BI.createWidget({type:"bi.label",height:this.constants.height,width:this.constants.width,text:"-"}),BI.createWidget({element:self,type:"bi.center",height:this.constants.height,items:[{type:"bi.absolute",items:[{el:self.left,left:this.constants.offset,right:this.constants.width/2,top:0,bottom:0}]},{type:"bi.absolute",items:[{el:self.right,left:this.constants.width/2,right:this.constants.offset,top:0,bottom:0}]}]}),BI.createWidget({type:"bi.horizontal_auto",element:this,items:[self.label]})},_createCombo:function(v){var self=this,o=this.options,combo=BI.createWidget({type:"bi.dynamic_date_time_combo",behaviors:o.behaviors,value:v});return combo.on(BI.DynamicDateTimeCombo.EVENT_ERROR,function(){self._clearTitle(),BI.Bubbles.hide("error"),self.element.removeClass(self.constants.timeErrorCls),self.fireEvent(BI.TimeInterval.EVENT_ERROR)}),combo.on(BI.DynamicDateTimeCombo.EVENT_VALID,function(){BI.Bubbles.hide("error");var smallDate=self.left.getKey(),bigDate=self.right.getKey();self.left.isValid()&&self.right.isValid()&&self._check(smallDate,bigDate)&&self._compare(smallDate,bigDate)?(self._setTitle(BI.i18nText("BI-Time_Interval_Error_Text")),self.element.addClass(self.constants.timeErrorCls),BI.Bubbles.show("error",BI.i18nText("BI-Time_Interval_Error_Text"),self,{offsetStyle:"center"}),self.fireEvent(BI.TimeInterval.EVENT_ERROR)):(self._clearTitle(),self.element.removeClass(self.constants.timeErrorCls))}),combo.on(BI.DynamicDateTimeCombo.EVENT_FOCUS,function(){BI.Bubbles.hide("error");var smallDate=self.left.getKey(),bigDate=self.right.getKey();self.left.isValid()&&self.right.isValid()&&self._check(smallDate,bigDate)&&self._compare(smallDate,bigDate)?(self._setTitle(BI.i18nText("BI-Time_Interval_Error_Text")),self.element.addClass(self.constants.timeErrorCls),BI.Bubbles.show("error",BI.i18nText("BI-Time_Interval_Error_Text"),self,{offsetStyle:"center"}),self.fireEvent(BI.TimeInterval.EVENT_ERROR)):(self._clearTitle(),self.element.removeClass(self.constants.timeErrorCls))}),combo.on(BI.DynamicDateTimeCombo.EVENT_BEFORE_POPUPVIEW,function(){self.left.hidePopupView(),self.right.hidePopupView()}),combo.on(BI.DynamicDateTimeCombo.EVENT_CONFIRM,function(){BI.Bubbles.hide("error");var smallDate=self.left.getKey(),bigDate=self.right.getKey();self.left.isValid()&&self.right.isValid()&&self._check(smallDate,bigDate)&&self._compare(smallDate,bigDate)?(self._setTitle(BI.i18nText("BI-Time_Interval_Error_Text")),self.element.addClass(self.constants.timeErrorCls),self.fireEvent(BI.TimeInterval.EVENT_ERROR)):(self._clearTitle(),self.element.removeClass(self.constants.timeErrorCls),self.fireEvent(BI.TimeInterval.EVENT_CHANGE))}),combo},_dateCheck:function(date){return BI.print(BI.parseDateTime(date,"%Y-%x-%d %H:%M:%S"),"%Y-%x-%d %H:%M:%S")===date||BI.print(BI.parseDateTime(date,"%Y-%X-%d %H:%M:%S"),"%Y-%X-%d %H:%M:%S")===date||BI.print(BI.parseDateTime(date,"%Y-%x-%e %H:%M:%S"),"%Y-%x-%e %H:%M:%S")===date||BI.print(BI.parseDateTime(date,"%Y-%X-%e %H:%M:%S"),"%Y-%X-%e %H:%M:%S")===date},_checkVoid:function(obj){var o=this.options;return!BI.checkDateVoid(obj.year,obj.month,obj.day,o.minDate,o.maxDate)[0]},_check:function(smallDate,bigDate){var smallObj=smallDate.match(/\d+/g),bigObj=bigDate.match(/\d+/g);return this._dateCheck(smallDate)&&BI.checkDateLegal(smallDate)&&this._checkVoid({year:smallObj[0],month:smallObj[1],day:smallObj[2]})&&this._dateCheck(bigDate)&&BI.checkDateLegal(bigDate)&&this._checkVoid({year:bigObj[0],month:bigObj[1],day:bigObj[2]})},_compare:function(smallDate,bigDate){return smallDate=BI.print(BI.parseDateTime(smallDate,"%Y-%X-%d %H:%M:%S"),"%Y-%X-%d %H:%M:%S"),bigDate=BI.print(BI.parseDateTime(bigDate,"%Y-%X-%d %H:%M:%S"),"%Y-%X-%d %H:%M:%S"),BI.isNotNull(smallDate)&&BI.isNotNull(bigDate)&&smallDate>bigDate},_setTitle:function(v){this.left.setTitle(v),this.right.setTitle(v),this.label.setTitle(v)},_clearTitle:function(){this.left.setTitle(""),this.right.setTitle(""),this.label.setTitle("")},setValue:function(date){date=date||{},this.left.setValue(date.start),this.right.setValue(date.end)},getValue:function(){return{start:this.left.getValue(),end:this.right.getValue()}}}),BI.TimeInterval.EVENT_VALID="EVENT_VALID",BI.TimeInterval.EVENT_ERROR="EVENT_ERROR",BI.TimeInterval.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.time_interval",BI.TimeInterval),!function(){BI.TimePeriods=BI.inherit(BI.Single,{constants:{height:24,width:24,lgap:15,offset:0},props:{extraCls:"bi-time-interval",value:{}},render:function(){var self=this,o=this.options;return{type:"bi.absolute",height:this.constants.height,items:[{el:{type:"bi.horizontal_auto",items:[{type:"bi.label",height:this.constants.height,width:this.constants.width,text:"-",ref:function(_ref){self.label=_ref}}]},top:0,left:0,right:0,bottom:0},{el:{type:"bi.center",height:this.constants.height,items:[{type:"bi.absolute",items:[{el:BI.extend({ref:function(_ref){self.left=_ref}},this._createCombo(o.value.start)),left:this.constants.offset,right:this.constants.width/2,top:0,bottom:0}]},{type:"bi.absolute",items:[{el:BI.extend({ref:function(_ref){self.right=_ref}},this._createCombo(o.value.end)),left:this.constants.width/2,right:this.constants.offset,top:0,bottom:0}]}]},top:0,left:0,right:0,bottom:0}]}},_createCombo:function(v){var self=this;return{type:"bi.time_combo",value:v,listeners:[{eventName:BI.TimeCombo.EVENT_BEFORE_POPUPVIEW,action:function(){self.left.hidePopupView(),self.right.hidePopupView()}},{eventName:BI.TimeCombo.EVENT_CHANGE,action:function(){self.fireEvent(BI.TimePeriods.EVENT_CHANGE)}},{eventName:BI.TimeCombo.EVENT_CONFIRM,action:function(){self.fireEvent(BI.TimePeriods.EVENT_CONFIRM)}}]}},setValue:function(date){date=date||{},this.left.setValue(date.start),this.right.setValue(date.end)},getValue:function(){return{start:this.left.getValue(),end:this.right.getValue()}}}),BI.TimePeriods.EVENT_CONFIRM="EVENT_CONFIRM",BI.TimePeriods.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.time_periods",BI.TimePeriods)}(),BI.DynamicYearCard=BI.inherit(BI.Widget,{props:{baseCls:"bi-year-card"},render:function(){var self=this;return{type:"bi.vertical",items:[{type:"bi.label",text:BI.i18nText("BI-Multi_Date_Relative_Current_Time"),textAlign:"left",height:24},{type:"bi.dynamic_date_param_item",ref:function(){self.item=this},listeners:[{eventName:"EVENT_CHANGE",action:function(){self.fireEvent("EVENT_CHANGE")}}]}],vgap:10,hgap:10}},_createValue:function(type,v){return{dateType:type,value:Math.abs(v),offset:v>0?1:0}},setValue:function(v){v=v||{year:0},this.item.setValue(this._createValue(BI.DynamicDateCard.TYPE.YEAR,v.year))},getValue:function(){var value=this.item.getValue();return{year:0===value.offset?-value.value:value.value}}}),BI.DynamicYearCard.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.dynamic_year_card",BI.DynamicYearCard),BI.StaticYearCard=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.StaticYearCard.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-year-card",behaviors:{},min:"1900-01-01",max:"2099-12-31"})},_createYearCalendar:function(v){var o=this.options,y=this._year,calendar=BI.createWidget({type:"bi.year_calendar",behaviors:o.behaviors,min:o.min,max:o.max,logic:{dynamic:!0},year:y+12*v});return calendar.setValue(this._year),calendar},_init:function(){BI.StaticYearCard.superclass._init.apply(this,arguments);var self=this,o=this.options;this.selectedYear=this._year=BI.getDate().getFullYear(),this.backBtn=BI.createWidget({type:"bi.icon_button",cls:"pre-page-h-font",width:25,height:25,value:-1,listeners:[{eventName:BI.IconButton.EVENT_CHANGE,action:function(){self.navigation.setSelect(self.navigation.getSelect()-1),self._checkLeftValid(),self._checkRightValid()}}]}),this.preBtn=BI.createWidget({type:"bi.icon_button",cls:"next-page-h-font",width:25,height:25,value:1,listeners:[{eventName:BI.IconButton.EVENT_CHANGE,action:function(){self.navigation.setSelect(self.navigation.getSelect()+1),self._checkLeftValid(),self._checkRightValid()}}]}),this.navigation=BI.createWidget({type:"bi.navigation",direction:"top",element:this,single:!0,logic:{dynamic:!0},tab:{type:"bi.htape",cls:"bi-split-top bi-split-bottom",height:30,items:[{el:{type:"bi.center_adapt",items:[self.backBtn]},width:25},{type:"bi.layout"},{el:{type:"bi.center_adapt",items:[self.preBtn]},width:25}]},cardCreator:BI.bind(this._createYearCalendar,this),afterCardShow:function(){this.setValue(self.selectedYear);var calendar=this.getSelectedCard();self.backBtn.setEnable(!calendar.isFrontYear()),self.preBtn.setEnable(!calendar.isFinalYear())}}),this.navigation.on(BI.Navigation.EVENT_CHANGE,function(){self.selectedYear=this.getValue(),self.fireEvent(BI.Controller.EVENT_CHANGE,arguments),self.fireEvent(BI.StaticYearCard.EVENT_CHANGE,self.selectedYear)}),BI.isKey(o.value)&&this.setValue(o.value)},_checkLeftValid:function(){var o=this.options,valid=!0;return this.backBtn.setEnable(valid),valid},_checkRightValid:function(){var o=this.options,valid=!0;return this.preBtn.setEnable(valid),valid},getValue:function(){return{year:this.selectedYear}},setValue:function(obj){var o=this.options;obj=obj||{};var v=obj.year;BI.checkDateVoid(v,1,1,o.min,o.max)[0]?(v=BI.getDate().getFullYear(),this.selectedYear="",this.navigation.setSelect(BI.YearCalendar.getPageByYear(v)),this.navigation.setValue("")):(this.selectedYear=BI.parseInt(v),this.navigation.setSelect(BI.YearCalendar.getPageByYear(v)),this.navigation.setValue(this.selectedYear)),this._checkLeftValid(),this._checkRightValid()}}),BI.StaticYearCard.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.static_year_card",BI.StaticYearCard),BI.DynamicYearCombo=BI.inherit(BI.Widget,{props:{baseCls:"bi-year-combo bi-border bi-focus-shadow",behaviors:{},min:"1900-01-01",max:"2099-12-31",height:22},_init:function(){BI.DynamicYearCombo.superclass._init.apply(this,arguments);var self=this,o=this.options;this.storeValue=o.value,this.trigger=BI.createWidget({type:"bi.dynamic_year_trigger",min:o.min,max:o.max,height:o.height,value:o.value||""}),this.trigger.on(BI.DynamicYearTrigger.EVENT_FOCUS,function(){self.storeTriggerValue=this.getKey()}),this.trigger.on(BI.DynamicYearTrigger.EVENT_START,function(){self.combo.isViewVisible()&&self.combo.hideView()}),this.trigger.on(BI.DynamicYearTrigger.EVENT_STOP,function(){self.combo.showView()}),this.trigger.on(BI.DynamicYearTrigger.EVENT_ERROR,function(){self.combo.isViewVisible()&&self.combo.hideView()}),this.trigger.on(BI.DynamicYearTrigger.EVENT_CONFIRM,function(){self.combo.isViewVisible()||(this.getKey()&&this.getKey()!==self.storeTriggerValue?(self.storeValue=self.trigger.getValue(),self.setValue(self.storeValue)):this.getKey()||(self.storeValue=null,self.setValue()),self._checkDynamicValue(self.storeValue),self.fireEvent(BI.DynamicYearCombo.EVENT_CONFIRM))}),this.combo=BI.createWidget({type:"bi.combo",container:o.container,isNeedAdjustHeight:!1,isNeedAdjustWidth:!1,el:this.trigger,popup:{minWidth:85,stopPropagation:!1,el:{type:"bi.dynamic_year_popup",ref:function(){self.popup=this},listeners:[{eventName:BI.DynamicYearPopup.EVENT_CHANGE,action:function(){self.setValue(self.popup.getValue()),self.combo.hideView(),self.fireEvent(BI.DynamicYearCombo.EVENT_CONFIRM)}},{eventName:BI.DynamicYearPopup.BUTTON_CLEAR_EVENT_CHANGE,action:function(){self.setValue(),self.combo.hideView(),self.fireEvent(BI.DynamicYearCombo.EVENT_CONFIRM)}},{eventName:BI.DynamicYearPopup.BUTTON_lABEL_EVENT_CHANGE,action:function(){var date=BI.getDate();self.setValue({type:BI.DynamicYearCombo.Static,value:{year:date.getFullYear()}}),self.combo.hideView(),self.fireEvent(BI.DynamicDateCombo.EVENT_CONFIRM)}},{eventName:BI.DynamicYearPopup.BUTTON_OK_EVENT_CHANGE,action:function(){self.setValue(self.popup.getValue()),self.combo.hideView(),self.fireEvent(BI.DynamicDateCombo.EVENT_CONFIRM)}}],behaviors:o.behaviors,min:o.min,max:o.max},value:o.value||""}}),this.combo.on(BI.Combo.EVENT_BEFORE_POPUPVIEW,function(){self.popup.setValue(self.storeValue),self.fireEvent(BI.DynamicYearCombo.EVENT_BEFORE_POPUPVIEW)}),BI.createWidget({type:"bi.htape",element:this,ref:function(){self.comboWrapper=this},items:[{el:{type:"bi.icon_button",cls:"bi-trigger-icon-button date-change-h-font",width:24,height:24,ref:function(){self.changeIcon=this}},width:24},this.combo]}),this._checkDynamicValue(o.value)},_checkDynamicValue:function(v){var type=null;switch(BI.isNotNull(v)&&(type=v.type),type){case BI.DynamicYearCombo.Dynamic:this.changeIcon.setVisible(!0),this.comboWrapper.attr("items")[0].width=24,this.comboWrapper.resize();break;default:this.comboWrapper.attr("items")[0].width=0,this.comboWrapper.resize(),this.changeIcon.setVisible(!1)}},setValue:function(v){this.storeValue=v,this.trigger.setValue(v),this._checkDynamicValue(v)},getValue:function(){return this.storeValue}}),BI.DynamicYearCombo.EVENT_CONFIRM="EVENT_CONFIRM",BI.DynamicYearCombo.EVENT_BEFORE_POPUPVIEW="EVENT_BEFORE_POPUPVIEW",BI.shortcut("bi.dynamic_year_combo",BI.DynamicYearCombo),BI.extend(BI.DynamicYearCombo,{Static:1,Dynamic:2}),BI.DynamicYearPopup=BI.inherit(BI.Widget,{constants:{tabHeight:30,buttonHeight:24},props:{baseCls:"bi-year-popup",behaviors:{},min:"1900-01-01",max:"2099-12-31",width:180,height:240},render:function(){var self=this,opts=this.options,c=this.constants;return this.storeValue={type:BI.DynamicYearCombo.Static},{type:"bi.vtape",items:[{el:this._getTabJson()},{el:{type:"bi.grid",items:[[{type:"bi.text_button",cls:"bi-split-top bi-high-light",textHeight:c.buttonHeight-1,shadow:!0,text:BI.i18nText("BI-Basic_Clear"),listeners:[{eventName:BI.TextButton.EVENT_CHANGE,action:function(){self.fireEvent(BI.DynamicYearPopup.BUTTON_CLEAR_EVENT_CHANGE)}}]},{type:"bi.text_button",textHeight:c.buttonHeight-1,cls:"bi-split-left bi-split-right bi-high-light bi-split-top",shadow:!0,text:BI.i18nText("BI-Basic_Current_Year"),ref:function(){self.textButton=this},listeners:[{eventName:BI.TextButton.EVENT_CHANGE,action:function(){self.fireEvent(BI.DynamicYearPopup.BUTTON_lABEL_EVENT_CHANGE)}}]},{type:"bi.text_button",cls:"bi-split-top bi-high-light",textHeight:c.buttonHeight-1,shadow:!0,text:BI.i18nText("BI-Basic_OK"),listeners:[{eventName:BI.TextButton.EVENT_CHANGE,action:function(){self.fireEvent(BI.DynamicYearPopup.BUTTON_OK_EVENT_CHANGE)}}]}]]},height:24}]}},_setInnerValue:function(){if(this.dateTab.getSelect()===BI.DynamicDateCombo.Static)this.textButton.setValue(BI.i18nText("BI-Basic_Current_Year")),this.textButton.setEnable(!0);else{var date=BI.DynamicDateHelper.getCalculation(this.dynamicPane.getValue());date=BI.print(date,"%Y"),this.textButton.setValue(date),this.textButton.setEnable(!1)}},_getTabJson:function(){var self=this,o=this.options;return{type:"bi.tab",ref:function(){self.dateTab=this},tab:{type:"bi.linear_segment",cls:"bi-split-bottom",height:this.constants.tabHeight,items:BI.createItems([{text:BI.i18nText("BI-Basic_Year_Fen"),value:BI.DynamicYearCombo.Static},{text:BI.i18nText("BI-Basic_Dynamic_Title"),value:BI.DynamicYearCombo.Dynamic}],{textAlign:"center"})},cardCreator:function(v){switch(v){case BI.DynamicYearCombo.Dynamic:return{type:"bi.dynamic_year_card",listeners:[{eventName:"EVENT_CHANGE",action:function(){self._setInnerValue(self.year,v)}}],ref:function(){self.dynamicPane=this}};case BI.DynamicYearCombo.Static:default:return{type:"bi.static_year_card",behaviors:o.behaviors,min:self.options.min,max:self.options.max,listeners:[{eventName:BI.StaticYearCard.EVENT_CHANGE,action:function(){self.fireEvent(BI.DynamicYearPopup.EVENT_CHANGE)}}],ref:function(){self.year=this}}}},listeners:[{eventName:BI.Tab.EVENT_CHANGE,action:function(){var v=self.dateTab.getSelect();switch(v){case BI.DynamicYearCombo.Static:var date=BI.DynamicDateHelper.getCalculation(self.dynamicPane.getValue());self.year.setValue({year:date.getFullYear()}),self._setInnerValue();break;case BI.DynamicYearCombo.Dynamic:default:self.storeValue&&self.storeValue.type===BI.DynamicYearCombo.Dynamic?self.dynamicPane.setValue(self.storeValue.value):self.dynamicPane.setValue({year:0}),self._setInnerValue()}}}]}},setValue:function(v){this.storeValue=v;var self=this,type,value;switch(v=v||{},type=v.type||BI.DynamicDateCombo.Static,value=v.value||v,this.dateTab.setSelect(type),type){case BI.DynamicDateCombo.Dynamic:this.dynamicPane.setValue(value),self._setInnerValue();break;case BI.DynamicDateCombo.Static:default:this.year.setValue(value),this.textButton.setValue(BI.i18nText("BI-Basic_Current_Year")),this.textButton.setEnable(!0)}},getValue:function(){return{type:this.dateTab.getSelect(),value:this.dateTab.getValue()}}}),BI.DynamicYearPopup.BUTTON_CLEAR_EVENT_CHANGE="BUTTON_CLEAR_EVENT_CHANGE",BI.DynamicYearPopup.BUTTON_lABEL_EVENT_CHANGE="BUTTON_lABEL_EVENT_CHANGE",BI.DynamicYearPopup.BUTTON_OK_EVENT_CHANGE="BUTTON_OK_EVENT_CHANGE",BI.DynamicYearPopup.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.dynamic_year_popup",BI.DynamicYearPopup),BI.DynamicYearTrigger=BI.inherit(BI.Trigger,{_const:{hgap:4,vgap:2},_defaultConfig:function(){return BI.extend(BI.DynamicYearTrigger.superclass._defaultConfig.apply(this,arguments),{extraCls:"bi-year-trigger",min:"1900-01-01",max:"2099-12-31",height:24})},beforeInit:function(callback){var o=this.options;o.title=BI.bind(this._titleCreator,this),callback()},_init:function(){BI.DynamicYearTrigger.superclass._init.apply(this,arguments);var self=this,o=this.options,c=this._const;this.editor=BI.createWidget({type:"bi.sign_editor",height:o.height,validationChecker:function(v){return""===v||BI.isPositiveInteger(v)&&!BI.checkDateVoid(v,1,1,o.min,o.max)[0]},quitChecker:function(v){return!1},hgap:c.hgap,vgap:c.vgap,watermark:BI.i18nText("BI-Basic_Unrestricted"),allowBlank:!0,errorText:function(){return BI.i18nText("BI-Year_Trigger_Invalid_Text")}}),this.editor.on(BI.SignEditor.EVENT_FOCUS,function(){self.fireEvent(BI.DynamicYearTrigger.EVENT_FOCUS)}),this.editor.on(BI.SignEditor.EVENT_STOP,function(){self.fireEvent(BI.DynamicYearTrigger.EVENT_STOP)}),this.editor.on(BI.SignEditor.EVENT_CONFIRM,function(){var value=self.editor.getValue();BI.isNotNull(value)&&self.editor.setValue(value),BI.isNotEmptyString(value)&&(self.storeValue={type:BI.DynamicDateCombo.Static,value:{year:value}}),self.fireEvent(BI.DynamicYearTrigger.EVENT_CONFIRM)}),this.editor.on(BI.SignEditor.EVENT_SPACE,function(){self.editor.isValid()&&self.editor.blur()}),this.editor.on(BI.SignEditor.EVENT_START,function(){self.fireEvent(BI.DynamicYearTrigger.EVENT_START)}),this.editor.on(BI.SignEditor.EVENT_ERROR,function(){self.fireEvent(BI.DynamicYearTrigger.EVENT_ERROR)}),BI.createWidget({element:this,type:"bi.htape",items:[{el:this.editor},{el:{type:"bi.text_button",baseCls:"bi-trigger-year-text",text:BI.i18nText("BI-Multi_Date_Year"),width:o.height},width:o.height},{el:{type:"bi.trigger_icon_button",width:o.height},width:o.height}]}),this.setValue(o.value)},_getText:function(obj){var value="";return BI.isNotNull(obj.year)&&0!==BI.parseInt(obj.year)&&(value+=Math.abs(obj.year)+BI.i18nText("BI-Basic_Year")+(obj.year<0?BI.i18nText("BI-Basic_Front"):BI.i18nText("BI-Basic_Behind"))),value},_setInnerValue:function(date,text){var dateStr=BI.print(date,"%Y");this.editor.setState(dateStr),this.editor.setValue(dateStr)},_titleCreator:function(){var storeValue=this.storeValue||{},type=storeValue.type||BI.DynamicDateCombo.Static,value=storeValue.value;if(!this.editor.isValid())return"";switch(type){case BI.DynamicDateCombo.Dynamic:var text=this._getText(value),date=BI.getDate();date=BI.DynamicDateHelper.getCalculation(value);var dateStr=BI.print(date,"%Y");return BI.isEmptyString(text)?dateStr:text+":"+dateStr;case BI.DynamicDateCombo.Static:default:return value=value||{},value.year}},setValue:function(v){var type,value,date=BI.getDate();switch(this.storeValue=v,BI.isNotNull(v)&&(type=v.type||BI.DynamicDateCombo.Static,value=v.value||v),type){case BI.DynamicDateCombo.Dynamic:var text=this._getText(value);date=BI.DynamicDateHelper.getCalculation(value),this._setInnerValue(date,text);break;case BI.DynamicDateCombo.Static: +default:value=value||{},this.editor.setState(value.year),this.editor.setValue(value.year)}},getValue:function(){return this.storeValue},getKey:function(){return 0|this.editor.getValue()}}),BI.DynamicYearTrigger.EVENT_FOCUS="EVENT_FOCUS",BI.DynamicYearTrigger.EVENT_ERROR="EVENT_ERROR",BI.DynamicYearTrigger.EVENT_START="EVENT_START",BI.DynamicYearTrigger.EVENT_CONFIRM="EVENT_CONFIRM",BI.DynamicYearTrigger.EVENT_STOP="EVENT_STOP",BI.shortcut("bi.dynamic_year_trigger",BI.DynamicYearTrigger),BI.DynamicYearMonthCard=BI.inherit(BI.Widget,{props:{baseCls:"bi-year-month-card"},render:function(){var self=this;return{type:"bi.vertical",items:[{type:"bi.label",text:BI.i18nText("BI-Multi_Date_Relative_Current_Time"),textAlign:"left",height:24},{type:"bi.dynamic_date_param_item",ref:function(){self.year=this},listeners:[{eventName:"EVENT_CHANGE",action:function(){self.fireEvent("EVENT_CHANGE")}}]},{type:"bi.dynamic_date_param_item",dateType:BI.DynamicDateCard.TYPE.MONTH,ref:function(){self.month=this},listeners:[{eventName:"EVENT_CHANGE",action:function(){self.fireEvent("EVENT_CHANGE")}}]}],vgap:10,hgap:10}},_createValue:function(type,v){return{dateType:type,value:Math.abs(v),offset:v>0?1:0}},setValue:function(v){v=v||{year:0,month:0},this.year.setValue(this._createValue(BI.DynamicDateCard.TYPE.YEAR,v.year)),this.month.setValue(this._createValue(BI.DynamicDateCard.TYPE.MONTH,v.month))},getValue:function(){var year=this.year.getValue(),month=this.month.getValue();return{year:0===year.offset?-year.value:year.value,month:0===month.offset?-month.value:month.value}}}),BI.DynamicYearMonthCard.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.dynamic_year_month_card",BI.DynamicYearMonthCard),BI.StaticYearMonthCard=BI.inherit(BI.Widget,{props:{baseCls:"bi-static-year-month-card",behaviors:{}},_createMonths:function(){var self=this,month=[1,7,2,8,3,9,4,10,5,11,6,12],items=[];return items.push(month.slice(0,2)),items.push(month.slice(2,4)),items.push(month.slice(4,6)),items.push(month.slice(6,8)),items.push(month.slice(8,10)),items.push(month.slice(10,12)),BI.map(items,function(i,item){return BI.map(item,function(j,td){return{type:"bi.text_item",cls:"bi-list-item-select",textAlign:"center",whiteSpace:"nowrap",once:!1,forceSelected:!0,height:23,width:38,value:td,text:td,ref:function(_ref){self.monthMap[0===j?i:i+6]=_ref}}})})},render:function(){var self=this,o=this.options;return this.monthMap={},{type:"bi.vertical",items:[{type:"bi.year_picker",min:o.min,max:o.max,ref:function(){self.yearPicker=this},behaviors:o.behaviors,height:30,listeners:[{eventName:BI.YearPicker.EVENT_CHANGE,action:function(){var value=this.getValue();self._checkMonthStatus(value),self.setValue({year:value,month:self.selectedMonth})}}]},{type:"bi.button_group",cls:"bi-split-top",behaviors:o.behaviors,ref:function(){self.month=this},items:this._createMonths(),layouts:[BI.LogicFactory.createLogic("table",BI.extend({dynamic:!0},{columns:2,rows:6,columnSize:[.5,.5],rowSize:25})),{type:"bi.center_adapt",vgap:1,hgap:2}],value:o.value,listeners:[{eventName:BI.ButtonGroup.EVENT_CHANGE,action:function(){self.selectedYear=self.yearPicker.getValue(),self.selectedMonth=this.getValue()[0],self.fireEvent(BI.StaticYearMonthCard.EVENT_CHANGE)}}]}]}},mounted:function(){this._checkMonthStatus(this.selectedYear)},_checkMonthStatus:function(year){var o=this.options,minDate=BI.parseDateTime(o.min,"%Y-%X-%d"),maxDate=BI.parseDateTime(o.max,"%Y-%X-%d"),minYear=minDate.getFullYear(),maxYear=maxDate.getFullYear(),minMonth=0,maxMonth=11;minYear===year&&(minMonth=minDate.getMonth()),maxYear===year&&(maxMonth=maxDate.getMonth());var yearInvalid=yearmaxYear;BI.each(this.monthMap,function(month,obj){var monthInvalid=monthmaxMonth;obj.setEnable(!yearInvalid&&!monthInvalid)})},getValue:function(){return{year:this.selectedYear,month:this.selectedMonth}},setValue:function(obj){var o=this.options,newObj={};if(newObj.year=obj.year||0,newObj.month=obj.month||0,0===newObj.year||0===newObj.month||BI.checkDateVoid(newObj.year,newObj.month,1,o.min,o.max)[0]){var year=newObj.year||BI.getDate().getFullYear();this.selectedYear=year,this.selectedMonth="",this.yearPicker.setValue(year),this.month.setValue()}else this.selectedYear=BI.parseInt(newObj.year),this.selectedMonth=BI.parseInt(newObj.month),this.yearPicker.setValue(this.selectedYear),this.month.setValue(this.selectedMonth)}}),BI.StaticYearMonthCard.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.static_year_month_card",BI.StaticYearMonthCard),BI.DynamicYearMonthCombo=BI.inherit(BI.Single,{props:{baseCls:"bi-year-month-combo bi-border bi-focus-shadow",behaviors:{},minDate:"1900-01-01",maxDate:"2099-12-31",height:22},_init:function(){BI.DynamicYearMonthCombo.superclass._init.apply(this,arguments);var self=this,o=this.options;this.storeValue=o.value,this.storeTriggerValue="",this.trigger=BI.createWidget({type:"bi.dynamic_year_month_trigger",min:o.minDate,max:o.maxDate,height:o.height,value:o.value||""}),this.trigger.on(BI.DynamicYearMonthTrigger.EVENT_KEY_DOWN,function(){self.combo.isViewVisible()&&self.combo.hideView()}),this.trigger.on(BI.DynamicYearMonthTrigger.EVENT_START,function(){self.combo.isViewVisible()&&self.combo.hideView()}),this.trigger.on(BI.DynamicYearMonthTrigger.EVENT_STOP,function(){self.combo.showView()}),this.trigger.on(BI.DynamicYearMonthTrigger.EVENT_ERROR,function(){self.combo.isViewVisible()&&self.combo.hideView(),self.fireEvent(BI.DynamicYearMonthCombo.EVENT_ERROR)}),this.trigger.on(BI.DynamicYearMonthTrigger.EVENT_VALID,function(){self.fireEvent(BI.DynamicYearMonthCombo.EVENT_VALID)}),this.trigger.on(BI.DynamicYearMonthTrigger.EVENT_CONFIRM,function(){var dateStore=self.storeTriggerValue,dateObj=self.trigger.getKey();BI.isNotEmptyString(dateObj)&&!BI.isEqual(dateObj,dateStore)&&(self.storeValue=self.trigger.getValue(),self.setValue(self.trigger.getValue())),self._checkDynamicValue(self.storeValue),self.fireEvent(BI.DynamicYearMonthCombo.EVENT_CONFIRM)}),this.trigger.on(BI.DynamicYearMonthTrigger.EVENT_FOCUS,function(){self.storeTriggerValue=self.trigger.getKey(),self.fireEvent(BI.DynamicYearMonthCombo.EVENT_FOCUS)}),this.combo=BI.createWidget({type:"bi.combo",container:o.container,isNeedAdjustHeight:!1,isNeedAdjustWidth:!1,el:this.trigger,popup:{minWidth:100,stopPropagation:!1,el:{type:"bi.dynamic_year_month_popup",ref:function(){self.popup=this},listeners:[{eventName:BI.DynamicYearMonthPopup.EVENT_CHANGE,action:function(){self.setValue(self.popup.getValue()),self.combo.hideView(),self.fireEvent(BI.DynamicYearMonthCombo.EVENT_CONFIRM)}},{eventName:BI.DynamicYearMonthPopup.BUTTON_CLEAR_EVENT_CHANGE,action:function(){self.setValue(),self.combo.hideView(),self.fireEvent(BI.DynamicYearMonthCombo.EVENT_CONFIRM)}},{eventName:BI.DynamicYearMonthPopup.BUTTON_lABEL_EVENT_CHANGE,action:function(){var date=BI.getDate();self.setValue({type:BI.DynamicYearMonthCombo.Static,value:{year:date.getFullYear(),month:date.getMonth()+1}}),self.combo.hideView(),self.fireEvent(BI.DynamicDateCombo.EVENT_CONFIRM)}},{eventName:BI.DynamicYearMonthPopup.BUTTON_OK_EVENT_CHANGE,action:function(){self.setValue(self.popup.getValue()),self.combo.hideView(),self.fireEvent(BI.DynamicDateCombo.EVENT_CONFIRM)}}],behaviors:o.behaviors,min:o.minDate,max:o.maxDate},value:o.value||""}}),this.combo.on(BI.Combo.EVENT_BEFORE_POPUPVIEW,function(){self.popup.setValue(self.storeValue),self.fireEvent(BI.DynamicYearMonthCombo.EVENT_BEFORE_POPUPVIEW)}),BI.createWidget({type:"bi.htape",element:this,ref:function(){self.comboWrapper=this},items:[{el:{type:"bi.icon_button",cls:"bi-trigger-icon-button date-change-h-font",width:24,height:24,ref:function(){self.changeIcon=this}},width:24},this.combo]}),this._checkDynamicValue(o.value)},_checkDynamicValue:function(v){var type=null;switch(BI.isNotNull(v)&&(type=v.type),type){case BI.DynamicYearMonthCombo.Dynamic:this.changeIcon.setVisible(!0),this.comboWrapper.attr("items")[0].width=24,this.comboWrapper.resize();break;default:this.comboWrapper.attr("items")[0].width=0,this.comboWrapper.resize(),this.changeIcon.setVisible(!1)}},hideView:function(){this.combo.hideView()},setValue:function(v){this.storeValue=v,this.trigger.setValue(v),this._checkDynamicValue(v)},getValue:function(){return this.storeValue},getKey:function(){return this.trigger.getKey()},isValid:function(){return this.trigger.isValid()}}),BI.DynamicYearMonthCombo.EVENT_ERROR="EVENT_ERROR",BI.DynamicYearMonthCombo.EVENT_VALID="EVENT_VALID",BI.DynamicYearMonthCombo.EVENT_FOCUS="EVENT_FOCUS",BI.DynamicYearMonthCombo.EVENT_CONFIRM="EVENT_CONFIRM",BI.DynamicYearMonthCombo.EVENT_BEFORE_POPUPVIEW="EVENT_BEFORE_POPUPVIEW",BI.shortcut("bi.dynamic_year_month_combo",BI.DynamicYearMonthCombo),BI.extend(BI.DynamicYearMonthCombo,{Static:1,Dynamic:2}),BI.DynamicYearMonthPopup=BI.inherit(BI.Widget,{constants:{tabHeight:30,buttonHeight:24},props:{baseCls:"bi-year-month-popup",behaviors:{},min:"1900-01-01",max:"2099-12-31",width:180,height:240},render:function(){var self=this,opts=this.options,c=this.constants;return this.storeValue={type:BI.DynamicYearMonthCombo.Static},{type:"bi.vtape",items:[{el:this._getTabJson()},{el:{type:"bi.grid",items:[[{type:"bi.text_button",cls:"bi-split-top bi-high-light",textHeight:c.buttonHeight-1,shadow:!0,text:BI.i18nText("BI-Basic_Clear"),listeners:[{eventName:BI.TextButton.EVENT_CHANGE,action:function(){self.fireEvent(BI.DynamicYearMonthPopup.BUTTON_CLEAR_EVENT_CHANGE)}}]},{type:"bi.text_button",cls:"bi-split-left bi-split-right bi-high-light bi-split-top",textHeight:c.buttonHeight-1,shadow:!0,text:BI.i18nText("BI-Basic_Current_Month"),ref:function(){self.textButton=this},listeners:[{eventName:BI.TextButton.EVENT_CHANGE,action:function(){self.fireEvent(BI.DynamicYearMonthPopup.BUTTON_lABEL_EVENT_CHANGE)}}]},{type:"bi.text_button",cls:"bi-split-top bi-high-light",textHeight:c.buttonHeight-1,shadow:!0,text:BI.i18nText("BI-Basic_OK"),listeners:[{eventName:BI.TextButton.EVENT_CHANGE,action:function(){self.fireEvent(BI.DynamicYearMonthPopup.BUTTON_OK_EVENT_CHANGE)}}]}]]},height:24}]}},_setInnerValue:function(){if(this.dateTab.getSelect()===BI.DynamicDateCombo.Static)this.textButton.setValue(BI.i18nText("BI-Basic_Current_Month")),this.textButton.setEnable(!0);else{var date=BI.DynamicDateHelper.getCalculation(this.dynamicPane.getValue());date=BI.print(date,"%Y-%x"),this.textButton.setValue(date),this.textButton.setEnable(!1)}},_getTabJson:function(){var self=this,o=this.options;return{type:"bi.tab",ref:function(){self.dateTab=this},tab:{type:"bi.linear_segment",cls:"bi-split-bottom",height:this.constants.tabHeight,items:BI.createItems([{text:BI.i18nText("BI-Basic_Year_Month"),value:BI.DynamicYearCombo.Static},{text:BI.i18nText("BI-Basic_Dynamic_Title"),value:BI.DynamicYearCombo.Dynamic}],{textAlign:"center"})},cardCreator:function(v){switch(v){case BI.DynamicYearCombo.Dynamic:return{type:"bi.dynamic_year_month_card",listeners:[{eventName:"EVENT_CHANGE",action:function(){self._setInnerValue(self.year,v)}}],ref:function(){self.dynamicPane=this}};case BI.DynamicYearCombo.Static:default:return{type:"bi.static_year_month_card",behaviors:o.behaviors,min:self.options.min,max:self.options.max,listeners:[{eventName:BI.StaticYearMonthCard.EVENT_CHANGE,action:function(){self.fireEvent(BI.DynamicYearMonthPopup.EVENT_CHANGE)}}],ref:function(){self.year=this}}}},listeners:[{eventName:BI.Tab.EVENT_CHANGE,action:function(){var v=self.dateTab.getSelect();switch(v){case BI.DynamicYearCombo.Static:var date=BI.DynamicDateHelper.getCalculation(self.dynamicPane.getValue());self.year.setValue({year:date.getFullYear(),month:date.getMonth()+1}),self._setInnerValue();break;case BI.DynamicYearCombo.Dynamic:default:self.storeValue&&self.storeValue.type===BI.DynamicYearCombo.Dynamic?self.dynamicPane.setValue(self.storeValue.value):self.dynamicPane.setValue({year:0}),self._setInnerValue()}}}]}},setValue:function(v){this.storeValue=v;var self=this,type,value;switch(v=v||{},type=v.type||BI.DynamicDateCombo.Static,value=v.value||v,this.dateTab.setSelect(type),type){case BI.DynamicDateCombo.Dynamic:this.dynamicPane.setValue(value),self._setInnerValue();break;case BI.DynamicDateCombo.Static:default:this.year.setValue(value),this.textButton.setValue(BI.i18nText("BI-Basic_Current_Month")),this.textButton.setEnable(!0)}},getValue:function(){return{type:this.dateTab.getSelect(),value:this.dateTab.getValue()}}}),BI.DynamicYearMonthPopup.BUTTON_CLEAR_EVENT_CHANGE="BUTTON_CLEAR_EVENT_CHANGE",BI.DynamicYearMonthPopup.BUTTON_lABEL_EVENT_CHANGE="BUTTON_lABEL_EVENT_CHANGE",BI.DynamicYearMonthPopup.BUTTON_OK_EVENT_CHANGE="BUTTON_OK_EVENT_CHANGE",BI.DynamicYearMonthPopup.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.dynamic_year_month_popup",BI.DynamicYearMonthPopup),BI.DynamicYearMonthTrigger=BI.inherit(BI.Trigger,{_const:{hgap:4,vgap:2},props:{extraCls:"bi-year-month-trigger",min:"1900-01-01",max:"2099-12-31",height:22},beforeInit:function(callback){var o=this.options;o.title=BI.bind(this._titleCreator,this),callback()},_init:function(){BI.DynamicYearMonthTrigger.superclass._init.apply(this,arguments);var o=this.options;this.yearEditor=this._createEditor(!0),this.monthEditor=this._createEditor(!1),BI.createWidget({element:this,type:"bi.htape",items:[{type:"bi.center",items:[{type:"bi.htape",items:[this.yearEditor,{el:{type:"bi.text_button",text:BI.i18nText("BI-Multi_Date_Year"),width:o.height},width:o.height}]},{type:"bi.htape",items:[this.monthEditor,{el:{type:"bi.text_button",text:BI.i18nText("BI-Multi_Date_Month"),width:o.height},width:o.height}]}]},{el:{type:"bi.trigger_icon_button",width:o.height},width:o.height}]}),this.setValue(o.value)},_createEditor:function(isYear){var self=this,o=this.options,c=this._const,minDate=BI.parseDateTime(o.min,"%Y-%X-%d"),editor=BI.createWidget({type:"bi.sign_editor",height:o.height,validationChecker:function(v){return isYear?""===v||BI.isPositiveInteger(v)&&!BI.checkDateVoid(v,v===minDate.getFullYear()?minDate.getMonth()+1:1,1,o.min,o.max)[0]:""===v||BI.isPositiveInteger(v)&&v>=1&&v<=12&&!BI.checkDateVoid(BI.getDate().getFullYear(),v,1,o.min,o.max)[0]},quitChecker:function(){return!1},watermark:BI.i18nText("BI-Basic_Unrestricted"),errorText:function(v){return BI.i18nText("BI-Year_Trigger_Invalid_Text")},hgap:c.hgap,vgap:c.vgap,allowBlank:!0});return editor.on(BI.SignEditor.EVENT_KEY_DOWN,function(){self.fireEvent(BI.DynamicYearMonthTrigger.EVENT_KEY_DOWN)}),editor.on(BI.SignEditor.EVENT_FOCUS,function(){self.fireEvent(BI.DynamicYearMonthTrigger.EVENT_FOCUS)}),editor.on(BI.SignEditor.EVENT_STOP,function(){self.fireEvent(BI.DynamicYearMonthTrigger.EVENT_STOP)}),editor.on(BI.SignEditor.EVENT_CONFIRM,function(){self._doEditorConfirm(editor),self.fireEvent(BI.DynamicYearMonthTrigger.EVENT_CONFIRM)}),editor.on(BI.SignEditor.EVENT_SPACE,function(){editor.isValid()&&editor.blur()}),editor.on(BI.SignEditor.EVENT_START,function(){self.fireEvent(BI.DynamicYearMonthTrigger.EVENT_START)}),editor.on(BI.SignEditor.EVENT_ERROR,function(){self.fireEvent(BI.DynamicYearMonthTrigger.EVENT_ERROR)}),editor.on(BI.SignEditor.EVENT_VALID,function(){var year=self.yearEditor.getValue(),month=self.monthEditor.getValue();BI.isNotEmptyString(year)&&BI.isNotEmptyString(month)&&BI.isPositiveInteger(year)&&month>=1&&month<=12&&!BI.checkDateVoid(year,month,1,o.min,o.max)[0]&&self.fireEvent(BI.DynamicYearMonthTrigger.EVENT_VALID)}),editor.on(BI.SignEditor.EVENT_CHANGE,function(){isYear&&self._autoSwitch(editor)}),editor},_titleCreator:function(){var storeValue=this.storeValue||{},type=storeValue.type||BI.DynamicDateCombo.Static,value=storeValue.value;if(!this.monthEditor.isValid()||!this.yearEditor.isValid())return"";switch(type){case BI.DynamicDateCombo.Dynamic:var text=this._getText(value),date=BI.getDate();date=BI.DynamicDateHelper.getCalculation(value);var dateStr=BI.print(date,"%Y-%x");return BI.isEmptyString(text)?dateStr:text+":"+dateStr;case BI.DynamicDateCombo.Static:default:return value=value||{},this._getStaticTitle(value)}},_doEditorConfirm:function(editor){var value=editor.getValue();BI.isNotNull(value)&&editor.setValue(value);var monthValue=this.monthEditor.getValue();this.storeValue={type:BI.DynamicDateCombo.Static,value:{year:this.yearEditor.getValue(),month:BI.isEmptyString(this.monthEditor.getValue())?"":monthValue}}},_yearCheck:function(v){var date=BI.print(BI.parseDateTime(v,"%Y-%X-%d"),"%Y-%X-%d");return BI.print(BI.parseDateTime(v,"%Y"),"%Y")===v&&date>=this.options.min&&date<=this.options.max},_autoSwitch:function(editor){var v=editor.getValue();BI.isNotEmptyString(v)&&BI.checkDateLegal(v)&&4===v.length&&this._yearCheck(v)&&(this._doEditorConfirm(editor),this.fireEvent(BI.DynamicYearMonthTrigger.EVENT_CONFIRM),this.monthEditor.focus())},_getText:function(obj){var value="";return BI.isNotNull(obj.year)&&0!==BI.parseInt(obj.year)&&(value+=Math.abs(obj.year)+BI.i18nText("BI-Basic_Year")+(obj.year<0?BI.i18nText("BI-Basic_Front"):BI.i18nText("BI-Basic_Behind"))),BI.isNotNull(obj.month)&&0!==BI.parseInt(obj.month)&&(value+=Math.abs(obj.month)+BI.i18nText("BI-Basic_Month")+(obj.month<0?BI.i18nText("BI-Basic_Front"):BI.i18nText("BI-Basic_Behind"))),value},_setInnerValue:function(date,text){this.yearEditor.setValue(date.getFullYear()),this.monthEditor.setValue(date.getMonth()+1)},_getStaticTitle:function(value){value=value||{};var hasYear=!(BI.isNull(value.year)||BI.isEmptyString(value.year)),hasMonth=!(BI.isNull(value.month)||BI.isEmptyString(value.month));switch(hasYear<<1|hasMonth){case 0:return"";case 1:return value.month;case 2:return value.year;case 3:default:return value.year+"-"+value.month}},setValue:function(v){var type,value,date=BI.getDate();switch(this.storeValue=v,BI.isNotNull(v)&&(type=v.type||BI.DynamicDateCombo.Static,value=v.value||v),type){case BI.DynamicDateCombo.Dynamic:var text=this._getText(value);date=BI.DynamicDateHelper.getCalculation(value),this._setInnerValue(date,text);break;case BI.DynamicDateCombo.Static:default:value=value||{};var month=BI.isNull(value.month)?null:value.month;this.yearEditor.setValue(value.year),this.monthEditor.setValue(month)}},getValue:function(){return this.storeValue},getKey:function(){return this.yearEditor.getValue()+"-"+this.monthEditor.getValue()},isValid:function(){return this.yearEditor.isValid()&&this.monthEditor.isValid()}}),BI.DynamicYearMonthTrigger.EVENT_VALID="EVENT_VALID",BI.DynamicYearMonthTrigger.EVENT_FOCUS="EVENT_FOCUS",BI.DynamicYearMonthTrigger.EVENT_ERROR="EVENT_ERROR",BI.DynamicYearMonthTrigger.EVENT_START="EVENT_START",BI.DynamicYearMonthTrigger.EVENT_CONFIRM="EVENT_CONFIRM",BI.DynamicYearMonthTrigger.EVENT_STOP="EVENT_STOP",BI.DynamicYearMonthTrigger.EVENT_KEY_DOWN="EVENT_KEY_DOWN",BI.shortcut("bi.dynamic_year_month_trigger",BI.DynamicYearMonthTrigger),BI.YearMonthInterval=BI.inherit(BI.Single,{constants:{height:24,width:25,lgap:15,offset:-15,timeErrorCls:"time-error"},props:{extraCls:"bi-year-month-interval",minDate:"1900-01-01",maxDate:"2099-12-31"},_init:function(){var self=this,o=this.options;BI.YearMonthInterval.superclass._init.apply(this,arguments),o.value=o.value||{},this.left=this._createCombo(o.value.start),this.right=this._createCombo(o.value.end),this.label=BI.createWidget({type:"bi.label",height:this.constants.height,width:this.constants.width,text:"-"}),BI.createWidget({element:self,type:"bi.center",hgap:15,height:this.constants.height,items:[{type:"bi.absolute",items:[{el:self.left,left:this.constants.offset,right:0,top:0,bottom:0}]},{type:"bi.absolute",items:[{el:self.right,left:0,right:this.constants.offset,top:0,bottom:0}]}]}),BI.createWidget({type:"bi.horizontal_auto",element:this,items:[self.label]})},_createCombo:function(v){var self=this,o=this.options,combo=BI.createWidget({type:"bi.dynamic_year_month_combo",behaviors:o.behaviors,value:v,listeners:[{eventName:BI.DynamicYearMonthCombo.EVENT_BEFORE_POPUPVIEW,action:function(){self.fireEvent(BI.YearMonthInterval.EVENT_BEFORE_POPUPVIEW)}}]});return combo.on(BI.DynamicYearMonthCombo.EVENT_ERROR,function(){self._clearTitle(),BI.Bubbles.hide("error"),self.element.removeClass(self.constants.timeErrorCls),self.fireEvent(BI.YearMonthInterval.EVENT_ERROR)}),combo.on(BI.DynamicYearMonthCombo.EVENT_VALID,function(){self._checkValid()}),combo.on(BI.DynamicYearMonthCombo.EVENT_FOCUS,function(){self._checkValid()}),combo.on(BI.DynamicYearMonthCombo.EVENT_BEFORE_POPUPVIEW,function(){self.left.hideView(),self.right.hideView()}),combo.on(BI.DynamicYearMonthCombo.EVENT_CONFIRM,function(){BI.Bubbles.hide("error");var smallDate=self.left.getKey(),bigDate=self.right.getKey();self.left.isValid()&&self.right.isValid()&&self._check(smallDate,bigDate)&&self._compare(smallDate,bigDate)?(self._setTitle(BI.i18nText("BI-Time_Interval_Error_Text")),self.element.addClass(self.constants.timeErrorCls),self.fireEvent(BI.YearMonthInterval.EVENT_ERROR)):(self._clearTitle(),self.element.removeClass(self.constants.timeErrorCls),self.fireEvent(BI.YearMonthInterval.EVENT_CHANGE))}),combo},_dateCheck:function(date){return BI.print(BI.parseDateTime(date,"%Y-%x"),"%Y-%x")===date||BI.print(BI.parseDateTime(date,"%Y-%X"),"%Y-%X")===date},_checkVoid:function(obj){var o=this.options;return!BI.checkDateVoid(obj.year,obj.month,1,o.minDate,o.maxDate)[0]},_check:function(smallDate,bigDate){var smallObj=smallDate.match(/\d+/g),bigObj=bigDate.match(/\d+/g),smallDate4Check="";BI.isNotNull(smallObj)&&(smallDate4Check=(smallObj[0]||"")+"-"+(smallObj[1]||1));var bigDate4Check="";return BI.isNotNull(bigObj)&&(bigDate4Check=(bigObj[0]||"")+"-"+(bigObj[1]||1)),this._dateCheck(smallDate4Check)&&BI.checkDateLegal(smallDate)&&this._checkVoid({year:smallObj[0],month:smallObj[1],day:1})&&this._dateCheck(bigDate4Check)&&BI.checkDateLegal(bigDate)&&this._checkVoid({year:bigObj[0],month:bigObj[1],day:1})},_compare:function(smallDate,bigDate){return smallDate=BI.print(BI.parseDateTime(smallDate,"%Y-%X"),"%Y-%X"),bigDate=BI.print(BI.parseDateTime(bigDate,"%Y-%X"),"%Y-%X"),BI.isNotNull(smallDate)&&BI.isNotNull(bigDate)&&smallDate>bigDate},_setTitle:function(v){this.setTitle(v)},_clearTitle:function(){this.setTitle("")},_checkValid:function(){var self=this;BI.Bubbles.hide("error");var smallDate=self.left.getKey(),bigDate=self.right.getKey();self.left.isValid()&&self.right.isValid()&&self._check(smallDate,bigDate)&&self._compare(smallDate,bigDate)?(self._setTitle(BI.i18nText("BI-Time_Interval_Error_Text")),self.element.addClass(self.constants.timeErrorCls),BI.Bubbles.show("error",BI.i18nText("BI-Time_Interval_Error_Text"),self,{offsetStyle:"center"}),self.fireEvent(BI.YearMonthInterval.EVENT_ERROR)):(self._clearTitle(),self.element.removeClass(self.constants.timeErrorCls))},setValue:function(date){date=date||{},this.left.setValue(date.start),this.right.setValue(date.end),this._checkValid()},getValue:function(){return{start:this.left.getValue(),end:this.right.getValue()}}}),BI.YearMonthInterval.EVENT_VALID="EVENT_VALID",BI.YearMonthInterval.EVENT_ERROR="EVENT_ERROR",BI.YearMonthInterval.EVENT_CHANGE="EVENT_CHANGE",BI.YearMonthInterval.EVENT_BEFORE_POPUPVIEW="EVENT_BEFORE_POPUPVIEW",BI.shortcut("bi.year_month_interval",BI.YearMonthInterval),BI.DynamicYearQuarterCard=BI.inherit(BI.Widget,{props:{baseCls:"bi-year-month-card"},render:function(){var self=this;return{type:"bi.vertical",items:[{type:"bi.label",text:BI.i18nText("BI-Multi_Date_Relative_Current_Time"),textAlign:"left",height:24},{type:"bi.dynamic_date_param_item",ref:function(){self.year=this},listeners:[{eventName:"EVENT_CHANGE",action:function(){self.fireEvent("EVENT_CHANGE")}}]},{type:"bi.dynamic_date_param_item",dateType:BI.DynamicDateCard.TYPE.QUARTER,ref:function(){self.quarter=this},listeners:[{eventName:"EVENT_CHANGE",action:function(){self.fireEvent("EVENT_CHANGE")}}]}],vgap:10,hgap:10}},_createValue:function(type,v){return{dateType:type,value:Math.abs(v),offset:v>0?1:0}},setValue:function(v){v=v||{year:0,month:0},this.year.setValue(this._createValue(BI.DynamicDateCard.TYPE.YEAR,v.year)),this.quarter.setValue(this._createValue(BI.DynamicDateCard.TYPE.QUARTER,v.quarter))},getValue:function(){var year=this.year.getValue(),quarter=this.quarter.getValue();return{year:0===year.offset?-year.value:year.value,quarter:0===quarter.offset?-quarter.value:quarter.value}}}),BI.DynamicYearQuarterCard.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.dynamic_year_quarter_card",BI.DynamicYearQuarterCard),BI.StaticYearQuarterCard=BI.inherit(BI.Widget,{props:{baseCls:"bi-static-year-quarter-card",behaviors:{}},_createQuarter:function(){var items=[{text:BI.Date._QN[1],value:1},{text:BI.Date._QN[2],value:2},{text:BI.Date._QN[3],value:3},{text:BI.Date._QN[4],value:4}];return BI.map(items,function(j,item){return BI.extend(item,{type:"bi.text_item",cls:"bi-list-item-select",textAlign:"center",whiteSpace:"nowrap",once:!1,forceSelected:!0,height:24})})},render:function(){var self=this,o=this.options;return{type:"bi.vertical",items:[{type:"bi.year_picker",ref:function(){self.yearPicker=this},behaviors:o.behaviors,height:30,listeners:[{eventName:BI.YearPicker.EVENT_CHANGE,action:function(){var value=this.getValue();self.setValue({year:value,quarter:self.selectedQuarter})}}]},{type:"bi.button_group",behaviors:o.behaviors,ref:function(){self.quarter=this},items:this._createQuarter(),layouts:[{type:"bi.vertical",vgap:10}],value:o.value,listeners:[{eventName:BI.ButtonGroup.EVENT_CHANGE,action:function(){self.selectedYear=self.yearPicker.getValue(),self.selectedQuarter=this.getValue()[0],self.fireEvent(BI.StaticYearQuarterCard.EVENT_CHANGE)}}]}]}},getValue:function(){return{year:this.selectedYear,quarter:this.selectedQuarter}},setValue:function(obj){var o=this.options,newObj={};if(newObj.year=obj.year||0,newObj.quarter=obj.quarter||0,0===newObj.quarter||0===newObj.year||BI.checkDateVoid(newObj.year,newObj.quarter,1,o.min,o.max)[0]){var year=newObj.year||BI.getDate().getFullYear();this.selectedYear=year,this.selectedQuarter="",this.yearPicker.setValue(year),this.quarter.setValue()}else this.selectedYear=BI.parseInt(newObj.year),this.selectedQuarter=BI.parseInt(newObj.quarter),this.yearPicker.setValue(this.selectedYear),this.quarter.setValue(this.selectedQuarter)}}),BI.StaticYearQuarterCard.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.static_year_quarter_card",BI.StaticYearQuarterCard),BI.DynamicYearQuarterCombo=BI.inherit(BI.Widget,{props:{baseCls:"bi-year-quarter-combo bi-border bi-focus-shadow",behaviors:{},min:"1900-01-01",max:"2099-12-31",height:22},_init:function(){BI.DynamicYearQuarterCombo.superclass._init.apply(this,arguments);var self=this,o=this.options;this.storeValue=o.value,self.storeTriggerValue="",this.trigger=BI.createWidget({type:"bi.dynamic_year_quarter_trigger",min:o.min,max:o.max,height:o.height,value:o.value||""}),this.trigger.on(BI.DynamicYearQuarterTrigger.EVENT_KEY_DOWN,function(){self.combo.isViewVisible()&&self.combo.hideView()}),this.trigger.on(BI.DynamicYearQuarterTrigger.EVENT_START,function(){self.combo.isViewVisible()&&self.combo.hideView()}),this.trigger.on(BI.DynamicYearQuarterTrigger.EVENT_STOP,function(){self.combo.showView()}),this.trigger.on(BI.DynamicYearQuarterTrigger.EVENT_ERROR,function(){self.combo.isViewVisible()&&self.combo.hideView()}),this.trigger.on(BI.DynamicYearQuarterTrigger.EVENT_CONFIRM,function(){var dateStore=self.storeTriggerValue,dateObj=self.trigger.getKey();BI.isNotEmptyString(dateObj)&&!BI.isEqual(dateObj,dateStore)&&(self.storeValue=self.trigger.getValue(),self.setValue(self.trigger.getValue())),self._checkDynamicValue(self.storeValue),self.fireEvent(BI.DynamicYearQuarterCombo.EVENT_CONFIRM)}),this.trigger.on(BI.DynamicYearQuarterTrigger.EVENT_FOCUS,function(){self.storeTriggerValue=self.trigger.getKey()}),this.combo=BI.createWidget({type:"bi.combo",container:o.container,isNeedAdjustHeight:!1,isNeedAdjustWidth:!1,el:this.trigger,popup:{minWidth:85,stopPropagation:!1,el:{type:"bi.dynamic_year_quarter_popup",ref:function(){self.popup=this},listeners:[{eventName:BI.DynamicYearQuarterPopup.EVENT_CHANGE,action:function(){self.setValue(self.popup.getValue()),self.combo.hideView(),self.fireEvent(BI.DynamicYearQuarterCombo.EVENT_CONFIRM)}},{eventName:BI.DynamicYearQuarterPopup.BUTTON_CLEAR_EVENT_CHANGE,action:function(){self.setValue(),self.combo.hideView(),self.fireEvent(BI.DynamicYearQuarterCombo.EVENT_CONFIRM)}},{eventName:BI.DynamicYearQuarterPopup.BUTTON_lABEL_EVENT_CHANGE,action:function(){var date=BI.getDate();self.setValue({type:BI.DynamicYearMonthCombo.Static,value:{year:date.getFullYear(),quarter:BI.getQuarter(date)}}),self.combo.hideView(),self.fireEvent(BI.DynamicDateCombo.EVENT_CONFIRM)}},{eventName:BI.DynamicYearQuarterPopup.BUTTON_OK_EVENT_CHANGE,action:function(){self.setValue(self.popup.getValue()),self.combo.hideView(),self.fireEvent(BI.DynamicDateCombo.EVENT_CONFIRM)}}],behaviors:o.behaviors,min:o.min,max:o.max},value:o.value||""}}),this.combo.on(BI.Combo.EVENT_BEFORE_POPUPVIEW,function(){self.popup.setValue(self.storeValue),self.fireEvent(BI.DynamicYearQuarterCombo.EVENT_BEFORE_POPUPVIEW)}),BI.createWidget({type:"bi.htape",element:this,ref:function(){self.comboWrapper=this},items:[{el:{type:"bi.icon_button",cls:"bi-trigger-icon-button date-change-h-font",width:24,height:24,ref:function(){self.changeIcon=this}},width:24},this.combo]}),this._checkDynamicValue(o.value)},_checkDynamicValue:function(v){var type=null;switch(BI.isNotNull(v)&&(type=v.type),type){case BI.DynamicYearQuarterCombo.Dynamic:this.changeIcon.setVisible(!0),this.comboWrapper.attr("items")[0].width=24,this.comboWrapper.resize();break;default:this.comboWrapper.attr("items")[0].width=0,this.comboWrapper.resize(),this.changeIcon.setVisible(!1)}},setValue:function(v){this.storeValue=v,this.trigger.setValue(v),this._checkDynamicValue(v)},getValue:function(){return this.storeValue}}),BI.DynamicYearQuarterCombo.EVENT_CONFIRM="EVENT_CONFIRM",BI.DynamicYearQuarterCombo.EVENT_BEFORE_POPUPVIEW="EVENT_BEFORE_POPUPVIEW",BI.shortcut("bi.dynamic_year_quarter_combo",BI.DynamicYearQuarterCombo),BI.extend(BI.DynamicYearQuarterCombo,{Static:1,Dynamic:2}),BI.DynamicYearQuarterPopup=BI.inherit(BI.Widget,{constants:{tabHeight:30,buttonHeight:24},props:{baseCls:"bi-year-quarter-popup",behaviors:{},min:"1900-01-01",max:"2099-12-31",width:180,height:240},render:function(){var self=this,opts=this.options,c=this.constants;return this.storeValue={type:BI.DynamicYearQuarterCombo.Static},{type:"bi.vtape",items:[{el:this._getTabJson()},{el:{type:"bi.grid",items:[[{type:"bi.text_button",cls:"bi-split-top bi-high-light",shadow:!0,textHeight:c.buttonHeight-1,text:BI.i18nText("BI-Basic_Clear"),listeners:[{eventName:BI.TextButton.EVENT_CHANGE,action:function(){self.fireEvent(BI.DynamicYearQuarterPopup.BUTTON_CLEAR_EVENT_CHANGE)}}]},{type:"bi.text_button",cls:"bi-split-left bi-split-right bi-high-light bi-split-top",textHeight:c.buttonHeight-1,shadow:!0,text:BI.i18nText("BI-Basic_Current_Quarter"),ref:function(){self.textButton=this},listeners:[{eventName:BI.TextButton.EVENT_CHANGE,action:function(){self.fireEvent(BI.DynamicYearQuarterPopup.BUTTON_lABEL_EVENT_CHANGE)}}]},{type:"bi.text_button",cls:"bi-split-top bi-high-light",shadow:!0,textHeight:c.buttonHeight-1,text:BI.i18nText("BI-Basic_OK"),listeners:[{eventName:BI.TextButton.EVENT_CHANGE,action:function(){self.fireEvent(BI.DynamicYearQuarterPopup.BUTTON_OK_EVENT_CHANGE)}}]}]]},height:24}]}},_setInnerValue:function(){if(this.dateTab.getSelect()===BI.DynamicYearQuarterCombo.Static)this.textButton.setValue(BI.i18nText("BI-Basic_Current_Quarter")),this.textButton.setEnable(!0);else{var date=BI.DynamicDateHelper.getCalculation(this.dynamicPane.getValue());date=BI.print(date,"%Y-%Q"),this.textButton.setValue(date),this.textButton.setEnable(!1)}},_getTabJson:function(){var self=this,o=this.options;return{type:"bi.tab",ref:function(){self.dateTab=this},tab:{type:"bi.linear_segment",cls:"bi-split-bottom",height:this.constants.tabHeight,items:BI.createItems([{text:BI.i18nText("BI-Basic_Year_Quarter"),value:BI.DynamicYearQuarterCombo.Static},{text:BI.i18nText("BI-Basic_Dynamic_Title"),value:BI.DynamicYearQuarterCombo.Dynamic +}],{textAlign:"center"})},cardCreator:function(v){switch(v){case BI.DynamicYearQuarterCombo.Dynamic:return{type:"bi.dynamic_year_quarter_card",listeners:[{eventName:"EVENT_CHANGE",action:function(){self._setInnerValue(self.year,v)}}],ref:function(){self.dynamicPane=this}};case BI.DynamicYearQuarterCombo.Static:default:return{type:"bi.static_year_quarter_card",behaviors:o.behaviors,min:self.options.min,max:self.options.max,listeners:[{eventName:BI.DynamicYearCard.EVENT_CHANGE,action:function(){self.fireEvent(BI.DynamicYearQuarterPopup.EVENT_CHANGE)}}],ref:function(){self.year=this}}}},listeners:[{eventName:BI.Tab.EVENT_CHANGE,action:function(){var v=self.dateTab.getSelect();switch(v){case BI.DynamicYearQuarterCombo.Static:var date=BI.DynamicDateHelper.getCalculation(self.dynamicPane.getValue());self.year.setValue({year:date.getFullYear(),quarter:BI.getQuarter(date)}),self._setInnerValue();break;case BI.DynamicYearQuarterCombo.Dynamic:default:self.storeValue&&self.storeValue.type===BI.DynamicYearQuarterCombo.Dynamic?self.dynamicPane.setValue(self.storeValue.value):self.dynamicPane.setValue({year:0}),self._setInnerValue()}}}]}},setValue:function(v){this.storeValue=v;var self=this,type,value;switch(v=v||{},type=v.type||BI.DynamicDateCombo.Static,value=v.value||v,this.dateTab.setSelect(type),type){case BI.DynamicDateCombo.Dynamic:this.dynamicPane.setValue(value),self._setInnerValue();break;case BI.DynamicDateCombo.Static:default:this.year.setValue(value),this.textButton.setValue(BI.i18nText("BI-Basic_Current_Quarter")),this.textButton.setEnable(!0)}},getValue:function(){return{type:this.dateTab.getSelect(),value:this.dateTab.getValue()}}}),BI.DynamicYearQuarterPopup.BUTTON_CLEAR_EVENT_CHANGE="BUTTON_CLEAR_EVENT_CHANGE",BI.DynamicYearQuarterPopup.BUTTON_lABEL_EVENT_CHANGE="BUTTON_lABEL_EVENT_CHANGE",BI.DynamicYearQuarterPopup.BUTTON_OK_EVENT_CHANGE="BUTTON_OK_EVENT_CHANGE",BI.DynamicYearQuarterPopup.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.dynamic_year_quarter_popup",BI.DynamicYearQuarterPopup),BI.DynamicYearQuarterTrigger=BI.inherit(BI.Trigger,{_const:{hgap:4,vgap:2},props:{extraCls:"bi-year-quarter-trigger",min:"1900-01-01",max:"2099-12-31",height:22},_init:function(){BI.DynamicYearQuarterTrigger.superclass._init.apply(this,arguments);var o=this.options;this.yearEditor=this._createEditor(!0),this.quarterEditor=this._createEditor(!1),BI.createWidget({element:this,type:"bi.htape",items:[{type:"bi.center",items:[{type:"bi.htape",items:[this.yearEditor,{el:{type:"bi.text_button",text:BI.i18nText("BI-Multi_Date_Year"),width:o.height},width:o.height}]},{type:"bi.htape",items:[this.quarterEditor,{el:{type:"bi.text_button",text:BI.i18nText("BI-Multi_Date_Quarter"),width:24},width:24}]}]},{el:{type:"bi.trigger_icon_button",width:o.height},width:o.height}]}),this.setValue(o.value)},_createEditor:function(isYear){var self=this,o=this.options,c=this._const,editor=BI.createWidget({type:"bi.sign_editor",height:o.height,validationChecker:function(v){return isYear?""===v||BI.isPositiveInteger(v)&&!BI.checkDateVoid(v,1,1,o.min,o.max)[0]:""===v||BI.isPositiveInteger(v)&&v>=1&&v<=4&&!BI.checkDateVoid(BI.getDate().getFullYear(),v,1,o.min,o.max)[0]},quitChecker:function(){return!1},errorText:function(v){return BI.i18nText("BI-Year_Trigger_Invalid_Text")},watermark:BI.i18nText("BI-Basic_Unrestricted"),hgap:c.hgap,vgap:c.vgap,title:"",allowBlank:!0});return editor.on(BI.SignEditor.EVENT_KEY_DOWN,function(){self.fireEvent(BI.DynamicYearQuarterTrigger.EVENT_KEY_DOWN)}),editor.on(BI.SignEditor.EVENT_FOCUS,function(){self.fireEvent(BI.DynamicYearQuarterTrigger.EVENT_FOCUS)}),editor.on(BI.SignEditor.EVENT_STOP,function(){self.fireEvent(BI.DynamicYearQuarterTrigger.EVENT_STOP)}),editor.on(BI.SignEditor.EVENT_CONFIRM,function(){self._doEditorConfirm(editor),self.fireEvent(BI.DynamicYearQuarterTrigger.EVENT_CONFIRM)}),editor.on(BI.SignEditor.EVENT_SPACE,function(){editor.isValid()&&editor.blur()}),editor.on(BI.SignEditor.EVENT_START,function(){self.fireEvent(BI.DynamicYearQuarterTrigger.EVENT_START)}),editor.on(BI.SignEditor.EVENT_ERROR,function(){self.fireEvent(BI.DynamicYearQuarterTrigger.EVENT_ERROR)}),editor.on(BI.SignEditor.EVENT_CHANGE,function(){isYear&&self._autoSwitch(editor)}),editor},_doEditorConfirm:function(editor){var value=editor.getValue();BI.isNotNull(value)&&editor.setValue(value);var quarterValue=this.quarterEditor.getValue();this.storeValue={type:BI.DynamicYearQuarterCombo.Static,value:{year:this.yearEditor.getValue(),quarter:BI.isEmptyString(this.quarterEditor.getValue())?"":quarterValue}},this.setTitle(this._getStaticTitle(this.storeValue.value))},_yearCheck:function(v){var date=BI.print(BI.parseDateTime(v,"%Y-%X-%d"),"%Y-%X-%d");return BI.print(BI.parseDateTime(v,"%Y"),"%Y")===v&&date>=this.options.min&&date<=this.options.max},_autoSwitch:function(editor){var v=editor.getValue();BI.isNotEmptyString(v)&&BI.checkDateLegal(v)&&4===v.length&&this._yearCheck(v)&&(this._doEditorConfirm(editor),this.fireEvent(BI.DynamicYearQuarterTrigger.EVENT_CONFIRM),this.quarterEditor.focus())},_getStaticTitle:function(value){value=value||{};var hasYear=!(BI.isNull(value.year)||BI.isEmptyString(value.year)),hasMonth=!(BI.isNull(value.quarter)||BI.isEmptyString(value.quarter));switch(hasYear<<1|hasMonth){case 0:return"";case 1:return value.quarter;case 2:return value.year;case 3:default:return value.year+"-"+value.quarter}},_getText:function(obj){var value="";return BI.isNotNull(obj.year)&&0!==BI.parseInt(obj.year)&&(value+=Math.abs(obj.year)+BI.i18nText("BI-Basic_Year")+(obj.year<0?BI.i18nText("BI-Basic_Front"):BI.i18nText("BI-Basic_Behind"))),BI.isNotNull(obj.quarter)&&0!==BI.parseInt(obj.quarter)&&(value+=Math.abs(obj.quarter)+BI.i18nText("BI-Basic_Single_Quarter")+(obj.quarter<0?BI.i18nText("BI-Basic_Front"):BI.i18nText("BI-Basic_Behind"))),value},_setInnerValue:function(date,text){var dateStr=BI.print(date,"%Y-%Q");this.yearEditor.setValue(date.getFullYear()),this.quarterEditor.setValue(BI.getQuarter(date)),this.setTitle(BI.isEmptyString(text)?dateStr:text+":"+dateStr)},setValue:function(v){var type,value,date=BI.getDate();switch(this.storeValue=v,BI.isNotNull(v)&&(type=v.type||BI.DynamicYearQuarterCombo.Static,value=v.value||v),type){case BI.DynamicYearQuarterCombo.Dynamic:var text=this._getText(value);date=BI.DynamicDateHelper.getCalculation(value),this._setInnerValue(date,text);break;case BI.DynamicYearQuarterCombo.Static:default:value=value||{};var quarter=BI.isNull(value.quarter)?null:value.quarter;this.yearEditor.setValue(value.year),this.yearEditor.setTitle(value.year),this.quarterEditor.setValue(quarter),this.quarterEditor.setTitle(quarter),this.setTitle(this._getStaticTitle(value))}},getValue:function(){return this.storeValue},getKey:function(){return this.yearEditor.getValue()+"-"+this.quarterEditor.getValue()}}),BI.DynamicYearQuarterTrigger.EVENT_FOCUS="EVENT_FOCUS",BI.DynamicYearQuarterTrigger.EVENT_ERROR="EVENT_ERROR",BI.DynamicYearQuarterTrigger.EVENT_START="EVENT_START",BI.DynamicYearQuarterTrigger.EVENT_CONFIRM="EVENT_CONFIRM",BI.DynamicYearQuarterTrigger.EVENT_STOP="EVENT_STOP",BI.DynamicYearQuarterTrigger.EVENT_KEY_DOWN="EVENT_KEY_DOWN",BI.shortcut("bi.dynamic_year_quarter_trigger",BI.DynamicYearQuarterTrigger),BI.AbstractAllValueChooser=BI.inherit(BI.Widget,{_const:{perPage:100},_defaultConfig:function(){return BI.extend(BI.AbstractAllValueChooser.superclass._defaultConfig.apply(this,arguments),{width:200,height:30,items:null,itemsCreator:BI.emptyFn,cache:!0})},_valueFormatter:function(v){var text=v;return BI.isNotNull(this.items)&&BI.some(this.items,function(i,item){if(item.value===v||item.value+""===v)return text=item.text,!0}),text},_itemsCreator:function(options,callback){function call(items){var keywords=(options.keywords||[]).slice();options.keyword&&keywords.push(options.keyword);var resultItems=items;if(BI.isNotEmptyArray(keywords)&&(resultItems=[],BI.each(keywords,function(i,kw){var search=BI.Func.getSearchResult(items,kw);resultItems=resultItems.concat(search.match).concat(search.find)}),resultItems=BI.uniq(resultItems)),options.selectedValues){var filter=BI.makeObject(options.selectedValues,!0);resultItems=BI.filter(resultItems,function(i,ob){return!filter[ob.value]})}return options.type===BI.MultiSelectCombo.REQ_GET_ALL_DATA?void callback({items:resultItems}):options.type===BI.MultiSelectCombo.REQ_GET_DATA_LENGTH?void callback({count:resultItems.length}):void callback({items:resultItems,hasNext:!1})}var self=this,o=this.options;o.cache&&this.items?call(this.items):o.itemsCreator({},function(items){self.items=items,call(items)})}}),BI.AllValueChooserCombo=BI.inherit(BI.AbstractAllValueChooser,{_defaultConfig:function(){return BI.extend(BI.AllValueChooserCombo.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-all-value-chooser-combo",width:200,height:24,items:null,itemsCreator:BI.emptyFn,cache:!0})},_init:function(){BI.AllValueChooserCombo.superclass._init.apply(this,arguments);var self=this,o=this.options;BI.isNotNull(o.items)&&(this.items=o.items),this.combo=BI.createWidget({type:"bi.multi_select_combo",text:o.text,element:this,itemsCreator:BI.bind(this._itemsCreator,this),valueFormatter:BI.bind(this._valueFormatter,this),width:o.width,height:o.height,value:{type:BI.Selection.Multi,value:o.value||[]}}),this.combo.on(BI.MultiSelectCombo.EVENT_CONFIRM,function(){self.fireEvent(BI.AllValueChooserCombo.EVENT_CONFIRM)})},setValue:function(v){this.combo.setValue({type:BI.Selection.Multi,value:v||[]})},getValue:function(){var val=this.combo.getValue()||{};return val.type===BI.Selection.All?val.assist:val.value||[]},populate:function(items){this.items=items,this.combo.populate.apply(this,arguments)}}),BI.AllValueChooserCombo.EVENT_CONFIRM="EVENT_CONFIRM",BI.shortcut("bi.all_value_chooser_combo",BI.AllValueChooserCombo),BI.AllValueChooserPane=BI.inherit(BI.AbstractAllValueChooser,{_defaultConfig:function(){return BI.extend(BI.AllValueChooserPane.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-all-value-chooser-pane",width:200,height:30,items:null,itemsCreator:BI.emptyFn,cache:!0})},_init:function(){BI.AllValueChooserPane.superclass._init.apply(this,arguments);var self=this,o=this.options;BI.isNotNull(o.items)&&(this.items=o.items),this.list=BI.createWidget({type:"bi.multi_select_list",element:this,itemsCreator:BI.bind(this._itemsCreator,this),valueFormatter:BI.bind(this._valueFormatter,this),width:o.width,height:o.height}),this.list.on(BI.MultiSelectList.EVENT_CHANGE,function(){self.fireEvent(BI.AllValueChooserPane.EVENT_CHANGE)})},setValue:function(v){this.list.setValue({type:BI.Selection.Multi,value:v||[]})},getValue:function(){var val=this.list.getValue()||{};return val.type===BI.Selection.All?val.assist:val.value||[]},populate:function(items){this.items=items,this.list.populate.apply(this.list,arguments)}}),BI.AllValueChooserPane.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.all_value_chooser_pane",BI.AllValueChooserPane),BI.AllValueMultiTextValueCombo=BI.inherit(BI.Widget,{props:{baseCls:"bi-all-value-multi-text-value-combo",width:200,height:24,items:[]},render:function(){var self=this,o=this.options,value=this._digestValue(o.value);return{type:"bi.search_multi_text_value_combo",text:o.text,height:o.height,items:o.items,value:value,numOfPage:100,valueFormatter:o.valueFormatter,warningTitle:o.warningTitle,listeners:[{eventName:BI.SearchMultiTextValueCombo.EVENT_CONFIRM,action:function(){self.fireEvent(BI.AllValueMultiTextValueCombo.EVENT_CONFIRM)}}],ref:function(){self.combo=this}}},setValue:function(v){var value=this._digestValue(v);this.combo.setValue(value)},getValue:function(){var obj=this.combo.getValue()||{};if(obj.value=obj.value||[],obj.type===BI.Selection.All){var values=[];return BI.each(this.options.items,function(idx,item){!BI.contains(obj.value,item.value)&&values.push(item.value)}),values}return obj.value||[]},populate:function(items){this.options.items=items,this.combo.populate.apply(this,arguments)},_digestValue:function(v){return{type:BI.Selection.Multi,value:v||[]}}}),BI.AllValueMultiTextValueCombo.EVENT_CONFIRM="EVENT_CONFIRM",BI.shortcut("bi.all_value_multi_text_value_combo",BI.AllValueMultiTextValueCombo),BI.AbstractTreeValueChooser=BI.inherit(BI.Widget,{_const:{perPage:100},_defaultConfig:function(){return BI.extend(BI.AbstractTreeValueChooser.superclass._defaultConfig.apply(this,arguments),{items:null,itemsCreator:BI.emptyFn,open:!1})},_valueFormatter:function(v){var text=v;return BI.isNotNull(this.items)&&BI.some(this.items,function(i,item){if(item.value===v||item.value+""===v)return text=item.text,!0}),text},_initData:function(items){this.items=items;var nodes=BI.Tree.treeFormat(items);this.tree=new BI.Tree,this.tree.initTree(nodes)},_itemsCreator:function(options,callback){function call(){switch(options.type){case BI.TreeView.REQ_TYPE_INIT_DATA:self._reqInitTreeNode(options,callback);break;case BI.TreeView.REQ_TYPE_ADJUST_DATA:self._reqAdjustTreeNode(options,callback);break;case BI.TreeView.REQ_TYPE_SELECT_DATA:self._reqSelectedTreeNode(options,callback);break;case BI.TreeView.REQ_TYPE_GET_SELECTED_DATA:self._reqDisplayTreeNode(options,callback);break;default:self._reqTreeNode(options,callback)}}var self=this,o=this.options;this.items?call():o.itemsCreator({},function(items){self._initData(items),call()})},_reqDisplayTreeNode:function(op,callback){function doCheck(parentValues,node,selected){return null==selected||BI.isEmpty(selected)?void BI.each(node.getChildren(),function(i,child){var newParents=BI.clone(parentValues);newParents.push(child.value);var llen=self._getChildCount(newParents);createOneJson(child,node.id,llen),doCheck(newParents,child,{})}):void BI.each(selected,function(k){var node=self._getTreeNode(parentValues,k);if(BI.isNull(node))createOneJson({id:BI.UUID(),text:k,value:k},BI.UUID(),0);else{var newParents=BI.clone(parentValues);newParents.push(node.value),createOneJson(node,node.parent&&node.parent.id,getCount(selected[k],newParents)),doCheck(newParents,node,selected[k])}})}function getCount(jo,parentValues){return null==jo?0:BI.isEmpty(jo)?self._getChildCount(parentValues):BI.size(jo)}function createOneJson(node,pId,llen){result.push({id:node.id,pId:pId,text:node.text+(llen>0?"("+BI.i18nText("BI-Basic_Altogether")+llen+BI.i18nText("BI-Basic_Count")+")":""),value:node.value,open:!0})}var self=this,result=[],selectedValues=op.selectedValues;return null==selectedValues||BI.isEmpty(selectedValues)?void callback({}):(doCheck([],this.tree.getRoot(),selectedValues),void callback({items:result}))},_reqSelectedTreeNode:function(op,callback){function dealWithSelectedValues(selectedValues){var p=parentValues.concat(notSelectedValue);if(canFindKey(selectedValues,p))if(isSearchValueInParent(p))self._deleteNode(selectedValues,p);else{var searched=[],find=search(parentValues,notSelectedValue,[],searched);find&&BI.isNotEmptyArray(searched)&&BI.each(searched,function(i,arr){var node=self._getNode(selectedValues,arr);node?self._deleteNode(selectedValues,arr):expandSelectedValue(selectedValues,arr,BI.last(arr))})}if(isChild(selectedValues,p)){var result=[],find=!1;isSearchValueInParent(p)?find=!0:(find=search(parentValues,notSelectedValue,result),p=parentValues),find===!0&&(expandSelectedValue(selectedValues,p,notSelectedValue),result.length>0&&BI.each(result,function(i,strs){self._buildTree(selectedValues,strs)}))}}function expandSelectedValue(selectedValues,parents,notSelectedValue){var next=selectedValues,childrenCount=[],path=[];BI.some(parents,function(i,v){var t=next[v];if(null==t){if(0===i)return!0;if(!BI.isEmpty(next))return!0;var split=parents.slice(0,i),expanded=self._getChildren(split);if(path.push(split),childrenCount.push(expanded.length),i===parents.length-1&&1===expanded.length&&expanded[0].value===notSelectedValue)for(var j=childrenCount.length-1;j>=0&&1===childrenCount[j];j--)self._deleteNode(selectedValues,path[j]);else BI.each(expanded,function(m,child){return i===parents.length-1&&child.value===notSelectedValue||void(next[child.value]={})});next=next[v]}else next=t})}function search(parents,current,result,searched){var newParents=BI.clone(parents);if(newParents.push(current),self._isMatch(parents,current,keyword))return searched&&searched.push(newParents),!0;var children=self._getChildren(newParents),notSearch=[],can=!1;return BI.each(children,function(i,child){search(newParents,child.value,result,searched)?can=!0:notSearch.push(child.value)}),can===!0&&BI.each(notSearch,function(i,v){var next=BI.clone(newParents);next.push(v),result.push(next)}),can}function isSearchValueInParent(parentValues){for(var i=0,len=parentValues.length;iself._const.perPage)break}if(1===op.times){var nodes=self._getAddedValueNode([],selectedValues);result=BI.concat(BI.filter(nodes,function(idx,node){var find=BI.Func.getSearchResult([node.text||node.value],keyword);return find.find.length>0||find.match.length>0}),result)}return output}function nodeSearch(deep,parentValues,current,isAllSelect,result){if(self._isMatch(parentValues,current,keyword)){var checked=isAllSelect||isSelected(parentValues,current);return createOneJson(parentValues,current,!1,checked,!isAllSelect&&isHalf(parentValues,current),!0,result),[!0,checked]}var newParents=BI.clone(parentValues);newParents.push(current);var children=self._getChildren(newParents),can=!1,checked=!1,isCurAllSelected=isAllSelect||isAllSelected(parentValues,current);return BI.each(children,function(i,child){var state=nodeSearch(deep+1,newParents,child.value,isCurAllSelected,result);state[1]===!0&&(checked=!0),state[0]===!0&&(can=!0)}),can===!0&&(checked=isCurAllSelected||isSelected(parentValues,current)&&checked,createOneJson(parentValues,current,!0,checked,!1,!1,result)),[can,checked]}function createOneJson(parentValues,value,isOpen,checked,half,flag,result){var node=self._getTreeNode(parentValues,value);result.push({id:node.id,pId:node.pId,text:node.text,value:node.value,title:node.title,isParent:node.getChildrenLength()>0,open:isOpen,checked:checked,halfCheck:half,flag:flag})}function isHalf(parentValues,value){var find=findSelectedObj(parentValues);return null==find?null:BI.any(find,function(v,ob){if(v===value&&null!=ob&&!BI.isEmpty(ob))return!0})}function isAllSelected(parentValues,value){var find=findSelectedObj(parentValues);return null==find?null:BI.any(find,function(v,ob){if(v===value&&null!=ob&&BI.isEmpty(ob))return!0})}function isSelected(parentValues,value){var find=findSelectedObj(parentValues);return null!=find&&BI.any(find,function(v){if(v===value)return!0})}function findSelectedObj(parentValues){var find=selectedValues;return null==find?null:(BI.every(parentValues,function(i,v){return find=find[v],null!=find}),find)}var self=this,result=[],keyword=op.keyword||"",selectedValues=op.selectedValues,lastSearchValue=op.lastSearchValue||"",output=search();BI.nextTick(function(){callback({hasNext:output.length>self._const.perPage,items:result,lastSearchValue:BI.last(output)})})},_reqTreeNode:function(op,callback){function judgeState(parentValues,selected_value,checkState){var checked=checkState.checked,half=checkState.half;return!(parentValues.length>0&&!checked)&&(0===parentValues.length||checked&&half&&!BI.isEmpty(selected_value))}function dealWithSelectedValue(parentValues,selectedValues){var valueMap={};return BI.each(parentValues,function(i,v){selectedValues=selectedValues[v]||{}}),BI.each(selectedValues,function(value,obj){if(BI.isNull(obj))return void(valueMap[value]=[0,0]);if(BI.isEmpty(obj))return void(valueMap[value]=[2,0]);var nextNames={};BI.each(obj,function(t,o){(BI.isNull(o)||BI.isEmpty(o))&&(nextNames[t]=!0)}),valueMap[value]=[1,BI.size(nextNames)]}),valueMap}function getCheckState(current,parentValues,valueMap,checkState){var checked=checkState.checked,half=checkState.half,tempCheck=!1,halfCheck=!1;if(BI.has(valueMap,current))if(1===valueMap[current][0]){var values=BI.clone(parentValues);values.push(current);var childCount=self._getChildCount(values);childCount>0&&childCount!==valueMap[current][1]&&(halfCheck=!0)}else 2===valueMap[current][0]&&(tempCheck=!0);var check;return check=checked||halfCheck||tempCheck?(tempCheck||checked)&&!half||BI.has(valueMap,current):BI.has(valueMap,current),[check,halfCheck]}var self=this,o=this.options,result=[],times=op.times,checkState=op.checkState||{},parentValues=op.parentValues||[],selectedValues=op.selectedValues||{},valueMap={};valueMap=dealWithSelectedValue(parentValues,selectedValues);for(var nodes=this._getChildren(parentValues),i=(times-1)*this._const.perPage;nodes[i]&&i0,checked:state[0],halfCheck:state[1],open:o.open})}if(o.open){var allNodes=[];BI.each(nodes,function(idx,node){allNodes=BI.concat(allNodes,self._getAllChildren(parentValues.concat([node.value])))}),BI.each(allNodes,function(idx,node){var valueMap=dealWithSelectedValue(node.parentValues,selectedValues),state=getCheckState(node.value,node.parentValues,valueMap,checkState);result.push({id:node.id,pId:node.pId,value:node.value,text:node.text,times:1,isParent:node.getChildrenLength()>0,checked:state[0],halfCheck:state[1],open:self.options.open})})}0===parentValues.length&&1===times&&(result=BI.concat(self._getAddedValueNode(parentValues,selectedValues),result)),BI.nextTick(function(){callback({items:result,hasNext:nodes.length>times*self._const.perPage})})},_getAddedValueNode:function(parentValues,selectedValues){var nodes=this._getChildren(parentValues);return BI.map(BI.difference(BI.keys(selectedValues),BI.map(nodes,"value")),function(idx,v){return{id:BI.UUID(),pId:nodes.length>0?nodes[0].pId:BI.UUID(),value:v,text:v,times:1,isParent:!1,checked:!0,halfCheck:!1}})},_getNode:function(selectedValues,parentValues){for(var pNode=selectedValues,i=0,len=parentValues.length;i0&&BI.isEmpty(pNode);)name=p[p.length-1],p=p.slice(0,p.length-1),pNode=this._getNode(selectedValues,p),null!=pNode&&delete pNode[name]},_buildTree:function(jo,values){var t=jo;BI.each(values,function(i,v){BI.has(t,v)||(t[v]={}),t=t[v]})},_isMatch:function(parentValues,value,keyword){var o=this.options,node=this._getTreeNode(parentValues,value);if(!node)return!1;var find=BI.Func.getSearchResult([node.text||node.value],keyword);if(o.allowSearchValue&&node.value){var valueFind=BI.Func.getSearchResult([node.value],keyword);return valueFind.find.length>0||valueFind.match.length>0||find.find.length>0||find.match.length>0}return find.find.length>0||find.match.length>0},_getTreeNode:function(parentValues,v){var self=this,findParentNode,index=0;return this.tree.traverse(function(node){if(!self.tree.isRoot(node))return!(index>parentValues.length)&&(index===parentValues.length&&node.value===v?(findParentNode=node,!1):node.value!==parentValues[index]||void index++)}),findParentNode},_getChildren:function(parentValues){if(parentValues.length>0)var value=BI.last(parentValues),parent=this._getTreeNode(parentValues.slice(0,parentValues.length-1),value);else var parent=this.tree.getRoot();return parent.getChildren()},_getAllChildren:function(parentValues){var children=this._getChildren(parentValues),nodes=[].concat(children);BI.each(nodes,function(idx,node){node.parentValues=parentValues});for(var queue=BI.map(children,function(idx,node){return{parentValues:parentValues,value:node.value}});BI.isNotEmptyArray(queue);){var node=queue.shift(),pValues=node.parentValues.concat(node.value),childNodes=this._getChildren(pValues);BI.each(childNodes,function(idx,node){node.parentValues=pValues}),queue=queue.concat(childNodes),nodes=nodes.concat(childNodes)}return nodes},_getChildCount:function(parentValues){return this._getChildren(parentValues).length}}),BI.AbstractListTreeValueChooser=BI.inherit(BI.AbstractTreeValueChooser,{_reqDisplayTreeNode:function(op,callback){function doCheck(parentValues,node,selected){BI.each(selected,function(idx,path){BI.each(path,function(id,value){var nodeValue=value,node=self._getTreeNode(path.slice(0,id),nodeValue);BI.isNull(node)?createOneJson({id:BI.UUID(),text:nodeValue,value:nodeValue,isLeaf:!0},BI.UUID()):(BI.has(result,node.id)||createOneJson(node,node.parent&&node.parent.id),result[node.id].isLeaf!==!0&&(result[node.id].isLeaf=id===path.length-1))})})}function createOneJson(node,pId){result[node.id]={id:node.id,pId:pId,text:node.text,value:node.value,open:!0,isLeaf:node.isLeaf}}var self=this,result={},selectedValues=op.selectedValues;return null==selectedValues||BI.isEmpty(selectedValues)?void callback({}):(doCheck([],this.tree.getRoot(),selectedValues),void callback({items:BI.values(result)}))},_reqInitTreeNode:function(op,callback){function search(){var children=self._getChildren([]),start=children.length;if(""!==lastSearchValue){for(var j=0,len=start;jself._const.perPage)break}if(1===op.times){var nodes=self._getAddedValueNode([],selectedValues);result=BI.concat(BI.filter(nodes,function(idx,node){var find=BI.Func.getSearchResult([node.text||node.value],keyword);return find.find.length>0||find.match.length>0}),result)}return output}function nodeSearch(deep,parentValues,current,result){if(self._isMatch(parentValues,current,keyword)){var checked=isSelected(current);return createOneJson(parentValues,current,!1,checked,!0,result),[!0,checked]}var newParents=BI.clone(parentValues);newParents.push(current);var children=self._getChildren(newParents),can=!1,checked=!1;return BI.each(children,function(i,child){var state=nodeSearch(deep+1,newParents,child.value,result);state[1]===!0&&(checked=!0),state[0]===!0&&(can=!0)}),can===!0&&(checked=isSelected(current),createOneJson(parentValues,current,!0,checked,!1,result)),[can,checked]}function createOneJson(parentValues,value,isOpen,checked,flag,result){var node=self._getTreeNode(parentValues,value);result.push({id:node.id,pId:node.pId,text:node.text,value:node.value,title:node.title,isParent:node.getChildrenLength()>0,open:isOpen,checked:checked,halfCheck:!1,flag:flag})}function isHalf(parentValues,value){var find=findSelectedObj(parentValues);return null==find?null:BI.any(find,function(v,ob){if(v===value&&null!=ob&&!BI.isEmpty(ob))return!0})}function isAllSelected(parentValues,value){var find=findSelectedObj(parentValues);return null==find?null:BI.any(find,function(v,ob){if(v===value&&null!=ob&&BI.isEmpty(ob))return!0})}function isSelected(value){return BI.any(selectedValues,function(idx,array){return BI.last(array)===value})}function findSelectedObj(parentValues){var find=selectedValues;return null==find?null:(BI.every(parentValues,function(i,v){return find=find[v],null!=find}),find)}var self=this,result=[],keyword=op.keyword||"",selectedValues=op.selectedValues,lastSearchValue=op.lastSearchValue||"",output=search();BI.nextTick(function(){callback({hasNext:output.length>self._const.perPage,items:result,lastSearchValue:BI.last(output)})})},_reqTreeNode:function(op,callback){function dealWithSelectedValue(selectedValues){var valueMap={};return BI.each(selectedValues,function(idx,v){valueMap[BI.last(v)]=[2,0]}),valueMap}for(var self=this,o=this.options,result=[],times=op.times,parentValues=op.parentValues||[],selectedValues=op.selectedValues||[],valueMap=dealWithSelectedValue(selectedValues),nodes=this._getChildren(parentValues),i=(times-1)*this._const.perPage;nodes[i]&&i0,checked:checked,halfCheck:!1,open:o.open})}if(o.open){var allNodes=[];BI.each(nodes,function(idx,node){allNodes=BI.concat(allNodes,self._getAllChildren(parentValues.concat([node.value])))}),BI.each(allNodes,function(idx,node){var checked=BI.has(valueMap,node.value);result.push({id:node.id,pId:node.pId,value:node.value,text:node.text,times:1,isParent:node.getChildrenLength()>0,checked:checked,halfCheck:!1,open:o.open})})}0===parentValues.length&&1===times&&(result=BI.concat(self._getAddedValueNode(parentValues,selectedValues),result)),BI.nextTick(function(){callback({items:result,hasNext:nodes.length>times*self._const.perPage})})},_getAddedValueNode:function(parentValues,selectedValues){var nodes=this._getChildren(parentValues),values=BI.flatten(BI.filter(selectedValues,function(idx,array){return 1===array.length}));return BI.map(BI.difference(values,BI.map(nodes,"value")),function(idx,v){return{id:BI.UUID(),pId:nodes.length>0?nodes[0].pId:BI.UUID(),value:v,text:v,times:1,isParent:!1,checked:!0,halfCheck:!1}})}}),BI.ListTreeValueChooserInsertCombo=BI.inherit(BI.AbstractListTreeValueChooser,{_defaultConfig:function(){return BI.extend(BI.ListTreeValueChooserInsertCombo.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-list-tree-value-chooser-insert-combo",width:200,height:24,items:null,itemsCreator:BI.emptyFn})},_init:function(){BI.ListTreeValueChooserInsertCombo.superclass._init.apply(this,arguments);var self=this,o=this.options;BI.isNotNull(o.items)&&this._initData(o.items),this.combo=BI.createWidget({type:"bi.multi_tree_list_combo",element:this,text:o.text,value:o.value,watermark:o.watermark,allowInsertValue:o.allowInsertValue,allowEdit:o.allowEdit, +itemsCreator:BI.bind(this._itemsCreator,this),valueFormatter:BI.bind(this._valueFormatter,this),width:o.width,height:o.height,listeners:[{eventName:BI.MultiTreeListCombo.EVENT_FOCUS,action:function(){self.fireEvent(BI.ListTreeValueChooserInsertCombo.EVENT_FOCUS)}},{eventName:BI.MultiTreeListCombo.EVENT_BLUR,action:function(){self.fireEvent(BI.ListTreeValueChooserInsertCombo.EVENT_BLUR)}},{eventName:BI.MultiTreeListCombo.EVENT_STOP,action:function(){self.fireEvent(BI.ListTreeValueChooserInsertCombo.EVENT_STOP)}},{eventName:BI.MultiTreeListCombo.EVENT_CLICK_ITEM,action:function(){self.fireEvent(BI.ListTreeValueChooserInsertCombo.EVENT_CLICK_ITEM)}},{eventName:BI.MultiTreeListCombo.EVENT_SEARCHING,action:function(){self.fireEvent(BI.ListTreeValueChooserInsertCombo.EVENT_SEARCHING)}},{eventName:BI.MultiTreeListCombo.EVENT_CONFIRM,action:function(){self.fireEvent(BI.ListTreeValueChooserInsertCombo.EVENT_CONFIRM)}}]})},setValue:function(v){this.combo.setValue(v)},getValue:function(){return this.combo.getValue()},populate:function(items){this._initData(items),this.combo.populate.apply(this.combo,arguments)}}),BI.ListTreeValueChooserInsertCombo.EVENT_FOCUS="EVENT_FOCUS",BI.ListTreeValueChooserInsertCombo.EVENT_BLUR="EVENT_BLUR",BI.ListTreeValueChooserInsertCombo.EVENT_STOP="EVENT_STOP",BI.ListTreeValueChooserInsertCombo.EVENT_CLICK_ITEM="EVENT_CLICK_ITEM",BI.ListTreeValueChooserInsertCombo.EVENT_SEARCHING="EVENT_SEARCHING",BI.ListTreeValueChooserInsertCombo.EVENT_CONFIRM="EVENT_CONFIRM",BI.shortcut("bi.list_tree_value_chooser_insert_combo",BI.ListTreeValueChooserInsertCombo),BI.TreeValueChooserInsertCombo=BI.inherit(BI.AbstractTreeValueChooser,{_defaultConfig:function(){return BI.extend(BI.TreeValueChooserInsertCombo.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-tree-value-chooser-insert-combo",width:200,height:24,items:null,itemsCreator:BI.emptyFn})},_init:function(){BI.TreeValueChooserInsertCombo.superclass._init.apply(this,arguments);var self=this,o=this.options;BI.isNotNull(o.items)&&this._initData(o.items),this.combo=BI.createWidget({type:"bi.multi_tree_insert_combo",text:o.text,value:o.value,watermark:o.watermark,element:this,itemsCreator:BI.bind(this._itemsCreator,this),valueFormatter:BI.bind(this._valueFormatter,this),width:o.width,height:o.height,listeners:[{eventName:BI.MultiTreeInsertCombo.EVENT_FOCUS,action:function(){self.fireEvent(BI.TreeValueChooserCombo.EVENT_FOCUS)}},{eventName:BI.MultiTreeInsertCombo.EVENT_BLUR,action:function(){self.fireEvent(BI.TreeValueChooserCombo.EVENT_BLUR)}},{eventName:BI.MultiTreeInsertCombo.EVENT_STOP,action:function(){self.fireEvent(BI.TreeValueChooserInsertCombo.EVENT_STOP)}},{eventName:BI.MultiTreeInsertCombo.EVENT_CLICK_ITEM,action:function(){self.fireEvent(BI.TreeValueChooserInsertCombo.EVENT_CLICK_ITEM)}},{eventName:BI.MultiTreeInsertCombo.EVENT_SEARCHING,action:function(){self.fireEvent(BI.TreeValueChooserInsertCombo.EVENT_SEARCHING)}},{eventName:BI.MultiTreeInsertCombo.EVENT_CONFIRM,action:function(){self.fireEvent(BI.TreeValueChooserInsertCombo.EVENT_CONFIRM)}}]})},setValue:function(v){this.combo.setValue(v)},getValue:function(){return this.combo.getValue()},populate:function(items){this._initData(items),this.combo.populate.apply(this.combo,arguments)}}),BI.TreeValueChooserInsertCombo.EVENT_FOCUS="EVENT_FOCUS",BI.TreeValueChooserInsertCombo.EVENT_BLUR="EVENT_BLUR",BI.TreeValueChooserInsertCombo.EVENT_STOP="EVENT_STOP",BI.TreeValueChooserInsertCombo.EVENT_CLICK_ITEM="EVENT_CLICK_ITEM",BI.TreeValueChooserInsertCombo.EVENT_SEARCHING="EVENT_SEARCHING",BI.TreeValueChooserInsertCombo.EVENT_CONFIRM="EVENT_CONFIRM",BI.shortcut("bi.tree_value_chooser_insert_combo",BI.TreeValueChooserInsertCombo),BI.TreeValueChooserCombo=BI.inherit(BI.AbstractTreeValueChooser,{_defaultConfig:function(){return BI.extend(BI.TreeValueChooserCombo.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-tree-value-chooser-combo",width:200,height:24,items:null,itemsCreator:BI.emptyFn})},_init:function(){BI.TreeValueChooserCombo.superclass._init.apply(this,arguments);var self=this,o=this.options;BI.isNotNull(o.items)&&this._initData(o.items),this.combo=BI.createWidget({type:"bi.multi_tree_combo",text:o.text,value:o.value,watermark:o.watermark,element:this,itemsCreator:BI.bind(this._itemsCreator,this),valueFormatter:BI.bind(this._valueFormatter,this),width:o.width,height:o.height,listeners:[{eventName:BI.MultiTreeCombo.EVENT_FOCUS,action:function(){self.fireEvent(BI.TreeValueChooserCombo.EVENT_FOCUS)}},{eventName:BI.MultiTreeCombo.EVENT_BLUR,action:function(){self.fireEvent(BI.TreeValueChooserCombo.EVENT_BLUR)}},{eventName:BI.MultiTreeCombo.EVENT_STOP,action:function(){self.fireEvent(BI.TreeValueChooserCombo.EVENT_STOP)}},{eventName:BI.MultiTreeCombo.EVENT_CLICK_ITEM,action:function(){self.fireEvent(BI.TreeValueChooserCombo.EVENT_CLICK_ITEM)}},{eventName:BI.MultiTreeCombo.EVENT_SEARCHING,action:function(){self.fireEvent(BI.TreeValueChooserCombo.EVENT_SEARCHING)}},{eventName:BI.MultiTreeCombo.EVENT_CONFIRM,action:function(){self.fireEvent(BI.TreeValueChooserCombo.EVENT_CONFIRM)}}]})},setValue:function(v){this.combo.setValue(v)},getValue:function(){return this.combo.getValue()},populate:function(items){this._initData(items),this.combo.populate.apply(this.combo,arguments)}}),BI.TreeValueChooserCombo.EVENT_CONFIRM="EVENT_CONFIRM",BI.TreeValueChooserCombo.EVENT_FOCUS="EVENT_FOCUS",BI.TreeValueChooserCombo.EVENT_BLUR="EVENT_BLUR",BI.TreeValueChooserCombo.EVENT_STOP="EVENT_STOP",BI.TreeValueChooserCombo.EVENT_CLICK_ITEM="EVENT_CLICK_ITEM",BI.TreeValueChooserCombo.EVENT_SEARCHING="EVENT_SEARCHING",BI.shortcut("bi.tree_value_chooser_combo",BI.TreeValueChooserCombo),BI.TreeValueChooserPane=BI.inherit(BI.AbstractTreeValueChooser,{_defaultConfig:function(){return BI.extend(BI.TreeValueChooserPane.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-tree-value-chooser-pane",items:null,itemsCreator:BI.emptyFn})},_init:function(){BI.TreeValueChooserPane.superclass._init.apply(this,arguments);var self=this,o=this.options;this.pane=BI.createWidget({type:"bi.multi_select_tree",element:this,itemsCreator:BI.bind(this._itemsCreator,this)}),this.pane.on(BI.MultiSelectTree.EVENT_CHANGE,function(){self.fireEvent(BI.TreeValueChooserPane.EVENT_CHANGE)}),BI.isNotNull(o.items)&&(this._initData(o.items),this.populate())},setSelectedValue:function(v){this.pane.setSelectedValue(v)},setValue:function(v){this.pane.setValue(v)},getValue:function(){return this.pane.getValue()},populate:function(){this.pane.populate.apply(this.pane,arguments)}}),BI.TreeValueChooserPane.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.tree_value_chooser_pane",BI.TreeValueChooserPane),BI.AbstractValueChooser=BI.inherit(BI.Widget,{_const:{perPage:100},_defaultConfig:function(){return BI.extend(BI.AbstractValueChooser.superclass._defaultConfig.apply(this,arguments),{items:null,itemsCreator:BI.emptyFn,cache:!0})},_valueFormatter:function(v){var text=v;return BI.isNotNull(this.items)&&BI.some(this.items,function(i,item){if(item.value===v||item.value+""===v)return text=item.text,!0}),text},_getItemsByTimes:function(items,times){for(var res=[],i=(times-1)*this._const.perPage;items[i]&&idocument.F=Object"),t.close(),p=t.F;e--;)delete p[a][i[e]];return p()};t.exports=Object.create||function(t,n){var e;return null!==t?(l[a]=r(t),e=new l,l[a]=null,e[f]=t):e=p(),n===undefined?e:o(e,n)},u[f]=!0},function(t,n,e){"use strict";var r=e(25);t.exports=function(t){return Object(r(t))}},function(t,n,e){"use strict";t.exports={}},function(t,n,e){"use strict";var o=e(13),i=function i(t){var e,r;this.promise=new t(function(t,n){if(e!==undefined||r!==undefined)throw TypeError("Bad Promise constructor");e=t,r=n}),this.resolve=o(e),this.reject=o(r)};t.exports.f=function(t){return new i(t)}},function(t,n,e){"use strict";var r=e(4),o=e(35),i=e(18),u=e(14),c=e(37),s=e(8),f=e(47),a=Object.getOwnPropertyDescriptor;n.f=r?a:function(t,n){if(t=u(t),n=c(n,!0),f)try{return a(t,n)}catch(e){}if(s(t,n))return i(!o.f.call(t,n),t[n])}},function(t,n,e){"use strict";t.exports=function(t){if(t==undefined)throw TypeError("Can't call method on "+t);return t}},function(t,n,e){"use strict";var r=e(19),o=e(40),i=r("keys");t.exports=function(t){return i[t]||(i[t]=o(t))}},function(t,n,e){"use strict";t.exports={}},function(t,n,e){"use strict";var r=e(29),o=Math.min;t.exports=function(t){return 0o;)u(r,e=n[o++])&&(~s(i,e)||i.push(e));return i}},function(t,n,e){"use strict";var s=e(14),f=e(28),a=e(78),r=function r(c){return function(t,n,e){var r,o=s(t),i=f(o.length),u=a(e,i);if(c&&n!=n){for(;u=e.length?{value:undefined,done:!0}:(t=o(e,r),n.index+=t.length,{value:t,done:!1})})},function(t,n,e){"use strict";var o=e(60).IteratorPrototype,i=e(20),u=e(18),c=e(32),s=e(22),f=function f(){return this};t.exports=function(t,n,e){var r=n+" Iterator";return t.prototype=i(o,{next:u(1,e)}),c(t,r,!1,!0),s[r]=f,t}},function(t,n,e){"use strict";var r=e(5);t.exports=!r(function(){function t(){}return t.prototype.constructor=null,Object.getPrototypeOf(new t)!==t.prototype})},function(t,n,e){"use strict";var r=e(7);t.exports=function(t){if(!r(t)&&null!==t)throw TypeError("Can't set "+String(t)+" as a prototype");return t}},function(t,n,e){"use strict";var r=e(0),o=e(108),i=e(109),u=e(6),c=e(1),s=c("iterator"),f=c("toStringTag"),a=i.values;for(var l in o){var p=r[l],d=p&&p.prototype;if(d){if(d[s]!==a)try{u(d,s,a)}catch(v){d[s]=a}if(d[f]||u(d,f,l),o[l])for(var y in i)if(d[y]!==i[y])try{u(d,y,i[y])}catch(v){d[y]=i[y]}}}},function(t,n,e){"use strict";t.exports={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0}},function(t,n,e){"use strict";var r=e(14),o=e(110),i=e(22),u=e(16),c=e(59),s="Array Iterator",f=u.set,a=u.getterFor(s);t.exports=c(Array,"Array",function(t,n){f(this,{type:s,target:r(t),index:0,kind:n})},function(){var t=a(this),n=t.target,e=t.kind,r=t.index++;return!n||r>=n.length?(t.target=undefined,{value:undefined,done:!0}):"keys"==e?{value:r,done:!1}:"values"==e?{value:n[r],done:!1}:{value:[r,n[r]],done:!1}},"values"),i.Arguments=i.Array,o("keys"),o("values"),o("entries")},function(t,n,e){"use strict";var r=e(1),o=e(20),i=e(6),u=r("unscopables"),c=Array.prototype;c[u]==undefined&&i(c,u,o(null)),t.exports=function(t){c[u][t]=!0}},function(t,n,e){"use strict";var r,o,i,u,c=e(2),s=e(15),f=e(0),a=e(11),l=e(62),p=e(10),d=e(112),y=e(32),v=e(113),h=e(7),g=e(13),b=e(114),m=e(12),x=e(33),S=e(118),O=e(63),w=e(64).set,j=e(119),P=e(65),E=e(120),A=e(23),T=e(34),M=e(46),I=e(16),k=e(51),L=e(1)("species"),_="Promise",F=I.get,C=I.set,R=I.getterFor(_),N=l,D=f.TypeError,G=f.document,B=f.process,V=f.fetch,$=B&&B.versions,W=$&&$.v8||"",z=A.f,H=z,q="process"==m(B),U=!!(G&&G.createEvent&&f.dispatchEvent),Y="unhandledrejection",J=k(_,function(){var t=N.resolve(1),n=function n(){},e=(t.constructor={})[L]=function(t){t(n,n)};return!((q||"function"==typeof PromiseRejectionEvent)&&(!s||t["finally"])&&t.then(n)instanceof e&&0!==W.indexOf("6.6")&&-1===M.indexOf("Chrome/66"))}),K=J||!S(function(t){N.all(t)["catch"](function(){})}),Q=function Q(t){var n;return!(!h(t)||"function"!=typeof(n=t.then))&&n},X=function X(p,d,y){if(!d.notified){d.notified=!0;var v=d.reactions;j(function(){for(var t=d.value,n=1==d.state,e=0;v.length>e;){var r,o,i,u=v[e++],c=n?u.ok:u.fail,s=u.resolve,f=u.reject,a=u.domain;try{c?(n||(2===d.rejection&&et(p,d),d.rejection=1),!0===c?r=t:(a&&a.enter(),r=c(t),a&&(a.exit(),i=!0)),r===u.promise?f(D("Promise-chain cycle")):(o=Q(r))?o.call(r,s,f):s(r)):f(t)}catch(l){a&&!i&&a.exit(),f(l)}}d.reactions=[],d.notified=!1,y&&!d.rejection&&tt(p,d)})}},Z=function Z(t,n,e){var r,o;U?((r=G.createEvent("Event")).promise=n,r.reason=e,r.initEvent(t,!1,!0),f.dispatchEvent(r)):r={promise:n,reason:e},(o=f["on"+t])?o(r):t===Y&&E("Unhandled promise rejection",e)},tt=function tt(e,r){w.call(f,function(){var t,n=r.value;if(nt(r)&&(t=T(function(){q?B.emit("unhandledRejection",n,e):Z(Y,e,n)}),r.rejection=q||nt(r)?2:1,t.error))throw t.value})},nt=function nt(t){return 1!==t.rejection&&!t.parent},et=function et(t,n){w.call(f,function(){q?B.emit("rejectionHandled",t):Z("rejectionhandled",t,n.value)})},rt=function rt(n,e,r,o){return function(t){n(e,r,t,o)}},ot=function ot(t,n,e,r){n.done||(n.done=!0,r&&(n=r),n.value=e,n.state=2,X(t,n,!0))},it=function it(e,r,o,t){if(!r.done){r.done=!0,t&&(r=t);try{if(e===o)throw D("Promise can't be resolved itself");var i=Q(o);i?j(function(){var t={done:!1};try{i.call(o,rt(it,e,t,r),rt(ot,e,t,r))}catch(n){ot(e,t,n,r)}}):(r.value=o,r.state=1,X(e,r,!1))}catch(n){ot(e,{done:!1},n,r)}}};J&&(N=function(t){b(this,N,_),g(t),r.call(this);var n=F(this);try{t(rt(it,this,n),rt(ot,this,n))}catch(e){ot(this,n,e)}},(r=function(t){C(this,{type:_,done:!1,notified:!1,parent:!1,reactions:[],rejection:!1,state:0,value:undefined})}).prototype=d(N.prototype,{then:function(t,n){var e=R(this),r=z(O(this,N));return r.ok="function"!=typeof t||t,r.fail="function"==typeof n&&n,r.domain=q?B.domain:undefined,e.parent=!0,e.reactions.push(r),0!=e.state&&X(this,e,!1),r.promise},"catch":function(t){return this.then(undefined,t)}}),o=function o(){var t=new r,n=F(t);this.promise=t,this.resolve=rt(it,t,n),this.reject=rt(ot,t,n)},A.f=z=function z(t){return t===N||t===i?new o(t):H(t)},s||"function"!=typeof l||(u=l.prototype.then,p(l.prototype,"then",function(t,n){var e=this;return new N(function(t,n){u.call(e,t,n)}).then(t,n)},{unsafe:!0}),"function"==typeof V&&c({global:!0,enumerable:!0,forced:!0},{fetch:function(t){return P(N,V.apply(f,arguments))}}))),c({global:!0,wrap:!0,forced:J},{Promise:N}),y(N,_,!1,!0),v(_),i=a[_],c({target:_,stat:!0,forced:J},{reject:function(t){var n=z(this);return n.reject.call(undefined,t),n.promise}}),c({target:_,stat:!0,forced:s||J},{resolve:function(t){return P(s&&this===i?N:this,t)}}),c({target:_,stat:!0,forced:K},{all:function(t){var c=this,n=z(c),s=n.resolve,f=n.reject,e=T(function(){var r=g(c.resolve),o=[],i=0,u=1;x(t,function(t){var n=i++,e=!1;o.push(undefined),u++,r.call(c,t).then(function(t){e||(e=!0,o[n]=t,--u||s(o))},f)}),--u||s(o)});return e.error&&f(e.value),n.promise},race:function(t){var e=this,r=z(e),o=r.reject,n=T(function(){var n=g(e.resolve);x(t,function(t){n.call(e,t).then(r.resolve,o)})});return n.error&&o(n.value),r.promise}})},function(t,n,e){"use strict";var o=e(10);t.exports=function(t,n,e){for(var r in n)o(t,r,n[r],e);return t}},function(t,n,e){"use strict";var r=e(17),o=e(9),i=e(1),u=e(4),c=i("species");t.exports=function(t){var n=r(t),e=o.f;u&&n&&!n[c]&&e(n,c,{configurable:!0,get:function(){return this}})}},function(t,n,e){"use strict";t.exports=function(t,n,e){if(!(t instanceof n))throw TypeError("Incorrect "+(e?e+" ":"")+"invocation");return t}},function(t,n,e){"use strict";var r=e(1),o=e(22),i=r("iterator"),u=Array.prototype;t.exports=function(t){return t!==undefined&&(o.Array===t||u[i]===t)}},function(t,n,e){"use strict";var r=e(57),o=e(22),i=e(1)("iterator");t.exports=function(t){if(t!=undefined)return t[i]||t["@@iterator"]||o[r(t)]}},function(t,n,e){"use strict";var u=e(3);t.exports=function(t,n,e,r){try{return r?n(u(e)[0],e[1]):n(e)}catch(i){var o=t["return"];throw o!==undefined&&u(o.call(t)),i}}},function(t,n,e){"use strict";var o=e(1)("iterator"),i=!1;try{var r=0,u={next:function(){return{done:!!r++}},"return":function(){i=!0}};u[o]=function(){return this},Array.from(u,function(){throw 2})}catch(c){}t.exports=function(t,n){if(!n&&!i)return!1;var e=!1;try{var r={};r[o]=function(){return{next:function(){return{done:e=!0}}}},t(r)}catch(c){}return e}},function(t,n,e){"use strict";var r,o,i,u,c,s,f,a,l=e(0),p=e(24).f,d=e(12),y=e(64).set,v=e(46),h=l.MutationObserver||l.WebKitMutationObserver,g=l.process,b=l.Promise,m="process"==d(g),x=p(l,"queueMicrotask"),S=x&&x.value;S||(r=function r(){var t,n;for(m&&(t=g.domain)&&t.exit();o;){n=o.fn,o=o.next;try{n()}catch(e){throw o?u():i=undefined,e}}i=undefined,t&&t.enter()},u=m?function u(){g.nextTick(r)}:h&&!/(iphone|ipod|ipad).*applewebkit/i.test(v)?(c=!0,s=document.createTextNode(""),new h(r).observe(s,{characterData:!0}),function u(){s.data=c=!c}):b&&b.resolve?(f=b.resolve(undefined),a=f.then,function u(){a.call(f,r)}):function u(){y.call(l,r)}),t.exports=S||function(t){var n={fn:t,next:undefined};i&&(i.next=n),o||(o=n,u()),i=n}},function(t,n,e){"use strict";var r=e(0);t.exports=function(t,n){var e=r.console;e&&e.error&&(1===arguments.length?e.error(t):e.error(t,n))}},function(t,n,e){"use strict";var r=e(2),o=e(15),i=e(62),u=e(17),c=e(63),s=e(65),f=e(10);r({target:"Promise",proto:!0,real:!0},{"finally":function(n){var e=c(this,u("Promise")),t="function"==typeof n;return this.then(t?function(t){return s(e,n()).then(function(){return t})}:n,t?function(t){return s(e,n()).then(function(){throw t})}:n)}}),o||"function"!=typeof i||i.prototype["finally"]||f(i.prototype,"finally",u("Promise").prototype["finally"])},function(t,n,e){"use strict";var r=e(2),o=e(4),i=e(45),u=e(61),c=e(20),s=e(9),f=e(18),a=e(33),l=e(6),p=e(3),d=e(16),y=d.set,v=d.getterFor("AggregateError"),h=function(t,n){var e=this;if(!(e instanceof h))return new h(t,n);u&&(e=u(new Error(n),i(e)));var r=[];return a(t,r.push,r),o?y(e,{errors:r,type:"AggregateError"}):e.errors=r,n!==undefined&&l(e,"message",String(n)),e};h.prototype=c(Error.prototype,{constructor:f(5,h),message:f(5,""),name:f(5,"AggregateError"),toString:f(5,function(){var t=p(this).name;t=t===undefined?"AggregateError":String(t);var n=this.message;return t+": "+(n=n===undefined?"":String(n))})}),o&&s.f(h.prototype,"errors",{get:function(){return v(this).errors},configurable:!0}),r({global:!0},{AggregateError:h})},function(t,n,e){"use strict";e(66)},function(t,n,e){"use strict";var r=e(2),o=e(23),i=e(34);r({target:"Promise",stat:!0},{"try":function(t){var n=o.f(this),e=i(t);return(e.error?n.reject:n.resolve)(e.value),n.promise}})},function(t,n,e){"use strict";var r=e(2),l=e(13),p=e(17),o=e(23),i=e(34),d=e(33),y="No one promise resolved";r({target:"Promise",stat:!0},{any:function(t){var s=this,n=o.f(s),f=n.resolve,a=n.reject,e=i(function(){var r=l(s.resolve),o=[],i=0,u=1,c=!1;d(t,function(t){var n=i++,e=!1;o.push(undefined),u++,r.call(s,t).then(function(t){e||c||(c=!0,f(t))},function(t){e||c||(e=!0,o[n]=t,--u||a(new(p("AggregateError"))(o,y)))})}),--u||a(new(p("AggregateError"))(o,y))});return e.error&&a(e.value),n.promise}})},function(t,n,e){"use strict";t.exports=e(127)},function(t,n,e){"use strict";e(128);var r=e(11);t.exports=r.Object.getOwnPropertySymbols},function(t,n,e){"use strict";function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function o(n,t){h(n);var e=b(t),r=O(e).concat(dt(e));return B(r,function(t){a&&!pt.call(e,t)||lt(n,t,e[t])}),n}function i(t,n){var e=b(t),r=m(n,!0);if(e!==U||!d(nt,r)||d(et,r)){var o=Q(e,r);return!o||!d(nt,r)||d(e,V)&&e[V][r]||(o.enumerable=!0),o}}function u(t){var n=Z(b(t)),e=[];return B(n,function(t){d(nt,t)||d(_,t)||e.push(t)}),e}var c=e(2),s=e(0),f=e(15),a=e(4),l=e(55),p=e(5),d=e(8),y=e(54),v=e(7),h=e(3),g=e(21),b=e(14),m=e(37),x=e(18),S=e(20),O=e(44),w=e(41),j=e(129),P=e(43),E=e(24),A=e(9),T=e(35),M=e(6),I=e(10),k=e(19),L=e(26),_=e(27),F=e(40),C=e(1),R=e(67),N=e(130),D=e(32),G=e(16),B=e(53).forEach,V=L("hidden"),$="Symbol",W="prototype",z=C("toPrimitive"),H=G.set,q=G.getterFor($),U=Object[W],Y=s.Symbol,J=s.JSON,K=J&&J.stringify,Q=E.f,X=A.f,Z=j.f,tt=T.f,nt=k("symbols"),et=k("op-symbols"),rt=k("string-to-symbol-registry"),ot=k("symbol-to-string-registry"),it=k("wks"),ut=s.QObject,ct=!ut||!ut[W]||!ut[W].findChild,st=a&&p(function(){return 7!=S(X({},"a",{get:function(){return X(this,"a",{value:7}).a}})).a})?function(t,n,e){var r=Q(U,n);r&&delete U[n],X(t,n,e),r&&t!==U&&X(U,n,r)}:X,ft=function ft(t,n){var e=nt[t]=S(Y[W]);return H(e,{type:$,tag:t,description:n}),a||(e.description=n),e},at=l&&"symbol"==r(Y.iterator)?function(t){return"symbol"==r(t)}:function(t){return Object(t)instanceof Y},lt=function(t,n,e){t===U&<(et,n,e),h(t);var r=m(n,!0);return h(e),d(nt,r)?(e.enumerable?(d(t,V)&&t[V][r]&&(t[V][r]=!1),e=S(e,{enumerable:x(0,!1)})):(d(t,V)||X(t,V,x(1,{})),t[V][r]=!0),st(t,r,e)):X(t,r,e)},pt=function(t){var n=m(t,!0),e=tt.call(this,n);return!(this===U&&d(nt,n)&&!d(et,n))&&(!(e||!d(this,n)||!d(nt,n)||d(this,V)&&this[V][n])||e)},dt=function(t){var n=t===U,e=Z(n?et:b(t)),r=[];return B(e,function(t){!d(nt,t)||n&&!d(U,t)||r.push(nt[t])}),r};l||(I((Y=function(){if(this instanceof Y)throw TypeError("Symbol is not a constructor");var t=arguments.length&&arguments[0]!==undefined?String(arguments[0]):undefined,n=F(t),e=function e(t){this===U&&e.call(et,t),d(this,V)&&d(this[V],n)&&(this[V][n]=!1),st(this,n,x(1,t))};return a&&ct&&st(U,n,{configurable:!0,set:e}),ft(n,t)})[W],"toString",function(){return q(this).tag}),T.f=pt,A.f=lt,E.f=i,w.f=j.f=u,P.f=dt,a&&(X(Y[W],"description",{configurable:!0,get:function(){return q(this).description}}),f||I(U,"propertyIsEnumerable",pt,{unsafe:!0})),R.f=function(t){return ft(C(t),t)}),c({global:!0,wrap:!0,forced:!l,sham:!l},{Symbol:Y}),B(O(it),function(t){N(t)}),c({target:$,stat:!0,forced:!l},{"for":function(t){var n=String(t);if(d(rt,n))return rt[n];var e=Y(n);return rt[n]=e,ot[e]=n,e},keyFor:function(t){if(!at(t))throw TypeError(t+" is not a symbol");if(d(ot,t))return ot[t]},useSetter:function(){ct=!0},useSimple:function(){ct=!1}}),c({target:"Object",stat:!0,forced:!l,sham:!a},{create:function(t,n){return n===undefined?S(t):o(S(t),n)},defineProperty:lt,defineProperties:o,getOwnPropertyDescriptor:i}),c({target:"Object",stat:!0,forced:!l},{getOwnPropertyNames:u,getOwnPropertySymbols:dt}),c({target:"Object",stat:!0,forced:p(function(){P.f(1)})},{getOwnPropertySymbols:function(t){return P.f(g(t))}}),J&&c({target:"JSON",stat:!0,forced:!l||p(function(){var t=Y();return"[null]"!=K([t])||"{}"!=K({a:t})||"{}"!=K(Object(t))})},{stringify:function(t){for(var e,r,n=[t],o=1;o]*>)/g,v=/\$([$&'`]|\d\d?)/g,I=function I(t){return t===undefined?t:String(t)};r("replace",2,function(o,x,S){return[function(t,n){var e=i(this),r=t==undefined?undefined:t[o];return r!==undefined?r.call(t,e,n):x.call(String(e),t,n)},function(t,n){var e=S(x,t,this,n);if(e.done)return e.value;var r=w(t),o=String(this),i="function"==typeof n;i||(n=String(n));var u=r.global;if(u){var c=r.unicode;r.lastIndex=0}for(var s=[];;){var f=A(r,o);if(null===f)break;if(s.push(f),!u)break;""===String(f[0])&&(r.lastIndex=E(o,j(r.lastIndex),c))}for(var a="",l=0,p=0;p")}),b=!d(function(){var t=/(?:)/,n=t.exec;t.exec=function(){return n.apply(this,arguments)};var e="ab".split(t);return 2!==e.length||"a"!==e[0]||"b"!==e[1]});t.exports=function(e,t,n,r){var o=y(e),i=!d(function(){var t={};return t[o]=function(){return 7},7!=""[e](t)}),u=i&&!d(function(){var t=!1,n=/a/;return n.exec=function(){return t=!0,null},"split"===e&&(n.constructor={},n.constructor[h]=function(){return n}),n[o](""),!t});if(!i||!u||"replace"===e&&!g||"split"===e&&!b){var c=/./[o],s=n(o,""[e],function(t,n,e,r,o){return n.exec===v?i&&!o?{done:!0,value:c.call(n,e,r)}:{done:!0,value:t.call(e,n,r)}:{done:!1}}),f=s[0],a=s[1];p(String.prototype,e,f),p(RegExp.prototype,o,2==t?function(t,n){return a.call(t,this,n)}:function(t){return a.call(t,this)}),r&&l(RegExp.prototype[o],"sham",!0)}}},function(t,n,e){"use strict";var r=e(3);t.exports=function(){var t=r(this),n="";return t.global&&(n+="g"),t.ignoreCase&&(n+="i"),t.multiline&&(n+="m"),t.dotAll&&(n+="s"),t.unicode&&(n+="u"),t.sticky&&(n+="y"),n}},function(t,n,e){"use strict";var r=e(58).charAt;t.exports=function(t,n,e){return n+(e?r(t,n).length:1)}},function(t,n,e){"use strict";function o(t){return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var i=e(12),u=e(68);t.exports=function(t,n){var e=t.exec;if("function"==typeof e){var r=e.call(t,n);if("object"!==o(r))throw TypeError("RegExp exec method returned something other than an Object or null");return r}if("RegExp"!==i(t))throw TypeError("RegExp#exec called on incompatible receiver");return u.call(t,n)}},function(t,n,e){"use strict";var r=function c(t){if(t&&t.__esModule)return t;var n=u();if(n&&n.has(t))return n.get(t);var e={};if(null!=t){var r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in t)if(Object.prototype.hasOwnProperty.call(t,o)){var i=r?Object.getOwnPropertyDescriptor(t,o):null;i&&(i.get||i.set)?Object.defineProperty(e,o,i):e[o]=t[o]}}e["default"]=t,n&&n.set(t,e);return e}(e(139));function u(){if("function"!=typeof WeakMap)return null;var t=new WeakMap;return u=function(){return t},t}BI=BI.extend(BI,{Decorators:r})},function(t,n,e){"use strict";function i(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function u(t,n,e){return n in t?Object.defineProperty(t,n,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[n]=e,t}function c(t,n){t.prototype=Object.create(n.prototype),function u(t,n){for(var e=Object.getOwnPropertyNames(n),r=0;r>>0;if(0===len)return-1;var n=0|fromIndex;if(n>=len)return-1;for(k=Math.max(n>=0?n:len-Math.abs(n),0);k>>0;if(0===len)return-1;for(n=len-1,arguments.length>1&&(n=Number(arguments[1]),n!=n?n=0:0!=n&&n!=1/0&&n!=-(1/0)&&(n=(n>0||-1)*Math.floor(Math.abs(n)))),k=n>=0?Math.min(n,len-1):len-Math.abs(n);k>=0;k--)if(k in t&&t[k]===searchElement)return k;return-1}),_global.console=_global.console||function(){var c={};return c.log=c.warn=c.debug=c.info=c.error=c.time=c.dir=c.profile=c.clear=c.exception=c.trace=c.assert=function(){},c}(),_global.localStorage||(_global.localStorage={items:{},setItem:function(k,v){BI.Cache.addCookie(k,v)},getItem:function(k){return BI.Cache.getCookie(k)},removeItem:function(k){BI.Cache.deleteCookie(k)},key:function(){},clear:function(){this.items={}}}),Object.keys||(Object.keys=function(o){if(o!==Object(o))throw new TypeError("Object.keys called on a non-object");var falsy,skipArray={__ob__:falsy,$accessors:falsy,$vbthis:falsy,$vbsetter:falsy},k=[],p;for(p in o)p in skipArray||Object.prototype.hasOwnProperty.call(o,p)&&k.push(p);return k}),Array.isArray||(Array.isArray=function(arg){return"[object Array]"===Object.prototype.toString.call(arg)}),"function"!=typeof Object.getPrototypeOf&&(Object.getPrototypeOf="".__proto__===String.prototype?function(object){return object.__proto__}:function(object){return object.constructor.prototype}),Date.now||(Date.now=function(){return(new Date).valueOf()}),"undefined"!=typeof Set&&Set.toString().match(/native code/)||(Set=function(){this.set={}},Set.prototype.has=function(key){return void 0!==this.set[key]},Set.prototype.add=function(key){this.set[key]=1},Set.prototype.clear=function(){this.set={}}),!function(window){var ua=window.navigator.userAgent.toLowerCase(),reg=/msie/;if(reg.test(ua)){var _sort=Array.prototype.sort;Array.prototype.sort=function(fn){if(fn&&"function"==typeof fn){if(this.length<2)return this;for(var i=0,j=i+1,l=this.length,tmp,r=!1,t=0;i0,r===!0&&(tmp=this[i],this[i]=this[j],this[j]=tmp);return this}return _sort.call(this)}}}(window);var _global;_global="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,null==_global.BI&&(_global.BI={prepares:[]}),null==_global.BI.prepares&&(_global.BI.prepares=[]),function(){function apply(func,thisArg,args){switch(args.length){case 0:return func.call(thisArg);case 1:return func.call(thisArg,args[0]);case 2:return func.call(thisArg,args[0],args[1]);case 3:return func.call(thisArg,args[0],args[1],args[2])}return func.apply(thisArg,args)}function arrayAggregator(array,setter,iteratee,accumulator){for(var index=-1,length=null==array?0:array.length;++index-1}function arrayIncludesWith(array,value,comparator){for(var index=-1,length=null==array?0:array.length;++index-1;);return index}function charsEndIndex(strSymbols,chrSymbols){for(var index=strSymbols.length;index--&&baseIndexOf(chrSymbols,strSymbols[index],0)>-1;);return index}function countHolders(array,placeholder){for(var length=array.length,result=0;length--;)array[length]===placeholder&&++result;return result}function getValue(object,key){return null==object?undefined:object[key]}function hasUnicode(string){return reHasUnicode.test(string)}function iteratorToArray(iterator){for(var data,result=[];!(data=iterator.next()).done;)result.push(data.value);return result}function mapToArray(map){var index=-1,result=Array(map.size);return map.forEach(function(value,key){result[++index]=[key,value]}),result}function overArg(func,transform){return function(arg){return func(transform(arg))}}function replaceHolders(array,placeholder){for(var index=-1,length=array.length,resIndex=0,result=[];++index-1}function listCacheSet(key,value){var data=this.__data__,index=assocIndexOf(data,key);return index<0?(++this.size,data.push([key,value])):data[index][1]=value,this}function MapCache(entries){var index=-1,length=null==entries?0:entries.length;for(this.clear();++index=lower?number:lower)),number}function baseClone(value,bitmask,customizer,key,object,stack){var result,isDeep=bitmask&CLONE_DEEP_FLAG,isFlat=bitmask&CLONE_FLAT_FLAG,isFull=bitmask&CLONE_SYMBOLS_FLAG;if(customizer&&(result=object?customizer(value,key,object,stack):customizer(value)),result!==undefined)return result;if(!isObject(value))return value;var isArr=isArray(value);if(isArr){if(result=initCloneArray(value),!isDeep)return copyArray(value,result)}else{var tag=getTag(value),isFunc=tag==funcTag||tag==genTag;if(isBuffer(value))return cloneBuffer(value,isDeep);if(tag==objectTag||tag==argsTag||isFunc&&!object){if(result=isFlat||isFunc?{}:initCloneObject(value),!isDeep)return isFlat?copySymbolsIn(value,baseAssignIn(result,value)):copySymbols(value,baseAssign(result,value))}else{if(!cloneableTags[tag])return object?value:{};result=initCloneByTag(value,tag,isDeep)}}stack||(stack=new Stack);var stacked=stack.get(value);if(stacked)return stacked;if(stack.set(value,result),isSet(value))return value.forEach(function(subValue){result.add(baseClone(subValue,bitmask,customizer,subValue,value,stack))}),result;if(isMap(value))return value.forEach(function(subValue,key){result.set(key,baseClone(subValue,bitmask,customizer,key,value,stack))}),result;var keysFunc=isFull?isFlat?getAllKeysIn:getAllKeys:isFlat?keysIn:keys,props=isArr?undefined:keysFunc(value);return arrayEach(props||value,function(subValue,key){props&&(key=subValue,subValue=value[key]),assignValue(result,key,baseClone(subValue,bitmask,customizer,key,value,stack))}),result}function baseDelay(func,wait,args){if("function"!=typeof func)throw new TypeError(FUNC_ERROR_TEXT);return setTimeout(function(){func.apply(undefined,args)},wait)}function baseDifference(array,values,iteratee,comparator){var index=-1,includes=arrayIncludes,isCommon=!0,length=array.length,result=[],valuesLength=values.length;if(!length)return result;iteratee&&(values=arrayMap(values,baseUnary(iteratee))),comparator?(includes=arrayIncludesWith,isCommon=!1):values.length>=LARGE_ARRAY_SIZE&&(includes=cacheHas,isCommon=!1,values=new SetCache(values));outer:for(;++index0&&predicate(value)?depth>1?baseFlatten(value,depth-1,predicate,isStrict,result):arrayPush(result,value):isStrict||(result[result.length]=value)}return result}function baseForOwn(object,iteratee){return object&&baseFor(object,iteratee,keys)}function baseForOwnRight(object,iteratee){return object&&baseForRight(object,iteratee,keys)}function baseFunctions(object,props){return arrayFilter(props,function(key){return isFunction(object[key])})}function baseGet(object,path){path=castPath(path,object);for(var index=0,length=path.length;null!=object&&indexother}function baseHas(object,key){return null!=object&&hasOwnProperty.call(object,key)}function baseHasIn(object,key){return null!=object&&key in Object(object)}function baseIntersection(arrays,iteratee,comparator){for(var includes=comparator?arrayIncludesWith:arrayIncludes,length=arrays[0].length,othLength=arrays.length,othIndex=othLength,caches=Array(othLength),maxLength=1/0,result=[];othIndex--;){var array=arrays[othIndex];othIndex&&iteratee&&(array=arrayMap(array,baseUnary(iteratee))),maxLength=nativeMin(array.length,maxLength),caches[othIndex]=!comparator&&(iteratee||length>=120&&array.length>=120)?new SetCache(othIndex&&array):undefined}array=arrays[0];var index=-1,seen=caches[0];outer:for(;++indexlength?0:length+start),end=end>length?length:end,end<0&&(end+=length),length=start>end?0:end-start>>>0,start>>>=0;for(var result=Array(length);++index=LARGE_ARRAY_SIZE){var set=iteratee?null:createSet(array);if(set)return setToArray(set);isCommon=!1,includes=cacheHas,seen=new SetCache}else seen=iteratee?[]:result;outer:for(;++index=length?array:baseSlice(array,start,end)}function cloneBuffer(buffer,isDeep){if(isDeep)return buffer.slice();var length=buffer.length,result=allocUnsafe?allocUnsafe(length):new buffer.constructor(length);return buffer.copy(result),result}function cloneArrayBuffer(arrayBuffer){var result=new arrayBuffer.constructor(arrayBuffer.byteLength);return new Uint8Array(result).set(new Uint8Array(arrayBuffer)), +result}function cloneDataView(dataView,isDeep){var buffer=isDeep?cloneArrayBuffer(dataView.buffer):dataView.buffer;return new dataView.constructor(buffer,dataView.byteOffset,dataView.byteLength)}function cloneRegExp(regexp){var result=new regexp.constructor(regexp.source,reFlags.exec(regexp));return result.lastIndex=regexp.lastIndex,result}function cloneSymbol(symbol){return symbolValueOf?Object(symbolValueOf.call(symbol)):{}}function cloneTypedArray(typedArray,isDeep){var buffer=isDeep?cloneArrayBuffer(typedArray.buffer):typedArray.buffer;return new typedArray.constructor(buffer,typedArray.byteOffset,typedArray.length)}function compareAscending(value,other){if(value!==other){var valIsDefined=value!==undefined,valIsNull=null===value,valIsReflexive=value===value,valIsSymbol=isSymbol(value),othIsDefined=other!==undefined,othIsNull=null===other,othIsReflexive=other===other,othIsSymbol=isSymbol(other);if(!othIsNull&&!othIsSymbol&&!valIsSymbol&&value>other||valIsSymbol&&othIsDefined&&othIsReflexive&&!othIsNull&&!othIsSymbol||valIsNull&&othIsDefined&&othIsReflexive||!valIsDefined&&othIsReflexive||!valIsReflexive)return 1;if(!valIsNull&&!valIsSymbol&&!othIsSymbol&&value=ordersLength)return result;var order=orders[index];return result*("desc"==order?-1:1)}}return object.index-other.index}function composeArgs(args,partials,holders,isCurried){for(var argsIndex=-1,argsLength=args.length,holdersLength=holders.length,leftIndex=-1,leftLength=partials.length,rangeLength=nativeMax(argsLength-holdersLength,0),result=Array(leftLength+rangeLength),isUncurried=!isCurried;++leftIndex1?sources[length-1]:undefined,guard=length>2?sources[2]:undefined;for(customizer=assigner.length>3&&"function"==typeof customizer?(length--,customizer):undefined,guard&&isIterateeCall(sources[0],sources[1],guard)&&(customizer=length<3?undefined:customizer,length=1),object=Object(object);++index-1?iterable[iteratee?collection[index]:index]:undefined}}function createHybrid(func,bitmask,thisArg,partials,holders,partialsRight,holdersRight,argPos,ary,arity){function wrapper(){for(var length=arguments.length,args=Array(length),index=length;index--;)args[index]=arguments[index];if(isCurried)var placeholder=getHolder(wrapper),holdersCount=countHolders(args,placeholder);if(partials&&(args=composeArgs(args,partials,holders,isCurried)),partialsRight&&(args=composeArgsRight(args,partialsRight,holdersRight,isCurried)),length-=holdersCount,isCurried&&length1&&args.reverse(),isAry&&aryarrLength))return!1;var stacked=stack.get(array);if(stacked&&stack.get(other))return stacked==other;var index=-1,result=!0,seen=bitmask&COMPARE_UNORDERED_FLAG?new SetCache:undefined;for(stack.set(array,other),stack.set(other,array);++index1?"& ":"")+details[lastIndex],details=details.join(length>2?", ":" "),source.replace(reWrapComment,"{\n/* [wrapped with "+details+"] */\n")}function isFlattenable(value){return isArray(value)||isArguments(value)||!!(spreadableSymbol&&value&&value[spreadableSymbol])}function isIndex(value,length){var type=typeof value;return length=null==length?MAX_SAFE_INTEGER:length,!!length&&("number"==type||"symbol"!=type&&reIsUint.test(value))&&value>-1&&value%1==0&&value0){if(++count>=HOT_COUNT)return arguments[0]}else count=0;return func.apply(undefined,arguments)}}function toKey(value){if("string"==typeof value||isSymbol(value))return value;var result=value+"";return"0"==result&&1/value==-INFINITY?"-0":result}function toSource(func){if(null!=func){try{return funcToString.call(func)}catch(e){}try{return func+""}catch(e){}}return""}function updateWrapDetails(details,bitmask){return arrayEach(wrapFlags,function(pair){var value="_."+pair[0];bitmask&pair[1]&&!arrayIncludes(details,value)&&details.push(value)}),details.sort()}function wrapperClone(wrapper){if(wrapper instanceof LazyWrapper)return wrapper.clone();var result=new LodashWrapper(wrapper.__wrapped__,wrapper.__chain__);return result.__actions__=copyArray(wrapper.__actions__),result.__index__=wrapper.__index__,result.__values__=wrapper.__values__,result}function compact(array){for(var index=-1,length=null==array?0:array.length,resIndex=0,result=[];++index=this.__values__.length,value=done?undefined:this.__values__[this.__index__++];return{done:done,value:value}}function wrapperToIterator(){return this}function wrapperPlant(value){for(var result,parent=this;parent instanceof baseLodash;){var clone=wrapperClone(parent);clone.__index__=0,clone.__values__=undefined,result?previous.__wrapped__=clone:result=clone;var previous=clone;parent=parent.__wrapped__}return previous.__wrapped__=value,result}function wrapperReverse(){var value=this.__wrapped__;if(value instanceof LazyWrapper){var wrapped=value;return this.__actions__.length&&(wrapped=new LazyWrapper(this)),wrapped=wrapped.reverse(),wrapped.__actions__.push({func:thru,args:[reverse],thisArg:undefined}),new LodashWrapper(wrapped,this.__chain__)}return this.thru(reverse)}function wrapperValue(){return baseWrapperValue(this.__wrapped__,this.__actions__)}function every(collection,predicate,guard){var func=isArray(collection)?arrayEvery:baseEvery;return guard&&isIterateeCall(collection,predicate,guard)&&(predicate=undefined),func(collection,baseIteratee(predicate,3))}function filter(collection,predicate){var func=isArray(collection)?arrayFilter:baseFilter;return func(collection,baseIteratee(predicate,3))}function forEach(collection,iteratee){var func=isArray(collection)?arrayEach:baseEach;return func(collection,baseIteratee(iteratee,3))}function map(collection,iteratee){var func=isArray(collection)?arrayMap:baseMap;return func(collection,baseIteratee(iteratee,3))}function reduce(collection,iteratee,accumulator){var func=isArray(collection)?arrayReduce:baseReduce,initAccum=arguments.length<3;return func(collection,baseIteratee(iteratee,4),accumulator,initAccum,baseEach)}function reject(collection,predicate){var func=isArray(collection)?arrayFilter:baseFilter;return func(collection,negate(baseIteratee(predicate,3)))}function size(collection){if(null==collection)return 0;if(isArrayLike(collection))return isString(collection)?stringSize(collection):collection.length;var tag=getTag(collection);return tag==mapTag||tag==setTag?collection.size:baseKeys(collection).length}function some(collection,predicate,guard){var func=isArray(collection)?arraySome:baseSome;return guard&&isIterateeCall(collection,predicate,guard)&&(predicate=undefined),func(collection,baseIteratee(predicate,3))}function before(n,func){var result;if("function"!=typeof func)throw new TypeError(FUNC_ERROR_TEXT);return n=toInteger(n),function(){return--n>0&&(result=func.apply(this,arguments)),n<=1&&(func=undefined),result}}function debounce(func,wait,options){function invokeFunc(time){var args=lastArgs,thisArg=lastThis;return lastArgs=lastThis=undefined,lastInvokeTime=time,result=func.apply(thisArg,args)}function leadingEdge(time){return lastInvokeTime=time,timerId=setTimeout(timerExpired,wait),leading?invokeFunc(time):result}function remainingWait(time){var timeSinceLastCall=time-lastCallTime,timeSinceLastInvoke=time-lastInvokeTime,timeWaiting=wait-timeSinceLastCall;return maxing?nativeMin(timeWaiting,maxWait-timeSinceLastInvoke):timeWaiting}function shouldInvoke(time){var timeSinceLastCall=time-lastCallTime,timeSinceLastInvoke=time-lastInvokeTime;return lastCallTime===undefined||timeSinceLastCall>=wait||timeSinceLastCall<0||maxing&&timeSinceLastInvoke>=maxWait}function timerExpired(){var time=now();return shouldInvoke(time)?trailingEdge(time):void(timerId=setTimeout(timerExpired,remainingWait(time)))}function trailingEdge(time){return timerId=undefined,trailing&&lastArgs?invokeFunc(time):(lastArgs=lastThis=undefined,result)}function cancel(){timerId!==undefined&&clearTimeout(timerId),lastInvokeTime=0,lastArgs=lastCallTime=lastThis=timerId=undefined}function flush(){return timerId===undefined?result:trailingEdge(now())}function debounced(){var time=now(),isInvoking=shouldInvoke(time);if(lastArgs=arguments,lastThis=this,lastCallTime=time,isInvoking){if(timerId===undefined)return leadingEdge(lastCallTime);if(maxing)return timerId=setTimeout(timerExpired,wait),invokeFunc(lastCallTime)}return timerId===undefined&&(timerId=setTimeout(timerExpired,wait)),result}var lastArgs,lastThis,maxWait,result,timerId,lastCallTime,lastInvokeTime=0,leading=!1,maxing=!1,trailing=!0;if("function"!=typeof func)throw new TypeError(FUNC_ERROR_TEXT);return wait=toNumber(wait)||0,isObject(options)&&(leading=!!options.leading,maxing="maxWait"in options,maxWait=maxing?nativeMax(toNumber(options.maxWait)||0,wait):maxWait,trailing="trailing"in options?!!options.trailing:trailing),debounced.cancel=cancel,debounced.flush=flush,debounced}function memoize(func,resolver){if("function"!=typeof func||null!=resolver&&"function"!=typeof resolver)throw new TypeError(FUNC_ERROR_TEXT);var memoized=function(){var args=arguments,key=resolver?resolver.apply(this,args):args[0],cache=memoized.cache;if(cache.has(key))return cache.get(key);var result=func.apply(this,args);return memoized.cache=cache.set(key,result)||cache,result};return memoized.cache=new(memoize.Cache||MapCache), +memoized}function negate(predicate){if("function"!=typeof predicate)throw new TypeError(FUNC_ERROR_TEXT);return function(){var args=arguments;switch(args.length){case 0:return!predicate.call(this);case 1:return!predicate.call(this,args[0]);case 2:return!predicate.call(this,args[0],args[1]);case 3:return!predicate.call(this,args[0],args[1],args[2])}return!predicate.apply(this,args)}}function once(func){return before(2,func)}function rest(func,start){if("function"!=typeof func)throw new TypeError(FUNC_ERROR_TEXT);return start=start===undefined?start:toInteger(start),baseRest(func,start)}function throttle(func,wait,options){var leading=!0,trailing=!0;if("function"!=typeof func)throw new TypeError(FUNC_ERROR_TEXT);return isObject(options)&&(leading="leading"in options?!!options.leading:leading,trailing="trailing"in options?!!options.trailing:trailing),debounce(func,wait,{leading:leading,maxWait:wait,trailing:trailing})}function clone(value){return baseClone(value,CLONE_SYMBOLS_FLAG)}function cloneDeep(value){return baseClone(value,CLONE_DEEP_FLAG|CLONE_SYMBOLS_FLAG)}function eq(value,other){return value===other||value!==value&&other!==other}function isArrayLike(value){return null!=value&&isLength(value.length)&&!isFunction(value)}function isArrayLikeObject(value){return isObjectLike(value)&&isArrayLike(value)}function isBoolean(value){return value===!0||value===!1||isObjectLike(value)&&baseGetTag(value)==boolTag}function isEmpty(value){if(null==value)return!0;if(isArrayLike(value)&&(isArray(value)||"string"==typeof value||"function"==typeof value.splice||isBuffer(value)||isTypedArray(value)||isArguments(value)))return!value.length;var tag=getTag(value);if(tag==mapTag||tag==setTag)return!value.size;if(isPrototype(value))return!baseKeys(value).length;for(var key in value)if(hasOwnProperty.call(value,key))return!1;return!0}function isEqual(value,other){return baseIsEqual(value,other)}function isFinite(value){return"number"==typeof value&&nativeIsFinite(value)}function isFunction(value){if(!isObject(value))return!1;var tag=baseGetTag(value);return tag==funcTag||tag==genTag||tag==asyncTag||tag==proxyTag}function isLength(value){return"number"==typeof value&&value>-1&&value%1==0&&value<=MAX_SAFE_INTEGER}function isObject(value){var type=typeof value;return null!=value&&("object"==type||"function"==type)}function isObjectLike(value){return null!=value&&"object"==typeof value}function isNaN(value){return isNumber(value)&&value!=+value}function isNull(value){return null===value}function isNumber(value){return"number"==typeof value||isObjectLike(value)&&baseGetTag(value)==numberTag}function isPlainObject(value){if(!isObjectLike(value)||baseGetTag(value)!=objectTag)return!1;var proto=getPrototype(value);if(null===proto)return!0;var Ctor=hasOwnProperty.call(proto,"constructor")&&proto.constructor;return"function"==typeof Ctor&&Ctor instanceof Ctor&&funcToString.call(Ctor)==objectCtorString}function isString(value){return"string"==typeof value||!isArray(value)&&isObjectLike(value)&&baseGetTag(value)==stringTag}function isSymbol(value){return"symbol"==typeof value||isObjectLike(value)&&baseGetTag(value)==symbolTag}function isUndefined(value){return value===undefined}function toArray(value){if(!value)return[];if(isArrayLike(value))return isString(value)?stringToArray(value):copyArray(value);if(symIterator&&value[symIterator])return iteratorToArray(value[symIterator]());var tag=getTag(value),func=tag==mapTag?mapToArray:tag==setTag?setToArray:values;return func(value)}function toFinite(value){if(!value)return 0===value?value:0;if(value=toNumber(value),value===INFINITY||value===-INFINITY){var sign=value<0?-1:1;return sign*MAX_INTEGER}return value===value?value:0}function toInteger(value){var result=toFinite(value),remainder=result%1;return result===result?remainder?result-remainder:result:0}function toNumber(value){if("number"==typeof value)return value;if(isSymbol(value))return NAN;if(isObject(value)){var other="function"==typeof value.valueOf?value.valueOf():value;value=isObject(other)?other+"":other}if("string"!=typeof value)return 0===value?value:+value;value=value.replace(reTrim,"");var isBinary=reIsBinary.test(value);return isBinary||reIsOctal.test(value)?freeParseInt(value.slice(2),isBinary?2:8):reIsBadHex.test(value)?NAN:+value}function toPlainObject(value){return copyObject(value,keysIn(value))}function toString(value){return null==value?"":baseToString(value)}function create(prototype,properties){var result=baseCreate(prototype);return null==properties?result:baseAssign(result,properties)}function findKey(object,predicate){return baseFindKey(object,baseIteratee(predicate,3),baseForOwn)}function findLastKey(object,predicate){return baseFindKey(object,baseIteratee(predicate,3),baseForOwnRight)}function get(object,path,defaultValue){var result=null==object?undefined:baseGet(object,path);return result===undefined?defaultValue:result}function has(object,path){return null!=object&&hasPath(object,path,baseHas)}function hasIn(object,path){return null!=object&&hasPath(object,path,baseHasIn)}function keys(object){return isArrayLike(object)?arrayLikeKeys(object):baseKeys(object)}function keysIn(object){return isArrayLike(object)?arrayLikeKeys(object,!0):baseKeysIn(object)}function omitBy(object,predicate){return pickBy(object,negate(baseIteratee(predicate)))}function pickBy(object,predicate){if(null==object)return{};var props=arrayMap(getAllKeysIn(object),function(prop){return[prop]});return predicate=baseIteratee(predicate),basePickBy(object,props,function(value,path){return predicate(value,path[0])})}function result(object,path,defaultValue){path=castPath(path,object);var index=-1,length=path.length;for(length||(length=1,object=undefined);++indexupper){var temp=lower;lower=upper,upper=temp}if(floating||lower%1||upper%1){var rand=nativeRandom();return nativeMin(lower+rand*(upper-lower+freeParseFloat("1e-"+((rand+"").length-1))),upper)}return baseRandom(lower,upper)}function escape(string){return string=toString(string),string&&reHasUnescapedHtml.test(string)?string.replace(reUnescapedHtml,escapeHtmlChar):string}function trim(string,chars,guard){if(string=toString(string),string&&(guard||chars===undefined))return string.replace(reTrim,"");if(!string||!(chars=baseToString(chars)))return string;var strSymbols=stringToArray(string),chrSymbols=stringToArray(chars),start=charsStartIndex(strSymbols,chrSymbols),end=charsEndIndex(strSymbols,chrSymbols)+1;return castSlice(strSymbols,start,end).join("")}function constant(value){return function(){return value}}function identity(value){return value}function iteratee(func){return baseIteratee("function"==typeof func?func:baseClone(func,CLONE_DEEP_FLAG))}function matches(source){return baseMatches(baseClone(source,CLONE_DEEP_FLAG))}function mixin(object,source,options){var props=keys(source),methodNames=baseFunctions(source,props);null!=options||isObject(source)&&(methodNames.length||!props.length)||(options=source,source=object,object=this,methodNames=baseFunctions(source,keys(source)));var chain=!(isObject(options)&&"chain"in options&&!options.chain),isFunc=isFunction(object);return arrayEach(methodNames,function(methodName){var func=source[methodName];object[methodName]=func,isFunc&&(object.prototype[methodName]=function(){var chainAll=this.__chain__;if(chain||chainAll){var result=object(this.__wrapped__),actions=result.__actions__=copyArray(this.__actions__);return actions.push({func:func,args:arguments,thisArg:object}),result.__chain__=chainAll,result}return func.apply(object,arrayPush([this.value()],arguments))})}),object}function noConflict(){return root._===this&&(root._=oldDash),this}function noop(){}function property(path){return isKey(path)?baseProperty(toKey(path)):basePropertyDeep(path)}function stubArray(){return[]}function stubFalse(){return!1}function uniqueId(prefix){var id=++idCounter;return toString(prefix)+id}function max(array){return array&&array.length?baseExtremum(array,identity,baseGt):undefined}function min(array){return array&&array.length?baseExtremum(array,identity,baseLt):undefined}var undefined,VERSION="4.17.5",LARGE_ARRAY_SIZE=200,FUNC_ERROR_TEXT="Expected a function",HASH_UNDEFINED="__lodash_hash_undefined__",MAX_MEMOIZE_SIZE=500,PLACEHOLDER="__lodash_placeholder__",CLONE_DEEP_FLAG=1,CLONE_FLAT_FLAG=2,CLONE_SYMBOLS_FLAG=4,COMPARE_PARTIAL_FLAG=1,COMPARE_UNORDERED_FLAG=2,WRAP_BIND_FLAG=1,WRAP_BIND_KEY_FLAG=2,WRAP_CURRY_BOUND_FLAG=4,WRAP_CURRY_FLAG=8,WRAP_CURRY_RIGHT_FLAG=16,WRAP_PARTIAL_FLAG=32,WRAP_PARTIAL_RIGHT_FLAG=64,WRAP_ARY_FLAG=128,WRAP_REARG_FLAG=256,WRAP_FLIP_FLAG=512,HOT_COUNT=800,HOT_SPAN=16,LAZY_FILTER_FLAG=1,LAZY_MAP_FLAG=2,LAZY_WHILE_FLAG=3,INFINITY=1/0,MAX_SAFE_INTEGER=9007199254740991,MAX_INTEGER=1.7976931348623157e308,NAN=NaN,MAX_ARRAY_LENGTH=4294967295,wrapFlags=[["ary",WRAP_ARY_FLAG],["bind",WRAP_BIND_FLAG],["bindKey",WRAP_BIND_KEY_FLAG],["curry",WRAP_CURRY_FLAG],["curryRight",WRAP_CURRY_RIGHT_FLAG],["flip",WRAP_FLIP_FLAG],["partial",WRAP_PARTIAL_FLAG],["partialRight",WRAP_PARTIAL_RIGHT_FLAG],["rearg",WRAP_REARG_FLAG]],argsTag="[object Arguments]",arrayTag="[object Array]",asyncTag="[object AsyncFunction]",boolTag="[object Boolean]",dateTag="[object Date]",errorTag="[object Error]",funcTag="[object Function]",genTag="[object GeneratorFunction]",mapTag="[object Map]",numberTag="[object Number]",nullTag="[object Null]",objectTag="[object Object]",promiseTag="[object Promise]",proxyTag="[object Proxy]",regexpTag="[object RegExp]",setTag="[object Set]",stringTag="[object String]",symbolTag="[object Symbol]",undefinedTag="[object Undefined]",weakMapTag="[object WeakMap]",arrayBufferTag="[object ArrayBuffer]",dataViewTag="[object DataView]",float32Tag="[object Float32Array]",float64Tag="[object Float64Array]",int8Tag="[object Int8Array]",int16Tag="[object Int16Array]",int32Tag="[object Int32Array]",uint8Tag="[object Uint8Array]",uint8ClampedTag="[object Uint8ClampedArray]",uint16Tag="[object Uint16Array]",uint32Tag="[object Uint32Array]",reUnescapedHtml=/[&<>"']/g,reHasUnescapedHtml=RegExp(reUnescapedHtml.source),reIsDeepProp=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,reIsPlainProp=/^\w*$/,rePropName=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,reRegExpChar=/[\\^$.*+?()[\]{}|]/g,reTrim=/^\s+|\s+$/g,reWrapComment=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,reWrapDetails=/\{\n\/\* \[wrapped with (.+)\] \*/,reSplitDetails=/,? & /,reEscapeChar=/\\(\\)?/g,reFlags=/\w*$/,reIsBadHex=/^[-+]0x[0-9a-f]+$/i,reIsBinary=/^0b[01]+$/i,reIsHostCtor=/^\[object .+?Constructor\]$/,reIsOctal=/^0o[0-7]+$/i,reIsUint=/^(?:0|[1-9]\d*)$/,rsAstralRange="\\ud800-\\udfff",rsComboMarksRange="\\u0300-\\u036f",reComboHalfMarksRange="\\ufe20-\\ufe2f",rsComboSymbolsRange="\\u20d0-\\u20ff",rsComboRange=rsComboMarksRange+reComboHalfMarksRange+rsComboSymbolsRange,rsVarRange="\\ufe0e\\ufe0f",rsAstral="["+rsAstralRange+"]",rsCombo="["+rsComboRange+"]",rsFitz="\\ud83c[\\udffb-\\udfff]",rsModifier="(?:"+rsCombo+"|"+rsFitz+")",rsNonAstral="[^"+rsAstralRange+"]",rsRegional="(?:\\ud83c[\\udde6-\\uddff]){2}",rsSurrPair="[\\ud800-\\udbff][\\udc00-\\udfff]",rsZWJ="\\u200d",reOptMod=rsModifier+"?",rsOptVar="["+rsVarRange+"]?",rsOptJoin="(?:"+rsZWJ+"(?:"+[rsNonAstral,rsRegional,rsSurrPair].join("|")+")"+rsOptVar+reOptMod+")*",rsSeq=rsOptVar+reOptMod+rsOptJoin,rsSymbol="(?:"+[rsNonAstral+rsCombo+"?",rsCombo,rsRegional,rsSurrPair,rsAstral].join("|")+")",reUnicode=RegExp(rsFitz+"(?="+rsFitz+")|"+rsSymbol+rsSeq,"g"),reHasUnicode=RegExp("["+rsZWJ+rsAstralRange+rsComboRange+rsVarRange+"]"),typedArrayTags={};typedArrayTags[float32Tag]=typedArrayTags[float64Tag]=typedArrayTags[int8Tag]=typedArrayTags[int16Tag]=typedArrayTags[int32Tag]=typedArrayTags[uint8Tag]=typedArrayTags[uint8ClampedTag]=typedArrayTags[uint16Tag]=typedArrayTags[uint32Tag]=!0,typedArrayTags[argsTag]=typedArrayTags[arrayTag]=typedArrayTags[arrayBufferTag]=typedArrayTags[boolTag]=typedArrayTags[dataViewTag]=typedArrayTags[dateTag]=typedArrayTags[errorTag]=typedArrayTags[funcTag]=typedArrayTags[mapTag]=typedArrayTags[numberTag]=typedArrayTags[objectTag]=typedArrayTags[regexpTag]=typedArrayTags[setTag]=typedArrayTags[stringTag]=typedArrayTags[weakMapTag]=!1;var cloneableTags={};cloneableTags[argsTag]=cloneableTags[arrayTag]=cloneableTags[arrayBufferTag]=cloneableTags[dataViewTag]=cloneableTags[boolTag]=cloneableTags[dateTag]=cloneableTags[float32Tag]=cloneableTags[float64Tag]=cloneableTags[int8Tag]=cloneableTags[int16Tag]=cloneableTags[int32Tag]=cloneableTags[mapTag]=cloneableTags[numberTag]=cloneableTags[objectTag]=cloneableTags[regexpTag]=cloneableTags[setTag]=cloneableTags[stringTag]=cloneableTags[symbolTag]=cloneableTags[uint8Tag]=cloneableTags[uint8ClampedTag]=cloneableTags[uint16Tag]=cloneableTags[uint32Tag]=!0,cloneableTags[errorTag]=cloneableTags[funcTag]=cloneableTags[weakMapTag]=!1;var htmlEscapes={"&":"&","<":"<",">":">",'"':""","'":"'"},freeParseFloat=parseFloat,freeParseInt=parseInt,freeGlobal="object"==typeof global&&global&&global.Object===Object&&global,freeSelf="object"==typeof self&&self&&self.Object===Object&&self,root=freeGlobal||freeSelf||Function("return this")(),freeExports="object"==typeof exports&&exports&&!exports.nodeType&&exports,freeModule=freeExports&&"object"==typeof module&&module&&!module.nodeType&&module,moduleExports=freeModule&&freeModule.exports===freeExports,freeProcess=moduleExports&&freeGlobal.process,nodeUtil=function(){try{return freeProcess&&freeProcess.binding&&freeProcess.binding("util")}catch(e){}}(),nodeIsDate=nodeUtil&&nodeUtil.isDate,nodeIsMap=nodeUtil&&nodeUtil.isMap,nodeIsRegExp=nodeUtil&&nodeUtil.isRegExp,nodeIsSet=nodeUtil&&nodeUtil.isSet,nodeIsTypedArray=nodeUtil&&nodeUtil.isTypedArray,asciiSize=baseProperty("length"),escapeHtmlChar=basePropertyOf(htmlEscapes),arrayProto=Array.prototype,funcProto=Function.prototype,objectProto=Object.prototype,coreJsData=root["__core-js_shared__"],funcToString=funcProto.toString,hasOwnProperty=objectProto.hasOwnProperty,idCounter=0,maskSrcKey=function(){var uid=/[^.]+$/.exec(coreJsData&&coreJsData.keys&&coreJsData.keys.IE_PROTO||"");return uid?"Symbol(src)_1."+uid:""}(),nativeObjectToString=objectProto.toString,objectCtorString=funcToString.call(Object),oldDash=root._,reIsNative=RegExp("^"+funcToString.call(hasOwnProperty).replace(reRegExpChar,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Buffer=moduleExports?root.Buffer:undefined,Symbol=root.Symbol,Uint8Array=root.Uint8Array,allocUnsafe=Buffer?Buffer.allocUnsafe:undefined,getPrototype=overArg(Object.getPrototypeOf,Object),objectCreate=Object.create,propertyIsEnumerable=objectProto.propertyIsEnumerable,splice=arrayProto.splice,spreadableSymbol=Symbol?Symbol.isConcatSpreadable:undefined,symIterator=Symbol?Symbol.iterator:undefined,symToStringTag=Symbol?Symbol.toStringTag:undefined,defineProperty=function(){try{var func=getNative(Object,"defineProperty");return func({},"",{}),func}catch(e){}}(),nativeCeil=Math.ceil,nativeFloor=Math.floor,nativeGetSymbols=Object.getOwnPropertySymbols,nativeIsBuffer=Buffer?Buffer.isBuffer:undefined,nativeIsFinite=root.isFinite,nativeKeys=overArg(Object.keys,Object),nativeMax=Math.max,nativeMin=Math.min,nativeNow=Date.now,nativeRandom=Math.random,nativeReverse=arrayProto.reverse,DataView=getNative(root,"DataView"),Map=getNative(root,"Map"),Promise=getNative(root,"Promise"),Set=getNative(root,"Set"),WeakMap=getNative(root,"WeakMap"),nativeCreate=getNative(Object,"create"),metaMap=WeakMap&&new WeakMap,realNames={},dataViewCtorString=toSource(DataView),mapCtorString=toSource(Map),promiseCtorString=toSource(Promise),setCtorString=toSource(Set),weakMapCtorString=toSource(WeakMap),symbolProto=Symbol?Symbol.prototype:undefined,symbolValueOf=symbolProto?symbolProto.valueOf:undefined,symbolToString=symbolProto?symbolProto.toString:undefined,baseCreate=function(){function object(){}return function(proto){if(!isObject(proto))return{};if(objectCreate)return objectCreate(proto);object.prototype=proto;var result=new object;return object.prototype=undefined,result}}();lodash.prototype=baseLodash.prototype,lodash.prototype.constructor=lodash,LodashWrapper.prototype=baseCreate(baseLodash.prototype),LodashWrapper.prototype.constructor=LodashWrapper,LazyWrapper.prototype=baseCreate(baseLodash.prototype),LazyWrapper.prototype.constructor=LazyWrapper,Hash.prototype.clear=hashClear,Hash.prototype["delete"]=hashDelete,Hash.prototype.get=hashGet,Hash.prototype.has=hashHas,Hash.prototype.set=hashSet,ListCache.prototype.clear=listCacheClear,ListCache.prototype["delete"]=listCacheDelete,ListCache.prototype.get=listCacheGet,ListCache.prototype.has=listCacheHas,ListCache.prototype.set=listCacheSet,MapCache.prototype.clear=mapCacheClear,MapCache.prototype["delete"]=mapCacheDelete,MapCache.prototype.get=mapCacheGet,MapCache.prototype.has=mapCacheHas,MapCache.prototype.set=mapCacheSet,SetCache.prototype.add=SetCache.prototype.push=setCacheAdd,SetCache.prototype.has=setCacheHas,Stack.prototype.clear=stackClear,Stack.prototype["delete"]=stackDelete,Stack.prototype.get=stackGet,Stack.prototype.has=stackHas,Stack.prototype.set=stackSet;var baseEach=createBaseEach(baseForOwn),baseFor=createBaseFor(),baseForRight=createBaseFor(!0),baseSetData=metaMap?function(func,data){return metaMap.set(func,data),func}:identity,baseSetToString=defineProperty?function(func,string){return defineProperty(func,"toString",{configurable:!0,enumerable:!1,value:constant(string),writable:!0})}:identity,createSet=Set&&1/setToArray(new Set([,-0]))[1]==INFINITY?function(values){return new Set(values)}:noop,getData=metaMap?function(func){return metaMap.get(func)}:noop,getSymbols=nativeGetSymbols?function(object){return null==object?[]:(object=Object(object),arrayFilter(nativeGetSymbols(object),function(symbol){return propertyIsEnumerable.call(object,symbol)}))}:stubArray,getSymbolsIn=nativeGetSymbols?function(object){for(var result=[];object;)arrayPush(result,getSymbols(object)),object=getPrototype(object);return result}:stubArray,getTag=baseGetTag;(DataView&&getTag(new DataView(new ArrayBuffer(1)))!=dataViewTag||Map&&getTag(new Map)!=mapTag||Promise&&getTag(Promise.resolve())!=promiseTag||Set&&getTag(new Set)!=setTag||WeakMap&&getTag(new WeakMap)!=weakMapTag)&&(getTag=function(value){var result=baseGetTag(value),Ctor=result==objectTag?value.constructor:undefined,ctorString=Ctor?toSource(Ctor):"";if(ctorString)switch(ctorString){case dataViewCtorString:return dataViewTag;case mapCtorString:return mapTag;case promiseCtorString:return promiseTag;case setCtorString:return setTag;case weakMapCtorString:return weakMapTag}return result});var setData=shortOut(baseSetData),setToString=shortOut(baseSetToString),stringToPath=memoizeCapped(function(string){var result=[];return 46===string.charCodeAt(0)&&result.push(""),string.replace(rePropName,function(match,number,quote,subString){result.push(quote?subString.replace(reEscapeChar,"$1"):number||match)}),result}),difference=baseRest(function(array,values){return isArrayLikeObject(array)?baseDifference(array,baseFlatten(values,1,isArrayLikeObject,!0)):[]}),intersection=baseRest(function(arrays){var mapped=arrayMap(arrays,castArrayLikeObject);return mapped.length&&mapped[0]===arrays[0]?baseIntersection(mapped):[]}),union=baseRest(function(arrays){return baseUniq(baseFlatten(arrays,1,isArrayLikeObject,!0))}),without=baseRest(function(array,values){return isArrayLikeObject(array)?baseDifference(array,values):[]}),zip=baseRest(unzip),wrapperAt=flatRest(function(paths){var length=paths.length,start=length?paths[0]:0,value=this.__wrapped__,interceptor=function(object){return baseAt(object,paths)};return!(length>1||this.__actions__.length)&&value instanceof LazyWrapper&&isIndex(start)?(value=value.slice(start,+start+(length?1:0)),value.__actions__.push({func:thru,args:[interceptor],thisArg:undefined}),new LodashWrapper(value,this.__chain__).thru(function(array){return length&&!array.length&&array.push(undefined),array})):this.thru(interceptor)}),countBy=createAggregator(function(result,value,key){hasOwnProperty.call(result,key)?++result[key]:baseAssignValue(result,key,1)}),find=createFind(findIndex),groupBy=createAggregator(function(result,value,key){hasOwnProperty.call(result,key)?result[key].push(value):baseAssignValue(result,key,[value])}),sortBy=baseRest(function(collection,iteratees){if(null==collection)return[];var length=iteratees.length;return length>1&&isIterateeCall(collection,iteratees[0],iteratees[1])?iteratees=[]:length>2&&isIterateeCall(iteratees[0],iteratees[1],iteratees[2])&&(iteratees=[iteratees[0]]),baseOrderBy(collection,baseFlatten(iteratees,1),[])}),now=function(){return root.Date.now()},bind=baseRest(function(func,thisArg,partials){var bitmask=WRAP_BIND_FLAG;if(partials.length){var holders=replaceHolders(partials,getHolder(bind));bitmask|=WRAP_PARTIAL_FLAG}return createWrap(func,bitmask,thisArg,partials,holders)}),defer=baseRest(function(func,args){return baseDelay(func,1,args)}),delay=baseRest(function(func,wait,args){return baseDelay(func,toNumber(wait)||0,args)});memoize.Cache=MapCache;var isArguments=baseIsArguments(function(){return arguments}())?baseIsArguments:function(value){return isObjectLike(value)&&hasOwnProperty.call(value,"callee")&&!propertyIsEnumerable.call(value,"callee")},isArray=Array.isArray,isBuffer=nativeIsBuffer||stubFalse,isDate=nodeIsDate?baseUnary(nodeIsDate):baseIsDate,isMap=nodeIsMap?baseUnary(nodeIsMap):baseIsMap,isRegExp=nodeIsRegExp?baseUnary(nodeIsRegExp):baseIsRegExp,isSet=nodeIsSet?baseUnary(nodeIsSet):baseIsSet,isTypedArray=nodeIsTypedArray?baseUnary(nodeIsTypedArray):baseIsTypedArray,assignIn=createAssigner(function(object,source){copyObject(source,keysIn(source),object)}),defaults=baseRest(function(object,sources){object=Object(object);var index=-1,length=sources.length,guard=length>2?sources[2]:undefined;for(guard&&isIterateeCall(sources[0],sources[1],guard)&&(length=1);++index1),path}),copyObject(object,getAllKeysIn(object),result),isDeep&&(result=baseClone(result,CLONE_DEEP_FLAG|CLONE_FLAT_FLAG|CLONE_SYMBOLS_FLAG,customOmitClone));for(var length=paths.length;length--;)baseUnset(result,paths[length]);return result}),pick=flatRest(function(object,paths){return null==object?{}:basePick(object,paths)}),range=createRange();lodash.assignIn=assignIn,lodash.before=before,lodash.bind=bind,lodash.chain=chain,lodash.compact=compact,lodash.concat=concat,lodash.countBy=countBy,lodash.create=create,lodash.debounce=debounce,lodash.defaults=defaults,lodash.defaultsDeep=defaultsDeep,lodash.defer=defer,lodash.delay=delay,lodash.difference=difference,lodash.drop=drop,lodash.filter=filter,lodash.flatten=flatten,lodash.flattenDeep=flattenDeep,lodash.groupBy=groupBy,lodash.initial=initial,lodash.intersection=intersection,lodash.invert=invert,lodash.invertBy=invertBy,lodash.iteratee=iteratee,lodash.keys=keys,lodash.map=map,lodash.matches=matches,lodash.merge=merge,lodash.mixin=mixin,lodash.negate=negate,lodash.omit=omit,lodash.omitBy=omitBy,lodash.once=once,lodash.pick=pick,lodash.range=range,lodash.reject=reject,lodash.rest=rest,lodash.slice=slice,lodash.sortBy=sortBy,lodash.take=take,lodash.takeRight=takeRight,lodash.tap=tap,lodash.throttle=throttle,lodash.thru=thru,lodash.toArray=toArray,lodash.union=union,lodash.uniq=uniq,lodash.uniqBy=uniqBy,lodash.unzip=unzip,lodash.values=values,lodash.without=without,lodash.zip=zip,lodash.zipObject=zipObject,lodash.extend=assignIn,mixin(lodash,lodash),lodash.clamp=clamp,lodash.clone=clone,lodash.cloneDeep=cloneDeep,lodash.escape=escape,lodash.every=every,lodash.find=find,lodash.findIndex=findIndex,lodash.findKey=findKey,lodash.findLastIndex=findLastIndex,lodash.findLastKey=findLastKey,lodash.forEach=forEach,lodash.get=get,lodash.has=has,lodash.head=head,lodash.identity=identity,lodash.indexOf=indexOf,lodash.isArguments=isArguments,lodash.isArray=isArray,lodash.isArrayLike=isArrayLike,lodash.isBoolean=isBoolean,lodash.isDate=isDate,lodash.isEmpty=isEmpty,lodash.isEqual=isEqual,lodash.isFinite=isFinite,lodash.isFunction=isFunction,lodash.isNaN=isNaN,lodash.isNull=isNull,lodash.isNumber=isNumber,lodash.isObject=isObject,lodash.isPlainObject=isPlainObject,lodash.isRegExp=isRegExp,lodash.isString=isString,lodash.isUndefined=isUndefined,lodash.last=last,lodash.max=max,lodash.min=min,lodash.noConflict=noConflict,lodash.noop=noop,lodash.random=random,lodash.reduce=reduce,lodash.result=result,lodash.size=size,lodash.some=some,lodash.trim=trim,lodash.uniqueId=uniqueId,lodash.each=forEach,lodash.first=head,mixin(lodash,function(){var source={};return baseForOwn(lodash,function(func,methodName){hasOwnProperty.call(lodash.prototype,methodName)||(source[methodName]=func)}),source}(),{chain:!1}),lodash.VERSION=VERSION,arrayEach(["drop","take"],function(methodName,index){LazyWrapper.prototype[methodName]=function(n){n=n===undefined?1:nativeMax(toInteger(n),0);var result=this.__filtered__&&!index?new LazyWrapper(this):this.clone();return result.__filtered__?result.__takeCount__=nativeMin(n,result.__takeCount__):result.__views__.push({size:nativeMin(n,MAX_ARRAY_LENGTH),type:methodName+(result.__dir__<0?"Right":"")}),result},LazyWrapper.prototype[methodName+"Right"]=function(n){return this.reverse()[methodName](n).reverse()}}),arrayEach(["filter","map","takeWhile"],function(methodName,index){var type=index+1,isFilter=type==LAZY_FILTER_FLAG||type==LAZY_WHILE_FLAG;LazyWrapper.prototype[methodName]=function(iteratee){var result=this.clone();return result.__iteratees__.push({iteratee:getIteratee(iteratee,3),type:type}),result.__filtered__=result.__filtered__||isFilter,result}}),arrayEach(["head","last"],function(methodName,index){var takeName="take"+(index?"Right":"");LazyWrapper.prototype[methodName]=function(){return this[takeName](1).value()[0]}}),arrayEach(["initial","tail"],function(methodName,index){var dropName="drop"+(index?"":"Right");LazyWrapper.prototype[methodName]=function(){return this.__filtered__?new LazyWrapper(this):this[dropName](1)}}),LazyWrapper.prototype.compact=function(){return this.filter(identity)},LazyWrapper.prototype.find=function(predicate){return this.filter(predicate).head()},LazyWrapper.prototype.findLast=function(predicate){return this.reverse().find(predicate)},LazyWrapper.prototype.invokeMap=baseRest(function(path,args){return"function"==typeof path?new LazyWrapper(this):this.map(function(value){return baseInvoke(value,path,args)})}),LazyWrapper.prototype.reject=function(predicate){return this.filter(negate(getIteratee(predicate)))},LazyWrapper.prototype.slice=function(start,end){start=toInteger(start);var result=this;return result.__filtered__&&(start>0||end<0)?new LazyWrapper(result):(start<0?result=result.takeRight(-start):start&&(result=result.drop(start)),end!==undefined&&(end=toInteger(end),result=end<0?result.dropRight(-end):result.take(end-start)),result)},LazyWrapper.prototype.takeRightWhile=function(predicate){return this.reverse().takeWhile(predicate).reverse()},LazyWrapper.prototype.toArray=function(){return this.take(MAX_ARRAY_LENGTH)},baseForOwn(LazyWrapper.prototype,function(func,methodName){var checkIteratee=/^(?:filter|find|map|reject)|While$/.test(methodName),isTaker=/^(?:head|last)$/.test(methodName),lodashFunc=lodash[isTaker?"take"+("last"==methodName?"Right":""):methodName],retUnwrapped=isTaker||/^find/.test(methodName);lodashFunc&&(lodash.prototype[methodName]=function(){var value=this.__wrapped__,args=isTaker?[1]:arguments,isLazy=value instanceof LazyWrapper,iteratee=args[0],useLazy=isLazy||isArray(value),interceptor=function(value){var result=lodashFunc.apply(lodash,arrayPush([value],args));return isTaker&&chainAll?result[0]:result};useLazy&&checkIteratee&&"function"==typeof iteratee&&1!=iteratee.length&&(isLazy=useLazy=!1);var chainAll=this.__chain__,isHybrid=!!this.__actions__.length,isUnwrapped=retUnwrapped&&!chainAll,onlyLazy=isLazy&&!isHybrid;if(!retUnwrapped&&useLazy){value=onlyLazy?value:new LazyWrapper(this);var result=func.apply(value,args);return result.__actions__.push({func:thru,args:[interceptor],thisArg:undefined}),new LodashWrapper(result,chainAll)}return isUnwrapped&&onlyLazy?func.apply(this,args):(result=this.thru(interceptor),isUnwrapped?isTaker?result.value()[0]:result.value():result)})}),arrayEach(["pop","push","shift","sort","splice","unshift"],function(methodName){var func=arrayProto[methodName],chainName=/^(?:push|sort|unshift)$/.test(methodName)?"tap":"thru",retUnwrapped=/^(?:pop|shift)$/.test(methodName);lodash.prototype[methodName]=function(){var args=arguments;if(retUnwrapped&&!this.__chain__){var value=this.value();return func.apply(isArray(value)?value:[],args)}return this[chainName](function(value){return func.apply(isArray(value)?value:[],args)})}}),baseForOwn(LazyWrapper.prototype,function(func,methodName){var lodashFunc=lodash[methodName];if(lodashFunc){var key=lodashFunc.name+"",names=realNames[key]||(realNames[key]=[]);names.push({name:methodName,func:lodashFunc})}}),realNames[createHybrid(undefined,WRAP_BIND_KEY_FLAG).name]=[{name:"wrapper",func:undefined}],LazyWrapper.prototype.clone=lazyClone,LazyWrapper.prototype.reverse=lazyReverse,LazyWrapper.prototype.value=lazyValue,lodash.prototype.first=lodash.prototype.head,symIterator&&(lodash.prototype[symIterator]=wrapperToIterator),"function"==typeof define&&"object"==typeof define.amd&&define.amd?(root._=lodash,define(function(){return lodash})):freeModule?((freeModule.exports=lodash)._=lodash,freeExports._=lodash):root._=lodash}.call(this);var _global;_global="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,_global.BI||(_global.BI={}),!function(undefined){var traverse=function(func,context){return function(value,key,obj){return func.call(context,key,value,obj); +}},_apply=function(name){return function(){return _[name].apply(_,arguments)}},_applyFunc=function(name){return function(){var args=Array.prototype.slice.call(arguments,0);return args[1]=_.isFunction(args[1])?traverse(args[1],args[2]):args[1],_[name].apply(_,args)}};_.extend(BI,{assert:function(v,is){if(this.isFunction(is)){if(is(v))return!0;throw new Error(v+" error")}if(this.isArray(is)||(is=[is]),!this.deepContains(is,v))throw new Error(v+" error")},warn:function(message){console.warn(message)},UUID:function(){for(var f=["0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f"],str="",i=0;i<16;i++){var r=parseInt(f.length*Math.random(),10);str+=f[r]}return str},isWidget:function(widget){return widget instanceof BI.Widget||BI.View&&widget instanceof BI.View},createWidgets:function(items,options,context){if(!BI.isArray(items))throw new Error("cannot create Widgets");return BI.isWidget(options)?(context=options,options={}):options||(options={}),BI.map(BI.flatten(items),function(i,item){return BI.createWidget(item,BI.deepClone(options))})},createItems:function(data,innerAttr,outerAttr){return innerAttr=BI.isArray(innerAttr)?innerAttr:BI.makeArray(BI.flatten(data).length,innerAttr||{}),outerAttr=BI.isArray(outerAttr)?outerAttr:BI.makeArray(BI.flatten(data).length,outerAttr||{}),BI.map(data,function(i,item){return BI.isArray(item)?BI.createItems(item,innerAttr,outerAttr):item instanceof BI.Widget?BI.extend({},innerAttr.shift(),outerAttr.shift(),{type:null,el:item}):innerAttr[0]instanceof BI.Widget?(outerAttr.shift(),BI.extend({},item,{el:innerAttr.shift()})):item.el instanceof BI.Widget||BI.View&&item.el instanceof BI.View?(innerAttr.shift(),BI.extend({},outerAttr.shift(),{type:null},item)):item.el?BI.extend({},outerAttr.shift(),item,{el:BI.extend({},innerAttr.shift(),item.el)}):BI.extend({},outerAttr.shift(),{el:BI.extend({},innerAttr.shift(),item)})})},packageItems:function(items,layouts){for(var i=layouts.length-1;i>=0;i--)items=BI.map(items,function(k,it){return BI.extend({},layouts[i],{items:[BI.extend({},layouts[i].el,{el:it})]})});return items},formatEL:function(obj){return obj&&!obj.type&&obj.el?obj:{el:obj}},stripEL:function(obj){return obj.type&&obj||obj.el||obj},trans2Element:function(widgets){return BI.map(widgets,function(i,wi){return wi.element})}}),_.each(["where","findWhere","invoke","pluck","shuffle","sample","toArray","size"],function(name){BI[name]=_apply(name)}),_.each(["get","each","map","reduce","reduceRight","find","filter","reject","every","all","some","any","max","min","sortBy","groupBy","indexBy","countBy","partition","clamp"],function(name){"any"===name?BI[name]=_applyFunc("some"):BI[name]=_applyFunc(name)}),_.extend(BI,{count:function(from,to,predicate){var t;if(predicate)for(t=from;t=0;index--)predicate(index,obj[index],obj);return!1},backAny:function(obj,predicate,context){predicate=BI.iteratee(predicate,context);for(var index=obj.length-1;index>=0;index--)if(predicate(index,obj[index],obj))return!0;return!1},backEvery:function(obj,predicate,context){predicate=BI.iteratee(predicate,context);for(var index=obj.length-1;index>=0;index--)if(!predicate(index,obj[index],obj))return!1;return!0},backFindKey:function(obj,predicate,context){predicate=BI.iteratee(predicate,context);for(var keys=_.keys(obj),key,i=keys.length-1;i>=0;i--)if(key=keys[i],predicate(obj[key],key,obj))return key},backFind:function(obj,predicate,context){var key;if(key=BI.isArray(obj)?BI.findLastIndex(obj,predicate,context):BI.backFindKey(obj,predicate,context),void 0!==key&&key!==-1)return obj[key]},remove:function(obj,target,context){var isFunction=BI.isFunction(target);target=isFunction||BI.isArray(target)?target:[target];var i;if(BI.isArray(obj))for(i=0;i(2147483646-str.charAt(i).charCodeAt(0)+start.charCodeAt(0))/26)return 0;return idx},int2Abc:function(num){var DIGITS=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"],idx=num,str="";if(0===num)return"";for(;0!==idx;){var t=idx%26;0===t&&(t=26),str=DIGITS[t-1]+str,idx=(idx-t)/26}return str}}),_.each(["first","initial","last","rest","compact","flatten","without","union","intersection","difference","zip","unzip","object","indexOf","lastIndexOf","sortedIndex","range","take","takeRight","uniqBy"],function(name){BI[name]=_apply(name)}),_.each(["findIndex","findLastIndex"],function(name){BI[name]=_applyFunc(name)}),_.extend(BI,{makeArray:function(length,value){for(var res=[],i=0;i0;)BI.prepares.shift()()},has:function(obj,keys){return BI.isArray(keys)?0!==keys.length&&BI.every(keys,function(i,key){return _.has(obj,key)}):_.has.apply(_,arguments)},freeze:function(value){return Object.freeze&&BI.isObject(value)?Object.freeze(value):value},isKey:function(key){return BI.isNumber(key)||BI.isString(key)&&key.length>0},isCapitalEqual:function(a,b){return a=BI.isNull(a)?a:(""+a).toLowerCase(),b=BI.isNull(b)?b:(""+b).toLowerCase(),BI.isEqual(a,b)},isWidthOrHeight:function(w){return"number"==typeof w?w>=0:"string"==typeof w?/^\d{1,3}%$/.exec(w)||"auto"==w||/^\d+px$/.exec(w):void 0},isNotNull:function(obj){return!BI.isNull(obj)},isNull:function(obj){return"undefined"==typeof obj||null===obj},isEmptyArray:function(arr){return BI.isArray(arr)&&BI.isEmpty(arr)},isNotEmptyArray:function(arr){return BI.isArray(arr)&&!BI.isEmpty(arr)},isEmptyObject:function(obj){return BI.isEqual(obj,{})},isNotEmptyObject:function(obj){return BI.isPlainObject(obj)&&!BI.isEmptyObject(obj)},isEmptyString:function(obj){return BI.isString(obj)&&0===obj.length},isNotEmptyString:function(obj){return BI.isString(obj)&&!BI.isEmptyString(obj)},isWindow:function(obj){return null!=obj&&obj==obj.window}}),_.extend(BI,{deepClone:_.cloneDeep,deepExtend:_.merge,isDeepMatch:function(object,attrs){var keys=BI.keys(attrs),length=keys.length;if(null==object)return!length;for(var obj=Object(object),i=0;i=0},deepContains:function(obj,copy){return BI.isObject(copy)?BI.any(obj,function(i,v){if(BI.isEqual(v,copy))return!0}):BI.contains(obj,copy)},deepIndexOf:function(obj,target){for(var i=0;imaxDate[0]?back=["y",1]:YY>=minDate[0]&&YY<=maxDate[0]&&(YY==minDate[0]&&(MMmaxDate[1]?back=["m",1]:MM==maxDate[1]&&DD>maxDate[2]&&(back=["d",1]))),back},checkDateLegal:function(str){var ar=str.match(/\d+/g),YY=0|ar[0],MM=0|ar[1],DD=0|ar[2];if(ar.length<=1)return!0;if(ar.length<=2)return MM>=1&&MM<=12;var MD=BI.Date._MD.slice(0);return MD[1]=BI.isLeapYear(YY)?29:28,MM>=1&&MM<=12&&DD<=MD[MM-1]},parseDateTime:function(str,fmt){var today=BI.getDate(),y=0,m=0,d=1,a=str.split(/\W+/);if("%y%x"==fmt.toLowerCase()||"%y%x%d"==fmt.toLowerCase()){var yearlength=4,otherlength=2;a[0]=str.substring(0,yearlength),a[1]=str.substring(yearlength,yearlength+otherlength),a[2]=str.substring(yearlength+otherlength,yearlength+2*otherlength)}var b=fmt.match(/%./g),i=0,j=0,hr=0,min=0,sec=0;for(i=0;i29?1900:2e3);break;case"%b":case"%B":for(j=0;j<12;++j)if(BI.Date._MN[j].substr(0,a[i].length).toLowerCase()==a[i].toLowerCase()){m=j;break}break;case"%H":case"%I":case"%k":case"%l":hr=parseInt(a[i],10);break;case"%P":case"%p":/pm/i.test(a[i])&&hr<12?hr+=12:/am/i.test(a[i])&&hr>=12&&(hr-=12);break;case"%M":min=parseInt(a[i],10);case"%S":sec=parseInt(a[i],10)}if(isNaN(y)&&(y=today.getFullYear()),isNaN(m)&&(m=today.getMonth()),isNaN(d)&&(d=today.getDate()),isNaN(hr)&&(hr=today.getHours()),isNaN(min)&&(min=today.getMinutes()),isNaN(sec)&&(sec=today.getSeconds()),0!=y)return BI.getDate(y,m,d,hr,min,sec);for(y=0,m=-1,d=0,i=0;i31&&0==y?(y=parseInt(a[i],10),y<100&&(y+=y>29?1900:2e3)):0==d&&(d=a[i]);return 0==y&&(y=today.getFullYear()),m!=-1&&0!=d?BI.getDate(y,m,d,hr,min,sec):today},getDate:function(){var length=arguments.length,args=arguments,dt;switch(length){case 0:dt=new Date;break;case 1:dt=new Date(args[0]);break;case 2:dt=new Date(args[0],args[1]);break;case 3:dt=new Date(args[0],args[1],args[2]);break;case 4:dt=new Date(args[0],args[1],args[2],args[3]);break;case 5:dt=new Date(args[0],args[1],args[2],args[3],args[4]);break;case 6:dt=new Date(args[0],args[1],args[2],args[3],args[4],args[5]);break;case 7:dt=new Date(args[0],args[1],args[2],args[3],args[4],args[5],args[6]);break;default:dt=new Date}if(BI.isNotNull(BI.timeZone)&&(0===arguments.length||1===arguments.length&&BI.isNumber(arguments[0]))){var localTime=dt.getTime(),localOffset=6e4*dt.getTimezoneOffset(),utc=localTime+localOffset;return new Date(utc+BI.timeZone)}return dt},getTime:function(){var length=arguments.length,args=arguments,dt;switch(length){case 0:dt=new Date;break;case 1:dt=new Date(args[0]);break;case 2:dt=new Date(args[0],args[1]);break;case 3:dt=new Date(args[0],args[1],args[2]);break;case 4:dt=new Date(args[0],args[1],args[2],args[3]);break;case 5:dt=new Date(args[0],args[1],args[2],args[3],args[4]);break;case 6:dt=new Date(args[0],args[1],args[2],args[3],args[4],args[5]);break;case 7:dt=new Date(args[0],args[1],args[2],args[3],args[4],args[5],args[6]);break;default:dt=new Date}return BI.isNotNull(BI.timeZone)?dt.getTime()-BI.timeZone-6e4*(new Date).getTimezoneOffset():dt.getTime()}})}(),!function(){function extend(){for(var target=arguments[0]||{},length=arguments.length,i=1,options,name,src,copy;i0;)BI.prepares.shift()();var el,w;if(item||(item={}),BI.isWidget(options)?(context=options,options={}):options||(options={}),BI.isEmpty(item)&&BI.isEmpty(options))return BI.createWidget({type:"bi.layout"});if(BI.isWidget(item))return item;if(item.type||options.type)return el=BI.extend({},options,item),w=BI.Plugin.getWidget(el.type,el),w.listeners=(w.listeners||[]).concat([{eventName:BI.Events.MOUNT,action:function(){BI.Plugin.getObject(el.type,this)}}]),w.type===el.type?createWidget(w):BI.createWidget(BI.extend({},item,{type:w.type},options));if(item.el&&(item.el.type||options.type))return el=BI.extend({},options,item.el),w=BI.Plugin.getWidget(el.type,el),w.listeners=(w.listeners||[]).concat([{eventName:BI.Events.MOUNT,action:function(){BI.Plugin.getObject(el.type,this)}}]),w.type===el.type?createWidget(w):BI.createWidget(BI.extend({},item,{type:w.type},options));if(BI.isWidget(item.el))return item.el;throw new Error("无法根据item创建组件")},BI.createElement=function(){var widget=BI.createWidget.apply(this,arguments);return widget.element}}(),!function(){BI.CRYPT_TYPE=BI.CRYPT_TYPE||{},BI.CRYPT_TYPE.AES="aes";var CryptoJS=CryptoJS||function(Math,undefined){var C={},C_lib=C.lib={},Base=C_lib.Base=function(){function F(){}return{extend:function(overrides){F.prototype=this;var subtype=new F;return overrides&&subtype.mixIn(overrides),subtype.hasOwnProperty("init")||(subtype.init=function(){subtype.$super.init.apply(this,arguments)}),subtype.init.prototype=subtype,subtype.$super=this,subtype},create:function(){var instance=this.extend();return instance.init.apply(instance,arguments),instance},init:function(){},mixIn:function(properties){for(var propertyName in properties)properties.hasOwnProperty(propertyName)&&(this[propertyName]=properties[propertyName]);properties.hasOwnProperty("toString")&&(this.toString=properties.toString)},clone:function(){return this.init.prototype.extend(this)}}}(),WordArray=C_lib.WordArray=Base.extend({init:function(words,sigBytes){words=this.words=words||[],sigBytes!=undefined?this.sigBytes=sigBytes:this.sigBytes=4*words.length},toString:function(encoder){return(encoder||Hex).stringify(this)},concat:function(wordArray){var thisWords=this.words,thatWords=wordArray.words,thisSigBytes=this.sigBytes,thatSigBytes=wordArray.sigBytes;if(this.clamp(),thisSigBytes%4)for(var i=0;i>>2]>>>24-i%4*8&255;thisWords[thisSigBytes+i>>>2]|=thatByte<<24-(thisSigBytes+i)%4*8}else if(thatWords.length>65535)for(var i=0;i>>2]=thatWords[i>>>2];else thisWords.push.apply(thisWords,thatWords);return this.sigBytes+=thatSigBytes,this},clamp:function(){var words=this.words,sigBytes=this.sigBytes;words[sigBytes>>>2]&=4294967295<<32-sigBytes%4*8,words.length=Math.ceil(sigBytes/4); +},clone:function(){var clone=Base.clone.call(this);return clone.words=this.words.slice(0),clone},random:function(nBytes){for(var words=[],i=0;i>>2]>>>24-i%4*8&255;hexChars.push((bite>>>4).toString(16)),hexChars.push((15&bite).toString(16))}return hexChars.join("")},parse:function(hexStr){for(var hexStrLength=hexStr.length,words=[],i=0;i>>3]|=parseInt(hexStr.substr(i,2),16)<<24-i%8*4;return new WordArray.init(words,hexStrLength/2)}},Latin1=C_enc.Latin1={stringify:function(wordArray){for(var words=wordArray.words,sigBytes=wordArray.sigBytes,latin1Chars=[],i=0;i>>2]>>>24-i%4*8&255;latin1Chars.push(String.fromCharCode(bite))}return latin1Chars.join("")},parse:function(latin1Str){for(var latin1StrLength=latin1Str.length,words=[],i=0;i>>2]|=(255&latin1Str.charCodeAt(i))<<24-i%4*8;return new WordArray.init(words,latin1StrLength)}},Utf8=C_enc.Utf8={stringify:function(wordArray){try{return decodeURIComponent(escape(Latin1.stringify(wordArray)))}catch(e){throw new Error("Malformed UTF-8 data")}},parse:function(utf8Str){return Latin1.parse(unescape(encodeURIComponent(utf8Str)))}},BufferedBlockAlgorithm=C_lib.BufferedBlockAlgorithm=Base.extend({reset:function(){this._data=new WordArray.init,this._nDataBytes=0},_append:function(data){"string"==typeof data&&(data=Utf8.parse(data)),this._data.concat(data),this._nDataBytes+=data.sigBytes},_process:function(doFlush){var data=this._data,dataWords=data.words,dataSigBytes=data.sigBytes,blockSize=this.blockSize,blockSizeBytes=4*blockSize,nBlocksReady=dataSigBytes/blockSizeBytes;nBlocksReady=doFlush?Math.ceil(nBlocksReady):Math.max((0|nBlocksReady)-this._minBufferSize,0);var nWordsReady=nBlocksReady*blockSize,nBytesReady=Math.min(4*nWordsReady,dataSigBytes);if(nWordsReady){for(var offset=0;offset>>2]>>>24-i%4*8&255,byte2=words[i+1>>>2]>>>24-(i+1)%4*8&255,byte3=words[i+2>>>2]>>>24-(i+2)%4*8&255,triplet=byte1<<16|byte2<<8|byte3,j=0;j<4&&i+.75*j>>6*(3-j)&63));var paddingChar=map.charAt(64);if(paddingChar)for(;base64Chars.length%4;)base64Chars.push(paddingChar);return base64Chars.join("")},parse:function(base64Str){var base64StrLength=base64Str.length,map=this._map,paddingChar=map.charAt(64);if(paddingChar){var paddingIndex=base64Str.indexOf(paddingChar);paddingIndex!=-1&&(base64StrLength=paddingIndex)}for(var words=[],nBytes=0,i=0;i>>6-i%4*2;words[nBytes>>>2]|=(bits1|bits2)<<24-nBytes%4*8,nBytes++}return WordArray.create(words,nBytes)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="}}(),function(Math){function FF(a,b,c,d,x,s,t){var n=a+(b&c|~b&d)+x+t;return(n<>>32-s)+b}function GG(a,b,c,d,x,s,t){var n=a+(b&d|c&~d)+x+t;return(n<>>32-s)+b}function HH(a,b,c,d,x,s,t){var n=a+(b^c^d)+x+t;return(n<>>32-s)+b}function II(a,b,c,d,x,s,t){var n=a+(c^(b|~d))+x+t;return(n<>>32-s)+b}var C=CryptoJS,C_lib=C.lib,WordArray=C_lib.WordArray,Hasher=C_lib.Hasher,C_algo=C.algo,T=[];!function(){for(var i=0;i<64;i++)T[i]=4294967296*Math.abs(Math.sin(i+1))|0}();var MD5=C_algo.MD5=Hasher.extend({_doReset:function(){this._hash=new WordArray.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(M,offset){for(var i=0;i<16;i++){var offset_i=offset+i,M_offset_i=M[offset_i];M[offset_i]=16711935&(M_offset_i<<8|M_offset_i>>>24)|4278255360&(M_offset_i<<24|M_offset_i>>>8)}var H=this._hash.words,M_offset_0=M[offset+0],M_offset_1=M[offset+1],M_offset_2=M[offset+2],M_offset_3=M[offset+3],M_offset_4=M[offset+4],M_offset_5=M[offset+5],M_offset_6=M[offset+6],M_offset_7=M[offset+7],M_offset_8=M[offset+8],M_offset_9=M[offset+9],M_offset_10=M[offset+10],M_offset_11=M[offset+11],M_offset_12=M[offset+12],M_offset_13=M[offset+13],M_offset_14=M[offset+14],M_offset_15=M[offset+15],a=H[0],b=H[1],c=H[2],d=H[3];a=FF(a,b,c,d,M_offset_0,7,T[0]),d=FF(d,a,b,c,M_offset_1,12,T[1]),c=FF(c,d,a,b,M_offset_2,17,T[2]),b=FF(b,c,d,a,M_offset_3,22,T[3]),a=FF(a,b,c,d,M_offset_4,7,T[4]),d=FF(d,a,b,c,M_offset_5,12,T[5]),c=FF(c,d,a,b,M_offset_6,17,T[6]),b=FF(b,c,d,a,M_offset_7,22,T[7]),a=FF(a,b,c,d,M_offset_8,7,T[8]),d=FF(d,a,b,c,M_offset_9,12,T[9]),c=FF(c,d,a,b,M_offset_10,17,T[10]),b=FF(b,c,d,a,M_offset_11,22,T[11]),a=FF(a,b,c,d,M_offset_12,7,T[12]),d=FF(d,a,b,c,M_offset_13,12,T[13]),c=FF(c,d,a,b,M_offset_14,17,T[14]),b=FF(b,c,d,a,M_offset_15,22,T[15]),a=GG(a,b,c,d,M_offset_1,5,T[16]),d=GG(d,a,b,c,M_offset_6,9,T[17]),c=GG(c,d,a,b,M_offset_11,14,T[18]),b=GG(b,c,d,a,M_offset_0,20,T[19]),a=GG(a,b,c,d,M_offset_5,5,T[20]),d=GG(d,a,b,c,M_offset_10,9,T[21]),c=GG(c,d,a,b,M_offset_15,14,T[22]),b=GG(b,c,d,a,M_offset_4,20,T[23]),a=GG(a,b,c,d,M_offset_9,5,T[24]),d=GG(d,a,b,c,M_offset_14,9,T[25]),c=GG(c,d,a,b,M_offset_3,14,T[26]),b=GG(b,c,d,a,M_offset_8,20,T[27]),a=GG(a,b,c,d,M_offset_13,5,T[28]),d=GG(d,a,b,c,M_offset_2,9,T[29]),c=GG(c,d,a,b,M_offset_7,14,T[30]),b=GG(b,c,d,a,M_offset_12,20,T[31]),a=HH(a,b,c,d,M_offset_5,4,T[32]),d=HH(d,a,b,c,M_offset_8,11,T[33]),c=HH(c,d,a,b,M_offset_11,16,T[34]),b=HH(b,c,d,a,M_offset_14,23,T[35]),a=HH(a,b,c,d,M_offset_1,4,T[36]),d=HH(d,a,b,c,M_offset_4,11,T[37]),c=HH(c,d,a,b,M_offset_7,16,T[38]),b=HH(b,c,d,a,M_offset_10,23,T[39]),a=HH(a,b,c,d,M_offset_13,4,T[40]),d=HH(d,a,b,c,M_offset_0,11,T[41]),c=HH(c,d,a,b,M_offset_3,16,T[42]),b=HH(b,c,d,a,M_offset_6,23,T[43]),a=HH(a,b,c,d,M_offset_9,4,T[44]),d=HH(d,a,b,c,M_offset_12,11,T[45]),c=HH(c,d,a,b,M_offset_15,16,T[46]),b=HH(b,c,d,a,M_offset_2,23,T[47]),a=II(a,b,c,d,M_offset_0,6,T[48]),d=II(d,a,b,c,M_offset_7,10,T[49]),c=II(c,d,a,b,M_offset_14,15,T[50]),b=II(b,c,d,a,M_offset_5,21,T[51]),a=II(a,b,c,d,M_offset_12,6,T[52]),d=II(d,a,b,c,M_offset_3,10,T[53]),c=II(c,d,a,b,M_offset_10,15,T[54]),b=II(b,c,d,a,M_offset_1,21,T[55]),a=II(a,b,c,d,M_offset_8,6,T[56]),d=II(d,a,b,c,M_offset_15,10,T[57]),c=II(c,d,a,b,M_offset_6,15,T[58]),b=II(b,c,d,a,M_offset_13,21,T[59]),a=II(a,b,c,d,M_offset_4,6,T[60]),d=II(d,a,b,c,M_offset_11,10,T[61]),c=II(c,d,a,b,M_offset_2,15,T[62]),b=II(b,c,d,a,M_offset_9,21,T[63]),H[0]=H[0]+a|0,H[1]=H[1]+b|0,H[2]=H[2]+c|0,H[3]=H[3]+d|0},_doFinalize:function(){var data=this._data,dataWords=data.words,nBitsTotal=8*this._nDataBytes,nBitsLeft=8*data.sigBytes;dataWords[nBitsLeft>>>5]|=128<<24-nBitsLeft%32;var nBitsTotalH=Math.floor(nBitsTotal/4294967296),nBitsTotalL=nBitsTotal;dataWords[(nBitsLeft+64>>>9<<4)+15]=16711935&(nBitsTotalH<<8|nBitsTotalH>>>24)|4278255360&(nBitsTotalH<<24|nBitsTotalH>>>8),dataWords[(nBitsLeft+64>>>9<<4)+14]=16711935&(nBitsTotalL<<8|nBitsTotalL>>>24)|4278255360&(nBitsTotalL<<24|nBitsTotalL>>>8),data.sigBytes=4*(dataWords.length+1),this._process();for(var hash=this._hash,H=hash.words,i=0;i<4;i++){var H_i=H[i];H[i]=16711935&(H_i<<8|H_i>>>24)|4278255360&(H_i<<24|H_i>>>8)}return hash},clone:function(){var clone=Hasher.clone.call(this);return clone._hash=this._hash.clone(),clone}});C.MD5=Hasher._createHelper(MD5),C.HmacMD5=Hasher._createHmacHelper(MD5)}(Math),function(){var C=CryptoJS,C_lib=C.lib,Base=C_lib.Base,WordArray=C_lib.WordArray,C_algo=C.algo,MD5=C_algo.MD5,EvpKDF=C_algo.EvpKDF=Base.extend({cfg:Base.extend({keySize:4,hasher:MD5,iterations:1}),init:function(cfg){this.cfg=this.cfg.extend(cfg)},compute:function(password,salt){for(var cfg=this.cfg,hasher=cfg.hasher.create(),derivedKey=WordArray.create(),derivedKeyWords=derivedKey.words,keySize=cfg.keySize,iterations=cfg.iterations;derivedKeyWords.length>>2];data.sigBytes-=nPaddingBytes}},BlockCipher=C_lib.BlockCipher=Cipher.extend({cfg:Cipher.cfg.extend({mode:CBC,padding:Pkcs7}),reset:function(){Cipher.reset.call(this);var cfg=this.cfg,iv=cfg.iv,mode=cfg.mode;if(this._xformMode==this._ENC_XFORM_MODE)var modeCreator=mode.createEncryptor;else{var modeCreator=mode.createDecryptor;this._minBufferSize=1}this._mode=modeCreator.call(mode,this,iv&&iv.words)},_doProcessBlock:function(words,offset){this._mode.processBlock(words,offset)},_doFinalize:function(){var padding=this.cfg.padding;if(this._xformMode==this._ENC_XFORM_MODE){padding.pad(this._data,this.blockSize);var finalProcessedBlocks=this._process(!0)}else{var finalProcessedBlocks=this._process(!0);padding.unpad(finalProcessedBlocks)}return finalProcessedBlocks},blockSize:4}),CipherParams=C_lib.CipherParams=Base.extend({init:function(cipherParams){this.mixIn(cipherParams)},toString:function(formatter){return(formatter||this.formatter).stringify(this)}}),C_format=C.format={},OpenSSLFormatter=C_format.OpenSSL={stringify:function(cipherParams){var ciphertext=cipherParams.ciphertext,salt=cipherParams.salt;if(salt)var wordArray=WordArray.create([1398893684,1701076831]).concat(salt).concat(ciphertext);else var wordArray=ciphertext;return wordArray.toString(Base64)},parse:function(openSSLStr){var ciphertext=Base64.parse(openSSLStr),ciphertextWords=ciphertext.words;if(1398893684==ciphertextWords[0]&&1701076831==ciphertextWords[1]){var salt=WordArray.create(ciphertextWords.slice(2,4));ciphertextWords.splice(0,4),ciphertext.sigBytes-=16}return CipherParams.create({ciphertext:ciphertext,salt:salt})}},SerializableCipher=C_lib.SerializableCipher=Base.extend({cfg:Base.extend({format:OpenSSLFormatter}),encrypt:function(cipher,message,key,cfg){cfg=this.cfg.extend(cfg);var encryptor=cipher.createEncryptor(key,cfg),ciphertext=encryptor.finalize(message),cipherCfg=encryptor.cfg;return CipherParams.create({ciphertext:ciphertext,key:key,iv:cipherCfg.iv,algorithm:cipher,mode:cipherCfg.mode,padding:cipherCfg.padding,blockSize:cipher.blockSize,formatter:cfg.format})},decrypt:function(cipher,ciphertext,key,cfg){cfg=this.cfg.extend(cfg),ciphertext=this._parse(ciphertext,cfg.format);var plaintext=cipher.createDecryptor(key,cfg).finalize(ciphertext.ciphertext);return plaintext},_parse:function(ciphertext,format){return"string"==typeof ciphertext?format.parse(ciphertext,this):ciphertext}}),C_kdf=C.kdf={},OpenSSLKdf=C_kdf.OpenSSL={execute:function(password,keySize,ivSize,salt){salt||(salt=WordArray.random(8));var key=EvpKDF.create({keySize:keySize+ivSize}).compute(password,salt),iv=WordArray.create(key.words.slice(keySize),4*ivSize);return key.sigBytes=4*keySize,CipherParams.create({key:key,iv:iv,salt:salt})}},PasswordBasedCipher=C_lib.PasswordBasedCipher=SerializableCipher.extend({cfg:SerializableCipher.cfg.extend({kdf:OpenSSLKdf}),encrypt:function(cipher,message,password,cfg){cfg=this.cfg.extend(cfg);var derivedParams=cfg.kdf.execute(password,cipher.keySize,cipher.ivSize);cfg.iv=derivedParams.iv;var ciphertext=SerializableCipher.encrypt.call(this,cipher,message,derivedParams.key,cfg);return ciphertext.mixIn(derivedParams),ciphertext},decrypt:function(cipher,ciphertext,password,cfg){cfg=this.cfg.extend(cfg),ciphertext=this._parse(ciphertext,cfg.format);var derivedParams=cfg.kdf.execute(password,cipher.keySize,cipher.ivSize,ciphertext.salt);cfg.iv=derivedParams.iv;var plaintext=SerializableCipher.decrypt.call(this,cipher,ciphertext,derivedParams.key,cfg);return plaintext}})}(),CryptoJS.mode.ECB=function(){var ECB=CryptoJS.lib.BlockCipherMode.extend();return ECB.Encryptor=ECB.extend({processBlock:function(words,offset){this._cipher.encryptBlock(words,offset)}}),ECB.Decryptor=ECB.extend({processBlock:function(words,offset){this._cipher.decryptBlock(words,offset)}}),ECB}(),function(){var C=CryptoJS,C_lib=C.lib,BlockCipher=C_lib.BlockCipher,C_algo=C.algo,SBOX=[],INV_SBOX=[],SUB_MIX_0=[],SUB_MIX_1=[],SUB_MIX_2=[],SUB_MIX_3=[],INV_SUB_MIX_0=[],INV_SUB_MIX_1=[],INV_SUB_MIX_2=[],INV_SUB_MIX_3=[];!function(){for(var d=[],i=0;i<256;i++)i<128?d[i]=i<<1:d[i]=i<<1^283;for(var x=0,xi=0,i=0;i<256;i++){var sx=xi^xi<<1^xi<<2^xi<<3^xi<<4;sx=sx>>>8^255&sx^99,SBOX[x]=sx,INV_SBOX[sx]=x;var x2=d[x],x4=d[x2],x8=d[x4],t=257*d[sx]^16843008*sx;SUB_MIX_0[x]=t<<24|t>>>8,SUB_MIX_1[x]=t<<16|t>>>16,SUB_MIX_2[x]=t<<8|t>>>24,SUB_MIX_3[x]=t;var t=16843009*x8^65537*x4^257*x2^16843008*x;INV_SUB_MIX_0[sx]=t<<24|t>>>8,INV_SUB_MIX_1[sx]=t<<16|t>>>16,INV_SUB_MIX_2[sx]=t<<8|t>>>24,INV_SUB_MIX_3[sx]=t,x?(x=x2^d[d[d[x8^x2]]],xi^=d[d[xi]]):x=xi=1}}();var RCON=[0,1,2,4,8,16,32,64,128,27,54],AES=C_algo.AES=BlockCipher.extend({_doReset:function(){for(var key=this._key,keyWords=key.words,keySize=key.sigBytes/4,nRounds=this._nRounds=keySize+6,ksRows=4*(nRounds+1),keySchedule=this._keySchedule=[],ksRow=0;ksRow6&&ksRow%keySize==4&&(t=SBOX[t>>>24]<<24|SBOX[t>>>16&255]<<16|SBOX[t>>>8&255]<<8|SBOX[255&t]):(t=t<<8|t>>>24,t=SBOX[t>>>24]<<24|SBOX[t>>>16&255]<<16|SBOX[t>>>8&255]<<8|SBOX[255&t],t^=RCON[ksRow/keySize|0]<<24),keySchedule[ksRow]=keySchedule[ksRow-keySize]^t}for(var invKeySchedule=this._invKeySchedule=[],invKsRow=0;invKsRow>>24]]^INV_SUB_MIX_1[SBOX[t>>>16&255]]^INV_SUB_MIX_2[SBOX[t>>>8&255]]^INV_SUB_MIX_3[SBOX[255&t]]}},encryptBlock:function(M,offset){this._doCryptBlock(M,offset,this._keySchedule,SUB_MIX_0,SUB_MIX_1,SUB_MIX_2,SUB_MIX_3,SBOX)},decryptBlock:function(M,offset){var t=M[offset+1];M[offset+1]=M[offset+3],M[offset+3]=t,this._doCryptBlock(M,offset,this._invKeySchedule,INV_SUB_MIX_0,INV_SUB_MIX_1,INV_SUB_MIX_2,INV_SUB_MIX_3,INV_SBOX);var t=M[offset+1];M[offset+1]=M[offset+3],M[offset+3]=t},_doCryptBlock:function(M,offset,keySchedule,SUB_MIX_0,SUB_MIX_1,SUB_MIX_2,SUB_MIX_3,SBOX){for(var nRounds=this._nRounds,s0=M[offset]^keySchedule[0],s1=M[offset+1]^keySchedule[1],s2=M[offset+2]^keySchedule[2],s3=M[offset+3]^keySchedule[3],ksRow=4,round=1;round>>24]^SUB_MIX_1[s1>>>16&255]^SUB_MIX_2[s2>>>8&255]^SUB_MIX_3[255&s3]^keySchedule[ksRow++],t1=SUB_MIX_0[s1>>>24]^SUB_MIX_1[s2>>>16&255]^SUB_MIX_2[s3>>>8&255]^SUB_MIX_3[255&s0]^keySchedule[ksRow++],t2=SUB_MIX_0[s2>>>24]^SUB_MIX_1[s3>>>16&255]^SUB_MIX_2[s0>>>8&255]^SUB_MIX_3[255&s1]^keySchedule[ksRow++],t3=SUB_MIX_0[s3>>>24]^SUB_MIX_1[s0>>>16&255]^SUB_MIX_2[s1>>>8&255]^SUB_MIX_3[255&s2]^keySchedule[ksRow++];s0=t0,s1=t1,s2=t2,s3=t3}var t0=(SBOX[s0>>>24]<<24|SBOX[s1>>>16&255]<<16|SBOX[s2>>>8&255]<<8|SBOX[255&s3])^keySchedule[ksRow++],t1=(SBOX[s1>>>24]<<24|SBOX[s2>>>16&255]<<16|SBOX[s3>>>8&255]<<8|SBOX[255&s0])^keySchedule[ksRow++],t2=(SBOX[s2>>>24]<<24|SBOX[s3>>>16&255]<<16|SBOX[s0>>>8&255]<<8|SBOX[255&s1])^keySchedule[ksRow++],t3=(SBOX[s3>>>24]<<24|SBOX[s0>>>16&255]<<16|SBOX[s1>>>8&255]<<8|SBOX[255&s2])^keySchedule[ksRow++];M[offset]=t0,M[offset+1]=t1,M[offset+2]=t2,M[offset+3]=t3},keySize:8});C.AES=BlockCipher._createHelper(AES)}(),_.extend(BI,{aesEncrypt:function(text,key){key=CryptoJS.enc.Utf8.parse(key);var cipher=CryptoJS.AES.encrypt(text,key,{mode:CryptoJS.mode.ECB,padding:CryptoJS.pad.Pkcs7}),base64Cipher=cipher.ciphertext.toString(CryptoJS.enc.Base64);return base64Cipher}})}(),!function(){function aspect(type){return function(target,methodName,advice){var exist=target[methodName],dispatcher;exist&&exist.target==target||(dispatcher=target[methodName]=function(){for(var beforeArr=dispatcher.before,args=arguments,next,l=beforeArr.length;l--;){if(next=beforeArr[l].advice.apply(this,args),next===!1)return!1;args=next||args}for(var rs=dispatcher.method.apply(this,args),afterArr=dispatcher.after,i=0,ii=afterArr.length;i127&&c<2048?(utftext+=String.fromCharCode(c>>6|192),utftext+=String.fromCharCode(63&c|128)):(utftext+=String.fromCharCode(c>>12|224),utftext+=String.fromCharCode(c>>6&63|128),utftext+=String.fromCharCode(63&c|128))}return utftext},_utf8_decode=function(utftext){for(var string="",i=0,c=0,c3=0,c2=0;i191&&c<224?(c2=utftext.charCodeAt(i+1),string+=String.fromCharCode((31&c)<<6|63&c2),i+=2):(c2=utftext.charCodeAt(i+1),c3=utftext.charCodeAt(i+2),string+=String.fromCharCode((15&c)<<12|(63&c2)<<6|63&c3),i+=3);return string};_.extend(BI,{encode:function(input){var output="",chr1,chr2,chr3,enc1,enc2,enc3,enc4,i=0;for(input=_utf8_encode(input);i>2,enc2=(3&chr1)<<4|chr2>>4,enc3=(15&chr2)<<2|chr3>>6,enc4=63&chr3,isNaN(chr2)?enc3=enc4=64:isNaN(chr3)&&(enc4=64),output=output+_keyStr.charAt(enc1)+_keyStr.charAt(enc2)+_keyStr.charAt(enc3)+_keyStr.charAt(enc4);return output},decode:function(input){var output="",chr1,chr2,chr3,enc1,enc2,enc3,enc4,i=0;for(input=input.replace(/[^A-Za-z0-9\+\/\=]/g,"");i>4,chr2=(15&enc2)<<4|enc3>>2,chr3=(3&enc3)<<6|enc4,output+=String.fromCharCode(chr1),64!=enc3&&(output+=String.fromCharCode(chr2)),64!=enc4&&(output+=String.fromCharCode(chr3));return output=_utf8_decode(output)}})}(),BI.Cache={_prefix:"bi",setUsername:function(username){localStorage.setItem(BI.Cache._prefix+".username",(username+""||"").toUpperCase())},getUsername:function(){return localStorage.getItem(BI.Cache._prefix+".username")||""},_getKeyPrefix:function(){return BI.Cache.getUsername()+"."+BI.Cache._prefix+"."},_generateKey:function(key){return BI.Cache._getKeyPrefix()+(key||"")},getItem:function(key){return localStorage.getItem(BI.Cache._generateKey(key))},setItem:function(key,value){localStorage.setItem(BI.Cache._generateKey(key),value)},removeItem:function(key){localStorage.removeItem(BI.Cache._generateKey(key))},clear:function(){for(var i=localStorage.length;i>=0;i--){var key=localStorage.key(i);key&&0===key.indexOf(BI.Cache._getKeyPrefix())&&localStorage.removeItem(key)}},keys:function(){for(var result=[],i=localStorage.length;i>=0;i--){var key=localStorage.key(i);if(key){var prefix=BI.Cache._getKeyPrefix();0===key.indexOf(prefix)&&(result[result.length]=key.substring(prefix.length))}}return result},addCookie:function(name,value,path,expiresHours){var cookieString=name+"="+escape(value);if(expiresHours&&expiresHours>0){var date=new Date;date.setTime(BI.getTime()+3600*expiresHours*1e3),cookieString=cookieString+"; expires="+date.toGMTString()}path&&(cookieString=cookieString+"; path="+path),document.cookie=cookieString},getCookie:function(name){var arr,reg=new RegExp("(^| )"+name+"=([^;]*)(;|$)");return(arr=document.cookie.match(reg))?unescape(arr[2]):null},deleteCookie:function(name,path){var date=new Date;date.setTime(BI.getTime()-1e4);var cookieString=name+"=v; expires="+date.toGMTString();path&&(cookieString=cookieString+"; path="+path),document.cookie=cookieString}},BI.CellSizeAndPositionManager=function(cellCount,cellSizeGetter,estimatedCellSize){this._cellSizeGetter=cellSizeGetter,this._cellCount=cellCount,this._estimatedCellSize=estimatedCellSize,this._cellSizeAndPositionData={},this._lastMeasuredIndex=-1},BI.CellSizeAndPositionManager.prototype={constructor:BI.CellSizeAndPositionManager,configure:function(cellCount,estimatedCellSize){this._cellCount=cellCount,this._estimatedCellSize=estimatedCellSize},getCellCount:function(){return this._cellCount},getEstimatedCellSize:function(){return this._estimatedCellSize},getLastMeasuredIndex:function(){return this._lastMeasuredIndex},getSizeAndPositionOfCell:function(index){if(!(index<0||index>=this._cellCount)){if(index>this._lastMeasuredIndex){for(var lastMeasuredCellSizeAndPosition=this.getSizeAndPositionOfLastMeasuredCell(),offset=lastMeasuredCellSizeAndPosition.offset+lastMeasuredCellSizeAndPosition.size,i=this._lastMeasuredIndex+1;i<=index;i++){var size=this._cellSizeGetter(i);null==size||isNaN(size)||(this._cellSizeAndPositionData[i]={offset:offset,size:size},offset+=size)}this._lastMeasuredIndex=index}return this._cellSizeAndPositionData[index]}},getSizeAndPositionOfLastMeasuredCell:function(){return this._lastMeasuredIndex>=0?this._cellSizeAndPositionData[this._lastMeasuredIndex]:{offset:0,size:0}},getTotalSize:function(){var lastMeasuredCellSizeAndPosition=this.getSizeAndPositionOfLastMeasuredCell();return lastMeasuredCellSizeAndPosition.offset+lastMeasuredCellSizeAndPosition.size+(this._cellCount-this._lastMeasuredIndex-1)*this._estimatedCellSize},getUpdatedOffsetForIndex:function(align,containerSize,currentOffset,targetIndex){var datum=this.getSizeAndPositionOfCell(targetIndex),maxOffset=datum.offset,minOffset=maxOffset-containerSize+datum.size,idealOffset;switch(align){case"start":idealOffset=maxOffset;break;case"end":idealOffset=minOffset;break;case"center":idealOffset=maxOffset-(containerSize-datum.size)/2;break;default:idealOffset=Math.max(minOffset,Math.min(maxOffset,currentOffset))}var totalSize=this.getTotalSize();return Math.max(0,Math.min(totalSize-containerSize,idealOffset))},getVisibleCellRange:function(containerSize,offset){var totalSize=this.getTotalSize();if(0===totalSize)return{};var maxOffset=offset+containerSize,start=this._findNearestCell(offset),datum=this.getSizeAndPositionOfCell(start);offset=datum.offset+datum.size;for(var stop=start;offsetoffset&&(high=middle-1)}if(low>0)return low-1},_exponentialSearch:function(index,offset){for(var interval=1;index=offset?this._binarySearch(lastMeasuredIndex,0,offset):this._exponentialSearch(lastMeasuredIndex,offset)}}},BI.ScalingCellSizeAndPositionManager=function(cellCount,cellSizeGetter,estimatedCellSize,maxScrollSize){this._cellSizeAndPositionManager=new BI.CellSizeAndPositionManager(cellCount,cellSizeGetter,estimatedCellSize),this._maxScrollSize=maxScrollSize||1e7},BI.ScalingCellSizeAndPositionManager.prototype={constructor:BI.ScalingCellSizeAndPositionManager,configure:function(){this._cellSizeAndPositionManager.configure.apply(this._cellSizeAndPositionManager,arguments)},getCellCount:function(){return this._cellSizeAndPositionManager.getCellCount()},getEstimatedCellSize:function(){return this._cellSizeAndPositionManager.getEstimatedCellSize()},getLastMeasuredIndex:function(){return this._cellSizeAndPositionManager.getLastMeasuredIndex()},getOffsetAdjustment:function(containerSize,offset){var totalSize=this._cellSizeAndPositionManager.getTotalSize(),safeTotalSize=this.getTotalSize(),offsetPercentage=this._getOffsetPercentage(containerSize,offset,safeTotalSize);return Math.round(offsetPercentage*(safeTotalSize-totalSize))},getSizeAndPositionOfCell:function(index){return this._cellSizeAndPositionManager.getSizeAndPositionOfCell(index)},getSizeAndPositionOfLastMeasuredCell:function(){return this._cellSizeAndPositionManager.getSizeAndPositionOfLastMeasuredCell()},getTotalSize:function(){return Math.min(this._maxScrollSize,this._cellSizeAndPositionManager.getTotalSize())},getUpdatedOffsetForIndex:function(align,containerSize,currentOffset,targetIndex){currentOffset=this._safeOffsetToOffset(containerSize,currentOffset);var offset=this._cellSizeAndPositionManager.getUpdatedOffsetForIndex(align,containerSize,currentOffset,targetIndex);return this._offsetToSafeOffset(containerSize,offset)},getVisibleCellRange:function(containerSize,offset){return offset=this._safeOffsetToOffset(containerSize,offset),this._cellSizeAndPositionManager.getVisibleCellRange(containerSize,offset)},resetCell:function(index){this._cellSizeAndPositionManager.resetCell(index)},_getOffsetPercentage:function(containerSize,offset,totalSize){return totalSize<=containerSize?0:offset/(totalSize-containerSize)},_offsetToSafeOffset:function(containerSize,offset){var totalSize=this._cellSizeAndPositionManager.getTotalSize(),safeTotalSize=this.getTotalSize();if(totalSize===safeTotalSize)return offset;var offsetPercentage=this._getOffsetPercentage(containerSize,offset,totalSize);return Math.round(offsetPercentage*(safeTotalSize-containerSize))},_safeOffsetToOffset:function(containerSize,offset){var totalSize=this._cellSizeAndPositionManager.getTotalSize(),safeTotalSize=this.getTotalSize();if(totalSize===safeTotalSize)return offset;var offsetPercentage=this._getOffsetPercentage(containerSize,offset,safeTotalSize);return Math.round(offsetPercentage*(totalSize-containerSize))}},!function(){var _ChineseFirstPY="YDYQSXMWZSSXJBYMGCCZQPSSQBYCDSCDQLDYLYBSSJGYZZJJFKCCLZDHWDWZJLJPFYYNWJJTMYHZWZHFLZPPQHGSCYYYNJQYXXGJHHSDSJNKKTMOMLCRXYPSNQSECCQZGGLLYJLMYZZSECYKYYHQWJSSGGYXYZYJWWKDJHYCHMYXJTLXJYQBYXZLDWRDJRWYSRLDZJPCBZJJBRCFTLECZSTZFXXZHTRQHYBDLYCZSSYMMRFMYQZPWWJJYFCRWFDFZQPYDDWYXKYJAWJFFXYPSFTZYHHYZYSWCJYXSCLCXXWZZXNBGNNXBXLZSZSBSGPYSYZDHMDZBQBZCWDZZYYTZHBTSYYBZGNTNXQYWQSKBPHHLXGYBFMJEBJHHGQTJCYSXSTKZHLYCKGLYSMZXYALMELDCCXGZYRJXSDLTYZCQKCNNJWHJTZZCQLJSTSTBNXBTYXCEQXGKWJYFLZQLYHYXSPSFXLMPBYSXXXYDJCZYLLLSJXFHJXPJBTFFYABYXBHZZBJYZLWLCZGGBTSSMDTJZXPTHYQTGLJSCQFZKJZJQNLZWLSLHDZBWJNCJZYZSQQYCQYRZCJJWYBRTWPYFTWEXCSKDZCTBZHYZZYYJXZCFFZZMJYXXSDZZOTTBZLQWFCKSZSXFYRLNYJMBDTHJXSQQCCSBXYYTSYFBXDZTGBCNSLCYZZPSAZYZZSCJCSHZQYDXLBPJLLMQXTYDZXSQJTZPXLCGLQTZWJBHCTSYJSFXYEJJTLBGXSXJMYJQQPFZASYJNTYDJXKJCDJSZCBARTDCLYJQMWNQNCLLLKBYBZZSYHQQLTWLCCXTXLLZNTYLNEWYZYXCZXXGRKRMTCNDNJTSYYSSDQDGHSDBJGHRWRQLYBGLXHLGTGXBQJDZPYJSJYJCTMRNYMGRZJCZGJMZMGXMPRYXKJNYMSGMZJYMKMFXMLDTGFBHCJHKYLPFMDXLQJJSMTQGZSJLQDLDGJYCALCMZCSDJLLNXDJFFFFJCZFMZFFPFKHKGDPSXKTACJDHHZDDCRRCFQYJKQCCWJDXHWJLYLLZGCFCQDSMLZPBJJPLSBCJGGDCKKDEZSQCCKJGCGKDJTJDLZYCXKLQSCGJCLTFPCQCZGWPJDQYZJJBYJHSJDZWGFSJGZKQCCZLLPSPKJGQJHZZLJPLGJGJJTHJJYJZCZMLZLYQBGJWMLJKXZDZNJQSYZMLJLLJKYWXMKJLHSKJGBMCLYYMKXJQLBMLLKMDXXKWYXYSLMLPSJQQJQXYXFJTJDXMXXLLCXQBSYJBGWYMBGGBCYXPJYGPEPFGDJGBHBNSQJYZJKJKHXQFGQZKFHYGKHDKLLSDJQXPQYKYBNQSXQNSZSWHBSXWHXWBZZXDMNSJBSBKBBZKLYLXGWXDRWYQZMYWSJQLCJXXJXKJEQXSCYETLZHLYYYSDZPAQYZCMTLSHTZCFYZYXYLJSDCJQAGYSLCQLYYYSHMRQQKLDXZSCSSSYDYCJYSFSJBFRSSZQSBXXPXJYSDRCKGJLGDKZJZBDKTCSYQPYHSTCLDJDHMXMCGXYZHJDDTMHLTXZXYLYMOHYJCLTYFBQQXPFBDFHHTKSQHZYYWCNXXCRWHOWGYJLEGWDQCWGFJYCSNTMYTOLBYGWQWESJPWNMLRYDZSZTXYQPZGCWXHNGPYXSHMYQJXZTDPPBFYHZHTJYFDZWKGKZBLDNTSXHQEEGZZYLZMMZYJZGXZXKHKSTXNXXWYLYAPSTHXDWHZYMPXAGKYDXBHNHXKDPJNMYHYLPMGOCSLNZHKXXLPZZLBMLSFBHHGYGYYGGBHSCYAQTYWLXTZQCEZYDQDQMMHTKLLSZHLSJZWFYHQSWSCWLQAZYNYTLSXTHAZNKZZSZZLAXXZWWCTGQQTDDYZTCCHYQZFLXPSLZYGPZSZNGLNDQTBDLXGTCTAJDKYWNSYZLJHHZZCWNYYZYWMHYCHHYXHJKZWSXHZYXLYSKQYSPSLYZWMYPPKBYGLKZHTYXAXQSYSHXASMCHKDSCRSWJPWXSGZJLWWSCHSJHSQNHCSEGNDAQTBAALZZMSSTDQJCJKTSCJAXPLGGXHHGXXZCXPDMMHLDGTYBYSJMXHMRCPXXJZCKZXSHMLQXXTTHXWZFKHCCZDYTCJYXQHLXDHYPJQXYLSYYDZOZJNYXQEZYSQYAYXWYPDGXDDXSPPYZNDLTWRHXYDXZZJHTCXMCZLHPYYYYMHZLLHNXMYLLLMDCPPXHMXDKYCYRDLTXJCHHZZXZLCCLYLNZSHZJZZLNNRLWHYQSNJHXYNTTTKYJPYCHHYEGKCTTWLGQRLGGTGTYGYHPYHYLQYQGCWYQKPYYYTTTTLHYHLLTYTTSPLKYZXGZWGPYDSSZZDQXSKCQNMJJZZBXYQMJRTFFBTKHZKBXLJJKDXJTLBWFZPPTKQTZTGPDGNTPJYFALQMKGXBDCLZFHZCLLLLADPMXDJHLCCLGYHDZFGYDDGCYYFGYDXKSSEBDHYKDKDKHNAXXYBPBYYHXZQGAFFQYJXDMLJCSQZLLPCHBSXGJYNDYBYQSPZWJLZKSDDTACTBXZDYZYPJZQSJNKKTKNJDJGYYPGTLFYQKASDNTCYHBLWDZHBBYDWJRYGKZYHEYYFJMSDTYFZJJHGCXPLXHLDWXXJKYTCYKSSSMTWCTTQZLPBSZDZWZXGZAGYKTYWXLHLSPBCLLOQMMZSSLCMBJCSZZKYDCZJGQQDSMCYTZQQLWZQZXSSFPTTFQMDDZDSHDTDWFHTDYZJYQJQKYPBDJYYXTLJHDRQXXXHAYDHRJLKLYTWHLLRLLRCXYLBWSRSZZSYMKZZHHKYHXKSMDSYDYCJPBZBSQLFCXXXNXKXWYWSDZYQOGGQMMYHCDZTTFJYYBGSTTTYBYKJDHKYXBELHTYPJQNFXFDYKZHQKZBYJTZBXHFDXKDASWTAWAJLDYJSFHBLDNNTNQJTJNCHXFJSRFWHZFMDRYJYJWZPDJKZYJYMPCYZNYNXFBYTFYFWYGDBNZZZDNYTXZEMMQBSQEHXFZMBMFLZZSRXYMJGSXWZJSPRYDJSJGXHJJGLJJYNZZJXHGXKYMLPYYYCXYTWQZSWHWLYRJLPXSLSXMFSWWKLCTNXNYNPSJSZHDZEPTXMYYWXYYSYWLXJQZQXZDCLEEELMCPJPCLWBXSQHFWWTFFJTNQJHJQDXHWLBYZNFJLALKYYJLDXHHYCSTYYWNRJYXYWTRMDRQHWQCMFJDYZMHMYYXJWMYZQZXTLMRSPWWCHAQBXYGZYPXYYRRCLMPYMGKSJSZYSRMYJSNXTPLNBAPPYPYLXYYZKYNLDZYJZCZNNLMZHHARQMPGWQTZMXXMLLHGDZXYHXKYXYCJMFFYYHJFSBSSQLXXNDYCANNMTCJCYPRRNYTYQNYYMBMSXNDLYLYSLJRLXYSXQMLLYZLZJJJKYZZCSFBZXXMSTBJGNXYZHLXNMCWSCYZYFZLXBRNNNYLBNRTGZQYSATSWRYHYJZMZDHZGZDWYBSSCSKXSYHYTXXGCQGXZZSHYXJSCRHMKKBXCZJYJYMKQHZJFNBHMQHYSNJNZYBKNQMCLGQHWLZNZSWXKHLJHYYBQLBFCDSXDLDSPFZPSKJYZWZXZDDXJSMMEGJSCSSMGCLXXKYYYLNYPWWWGYDKZJGGGZGGSYCKNJWNJPCXBJJTQTJWDSSPJXZXNZXUMELPXFSXTLLXCLJXJJLJZXCTPSWXLYDHLYQRWHSYCSQYYBYAYWJJJQFWQCQQCJQGXALDBZZYJGKGXPLTZYFXJLTPADKYQHPMATLCPDCKBMTXYBHKLENXDLEEGQDYMSAWHZMLJTWYGXLYQZLJEEYYBQQFFNLYXRDSCTGJGXYYNKLLYQKCCTLHJLQMKKZGCYYGLLLJDZGYDHZWXPYSJBZKDZGYZZHYWYFQYTYZSZYEZZLYMHJJHTSMQWYZLKYYWZCSRKQYTLTDXWCTYJKLWSQZWBDCQYNCJSRSZJLKCDCDTLZZZACQQZZDDXYPLXZBQJYLZLLLQDDZQJYJYJZYXNYYYNYJXKXDAZWYRDLJYYYRJLXLLDYXJCYWYWNQCCLDDNYYYNYCKCZHXXCCLGZQJGKWPPCQQJYSBZZXYJSQPXJPZBSBDSFNSFPZXHDWZTDWPPTFLZZBZDMYYPQJRSDZSQZSQXBDGCPZSWDWCSQZGMDHZXMWWFYBPDGPHTMJTHZSMMBGZMBZJCFZWFZBBZMQCFMBDMCJXLGPNJBBXGYHYYJGPTZGZMQBQTCGYXJXLWZKYDPDYMGCFTPFXYZTZXDZXTGKMTYBBCLBJASKYTSSQYYMSZXFJEWLXLLSZBQJJJAKLYLXLYCCTSXMCWFKKKBSXLLLLJYXTYLTJYYTDPJHNHNNKBYQNFQYYZBYYESSESSGDYHFHWTCJBSDZZTFDMXHCNJZYMQWSRYJDZJQPDQBBSTJGGFBKJBXTGQHNGWJXJGDLLTHZHHYYYYYYSXWTYYYCCBDBPYPZYCCZYJPZYWCBDLFWZCWJDXXHYHLHWZZXJTCZLCDPXUJCZZZLYXJJTXPHFXWPYWXZPTDZZBDZCYHJHMLXBQXSBYLRDTGJRRCTTTHYTCZWMXFYTWWZCWJWXJYWCSKYBZSCCTZQNHXNWXXKHKFHTSWOCCJYBCMPZZYKBNNZPBZHHZDLSYDDYTYFJPXYNGFXBYQXCBHXCPSXTYZDMKYSNXSXLHKMZXLYHDHKWHXXSSKQYHHCJYXGLHZXCSNHEKDTGZXQYPKDHEXTYKCNYMYYYPKQYYYKXZLTHJQTBYQHXBMYHSQCKWWYLLHCYYLNNEQXQWMCFBDCCMLJGGXDQKTLXKGNQCDGZJWYJJLYHHQTTTNWCHMXCXWHWSZJYDJCCDBQCDGDNYXZTHCQRXCBHZTQCBXWGQWYYBXHMBYMYQTYEXMQKYAQYRGYZSLFYKKQHYSSQYSHJGJCNXKZYCXSBXYXHYYLSTYCXQTHYSMGSCPMMGCCCCCMTZTASMGQZJHKLOSQYLSWTMXSYQKDZLJQQYPLSYCZTCQQPBBQJZCLPKHQZYYXXDTDDTSJCXFFLLCHQXMJLWCJCXTSPYCXNDTJSHJWXDQQJSKXYAMYLSJHMLALYKXCYYDMNMDQMXMCZNNCYBZKKYFLMCHCMLHXRCJJHSYLNMTJZGZGYWJXSRXCWJGJQHQZDQJDCJJZKJKGDZQGJJYJYLXZXXCDQHHHEYTMHLFSBDJSYYSHFYSTCZQLPBDRFRZTZYKYWHSZYQKWDQZRKMSYNBCRXQBJYFAZPZZEDZCJYWBCJWHYJBQSZYWRYSZPTDKZPFPBNZTKLQYHBBZPNPPTYZZYBQNYDCPJMMCYCQMCYFZZDCMNLFPBPLNGQJTBTTNJZPZBBZNJKLJQYLNBZQHKSJZNGGQSZZKYXSHPZSNBCGZKDDZQANZHJKDRTLZLSWJLJZLYWTJNDJZJHXYAYNCBGTZCSSQMNJPJYTYSWXZFKWJQTKHTZPLBHSNJZSYZBWZZZZLSYLSBJHDWWQPSLMMFBJDWAQYZTCJTBNNWZXQXCDSLQGDSDPDZHJTQQPSWLYYJZLGYXYZLCTCBJTKTYCZJTQKBSJLGMGZDMCSGPYNJZYQYYKNXRPWSZXMTNCSZZYXYBYHYZAXYWQCJTLLCKJJTJHGDXDXYQYZZBYWDLWQCGLZGJGQRQZCZSSBCRPCSKYDZNXJSQGXSSJMYDNSTZTPBDLTKZWXQWQTZEXNQCZGWEZKSSBYBRTSSSLCCGBPSZQSZLCCGLLLZXHZQTHCZMQGYZQZNMCOCSZJMMZSQPJYGQLJYJPPLDXRGZYXCCSXHSHGTZNLZWZKJCXTCFCJXLBMQBCZZWPQDNHXLJCTHYZLGYLNLSZZPCXDSCQQHJQKSXZPBAJYEMSMJTZDXLCJYRYYNWJBNGZZTMJXLTBSLYRZPYLSSCNXPHLLHYLLQQZQLXYMRSYCXZLMMCZLTZSDWTJJLLNZGGQXPFSKYGYGHBFZPDKMWGHCXMSGDXJMCJZDYCABXJDLNBCDQYGSKYDQTXDJJYXMSZQAZDZFSLQXYJSJZYLBTXXWXQQZBJZUFBBLYLWDSLJHXJYZJWTDJCZFQZQZZDZSXZZQLZCDZFJHYSPYMPQZMLPPLFFXJJNZZYLSJEYQZFPFZKSYWJJJHRDJZZXTXXGLGHYDXCSKYSWMMZCWYBAZBJKSHFHJCXMHFQHYXXYZFTSJYZFXYXPZLCHMZMBXHZZSXYFYMNCWDABAZLXKTCSHHXKXJJZJSTHYGXSXYYHHHJWXKZXSSBZZWHHHCWTZZZPJXSNXQQJGZYZYWLLCWXZFXXYXYHXMKYYSWSQMNLNAYCYSPMJKHWCQHYLAJJMZXHMMCNZHBHXCLXTJPLTXYJHDYYLTTXFSZHYXXSJBJYAYRSMXYPLCKDUYHLXRLNLLSTYZYYQYGYHHSCCSMZCTZQXKYQFPYYRPFFLKQUNTSZLLZMWWTCQQYZWTLLMLMPWMBZSSTZRBPDDTLQJJBXZCSRZQQYGWCSXFWZLXCCRSZDZMCYGGDZQSGTJSWLJMYMMZYHFBJDGYXCCPSHXNZCSBSJYJGJMPPWAFFYFNXHYZXZYLREMZGZCYZSSZDLLJCSQFNXZKPTXZGXJJGFMYYYSNBTYLBNLHPFZDCYFBMGQRRSSSZXYSGTZRNYDZZCDGPJAFJFZKNZBLCZSZPSGCYCJSZLMLRSZBZZLDLSLLYSXSQZQLYXZLSKKBRXBRBZCYCXZZZEEYFGKLZLYYHGZSGZLFJHGTGWKRAAJYZKZQTSSHJJXDCYZUYJLZYRZDQQHGJZXSSZBYKJPBFRTJXLLFQWJHYLQTYMBLPZDXTZYGBDHZZRBGXHWNJTJXLKSCFSMWLSDQYSJTXKZSCFWJLBXFTZLLJZLLQBLSQMQQCGCZFPBPHZCZJLPYYGGDTGWDCFCZQYYYQYSSCLXZSKLZZZGFFCQNWGLHQYZJJCZLQZZYJPJZZBPDCCMHJGXDQDGDLZQMFGPSYTSDYFWWDJZJYSXYYCZCYHZWPBYKXRYLYBHKJKSFXTZJMMCKHLLTNYYMSYXYZPYJQYCSYCWMTJJKQYRHLLQXPSGTLYYCLJSCPXJYZFNMLRGJJTYZBXYZMSJYJHHFZQMSYXRSZCWTLRTQZSSTKXGQKGSPTGCZNJSJCQCXHMXGGZTQYDJKZDLBZSXJLHYQGGGTHQSZPYHJHHGYYGKGGCWJZZYLCZLXQSFTGZSLLLMLJSKCTBLLZZSZMMNYTPZSXQHJCJYQXYZXZQZCPSHKZZYSXCDFGMWQRLLQXRFZTLYSTCTMJCXJJXHJNXTNRZTZFQYHQGLLGCXSZSJDJLJCYDSJTLNYXHSZXCGJZYQPYLFHDJSBPCCZHJJJQZJQDYBSSLLCMYTTMQTBHJQNNYGKYRQYQMZGCJKPDCGMYZHQLLSLLCLMHOLZGDYYFZSLJCQZLYLZQJESHNYLLJXGJXLYSYYYXNBZLJSSZCQQCJYLLZLTJYLLZLLBNYLGQCHXYYXOXCXQKYJXXXYKLXSXXYQXCYKQXQCSGYXXYQXYGYTQOHXHXPYXXXULCYEYCHZZCBWQBBWJQZSCSZSSLZYLKDESJZWMYMCYTSDSXXSCJPQQSQYLYYZYCMDJDZYWCBTJSYDJKCYDDJLBDJJSODZYSYXQQYXDHHGQQYQHDYXWGMMMAJDYBBBPPBCMUUPLJZSMTXERXJMHQNUTPJDCBSSMSSSTKJTSSMMTRCPLZSZMLQDSDMJMQPNQDXCFYNBFSDQXYXHYAYKQYDDLQYYYSSZBYDSLNTFQTZQPZMCHDHCZCWFDXTMYQSPHQYYXSRGJCWTJTZZQMGWJJTJHTQJBBHWZPXXHYQFXXQYWYYHYSCDYDHHQMNMTMWCPBSZPPZZGLMZFOLLCFWHMMSJZTTDHZZYFFYTZZGZYSKYJXQYJZQBHMBZZLYGHGFMSHPZFZSNCLPBQSNJXZSLXXFPMTYJYGBXLLDLXPZJYZJYHHZCYWHJYLSJEXFSZZYWXKZJLUYDTMLYMQJPWXYHXSKTQJEZRPXXZHHMHWQPWQLYJJQJJZSZCPHJLCHHNXJLQWZJHBMZYXBDHHYPZLHLHLGFWLCHYYTLHJXCJMSCPXSTKPNHQXSRTYXXTESYJCTLSSLSTDLLLWWYHDHRJZSFGXTSYCZYNYHTDHWJSLHTZDQDJZXXQHGYLTZPHCSQFCLNJTCLZPFSTPDYNYLGMJLLYCQHYSSHCHYLHQYQTMZYPBYWRFQYKQSYSLZDQJMPXYYSSRHZJNYWTQDFZBWWTWWRXCWHGYHXMKMYYYQMSMZHNGCEPMLQQMTCWCTMMPXJPJJHFXYYZSXZHTYBMSTSYJTTQQQYYLHYNPYQZLCYZHZWSMYLKFJXLWGXYPJYTYSYXYMZCKTTWLKSMZSYLMPWLZWXWQZSSAQSYXYRHSSNTSRAPXCPWCMGDXHXZDZYFJHGZTTSBJHGYZSZYSMYCLLLXBTYXHBBZJKSSDMALXHYCFYGMQYPJYCQXJLLLJGSLZGQLYCJCCZOTYXMTMTTLLWTGPXYMZMKLPSZZZXHKQYSXCTYJZYHXSHYXZKXLZWPSQPYHJWPJPWXQQYLXSDHMRSLZZYZWTTCYXYSZZSHBSCCSTPLWSSCJCHNLCGCHSSPHYLHFHHXJSXYLLNYLSZDHZXYLSXLWZYKCLDYAXZCMDDYSPJTQJZLNWQPSSSWCTSTSZLBLNXSMNYYMJQBQHRZWTYYDCHQLXKPZWBGQYBKFCMZWPZLLYYLSZYDWHXPSBCMLJBSCGBHXLQHYRLJXYSWXWXZSLDFHLSLYNJLZYFLYJYCDRJLFSYZFSLLCQYQFGJYHYXZLYLMSTDJCYHBZLLNWLXXYGYYHSMGDHXXHHLZZJZXCZZZCYQZFNGWPYLCPKPYYPMCLQKDGXZGGWQBDXZZKZFBXXLZXJTPJPTTBYTSZZDWSLCHZHSLTYXHQLHYXXXYYZYSWTXZKHLXZXZPYHGCHKCFSYHUTJRLXFJXPTZTWHPLYXFCRHXSHXKYXXYHZQDXQWULHYHMJTBFLKHTXCWHJFWJCFPQRYQXCYYYQYGRPYWSGSUNGWCHKZDXYFLXXHJJBYZWTSXXNCYJJYMSWZJQRMHXZWFQSYLZJZGBHYNSLBGTTCSYBYXXWXYHXYYXNSQYXMQYWRGYQLXBBZLJSYLPSYTJZYHYZAWLRORJMKSCZJXXXYXCHDYXRYXXJDTSQFXLYLTSFFYXLMTYJMJUYYYXLTZCSXQZQHZXLYYXZHDNBRXXXJCTYHLBRLMBRLLAXKYLLLJLYXXLYCRYLCJTGJCMTLZLLCYZZPZPCYAWHJJFYBDYYZSMPCKZDQYQPBPCJPDCYZMDPBCYYDYCNNPLMTMLRMFMMGWYZBSJGYGSMZQQQZTXMKQWGXLLPJGZBQCDJJJFPKJKCXBLJMSWMDTQJXLDLPPBXCWRCQFBFQJCZAHZGMYKPHYYHZYKNDKZMBPJYXPXYHLFPNYYGXJDBKXNXHJMZJXSTRSTLDXSKZYSYBZXJLXYSLBZYSLHXJPFXPQNBYLLJQKYGZMCYZZYMCCSLCLHZFWFWYXZMWSXTYNXJHPYYMCYSPMHYSMYDYSHQYZCHMJJMZCAAGCFJBBHPLYZYLXXSDJGXDHKXXTXXNBHRMLYJSLTXMRHNLXQJXYZLLYSWQGDLBJHDCGJYQYCMHWFMJYBMBYJYJWYMDPWHXQLDYGPDFXXBCGJSPCKRSSYZJMSLBZZJFLJJJLGXZGYXYXLSZQYXBEXYXHGCXBPLDYHWETTWWCJMBTXCHXYQXLLXFLYXLLJLSSFWDPZSMYJCLMWYTCZPCHQEKCQBWLCQYDPLQPPQZQFJQDJHYMMCXTXDRMJWRHXCJZYLQXDYYNHYYHRSLSRSYWWZJYMTLTLLGTQCJZYABTCKZCJYCCQLJZQXALMZYHYWLWDXZXQDLLQSHGPJFJLJHJABCQZDJGTKHSSTCYJLPSWZLXZXRWGLDLZRLZXTGSLLLLZLYXXWGDZYGBDPHZPBRLWSXQBPFDWOFMWHLYPCBJCCLDMBZPBZZLCYQXLDOMZBLZWPDWYYGDSTTHCSQSCCRSSSYSLFYBFNTYJSZDFNDPDHDZZMBBLSLCMYFFGTJJQWFTMTPJWFNLBZCMMJTGBDZLQLPYFHYYMJYLSDCHDZJWJCCTLJCLDTLJJCPDDSQDSSZYBNDBJLGGJZXSXNLYCYBJXQYCBYLZCFZPPGKCXZDZFZTJJFJSJXZBNZYJQTTYJYHTYCZHYMDJXTTMPXSPLZCDWSLSHXYPZGTFMLCJTYCBPMGDKWYCYZCDSZZYHFLYCTYGWHKJYYLSJCXGYWJCBLLCSNDDBTZBSCLYZCZZSSQDLLMQYYHFSLQLLXFTYHABXGWNYWYYPLLSDLDLLBJCYXJZMLHLJDXYYQYTDLLLBUGBFDFBBQJZZMDPJHGCLGMJJPGAEHHBWCQXAXHHHZCHXYPHJAXHLPHJPGPZJQCQZGJJZZUZDMQYYBZZPHYHYBWHAZYJHYKFGDPFQSDLZMLJXKXGALXZDAGLMDGXMWZQYXXDXXPFDMMSSYMPFMDMMKXKSYZYSHDZKXSYSMMZZZMSYDNZZCZXFPLSTMZDNMXCKJMZTYYMZMZZMSXHHDCZJEMXXKLJSTLWLSQLYJZLLZJSSDPPMHNLZJCZYHMXXHGZCJMDHXTKGRMXFWMCGMWKDTKSXQMMMFZZYDKMSCLCMPCGMHSPXQPZDSSLCXKYXTWLWJYAHZJGZQMCSNXYYMMPMLKJXMHLMLQMXCTKZMJQYSZJSYSZHSYJZJCDAJZYBSDQJZGWZQQXFKDMSDJLFWEHKZQKJPEYPZYSZCDWYJFFMZZYLTTDZZEFMZLBNPPLPLPEPSZALLTYLKCKQZKGENQLWAGYXYDPXLHSXQQWQCQXQCLHYXXMLYCCWLYMQYSKGCHLCJNSZKPYZKCQZQLJPDMDZHLASXLBYDWQLWDNBQCRYDDZTJYBKBWSZDXDTNPJDTCTQDFXQQMGNXECLTTBKPWSLCTYQLPWYZZKLPYGZCQQPLLKCCYLPQMZCZQCLJSLQZDJXLDDHPZQDLJJXZQDXYZQKZLJCYQDYJPPYPQYKJYRMPCBYMCXKLLZLLFQPYLLLMBSGLCYSSLRSYSQTMXYXZQZFDZUYSYZTFFMZZSMZQHZSSCCMLYXWTPZGXZJGZGSJSGKDDHTQGGZLLBJDZLCBCHYXYZHZFYWXYZYMSDBZZYJGTSMTFXQYXQSTDGSLNXDLRYZZLRYYLXQHTXSRTZNGZXBNQQZFMYKMZJBZYMKBPNLYZPBLMCNQYZZZSJZHJCTZKHYZZJRDYZHNPXGLFZTLKGJTCTSSYLLGZRZBBQZZKLPKLCZYSSUYXBJFPNJZZXCDWXZYJXZZDJJKGGRSRJKMSMZJLSJYWQSKYHQJSXPJZZZLSNSHRNYPZTWCHKLPSRZLZXYJQXQKYSJYCZTLQZYBBYBWZPQDWWYZCYTJCJXCKCWDKKZXSGKDZXWWYYJQYYTCYTDLLXWKCZKKLCCLZCQQDZLQLCSFQCHQHSFSMQZZLNBJJZBSJHTSZDYSJQJPDLZCDCWJKJZZLPYCGMZWDJJBSJQZSYZYHHXJPBJYDSSXDZNCGLQMBTSFSBPDZDLZNFGFJGFSMPXJQLMBLGQCYYXBQKDJJQYRFKZTJDHCZKLBSDZCFJTPLLJGXHYXZCSSZZXSTJYGKGCKGYOQXJPLZPBPGTGYJZGHZQZZLBJLSQFZGKQQJZGYCZBZQTLDXRJXBSXXPZXHYZYCLWDXJJHXMFDZPFZHQHQMQGKSLYHTYCGFRZGNQXCLPDLBZCSCZQLLJBLHBZCYPZZPPDYMZZSGYHCKCPZJGSLJLNSCDSLDLXBMSTLDDFJMKDJDHZLZXLSZQPQPGJLLYBDSZGQLBZLSLKYYHZTTNTJYQTZZPSZQZTLLJTYYLLQLLQYZQLBDZLSLYYZYMDFSZSNHLXZNCZQZPBWSKRFBSYZMTHBLGJPMCZZLSTLXSHTCSYZLZBLFEQHLXFLCJLYLJQCBZLZJHHSSTBRMHXZHJZCLXFNBGXGTQJCZTMSFZKJMSSNXLJKBHSJXNTNLZDNTLMSJXGZJYJCZXYJYJWRWWQNZTNFJSZPZSHZJFYRDJSFSZJZBJFZQZZHZLXFYSBZQLZSGYFTZDCSZXZJBQMSZKJRHYJZCKMJKHCHGTXKXQGLXPXFXTRTYLXJXHDTSJXHJZJXZWZLCQSBTXWXGXTXXHXFTSDKFJHZYJFJXRZSDLLLTQSQQZQWZXSYQTWGWBZCGZLLYZBCLMQQTZHZXZXLJFRMYZFLXYSQXXJKXRMQDZDMMYYBSQBHGZMWFWXGMXLZPYYTGZYCCDXYZXYWGSYJYZNBHPZJSQSYXSXRTFYZGRHZTXSZZTHCBFCLSYXZLZQMZLMPLMXZJXSFLBYZMYQHXJSXRXSQZZZSSLYFRCZJRCRXHHZXQYDYHXSJJHZCXZBTYNSYSXJBQLPXZQPYMLXZKYXLXCJLCYSXXZZLXDLLLJJYHZXGYJWKJRWYHCPSGNRZLFZWFZZNSXGXFLZSXZZZBFCSYJDBRJKRDHHGXJLJJTGXJXXSTJTJXLYXQFCSGSWMSBCTLQZZWLZZKXJMLTMJYHSDDBXGZHDLBMYJFRZFSGCLYJBPMLYSMSXLSZJQQHJZFXGFQFQBPXZGYYQXGZTCQWYLTLGWSGWHRLFSFGZJMGMGBGTJFSYZZGZYZAFLSSPMLPFLCWBJZCLJJMZLPJJLYMQDMYYYFBGYGYZMLYZDXQYXRQQQHSYYYQXYLJTYXFSFSLLGNQCYHYCWFHCCCFXPYLYPLLZYXXXXXKQHHXSHJZCFZSCZJXCPZWHHHHHAPYLQALPQAFYHXDYLUKMZQGGGDDESRNNZLTZGCHYPPYSQJJHCLLJTOLNJPZLJLHYMHEYDYDSQYCDDHGZUNDZCLZYZLLZNTNYZGSLHSLPJJBDGWXPCDUTJCKLKCLWKLLCASSTKZZDNQNTTLYYZSSYSSZZRYLJQKCQDHHCRXRZYDGRGCWCGZQFFFPPJFZYNAKRGYWYQPQXXFKJTSZZXSWZDDFBBXTBGTZKZNPZZPZXZPJSZBMQHKCYXYLDKLJNYPKYGHGDZJXXEAHPNZKZTZCMXCXMMJXNKSZQNMNLWBWWXJKYHCPSTMCSQTZJYXTPCTPDTNNPGLLLZSJLSPBLPLQHDTNJNLYYRSZFFJFQWDPHZDWMRZCCLODAXNSSNYZRESTYJWJYJDBCFXNMWTTBYLWSTSZGYBLJPXGLBOCLHPCBJLTMXZLJYLZXCLTPNCLCKXTPZJSWCYXSFYSZDKNTLBYJCYJLLSTGQCBXRYZXBXKLYLHZLQZLNZCXWJZLJZJNCJHXMNZZGJZZXTZJXYCYYCXXJYYXJJXSSSJSTSSTTPPGQTCSXWZDCSYFPTFBFHFBBLZJCLZZDBXGCXLQPXKFZFLSYLTUWBMQJHSZBMDDBCYSCCLDXYCDDQLYJJWMQLLCSGLJJSYFPYYCCYLTJANTJJPWYCMMGQYYSXDXQMZHSZXPFTWWZQSWQRFKJLZJQQYFBRXJHHFWJJZYQAZMYFRHCYYBYQWLPEXCCZSTYRLTTDMQLYKMBBGMYYJPRKZNPBSXYXBHYZDJDNGHPMFSGMWFZMFQMMBCMZZCJJLCNUXYQLMLRYGQZCYXZLWJGCJCGGMCJNFYZZJHYCPRRCMTZQZXHFQGTJXCCJEAQCRJYHPLQLSZDJRBCQHQDYRHYLYXJSYMHZYDWLDFRYHBPYDTSSCNWBXGLPZMLZZTQSSCPJMXXYCSJYTYCGHYCJWYRXXLFEMWJNMKLLSWTXHYYYNCMMCWJDQDJZGLLJWJRKHPZGGFLCCSCZMCBLTBHBQJXQDSPDJZZGHGLFQYWBZYZJLTSTDHQHCTCBCHFLQMPWDSHYYTQWCNZZJTLBYMBPDYYYXSQKXWYYFLXXNCWCXYPMAELYKKJMZZZBRXYYQJFLJPFHHHYTZZXSGQQMHSPGDZQWBWPJHZJDYSCQWZKTXXSQLZYYMYSDZGRXCKKUJLWPYSYSCSYZLRMLQSYLJXBCXTLWDQZPCYCYKPPPNSXFYZJJRCEMHSZMSXLXGLRWGCSTLRSXBZGBZGZTCPLUJLSLYLYMTXMTZPALZXPXJTJWTCYYZLBLXBZLQMYLXPGHDSLSSDMXMBDZZSXWHAMLCZCPJMCNHJYSNSYGCHSKQMZZQDLLKABLWJXSFMOCDXJRRLYQZKJMYBYQLYHETFJZFRFKSRYXFJTWDSXXSYSQJYSLYXWJHSNLXYYXHBHAWHHJZXWMYLJCSSLKYDZTXBZSYFDXGXZJKHSXXYBSSXDPYNZWRPTQZCZENYGCXQFJYKJBZMLJCMQQXUOXSLYXXLYLLJDZBTYMHPFSTTQQWLHOKYBLZZALZXQLHZWRRQHLSTMYPYXJJXMQSJFNBXYXYJXXYQYLTHYLQYFMLKLJTMLLHSZWKZHLJMLHLJKLJSTLQXYLMBHHLNLZXQJHXCFXXLHYHJJGBYZZKBXSCQDJQDSUJZYYHZHHMGSXCSYMXFEBCQWWRBPYYJQTYZCYQYQQZYHMWFFHGZFRJFCDPXNTQYZPDYKHJLFRZXPPXZDBBGZQSTLGDGYLCQMLCHHMFYWLZYXKJLYPQHSYWMQQGQZMLZJNSQXJQSYJYCBEHSXFSZPXZWFLLBCYYJDYTDTHWZSFJMQQYJLMQXXLLDTTKHHYBFPWTYYSQQWNQWLGWDEBZWCMYGCULKJXTMXMYJSXHYBRWFYMWFRXYQMXYSZTZZTFYKMLDHQDXWYYNLCRYJBLPSXCXYWLSPRRJWXHQYPHTYDNXHHMMYWYTZCSQMTSSCCDALWZTCPQPYJLLQZYJSWXMZZMMYLMXCLMXCZMXMZSQTZPPQQBLPGXQZHFLJJHYTJSRXWZXSCCDLXTYJDCQJXSLQYCLZXLZZXMXQRJMHRHZJBHMFLJLMLCLQNLDXZLLLPYPSYJYSXCQQDCMQJZZXHNPNXZMEKMXHYKYQLXSXTXJYYHWDCWDZHQYYBGYBCYSCFGPSJNZDYZZJZXRZRQJJYMCANYRJTLDPPYZBSTJKXXZYPFDWFGZZRPYMTNGXZQBYXNBUFNQKRJQZMJEGRZGYCLKXZDSKKNSXKCLJSPJYYZLQQJYBZSSQLLLKJXTBKTYLCCDDBLSPPFYLGYDTZJYQGGKQTTFZXBDKTYYHYBBFYTYYBCLPDYTGDHRYRNJSPTCSNYJQHKLLLZSLYDXXWBCJQSPXBPJZJCJDZFFXXBRMLAZHCSNDLBJDSZBLPRZTSWSBXBCLLXXLZDJZSJPYLYXXYFTFFFBHJJXGBYXJPMMMPSSJZJMTLYZJXSWXTYLEDQPJMYGQZJGDJLQJWJQLLSJGJGYGMSCLJJXDTYGJQJQJCJZCJGDZZSXQGSJGGCXHQXSNQLZZBXHSGZXCXYLJXYXYYDFQQJHJFXDHCTXJYRXYSQTJXYEFYYSSYYJXNCYZXFXMSYSZXYYSCHSHXZZZGZZZGFJDLTYLNPZGYJYZYYQZPBXQBDZTZCZYXXYHHSQXSHDHGQHJHGYWSZTMZMLHYXGEBTYLZKQWYTJZRCLEKYSTDBCYKQQSAYXCJXWWGSBHJYZYDHCSJKQCXSWXFLTYNYZPZCCZJQTZWJQDZZZQZLJJXLSBHPYXXPSXSHHEZTXFPTLQYZZXHYTXNCFZYYHXGNXMYWXTZSJPTHHGYMXMXQZXTSBCZYJYXXTYYZYPCQLMMSZMJZZLLZXGXZAAJZYXJMZXWDXZSXZDZXLEYJJZQBHZWZZZQTZPSXZTDSXJJJZNYAZPHXYYSRNQDTHZHYYKYJHDZXZLSWCLYBZYECWCYCRYLCXNHZYDZYDYJDFRJJHTRSQTXYXJRJHOJYNXELXSFSFJZGHPZSXZSZDZCQZBYYKLSGSJHCZSHDGQGXYZGXCHXZJWYQWGYHKSSEQZZNDZFKWYSSTCLZSTSYMCDHJXXYWEYXCZAYDMPXMDSXYBSQMJMZJMTZQLPJYQZCGQHXJHHLXXHLHDLDJQCLDWBSXFZZYYSCHTYTYYBHECXHYKGJPXHHYZJFXHWHBDZFYZBCAPNPGNYDMSXHMMMMAMYNBYJTMPXYYMCTHJBZYFCGTYHWPHFTWZZEZSBZEGPFMTSKFTYCMHFLLHGPZJXZJGZJYXZSBBQSCZZLZCCSTPGXMJSFTCCZJZDJXCYBZLFCJSYZFGSZLYBCWZZBYZDZYPSWYJZXZBDSYUXLZZBZFYGCZXBZHZFTPBGZGEJBSTGKDMFHYZZJHZLLZZGJQZLSFDJSSCBZGPDLFZFZSZYZYZSYGCXSNXXCHCZXTZZLJFZGQSQYXZJQDCCZTQCDXZJYQJQCHXZTDLGSCXZSYQJQTZWLQDQZTQCHQQJZYEZZZPBWKDJFCJPZTYPQYQTTYNLMBDKTJZPQZQZZFPZSBNJLGYJDXJDZZKZGQKXDLPZJTCJDQBXDJQJSTCKNXBXZMSLYJCQMTJQWWCJQNJNLLLHJCWQTBZQYDZCZPZZDZYDDCYZZZCCJTTJFZDPRRTZTJDCQTQZDTJNPLZBCLLCTZSXKJZQZPZLBZRBTJDCXFCZDBCCJJLTQQPLDCGZDBBZJCQDCJWYNLLZYZCCDWLLXWZLXRXNTQQCZXKQLSGDFQTDDGLRLAJJTKUYMKQLLTZYTDYYCZGJWYXDXFRSKSTQTENQMRKQZHHQKDLDAZFKYPBGGPZREBZZYKZZSPEGJXGYKQZZZSLYSYYYZWFQZYLZZLZHWCHKYPQGNPGBLPLRRJYXCCSYYHSFZFYBZYYTGZXYLXCZWXXZJZBLFFLGSKHYJZEYJHLPLLLLCZGXDRZELRHGKLZZYHZLYQSZZJZQLJZFLNBHGWLCZCFJYSPYXZLZLXGCCPZBLLCYBBBBUBBCBPCRNNZCZYRBFSRLDCGQYYQXYGMQZWTZYTYJXYFWTEHZZJYWLCCNTZYJJZDEDPZDZTSYQJHDYMBJNYJZLXTSSTPHNDJXXBYXQTZQDDTJTDYYTGWSCSZQFLSHLGLBCZPHDLYZJYCKWTYTYLBNYTSDSYCCTYSZYYEBHEXHQDTWNYGYCLXTSZYSTQMYGZAZCCSZZDSLZCLZRQXYYELJSBYMXSXZTEMBBLLYYLLYTDQYSHYMRQWKFKBFXNXSBYCHXBWJYHTQBPBSBWDZYLKGZSKYHXQZJXHXJXGNLJKZLYYCDXLFYFGHLJGJYBXQLYBXQPQGZTZPLNCYPXDJYQYDYMRBESJYYHKXXSTMXRCZZYWXYQYBMCLLYZHQYZWQXDBXBZWZMSLPDMYSKFMZKLZCYQYCZLQXFZZYDQZPZYGYJYZMZXDZFYFYTTQTZHGSPCZMLCCYTZXJCYTJMKSLPZHYSNZLLYTPZCTZZCKTXDHXXTQCYFKSMQCCYYAZHTJPCYLZLYJBJXTPNYLJYYNRXSYLMMNXJSMYBCSYSYLZYLXJJQYLDZLPQBFZZBLFNDXQKCZFYWHGQMRDSXYCYTXNQQJZYYPFZXDYZFPRXEJDGYQBXRCNFYYQPGHYJDYZXGRHTKYLNWDZNTSMPKLBTHBPYSZBZTJZSZZJTYYXZPHSSZZBZCZPTQFZMYFLYPYBBJQXZMXXDJMTSYSKKBJZXHJCKLPSMKYJZCXTMLJYXRZZQSLXXQPYZXMKYXXXJCLJPRMYYGADYSKQLSNDHYZKQXZYZTCGHZTLMLWZYBWSYCTBHJHJFCWZTXWYTKZLXQSHLYJZJXTMPLPYCGLTBZZTLZJCYJGDTCLKLPLLQPJMZPAPXYZLKKTKDZCZZBNZDYDYQZJYJGMCTXLTGXSZLMLHBGLKFWNWZHDXUHLFMKYSLGXDTWWFRJEJZTZHYDXYKSHWFZCQSHKTMQQHTZHYMJDJSKHXZJZBZZXYMPAGQMSTPXLSKLZYNWRTSQLSZBPSPSGZWYHTLKSSSWHZZLYYTNXJGMJSZSUFWNLSOZTXGXLSAMMLBWLDSZYLAKQCQCTMYCFJBSLXCLZZCLXXKSBZQCLHJPSQPLSXXCKSLNHPSFQQYTXYJZLQLDXZQJZDYYDJNZPTUZDSKJFSLJHYLZSQZLBTXYDGTQFDBYAZXDZHZJNHHQBYKNXJJQCZMLLJZKSPLDYCLBBLXKLELXJLBQYCXJXGCNLCQPLZLZYJTZLJGYZDZPLTQCSXFDMNYCXGBTJDCZNBGBQYQJWGKFHTNPYQZQGBKPBBYZMTJDYTBLSQMPSXTBNPDXKLEMYYCJYNZCTLDYKZZXDDXHQSHDGMZSJYCCTAYRZLPYLTLKXSLZCGGEXCLFXLKJRTLQJAQZNCMBYDKKCXGLCZJZXJHPTDJJMZQYKQSECQZDSHHADMLZFMMZBGNTJNNLGBYJBRBTMLBYJDZXLCJLPLDLPCQDHLXZLYCBLCXZZJADJLNZMMSSSMYBHBSQKBHRSXXJMXSDZNZPXLGBRHWGGFCXGMSKLLTSJYYCQLTSKYWYYHYWXBXQYWPYWYKQLSQPTNTKHQCWDQKTWPXXHCPTHTWUMSSYHBWCRWXHJMKMZNGWTMLKFGHKJYLSYYCXWHYECLQHKQHTTQKHFZLDXQWYZYYDESBPKYRZPJFYYZJCEQDZZDLATZBBFJLLCXDLMJSSXEGYGSJQXCWBXSSZPDYZCXDNYXPPZYDLYJCZPLTXLSXYZYRXCYYYDYLWWNZSAHJSYQYHGYWWAXTJZDAXYSRLTDPSSYYFNEJDXYZHLXLLLZQZSJNYQYQQXYJGHZGZCYJCHZLYCDSHWSHJZYJXCLLNXZJJYYXNFXMWFPYLCYLLABWDDHWDXJMCXZTZPMLQZHSFHZYNZTLLDYWLSLXHYMMYLMBWWKYXYADTXYLLDJPYBPWUXJMWMLLSAFDLLYFLBHHHBQQLTZJCQJLDJTFFKMMMBYTHYGDCQRDDWRQJXNBYSNWZDBYYTBJHPYBYTTJXAAHGQDQTMYSTQXKBTZPKJLZRBEQQSSMJJBDJOTGTBXPGBKTLHQXJJJCTHXQDWJLWRFWQGWSHCKRYSWGFTGYGBXSDWDWRFHWYTJJXXXJYZYSLPYYYPAYXHYDQKXSHXYXGSKQHYWFDDDPPLCJLQQEEWXKSYYKDYPLTJTHKJLTCYYHHJTTPLTZZCDLTHQKZXQYSTEEYWYYZYXXYYSTTJKLLPZMCYHQGXYHSRMBXPLLNQYDQHXSXXWGDQBSHYLLPJJJTHYJKYPPTHYYKTYEZYENMDSHLCRPQFDGFXZPSFTLJXXJBSWYYSKSFLXLPPLBBBLBSFXFYZBSJSSYLPBBFFFFSSCJDSTZSXZRYYSYFFSYZYZBJTBCTSBSDHRTJJBYTCXYJEYLXCBNEBJDSYXYKGSJZBXBYTFZWGENYHHTHZHHXFWGCSTBGXKLSXYWMTMBYXJSTZSCDYQRCYTWXZFHMYMCXLZNSDJTTTXRYCFYJSBSDYERXJLJXBBDEYNJGHXGCKGSCYMBLXJMSZNSKGXFBNBPTHFJAAFXYXFPXMYPQDTZCXZZPXRSYWZDLYBBKTYQPQJPZYPZJZNJPZJLZZFYSBTTSLMPTZRTDXQSJEHBZYLZDHLJSQMLHTXTJECXSLZZSPKTLZKQQYFSYGYWPCPQFHQHYTQXZKRSGTTSQCZLPTXCDYYZXSQZSLXLZMYCPCQBZYXHBSXLZDLTCDXTYLZJYYZPZYZLTXJSJXHLPMYTXCQRBLZSSFJZZTNJYTXMYJHLHPPLCYXQJQQKZZSCPZKSWALQSBLCCZJSXGWWWYGYKTJBBZTDKHXHKGTGPBKQYSLPXPJCKBMLLXDZSTBKLGGQKQLSBKKTFXRMDKBFTPZFRTBBRFERQGXYJPZSSTLBZTPSZQZSJDHLJQLZBPMSMMSXLQQNHKNBLRDDNXXDHDDJCYYGYLXGZLXSYGMQQGKHBPMXYXLYTQWLWGCPBMQXCYZYDRJBHTDJYHQSHTMJSBYPLWHLZFFNYPMHXXHPLTBQPFBJWQDBYGPNZTPFZJGSDDTQSHZEAWZZYLLTYYBWJKXXGHLFKXDJTMSZSQYNZGGSWQSPHTLSSKMCLZXYSZQZXNCJDQGZDLFNYKLJCJLLZLMZZNHYDSSHTHZZLZZBBHQZWWYCRZHLYQQJBEYFXXXWHSRXWQHWPSLMSSKZTTYGYQQWRSLALHMJTQJSMXQBJJZJXZYZKXBYQXBJXSHZTSFJLXMXZXFGHKZSZGGYLCLSARJYHSLLLMZXELGLXYDJYTLFBHBPNLYZFBBHPTGJKWETZHKJJXZXXGLLJLSTGSHJJYQLQZFKCGNNDJSSZFDBCTWWSEQFHQJBSAQTGYPQLBXBMMYWXGSLZHGLZGQYFLZBYFZJFRYSFMBYZHQGFWZSYFYJJPHZBYYZFFWODGRLMFTWLBZGYCQXCDJYGZYYYYTYTYDWEGAZYHXJLZYYHLRMGRXXZCLHNELJJTJTPWJYBJJBXJJTJTEEKHWSLJPLPSFYZPQQBDLQJJTYYQLYZKDKSQJYYQZLDQTGJQYZJSUCMRYQTHTEJMFCTYHYPKMHYZWJDQFHYYXWSHCTXRLJHQXHCCYYYJLTKTTYTMXGTCJTZAYYOCZLYLBSZYWJYTSJYHBYSHFJLYGJXXTMZYYLTXXYPZLXYJZYZYYPNHMYMDYYLBLHLSYYQQLLNJJYMSOYQBZGDLYXYLCQYXTSZEGXHZGLHWBLJHEYXTWQMAKBPQCGYSHHEGQCMWYYWLJYJHYYZLLJJYLHZYHMGSLJLJXCJJYCLYCJPCPZJZJMMYLCQLNQLJQJSXYJMLSZLJQLYCMMHCFMMFPQQMFYLQMCFFQMMMMHMZNFHHJGTTHHKHSLNCHHYQDXTMMQDCYZYXYQMYQYLTDCYYYZAZZCYMZYDLZFFFMMYCQZWZZMABTBYZTDMNZZGGDFTYPCGQYTTSSFFWFDTZQSSYSTWXJHXYTSXXYLBYQHWWKXHZXWZNNZZJZJJQJCCCHYYXBZXZCYZTLLCQXYNJYCYYCYNZZQYYYEWYCZDCJYCCHYJLBTZYYCQWMPWPYMLGKDLDLGKQQBGYCHJXY",oMultiDiff={ +19969:"DZ",19975:"WM",19988:"QJ",20048:"YL",20056:"SC",20060:"NM",20094:"QG",20127:"QJ",20167:"QC",20193:"YG",20250:"KH",20256:"ZC",20282:"SC",20285:"QJG",20291:"TD",20314:"YD",20315:"BF",20340:"NE",20375:"TD",20389:"YJ",20391:"CZ",20415:"PB",20446:"YS",20447:"SQ",20504:"TC",20608:"KG",20854:"QJ",20857:"ZC",20911:"PF",20985:"AW",21032:"PB",21048:"XQ",21049:"SC",21089:"YS",21119:"JC",21242:"SB",21273:"SC",21305:"YP",21306:"QO",21330:"ZC",21333:"SDC",21345:"QK",21378:"CA",21397:"SC",21414:"XS",21442:"SC",21477:"JG",21480:"TD",21484:"ZS",21494:"YX",21505:"YX",21512:"HG",21523:"XH",21537:"PB",21542:"PF",21549:"KH",21571:"E",21574:"DA",21588:"TD",21589:"O",21618:"ZC",21621:"KHA",21632:"ZJ",21654:"KG",21679:"LKG",21683:"KH",21710:"A",21719:"YH",21734:"WOE",21769:"A",21780:"WN",21804:"XH",21834:"A",21899:"ZD",21903:"RN",21908:"WO",21939:"ZC",21956:"SA",21964:"YA",21970:"TD",22003:"A",22031:"JG",22040:"XS",22060:"ZC",22066:"ZC",22079:"MH",22129:"XJ",22179:"XA",22237:"NJ",22244:"TD",22280:"JQ",22300:"YH",22313:"XW",22331:"YQ",22343:"YJ",22351:"PH",22395:"DC",22412:"TD",22484:"PB",22500:"PB",22534:"ZD",22549:"DH",22561:"PB",22612:"TD",22771:"KQ",22831:"HB",22841:"JG",22855:"QJ",22865:"XQ",23013:"ML",23081:"WM",23487:"SX",23558:"QJ",23561:"YW",23586:"YW",23614:"YW",23615:"SN",23631:"PB",23646:"ZS",23663:"ZT",23673:"YG",23762:"TD",23769:"ZS",23780:"QJ",23884:"QK",24055:"XH",24113:"DC",24162:"ZC",24191:"GA",24273:"QJ",24324:"NL",24377:"TD",24378:"QJ",24439:"PF",24554:"ZS",24683:"TD",24694:"WE",24733:"LK",24925:"TN",25094:"ZG",25100:"XQ",25103:"XH",25153:"PB",25170:"PB",25179:"KG",25203:"PB",25240:"ZS",25282:"FB",25303:"NA",25324:"KG",25341:"ZY",25373:"WZ",25375:"XJ",25384:"A",25457:"A",25528:"SD",25530:"SC",25552:"TD",25774:"ZC",25874:"ZC",26044:"YW",26080:"WM",26292:"PB",26333:"PB",26355:"ZY",26366:"CZ",26397:"ZC",26399:"QJ",26415:"ZS",26451:"SB",26526:"ZC",26552:"JG",26561:"TD",26588:"JG",26597:"CZ",26629:"ZS",26638:"YL",26646:"XQ",26653:"KG",26657:"XJ",26727:"HG",26894:"ZC",26937:"ZS",26946:"ZC",26999:"KJ",27099:"KJ",27449:"YQ",27481:"XS",27542:"ZS",27663:"ZS",27748:"TS",27784:"SC",27788:"ZD",27795:"TD",27812:"O",27850:"PB",27852:"MB",27895:"SL",27898:"PL",27973:"QJ",27981:"KH",27986:"HX",27994:"XJ",28044:"YC",28065:"WG",28177:"SM",28267:"QJ",28291:"KH",28337:"ZQ",28463:"TL",28548:"DC",28601:"TD",28689:"PB",28805:"JG",28820:"QG",28846:"PB",28952:"TD",28975:"ZC",29100:"A",29325:"QJ",29575:"SL",29602:"FB",30010:"TD",30044:"CX",30058:"PF",30091:"YSP",30111:"YN",30229:"XJ",30427:"SC",30465:"SX",30631:"YQ",30655:"QJ",30684:"QJG",30707:"SD",30729:"XH",30796:"LG",30917:"PB",31074:"NM",31085:"JZ",31109:"SC",31181:"ZC",31192:"MLB",31293:"JQ",31400:"YX",31584:"YJ",31896:"ZN",31909:"ZY",31995:"XJ",32321:"PF",32327:"ZY",32418:"HG",32420:"XQ",32421:"HG",32438:"LG",32473:"GJ",32488:"TD",32521:"QJ",32527:"PB",32562:"ZSQ",32564:"JZ",32735:"ZD",32793:"PB",33071:"PF",33098:"XL",33100:"YA",33152:"PB",33261:"CX",33324:"BP",33333:"TD",33406:"YA",33426:"WM",33432:"PB",33445:"JG",33486:"ZN",33493:"TS",33507:"QJ",33540:"QJ",33544:"ZC",33564:"XQ",33617:"YT",33632:"QJ",33636:"XH",33637:"YX",33694:"WG",33705:"PF",33728:"YW",33882:"SR",34067:"WM",34074:"YW",34121:"QJ",34255:"ZC",34259:"XL",34425:"JH",34430:"XH",34485:"KH",34503:"YS",34532:"HG",34552:"XS",34558:"YE",34593:"ZL",34660:"YQ",34892:"XH",34928:"SC",34999:"QJ",35048:"PB",35059:"SC",35098:"ZC",35203:"TQ",35265:"JX",35299:"JX",35782:"SZ",35828:"YS",35830:"E",35843:"TD",35895:"YG",35977:"MH",36158:"JG",36228:"QJ",36426:"XQ",36466:"DC",36710:"JC",36711:"ZYG",36767:"PB",36866:"SK",36951:"YW",37034:"YX",37063:"XH",37218:"ZC",37325:"ZC",38063:"PB",38079:"TD",38085:"QY",38107:"DC",38116:"TD",38123:"YD",38224:"HG",38241:"XTC",38271:"ZC",38415:"YE",38426:"KH",38461:"YD",38463:"AE",38466:"PB",38477:"XJ",38518:"YT",38551:"WK",38585:"ZC",38704:"XS",38739:"LJ",38761:"GJ",38808:"SQ",39048:"JG",39049:"XJ",39052:"HG",39076:"CZ",39271:"XT",39534:"TD",39552:"TD",39584:"PB",39647:"SB",39730:"LG",39748:"TPB",40109:"ZQ",40479:"ND",40516:"HG",40536:"HG",40583:"QJ",40765:"YQ",40784:"QJ",40840:"YK",40863:"QJG"},_checkPYCh=function(ch){var uni=ch.charCodeAt(0);return uni>40869||uni<19968?ch:oMultiDiff[uni]?oMultiDiff[uni]:_ChineseFirstPY.charAt(uni-19968)},_mkPYRslt=function(arr,ignoreMulti){for(var arrRslt=[""],k,multiLen=0,i=0,len=arr.length;i14||ignoreMulti){var tmpStr=str.substring(0,1);for(k=0;k0&&(this._items[0]=lastElt,this._sinkDown(0)),elt}},push:function(item){this._items[this._size++]=item,this._bubbleUp(this._size-1)},size:function(){return this._size},peek:function(){if(0!==this._size)return this._items[0]},_heapify:function(){for(var index=Math.floor((this._size+1)/2);index>=0;index--)this._sinkDown(index)},_bubbleUp:function(index){for(var elt=this._items[index];index>0;){var parentIndex=Math.floor((index+1)/2)-1,parentElt=this._items[parentIndex];if(this._comparator(parentElt,elt))return;this._items[parentIndex]=elt,this._items[index]=parentElt,index=parentIndex}},_sinkDown:function(index){for(var elt=this._items[index];;){var leftChildIndex=2*(index+1)-1,rightChildIndex=2*(index+1),swapIndex=-1;if(leftChildIndex=0;--i)xs[i]=0;return xs},ceilLog2=function(x){for(var y=1;y0;--i)this._heap[i]=this._heap[2*i]+this._heap[2*i+1]},BI.PrefixIntervalTree.prototype={constructor:BI.PrefixIntervalTree,set:function(index,value){var node=this._half+index;for(this._heap[node]=value,node=parent(node);0!==node;node=parent(node))this._heap[node]=this._heap[2*node]+this._heap[2*node+1]},get:function(index){var node=this._half+index;return this._heap[node]},getSize:function(){return this._size},sumUntil:function(end){if(0===end)return 0;for(var node=this._half+end-1,sum=this._heap[node];1!==node;node=parent(node))node%2===1&&(sum+=this._heap[node-1]);return sum},sumTo:function(inclusiveEnd){return this.sumUntil(inclusiveEnd+1)},sum:function(begin,end){return this.sumUntil(end)-this.sumUntil(begin)},greatestLowerBound:function(t){if(t<0)return-1;var node=1;if(this._heap[node]<=t)return this._size;for(;node=0;--i)xs[i]=initialValue;return new BI.PrefixIntervalTree(xs)},BI.PrefixIntervalTree.empty=function(size){return BI.PrefixIntervalTree.uniform(size,0)}}(),!function(){BI.Queue=function(capacity){this.capacity=capacity,this.array=[]},BI.Queue.prototype={constructor:BI.Queue,contains:function(v){return BI.contains(this.array,v)},indexOf:function(v){return BI.contains(this.array,v)},getElementByIndex:function(index){return this.array[index]},push:function(v){this.array.push(v),this.capacity&&this.array.length>this.capacity&&this.array.shift()},pop:function(){this.array.pop()},shift:function(){this.array.shift()},unshift:function(v){this.array.unshift(v),this.capacity&&this.array.length>this.capacity&&this.array.pop()},remove:function(v){BI.remove(this.array,v)},splice:function(){this.array.splice.apply(this.array,arguments)},slice:function(){this.array.slice.apply(this.array,arguments)},size:function(){return this.array.length},each:function(fn,scope){var scope=scope||window,fn=fn||null;if(null!=fn&&"function"==typeof fn)for(var i=0;i0?{children:children}:{})},toJSON:function(node){var self=this,result=[];return BI.each((node||this.root).getChildren(),function(i,child){result.push(self._toJSON(child))}),result},_toJSONWithNode:function(node){var self=this,children=[];return BI.each(node.getChildren(),function(i,child){children.push(self._toJSONWithNode(child))}),BI.extend({id:node.id},BI.deepClone(node.get("data")),{node:node},children.length>0?{children:children}:{})},toJSONWithNode:function(node){var self=this,result=[];return BI.each((node||this.root).getChildren(),function(i,child){result.push(self._toJSONWithNode(child))}),result},search:function(root,target,param){if(!(root instanceof BI.Node))return arguments.callee.apply(this,[this.root,root,target]);var self=this,next=null;return BI.isNull(target)?null:BI.isEqual(root[param||"id"],target)?root:(BI.any(root.getChildren(),function(i,child){if(next=self.search(child,target,param),null!==next)return!0}),next)},_traverse:function(node,callback){var queue=[];for(queue.push(node);!BI.isEmpty(queue);){var temp=queue.shift(),b=callback&&callback(temp);if(b===!1)break;b!==!0&&null!=temp&&(queue=queue.concat(temp.getChildren()))}},traverse:function(callback){this._traverse(this.root,callback)},_recursion:function(node,route,callback){var self=this;return BI.every(node.getChildren(),function(i,child){var next=BI.clone(route);next.push(child.id);var b=callback&&callback(child,next);return b!==!1&&(b===!0||self._recursion(child,next,callback))})},recursion:function(callback){this._recursion(this.root,[],callback)},inOrderTraverse:function(callback){this._inOrderTraverse(this.root,callback)},_inOrderTraverse:function(node,callback){null!=node&&(this._inOrderTraverse(node.getLeft()),callback&&callback(node),this._inOrderTraverse(node.getRight()))},nrInOrderTraverse:function(callback){for(var stack=[],node=this.root;null!=node||!BI.isEmpty(stack);){for(;null!=node;)stack.push(node),node=node.getLeft();node=stack.pop(),callback&&callback(node),node=node.getRight()}},preOrderTraverse:function(callback){this._preOrderTraverse(this.root,callback)},_preOrderTraverse:function(node,callback){null!=node&&(callback&&callback(node),this._preOrderTraverse(node.getLeft()),this._preOrderTraverse(node.getRight()))},nrPreOrderTraverse:function(callback){for(var stack=[],node=this.root;null!=node||!BI.isEmpty(stack);){for(;null!=node;)callback&&callback(node),stack.push(node),node=node.getLeft();node=stack.pop(),node=node.getRight()}},postOrderTraverse:function(callback){this._postOrderTraverse(this.root,callback)},_postOrderTraverse:function(node,callback){null!=node&&(this._postOrderTraverse(node.getLeft()),this._postOrderTraverse(node.getRight()),callback&&callback(node))},nrPostOrderTraverse:function(callback){for(var stack=[],node=this.root,preNode=null;null!=node||!BI.isEmpty(stack);){for(;null!=node;)stack.push(node),node=node.getLeft();node=BI.last(stack),null==node.getRight()||node.getRight()==preNode?(callback&&callback(node),node=stack.pop(),preNode=node,node=null):node=node.getRight()}}},BI.Node=function(id){BI.isObject(id)?BI.extend(this,id):this.id=id,this.clear.apply(this,arguments)},BI.Node.prototype={constructor:BI.Node,set:function(key,value){return BI.isObject(key)?void BI.extend(this,key):void(this[key]=value)},get:function(key){return this[key]},isLeaf:function(){return BI.isEmpty(this.children)},getChildren:function(){return this.children},getChildrenLength:function(){return this.children.length},getFirstChild:function(){return BI.first(this.children)},getLastChild:function(){return BI.last(this.children)},setLeft:function(left){this.left=left},getLeft:function(){return this.left},setRight:function(right){this.right=right},getRight:function(){return this.right},setParent:function(parent){this.parent=parent},getParent:function(){return this.parent},getChild:function(index){return this.children[index]},getChildIndex:function(id){return BI.findIndex(this.children,function(i,ch){return ch.get("id")===id})},removeChild:function(id){this.removeChildByIndex(this.getChildIndex(id))},removeChildByIndex:function(index){var before=this.getChild(index-1),behind=this.getChild(index+1);null!=before&&before.setRight(behind||null),null!=behind&&behind.setLeft(before||null),this.children.splice(index,1)},removeAllChilds:function(){this.children=[]},addChild:function(child,index){var cur=null;cur=BI.isUndefined(index)?this.children.length-1:index-1,child.setParent(this),cur>=0&&(this.getChild(cur)&&this.getChild(cur).setRight(child),child.setLeft(this.getChild(cur))),BI.isUndefined(index)?this.children.push(child):this.children.splice(index,0,child)},equals:function(obj){return this===obj||this.id===obj.id},clear:function(){this.parent=null,this.left=null,this.right=null,this.children=[]}},BI.extend(BI.Tree,{transformToArrayFormat:function(nodes,pId){if(!nodes)return[];var r=[];if(BI.isArray(nodes))for(var i=0,l=nodes.length;i=this.x&&x<=this.x+this.w&&y>=this.y&&y<=this.y+this.h)},getPosition:function(){var pos=[];return pos.push(this.x+this.w/2),pos.push(this.y+this.h/2),pos}},BI.BehaviorFactory={createBehavior:function(key,options){var behavior;switch(key){case"highlight":behavior=BI.HighlightBehavior;break;case"redmark":behavior=BI.RedMarkBehavior}return new behavior(options)}},BI.Behavior=BI.inherit(BI.OB,{_defaultConfig:function(){return BI.extend(BI.Behavior.superclass._defaultConfig.apply(this,arguments),{rule:function(){return!0}})},_init:function(){BI.Behavior.superclass._init.apply(this,arguments)},doBehavior:function(){}}),BI.Layout=BI.inherit(BI.Widget,{props:function(){return{scrollable:null,scrollx:!1,scrolly:!1,items:[]}},render:function(){this._init4Margin(),this._init4Scroll()},_init4Margin:function(){this.options.top&&this.element.css("top",this.options.top),this.options.left&&this.element.css("left",this.options.left),this.options.bottom&&this.element.css("bottom",this.options.bottom),this.options.right&&this.element.css("right",this.options.right)},_init4Scroll:function(){switch(this.options.scrollable){case!0:this.element.css("overflow","auto");break;case!1:this.element.css("overflow","hidden")}this.options.scrollx&&this.element.css({"overflow-x":"auto","overflow-y":"hidden"}),this.options.scrolly&&this.element.css({"overflow-x":"hidden","overflow-y":"auto"})},appendFragment:function(frag){this.element.append(frag)},_mountChildren:function(){var self=this,frag=BI.Widget._renderEngine.createFragment(),hasChild=!1;BI.each(this._children,function(i,widget){widget.element!==self.element&&(frag.appendChild(widget.element[0]),hasChild=!0)}),hasChild===!0&&this.appendFragment(frag)},_getChildName:function(index){return index+""},_addElement:function(i,item,context){var self=this,w;return this.hasWidget(this._getChildName(i))?w=this.getWidgetByName(this._getChildName(i)):(w=BI.createWidget(item,context),w.on(BI.Events.DESTROY,function(){BI.each(self._children,function(name,child){child===w&&(BI.remove(self._children,child),self.removeItemAt(0|name))})}),this.addWidget(this._getChildName(i),w)),w},_getOptions:function(item){return item instanceof BI.Widget&&(item=item.options),item=BI.stripEL(item),item instanceof BI.Widget&&(item=item.options),item},_compare:function(item1,item2){function eq(a,b,aStack,bStack){if(a===b)return 0!==a||1/a===1/b;if(null==a||null==b)return a===b;var className=Object.prototype.toString.call(a);switch(className){case"[object RegExp]":case"[object String]":return""+a==""+b;case"[object Number]":return+a!==+a?+b!==+b:0===+a?1/+a===1/b:+a===+b;case"[object Date]":case"[object Boolean]":return+a===+b}var areArrays="[object Array]"===className;if(!areArrays){if(BI.isFunction(a)&&BI.isFunction(b))return!0;a=self._getOptions(a),b=self._getOptions(b)}aStack=aStack||[],bStack=bStack||[];for(var length=aStack.length;length--;)if(aStack[length]===a)return bStack[length]===b;if(aStack.push(a),bStack.push(b),areArrays){if(length=a.length,length!==b.length)return!1;for(;length--;)if(!eq(a[length],b[length],aStack,bStack))return!1}else{var keys=_.keys(a),key;if(length=keys.length,_.keys(b).length!==length)return!1;for(;length--;)if(key=keys[length],!_.has(b,key)||!eq(a[key],b[key],aStack,bStack))return!1}return aStack.pop(),bStack.pop(),!0}var self=this;return eq(item1,item2)},_getWrapper:function(){return this.element},_addItemAt:function(index,item){for(var i=this.options.items.length;i>index;i--)this._children[this._getChildName(i)]=this._children[this._getChildName(i-1)];delete this._children[this._getChildName(index)],this.options.items.splice(index,0,item)},_removeItemAt:function(index){for(var i=index;ithis.options.items.length)){this._addItemAt(index,item);var w=this._addElement(index,item);return index>0?this._children[this._getChildName(index-1)].element.after(w.element):w.element.prependTo(this._getWrapper()),w._mount(),w}},removeItemAt:function(indexes){indexes=BI.isArray(indexes)?indexes:[indexes];for(var deleted=[],newItems=[],newChildren={},i=0,len=this.options.items.length;ithis.options.items.length-1)return!1;var child=this._children[this._getChildName(index)];return child.shouldUpdate?child.shouldUpdate(this._getOptions(item))===!0:null},updateItemAt:function(index,item){if(!(index<0||index>this.options.items.length-1)){ +var child=this._children[this._getChildName(index)],updated;if(updated=child.update(this._getOptions(item)))return updated;var del=this._children[this._getChildName(index)];delete this._children[this._getChildName(index)],this.options.items.splice(index,1);var w=this._addElement(index,item);this.options.items.splice(index,0,item),this._children[this._getChildName(index)]=w,index>0?this._children[this._getChildName(index-1)].element.after(w.element):w.element.prependTo(this._getWrapper()),del._destroy(),w._mount()}},addItems:function(items,context){var self=this,o=this.options,fragment=BI.Widget._renderEngine.createFragment(),added=[];BI.each(items,function(i,item){var w=self._addElement(o.items.length,item,context);self._children[self._getChildName(o.items.length)]=w,o.items.push(item),added.push(w),fragment.appendChild(w.element[0])}),this._isMounted&&(this._getWrapper().append(fragment),BI.each(added,function(i,w){w._mount()}))},prependItems:function(items,context){var self=this;items=items||[];for(var fragment=BI.Widget._renderEngine.createFragment(),added=[],i=items.length-1;i>=0;i--){this._addItemAt(0,items[i]);var w=this._addElement(0,items[i],context);self._children[self._getChildName(0)]=w,this.options.items.unshift(items[i]),added.push(w),fragment.appendChild(w.element[0])}this._isMounted&&(this._getWrapper().prepend(fragment),BI.each(added,function(i,w){w._mount()}))},getValue:function(){var self=this,value=[],child;return BI.each(this.options.items,function(i){if(child=self._children[self._getChildName(i)]){var v=child.getValue();v=BI.isArray(v)?v:[v],value=value.concat(v)}}),value},setValue:function(v){var self=this,child;BI.each(this.options.items,function(i){(child=self._children[self._getChildName(i)])&&child.setValue(v)})},setText:function(v){var self=this,child;BI.each(this.options.items,function(i){(child=self._children[self._getChildName(i)])&&child.setText(v)})},patchItem:function(oldVnode,vnode,index){var shouldUpdate=this.shouldUpdateItem(index,vnode);if(shouldUpdate===!0||null===shouldUpdate&&!this._compare(oldVnode,vnode))return this.updateItemAt(index,vnode)},updateChildren:function(oldCh,newCh){function sameVnode(vnode1,vnode2,oldIndex,newIndex){return vnode1=self._getOptions(vnode1),vnode2=self._getOptions(vnode2),BI.isKey(vnode1.key)?vnode1.key===vnode2.key:oldIndex>=0?oldIndex===newIndex:void 0}function addNode(vnode,index){var opt=self._getOptions(vnode),key=null==opt.key?self._getChildName(index):opt.key;return children[key]=self._addElement(key,vnode)}function addVnodes(before,vnodes,startIdx,endIdx){for(;startIdx<=endIdx;++startIdx){var node=addNode(vnodes[startIdx],startIdx);insertBefore(node,before,!1,startIdx)}}function removeVnodes(vnodes,startIdx,endIdx){for(;startIdx<=endIdx;++startIdx){var ch=vnodes[startIdx];if(BI.isNotNull(ch)){var node=self._getOptions(ch),key=null==node.key?self._getChildName(startIdx):node.key;delete self._children[self._getChildName(key)],children[key]._destroy()}}}function insertBefore(insert,before,isNext,index){insert=self._getOptions(insert),before=before&&self._getOptions(before);var insertKey=BI.isKey(insert.key)?insert.key:self._getChildName(index);if(before&&children[before.key]){var beforeKey=BI.isKey(before.key)?before.key:self._getChildName(index),next;next=isNext?children[beforeKey].element.next():children[beforeKey].element,next.length>0?next.before(children[insertKey].element):self._getWrapper().append(children[insertKey].element)}else self._getWrapper().append(children[insertKey].element)}function findOldVnode(vnodes,vNode,beginIdx,endIdx){var i,found;for(i=beginIdx;i<=endIdx;++i)vnodes[i]&&sameVnode(vnodes[i],vNode)&&(found=vnodes[i]);return found}var self=this,oldStartIdx=0,newStartIdx=0,oldEndIdx=oldCh.length-1,oldStartVnode=oldCh[0],oldEndVnode=oldCh[oldEndIdx],newEndIdx=newCh.length-1,newStartVnode=newCh[0],newEndVnode=newCh[newEndIdx],before,updated,children={};for(BI.each(oldCh,function(i,child){child=self._getOptions(child);var key=null==child.key?i:child.key;BI.isKey(key)&&(children[key]=self._children[self._getChildName(i)])});oldStartIdx<=oldEndIdx&&newStartIdx<=newEndIdx;)if(BI.isNull(oldStartVnode))oldStartVnode=oldCh[++oldStartIdx];else if(BI.isNull(oldEndVnode))oldEndVnode=oldCh[--oldEndIdx];else if(sameVnode(oldStartVnode,newStartVnode,oldStartIdx,newStartIdx))updated=this.patchItem(oldStartVnode,newStartVnode,oldStartIdx)||updated,children[null==oldStartVnode.key?this._getChildName(oldStartIdx):oldStartVnode.key]=this._children[this._getChildName(oldStartIdx)],oldStartVnode=oldCh[++oldStartIdx],newStartVnode=newCh[++newStartIdx];else if(sameVnode(oldEndVnode,newEndVnode,oldEndIdx,newEndIdx))updated=this.patchItem(oldEndVnode,newEndVnode,oldEndIdx)||updated,children[null==oldEndVnode.key?this._getChildName(oldEndIdx):oldEndVnode.key]=this._children[this._getChildName(oldEndIdx)],oldEndVnode=oldCh[--oldEndIdx],newEndVnode=newCh[--newEndIdx];else if(sameVnode(oldStartVnode,newEndVnode))updated=this.patchItem(oldStartVnode,newEndVnode,oldStartIdx)||updated,children[null==oldStartVnode.key?this._getChildName(oldStartIdx):oldStartVnode.key]=this._children[this._getChildName(oldStartIdx)],insertBefore(oldStartVnode,oldEndVnode,!0),oldStartVnode=oldCh[++oldStartIdx],newEndVnode=newCh[--newEndIdx];else if(sameVnode(oldEndVnode,newStartVnode))updated=this.patchItem(oldEndVnode,newStartVnode,oldEndIdx)||updated,children[null==oldEndVnode.key?this._getChildName(oldEndIdx):oldEndVnode.key]=this._children[this._getChildName(oldEndIdx)],insertBefore(oldEndVnode,oldStartVnode),oldEndVnode=oldCh[--oldEndIdx],newStartVnode=newCh[++newStartIdx];else{var sameOldVnode=findOldVnode(oldCh,newStartVnode,oldStartIdx,oldEndIdx);if(BI.isNull(sameOldVnode)){var node=addNode(newStartVnode);insertBefore(node,oldStartVnode),newStartVnode=newCh[++newStartIdx]}else BI.each(oldCh,function(index,child){child&&sameVnode(child,newStartVnode)&&(updated=self.patchItem(sameOldVnode,newStartVnode,index)||updated,children[null==sameOldVnode.key?self._getChildName(index):sameOldVnode.key]=self._children[self._getChildName(index)],oldCh[index]=void 0,insertBefore(sameOldVnode,oldStartVnode))}),newStartVnode=newCh[++newStartIdx]}return oldStartIdx>oldEndIdx?(before=BI.isNull(newCh[newEndIdx+1])?null:newCh[newEndIdx+1],addVnodes(before,newCh,newStartIdx,newEndIdx)):newStartIdx>newEndIdx&&removeVnodes(oldCh,oldStartIdx,oldEndIdx),this._children={},BI.each(newCh,function(i,child){var node=self._getOptions(child),key=null==node.key?self._getChildName(i):node.key;children[key]._mount(),self._children[self._getChildName(i)]=children[key]}),updated},update:function(opt){var o=this.options,items=opt.items||[],updated=this.updateChildren(o.items,items);return this.options.items=items,updated},stroke:function(items){var self=this;BI.each(items,function(i,item){item&&self._addElement(i,item)})},removeWidget:function(nameOrWidget){var removeIndex;BI.isWidget(nameOrWidget)?BI.each(this._children,function(name,child){child===nameOrWidget&&(removeIndex=name)}):removeIndex=nameOrWidget,removeIndex&&this._removeItemAt(0|removeIndex)},empty:function(){BI.Layout.superclass.empty.apply(this,arguments),this.options.items=[]},destroy:function(){BI.Layout.superclass.destroy.apply(this,arguments),this.options.items=[]},populate:function(items){var self=this,o=this.options;return items=items||[],this._isMounted?void this.update({items:items}):(this.options.items=items,void this.stroke(items))},resize:function(){}}),BI.shortcut("bi.layout",BI.Layout),BI.Plugin=BI.Plugin||{},!function(){var _WidgetsPlugin={},_ObjectPlugin={},_ConfigPlugin={},_GlobalWidgetConfigFn,_GlobalObjectConfigFn;BI.extend(BI.Plugin,{getWidget:function(type,options){if(_GlobalWidgetConfigFn&&_GlobalWidgetConfigFn(type,options),_ConfigPlugin[type])for(var i=_ConfigPlugin[type].length-1;i>=0;i--)_ConfigPlugin[type][i](options);if(_WidgetsPlugin[type])for(var res,i=_WidgetsPlugin[type].length-1;i>=0;i--)if(res=_WidgetsPlugin[type][i](options))return res;return options},config:function(widgetConfigFn,objectConfigFn){_GlobalWidgetConfigFn=widgetConfigFn,_GlobalObjectConfigFn=objectConfigFn},configWidget:function(type,fn){_ConfigPlugin[type]||(_ConfigPlugin[type]=[]),_ConfigPlugin[type].push(fn)},registerWidget:function(type,fn){_WidgetsPlugin[type]||(_WidgetsPlugin[type]=[]),_WidgetsPlugin[type].length>0&&console.log("组件已经注册过了!"),_WidgetsPlugin[type].push(fn)},relieveWidget:function(type){delete _WidgetsPlugin[type]},getObject:function(type,object){if(_GlobalObjectConfigFn&&_GlobalObjectConfigFn(type,object),_ObjectPlugin[type])for(var res,i=0,len=_ObjectPlugin[type].length;i0&&console.log("对象已经注册过了!"),_ObjectPlugin[type].push(fn)},relieveObject:function(type){delete _ObjectPlugin[type]}})}(),BI.Action=BI.inherit(BI.OB,{_defaultConfig:function(){return BI.extend(BI.Action.superclass._defaultConfig.apply(this,arguments),{src:null,tar:null})},_init:function(){BI.Action.superclass._init.apply(this,arguments)},actionPerformed:function(src,tar,callback){},actionBack:function(tar,src,callback){}}),BI.ActionFactory={createAction:function(key,options){var action;switch(key){case"show":action=BI.ShowAction}return new action(options)}},BI.ShowAction=BI.inherit(BI.Action,{_defaultConfig:function(){return BI.extend(BI.ShowAction.superclass._defaultConfig.apply(this,arguments),{})},_init:function(){BI.ShowAction.superclass._init.apply(this,arguments)},actionPerformed:function(src,tar,callback){tar=tar||this.options.tar,tar.setVisible(!0),callback&&callback()},actionBack:function(tar,src,callback){tar=tar||this.options.tar,tar.setVisible(!1),callback&&callback()}}),function(){function isEmpty(value){var result=""===value||null===value||void 0===value;return result}function isInvalidDate(date){return"Invalid Date"==date||"NaN"==date}function _eFormat(text,fmt){function eFormat(num,format){var neg=num<0?(num*=-1,"-"):"",magnitudeNeg="",funcName=num>0&&num<1?"floor":"ceil",magnitude=Math[funcName](Math.log(num)/Math.log(10));if(!isFinite(magnitude))return format.replace(/#/gi,"").replace(/\.e/gi,"E");num/=Math.pow(10,magnitude),num>0&&num<1&&(num*=10,magnitude-=1);var integerLen=getInteger(magnitude,format);integerLen>1&&(magnitude-=integerLen-1,num*=Math.pow(10,integerLen-1)),magnitude<0&&(magnitudeNeg="-",magnitude*=-1);var precision=getPrecision(format),isValueCarry=isValueCarried(num);return num*=Math.pow(10,precision),num=Math.round(num),isValueCarry&&(num/=10,magnitude+="-"===magnitudeNeg?-1:1),num/=Math.pow(10,precision),num=num.toFixed(precision),magnitude=formatExponential(format,magnitude,magnitudeNeg),neg+num+"E"+magnitude}function formatExponential(format,num,magnitudeNeg){if(num+="",!/e/gi.test(format))return num;for(format=format.split(/e/gi)[1];num.length1?arr[1].length:0}function getInteger(magnitude,format){if(!/e/gi.test(format))return 0;var formatLeft=format.split(/e/gi)[0].split(".")[0],i,f,len=formatLeft.length,valueLeftLen=0;for(i=0;i-1)return text>=0?_numberFormat(text+"",format.substring(0,numMod)):_numberFormat(-text+"",format.substr(numMod+1));if(+text<0&&"-"!==format.charAt(0))return _numberFormat(-text+"","-"+format);var fp=format.split("."),fleft=fp[0]||"",fright=fp[1]||"";text=_dealNumberPrecision(text,fright);var tp=text.split("."),tleft=tp[0]||"",tright=tp[1]||"";if(/[%‰]$/.test(format)){var paddingZero=/[%]$/.test(format)?"00":"000";tright+=paddingZero,tleft+=tright.substr(0,paddingZero.length),tleft=tleft.replace(/^0+/gi,""),tright=tright.substr(paddingZero.length).replace(/0+$/gi,"")}var right=_dealWithRight(tright,fright);right.leftPlus&&(tleft=parseInt(tleft)+1+"",tleft=isNaN(tleft)?"1":tleft),right=right.num;var left=_dealWithLeft(tleft,fleft);return/[0-9]/.test(left)||(left+="0"),/[0-9]/.test(right)?left+"."+right:left+right}function _dealWithRight(tright,fright){for(var right="",j=0,i=0,len=fright.length;i4){result.leftPlus=!0;var numReg=right.match(/^[0-9]+/);if(numReg){var num=numReg[0],orilen=num.length,newnum=parseInt(num)+1+"";newnum.length>orilen?newnum=newnum.substr(1):(newnum=BI.leftPad(newnum,orilen,"0"),result.leftPlus=!1),right=right.replace(/^[0-9]+/,newnum)}}return result.num=right,result}function _dealWithLeft(tleft,fleft){for(var left="",j=tleft.length-1,combo=-1,last=-1,i=fleft.length-1;i>=0;i--){var ch=fleft.charAt(i),c=tleft.charAt(j);switch(ch){case"0":isEmpty(c)&&(c="0"),last=-1,left=c+left,j--;break;case"#":last=i,left=c+left,j--;break;case",":if(!isEmpty(c)){var com=fleft.match(/,[#0]+/);com&&(combo=com[0].length-1),left=","+left}break;default:left=ch+left}}if(last>-1){var tll=tleft.substr(0,j+1);left=left.substr(0,last)+tll+left.substr(last)}if(combo>0){var res=left.match(/[0-9]+,/);if(res){res=res[0];for(var newstr="",n=res.length-1-combo;n>=0;n-=combo)newstr=res.substr(n,combo)+","+newstr;var lres=res.substr(0,n+combo);isEmpty(lres)||(newstr=lres+","+newstr)}left=left.replace(/[0-9]+,/,newstr)}return left}var _global;_global="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,_global.BI||(_global.BI={}),BI.cjkEncode=function(text){if("string"!=typeof text)return text;for(var newText="",i=0;i=128||91===code||93===code?"["+code.toString(16)+"]":text.charAt(i)}return newText},BI.cjkDecode=function(text){if(null==text)return"";if(!isNaN(text)||text.indexOf("[")==-1)return text;for(var newText="",i=0;ii+1){var subText=text.substring(i+1,rightIdx);subText.length>0&&(ch=String.fromCharCode(eval("0x"+subText))),i=rightIdx}}newText+=ch}return newText};var SPECIAL_TAGS={"&":"&",'"':""","<":"<",">":">"," ":" "};BI.htmlEncode=function(text){return BI.isNull(text)?"":BI.replaceAll(text+"",'&|"|<|>|\\s',function(v){return SPECIAL_TAGS[v]?SPECIAL_TAGS[v]:" "})},BI.htmlDecode=function(text){return BI.isNull(text)?"":BI.replaceAll(text+"","&|"|<|>| ",function(v){switch(v){case"&":return"&";case""":return'"';case"<":return"<";case">":return">";case" ":default:return" "}})},BI.cjkEncodeDO=function(o){if(BI.isPlainObject(o)){var result={};return _.each(o,function(v,k){"string"!=typeof v&&(v=BI.jsonEncode(v)),k=BI.cjkEncode(k),result[k]=BI.cjkEncode(v)}),result}return o},BI.jsonEncode=function(o){var useHasOwn=!!{}.hasOwnProperty,m={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},encodeString=function(s){return/["\\\x00-\x1f]/.test(s)?'"'+s.replace(/([\x00-\x1f\\"])/g,function(a,b){var c=m[b];return c?c:(c=b.charCodeAt(),"\\u00"+Math.floor(c/16).toString(16)+(c%16).toString(16))})+'"':'"'+s+'"'},encodeArray=function(o){var a=["["],b,i,l=o.length,v;for(i=0;i2?BI.Date._MN[date.getMonth()]:len<2?date.getMonth()+1:BI.leftPad(date.getMonth()+1+"",2,"0");break;case"d":str=len>1?BI.leftPad(date.getDate()+"",2,"0"):date.getDate();break;case"h":var hour=date.getHours()%12;0===hour&&(hour=12),str=len>1?BI.leftPad(hour+"",2,"0"):hour;break;case"H":str=len>1?BI.leftPad(date.getHours()+"",2,"0"):date.getHours();break;case"m":str=len>1?BI.leftPad(date.getMinutes()+"",2,"0"):date.getMinutes();break;case"s":str=len>1?BI.leftPad(date.getSeconds()+"",2,"0"):date.getSeconds();break;case"a":str=date.getHours()<12?"am":"pm";break;case"z":str=BI.getTimezone(date);break;default:str=jfmt.str}return str}if(!date)return"";var len=format.length,result="";if(len>0){for(var flagch=format.charAt(0),start=0,str=flagch,i=1;iBI.Widget._renderEngine.createElement("body").outerWidth()&&(x-=tooltip.element.outerWidth()+15);var bodyHeight=BI.Widget._renderEngine.createElement("body").outerHeight();return y+tooltip.element.outerHeight()>bodyHeight||top+tooltip.element.outerHeight()>bodyHeight?(y-=tooltip.element.outerHeight()+15,!opt.belowMouse&&(y=Math.min(y,offset.top-tooltip.element.outerHeight()-5))):!opt.belowMouse&&(y=Math.max(y,top)),tooltip.element.css({left:x<0?0:x+"px",top:y<0?0:y+"px"}),tooltip.element.hover(function(){self.remove(name),context.element.trigger("mouseleave.title"+context.getName())}),this},add:function(name,bubble){return this.has(name)?this:(this.set(name,bubble),this)},get:function(name){return this.tooltipsManager[name]},set:function(name,bubble){this.tooltipsManager[name]=bubble},has:function(name){return null!=this.tooltipsManager[name]},remove:function(name){return this.has(name)?(this.tooltipsManager[name].destroy(),delete this.tooltipsManager[name],this):this}}),_.extend(BI,{Events:{KEYDOWN:"_KEYDOWN",BACKSPACE:"_BACKSPACE",SPACE:"_SPACE",ENTER:"_ENTER",CONFIRM:"_CONFIRM",ERROR:"_ERROR",PAUSE:"_PAUSE",DESTROY:"_DESTROY",MOUNT:"_MOUNT",UNMOUNT:"_UNMOUNT",CLEAR:"_CLEAR",ADD:"_ADD",EDITING:"_EDITING",EMPTY:"_EMPTY",VIEW:"_VIEW",RESIZE:"_RESIZE",BEFOREEDIT:"_BEFOREEDIT",AFTEREDIT:"_AFTEREDIT",STARTEDIT:"_STARTEDIT",STOPEDIT:"_STOPEDIT",CHANGE:"_CHANGE",EXPAND:"_EXPAND",COLLAPSE:"_COLLAPSE",CALLBACK:"_CALLBACK",CLICK:"_CLICK",STATECHANGE:"_STATECHANGE",BEFORESTATECHANGE:"_BEFORESTATECHANGE",INIT:"_INIT",AFTERINIT:"_AFTERINIT",SCROLL:"_SCROLL",STARTLOAD:"_STARTLOAD",AFTERLOAD:"_AFTERLOAD",BS:"beforesubmit",AS:"aftersubmit",SC:"submitcomplete",SF:"submitfailure",SS:"submitsuccess",BVW:"beforeverifywrite",AVW:"afterverifywrite",AV:"afterverify",BW:"beforewrite",AW:"afterwrite",WS:"writesuccess",WF:"writefailure",BA:"beforeappend",AA:"afterappend",BD:"beforedelete",AD:"beforedelete",UC:"unloadcheck",BTOPDF:"beforetopdf",ATOPDF:"aftertopdf",BTOEXCEL:"beforetoexcel",ATOEXCEL:"aftertoexcel",BTOWORD:"beforetoword",ATOWORD:"aftertoword",BTOIMAGE:"beforetoimage",ATOIMAGE:"aftertoimage",BTOHTML:"beforetohtml",ATOHTML:"aftertohtml",BIMEXCEL:"beforeimportexcel",AIMEXCEL:"afterimportexcel",BPDFPRINT:"beforepdfprint",APDFPRINT:"afterpdfprint",BFLASHPRINT:"beforeflashprint",AFLASHPRINT:"afterflashprint",BAPPLETPRINT:"beforeappletprint",AAPPLETPRINT:"afterappletprint",BSEVERPRINT:"beforeserverprint",ASERVERPRINT:"afterserverprint",BEMAIL:"beforeemail",AEMAIL:"afteremail"}}),_.extend(BI,{pushArray:function(sArray,array){for(var i=0;imonthDay&&(day=monthDay),dt.setDate(day),dt.setMonth(dt.getMonth()+3*parseInt(n)),dt},getQuarterStartMonth:function(date){var quarterStartMonth=0,nowMonth=date.getMonth();return nowMonth<3&&(quarterStartMonth=0),28&&(quarterStartMonth=9),quarterStartMonth},getQuarterStartDate:function(date){return BI.getDate(date.getFullYear(),BI.getQuarterStartMonth(date),1)},getQuarterEndDate:function(date){var quarterEndMonth=BI.getQuarterStartMonth(date)+2;return BI.getDate(date.getFullYear(),quarterEndMonth,BI.getMonthDays(date,quarterEndMonth))},getOffsetMonth:function(date,n){var dt=BI.getDate(BI.getTime(date.getFullYear(),date.getMonth(),date.getDate(),date.getHours(),date.getMinutes(),date.getSeconds())),day=dt.getDate(),monthDay=BI.getMonthDays(BI.getDate(dt.getFullYear(),dt.getMonth()+parseInt(n),1));return day>monthDay&&(day=monthDay),dt.setDate(day),dt.setMonth(dt.getMonth()+parseInt(n)),dt},getWeekStartDate:function(date){var w=date.getDay(),startOfWeek=BI.StartOfWeek%7;return BI.getOffsetDate(date,BI.Date._OFFSET[w=12,ir=pm?hr-12:hr,dy=BI.getDayOfYear(date);0==ir&&(ir=12);var min=date.getMinutes(),sec=date.getSeconds();s["%a"]=BI.Date._SDN[w],s["%A"]=BI.Date._DN[w],s["%b"]=BI.Date._SMN[m],s["%B"]=BI.Date._MN[m],s["%C"]=1+Math.floor(y/100),s["%d"]=d<10?"0"+d:d,s["%e"]=d,s["%H"]=hr<10?"0"+hr:hr,s["%I"]=ir<10?"0"+ir:ir,s["%j"]=dy<100?dy<10?"00"+dy:"0"+dy:dy,s["%k"]=hr+"",s["%l"]=ir+"",s["%X"]=m<9?"0"+(1+m):1+m,s["%x"]=m+1,s["%M"]=min<10?"0"+min:min,s["%n"]="\n",s["%p"]=pm?"PM":"AM",s["%P"]=pm?"pm":"am",s["%s"]=Math.floor(date.getTime()/1e3),s["%S"]=sec<10?"0"+sec:sec,s["%t"]="\t",s["%U"]=s["%W"]=s["%V"]=wn<10?"0"+wn:wn,s["%u"]=w+1,s["%w"]=w,s["%y"]=yWith4number.substr(2,2),s["%Y"]=yWith4number,s["%%"]="%",s["%Q"]=qr;var re=/%./g;if(BI.isKhtml=BI.isKhtml||function(){return!!_global.navigator&&/Konqueror|Safari|KHTML/i.test(navigator.userAgent)},!(str.indexOf("%Y")===-1&&str.indexOf("%y")===-1||str.indexOf("%W")===-1&&str.indexOf("%U")===-1&&str.indexOf("%V")===-1))switch(wn){case 1:11===m&&(s["%y"]=parseInt(s["%y"])+1,s["%Y"]=parseInt(s["%Y"])+1);break;case 53:0===m&&(s["%y"]=parseInt(s["%y"])-1,s["%Y"]=parseInt(s["%Y"])-1)}if(!BI.isKhtml())return str.replace(re,function(par){return s[par]||par});for(var a=str.match(re),i=0;i-1?text===keyword?isArray?matched.push(item):matched[i]=item:isArray?find.push(item):find[i]=item:(pidx=py.indexOf(keyword),pidx>-1&&Math.floor(pidx/text.length)===Math.floor((pidx+keyword.length-1)/text.length)&&(text===keyword||keyword.length===text.length?isArray?matched.push(item):matched[i]=item:isArray?find.push(item):find[i]=item))}}),{match:matched,find:find}}}),_.extend(BI,{beforeFunc:function(sFunc,func){var __self=sFunc;return function(){return func.apply(sFunc,arguments)!==!1&&__self.apply(sFunc,arguments)}},afterFunc:function(sFunc,func){var __self=sFunc;return function(){var ret=__self.apply(sFunc,arguments);return ret!==!1&&(func.apply(sFunc,arguments),ret)}}}),_.extend(BI,{add:function(num,arg){function accAdd(arg1,arg2){var r1,r2,m,c;try{r1=arg1.toString().split(".")[1].length}catch(e){r1=0}try{r2=arg2.toString().split(".")[1].length}catch(e){r2=0}if(c=Math.abs(r1-r2),m=Math.pow(10,Math.max(r1,r2)),c>0){var cm=Math.pow(10,c);r1>r2?(arg1=Number(arg1.toString().replace(".","")),arg2=Number(arg2.toString().replace(".",""))*cm):(arg1=Number(arg1.toString().replace(".",""))*cm,arg2=Number(arg2.toString().replace(".","")))}else arg1=Number(arg1.toString().replace(".","")),arg2=Number(arg2.toString().replace(".",""));return(arg1+arg2)/m}return accAdd(arg,num)},sub:function(num,arg){function accSub(arg1,arg2){var r1,r2,m,n;try{r1=arg1.toString().split(".")[1].length}catch(e){r1=0}try{r2=arg2.toString().split(".")[1].length}catch(e){r2=0}return m=Math.pow(10,Math.max(r1,r2)),n=r1>=r2?r1:r2,((arg1*m-arg2*m)/m).toFixed(n)}return accSub(num,arg)},mul:function(num,arg){function accMul(arg1,arg2){var m=0,s1=arg1.toString(),s2=arg2.toString();try{m+=s1.split(".")[1].length}catch(e){}try{m+=s2.split(".")[1].length}catch(e){}return Number(s1.replace(".",""))*Number(s2.replace(".",""))/Math.pow(10,m)}return accMul(arg,num)},div:function(num,arg){function digitLength(num){var eSplit=num.toString().split(/[eE]/),len=(eSplit[0].split(".")[1]||"").length-+(eSplit[1]||0);return len>0?len:0}function float2Fixed(num){if(num.toString().indexOf("e")===-1)return Number(num.toString().replace(".",""));var dLen=digitLength(num);return dLen>0?num*Math.pow(10,dLen):num}function times(num1,num2){for(var others=[],_i=2;_i0)return times.apply(void 0,[times(num1,num2),others[0]].concat(others.slice(1)));var num1Changed=float2Fixed(num1),num2Changed=float2Fixed(num2),baseNum=digitLength(num1)+digitLength(num2),leftValue=num1Changed*num2Changed;return leftValue/Math.pow(10,baseNum)}function accDivide(num1,num2){for(var others=[],_i=2;_i0)return accDivide.apply(void 0,[accDivide(num1,num2),others[0]].concat(others.slice(1)));var num1Changed=float2Fixed(num1),num2Changed=float2Fixed(num2);return times(num1Changed/num2Changed,Math.pow(10,digitLength(num2)-digitLength(num1)))}return accDivide(num,arg)}}),_.extend(BI,{startWith:function(str,startTag){return str=str||"",!(null==startTag||""==startTag||0===str.length||startTag.length>str.length)&&str.substr(0,startTag.length)==startTag},endWith:function(str,endTag){return!(null==endTag||""==endTag||0===str.length||endTag.length>str.length)&&str.substring(str.length-endTag.length)==endTag},getQuery:function(str,name){var reg=new RegExp("(^|&)"+name+"=([^&]*)(&|$)"),r=str.substr(str.indexOf("?")+1).match(reg);return r?unescape(r[2]):null},appendQuery:function(str,paras){if(!paras)return str;var src=str;return src.indexOf("?")===-1&&(src+="?"),src.endWith("?")!==!1||(src+="&"),_.each(paras,function(value,name){"string"==typeof name&&(src+=name+"="+value+"&")}),src=src.substr(0,src.length-1)},replaceAll:function(str,s1,s2){return str.replace(new RegExp(s1,"gm"),s2)},perfectStart:function(str,start){return str.startWith(start)?str:start+str},allIndexOf:function(str,sub){if("string"!=typeof sub)return[];for(var location=[],offset=0;str.length>0;){var loc=str.indexOf(sub);if(loc===-1)break;location.push(offset+loc),str=str.substring(loc+sub.length,str.length),offset+=loc+sub.length}return location}}),!function(){var i18nStore={};_.extend(BI,{addI18n:function(i18n){BI.extend(i18nStore,i18n)},i18nText:function(key){var localeText=i18nStore[key]||BI.i18n&&BI.i18n[key]||"";localeText||(localeText=key);var len=arguments.length;if(len>1){if(!(localeText.indexOf("{R1}")>-1)){var args=Array.prototype.slice.call(arguments),count=1;return BI.replaceAll(localeText,"\\{\\s*\\}",function(){return args[count++]+""})}for(var i=1;i1?v.toString():v[0]:v,BI.isNull(v))throw new Error("value cannot be null");var cardName=o.cardNameCreator(v);if(!o.cardLayout.isCardExisted(cardName)){var card=o.cardCreator(cardName);o.cardLayout.addCardByName(cardName,card),o.afterCardCreated(cardName)}o.cardLayout.showCardByName(cardName),BI.nextTick(function(){o.afterCardShow(cardName),self.fireEvent(BI.ShowListener.EVENT_CHANGE,cardName)})}})}}),BI.ShowListener.EVENT_CHANGE="EVENT_CHANGE",BI.StyleLoaderManager=BI.inherit(BI.OB,{_defaultConfig:function(){return BI.extend(BI.StyleLoaderManager.superclass._defaultConfig.apply(this,arguments),{})},_init:function(){BI.StyleLoaderManager.superclass._init.apply(this,arguments),this.stylesManager={}},loadStyle:function(name,styleString){if(_global.document){var d=document,styles=d.createElement("style");return d.getElementsByTagName("head")[0].appendChild(styles),styles.setAttribute("type","text/css"),styles.styleSheet?styles.styleSheet.cssText=styleString:styles.appendChild(document.createTextNode(styleString)),this.stylesManager[name]=styles,this}},get:function(name){return this.stylesManager[name]},has:function(name){return null!=this.stylesManager[name]},removeStyle:function(name){return this.has(name)?(this.stylesManager[name].parentNode.removeChild(this.stylesManager[name]),delete this.stylesManager[name],this):this}}),BI.Logic=BI.inherit(BI.OB,{createLogic:function(){return this.options||{}}}),BI.LogicFactory={Type:{Vertical:"vertical",Horizontal:"horizontal",Table:"table",HorizontalFill:"horizontal_fill"},createLogic:function(key,options){var logic;switch(key){case BI.LogicFactory.Type.Vertical:logic=BI.VerticalLayoutLogic;break;case BI.LogicFactory.Type.Horizontal:logic=BI.HorizontalLayoutLogic;break;case BI.LogicFactory.Type.Table:logic=BI.TableLayoutLogic;break;case BI.LogicFactory.Type.HorizontalFill:logic=BI.HorizontalFillLayoutLogic;break;default:logic=BI.Logic}return new logic(options).createLogic()},createLogicTypeByDirection:function(direction){switch(direction){case BI.Direction.Top:case BI.Direction.Bottom:case BI.Direction.Custom:return BI.LogicFactory.Type.Vertical;case BI.Direction.Left:case BI.Direction.Right:return BI.LogicFactory.Type.Horizontal}},createLogicItemsByDirection:function(direction){var layout,items=Array.prototype.slice.call(arguments,1);switch(items=BI.map(items,function(i,item){return BI.isWidget(item)?{el:item,width:item.options.width,height:item.options.height}:item}),direction){case BI.Direction.Bottom:layout=BI.LogicFactory.Type.Vertical,items.reverse();break;case BI.Direction.Right:layout=BI.LogicFactory.Type.Horizontal,items.reverse();break;case BI.Direction.Custom:items=items.slice(1)}return items}},BI.VerticalLayoutLogic=BI.inherit(BI.Logic,{_defaultConfig:function(){return BI.extend(BI.VerticalLayoutLogic.superclass._defaultConfig.apply(this,arguments),{dynamic:!1,scrollable:null,scrolly:!1,scrollx:!1,items:[],hgap:0,vgap:0,lgap:0,rgap:0,tgap:0,bgap:0})},createLogic:function(){var layout,o=this.options;return layout=o.dynamic?"bi.vertical":"bi.vtape",{type:layout,scrollable:o.scrollable,scrolly:o.scrolly,scrollx:o.scrollx,hgap:o.hgap,vgap:o.vgap,lgap:o.lgap,rgap:o.rgap,tgap:o.tgap,bgap:o.bgap,items:o.items}},_init:function(){BI.VerticalLayoutLogic.superclass._init.apply(this,arguments)}}),BI.HorizontalLayoutLogic=BI.inherit(BI.Logic,{_defaultConfig:function(){return BI.extend(BI.HorizontalLayoutLogic.superclass._defaultConfig.apply(this,arguments),{dynamic:!1,scrollable:null,scrolly:!1,scrollx:!1,items:[],hgap:0,vgap:0,lgap:0,rgap:0,tgap:0,bgap:0})},createLogic:function(){var layout,o=this.options;return layout=o.dynamic?"bi.vertical_adapt":"bi.htape",{type:layout,scrollable:o.scrollable,scrolly:o.scrolly,scrollx:o.scrollx,hgap:o.hgap,vgap:o.vgap,lgap:o.lgap,rgap:o.rgap,tgap:o.tgap,bgap:o.bgap,items:o.items}},_init:function(){BI.HorizontalLayoutLogic.superclass._init.apply(this,arguments)}}),BI.TableLayoutLogic=BI.inherit(BI.Logic,{_defaultConfig:function(){return BI.extend(BI.TableLayoutLogic.superclass._defaultConfig.apply(this,arguments),{dynamic:!1,scrollable:null,scrolly:!1,scrollx:!1,columns:0,rows:0,columnSize:[],rowSize:[],hgap:0,vgap:0,items:[]})},createLogic:function(){var layout,o=this.options;return layout=o.dynamic?"bi.table":"bi.window",{type:layout,scrollable:o.scrollable,scrolly:o.scrolly,scrollx:o.scrollx,columns:o.columns,rows:o.rows,columnSize:o.columnSize,rowSize:o.rowSize,hgap:o.hgap,vgap:o.vgap,items:o.items}},_init:function(){BI.TableLayoutLogic.superclass._init.apply(this,arguments)}}),BI.HorizontalFillLayoutLogic=BI.inherit(BI.Logic,{_defaultConfig:function(){return BI.extend(BI.HorizontalFillLayoutLogic.superclass._defaultConfig.apply(this,arguments),{dynamic:!1,scrollable:null,scrolly:!1,scrollx:!1,items:[],hgap:0,vgap:0,lgap:0,rgap:0,tgap:0,bgap:0})},createLogic:function(){var layout,o=this.options,columnSize=[];return BI.each(o.items,function(i,item){columnSize.push(item.width||0)}),layout=o.dynamic?"bi.horizontal_adapt":"bi.htape",{type:layout,columnSize:columnSize,scrollable:o.scrollable,scrolly:o.scrolly,scrollx:o.scrollx,hgap:o.hgap,vgap:o.vgap,lgap:o.lgap,rgap:o.rgap,tgap:o.tgap,bgap:o.bgap,items:o.items}},_init:function(){BI.HorizontalFillLayoutLogic.superclass._init.apply(this,arguments)}}),BI.prepares.push(function(){var _isSupportFlex,isSupportFlex=function(){return null==_isSupportFlex&&(_isSupportFlex=!(!BI.isSupportCss3||!BI.isSupportCss3("flex"))),_isSupportFlex};BI.Plugin.registerWidget("bi.horizontal",function(ob){var isIE=BI.isIE(),supportFlex=isSupportFlex(),isLessIE8=isIE&&BI.getIEVersion()<8;return ob.verticalAlign===BI.VerticalAlign.Middle&&ob.horizontalAlign===BI.HorizontalAlign.Center?isLessIE8?ob:BI.extend(ob,{type:"bi.table_adapt"}):ob.verticalAlign===BI.VerticalAlign.Middle&&ob.horizontalAlign===BI.HorizontalAlign.Left?isLessIE8?ob:BI.extend(ob,{type:"bi.table_adapt"}):ob.verticalAlign===BI.VerticalAlign.Top&&ob.horizontalAlign===BI.HorizontalAlign.Center?isLessIE8?ob:BI.extend(ob,{type:"bi.table_adapt"}):isIE?ob:supportFlex?BI.extend(ob,{type:"bi.flex_horizontal"}):BI.extend(ob,{type:"bi.table_adapt"})}),BI.Plugin.registerWidget("bi.center_adapt",function(ob){var isIE=BI.isIE(),supportFlex=isSupportFlex(),justOneItem=ob.items&&ob.items.length<=1;return!isIE&&supportFlex&&justOneItem?ob.scrollable===!0||ob.scrollx===!0||ob.scrolly===!0?BI.extend(ob,{type:"bi.flex_scrollable_center_adapt"}):BI.extend(ob,{type:"bi.flex_center_adapt"}):justOneItem?BI.extend(ob,{type:"bi.inline_center_adapt"}):ob}),BI.Plugin.registerWidget("bi.vertical_adapt",function(ob){ +var isIE=BI.isIE(),supportFlex=isSupportFlex();return!isIE&&supportFlex?ob.scrollable===!0||ob.scrollx===!0||ob.scrolly===!0?BI.extend({},ob,{type:"bi.flex_scrollable_vertical_center_adapt"}):BI.extend(ob,{type:"bi.flex_vertical_center_adapt"}):BI.extend(ob,{type:"bi.inline_vertical_adapt"})}),BI.Plugin.registerWidget("bi.horizontal_adapt",function(ob){return ob.items&&ob.items.length<=1?BI.extend(ob,{type:"bi.horizontal_auto"}):ob}),BI.Plugin.registerWidget("bi.float_center_adapt",function(ob){return!BI.isIE()&&isSupportFlex()?ob.scrollable===!0||ob.scrollx===!0||ob.scrolly===!0?BI.extend({},ob,{type:"bi.flex_scrollable_center_adapt"}):BI.extend(ob,{type:"bi.flex_center_adapt"}):BI.extend(ob,{type:"bi.inline_center_adapt"})}),BI.Plugin.registerWidget("bi.flex_horizontal",function(ob){if(ob.scrollable===!0||ob.scrolly===!0)return BI.extend({},ob,{type:"bi.flex_scrollable_horizontal"})}),BI.Plugin.registerWidget("bi.flex_vertical",function(ob){if(ob.scrollable===!0||ob.scrollx===!0)return BI.extend({},ob,{type:"bi.flex_scrollable_vertical"})}),BI.Plugin.registerWidget("bi.flex_horizontal_adapt",function(ob){if(ob.scrollable===!0||ob.scrollx===!0)return BI.extend({},ob,{type:"bi.flex_scrollable_horizontal_adapt"})}),BI.Plugin.registerWidget("bi.flex_vertical_adapt",function(ob){if(ob.scrollable===!0||ob.scrolly===!0)return BI.extend({},ob,{type:"bi.flex_scrollable_vertical_adapt"})}),BI.Plugin.registerWidget("bi.flex_horizontal_center_adapt",function(ob){if(ob.scrollable===!0||ob.scrollx===!0)return BI.extend({},ob,{type:"bi.flex_scrollable_horizontal_adapt"})}),BI.Plugin.registerWidget("bi.flex_vertical_center_adapt",function(ob){if(ob.scrollable===!0||ob.scrolly===!0)return BI.extend({},ob,{type:"bi.flex_scrollable_vertical_adapt"})}),BI.Plugin.registerWidget("bi.flex_center_adapt",function(ob){if(ob.scrollable===!0||ob.scrolly===!0||ob.scrollx===!0)return BI.extend({},ob,{type:"bi.flex_scrollable_center_adapt"})}),BI.Plugin.registerWidget("bi.radio",function(ob){return BI.isIE()&&BI.getIEVersion()<9?BI.extend(ob,{type:"bi.image_radio"}):ob}),BI.Plugin.registerWidget("bi.checkbox",function(ob){return BI.isIE()&&BI.getIEVersion()<9?BI.extend(ob,{type:"bi.image_checkbox"}):ob}),BI.Plugin.registerWidget("bi.half_icon_button",function(ob){return BI.isIE()&&BI.getIEVersion()<9?ob:BI.extend(ob,{type:"bi.half_button"})})}),!function(){var attachEvent=_global.document&&_global.document.attachEvent,stylesCreated=!1;if(_global.document&&!attachEvent){var requestFrame=function(){var raf=_global.requestAnimationFrame||_global.mozRequestAnimationFrame||_global.webkitRequestAnimationFrame||function(fn){return _global.setTimeout(fn,20)};return function(fn){return raf(fn)}}(),cancelFrame=function(){var cancel=_global.cancelAnimationFrame||_global.mozCancelAnimationFrame||_global.webkitCancelAnimationFrame||_global.clearTimeout;return function(id){return cancel(id)}}(),resetTriggers=function(element){var triggers=element.__resizeTriggers__,expand=triggers.firstElementChild,contract=triggers.lastElementChild,expandChild=expand.firstElementChild;contract.scrollLeft=contract.scrollWidth,contract.scrollTop=contract.scrollHeight,expandChild.style.width=expand.offsetWidth+1+"px",expandChild.style.height=expand.offsetHeight+1+"px",expand.scrollLeft=expand.scrollWidth,expand.scrollTop=expand.scrollHeight},checkTriggers=function(element){return element.offsetWidth!==element.__resizeLast__.width||element.offsetHeight!==element.__resizeLast__.height},scrollListener=function(e){var element=this;resetTriggers(this),this.__resizeRAF__&&cancelFrame(this.__resizeRAF__),this.__resizeRAF__=requestFrame(function(){checkTriggers(element)&&(element.__resizeLast__.width=element.offsetWidth,element.__resizeLast__.height=element.offsetHeight,element.__resizeListeners__.forEach(function(fn){fn.call(element,e)}))})},animation=!1,animationstring="animation",keyframeprefix="",animationstartevent="animationstart",domPrefixes="Webkit Moz O ms".split(" "),startEvents="webkitAnimationStart animationstart oAnimationStart MSAnimationStart".split(" "),pfx="",elm=document.createElement("fakeelement");if(void 0!==elm.style.animationName&&(animation=!0),animation===!1)for(var i=0;i div, .contract-trigger:before { content: " "; display: block; position: absolute; top: 0; left: 0; height: 100%; width: 100%; overflow: hidden; } .resize-triggers > div { background: #eee; overflow: auto; } .contract-trigger:before { width: 200%; height: 200%; }',head=document.head||document.getElementsByTagName("head")[0],style=document.createElement("style");style.type="text/css",style.styleSheet?style.styleSheet.cssText=css:style.appendChild(document.createTextNode(css)),head.appendChild(style),stylesCreated=!0}},addResizeListener=function(element,fn){attachEvent?(element.attachEvent("onresize",fn),BI.nextTick(fn)):(element.__resizeTriggers__||("static"===getComputedStyle(element).position&&(element.style.position="relative"),createStyles(),element.__resizeLast__={},element.__resizeListeners__=[],(element.__resizeTriggers__=document.createElement("div")).className="resize-triggers",element.__resizeTriggers__.innerHTML='
    ',element.appendChild(element.__resizeTriggers__),resetTriggers(element),element.addEventListener("scroll",scrollListener,!0),animationstartevent&&element.__resizeTriggers__.addEventListener(animationstartevent,function(e){e.animationName===animationName&&resetTriggers(element)})),element.__resizeListeners__.push(fn))},removeResizeListener=function(element,fn){attachEvent?element.detachEvent("onresize",fn):(element.__resizeListeners__.splice(element.__resizeListeners__.indexOf(fn),1),element.__resizeListeners__.length||(element.removeEventListener("scroll",scrollListener),element.__resizeTriggers__=!element.removeChild(element.__resizeTriggers__)))};BI.ResizeDetector={addResizeListener:function(widget,fn){return addResizeListener(widget.element[0],fn),function(){removeResizeListener(widget.element[0],fn)}},removeResizeListener:function(widget,fn){removeResizeListener(widget.element[0],fn)}}}(),!function(){BI.DOM={},BI.extend(BI.DOM,{ready:function(fn){BI.Widget._renderEngine.createElement(document).ready(fn)}}),BI.extend(BI.DOM,{patchProps:function(fromElement,toElement){var elemData=BI.jQuery._data(fromElement[0]),events=elemData.events;BI.each(events,function(eventKey,event){BI.each(event,function(i,handler){toElement.on(eventKey+(handler.namespace?"."+handler.namespace:""),handler)})});var fromChildren=fromElement.children(),toChildren=toElement.children();if(fromChildren.length!==toChildren.length)throw new Error("不匹配");BI.each(fromChildren,function(i,child){BI.DOM.patchProps(BI.jQuery(child),BI.jQuery(toChildren[i]))}),BI.each(fromElement.data("__widgets"),function(i,widget){widget.element=toElement})},hang:function(doms){if(!BI.isEmpty(doms)){var frag=BI.Widget._renderEngine.createFragment();return BI.each(doms,function(i,dom){dom instanceof BI.Widget&&(dom=dom.element),dom instanceof BI.$&&dom[0]&&frag.appendChild(dom[0])}),frag}},isExist:function(obj){return BI.Widget._renderEngine.createElement("body").find(obj.element).length>0},preloadImages:function(srcArray,onload){function complete(){count++,count>=srcArray.length&&onload()}var count=0,images=[];BI.each(srcArray,function(i,src){images[i]=new Image,images[i].src=src,images[i].onload=function(){complete()},images[i].onerror=function(){complete()}})},getTextSizeWidth:function(text,fontSize){var span=BI.Widget._renderEngine.createElement("").addClass("text-width-span").appendTo("body");null==fontSize&&(fontSize=12),fontSize+="px",span.css("font-size",fontSize).text(text);var width=span.width();return span.remove(),width},getTextSizeHeight:function(text,fontSize){var span=BI.Widget._renderEngine.createElement("").addClass("text-width-span").appendTo("body");null==fontSize&&(fontSize=12),fontSize+="px",span.css("font-size",fontSize).text(text);var height=span.height();return span.remove(),height},getScrollWidth:function(){if(BI.isNull(this._scrollWidth)||0===this._scrollWidth){var ul=BI.Widget._renderEngine.createElement("
    ").width(50).height(50).css({position:"absolute",top:"-9999px",overflow:"scroll"}).appendTo("body");this._scrollWidth=ul[0].offsetWidth-ul[0].clientWidth,ul.destroy()}return this._scrollWidth},getImage:function(param,fillStyle,backgroundColor){var canvas=document.createElement("canvas"),ratio=2;BI.Widget._renderEngine.createElement("body").append(canvas);var ctx=canvas.getContext("2d");ctx.font="12px Georgia";var w=ctx.measureText(param).width+4;canvas.width=w*ratio,canvas.height=16*ratio,ctx.font=12*ratio+"px Georgia",ctx.fillStyle=fillStyle||"#3685f2",ctx.textBaseline="middle",ctx.fillText(param,2*ratio,9*ratio),BI.Widget._renderEngine.createElement(canvas).destroy();var backColor=backgroundColor||"rgba(54, 133, 242, 0.1)";return{width:w,height:16,src:canvas.toDataURL("image/png"),style:"background-color: "+backColor+";vertical-align: middle; margin: 0 1px; width:"+w+"px;height: 16px; max-width:"+w+"px;max-height: 16px; min-width:"+w+"px;min-height: 16px",param:param}}}),BI.extend(BI.DOM,{isColor:function(color){return color&&(this.isRGBColor(color)||this.isHexColor(color))},isRGBColor:function(color){return!!color&&"rgb"===color.substr(0,3)},isHexColor:function(color){return!!color&&("#"===color[0]&&7===color.length)},isDarkColor:function(hex){if(!hex||!this.isHexColor(hex))return!1;var rgb=this.rgb2json(this.hex2rgb(hex)),grayLevel=Math.round(.299*rgb.r+.587*rgb.g+.114*rgb.b);return grayLevel<192},getContrastColor:function(color){return color&&this.isColor(color)?this.isDarkColor(color)?"#ffffff":"#1a1a1a":""},rgb2hex:function(rgbColour){if(!rgbColour||"rgb"!=rgbColour.substr(0,3))return"";var rgbValues=rgbColour.match(/\d+(\.\d+)?/g),red=BI.parseInt(rgbValues[0]),green=BI.parseInt(rgbValues[1]),blue=BI.parseInt(rgbValues[2]),hexColour="#"+this.int2hex(red)+this.int2hex(green)+this.int2hex(blue);return hexColour},rgb2json:function(rgbColour){if(!rgbColour)return{};if(!this.isRGBColor(rgbColour))return{};var rgbValues=rgbColour.match(/\d+(\.\d+)?/g);return{r:BI.parseInt(rgbValues[0]),g:BI.parseInt(rgbValues[1]),b:BI.parseInt(rgbValues[2])}},rgba2json:function(rgbColour){if(!rgbColour)return{};var rgbValues=rgbColour.match(/\d+(\.\d+)?/g);return{r:BI.parseInt(rgbValues[0]),g:BI.parseInt(rgbValues[1]),b:BI.parseInt(rgbValues[2]),a:BI.parseFloat(rgbValues[3])}},json2rgb:function(rgb){return BI.isKey(rgb.r)&&BI.isKey(rgb.g)&&BI.isKey(rgb.b)?"rgb("+rgb.r+","+rgb.g+","+rgb.b+")":""},json2rgba:function(rgba){return BI.isKey(rgba.r)&&BI.isKey(rgba.g)&&BI.isKey(rgba.b)?"rgba("+rgba.r+","+rgba.g+","+rgba.b+","+rgba.a+")":""},int2hex:function(strNum){var hexdig=["0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f"];return hexdig[strNum>>>4]+""+hexdig[15&strNum]},hex2rgb:function(color){if(!color)return"";if(!this.isHexColor(color))return color;var tempValue="rgb(",colorArray;return 7===color.length?colorArray=[BI.parseInt("0x"+color.substring(1,3)),BI.parseInt("0x"+color.substring(3,5)),BI.parseInt("0x"+color.substring(5,7))]:4===color.length&&(colorArray=[BI.parseInt("0x"+color.substring(1,2)),BI.parseInt("0x"+color.substring(2,3)),BI.parseInt("0x"+color.substring(3,4))]),tempValue+=colorArray[0]+",",tempValue+=colorArray[1]+",",tempValue+=colorArray[2]+")"},rgba2rgb:function(rgbColor,bgColor){if(BI.isNull(bgColor)&&(bgColor=1),"rgba"!=rgbColor.substr(0,4))return"";var rgbValues=rgbColor.match(/\d+(\.\d+)?/g);if(rgbValues.length<4)return"";var R=BI.parseFloat(rgbValues[0]),G=BI.parseFloat(rgbValues[1]),B=BI.parseFloat(rgbValues[2]),A=BI.parseFloat(rgbValues[3]);return"rgb("+Math.floor(255*(bgColor*(1-A))+R*A)+","+Math.floor(255*(bgColor*(1-A))+G*A)+","+Math.floor(255*(bgColor*(1-A))+B*A)+")"}}),BI.extend(BI.DOM,{getLeftPosition:function(combo,popup,extraWidth){return{left:combo.element.offset().left-popup.element.outerWidth()-(extraWidth||0)}},getInnerLeftPosition:function(combo,popup,extraWidth){return{left:combo.element.offset().left+(extraWidth||0)}},getRightPosition:function(combo,popup,extraWidth){var el=combo.element;return{left:el.offset().left+el.outerWidth()+(extraWidth||0)}},getInnerRightPosition:function(combo,popup,extraWidth){var el=combo.element,viewBounds=popup.element.bounds();return{left:el.offset().left+el.outerWidth()-viewBounds.width-(extraWidth||0)}},getTopPosition:function(combo,popup,extraHeight){return{top:combo.element.offset().top-popup.element.outerHeight()-(extraHeight||0)}},getBottomPosition:function(combo,popup,extraHeight){var el=combo.element;return{top:el.offset().top+el.outerHeight()+(extraHeight||0)}},isLeftSpaceEnough:function(combo,popup,extraWidth){return BI.DOM.getLeftPosition(combo,popup,extraWidth).left>=0},isInnerLeftSpaceEnough:function(combo,popup,extraWidth){var viewBounds=popup.element.bounds(),windowBounds=BI.Widget._renderEngine.createElement("body").bounds();return BI.DOM.getInnerLeftPosition(combo,popup,extraWidth).left+viewBounds.width<=windowBounds.width},isRightSpaceEnough:function(combo,popup,extraWidth){var viewBounds=popup.element.bounds(),windowBounds=BI.Widget._renderEngine.createElement("body").bounds();return BI.DOM.getRightPosition(combo,popup,extraWidth).left+viewBounds.width<=windowBounds.width},isInnerRightSpaceEnough:function(combo,popup,extraWidth){return BI.DOM.getInnerRightPosition(combo,popup,extraWidth).left>=0},isTopSpaceEnough:function(combo,popup,extraHeight){return BI.DOM.getTopPosition(combo,popup,extraHeight).top>=0},isBottomSpaceEnough:function(combo,popup,extraHeight){var viewBounds=popup.element.bounds(),windowBounds=BI.Widget._renderEngine.createElement("body").bounds();return BI.DOM.getBottomPosition(combo,popup,extraHeight).top+viewBounds.height<=windowBounds.height},isRightSpaceLarger:function(combo){var windowBounds=BI.Widget._renderEngine.createElement("body").bounds();return windowBounds.width-combo.element.offset().left-combo.element.bounds().width>=combo.element.offset().left},isBottomSpaceLarger:function(combo){var windowBounds=BI.Widget._renderEngine.createElement("body").bounds();return windowBounds.height-combo.element.offset().top-combo.element.bounds().height>=combo.element.offset().top},getLeftAlignPosition:function(combo,popup,extraWidth){var viewBounds=popup.element.bounds(),windowBounds=BI.Widget._renderEngine.createElement("body").bounds(),left=combo.element.offset().left+extraWidth;return left+viewBounds.width>windowBounds.width&&(left=windowBounds.width-viewBounds.width),left<0&&(left=0),{left:left}},getLeftAdaptPosition:function(combo,popup,extraWidth){return BI.DOM.isLeftSpaceEnough(combo,popup,extraWidth)?BI.DOM.getLeftPosition(combo,popup,extraWidth):{left:0}},getRightAlignPosition:function(combo,popup,extraWidth){var comboBounds=combo.element.bounds(),viewBounds=popup.element.bounds(),left=combo.element.offset().left+comboBounds.width-viewBounds.width-extraWidth;return left<0&&(left=0),{left:left}},getRightAdaptPosition:function(combo,popup,extraWidth){return BI.DOM.isRightSpaceEnough(combo,popup,extraWidth)?BI.DOM.getRightPosition(combo,popup,extraWidth):{left:BI.Widget._renderEngine.createElement("body").bounds().width-popup.element.bounds().width}},getTopAlignPosition:function(combo,popup,extraHeight,needAdaptHeight){var comboOffset=combo.element.offset(),comboBounds=combo.element.bounds(),popupBounds=popup.element.bounds(),windowBounds=BI.Widget._renderEngine.createElement("body").bounds(),top,adaptHeight;return BI.DOM.isBottomSpaceEnough(combo,popup,-1*comboBounds.height+extraHeight)?top=comboOffset.top+extraHeight:needAdaptHeight?(top=comboOffset.top+extraHeight,adaptHeight=windowBounds.height-top):(top=windowBounds.height-popupBounds.height,topwindowBounds.height?{top:0,adaptHeight:windowBounds.height-extraHeight}:{top:0}},getBottomAlignPosition:function(combo,popup,extraHeight,needAdaptHeight){var comboOffset=combo.element.offset(),comboBounds=combo.element.bounds(),popupBounds=popup.element.bounds(),windowBounds=BI.Widget._renderEngine.createElement("body").bounds(),top,adaptHeight;return BI.DOM.isTopSpaceEnough(combo,popup,-1*comboBounds.height+extraHeight)?top=comboOffset.top+comboBounds.height-popupBounds.height-extraHeight:needAdaptHeight?(top=0,adaptHeight=comboOffset.top+comboBounds.height-extraHeight):(top=0,popupBounds.height+extraHeight>windowBounds.height&&(adaptHeight=windowBounds.height-extraHeight)),top<0&&(top=0),adaptHeight?{top:top,adaptHeight:adaptHeight}:{top:top}},getBottomAdaptPosition:function(combo,popup,extraHeight,needAdaptHeight){var comboOffset=combo.element.offset(),comboBounds=combo.element.bounds(),popupBounds=popup.element.bounds(),windowBounds=BI.Widget._renderEngine.createElement("body").bounds();return BI.DOM.isBottomSpaceEnough(combo,popup,extraHeight)?BI.DOM.getBottomPosition(combo,popup,extraHeight):needAdaptHeight?{top:comboOffset.top+comboBounds.height+extraHeight,adaptHeight:windowBounds.height-comboOffset.top-comboBounds.height-extraHeight}:popupBounds.height+extraHeight>windowBounds.height?{top:extraHeight,adaptHeight:windowBounds.height-extraHeight}:{top:windowBounds.height-popupBounds.height-extraHeight}},getCenterAdaptPosition:function(combo,popup){var comboOffset=combo.element.offset(),comboBounds=combo.element.bounds(),popupBounds=popup.element.bounds(),windowBounds=BI.Widget._renderEngine.createElement("body").bounds(),left;return left=comboOffset.left+comboBounds.width/2+popupBounds.width/2>windowBounds.width?windowBounds.width-popupBounds.width:comboOffset.left+comboBounds.width/2-popupBounds.width/2,left<0&&(left=0),{left:left}},getMiddleAdaptPosition:function(combo,popup){var comboOffset=combo.element.offset(),comboBounds=combo.element.bounds(),popupBounds=popup.element.bounds(),windowBounds=BI.Widget._renderEngine.createElement("body").bounds(),top;return top=comboOffset.top+comboBounds.height/2+popupBounds.height/2>windowBounds.height?windowBounds.height-popupBounds.height:comboOffset.top+comboBounds.height/2-popupBounds.height/2,top<0&&(top=0),{top:top}},getComboPositionByDirections:function(combo,popup,extraWidth,extraHeight,needAdaptHeight,directions){extraWidth||(extraWidth=0),extraHeight||(extraHeight=0);var i,direct,leftRight=[],topBottom=[],innerLeftRight=[],isNeedAdaptHeight=!1,tbFirst=!1,lrFirst=!1,left,top,pos,firstDir=directions[0];for(i=0;i0&&length-1 in obj)))}function createOptions(options){var object=optionsCache[options]={};return jQuery.each(options.match(core_rnotwhite)||[],function(_,flag){object[flag]=!0}),object}function internalData(elem,name,data,pvt){if(jQuery.acceptData(elem)){var thisCache,ret,internalKey=jQuery.expando,getByName="string"==typeof name,isNode=elem.nodeType,cache=isNode?jQuery.cache:elem,id=isNode?elem[internalKey]:elem[internalKey]&&internalKey;if(id&&cache[id]&&(pvt||cache[id].data)||!getByName||data!==undefined)return id||(isNode?elem[internalKey]=id=core_deletedIds.pop()||jQuery.guid++:id=internalKey),cache[id]||(cache[id]={},isNode||(cache[id].toJSON=jQuery.noop)),"object"!=typeof name&&"function"!=typeof name||(pvt?cache[id]=jQuery.extend(cache[id],name):cache[id].data=jQuery.extend(cache[id].data,name)),thisCache=cache[id],pvt||(thisCache.data||(thisCache.data={}),thisCache=thisCache.data),data!==undefined&&(thisCache[jQuery.camelCase(name)]=data),getByName?(ret=thisCache[name],null==ret&&(ret=thisCache[jQuery.camelCase(name)])):ret=thisCache,ret}}function internalRemoveData(elem,name,pvt){if(jQuery.acceptData(elem)){var i,l,thisCache,isNode=elem.nodeType,cache=isNode?jQuery.cache:elem,id=isNode?elem[jQuery.expando]:jQuery.expando;if(cache[id]){if(name&&(thisCache=pvt?cache[id]:cache[id].data)){jQuery.isArray(name)?name=name.concat(jQuery.map(name,jQuery.camelCase)):name in thisCache?name=[name]:(name=jQuery.camelCase(name),name=name in thisCache?[name]:name.split(" "));for(i=0,l=name.length;i=0===keep})}function createSafeFragment(document){var list=nodeNames.split("|"),safeFrag=document.createDocumentFragment();if(safeFrag.createElement)for(;list.length;)safeFrag.createElement(list.pop());return safeFrag}function findOrAppend(elem,tag){return elem.getElementsByTagName(tag)[0]||elem.appendChild(elem.ownerDocument.createElement(tag))}function disableScript(elem){var attr=elem.getAttributeNode("type");return elem.type=(attr&&attr.specified)+"/"+elem.type,elem}function restoreScript(elem){var match=rscriptTypeMasked.exec(elem.type);return match?elem.type=match[1]:elem.removeAttribute("type"),elem}function setGlobalEval(elems,refElements){for(var elem,i=0;null!=(elem=elems[i]);i++)jQuery._data(elem,"globalEval",!refElements||jQuery._data(refElements[i],"globalEval"))}function cloneCopyEvent(src,dest){if(1===dest.nodeType&&jQuery.hasData(src)){var type,i,l,oldData=jQuery._data(src),curData=jQuery._data(dest,oldData),events=oldData.events;if(events){delete curData.handle,curData.events={};for(type in events)for(i=0,l=events[type].length;i").css("cssText","display:block !important")).appendTo(doc.documentElement),doc=(iframe[0].contentWindow||iframe[0].contentDocument).document,doc.write(""),doc.close(),display=actualDisplay(nodeName,doc),iframe.detach()),elemdisplay[nodeName]=display),display}function actualDisplay(name,doc){var elem=jQuery(doc.createElement(name)).appendTo(doc.body),display=jQuery.css(elem[0],"display");return elem.remove(),display}function buildParams(prefix,obj,traditional,add){var name;if(jQuery.isArray(obj))jQuery.each(obj,function(i,v){traditional||rbracket.test(prefix)?add(prefix,v):buildParams(prefix+"["+("object"==typeof v?i:"")+"]",v,traditional,add)});else if(traditional||"object"!==jQuery.type(obj))add(prefix,obj);else for(name in obj)buildParams(prefix+"["+name+"]",obj[name],traditional,add)}function addToPrefiltersOrTransports(structure){return function(dataTypeExpression,func){"string"!=typeof dataTypeExpression&&(func=dataTypeExpression,dataTypeExpression="*");var dataType,i=0,dataTypes=dataTypeExpression.toLowerCase().match(core_rnotwhite)||[];if(jQuery.isFunction(func))for(;dataType=dataTypes[i++];)"+"===dataType[0]?(dataType=dataType.slice(1)||"*",(structure[dataType]=structure[dataType]||[]).unshift(func)):(structure[dataType]=structure[dataType]||[]).push(func)}}function inspectPrefiltersOrTransports(structure,options,originalOptions,jqXHR){function inspect(dataType){var selected;return inspected[dataType]=!0,jQuery.each(structure[dataType]||[],function(_,prefilterOrFactory){var dataTypeOrTransport=prefilterOrFactory(options,originalOptions,jqXHR);return"string"!=typeof dataTypeOrTransport||seekingTransport||inspected[dataTypeOrTransport]?seekingTransport?!(selected=dataTypeOrTransport):void 0:(options.dataTypes.unshift(dataTypeOrTransport),inspect(dataTypeOrTransport),!1)}),selected}var inspected={},seekingTransport=structure===transports;return inspect(options.dataTypes[0])||!inspected["*"]&&inspect("*")}function ajaxExtend(target,src){var deep,key,flatOptions=jQuery.ajaxSettings.flatOptions||{};for(key in src)src[key]!==undefined&&((flatOptions[key]?target:deep||(deep={}))[key]=src[key]);return deep&&jQuery.extend(!0,target,deep),target}function ajaxHandleResponses(s,jqXHR,responses){var firstDataType,ct,finalDataType,type,contents=s.contents,dataTypes=s.dataTypes,responseFields=s.responseFields;for(type in responseFields)type in responses&&(jqXHR[responseFields[type]]=responses[type]);for(;"*"===dataTypes[0];)dataTypes.shift(),ct===undefined&&(ct=s.mimeType||jqXHR.getResponseHeader("Content-Type"));if(ct)for(type in contents)if(contents[type]&&contents[type].test(ct)){dataTypes.unshift(type);break}if(dataTypes[0]in responses)finalDataType=dataTypes[0];else{for(type in responses){if(!dataTypes[0]||s.converters[type+" "+dataTypes[0]]){finalDataType=type;break}firstDataType||(firstDataType=type)}finalDataType=finalDataType||firstDataType}if(finalDataType)return finalDataType!==dataTypes[0]&&dataTypes.unshift(finalDataType),responses[finalDataType]}function ajaxConvert(s,response){var conv2,current,conv,tmp,converters={},i=0,dataTypes=s.dataTypes.slice(),prev=dataTypes[0];if(s.dataFilter&&(response=s.dataFilter(response,s.dataType)),dataTypes[1])for(conv in s.converters)converters[conv.toLowerCase()]=s.converters[conv];for(;current=dataTypes[++i];)if("*"!==current){if("*"!==prev&&prev!==current){if(conv=converters[prev+" "+current]||converters["* "+current],!conv)for(conv2 in converters)if(tmp=conv2.split(" "),tmp[1]===current&&(conv=converters[prev+" "+tmp[0]]||converters["* "+tmp[0]])){conv===!0?conv=converters[conv2]:converters[conv2]!==!0&&(current=tmp[0],dataTypes.splice(i--,0,current));break}if(conv!==!0)if(conv&&s["throws"])response=conv(response);else try{response=conv(response)}catch(e){return{state:"parsererror",error:conv?e:"No conversion from "+prev+" to "+current}}}prev=current}return{state:"success",data:response}}function createStandardXHR(){try{return new window.XMLHttpRequest}catch(e){}}function createActiveXHR(){try{return new window.ActiveXObject("Microsoft.XMLHTTP")}catch(e){}}function createFxNow(){return setTimeout(function(){fxNow=undefined}),fxNow=jQuery.now()}function createTweens(animation,props){jQuery.each(props,function(prop,value){for(var collection=(tweeners[prop]||[]).concat(tweeners["*"]),index=0,length=collection.length;index)[^>]*|#([\w-]*))$/,rsingleTag=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,rvalidchars=/^[\],:{}\s]*$/,rvalidbraces=/(?:^|:|,)(?:\s*\[)+/g,rvalidescape=/\\(?:["\\\/bfnrt]|u[\da-fA-F]{4})/g,rvalidtokens=/"[^"\\\r\n]*"|true|false|null|-?(?:\d+\.|)\d+(?:[eE][+-]?\d+|)/g,rmsPrefix=/^-ms-/,rdashAlpha=/-([\da-z])/gi,fcamelCase=function(all,letter){return letter.toUpperCase()},completed=function(event){(document.addEventListener||"load"===event.type||"complete"===document.readyState)&&(detach(),jQuery.ready())},detach=function(){document.addEventListener?(document.removeEventListener("DOMContentLoaded",completed,!1),window.removeEventListener("load",completed,!1)):(document.detachEvent("onreadystatechange",completed),window.detachEvent("onload",completed))};jQuery.fn=jQuery.prototype={jquery:core_version,constructor:jQuery,init:function(selector,context,rootjQuery){var match,elem;if(!selector)return this;if("string"==typeof selector){if(match="<"===selector.charAt(0)&&">"===selector.charAt(selector.length-1)&&selector.length>=3?[null,selector,null]:rquickExpr.exec(selector),!match||!match[1]&&context)return!context||context.jquery?(context||rootjQuery).find(selector):this.constructor(context).find(selector);if(match[1]){if(context=context instanceof jQuery?context[0]:context,jQuery.merge(this,jQuery.parseHTML(match[1],context&&context.nodeType?context.ownerDocument||context:document,!0)),rsingleTag.test(match[1])&&jQuery.isPlainObject(context))for(match in context)jQuery.isFunction(this[match])?this[match](context[match]):this.attr(match,context[match]);return this}if(elem=document.getElementById(match[2]),elem&&elem.parentNode){if(elem.id!==match[2])return rootjQuery.find(selector);this.length=1,this[0]=elem}return this.context=document,this.selector=selector,this}return selector.nodeType?(this.context=this[0]=selector,this.length=1,this):jQuery.isFunction(selector)?rootjQuery.ready(selector):(selector.selector!==undefined&&(this.selector=selector.selector,this.context=selector.context),jQuery.makeArray(selector,this))},selector:"",length:0,size:function(){return this.length},toArray:function(){return core_slice.call(this)},get:function(num){return null==num?this.toArray():num<0?this[this.length+num]:this[num]},pushStack:function(elems){var ret=jQuery.merge(this.constructor(),elems);return ret.prevObject=this,ret.context=this.context,ret},each:function(callback,args){return jQuery.each(this,callback,args)},ready:function(fn){return jQuery.ready.promise().done(fn),this},slice:function(){return this.pushStack(core_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&&j0||(readyList.resolveWith(document,[jQuery]),jQuery.fn.trigger&&jQuery(document).trigger("ready").off("ready"))}},isFunction:function(obj){return"function"===jQuery.type(obj)},isArray:Array.isArray||function(obj){return"array"===jQuery.type(obj)},isWindow:function(obj){return null!=obj&&obj==obj.window},isNumeric:function(obj){return!isNaN(parseFloat(obj))&&isFinite(obj)},type:function(obj){return null==obj?String(obj):"object"==typeof obj||"function"==typeof obj?class2type[core_toString.call(obj)]||"object":typeof obj},isPlainObject:function(obj){if(!obj||"object"!==jQuery.type(obj)||obj.nodeType||jQuery.isWindow(obj))return!1;try{if(obj.constructor&&!core_hasOwn.call(obj,"constructor")&&!core_hasOwn.call(obj.constructor.prototype,"isPrototypeOf"))return!1}catch(e){return!1}var key;for(key in obj);return key===undefined||core_hasOwn.call(obj,key)},isEmptyObject:function(obj){var name;for(name in obj)return!1;return!0},error:function(msg){throw new Error(msg)},parseHTML:function(data,context,keepScripts){if(!data||"string"!=typeof data)return null;"boolean"==typeof context&&(keepScripts=context,context=!1),context=context||document;var parsed=rsingleTag.exec(data),scripts=!keepScripts&&[];return parsed?[context.createElement(parsed[1])]:(parsed=jQuery.buildFragment([data],context,scripts),scripts&&jQuery(scripts).remove(),jQuery.merge([],parsed.childNodes))},parseJSON:function(data){return window.JSON&&window.JSON.parse?window.JSON.parse(data):null===data?data:"string"==typeof data&&(data=jQuery.trim(data),data&&rvalidchars.test(data.replace(rvalidescape,"@").replace(rvalidtokens,"]").replace(rvalidbraces,"")))?new Function("return "+data)():void jQuery.error("Invalid JSON: "+data)},parseXML:function(data){var xml,tmp;if(!data||"string"!=typeof data)return null;try{window.DOMParser?(tmp=new DOMParser,xml=tmp.parseFromString(data,"text/xml")):(xml=new ActiveXObject("Microsoft.XMLDOM"),xml.async="false",xml.loadXML(data))}catch(e){xml=undefined}return xml&&xml.documentElement&&!xml.getElementsByTagName("parsererror").length||jQuery.error("Invalid XML: "+data),xml},noop:function(){},globalEval:function(data){data&&jQuery.trim(data)&&(window.execScript||function(data){window.eval.call(window,data)})(data)},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,args){var value,i=0,length=obj.length,isArray=isArraylike(obj);if(args){if(isArray)for(;i-1;)list.splice(index,1),firing&&(index<=firingLength&&firingLength--,index<=firingIndex&&firingIndex--)}),this},has:function(fn){return fn?jQuery.inArray(fn,list)>-1:!(!list||!list.length)},empty:function(){return list=[],this},disable:function(){return list=stack=memory=undefined,this},disabled:function(){return!list},lock:function(){return stack=undefined,memory||self.disable(),this},locked:function(){return!stack},fireWith:function(context,args){return args=args||[],args=[context,args.slice?args.slice():args],!list||fired&&!stack||(firing?stack.push(args):fire(args)),this},fire:function(){return self.fireWith(this,arguments),this},fired:function(){return!!fired}};return self},jQuery.extend({Deferred:function(func){var tuples=[["resolve","done",jQuery.Callbacks("once memory"),"resolved"],["reject","fail",jQuery.Callbacks("once memory"),"rejected"],["notify","progress",jQuery.Callbacks("memory")]],state="pending",promise={state:function(){return state},always:function(){return deferred.done(arguments).fail(arguments),this},then:function(){var fns=arguments;return jQuery.Deferred(function(newDefer){jQuery.each(tuples,function(i,tuple){var action=tuple[0],fn=jQuery.isFunction(fns[i])&&fns[i];deferred[tuple[1]](function(){var returned=fn&&fn.apply(this,arguments);returned&&jQuery.isFunction(returned.promise)?returned.promise().done(newDefer.resolve).fail(newDefer.reject).progress(newDefer.notify):newDefer[action+"With"](this===promise?newDefer.promise():this,fn?[returned]:arguments)})}),fns=null}).promise()},promise:function(obj){return null!=obj?jQuery.extend(obj,promise):promise}},deferred={};return promise.pipe=promise.then,jQuery.each(tuples,function(i,tuple){var list=tuple[2],stateString=tuple[3];promise[tuple[1]]=list.add,stateString&&list.add(function(){state=stateString},tuples[1^i][2].disable,tuples[2][2].lock),deferred[tuple[0]]=function(){return deferred[tuple[0]+"With"](this===deferred?promise:this,arguments),this},deferred[tuple[0]+"With"]=list.fireWith}),promise.promise(deferred),func&&func.call(deferred,deferred),deferred},when:function(subordinate){var i=0,resolveValues=core_slice.call(arguments),length=resolveValues.length,remaining=1!==length||subordinate&&jQuery.isFunction(subordinate.promise)?length:0,deferred=1===remaining?subordinate:jQuery.Deferred(),updateFunc=function(i,contexts,values){return function(value){contexts[i]=this,values[i]=arguments.length>1?core_slice.call(arguments):value,values===progressValues?deferred.notifyWith(contexts,values):--remaining||deferred.resolveWith(contexts,values)}},progressValues,progressContexts,resolveContexts;if(length>1)for(progressValues=new Array(length),progressContexts=new Array(length),resolveContexts=new Array(length);i
  • a",all=div.getElementsByTagName("*"),a=div.getElementsByTagName("a")[0],!all||!a||!all.length)return{};select=document.createElement("select"),opt=select.appendChild(document.createElement("option")),input=div.getElementsByTagName("input")[0],a.style.cssText="top:1px;float:left;opacity:.5",support={getSetAttribute:"t"!==div.className,leadingWhitespace:3===div.firstChild.nodeType,tbody:!div.getElementsByTagName("tbody").length,htmlSerialize:!!div.getElementsByTagName("link").length,style:/top/.test(a.getAttribute("style")),hrefNormalized:"/a"===a.getAttribute("href"),opacity:/^0.5/.test(a.style.opacity),cssFloat:!!a.style.cssFloat,checkOn:!!input.value,optSelected:opt.selected,enctype:!!document.createElement("form").enctype,html5Clone:"<:nav>"!==document.createElement("nav").cloneNode(!0).outerHTML,boxModel:"CSS1Compat"===document.compatMode,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0,boxSizingReliable:!0,pixelPosition:!1},input.checked=!0,support.noCloneChecked=input.cloneNode(!0).checked,select.disabled=!0,support.optDisabled=!opt.disabled;try{delete div.test}catch(e){support.deleteExpando=!1}input=document.createElement("input"),input.setAttribute("value",""),support.input=""===input.getAttribute("value"),input.value="t",input.setAttribute("type","radio"),support.radioValue="t"===input.value,input.setAttribute("checked","t"),input.setAttribute("name","t"),fragment=document.createDocumentFragment(),fragment.appendChild(input),support.appendChecked=input.checked,support.checkClone=fragment.cloneNode(!0).cloneNode(!0).lastChild.checked,div.attachEvent&&(div.attachEvent("onclick",function(){support.noCloneEvent=!1}),div.cloneNode(!0).click());for(i in{submit:!0,change:!0,focusin:!0})div.setAttribute(eventName="on"+i,"t"),support[i+"Bubbles"]=eventName in window||div.attributes[eventName].expando===!1;return div.style.backgroundClip="content-box",div.cloneNode(!0).style.backgroundClip="",support.clearCloneStyle="content-box"===div.style.backgroundClip,jQuery(function(){var container,marginDiv,tds,divReset="padding:0;margin:0;border:0;display:block;box-sizing:content-box;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;",body=document.getElementsByTagName("body")[0];body&&(container=document.createElement("div"),container.style.cssText="border:0;width:0;height:0;position:absolute;top:0;left:-9999px;margin-top:1px",body.appendChild(container).appendChild(div),div.innerHTML="
    t
    ",tds=div.getElementsByTagName("td"),tds[0].style.cssText="padding:0;margin:0;border:0;display:none",isSupported=0===tds[0].offsetHeight,tds[0].style.display="",tds[1].style.display="none",support.reliableHiddenOffsets=isSupported&&0===tds[0].offsetHeight,div.innerHTML="",div.style.cssText="box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;position:absolute;top:1%;",support.boxSizing=4===div.offsetWidth,support.doesNotIncludeMarginInBodyOffset=1!==body.offsetTop,window.getComputedStyle&&(support.pixelPosition="1%"!==(window.getComputedStyle(div,null)||{}).top,support.boxSizingReliable="4px"===(window.getComputedStyle(div,null)||{width:"4px"}).width,marginDiv=div.appendChild(document.createElement("div")),marginDiv.style.cssText=div.style.cssText=divReset,marginDiv.style.marginRight=marginDiv.style.width="0",div.style.width="1px",support.reliableMarginRight=!parseFloat((window.getComputedStyle(marginDiv,null)||{}).marginRight)),typeof div.style.zoom!==core_strundefined&&(div.innerHTML="",div.style.cssText=divReset+"width:1px;padding:1px;display:inline;zoom:1",support.inlineBlockNeedsLayout=3===div.offsetWidth,div.style.display="block",div.innerHTML="
    ",div.firstChild.style.width="5px", +support.shrinkWrapBlocks=3!==div.offsetWidth,support.inlineBlockNeedsLayout&&(body.style.zoom=1)),body.removeChild(container),container=div=tds=marginDiv=null)}),all=select=fragment=opt=a=input=null,support}();var rbrace=/(?:\{[\s\S]*\}|\[[\s\S]*\])$/,rmultiDash=/([A-Z])/g;jQuery.extend({cache:{},expando:"jQuery"+(core_version+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(elem){return elem=elem.nodeType?jQuery.cache[elem[jQuery.expando]]:elem[jQuery.expando],!!elem&&!isEmptyDataObject(elem)},data:function(elem,name,data){return internalData(elem,name,data)},removeData:function(elem,name){return internalRemoveData(elem,name)},_data:function(elem,name,data){return internalData(elem,name,data,!0)},_removeData:function(elem,name){return internalRemoveData(elem,name,!0)},acceptData:function(elem){if(elem.nodeType&&1!==elem.nodeType&&9!==elem.nodeType)return!1;var noData=elem.nodeName&&jQuery.noData[elem.nodeName.toLowerCase()];return!noData||noData!==!0&&elem.getAttribute("classid")===noData}}),jQuery.fn.extend({data:function(key,value){var attrs,name,elem=this[0],i=0,data=null;if(key===undefined){if(this.length&&(data=jQuery.data(elem),1===elem.nodeType&&!jQuery._data(elem,"parsedAttrs"))){for(attrs=elem.attributes;i1,null,!0)},removeData:function(key){return this.each(function(){jQuery.removeData(this,key)})}}),jQuery.extend({queue:function(elem,type,data){var queue;if(elem)return type=(type||"fx")+"queue",queue=jQuery._data(elem,type),data&&(!queue||jQuery.isArray(data)?queue=jQuery._data(elem,type,jQuery.makeArray(data)):queue.push(data)),queue||[]},dequeue:function(elem,type){type=type||"fx";var queue=jQuery.queue(elem,type),startLength=queue.length,fn=queue.shift(),hooks=jQuery._queueHooks(elem,type),next=function(){jQuery.dequeue(elem,type)};"inprogress"===fn&&(fn=queue.shift(),startLength--),hooks.cur=fn,fn&&("fx"===type&&queue.unshift("inprogress"),delete hooks.stop,fn.call(elem,next,hooks)),!startLength&&hooks&&hooks.empty.fire()},_queueHooks:function(elem,type){var key=type+"queueHooks";return jQuery._data(elem,key)||jQuery._data(elem,key,{empty:jQuery.Callbacks("once memory").add(function(){jQuery._removeData(elem,type+"queue"),jQuery._removeData(elem,key)})})}}),jQuery.fn.extend({queue:function(type,data){var setter=2;return"string"!=typeof type&&(data=type,type="fx",setter--),arguments.length1)},removeAttr:function(name){return this.each(function(){jQuery.removeAttr(this,name)})},prop:function(name,value){return jQuery.access(this,jQuery.prop,name,value,arguments.length>1)},removeProp:function(name){return name=jQuery.propFix[name]||name,this.each(function(){try{this[name]=undefined,delete this[name]}catch(e){}})},addClass:function(value){var classes,elem,cur,clazz,j,i=0,len=this.length,proceed="string"==typeof value&&value;if(jQuery.isFunction(value))return this.each(function(j){jQuery(this).addClass(value.call(this,j,this.className))});if(proceed)for(classes=(value||"").match(core_rnotwhite)||[];i=0;)cur=cur.replace(" "+clazz+" "," ");elem.className=value?jQuery.trim(cur):""}return this},toggleClass:function(value,stateVal){var type=typeof value,isBool="boolean"==typeof stateVal;return jQuery.isFunction(value)?this.each(function(i){jQuery(this).toggleClass(value.call(this,i,this.className,stateVal),stateVal)}):this.each(function(){if("string"===type)for(var className,i=0,self=jQuery(this),state=stateVal,classNames=value.match(core_rnotwhite)||[];className=classNames[i++];)state=isBool?state:!self.hasClass(className),self[state?"addClass":"removeClass"](className);else type!==core_strundefined&&"boolean"!==type||(this.className&&jQuery._data(this,"__className__",this.className),this.className=this.className||value===!1?"":jQuery._data(this,"__className__")||"")})},hasClass:function(selector){for(var className=" "+selector+" ",i=0,l=this.length;i=0)return!0;return!1},val:function(value){var ret,hooks,isFunction,elem=this[0];{if(arguments.length)return isFunction=jQuery.isFunction(value),this.each(function(i){var val,self=jQuery(this);1===this.nodeType&&(val=isFunction?value.call(this,i,self.val()):value,null==val?val="":"number"==typeof val?val+="":jQuery.isArray(val)&&(val=jQuery.map(val,function(value){return null==value?"":value+""})),hooks=jQuery.valHooks[this.type]||jQuery.valHooks[this.nodeName.toLowerCase()],hooks&&"set"in hooks&&hooks.set(this,val,"value")!==undefined||(this.value=val))});if(elem)return hooks=jQuery.valHooks[elem.type]||jQuery.valHooks[elem.nodeName.toLowerCase()],hooks&&"get"in hooks&&(ret=hooks.get(elem,"value"))!==undefined?ret:(ret=elem.value,"string"==typeof ret?ret.replace(rreturn,""):null==ret?"":ret)}}}),jQuery.extend({valHooks:{option:{get:function(elem){var val=elem.attributes.value;return!val||val.specified?elem.value:elem.text}},select:{get:function(elem){for(var value,option,options=elem.options,index=elem.selectedIndex,one="select-one"===elem.type||index<0,values=one?null:[],max=one?index+1:options.length,i=index<0?max:one?index:0;i=0}),values.length||(elem.selectedIndex=-1),values}}},attr:function(elem,name,value){var hooks,notxml,ret,nType=elem.nodeType;if(elem&&3!==nType&&8!==nType&&2!==nType)return typeof elem.getAttribute===core_strundefined?jQuery.prop(elem,name,value):(notxml=1!==nType||!jQuery.isXMLDoc(elem),notxml&&(name=name.toLowerCase(),hooks=jQuery.attrHooks[name]||(rboolean.test(name)?boolHook:nodeHook)),value===undefined?hooks&¬xml&&"get"in hooks&&null!==(ret=hooks.get(elem,name))?ret:(typeof elem.getAttribute!==core_strundefined&&(ret=elem.getAttribute(name)),null==ret?undefined:ret):null!==value?hooks&¬xml&&"set"in hooks&&(ret=hooks.set(elem,value,name))!==undefined?ret:(elem.setAttribute(name,value+""),value):void jQuery.removeAttr(elem,name))},removeAttr:function(elem,value){var name,propName,i=0,attrNames=value&&value.match(core_rnotwhite);if(attrNames&&1===elem.nodeType)for(;name=attrNames[i++];)propName=jQuery.propFix[name]||name,rboolean.test(name)?!getSetAttribute&&ruseDefault.test(name)?elem[jQuery.camelCase("default-"+name)]=elem[propName]=!1:elem[propName]=!1:jQuery.attr(elem,name,""),elem.removeAttribute(getSetAttribute?name:propName)},attrHooks:{type:{set:function(elem,value){if(!jQuery.support.radioValue&&"radio"===value&&jQuery.nodeName(elem,"input")){var val=elem.value;return elem.setAttribute("type",value),val&&(elem.value=val),value}}}},propFix:{tabindex:"tabIndex",readonly:"readOnly","for":"htmlFor","class":"className",maxlength:"maxLength",cellspacing:"cellSpacing",cellpadding:"cellPadding",rowspan:"rowSpan",colspan:"colSpan",usemap:"useMap",frameborder:"frameBorder",contenteditable:"contentEditable"},prop:function(elem,name,value){var ret,hooks,notxml,nType=elem.nodeType;if(elem&&3!==nType&&8!==nType&&2!==nType)return notxml=1!==nType||!jQuery.isXMLDoc(elem),notxml&&(name=jQuery.propFix[name]||name,hooks=jQuery.propHooks[name]),value!==undefined?hooks&&"set"in hooks&&(ret=hooks.set(elem,value,name))!==undefined?ret:elem[name]=value:hooks&&"get"in hooks&&null!==(ret=hooks.get(elem,name))?ret:elem[name]},propHooks:{tabIndex:{get:function(elem){var attributeNode=elem.getAttributeNode("tabindex");return attributeNode&&attributeNode.specified?parseInt(attributeNode.value,10):rfocusable.test(elem.nodeName)||rclickable.test(elem.nodeName)&&elem.href?0:undefined}}}}),boolHook={get:function(elem,name){var prop=jQuery.prop(elem,name),attr="boolean"==typeof prop&&elem.getAttribute(name),detail="boolean"==typeof prop?getSetInput&&getSetAttribute?null!=attr:ruseDefault.test(name)?elem[jQuery.camelCase("default-"+name)]:!!attr:elem.getAttributeNode(name);return detail&&detail.value!==!1?name.toLowerCase():undefined},set:function(elem,value,name){return value===!1?jQuery.removeAttr(elem,name):getSetInput&&getSetAttribute||!ruseDefault.test(name)?elem.setAttribute(!getSetAttribute&&jQuery.propFix[name]||name,name):elem[jQuery.camelCase("default-"+name)]=elem[name]=!0,name}},getSetInput&&getSetAttribute||(jQuery.attrHooks.value={get:function(elem,name){var ret=elem.getAttributeNode(name);return jQuery.nodeName(elem,"input")?elem.defaultValue:ret&&ret.specified?ret.value:undefined},set:function(elem,value,name){return jQuery.nodeName(elem,"input")?void(elem.defaultValue=value):nodeHook&&nodeHook.set(elem,value,name)}}),getSetAttribute||(nodeHook=jQuery.valHooks.button={get:function(elem,name){var ret=elem.getAttributeNode(name);return ret&&("id"===name||"name"===name||"coords"===name?""!==ret.value:ret.specified)?ret.value:undefined},set:function(elem,value,name){var ret=elem.getAttributeNode(name);return ret||elem.setAttributeNode(ret=elem.ownerDocument.createAttribute(name)),ret.value=value+="","value"===name||value===elem.getAttribute(name)?value:undefined}},jQuery.attrHooks.contenteditable={get:nodeHook.get,set:function(elem,value,name){nodeHook.set(elem,""!==value&&value,name)}},jQuery.each(["width","height"],function(i,name){jQuery.attrHooks[name]=jQuery.extend(jQuery.attrHooks[name],{set:function(elem,value){if(""===value)return elem.setAttribute(name,"auto"),value}})})),jQuery.support.hrefNormalized||(jQuery.each(["href","src","width","height"],function(i,name){jQuery.attrHooks[name]=jQuery.extend(jQuery.attrHooks[name],{get:function(elem){var ret=elem.getAttribute(name,2);return null==ret?undefined:ret}})}),jQuery.each(["href","src"],function(i,name){jQuery.propHooks[name]={get:function(elem){return elem.getAttribute(name,4)}}})),jQuery.support.style||(jQuery.attrHooks.style={get:function(elem){return elem.style.cssText||undefined},set:function(elem,value){return elem.style.cssText=value+""}}),jQuery.support.optSelected||(jQuery.propHooks.selected=jQuery.extend(jQuery.propHooks.selected,{get:function(elem){var parent=elem.parentNode;return parent&&(parent.selectedIndex,parent.parentNode&&parent.parentNode.selectedIndex),null}})),jQuery.support.enctype||(jQuery.propFix.enctype="encoding"),jQuery.support.checkOn||jQuery.each(["radio","checkbox"],function(){jQuery.valHooks[this]={get:function(elem){return null===elem.getAttribute("value")?"on":elem.value}}}),jQuery.each(["radio","checkbox"],function(){jQuery.valHooks[this]=jQuery.extend(jQuery.valHooks[this],{set:function(elem,value){if(jQuery.isArray(value))return elem.checked=jQuery.inArray(jQuery(elem).val(),value)>=0}})});var rformElems=/^(?:input|select|textarea)$/i,rkeyEvent=/^key/,rmouseEvent=/^(?:mouse|contextmenu)|click/,rfocusMorph=/^(?:focusinfocus|focusoutblur)$/,rtypenamespace=/^([^.]*)(?:\.(.+)|)$/;jQuery.event={global:{},add:function(elem,types,handler,data,selector){var tmp,events,t,handleObjIn,special,eventHandle,handleObj,handlers,type,namespaces,origType,elemData=jQuery._data(elem);if(elemData){for(handler.handler&&(handleObjIn=handler,handler=handleObjIn.handler,selector=handleObjIn.selector),handler.guid||(handler.guid=jQuery.guid++),(events=elemData.events)||(events=elemData.events={}),(eventHandle=elemData.handle)||(eventHandle=elemData.handle=function(e){return typeof jQuery===core_strundefined||e&&jQuery.event.triggered===e.type?undefined:jQuery.event.dispatch.apply(eventHandle.elem,arguments)},eventHandle.elem=elem),types=(types||"").match(core_rnotwhite)||[""],t=types.length;t--;)tmp=rtypenamespace.exec(types[t])||[],type=origType=tmp[1],namespaces=(tmp[2]||"").split(".").sort(),special=jQuery.event.special[type]||{},type=(selector?special.delegateType:special.bindType)||type,special=jQuery.event.special[type]||{},handleObj=jQuery.extend({type:type,origType:origType,data:data,handler:handler,guid:handler.guid,selector:selector,needsContext:selector&&jQuery.expr.match.needsContext.test(selector),namespace:namespaces.join(".")},handleObjIn),(handlers=events[type])||(handlers=events[type]=[],handlers.delegateCount=0,special.setup&&special.setup.call(elem,data,namespaces,eventHandle)!==!1||(elem.addEventListener?elem.addEventListener(type,eventHandle,!1):elem.attachEvent&&elem.attachEvent("on"+type,eventHandle))),special.add&&(special.add.call(elem,handleObj),handleObj.handler.guid||(handleObj.handler.guid=handler.guid)),selector?handlers.splice(handlers.delegateCount++,0,handleObj):handlers.push(handleObj),jQuery.event.global[type]=!0;elem=null}},remove:function(elem,types,handler,selector,mappedTypes){var j,handleObj,tmp,origCount,t,events,special,handlers,type,namespaces,origType,elemData=jQuery.hasData(elem)&&jQuery._data(elem);if(elemData&&(events=elemData.events)){for(types=(types||"").match(core_rnotwhite)||[""],t=types.length;t--;)if(tmp=rtypenamespace.exec(types[t])||[],type=origType=tmp[1],namespaces=(tmp[2]||"").split(".").sort(),type){for(special=jQuery.event.special[type]||{},type=(selector?special.delegateType:special.bindType)||type,handlers=events[type]||[],tmp=tmp[2]&&new RegExp("(^|\\.)"+namespaces.join("\\.(?:.*\\.|)")+"(\\.|$)"),origCount=j=handlers.length;j--;)handleObj=handlers[j],!mappedTypes&&origType!==handleObj.origType||handler&&handler.guid!==handleObj.guid||tmp&&!tmp.test(handleObj.namespace)||selector&&selector!==handleObj.selector&&("**"!==selector||!handleObj.selector)||(handlers.splice(j,1),handleObj.selector&&handlers.delegateCount--,special.remove&&special.remove.call(elem,handleObj));origCount&&!handlers.length&&(special.teardown&&special.teardown.call(elem,namespaces,elemData.handle)!==!1||jQuery.removeEvent(elem,type,elemData.handle),delete events[type])}else for(type in events)jQuery.event.remove(elem,type+types[t],handler,selector,!0);jQuery.isEmptyObject(events)&&(delete elemData.handle,jQuery._removeData(elem,"events"))}},trigger:function(event,data,elem,onlyHandlers){var handle,ontype,cur,bubbleType,special,tmp,i,eventPath=[elem||document],type=core_hasOwn.call(event,"type")?event.type:event,namespaces=core_hasOwn.call(event,"namespace")?event.namespace.split("."):[];if(cur=tmp=elem=elem||document,3!==elem.nodeType&&8!==elem.nodeType&&!rfocusMorph.test(type+jQuery.event.triggered)&&(type.indexOf(".")>=0&&(namespaces=type.split("."),type=namespaces.shift(),namespaces.sort()),ontype=type.indexOf(":")<0&&"on"+type,event=event[jQuery.expando]?event:new jQuery.Event(type,"object"==typeof event&&event),event.isTrigger=!0,event.namespace=namespaces.join("."),event.namespace_re=event.namespace?new RegExp("(^|\\.)"+namespaces.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,event.result=undefined,event.target||(event.target=elem),data=null==data?[event]:jQuery.makeArray(data,[event]),special=jQuery.event.special[type]||{},onlyHandlers||!special.trigger||special.trigger.apply(elem,data)!==!1)){if(!onlyHandlers&&!special.noBubble&&!jQuery.isWindow(elem)){for(bubbleType=special.delegateType||type,rfocusMorph.test(bubbleType+type)||(cur=cur.parentNode);cur;cur=cur.parentNode)eventPath.push(cur),tmp=cur;tmp===(elem.ownerDocument||document)&&eventPath.push(tmp.defaultView||tmp.parentWindow||window)}for(i=0;(cur=eventPath[i++])&&!event.isPropagationStopped();)event.type=i>1?bubbleType:special.bindType||type,handle=(jQuery._data(cur,"events")||{})[event.type]&&jQuery._data(cur,"handle"),handle&&handle.apply(cur,data),handle=ontype&&cur[ontype],handle&&jQuery.acceptData(cur)&&handle.apply&&handle.apply(cur,data)===!1&&event.preventDefault();if(event.type=type,!onlyHandlers&&!event.isDefaultPrevented()&&(!special._default||special._default.apply(elem.ownerDocument,data)===!1)&&("click"!==type||!jQuery.nodeName(elem,"a"))&&jQuery.acceptData(elem)&&ontype&&elem[type]&&!jQuery.isWindow(elem)){tmp=elem[ontype],tmp&&(elem[ontype]=null),jQuery.event.triggered=type;try{elem[type]()}catch(e){}jQuery.event.triggered=undefined,tmp&&(elem[ontype]=tmp)}return event.result}},dispatch:function(event){event=jQuery.event.fix(event);var i,ret,handleObj,matched,j,handlerQueue=[],args=core_slice.call(arguments),handlers=(jQuery._data(this,"events")||{})[event.type]||[],special=jQuery.event.special[event.type]||{};if(args[0]=event,event.delegateTarget=this,!special.preDispatch||special.preDispatch.call(this,event)!==!1){for(handlerQueue=jQuery.event.handlers.call(this,event,handlers),i=0;(matched=handlerQueue[i++])&&!event.isPropagationStopped();)for(event.currentTarget=matched.elem,j=0;(handleObj=matched.handlers[j++])&&!event.isImmediatePropagationStopped();)if(!event.namespace_re||event.namespace_re.test(handleObj.namespace)){event.handleObj=handleObj,event.data=handleObj.data;var obj=(jQuery.event.special[handleObj.origType]||{}).handle||handleObj.handler;obj.apply&&(ret=obj.apply(matched.elem,args)),ret!==undefined&&(event.result=ret)===!1&&(event.preventDefault(),event.stopPropagation())}return special.postDispatch&&special.postDispatch.call(this,event),event.result}},handlers:function(event,handlers){var sel,handleObj,matches,i,handlerQueue=[],delegateCount=handlers.delegateCount,cur=event.target;if(delegateCount&&cur.nodeType&&(!event.button||"click"!==event.type))for(;cur!=this;cur=cur.parentNode||this)if(1===cur.nodeType&&(cur.disabled!==!0||"click"!==event.type)){for(matches=[],i=0;i=0:jQuery.find(sel,this,null,[cur]).length),matches[sel]&&matches.push(handleObj);matches.length&&handlerQueue.push({elem:cur,handlers:matches})}return delegateCountExpr.cacheLength&&delete cache[keys.shift()],cache[key]=value}}function markFunction(fn){return fn[expando]=!0,fn}function assert(fn){var div=document.createElement("div");try{return fn(div)}catch(e){return!1}finally{div=null}}function Sizzle(selector,context,results,seed){var match,elem,m,nodeType,i,groups,old,nid,newContext,newSelector;if((context?context.ownerDocument||context:preferredDoc)!==document&&setDocument(context),context=context||document,results=results||[],!selector||"string"!=typeof selector)return results;if(1!==(nodeType=context.nodeType)&&9!==nodeType)return[];if(!documentIsXML&&!seed){if(match=rquickExpr.exec(selector))if(m=match[1]){if(9===nodeType){if(elem=context.getElementById(m),!elem||!elem.parentNode)return results;if(elem.id===m)return results.push(elem),results}else if(context.ownerDocument&&(elem=context.ownerDocument.getElementById(m))&&contains(context,elem)&&elem.id===m)return results.push(elem),results}else{if(match[2])return push.apply(results,slice.call(context.getElementsByTagName(selector),0)),results;if((m=match[3])&&support.getByClassName&&context.getElementsByClassName)return push.apply(results,slice.call(context.getElementsByClassName(m),0)),results}if(support.qsa&&!rbuggyQSA.test(selector)){if(old=!0,nid=expando,newContext=context,newSelector=9===nodeType&&selector,1===nodeType&&"object"!==context.nodeName.toLowerCase()){for(groups=tokenize(selector),(old=context.getAttribute("id"))?nid=old.replace(rescape,"\\$&"):context.setAttribute("id",nid),nid="[id='"+nid+"'] ",i=groups.length;i--;)groups[i]=nid+toSelector(groups[i]);newContext=rsibling.test(selector)&&context.parentNode||context,newSelector=groups.join(",")}if(newSelector)try{return push.apply(results,slice.call(newContext.querySelectorAll(newSelector),0)),results}catch(qsaError){}finally{old||context.removeAttribute("id")}}}return select(selector.replace(rtrim,"$1"),context,results,seed)}function siblingCheck(a,b){var cur=b&&a,diff=cur&&(~b.sourceIndex||MAX_NEGATIVE)-(~a.sourceIndex||MAX_NEGATIVE);if(diff)return diff;if(cur)for(;cur=cur.nextSibling;)if(cur===b)return-1;return a?1:-1}function createInputPseudo(type){return function(elem){var name=elem.nodeName.toLowerCase();return"input"===name&&elem.type===type}}function createButtonPseudo(type){return function(elem){var name=elem.nodeName.toLowerCase();return("input"===name||"button"===name)&&elem.type===type}}function createPositionalPseudo(fn){return markFunction(function(argument){return argument=+argument,markFunction(function(seed,matches){for(var j,matchIndexes=fn([],seed.length,argument),i=matchIndexes.length;i--;)seed[j=matchIndexes[i]]&&(seed[j]=!(matches[j]=seed[j]))})})}function tokenize(selector,parseOnly){var matched,match,tokens,type,soFar,groups,preFilters,cached=tokenCache[selector+" "];if(cached)return parseOnly?0:cached.slice(0);for(soFar=selector,groups=[],preFilters=Expr.preFilter;soFar;){ +matched&&!(match=rcomma.exec(soFar))||(match&&(soFar=soFar.slice(match[0].length)||soFar),groups.push(tokens=[])),matched=!1,(match=rcombinators.exec(soFar))&&(matched=match.shift(),tokens.push({value:matched,type:match[0].replace(rtrim," ")}),soFar=soFar.slice(matched.length));for(type in Expr.filter)!(match=matchExpr[type].exec(soFar))||preFilters[type]&&!(match=preFilters[type](match))||(matched=match.shift(),tokens.push({value:matched,type:type,matches:match}),soFar=soFar.slice(matched.length));if(!matched)break}return parseOnly?soFar.length:soFar?Sizzle.error(selector):tokenCache(selector,groups).slice(0)}function toSelector(tokens){for(var i=0,len=tokens.length,selector="";i1?function(elem,context,xml){for(var i=matchers.length;i--;)if(!matchers[i](elem,context,xml))return!1;return!0}:matchers[0]}function condense(unmatched,map,filter,context,xml){for(var elem,newUnmatched=[],i=0,len=unmatched.length,mapped=null!=map;i-1&&(seed[temp]=!(results[temp]=elem))}}else matcherOut=condense(matcherOut===results?matcherOut.splice(preexisting,matcherOut.length):matcherOut),postFinder?postFinder(null,results,matcherOut,xml):push.apply(results,matcherOut)})}function matcherFromTokens(tokens){for(var checkContext,matcher,j,len=tokens.length,leadingRelative=Expr.relative[tokens[0].type],implicitRelative=leadingRelative||Expr.relative[" "],i=leadingRelative?1:0,matchContext=addCombinator(function(elem){return elem===checkContext},implicitRelative,!0),matchAnyContext=addCombinator(function(elem){return indexOf.call(checkContext,elem)>-1},implicitRelative,!0),matchers=[function(elem,context,xml){return!leadingRelative&&(xml||context!==outermostContext)||((checkContext=context).nodeType?matchContext(elem,context,xml):matchAnyContext(elem,context,xml))}];i1&&elementMatcher(matchers),i>1&&toSelector(tokens.slice(0,i-1)).replace(rtrim,"$1"),matcher,i0,byElement=elementMatchers.length>0,superMatcher=function(seed,context,xml,results,expandContext){var elem,j,matcher,setMatched=[],matchedCount=0,i="0",unmatched=seed&&[],outermost=null!=expandContext,contextBackup=outermostContext,elems=seed||byElement&&Expr.find.TAG("*",expandContext&&context.parentNode||context),dirrunsUnique=dirruns+=null==contextBackup?1:Math.random()||.1;for(outermost&&(outermostContext=context!==document&&context,cachedruns=matcherCachedRuns);null!=(elem=elems[i]);i++){if(byElement&&elem){for(j=0;matcher=elementMatchers[j++];)if(matcher(elem,context,xml)){results.push(elem);break}outermost&&(dirruns=dirrunsUnique,cachedruns=++matcherCachedRuns)}bySet&&((elem=!matcher&&elem)&&matchedCount--,seed&&unmatched.push(elem))}if(matchedCount+=i,bySet&&i!==matchedCount){for(j=0;matcher=setMatchers[j++];)matcher(unmatched,setMatched,context,xml);if(seed){if(matchedCount>0)for(;i--;)unmatched[i]||setMatched[i]||(setMatched[i]=pop.call(results));setMatched=condense(setMatched)}push.apply(results,setMatched),outermost&&!seed&&setMatched.length>0&&matchedCount+setMatchers.length>1&&Sizzle.uniqueSort(results)}return outermost&&(dirruns=dirrunsUnique,outermostContext=contextBackup),unmatched};return bySet?markFunction(superMatcher):superMatcher}function multipleContexts(selector,contexts,results){for(var i=0,len=contexts.length;i2&&"ID"===(token=tokens[0]).type&&9===context.nodeType&&!documentIsXML&&Expr.relative[tokens[1].type]){if(context=Expr.find.ID(token.matches[0].replace(runescape,funescape),context)[0],!context)return results;selector=selector.slice(tokens.shift().value.length)}for(i=matchExpr.needsContext.test(selector)?0:tokens.length;i--&&(token=tokens[i],!Expr.relative[type=token.type]);)if((find=Expr.find[type])&&(seed=find(token.matches[0].replace(runescape,funescape),rsibling.test(tokens[0].type)&&context.parentNode||context))){if(tokens.splice(i,1),selector=seed.length&&toSelector(tokens),!selector)return push.apply(results,slice.call(seed,0)),results;break}}return compile(selector,match)(seed,context,documentIsXML,results,rsibling.test(selector)),results}function setFilters(){}var i,cachedruns,Expr,getText,isXML,compile,hasDuplicate,outermostContext,setDocument,document,docElem,documentIsXML,rbuggyQSA,rbuggyMatches,matches,contains,sortOrder,expando="sizzle"+-new Date,preferredDoc=window.document,support={},dirruns=0,done=0,classCache=createCache(),tokenCache=createCache(),compilerCache=createCache(),strundefined=typeof undefined,MAX_NEGATIVE=1<<31,arr=[],pop=arr.pop,push=arr.push,slice=arr.slice,indexOf=arr.indexOf||function(elem){for(var i=0,len=this.length;i+~])"+whitespace+"*"),rpseudo=new RegExp(pseudos),ridentifier=new RegExp("^"+identifier+"$"),matchExpr={ID:new RegExp("^#("+characterEncoding+")"),CLASS:new RegExp("^\\.("+characterEncoding+")"),NAME:new RegExp("^\\[name=['\"]?("+characterEncoding+")['\"]?\\]"),TAG:new RegExp("^("+characterEncoding.replace("w","w*")+")"),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"),needsContext:new RegExp("^"+whitespace+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+whitespace+"*((?:-\\d)?\\d*)"+whitespace+"*\\)|)(?=[^-]|$)","i")},rsibling=/[\x20\t\r\n\f]*[+~]/,rnative=/^[^{]+\{\s*\[native code/,rquickExpr=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,rinputs=/^(?:input|select|textarea|button)$/i,rheader=/^h\d$/i,rescape=/'|\\/g,rattributeQuotes=/\=[\x20\t\r\n\f]*([^'"\]]*)[\x20\t\r\n\f]*\]/g,runescape=/\\([\da-fA-F]{1,6}[\x20\t\r\n\f]?|.)/g,funescape=function(_,escaped){var high="0x"+escaped-65536;return high!==high?escaped:high<0?String.fromCharCode(high+65536):String.fromCharCode(high>>10|55296,1023&high|56320)};try{slice.call(preferredDoc.documentElement.childNodes,0)[0].nodeType}catch(e){slice=function(i){for(var elem,results=[];elem=this[i++];)results.push(elem);return results}}isXML=Sizzle.isXML=function(elem){var documentElement=elem&&(elem.ownerDocument||elem).documentElement;return!!documentElement&&"HTML"!==documentElement.nodeName},setDocument=Sizzle.setDocument=function(node){var doc=node?node.ownerDocument||node:preferredDoc;return doc!==document&&9===doc.nodeType&&doc.documentElement?(document=doc,docElem=doc.documentElement,documentIsXML=isXML(doc),support.tagNameNoComments=assert(function(div){return div.appendChild(doc.createComment("")),!div.getElementsByTagName("*").length}),support.attributes=assert(function(div){div.innerHTML="";var type=typeof div.lastChild.getAttribute("multiple");return"boolean"!==type&&"string"!==type}),support.getByClassName=assert(function(div){return div.innerHTML="",!(!div.getElementsByClassName||!div.getElementsByClassName("e").length)&&(div.lastChild.className="e",2===div.getElementsByClassName("e").length)}),support.getByName=assert(function(div){div.id=expando+0,div.innerHTML="
    ",docElem.insertBefore(div,docElem.firstChild);var pass=doc.getElementsByName&&doc.getElementsByName(expando).length===2+doc.getElementsByName(expando+0).length;return support.getIdNotName=!doc.getElementById(expando),docElem.removeChild(div),pass}),Expr.attrHandle=assert(function(div){return div.innerHTML="",div.firstChild&&typeof div.firstChild.getAttribute!==strundefined&&"#"===div.firstChild.getAttribute("href")})?{}:{href:function(elem){return elem.getAttribute("href",2)},type:function(elem){return elem.getAttribute("type")}},support.getIdNotName?(Expr.find.ID=function(id,context){if(typeof context.getElementById!==strundefined&&!documentIsXML){var m=context.getElementById(id);return m&&m.parentNode?[m]:[]}},Expr.filter.ID=function(id){var attrId=id.replace(runescape,funescape);return function(elem){return elem.getAttribute("id")===attrId}}):(Expr.find.ID=function(id,context){if(typeof context.getElementById!==strundefined&&!documentIsXML){var m=context.getElementById(id);return m?m.id===id||typeof m.getAttributeNode!==strundefined&&m.getAttributeNode("id").value===id?[m]:undefined:[]}},Expr.filter.ID=function(id){var attrId=id.replace(runescape,funescape);return function(elem){var node=typeof elem.getAttributeNode!==strundefined&&elem.getAttributeNode("id");return node&&node.value===attrId}}),Expr.find.TAG=support.tagNameNoComments?function(tag,context){if(typeof context.getElementsByTagName!==strundefined)return context.getElementsByTagName(tag)}:function(tag,context){var elem,tmp=[],i=0,results=context.getElementsByTagName(tag);if("*"===tag){for(;elem=results[i++];)1===elem.nodeType&&tmp.push(elem);return tmp}return results},Expr.find.NAME=support.getByName&&function(tag,context){if(typeof context.getElementsByName!==strundefined)return context.getElementsByName(name)},Expr.find.CLASS=support.getByClassName&&function(className,context){if(typeof context.getElementsByClassName!==strundefined&&!documentIsXML)return context.getElementsByClassName(className)},rbuggyMatches=[],rbuggyQSA=[":focus"],(support.qsa=isNative(doc.querySelectorAll))&&(assert(function(div){div.innerHTML="",div.querySelectorAll("[selected]").length||rbuggyQSA.push("\\["+whitespace+"*(?:checked|disabled|ismap|multiple|readonly|selected|value)"),div.querySelectorAll(":checked").length||rbuggyQSA.push(":checked")}),assert(function(div){div.innerHTML="",div.querySelectorAll("[i^='']").length&&rbuggyQSA.push("[*^$]="+whitespace+"*(?:\"\"|'')"),div.querySelectorAll(":enabled").length||rbuggyQSA.push(":enabled",":disabled"),div.querySelectorAll("*,:x"),rbuggyQSA.push(",.*:")})),(support.matchesSelector=isNative(matches=docElem.matchesSelector||docElem.mozMatchesSelector||docElem.webkitMatchesSelector||docElem.oMatchesSelector||docElem.msMatchesSelector))&&assert(function(div){support.disconnectedMatch=matches.call(div,"div"),matches.call(div,"[s!='']:x"),rbuggyMatches.push("!=",pseudos)}),rbuggyQSA=new RegExp(rbuggyQSA.join("|")),rbuggyMatches=new RegExp(rbuggyMatches.join("|")),contains=isNative(docElem.contains)||docElem.compareDocumentPosition?function(a,b){var adown=9===a.nodeType?a.documentElement:a,bup=b&&b.parentNode;return a===bup||!(!bup||1!==bup.nodeType||!(adown.contains?adown.contains(bup):a.compareDocumentPosition&&16&a.compareDocumentPosition(bup)))}:function(a,b){if(b)for(;b=b.parentNode;)if(b===a)return!0;return!1},sortOrder=docElem.compareDocumentPosition?function(a,b){var compare;return a===b?(hasDuplicate=!0,0):(compare=b.compareDocumentPosition&&a.compareDocumentPosition&&a.compareDocumentPosition(b))?1&compare||a.parentNode&&11===a.parentNode.nodeType?a===doc||contains(preferredDoc,a)?-1:b===doc||contains(preferredDoc,b)?1:0:4&compare?-1:1:a.compareDocumentPosition?-1:1}:function(a,b){var cur,i=0,aup=a.parentNode,bup=b.parentNode,ap=[a],bp=[b];if(a===b)return hasDuplicate=!0,0;if(!aup||!bup)return a===doc?-1:b===doc?1:aup?-1:bup?1:0;if(aup===bup)return siblingCheck(a,b);for(cur=a;cur=cur.parentNode;)ap.unshift(cur);for(cur=b;cur=cur.parentNode;)bp.unshift(cur);for(;ap[i]===bp[i];)i++;return i?siblingCheck(ap[i],bp[i]):ap[i]===preferredDoc?-1:bp[i]===preferredDoc?1:0},hasDuplicate=!1,[0,0].sort(sortOrder),support.detectDuplicates=hasDuplicate,document):document},Sizzle.matches=function(expr,elements){return Sizzle(expr,null,null,elements)},Sizzle.matchesSelector=function(elem,expr){if((elem.ownerDocument||elem)!==document&&setDocument(elem),expr=expr.replace(rattributeQuotes,"='$1']"),support.matchesSelector&&!documentIsXML&&(!rbuggyMatches||!rbuggyMatches.test(expr))&&!rbuggyQSA.test(expr))try{var ret=matches.call(elem,expr);if(ret||support.disconnectedMatch||elem.document&&11!==elem.document.nodeType)return ret}catch(e){}return Sizzle(expr,document,null,[elem]).length>0},Sizzle.contains=function(context,elem){return(context.ownerDocument||context)!==document&&setDocument(context),contains(context,elem)},Sizzle.attr=function(elem,name){var val;return(elem.ownerDocument||elem)!==document&&setDocument(elem),documentIsXML||(name=name.toLowerCase()),(val=Expr.attrHandle[name])?val(elem):documentIsXML||support.attributes?elem.getAttribute(name):((val=elem.getAttributeNode(name))||elem.getAttribute(name))&&elem[name]===!0?name:val&&val.specified?val.value:null},Sizzle.error=function(msg){throw new Error("Syntax error, unrecognized expression: "+msg)},Sizzle.uniqueSort=function(results){var elem,duplicates=[],i=1,j=0;if(hasDuplicate=!support.detectDuplicates,results.sort(sortOrder),hasDuplicate){for(;elem=results[i];i++)elem===results[i-1]&&(j=duplicates.push(i));for(;j--;)results.splice(duplicates[j],1)}return results},getText=Sizzle.getText=function(elem){var node,ret="",i=0,nodeType=elem.nodeType;if(nodeType){if(1===nodeType||9===nodeType||11===nodeType){if("string"==typeof elem.textContent)return elem.textContent;for(elem=elem.firstChild;elem;elem=elem.nextSibling)ret+=getText(elem)}else if(3===nodeType||4===nodeType)return elem.nodeValue}else for(;node=elem[i];i++)ret+=getText(node);return ret},Expr=Sizzle.selectors={cacheLength:50,createPseudo:markFunction,match:matchExpr,find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(match){return match[1]=match[1].replace(runescape,funescape),match[3]=(match[4]||match[5]||"").replace(runescape,funescape),"~="===match[2]&&(match[3]=" "+match[3]+" "),match.slice(0,4)},CHILD:function(match){return match[1]=match[1].toLowerCase(),"nth"===match[1].slice(0,3)?(match[3]||Sizzle.error(match[0]),match[4]=+(match[4]?match[5]+(match[6]||1):2*("even"===match[3]||"odd"===match[3])),match[5]=+(match[7]+match[8]||"odd"===match[3])):match[3]&&Sizzle.error(match[0]),match},PSEUDO:function(match){var excess,unquoted=!match[5]&&match[2];return matchExpr.CHILD.test(match[0])?null:(match[4]?match[2]=match[4]:unquoted&&rpseudo.test(unquoted)&&(excess=tokenize(unquoted,!0))&&(excess=unquoted.indexOf(")",unquoted.length-excess)-unquoted.length)&&(match[0]=match[0].slice(0,excess),match[2]=unquoted.slice(0,excess)),match.slice(0,3))}},filter:{TAG:function(nodeName){return"*"===nodeName?function(){return!0}:(nodeName=nodeName.replace(runescape,funescape).toLowerCase(),function(elem){return elem.nodeName&&elem.nodeName.toLowerCase()===nodeName})},CLASS:function(className){var pattern=classCache[className+" "];return pattern||(pattern=new RegExp("(^|"+whitespace+")"+className+"("+whitespace+"|$)"))&&classCache(className,function(elem){return pattern.test(elem.className||typeof elem.getAttribute!==strundefined&&elem.getAttribute("class")||"")})},ATTR:function(name,operator,check){return function(elem){var result=Sizzle.attr(elem,name);return null==result?"!="===operator:!operator||(result+="","="===operator?result===check:"!="===operator?result!==check:"^="===operator?check&&0===result.indexOf(check):"*="===operator?check&&result.indexOf(check)>-1:"$="===operator?check&&result.slice(-check.length)===check:"~="===operator?(" "+result+" ").indexOf(check)>-1:"|="===operator&&(result===check||result.slice(0,check.length+1)===check+"-"))}},CHILD:function(type,what,argument,first,last){var simple="nth"!==type.slice(0,3),forward="last"!==type.slice(-4),ofType="of-type"===what;return 1===first&&0===last?function(elem){return!!elem.parentNode}:function(elem,context,xml){var cache,outerCache,node,diff,nodeIndex,start,dir=simple!==forward?"nextSibling":"previousSibling",parent=elem.parentNode,name=ofType&&elem.nodeName.toLowerCase(),useCache=!xml&&!ofType;if(parent){if(simple){for(;dir;){for(node=elem;node=node[dir];)if(ofType?node.nodeName.toLowerCase()===name:1===node.nodeType)return!1;start=dir="only"===type&&!start&&"nextSibling"}return!0}if(start=[forward?parent.firstChild:parent.lastChild],forward&&useCache){for(outerCache=parent[expando]||(parent[expando]={}),cache=outerCache[type]||[],nodeIndex=cache[0]===dirruns&&cache[1],diff=cache[0]===dirruns&&cache[2],node=nodeIndex&&parent.childNodes[nodeIndex];node=++nodeIndex&&node&&node[dir]||(diff=nodeIndex=0)||start.pop();)if(1===node.nodeType&&++diff&&node===elem){outerCache[type]=[dirruns,nodeIndex,diff];break}}else if(useCache&&(cache=(elem[expando]||(elem[expando]={}))[type])&&cache[0]===dirruns)diff=cache[1];else for(;(node=++nodeIndex&&node&&node[dir]||(diff=nodeIndex=0)||start.pop())&&((ofType?node.nodeName.toLowerCase()!==name:1!==node.nodeType)||!++diff||(useCache&&((node[expando]||(node[expando]={}))[type]=[dirruns,diff]),node!==elem)););return diff-=last,diff===first||diff%first===0&&diff/first>=0}}},PSEUDO:function(pseudo,argument){var args,fn=Expr.pseudos[pseudo]||Expr.setFilters[pseudo.toLowerCase()]||Sizzle.error("unsupported pseudo: "+pseudo);return fn[expando]?fn(argument):fn.length>1?(args=[pseudo,pseudo,"",argument],Expr.setFilters.hasOwnProperty(pseudo.toLowerCase())?markFunction(function(seed,matches){for(var idx,matched=fn(seed,argument),i=matched.length;i--;)idx=indexOf.call(seed,matched[i]),seed[idx]=!(matches[idx]=matched[i])}):function(elem){return fn(elem,0,args)}):fn}},pseudos:{not:markFunction(function(selector){var input=[],results=[],matcher=compile(selector.replace(rtrim,"$1"));return matcher[expando]?markFunction(function(seed,matches,context,xml){for(var elem,unmatched=matcher(seed,null,xml,[]),i=seed.length;i--;)(elem=unmatched[i])&&(seed[i]=!(matches[i]=elem))}):function(elem,context,xml){return input[0]=elem,matcher(input,null,xml,results),!results.pop()}}),has:markFunction(function(selector){return function(elem){return Sizzle(selector,elem).length>0}}),contains:markFunction(function(text){return function(elem){return(elem.textContent||elem.innerText||getText(elem)).indexOf(text)>-1}}),lang:markFunction(function(lang){return ridentifier.test(lang||"")||Sizzle.error("unsupported lang: "+lang),lang=lang.replace(runescape,funescape).toLowerCase(),function(elem){var elemLang;do if(elemLang=documentIsXML?elem.getAttribute("xml:lang")||elem.getAttribute("lang"):elem.lang)return elemLang=elemLang.toLowerCase(),elemLang===lang||0===elemLang.indexOf(lang+"-");while((elem=elem.parentNode)&&1===elem.nodeType);return!1}}),target:function(elem){var hash=window.location&&window.location.hash;return hash&&hash.slice(1)===elem.id},root:function(elem){return elem===docElem},focus:function(elem){return elem===document.activeElement&&(!document.hasFocus||document.hasFocus())&&!!(elem.type||elem.href||~elem.tabIndex)},enabled:function(elem){return elem.disabled===!1},disabled:function(elem){return elem.disabled===!0},checked:function(elem){var nodeName=elem.nodeName.toLowerCase();return"input"===nodeName&&!!elem.checked||"option"===nodeName&&!!elem.selected},selected:function(elem){return elem.parentNode&&elem.parentNode.selectedIndex,elem.selected===!0},empty:function(elem){for(elem=elem.firstChild;elem;elem=elem.nextSibling)if(elem.nodeName>"@"||3===elem.nodeType||4===elem.nodeType)return!1;return!0},parent:function(elem){return!Expr.pseudos.empty(elem)},header:function(elem){return rheader.test(elem.nodeName)},input:function(elem){return rinputs.test(elem.nodeName)},button:function(elem){var name=elem.nodeName.toLowerCase();return"input"===name&&"button"===elem.type||"button"===name},text:function(elem){var attr;return"input"===elem.nodeName.toLowerCase()&&"text"===elem.type&&(null==(attr=elem.getAttribute("type"))||attr.toLowerCase()===elem.type)},first:createPositionalPseudo(function(){return[0]}),last:createPositionalPseudo(function(matchIndexes,length){return[length-1]}),eq:createPositionalPseudo(function(matchIndexes,length,argument){return[argument<0?argument+length:argument]}),even:createPositionalPseudo(function(matchIndexes,length){for(var i=0;i=0;)matchIndexes.push(i);return matchIndexes}),gt:createPositionalPseudo(function(matchIndexes,length,argument){for(var i=argument<0?argument+length:argument;++i1?jQuery.unique(ret):ret),ret.selector=(this.selector?this.selector+" ":"")+selector,ret},has:function(target){var i,targets=jQuery(target,this),len=targets.length;return this.filter(function(){for(i=0;i=0:jQuery.filter(selector,this).length>0:this.filter(selector).length>0)},closest:function(selectors,context){for(var cur,i=0,l=this.length,ret=[],pos=rneedsContext.test(selectors)||"string"!=typeof selectors?jQuery(selectors,context||this.context):0;i-1:jQuery.find.matchesSelector(cur,selectors)){ret.push(cur);break}cur=cur.parentNode}return this.pushStack(ret.length>1?jQuery.unique(ret):ret)},index:function(elem){return elem?"string"==typeof elem?jQuery.inArray(this[0],jQuery(elem)):jQuery.inArray(elem.jquery?elem[0]:elem,this):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(selector,context){var set="string"==typeof selector?jQuery(selector,context):jQuery.makeArray(selector&&selector.nodeType?[selector]:selector),all=jQuery.merge(this.get(),set);return this.pushStack(jQuery.unique(all))},addBack:function(selector){return this.add(null==selector?this.prevObject:this.prevObject.filter(selector))}}),jQuery.fn.andSelf=jQuery.fn.addBack,jQuery.each({parent:function(elem){var parent=elem.parentNode;return parent&&11!==parent.nodeType?parent:null},parents:function(elem){return jQuery.dir(elem,"parentNode")},parentsUntil:function(elem,i,until){return jQuery.dir(elem,"parentNode",until)},next:function(elem){return sibling(elem,"nextSibling")},prev:function(elem){return sibling(elem,"previousSibling")},nextAll:function(elem){return jQuery.dir(elem,"nextSibling")},prevAll:function(elem){return jQuery.dir(elem,"previousSibling")},nextUntil:function(elem,i,until){return jQuery.dir(elem,"nextSibling",until)},prevUntil:function(elem,i,until){return jQuery.dir(elem,"previousSibling",until)},siblings:function(elem){return jQuery.sibling((elem.parentNode||{}).firstChild,elem)},children:function(elem){return jQuery.sibling(elem.firstChild)},contents:function(elem){return jQuery.nodeName(elem,"iframe")?elem.contentDocument||elem.contentWindow.document:jQuery.merge([],elem.childNodes)}},function(name,fn){jQuery.fn[name]=function(until,selector){var ret=jQuery.map(this,fn,until);return runtil.test(name)||(selector=until),selector&&"string"==typeof selector&&(ret=jQuery.filter(selector,ret)),ret=this.length>1&&!guaranteedUnique[name]?jQuery.unique(ret):ret,this.length>1&&rparentsprev.test(name)&&(ret=ret.reverse()),this.pushStack(ret)}}),jQuery.extend({filter:function(expr,elems,not){return not&&(expr=":not("+expr+")"),1===elems.length?jQuery.find.matchesSelector(elems[0],expr)?[elems[0]]:[]:jQuery.find.matches(expr,elems)},dir:function(elem,dir,until){for(var matched=[],cur=elem[dir];cur&&9!==cur.nodeType&&(until===undefined||1!==cur.nodeType||!jQuery(cur).is(until));)1===cur.nodeType&&matched.push(cur),cur=cur[dir];return matched},sibling:function(n,elem){for(var r=[];n;n=n.nextSibling)1===n.nodeType&&n!==elem&&r.push(n);return r}});var nodeNames="abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",rinlinejQuery=/ jQuery\d+="(?:null|\d+)"/g,rnoshimcache=new RegExp("<(?:"+nodeNames+")[\\s/>]","i"),rleadingWhitespace=/^\s+/,rxhtmlTag=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,rtagName=/<([\w:]+)/,rtbody=/\s*$/g,wrapMap={option:[1,""],legend:[1,"
    ","
    "],area:[1,"",""],param:[1,"",""],thead:[1,"","
    "],tr:[2,"","
    "],col:[2,"","
    "],td:[3,"","
    "],_default:jQuery.support.htmlSerialize?[0,"",""]:[1,"X
    ","
    "]},safeFragment=createSafeFragment(document),fragmentDiv=safeFragment.appendChild(document.createElement("div"));wrapMap.optgroup=wrapMap.option,wrapMap.tbody=wrapMap.tfoot=wrapMap.colgroup=wrapMap.caption=wrapMap.thead,wrapMap.th=wrapMap.td,jQuery.fn.extend({text:function(value){return jQuery.access(this,function(value){return value===undefined?jQuery.text(this):this.empty().append((this[0]&&this[0].ownerDocument||document).createTextNode(value))},null,value,arguments.length)},wrapAll:function(html){if(jQuery.isFunction(html))return this.each(function(i){jQuery(this).wrapAll(html.call(this,i))});if(this[0]){var wrap=jQuery(html,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&wrap.insertBefore(this[0]),wrap.map(function(){for(var elem=this;elem.firstChild&&1===elem.firstChild.nodeType;)elem=elem.firstChild;return elem}).append(this)}return this},wrapInner:function(html){return jQuery.isFunction(html)?this.each(function(i){jQuery(this).wrapInner(html.call(this,i))}):this.each(function(){var self=jQuery(this),contents=self.contents();contents.length?contents.wrapAll(html):self.append(html)})},wrap:function(html){var isFunction=jQuery.isFunction(html);return this.each(function(i){jQuery(this).wrapAll(isFunction?html.call(this,i):html)})},unwrap:function(){return this.parent().each(function(){jQuery.nodeName(this,"body")||jQuery(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(elem){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||this.appendChild(elem)})},prepend:function(){return this.domManip(arguments,!0,function(elem){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||this.insertBefore(elem,this.firstChild)})},before:function(){return this.domManip(arguments,!1,function(elem){this.parentNode&&this.parentNode.insertBefore(elem,this)})},after:function(){return this.domManip(arguments,!1,function(elem){this.parentNode&&this.parentNode.insertBefore(elem,this.nextSibling)})},remove:function(selector,keepData){for(var elem,i=0;null!=(elem=this[i]);i++)(!selector||jQuery.filter(selector,[elem]).length>0)&&(keepData||1!==elem.nodeType||jQuery.cleanData(getAll(elem)), +elem.parentNode&&(keepData&&jQuery.contains(elem.ownerDocument,elem)&&setGlobalEval(getAll(elem,"script")),elem.parentNode.removeChild(elem)));return this},empty:function(){for(var elem,i=0;null!=(elem=this[i]);i++){for(1===elem.nodeType&&jQuery.cleanData(getAll(elem,!1));elem.firstChild;)elem.removeChild(elem.firstChild);elem.options&&jQuery.nodeName(elem,"select")&&(elem.options.length=0)}return this},clone:function(dataAndEvents,deepDataAndEvents){return dataAndEvents=null!=dataAndEvents&&dataAndEvents,deepDataAndEvents=null==deepDataAndEvents?dataAndEvents:deepDataAndEvents,this.map(function(){return jQuery.clone(this,dataAndEvents,deepDataAndEvents)})},html:function(value){return jQuery.access(this,function(value){var elem=this[0]||{},i=0,l=this.length;if(value===undefined)return 1===elem.nodeType?elem.innerHTML.replace(rinlinejQuery,""):undefined;if("string"==typeof value&&!rnoInnerhtml.test(value)&&(jQuery.support.htmlSerialize||!rnoshimcache.test(value))&&(jQuery.support.leadingWhitespace||!rleadingWhitespace.test(value))&&!wrapMap[(rtagName.exec(value)||["",""])[1].toLowerCase()]){value=value.replace(rxhtmlTag,"<$1>");try{for(;i")?clone=elem.cloneNode(!0):(fragmentDiv.innerHTML=elem.outerHTML,fragmentDiv.removeChild(clone=fragmentDiv.firstChild)),!(jQuery.support.noCloneEvent&&jQuery.support.noCloneChecked||1!==elem.nodeType&&11!==elem.nodeType||jQuery.isXMLDoc(elem)))for(destElements=getAll(clone),srcElements=getAll(elem),i=0;null!=(node=srcElements[i]);++i)destElements[i]&&fixCloneNodeIssues(node,destElements[i]);if(dataAndEvents)if(deepDataAndEvents)for(srcElements=srcElements||getAll(elem),destElements=destElements||getAll(clone),i=0;null!=(node=srcElements[i]);i++)cloneCopyEvent(node,destElements[i]);else cloneCopyEvent(elem,clone);return destElements=getAll(clone,"script"),destElements.length>0&&setGlobalEval(destElements,!inPage&&getAll(elem,"script")),destElements=srcElements=node=null,clone},buildFragment:function(elems,context,scripts,selection){for(var j,elem,contains,tmp,tag,tbody,wrap,l=elems.length,safe=createSafeFragment(context),nodes=[],i=0;i")+wrap[2],j=wrap[0];j--;)tmp=tmp.lastChild;if(!jQuery.support.leadingWhitespace&&rleadingWhitespace.test(elem)&&nodes.push(context.createTextNode(rleadingWhitespace.exec(elem)[0])),!jQuery.support.tbody)for(elem="table"!==tag||rtbody.test(elem)?""!==wrap[1]||rtbody.test(elem)?0:tmp:tmp.firstChild,j=elem&&elem.childNodes.length;j--;)jQuery.nodeName(tbody=elem.childNodes[j],"tbody")&&!tbody.childNodes.length&&elem.removeChild(tbody);for(jQuery.merge(nodes,tmp.childNodes),tmp.textContent="";tmp.firstChild;)tmp.removeChild(tmp.firstChild);tmp=safe.lastChild}else nodes.push(context.createTextNode(elem));for(tmp&&safe.removeChild(tmp),jQuery.support.appendChecked||jQuery.grep(getAll(nodes,"input"),fixDefaultChecked),i=0;elem=nodes[i++];)if((!selection||jQuery.inArray(elem,selection)===-1)&&(contains=jQuery.contains(elem.ownerDocument,elem),tmp=getAll(safe.appendChild(elem),"script"),contains&&setGlobalEval(tmp),scripts))for(j=0;elem=tmp[j++];)rscriptType.test(elem.type||"")&&scripts.push(elem);return tmp=null,safe},cleanData:function(elems,acceptData){for(var elem,type,id,data,i=0,internalKey=jQuery.expando,cache=jQuery.cache,deleteExpando=jQuery.support.deleteExpando,special=jQuery.event.special;null!=(elem=elems[i]);i++)if((acceptData||jQuery.acceptData(elem))&&(id=elem[internalKey],data=id&&cache[id])){if(data.events)for(type in data.events)special[type]?jQuery.event.remove(elem,type):jQuery.removeEvent(elem,type,data.handle);cache[id]&&(delete cache[id],deleteExpando?delete elem[internalKey]:typeof elem.removeAttribute!==core_strundefined?elem.removeAttribute(internalKey):elem[internalKey]=null,core_deletedIds.push(id))}}});var iframe,getStyles,curCSS,ralpha=/alpha\([^)]*\)/i,ropacity=/opacity\s*=\s*([^)]*)/,rposition=/^(top|right|bottom|left)$/,rdisplayswap=/^(none|table(?!-c[ea]).+)/,rmargin=/^margin/,rnumsplit=new RegExp("^("+core_pnum+")(.*)$","i"),rnumnonpx=new RegExp("^("+core_pnum+")(?!px)[a-z%]+$","i"),rrelNum=new RegExp("^([+-])=("+core_pnum+")","i"),elemdisplay={BODY:"block"},cssShow={position:"absolute",visibility:"hidden",display:"block"},cssNormalTransform={letterSpacing:0,fontWeight:400},cssExpand=["Top","Right","Bottom","Left"],cssPrefixes=["Webkit","O","Moz","ms"];jQuery.fn.extend({css:function(name,value){return jQuery.access(this,function(elem,name,value){var len,styles,map={},i=0;if(jQuery.isArray(name)){for(styles=getStyles(elem),len=name.length;i1)},show:function(){return showHide(this,!0)},hide:function(){return showHide(this)},toggle:function(state){var bool="boolean"==typeof state;return this.each(function(){(bool?state:isHidden(this))?jQuery(this).show():jQuery(this).hide()})}}),jQuery.extend({cssHooks:{opacity:{get:function(elem,computed){if(computed){var ret=curCSS(elem,"opacity");return""===ret?"1":ret}}}},cssNumber:{columnCount:!0,fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":jQuery.support.cssFloat?"cssFloat":"styleFloat"},style:function(elem,name,value,extra){if(elem&&3!==elem.nodeType&&8!==elem.nodeType&&elem.style){var ret,type,hooks,origName=jQuery.camelCase(name),style=elem.style;if(name=jQuery.cssProps[origName]||(jQuery.cssProps[origName]=vendorPropName(style,origName)),hooks=jQuery.cssHooks[name]||jQuery.cssHooks[origName],value===undefined)return hooks&&"get"in hooks&&(ret=hooks.get(elem,!1,extra))!==undefined?ret:style[name];if(type=typeof value,"string"===type&&(ret=rrelNum.exec(value))&&(value=(ret[1]+1)*ret[2]+parseFloat(jQuery.css(elem,name)),type="number"),!(null==value||"number"===type&&isNaN(value)||("number"!==type||jQuery.cssNumber[origName]||(value+="px"),jQuery.support.clearCloneStyle||""!==value||0!==name.indexOf("background")||(style[name]="inherit"),hooks&&"set"in hooks&&(value=hooks.set(elem,value,extra))===undefined)))try{style[name]=value}catch(e){}}},css:function(elem,name,extra,styles){var num,val,hooks,origName=jQuery.camelCase(name);return name=jQuery.cssProps[origName]||(jQuery.cssProps[origName]=vendorPropName(elem.style,origName)),hooks=jQuery.cssHooks[name]||jQuery.cssHooks[origName],hooks&&"get"in hooks&&(val=hooks.get(elem,!0,extra)),val===undefined&&(val=curCSS(elem,name,styles)),"normal"===val&&name in cssNormalTransform&&(val=cssNormalTransform[name]),""===extra||extra?(num=parseFloat(val),extra===!0||jQuery.isNumeric(num)?num||0:val):val},swap:function(elem,options,callback,args){var ret,name,old={};for(name in options)old[name]=elem.style[name],elem.style[name]=options[name];ret=callback.apply(elem,args||[]);for(name in options)elem.style[name]=old[name];return ret}}),window.getComputedStyle?(getStyles=function(elem){return window.getComputedStyle(elem,null)},curCSS=function(elem,name,_computed){var width,minWidth,maxWidth,computed=_computed||getStyles(elem),ret=computed?computed.getPropertyValue(name)||computed[name]:undefined,style=elem.style;return computed&&(""!==ret||jQuery.contains(elem.ownerDocument,elem)||(ret=jQuery.style(elem,name)),rnumnonpx.test(ret)&&rmargin.test(name)&&(width=style.width,minWidth=style.minWidth,maxWidth=style.maxWidth,style.minWidth=style.maxWidth=style.width=ret,ret=computed.width,style.width=width,style.minWidth=minWidth,style.maxWidth=maxWidth)),ret}):document.documentElement.currentStyle&&(getStyles=function(elem){return elem.currentStyle},curCSS=function(elem,name,_computed){var left,rs,rsLeft,computed=_computed||getStyles(elem),ret=computed?computed[name]:undefined,style=elem.style;return null==ret&&style&&style[name]&&(ret=style[name]),rnumnonpx.test(ret)&&!rposition.test(name)&&(left=style.left,rs=elem.runtimeStyle,rsLeft=rs&&rs.left,rsLeft&&(rs.left=elem.currentStyle.left),style.left="fontSize"===name?"1em":ret,ret=style.pixelLeft+"px",style.left=left,rsLeft&&(rs.left=rsLeft)),""===ret?"auto":ret}),jQuery.each(["height","width"],function(i,name){jQuery.cssHooks[name]={get:function(elem,computed,extra){if(computed)return 0===elem.offsetWidth&&rdisplayswap.test(jQuery.css(elem,"display"))?jQuery.swap(elem,cssShow,function(){return getWidthOrHeight(elem,name,extra)}):getWidthOrHeight(elem,name,extra)},set:function(elem,value,extra){var styles=extra&&getStyles(elem);return setPositiveNumber(elem,value,extra?augmentWidthOrHeight(elem,name,extra,jQuery.support.boxSizing&&"border-box"===jQuery.css(elem,"boxSizing",!1,styles),styles):0)}}}),jQuery.support.opacity||(jQuery.cssHooks.opacity={get:function(elem,computed){return ropacity.test((computed&&elem.currentStyle?elem.currentStyle.filter:elem.style.filter)||"")?.01*parseFloat(RegExp.$1)+"":computed?"1":""},set:function(elem,value){var style=elem.style,currentStyle=elem.currentStyle,opacity=jQuery.isNumeric(value)?"alpha(opacity="+100*value+")":"",filter=currentStyle&¤tStyle.filter||style.filter||"";style.zoom=1,(value>=1||""===value)&&""===jQuery.trim(filter.replace(ralpha,""))&&style.removeAttribute&&(style.removeAttribute("filter"),""===value||currentStyle&&!currentStyle.filter)||(style.filter=ralpha.test(filter)?filter.replace(ralpha,opacity):filter+" "+opacity)}}),jQuery(function(){jQuery.support.reliableMarginRight||(jQuery.cssHooks.marginRight={get:function(elem,computed){if(computed)return jQuery.swap(elem,{display:"inline-block"},curCSS,[elem,"marginRight"])}}),!jQuery.support.pixelPosition&&jQuery.fn.position&&jQuery.each(["top","left"],function(i,prop){jQuery.cssHooks[prop]={get:function(elem,computed){if(computed)return computed=curCSS(elem,prop),rnumnonpx.test(computed)?jQuery(elem).position()[prop]+"px":computed}}})}),jQuery.expr&&jQuery.expr.filters&&(jQuery.expr.filters.hidden=function(elem){return elem.offsetWidth<=0&&elem.offsetHeight<=0||!jQuery.support.reliableHiddenOffsets&&"none"===(elem.style&&elem.style.display||jQuery.css(elem,"display"))},jQuery.expr.filters.visible=function(elem){return!jQuery.expr.filters.hidden(elem)}),jQuery.each({margin:"",padding:"",border:"Width"},function(prefix,suffix){jQuery.cssHooks[prefix+suffix]={expand:function(value){for(var i=0,expanded={},parts="string"==typeof value?value.split(" "):[value];i<4;i++)expanded[prefix+cssExpand[i]+suffix]=parts[i]||parts[i-2]||parts[0];return expanded}},rmargin.test(prefix)||(jQuery.cssHooks[prefix+suffix].set=setPositiveNumber)});var r20=/%20/g,rbracket=/\[\]$/,rCRLF=/\r?\n/g,rsubmitterTypes=/^(?:submit|button|image|reset|file)$/i,rsubmittable=/^(?:input|select|textarea|keygen)/i;jQuery.fn.extend({serialize:function(){return jQuery.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var elements=jQuery.prop(this,"elements");return elements?jQuery.makeArray(elements):this}).filter(function(){var type=this.type;return this.name&&!jQuery(this).is(":disabled")&&rsubmittable.test(this.nodeName)&&!rsubmitterTypes.test(type)&&(this.checked||!manipulation_rcheckableType.test(type))}).map(function(i,elem){var val=jQuery(this).val();return null==val?null:jQuery.isArray(val)?jQuery.map(val,function(val){return{name:elem.name,value:val.replace(rCRLF,"\r\n")}}):{name:elem.name,value:val.replace(rCRLF,"\r\n")}}).get()}}),jQuery.param=function(a,traditional){var prefix,s=[],add=function(key,value){value=jQuery.isFunction(value)?value():null==value?"":value,s[s.length]=encodeURIComponent(key)+"="+encodeURIComponent(value)};if(traditional===undefined&&(traditional=jQuery.ajaxSettings&&jQuery.ajaxSettings.traditional),jQuery.isArray(a)||a.jquery&&!jQuery.isPlainObject(a))jQuery.each(a,function(){add(this.name,this.value)});else for(prefix in a)buildParams(prefix,a[prefix],traditional,add);return s.join("&").replace(r20,"+")},jQuery.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "),function(i,name){jQuery.fn[name]=function(data,fn){return arguments.length>0?this.on(name,null,data,fn):this.trigger(name)}}),jQuery.fn.hover=function(fnOver,fnOut){return this.mouseenter(fnOver).mouseleave(fnOut||fnOver)};var ajaxLocParts,ajaxLocation,ajax_nonce=jQuery.now(),ajax_rquery=/\?/,rhash=/#.*$/,rts=/([?&])_=[^&]*/,rheaders=/^(.*?):[ \t]*([^\r\n]*)\r?$/gm,rlocalProtocol=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,rnoContent=/^(?:GET|HEAD)$/,rprotocol=/^\/\//,rurl=/^([\w.+-]+:)(?:\/\/([^\/?#:]*)(?::(\d+)|)|)/,_load=jQuery.fn.load,prefilters={},transports={},allTypes="*/".concat("*");try{ajaxLocation=location.href}catch(e){ajaxLocation=document.createElement("a"),ajaxLocation.href="",ajaxLocation=ajaxLocation.href}ajaxLocParts=rurl.exec(ajaxLocation.toLowerCase())||[],jQuery.fn.load=function(url,params,callback){if("string"!=typeof url&&_load)return _load.apply(this,arguments);var selector,response,type,self=this,off=url.indexOf(" ");return off>=0&&(selector=url.slice(off,url.length),url=url.slice(0,off)),jQuery.isFunction(params)?(callback=params,params=undefined):params&&"object"==typeof params&&(type="POST"),self.length>0&&jQuery.ajax({url:url,type:type,dataType:"html",data:params}).done(function(responseText){response=arguments,self.html(selector?jQuery("
    ").append(jQuery.parseHTML(responseText)).find(selector):responseText)}).complete(callback&&function(jqXHR,status){self.each(callback,response||[jqXHR.responseText,status,jqXHR])}),this},jQuery.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(i,type){jQuery.fn[type]=function(fn){return this.on(type,fn)}}),jQuery.each(["get","post"],function(i,method){jQuery[method]=function(url,data,callback,type){return jQuery.isFunction(data)&&(type=type||callback,callback=data,data=undefined),jQuery.ajax({url:url,type:method,dataType:type,data:data,success:callback})}}),jQuery.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:ajaxLocation,type:"GET",isLocal:rlocalProtocol.test(ajaxLocParts[1]),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":allTypes,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":window.String,"text html":!0,"text json":jQuery.parseJSON,"text xml":jQuery.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(target,settings){return settings?ajaxExtend(ajaxExtend(target,jQuery.ajaxSettings),settings):ajaxExtend(jQuery.ajaxSettings,target)},ajaxPrefilter:addToPrefiltersOrTransports(prefilters),ajaxTransport:addToPrefiltersOrTransports(transports),ajax:function(url,options){function done(status,nativeStatusText,responses,headers){var isSuccess,success,error,response,modified,statusText=nativeStatusText;2!==state&&(state=2,timeoutTimer&&clearTimeout(timeoutTimer),transport=undefined,responseHeadersString=headers||"",jqXHR.readyState=status>0?4:0,responses&&(response=ajaxHandleResponses(s,jqXHR,responses)),status>=200&&status<300||304===status?(s.ifModified&&(modified=jqXHR.getResponseHeader("Last-Modified"),modified&&(jQuery.lastModified[cacheURL]=modified),modified=jqXHR.getResponseHeader("etag"),modified&&(jQuery.etag[cacheURL]=modified)),204===status?(isSuccess=!0,statusText="nocontent"):304===status?(isSuccess=!0,statusText="notmodified"):(isSuccess=ajaxConvert(s,response),statusText=isSuccess.state,success=isSuccess.data,error=isSuccess.error,isSuccess=!error)):(error=statusText,!status&&statusText||(statusText="error",status<0&&(status=0))),jqXHR.status=status,jqXHR.statusText=(nativeStatusText||statusText)+"",isSuccess?deferred.resolveWith(callbackContext,[success,statusText,jqXHR]):deferred.rejectWith(callbackContext,[jqXHR,statusText,error]),jqXHR.statusCode(statusCode),statusCode=undefined,fireGlobals&&globalEventContext.trigger(isSuccess?"ajaxSuccess":"ajaxError",[jqXHR,s,isSuccess?success:error]),completeDeferred.fireWith(callbackContext,[jqXHR,statusText]),fireGlobals&&(globalEventContext.trigger("ajaxComplete",[jqXHR,s]),--jQuery.active||jQuery.event.trigger("ajaxStop")))}"object"==typeof url&&(options=url,url=undefined),options=options||{};var parts,i,cacheURL,responseHeadersString,timeoutTimer,fireGlobals,transport,responseHeaders,s=jQuery.ajaxSetup({},options),callbackContext=s.context||s,globalEventContext=s.context&&(callbackContext.nodeType||callbackContext.jquery)?jQuery(callbackContext):jQuery.event,deferred=jQuery.Deferred(),completeDeferred=jQuery.Callbacks("once memory"),statusCode=s.statusCode||{},requestHeaders={},requestHeadersNames={},state=0,strAbort="canceled",jqXHR={readyState:0,getResponseHeader:function(key){var match;if(2===state){if(!responseHeaders)for(responseHeaders={};match=rheaders.exec(responseHeadersString);)responseHeaders[match[1].toLowerCase()]=match[2];match=responseHeaders[key.toLowerCase()]}return null==match?null:match},getAllResponseHeaders:function(){return 2===state?responseHeadersString:null},setRequestHeader:function(name,value){var lname=name.toLowerCase();return state||(name=requestHeadersNames[lname]=requestHeadersNames[lname]||name,requestHeaders[name]=value),this},overrideMimeType:function(type){return state||(s.mimeType=type),this},statusCode:function(map){var code;if(map)if(state<2)for(code in map)statusCode[code]=[statusCode[code],map[code]];else jqXHR.always(map[jqXHR.status]);return this},abort:function(statusText){var finalText=statusText||strAbort;return transport&&transport.abort(finalText),done(0,finalText),this}};if(deferred.promise(jqXHR).complete=completeDeferred.add,jqXHR.success=jqXHR.done,jqXHR.error=jqXHR.fail,s.url=((url||s.url||ajaxLocation)+"").replace(rhash,"").replace(rprotocol,ajaxLocParts[1]+"//"),s.type=options.method||options.type||s.method||s.type,s.dataTypes=jQuery.trim(s.dataType||"*").toLowerCase().match(core_rnotwhite)||[""],null==s.crossDomain&&(parts=rurl.exec(s.url.toLowerCase()),s.crossDomain=!(!parts||parts[1]===ajaxLocParts[1]&&parts[2]===ajaxLocParts[2]&&(parts[3]||("http:"===parts[1]?80:443))==(ajaxLocParts[3]||("http:"===ajaxLocParts[1]?80:443)))),s.data&&s.processData&&"string"!=typeof s.data&&(s.data=jQuery.param(s.data,s.traditional)),inspectPrefiltersOrTransports(prefilters,s,options,jqXHR),2===state)return jqXHR;fireGlobals=s.global,fireGlobals&&0===jQuery.active++&&jQuery.event.trigger("ajaxStart"),s.type=s.type.toUpperCase(),s.hasContent=!rnoContent.test(s.type),cacheURL=s.url,s.hasContent||(s.data&&(cacheURL=s.url+=(ajax_rquery.test(cacheURL)?"&":"?")+s.data,delete s.data),s.cache===!1&&(s.url=rts.test(cacheURL)?cacheURL.replace(rts,"$1_="+ajax_nonce++):cacheURL+(ajax_rquery.test(cacheURL)?"&":"?")+"_="+ajax_nonce++)),s.ifModified&&(jQuery.lastModified[cacheURL]&&jqXHR.setRequestHeader("If-Modified-Since",jQuery.lastModified[cacheURL]),jQuery.etag[cacheURL]&&jqXHR.setRequestHeader("If-None-Match",jQuery.etag[cacheURL])),(s.data&&s.hasContent&&s.contentType!==!1||options.contentType)&&jqXHR.setRequestHeader("Content-Type",s.contentType),jqXHR.setRequestHeader("Accept",s.dataTypes[0]&&s.accepts[s.dataTypes[0]]?s.accepts[s.dataTypes[0]]+("*"!==s.dataTypes[0]?", "+allTypes+"; q=0.01":""):s.accepts["*"]);for(i in s.headers)jqXHR.setRequestHeader(i,s.headers[i]);if(s.beforeSend&&(s.beforeSend.call(callbackContext,jqXHR,s)===!1||2===state))return jqXHR.abort();strAbort="abort";for(i in{success:1,error:1,complete:1})jqXHR[i](s[i]);if(transport=inspectPrefiltersOrTransports(transports,s,options,jqXHR)){jqXHR.readyState=1,fireGlobals&&globalEventContext.trigger("ajaxSend",[jqXHR,s]),s.async&&s.timeout>0&&(timeoutTimer=setTimeout(function(){jqXHR.abort("timeout")},s.timeout));try{state=1,transport.send(requestHeaders,done)}catch(e){if(!(state<2))throw e;done(-1,e)}}else done(-1,"No Transport");return jqXHR},getScript:function(url,callback){return jQuery.get(url,undefined,callback,"script")},getJSON:function(url,data,callback){return jQuery.get(url,data,callback,"json")}}),jQuery.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/(?:java|ecma)script/},converters:{"text script":function(text){return jQuery.globalEval(text),text}}}),jQuery.ajaxPrefilter("script",function(s){s.cache===undefined&&(s.cache=!1),s.crossDomain&&(s.type="GET",s.global=!1)}),jQuery.ajaxTransport("script",function(s){if(s.crossDomain){var script,head=document.head||jQuery("head")[0]||document.documentElement;return{send:function(_,callback){script=document.createElement("script"),script.async=!0,s.scriptCharset&&(script.charset=s.scriptCharset),script.src=s.url,script.onload=script.onreadystatechange=function(_,isAbort){(isAbort||!script.readyState||/loaded|complete/.test(script.readyState))&&(script.onload=script.onreadystatechange=null,script.parentNode&&script.parentNode.removeChild(script),script=null,isAbort||callback(200,"success"))},head.insertBefore(script,head.firstChild)},abort:function(){script&&script.onload(undefined,!0)}}}});var oldCallbacks=[],rjsonp=/(=)\?(?=&|$)|\?\?/;jQuery.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var callback=oldCallbacks.pop()||jQuery.expando+"_"+ajax_nonce++;return this[callback]=!0,callback}}),jQuery.ajaxPrefilter("json jsonp",function(s,originalSettings,jqXHR){var callbackName,overwritten,responseContainer,jsonProp=s.jsonp!==!1&&(rjsonp.test(s.url)?"url":"string"==typeof s.data&&!(s.contentType||"").indexOf("application/x-www-form-urlencoded")&&rjsonp.test(s.data)&&"data");if(jsonProp||"jsonp"===s.dataTypes[0])return callbackName=s.jsonpCallback=jQuery.isFunction(s.jsonpCallback)?s.jsonpCallback():s.jsonpCallback,jsonProp?s[jsonProp]=s[jsonProp].replace(rjsonp,"$1"+callbackName):s.jsonp!==!1&&(s.url+=(ajax_rquery.test(s.url)?"&":"?")+s.jsonp+"="+callbackName),s.converters["script json"]=function(){return responseContainer||jQuery.error(callbackName+" was not called"),responseContainer[0]},s.dataTypes[0]="json",overwritten=window[callbackName],window[callbackName]=function(){responseContainer=arguments},jqXHR.always(function(){window[callbackName]=overwritten,s[callbackName]&&(s.jsonpCallback=originalSettings.jsonpCallback,oldCallbacks.push(callbackName)),responseContainer&&jQuery.isFunction(overwritten)&&overwritten(responseContainer[0]),responseContainer=overwritten=undefined}),"script"});var xhrCallbacks,xhrSupported,xhrId=0,xhrOnUnloadAbort=window.ActiveXObject&&function(){var key;for(key in xhrCallbacks)xhrCallbacks[key](undefined,!0)};jQuery.ajaxSettings.xhr=window.ActiveXObject?function(){return!this.isLocal&&createStandardXHR()||createActiveXHR()}:createStandardXHR,xhrSupported=jQuery.ajaxSettings.xhr(),jQuery.support.cors=!!xhrSupported&&"withCredentials"in xhrSupported,xhrSupported=jQuery.support.ajax=!!xhrSupported,xhrSupported&&jQuery.ajaxTransport(function(s){if(!s.crossDomain||jQuery.support.cors){var callback;return{send:function(headers,complete){var handle,i,xhr=s.xhr();if(s.username?xhr.open(s.type,s.url,s.async,s.username,s.password):xhr.open(s.type,s.url,s.async),s.xhrFields)for(i in s.xhrFields)xhr[i]=s.xhrFields[i];s.mimeType&&xhr.overrideMimeType&&xhr.overrideMimeType(s.mimeType),s.crossDomain||headers["X-Requested-With"]||(headers["X-Requested-With"]="XMLHttpRequest");try{for(i in headers)xhr.setRequestHeader(i,headers[i])}catch(err){}xhr.send(s.hasContent&&s.data||null),callback=function(_,isAbort){var status,responseHeaders,statusText,responses;try{if(callback&&(isAbort||4===xhr.readyState))if(callback=undefined,handle&&(xhr.onreadystatechange=jQuery.noop,xhrOnUnloadAbort&&delete xhrCallbacks[handle]),isAbort)4!==xhr.readyState&&xhr.abort();else{responses={},status=xhr.status,responseHeaders=xhr.getAllResponseHeaders(),"string"==typeof xhr.responseText&&(responses.text=xhr.responseText);try{statusText=xhr.statusText}catch(e){statusText=""}status||!s.isLocal||s.crossDomain?1223===status&&(status=204):status=responses.text?200:404}}catch(firefoxAccessException){isAbort||complete(-1,firefoxAccessException)}responses&&complete(status,statusText,responses,responseHeaders)},s.async?4===xhr.readyState?setTimeout(callback):(handle=++xhrId,xhrOnUnloadAbort&&(xhrCallbacks||(xhrCallbacks={},jQuery(window).unload(xhrOnUnloadAbort)),xhrCallbacks[handle]=callback),xhr.onreadystatechange=callback):callback()},abort:function(){callback&&callback(undefined,!0)}}}});var fxNow,timerId,rfxtypes=/^(?:toggle|show|hide)$/,rfxnum=new RegExp("^(?:([+-])=|)("+core_pnum+")([a-z%]*)$","i"),rrun=/queueHooks$/,animationPrefilters=[defaultPrefilter],tweeners={"*":[function(prop,value){var end,unit,tween=this.createTween(prop,value),parts=rfxnum.exec(value),target=tween.cur(),start=+target||0,scale=1,maxIterations=20;if(parts){if(end=+parts[2],unit=parts[3]||(jQuery.cssNumber[prop]?"":"px"),"px"!==unit&&start){start=jQuery.css(tween.elem,prop,!0)||end||1;do scale=scale||".5",start/=scale,jQuery.style(tween.elem,prop,start+unit);while(scale!==(scale=tween.cur()/target)&&1!==scale&&--maxIterations)}tween.unit=unit,tween.start=start,tween.end=parts[1]?start+(parts[1]+1)*end:end}return tween}]};jQuery.Animation=jQuery.extend(Animation,{tweener:function(props,callback){jQuery.isFunction(props)?(callback=props,props=["*"]):props=props.split(" ");for(var prop,index=0,length=props.length;index-1,props={},curPosition={},curTop,curLeft;calculatePosition?(curPosition=curElem.position(),curTop=curPosition.top,curLeft=curPosition.left):(curTop=parseFloat(curCSSTop)||0,curLeft=parseFloat(curCSSLeft)||0),jQuery.isFunction(options)&&(options=options.call(elem,i,curOffset)),null!=options.top&&(props.top=options.top-curOffset.top+curTop),null!=options.left&&(props.left=options.left-curOffset.left+curLeft),"using"in options?options.using.call(elem,props):curElem.css(props)}},jQuery.fn.extend({position:function(){if(this[0]){var offsetParent,offset,parentOffset={top:0,left:0},elem=this[0];return"fixed"===jQuery.css(elem,"position")?offset=elem.getBoundingClientRect():(offsetParent=this.offsetParent(),offset=this.offset(),jQuery.nodeName(offsetParent[0],"html")||(parentOffset=offsetParent.offset()),parentOffset.top+=jQuery.css(offsetParent[0],"borderTopWidth",!0),parentOffset.left+=jQuery.css(offsetParent[0],"borderLeftWidth",!0)),{top:offset.top-parentOffset.top-jQuery.css(elem,"marginTop",!0),left:offset.left-parentOffset.left-jQuery.css(elem,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){for(var offsetParent=this.offsetParent||document.documentElement;offsetParent&&!jQuery.nodeName(offsetParent,"html")&&"static"===jQuery.css(offsetParent,"position");)offsetParent=offsetParent.offsetParent;return offsetParent||document.documentElement})}}),jQuery.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(method,prop){var top=/Y/.test(prop);jQuery.fn[method]=function(val){return jQuery.access(this,function(elem,method,val){var win=getWindow(elem);return val===undefined?win?prop in win?win[prop]:win.document.documentElement[method]:elem[method]:void(win?win.scrollTo(top?jQuery(win).scrollLeft():val,top?val:jQuery(win).scrollTop()):elem[method]=val)},method,val,arguments.length,null)}}),jQuery.each({Height:"height",Width:"width"},function(name,type){jQuery.each({padding:"inner"+name,content:type,"":"outer"+name},function(defaultExtra,funcName){jQuery.fn[funcName]=function(margin,value){var chainable=arguments.length&&(defaultExtra||"boolean"!=typeof margin),extra=defaultExtra||(margin===!0||value===!0?"margin":"border");return jQuery.access(this,function(elem,type,value){var doc;return jQuery.isWindow(elem)?elem.document.documentElement["client"+name]:9===elem.nodeType?(doc=elem.documentElement,Math.max(elem.body["scroll"+name],doc["scroll"+name],elem.body["offset"+name],doc["offset"+name],doc["client"+name])):value===undefined?jQuery.css(elem,type,extra):jQuery.style(elem,type,value,extra)},type,chainable?margin:undefined,chainable,null)}})}),BI.jQuery=BI.$=jQuery,window.$=window.$||jQuery,window.jQuery=window.jQuery||jQuery,"function"==typeof define&&define.amd&&define.amd.jQuery&&define("jquery",[],function(){return jQuery})}(window),BI.$.extend(BI.$.Event.prototype,{stopEvent:function(){this.stopPropagation(),this.preventDefault()}}),BI.jQuery&&(!function($){$.fn.insets||($.fn.insets=function(){var p=this.padding(),b=this.border();return{top:p.top,bottom:p.bottom+b.bottom+b.top,left:p.left,right:p.right+b.right+b.left}}),$.fn.bounds||($.fn.bounds=function(value){var tmp={hasIgnoredBounds:!0};return value?(isNaN(value.x)||(tmp.left=value.x),isNaN(value.y)||(tmp.top=value.y),null!=value.width&&(tmp.width=value.width-(this.outerWidth(!0)-this.width()),tmp.width=tmp.width>=0?tmp.width:value.width),null!=value.height&&(tmp.height=value.height-(this.outerHeight(!0)-this.height()),tmp.height=tmp.height>=0?tmp.height:value.height),this.css(tmp),this):(tmp=this.position(),{x:tmp.left,y:tmp.top,width:this.outerWidth(),height:this.outerHeight()})})}(BI.jQuery),BI.extend(BI.jQuery.fn,{destroy:function(){this.remove(),BI.isIE()===!0&&(this[0].outerHTML="")},__textKeywordMarked__:function(text,keyword,py){if(!BI.isKey(keyword)||(text+"").length>100)return this.html(BI.htmlEncode(text));keyword+="",keyword=BI.toUpperCase(keyword);var textLeft=(text||"")+"";for(py=(py||BI.makeFirstPY(text))+"",null!=py&&(py=BI.toUpperCase(py)),this.empty();py.length>0&&textLeft.length>0;){var tidx=BI.toUpperCase(textLeft).indexOf(keyword),pidx=null;if(null!=py&&(pidx=py.indexOf(keyword),pidx>=0&&(pidx%=text.length)),tidx>=0)this.append(BI.htmlEncode(textLeft.substr(0,tidx))),this.append(BI.$("").addClass("bi-keyword-red-mark").html(BI.htmlEncode(textLeft.substr(tidx,keyword.length)))),textLeft=textLeft.substr(tidx+keyword.length),null!=py&&(py=py.substr(tidx+keyword.length));else{if(!(null!=pidx&&pidx>=0&&Math.floor(pidx/text.length)===Math.floor((pidx+keyword.length-1)/text.length))){this.append(BI.htmlEncode(textLeft));break}this.append(BI.htmlEncode(textLeft.substr(0,pidx))),this.append(BI.$("").addClass("bi-keyword-red-mark").html(BI.htmlEncode(textLeft.substr(pidx,keyword.length)))),null!=py&&(py=py.substr(pidx+keyword.length)),textLeft=textLeft.substr(pidx+keyword.length)}}return this},getDomHeight:function(parent){var clone=BI.$(this).clone();clone.appendTo(BI.$(parent||"body"));var height=clone.height();return clone.remove(),height},hasVerticalScroll:function(){return this.height()>0&&this[0].clientWidth0&&this[0].clientHeightoffset2Body.left+width||e.pageYoffset2Body.top+height)},__hasZIndexMask__:function(zindex){return zindex&&null!=this.zIndexMask[zindex]},__buildZIndexMask__:function(zindex,domArray){this.zIndexMask=this.zIndexMask||{},this.indexMask=this.indexMask||[];var mask=BI.createWidget({type:"bi.center_adapt",cls:"bi-z-index-mask",items:domArray});return mask.element.css({"z-index":zindex}),BI.createWidget({type:"bi.absolute",element:this,items:[{el:mask,left:0,right:0,top:0,bottom:0}]}),this.indexMask.push(mask),zindex&&(this.zIndexMask[zindex]=mask),mask.element},__releaseZIndexMask__:function(zindex){if(zindex&&this.zIndexMask[zindex])return BI.remove(this.indexMask,this.zIndexMask[zindex]),void this.zIndexMask[zindex].destroy();this.indexMask=this.indexMask||[];var indexMask=this.indexMask.pop();indexMask&&indexMask.destroy()}})),_.extend(BI,{$import:function(){function loadReady(src,must){var $scripts=BI.$("head script, body script");BI.$.each($scripts,function(i,item){item.src.indexOf(src)!=-1&&(_LOADED[src]=!0)});var $links=BI.$("head link");BI.$.each($links,function(i,item){item.href.indexOf(src)!=-1&&must&&(_LOADED[src]=!1,BI.$(item).remove())})}var _LOADED={};return function(src,ext,must){if(loadReady(src,must),_LOADED[src]!==!0)if("css"===ext){var link=document.createElement("link");link.rel="stylesheet",link.type="text/css",link.href=src;var head=document.getElementsByTagName("head")[0];head.appendChild(link),_LOADED[src]=!0}else BI.$.ajax({url:src,dataType:"script",async:!1,cache:!0,complete:function(res,status){"success"==status&&(_LOADED[src]=!0)}})}}()}),Number.prototype.toFixed&&"0.000"===8e-5.toFixed(3)&&"0"!==.9.toFixed(0)&&"1.25"===1.255.toFixed(2)&&"1000000000000000128"===(0xde0b6b3a7640080).toFixed(0)||!function(){function multiply(n,c){for(var i=-1;++i=0;)c+=data[i],data[i]=Math.floor(c/n),c=c%n*base}function toString(){for(var i=size,s="";--i>=0;)if(""!==s||0===i||0!==data[i]){var t=String(data[i]);""===s?s=t:s+="0000000".slice(0,7-t.length)+t}return s}function pow(x,n,acc){return 0===n?acc:n%2===1?pow(x,n-1,acc*x):pow(x*x,n/2,acc)}function log(x){for(var n=0;x>=4096;)n+=12,x/=4096;for(;x>=2;)n+=1,x/=2;return n}var base,size,data,i;base=1e7,size=6,data=[0,0,0,0,0,0],Number.prototype.toFixed=function(fractionDigits){var f,x,s,m,e,z,j,k;if(f=Number(fractionDigits),f=f!==f?0:Math.floor(f),f<0||f>20)throw new RangeError("Number.toFixed called with invalid number of decimals");if(x=Number(this),x!==x)return"NaN";if(x<=-1e21||x>1e21)return String(x);if(s="",x<0&&(s="-",x=-x),m="0",x>1e-21)if(e=log(x*pow(2,69,1))-69,z=e<0?x*pow(2,-e,1):x/pow(2,e,1),z*=4503599627370496,e=52-e,e>0){for(multiply(0,z),j=f;j>=7;)multiply(1e7,0),j-=7;for(multiply(pow(10,j,1),0),j=e-1;j>=23;)divide(1<<23),j-=23;divide(1<0?(k=m.length,m=k<=f?s+"0.0000000000000000000".slice(0,f-k+2)+m:s+m.slice(0,k-f)+"."+m.slice(k-f)):m=s+m,m}}(),_.extend(BI,{MAX:0x1000000000000000,MIN:-0x1000000000000000,EVENT_RESPONSE_TIME:200,zIndex_layer:1e5,zIndex_popover:1e6,zIndex_popup:1e7,zIndex_masker:1e8,zIndex_tip:1e9,emptyStr:"",emptyFn:function(){},empty:null,Key:{48:"0",49:"1",50:"2",51:"3",52:"4",53:"5",54:"6",55:"7",56:"8",57:"9",65:"a",66:"b",67:"c",68:"d",69:"e",70:"f",71:"g",72:"h",73:"i",74:"j",75:"k",76:"l",77:"m",78:"n",79:"o",80:"p",81:"q",82:"r",83:"s",84:"t",85:"u",86:"v",87:"w",88:"x",89:"y",90:"z",96:"0",97:"1",98:"2",99:"3",100:"4",101:"5",102:"6",103:"7",104:"8",105:"9",106:"*",107:"+",109:"-",110:".",111:"/"},KeyCode:{BACKSPACE:8,COMMA:188,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,LEFT:37,NUMPAD_ADD:107,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106,NUMPAD_SUBTRACT:109,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SPACE:32,TAB:9,UP:38},Status:{SUCCESS:1,WRONG:2,START:3,END:4,WAITING:5,READY:6,RUNNING:7,OUTOFBOUNDS:8,NULL:-1},Direction:{Top:"top",Bottom:"bottom",Left:"left",Right:"right",Custom:"custom"},Axis:{Vertical:"vertical",Horizontal:"horizontal"},Selection:{Default:-2,None:-1,Single:0,Multi:1,All:2},HorizontalAlign:{Left:"left",Right:"right",Center:"center",Stretch:"stretch"},VerticalAlign:{Middle:"middle",Top:"top",Bottom:"bottom",Stretch:"stretch"},StartOfWeek:1}),BI.version="2.0",BI.AbsoluteCenterLayout=BI.inherit(BI.Layout,{props:function(){return BI.extend(BI.AbsoluteCenterLayout.superclass.props.apply(this,arguments),{baseCls:"bi-absolute-center-layout",hgap:0,lgap:0,rgap:0,vgap:0,tgap:0,bgap:0})},render:function(){BI.AbsoluteCenterLayout.superclass.render.apply(this,arguments),this.populate(this.options.items)},_addElement:function(i,item){var o=this.options,w=BI.AbsoluteCenterLayout.superclass._addElement.apply(this,arguments);return w.element.css({position:"absolute",left:o.hgap+o.lgap+(item.lgap||0)+(item.hgap||0),right:o.hgap+o.rgap+(item.rgap||0)+(item.hgap||0),top:o.vgap+o.tgap+(item.tgap||0)+(item.vgap||0),bottom:o.vgap+o.bgap+(item.bgap||0)+(item.vgap||0),margin:"auto"}),w},resize:function(){},populate:function(items){BI.AbsoluteCenterLayout.superclass.populate.apply(this,arguments),this._mount()}}),BI.shortcut("bi.absolute_center_adapt",BI.AbsoluteCenterLayout),BI.AbsoluteHorizontalLayout=BI.inherit(BI.Layout,{props:function(){return BI.extend(BI.AbsoluteHorizontalLayout.superclass.props.apply(this,arguments),{baseCls:"bi-absolute-horizontal-layout",hgap:0,lgap:0,rgap:0,vgap:0,tgap:0,bgap:0})},render:function(){BI.AbsoluteHorizontalLayout.superclass.render.apply(this,arguments),this.populate(this.options.items)},_addElement:function(i,item){var o=this.options,w=BI.AbsoluteHorizontalLayout.superclass._addElement.apply(this,arguments);return w.element.css({position:"absolute",left:o.hgap+o.lgap+(item.lgap||0)+(item.hgap||0),right:o.hgap+o.rgap+(item.rgap||0)+(item.hgap||0),margin:"auto"}),o.vgap+o.tgap+(item.vgap||0)+(item.tgap||0)!==0&&w.element.css("top",o.vgap+o.tgap+(item.tgap||0)+(item.vgap||0)),o.vgap+o.bgap+(item.vgap||0)+(item.bgap||0)!==0&&w.element.css("bottom",o.vgap+o.bgap+(item.bgap||0)+(item.vgap||0)),w},resize:function(){},populate:function(items){BI.AbsoluteHorizontalLayout.superclass.populate.apply(this,arguments),this._mount()}}),BI.shortcut("bi.absolute_horizontal_adapt",BI.AbsoluteHorizontalLayout),BI.AbsoluteVerticalLayout=BI.inherit(BI.Layout,{props:function(){return BI.extend(BI.AbsoluteVerticalLayout.superclass.props.apply(this,arguments),{baseCls:"bi-absolute-vertical-layout",hgap:0,lgap:0,rgap:0,vgap:0,tgap:0,bgap:0})},render:function(){BI.AbsoluteVerticalLayout.superclass.render.apply(this,arguments),this.populate(this.options.items)},_addElement:function(i,item){var o=this.options,w=BI.AbsoluteVerticalLayout.superclass._addElement.apply(this,arguments);return w.element.css({position:"absolute",left:item.lgap,right:item.rgap,top:o.vgap+o.tgap+(item.tgap||0)+(item.vgap||0),bottom:o.vgap+o.bgap+(item.bgap||0)+(item.vgap||0),margin:"auto"}),o.hgap+o.lgap+(item.hgap||0)+(item.lgap||0)!==0&&w.element.css("left",o.hgap+o.lgap+(item.lgap||0)+(item.hgap||0)),o.hgap+o.rgap+(item.hgap||0)+(item.rgap||0)!==0&&w.element.css("right",o.hgap+o.rgap+(item.rgap||0)+(item.hgap||0)),w},resize:function(){},populate:function(items){BI.AbsoluteVerticalLayout.superclass.populate.apply(this,arguments),this._mount()}}),BI.shortcut("bi.absolute_vertical_adapt",BI.AbsoluteVerticalLayout),BI.CenterAdaptLayout=BI.inherit(BI.Layout,{props:function(){return BI.extend(BI.CenterAdaptLayout.superclass.props.apply(this,arguments),{baseCls:"bi-center-adapt-layout",horizontalAlign:BI.HorizontalAlign.Center,columnSize:[],scrollx:!1,hgap:0,vgap:0,lgap:0,rgap:0,tgap:0,bgap:0})},render:function(){var o=this.options,self=this;return BI.CenterAdaptLayout.superclass.render.apply(this,arguments),{type:"bi.horizontal",verticalAlign:BI.VerticalAlign.Middle,horizontalAlign:o.horizontalAlign,columnSize:o.columnSize,scrollx:o.scrollx,items:o.items,ref:function(_ref){self.layout=_ref},hgap:o.hgap,vgap:o.vgap,lgap:o.lgap,rgap:o.rgap,tgap:o.tgap,bgap:o.bgap}},resize:function(){},populate:function(items){this.layout.populate.apply(this,arguments)}}),BI.shortcut("bi.center_adapt",BI.CenterAdaptLayout),BI.HorizontalAdaptLayout=BI.inherit(BI.Layout,{props:function(){return BI.extend(BI.HorizontalAdaptLayout.superclass.props.apply(this,arguments),{baseCls:"bi-horizontal-adapt-layout",verticalAlign:BI.VerticalAlign.Top,horizontalAlign:BI.HorizontalAlign.Center,columnSize:[],scrollx:!1,hgap:0,vgap:0,lgap:0,rgap:0,tgap:0,bgap:0})},render:function(){var self=this,o=this.options;return BI.HorizontalAdaptLayout.superclass.render.apply(this,arguments),{type:"bi.horizontal",verticalAlign:BI.VerticalAlign.Top,horizontalAlign:o.horizontalAlign,columnSize:o.columnSize,items:o.items,scrollx:o.scrollx,ref:function(_ref){self.layout=_ref},hgap:o.hgap,vgap:o.vgap,lgap:o.lgap,rgap:o.rgap,tgap:o.tgap,bgap:o.bgap}},resize:function(){},populate:function(items){this.layout.populate.apply(this,arguments)}}),BI.shortcut("bi.horizontal_adapt",BI.HorizontalAdaptLayout),BI.LeftRightVerticalAdaptLayout=BI.inherit(BI.Layout,{props:function(){return BI.extend(BI.LeftRightVerticalAdaptLayout.superclass.props.apply(this,arguments),{baseCls:"bi-left-right-vertical-adapt-layout",items:{},llgap:0,lrgap:0,lhgap:0,rlgap:0,rrgap:0,rhgap:0})},render:function(){var o=this.options,self=this;BI.LeftRightVerticalAdaptLayout.superclass.render.apply(this,arguments);var layoutArray=[];return"left"in o.items&&layoutArray.push({type:"bi.left",items:[{el:{type:"bi.vertical_adapt",height:"100%",items:o.items.left,hgap:o.lhgap,lgap:o.llgap,rgap:o.lrgap}}]}),"right"in o.items&&layoutArray.push({type:"bi.right",items:[{el:{type:"bi.vertical_adapt",height:"100%",items:o.items.right,textAlign:"right",hgap:o.rhgap,lgap:o.rlgap,rgap:o.rrgap}}]}),layoutArray},resize:function(){},addItem:function(){throw new Error("cannot be added")},populate:function(items){BI.LeftRightVerticalAdaptLayout.superclass.populate.apply(this,arguments),this._mount()}}),BI.shortcut("bi.left_right_vertical_adapt",BI.LeftRightVerticalAdaptLayout),BI.LeftVerticalAdaptLayout=BI.inherit(BI.Layout,{props:function(){return BI.extend(BI.LeftRightVerticalAdaptLayout.superclass.props.apply(this,arguments),{baseCls:"bi-left-vertical-adapt-layout",items:[],lgap:0,rgap:0,hgap:0})},render:function(){var o=this.options,self=this;return BI.LeftVerticalAdaptLayout.superclass.render.apply(this,arguments),{type:"bi.left",ref:function(_ref){self.layout=_ref},items:[{el:{type:"bi.vertical_adapt",height:"100%",items:o.items,lgap:o.lgap,hgap:o.hgap,rgap:o.rgap}}]}},resize:function(){},addItem:function(){throw new Error("cannot be added")},populate:function(items){this.layout.populate.apply(this,arguments)}}),BI.shortcut("bi.left_vertical_adapt",BI.LeftVerticalAdaptLayout),BI.RightVerticalAdaptLayout=BI.inherit(BI.Layout,{props:function(){return BI.extend(BI.RightVerticalAdaptLayout.superclass.props.apply(this,arguments),{baseCls:"bi-right-vertical-adapt-layout",items:[],lgap:0,rgap:0,hgap:0})},render:function(){var o=this.options,self=this;return BI.RightVerticalAdaptLayout.superclass.render.apply(this,arguments),{type:"bi.right",ref:function(_ref){self.layout=_ref},items:[{el:{type:"bi.vertical_adapt",height:"100%",textAlign:"right",items:o.items,lgap:o.lgap,hgap:o.hgap,rgap:o.rgap}}]}},resize:function(){},addItem:function(){throw new Error("cannot be added")},populate:function(items){this.layout.populate.apply(this,arguments)}}),BI.shortcut("bi.right_vertical_adapt",BI.RightVerticalAdaptLayout),BI.TableAdaptLayout=BI.inherit(BI.Layout,{props:function(){return BI.extend(BI.TableAdaptLayout.superclass.props.apply(this,arguments),{baseCls:"bi-table-center-adapt-layout",columnSize:[],verticalAlign:BI.VerticalAlign.Top,horizontalAlign:BI.HorizontalAlign.Left,scrollx:!0,hgap:0,vgap:0,lgap:0,rgap:0,tgap:0,bgap:0})},render:function(){var o=this.options;BI.TableAdaptLayout.superclass.render.apply(this,arguments),this.$table=BI.Widget._renderEngine.createElement("
    ").css({position:"relative",display:"table",height:o.verticalAlign===BI.VerticalAlign.Middle?"100%":"auto",width:o.horizontalAlign===BI.HorizontalAlign.Center?"100%":"auto","white-space":"nowrap"}),this.populate(this.options.items)},_addElement:function(i,item){var o=this.options,td,width=o.columnSize[i]<=1?100*o.columnSize[i]+"%":o.columnSize[i];if(this.hasWidget(this._getChildName(i)))td=this.getWidgetByName(this._getChildName(i)),td.element.width(width);else{var w=BI.createWidget(item);w.element.css({position:"relative",top:"0",left:"0",margin:"0px auto"}),td=BI.createWidget({type:"bi.default",width:width,items:[w]}),this.addWidget(this._getChildName(i),td)}return td.element.css({"max-width":o.columnSize[i]<=1?width:width+"px"}),0===i&&td.element.addClass("first-element"),td.element.css({position:"relative",display:"table-cell","vertical-align":o.verticalAlign,margin:"0",padding:"0",height:"100%"}),o.vgap+o.tgap+(item.tgap||0)+(item.vgap||0)!==0&&w.element.css({"margin-top":o.vgap+o.tgap+(item.tgap||0)+(item.vgap||0)+"px"}),o.hgap+o.lgap+(item.lgap||0)+(item.hgap||0)!==0&&w.element.css({"margin-left":(0===i?o.hgap:0)+o.lgap+(item.lgap||0)+(item.hgap||0)+"px"}),o.hgap+o.rgap+(item.rgap||0)+(item.hgap||0)!==0&&w.element.css({"margin-right":o.hgap+o.rgap+(item.rgap||0)+(item.hgap||0)+"px"}),o.vgap+o.bgap+(item.bgap||0)+(item.vgap||0)!==0&&w.element.css({"margin-bottom":o.vgap+o.bgap+(item.bgap||0)+(item.vgap||0)+"px"}),td},appendFragment:function(frag){this.$table.append(frag),this.element.append(this.$table)},resize:function(){},populate:function(items){BI.TableAdaptLayout.superclass.populate.apply(this,arguments),this._mount()}}),BI.shortcut("bi.table_adapt",BI.TableAdaptLayout),BI.VerticalAdaptLayout=BI.inherit(BI.Layout,{props:{baseCls:"bi-vertical-adapt-layout",horizontalAlign:BI.HorizontalAlign.Left,columnSize:[],scrollx:!1,hgap:0,vgap:0,lgap:0,rgap:0,tgap:0,bgap:0},render:function(){var self=this,o=this.options;return BI.VerticalAdaptLayout.superclass.render.apply(this,arguments),{type:"bi.horizontal",verticalAlign:BI.VerticalAlign.Middle,horizontalAlign:o.horizontalAlign,columnSize:o.columnSize,items:o.items,scrollx:o.scrollx,ref:function(_ref){self.layout=_ref},hgap:o.hgap,vgap:o.vgap,lgap:o.lgap,rgap:o.rgap,tgap:o.tgap,bgap:o.bgap}},resize:function(){},populate:function(items){this.layout.populate.apply(this,arguments)}}),BI.shortcut("bi.vertical_adapt",BI.VerticalAdaptLayout),BI.HorizontalAutoLayout=BI.inherit(BI.Layout,{props:function(){return BI.extend(BI.HorizontalAutoLayout.superclass.props.apply(this,arguments),{baseCls:"bi-horizon-auto-layout",hgap:0,lgap:0,rgap:0,vgap:0,tgap:0,bgap:0})},render:function(){BI.HorizontalAutoLayout.superclass.render.apply(this,arguments),this.populate(this.options.items)},_addElement:function(i,item){var o=this.options,w=BI.HorizontalAutoLayout.superclass._addElement.apply(this,arguments);return w.element.css({position:"relative",margin:"0px auto"}),o.vgap+o.tgap+(item.tgap||0)+(item.vgap||0)!==0&&w.element.css({"margin-top":(0===i?o.vgap:0)+o.tgap+(item.tgap||0)+(item.vgap||0)+"px"}),o.hgap+o.lgap+(item.lgap||0)+(item.hgap||0)!==0&&w.element.css({"margin-left":o.hgap+o.lgap+(item.lgap||0)+(item.hgap||0)+"px"}),o.hgap+o.rgap+(item.rgap||0)+(item.hgap||0)!==0&&w.element.css({"margin-right":o.hgap+o.rgap+(item.rgap||0)+(item.hgap||0)+"px"}),o.vgap+o.bgap+(item.bgap||0)+(item.vgap||0)!==0&&w.element.css({"margin-bottom":o.vgap+o.bgap+(item.bgap||0)+(item.vgap||0)+"px"}),w},resize:function(){},populate:function(items){BI.HorizontalAutoLayout.superclass.populate.apply(this,arguments),this._mount()}}),BI.shortcut("bi.horizontal_auto",BI.HorizontalAutoLayout),BI.FloatHorizontalLayout=BI.inherit(BI.Layout,{props:function(){return BI.extend(BI.FloatHorizontalLayout.superclass.props.apply(this,arguments),{baseCls:"bi-float-horizontal-adapt-layout",items:[],hgap:0,vgap:0,tgap:0,bgap:0,lgap:0,rgap:0})},render:function(){BI.FloatHorizontalLayout.superclass.render.apply(this,arguments),this.populate(this.options.items)},resize:function(){},mounted:function(){var self=this,width=this.left.element.width(),height=this.left.element.height();this.left.element.width(width).height(height).css("float","none"),BI.remove(this._children,function(i,wi){wi===self.container&&delete self._children[i]}),BI.createWidget({type:"bi.horizontal_auto",element:this,items:[this.left]})},_addElement:function(i,item){var self=this,o=this.options;return this.left=BI.createWidget({type:"bi.vertical",items:[item],hgap:o.hgap,vgap:o.vgap,tgap:o.tgap,bgap:o.bgap,lgap:o.lgap,rgap:o.rgap}),this.container=BI.createWidget({type:"bi.left",element:this,items:[this.left]}),this.left},populate:function(items){BI.HorizontalAutoLayout.superclass.populate.apply(this,arguments),this._mount()}}),BI.shortcut("bi.horizontal_float",BI.FloatHorizontalLayout),BI.InlineCenterAdaptLayout=BI.inherit(BI.Layout,{props:function(){return BI.extend(BI.InlineLayout.superclass.props.apply(this,arguments),{baseCls:"bi-inline-center-adapt-layout",hgap:0,vgap:0,lgap:0,rgap:0,tgap:0,bgap:0})},render:function(){BI.InlineCenterAdaptLayout.superclass.render.apply(this,arguments),this.element.css({whiteSpace:"nowrap",textAlign:"center"}),this.populate(this.options.items)},_addElement:function(i,item,length){var o=this.options,w=BI.InlineVerticalAdaptLayout.superclass._addElement.apply(this,arguments);return w.element.css({position:"relative","vertical-align":"middle"}),w.element.addClass("inline-center-adapt-item"),o.vgap+o.tgap+(item.tgap||0)+(item.vgap||0)!==0&&w.element.css({"margin-top":o.vgap+o.tgap+(item.tgap||0)+(item.vgap||0)+"px"}),o.hgap+o.lgap+(item.lgap||0)+(item.hgap||0)!==0&&w.element.css({"margin-left":(0===i?o.hgap:0)+o.lgap+(item.lgap||0)+(item.hgap||0)+"px"}),o.hgap+o.rgap+(item.rgap||0)+(item.hgap||0)!==0&&w.element.css({"margin-right":o.hgap+o.rgap+(item.rgap||0)+(item.hgap||0)+"px"}),o.vgap+o.bgap+(item.bgap||0)+(item.vgap||0)!==0&&w.element.css({"margin-bottom":o.vgap+o.bgap+(item.bgap||0)+(item.vgap||0)+"px"}),w},resize:function(){this.stroke(this.options.items)},addItem:function(item){throw new Error("不能添加元素")},stroke:function(items){var self=this;BI.each(items,function(i,item){item&&self._addElement(i,item,items.length)})},populate:function(items){BI.InlineCenterAdaptLayout.superclass.populate.apply(this,arguments),this._mount()}}),BI.shortcut("bi.inline_center_adapt",BI.InlineCenterAdaptLayout),BI.InlineVerticalAdaptLayout=BI.inherit(BI.Layout,{props:function(){return BI.extend(BI.InlineLayout.superclass.props.apply(this,arguments),{baseCls:"bi-inline-vertical-adapt-layout",hgap:0,vgap:0,lgap:0,rgap:0,tgap:0,bgap:0,textAlign:"left"})},render:function(){BI.InlineVerticalAdaptLayout.superclass.render.apply(this,arguments);var o=this.options;this.element.css({whiteSpace:"nowrap",textAlign:o.textAlign}),this.populate(this.options.items)},_addElement:function(i,item){var o=this.options,w=BI.InlineVerticalAdaptLayout.superclass._addElement.apply(this,arguments);return w.element.css({position:"relative","vertical-align":"middle"}),w.element.addClass("inline-vertical-adapt-item"),o.vgap+o.tgap+(item.tgap||0)+(item.vgap||0)!==0&&w.element.css({"margin-top":o.vgap+o.tgap+(item.tgap||0)+(item.vgap||0)+"px"}),o.hgap+o.lgap+(item.lgap||0)+(item.hgap||0)!==0&&w.element.css({"margin-left":(0===i?o.hgap:0)+o.lgap+(item.lgap||0)+(item.hgap||0)+"px"}),o.hgap+o.rgap+(item.rgap||0)+(item.hgap||0)!==0&&w.element.css({"margin-right":o.hgap+o.rgap+(item.rgap||0)+(item.hgap||0)+"px"}),o.vgap+o.bgap+(item.bgap||0)+(item.vgap||0)!==0&&w.element.css({"margin-bottom":o.vgap+o.bgap+(item.bgap||0)+(item.vgap||0)+"px"}),w},resize:function(){this.stroke(this.options.items)},populate:function(items){BI.InlineVerticalAdaptLayout.superclass.populate.apply(this,arguments),this._mount()}}),BI.shortcut("bi.inline_vertical_adapt",BI.InlineVerticalAdaptLayout),BI.FlexCenterLayout=BI.inherit(BI.Layout,{props:function(){return BI.extend(BI.FlexCenterLayout.superclass.props.apply(this,arguments),{baseCls:"bi-flex-center-adapt-layout",hgap:0,vgap:0})},render:function(){BI.FlexCenterLayout.superclass.render.apply(this,arguments),this.populate(this.options.items)},_addElement:function(i,item){var o=this.options,w=BI.FlexCenterLayout.superclass._addElement.apply(this,arguments);return w.element.css({position:"relative","flex-shrink":"0","margin-left":(0===i?o.hgap:0)+"px","margin-right":o.hgap+"px","margin-top":o.vgap+"px","margin-bottom":o.vgap+"px"}),w},resize:function(){},populate:function(items){BI.FlexCenterLayout.superclass.populate.apply(this,arguments),this._mount()}}),BI.shortcut("bi.flex_center_adapt",BI.FlexCenterLayout),BI.FlexHorizontalCenter=BI.inherit(BI.Layout,{props:function(){return BI.extend(BI.FlexHorizontalCenter.superclass.props.apply(this,arguments),{baseCls:"bi-flex-horizontal-center-adapt-layout",verticalAlign:BI.VerticalAlign.Top,rowSize:[],scrolly:!1,hgap:0,vgap:0,lgap:0,rgap:0,tgap:0,bgap:0})},render:function(){var self=this,o=this.options;return{type:"bi.flex_vertical",ref:function(_ref){self.wrapper=_ref},horizontalAlign:BI.HorizontalAlign.Center,verticalAlign:o.verticalAlign,rowSize:o.rowSize,scrollx:o.scrollx,scrolly:o.scrolly,scrollable:o.scrollable,hgap:o.hgap,vgap:o.vgap,tgap:o.tgap,bgap:o.bgap,items:o.items}},resize:function(){},update:function(opt){return this.wrapper.update(opt)},populate:function(items){this.wrapper.populate(items)}}),BI.shortcut("bi.flex_horizontal_adapt",BI.FlexHorizontalCenter),BI.shortcut("bi.flex_horizontal_center_adapt",BI.FlexHorizontalCenter),BI.FlexHorizontalLayout=BI.inherit(BI.Layout,{props:function(){return BI.extend(BI.FlexHorizontalLayout.superclass.props.apply(this,arguments),{baseCls:"bi-flex-horizontal-layout",verticalAlign:BI.VerticalAlign.Top,horizontalAlign:BI.HorizontalAlign.Left,columnSize:[],scrollx:!0,hgap:0,vgap:0,lgap:0,rgap:0,tgap:0,bgap:0})},render:function(){BI.FlexHorizontalLayout.superclass.render.apply(this,arguments);var o=this.options;this.element.addClass("v-"+o.verticalAlign).addClass("h-"+o.horizontalAlign),this.populate(this.options.items)},_addElement:function(i,item){var o=this.options,w=BI.FlexHorizontalLayout.superclass._addElement.apply(this,arguments);return w.element.css({position:"relative","flex-shrink":"0"}),o.columnSize[i]>0&&w.element.width(o.columnSize[i]),"fill"===o.columnSize[i]&&w.element.css("flex","1"),o.vgap+o.tgap+(item.tgap||0)+(item.vgap||0)!==0&&w.element.css({"margin-top":o.vgap+o.tgap+(item.tgap||0)+(item.vgap||0)+"px"}),o.hgap+o.lgap+(item.lgap||0)+(item.hgap||0)!==0&&w.element.css({"margin-left":(0===i?o.hgap:0)+o.lgap+(item.lgap||0)+(item.hgap||0)+"px"}),o.hgap+o.rgap+(item.rgap||0)+(item.hgap||0)!==0&&w.element.css({ +"margin-right":o.hgap+o.rgap+(item.rgap||0)+(item.hgap||0)+"px"}),o.vgap+o.bgap+(item.bgap||0)+(item.vgap||0)!==0&&w.element.css({"margin-bottom":o.vgap+o.bgap+(item.bgap||0)+(item.vgap||0)+"px"}),w},resize:function(){},populate:function(items){BI.FlexHorizontalLayout.superclass.populate.apply(this,arguments),this._mount()}}),BI.shortcut("bi.flex_horizontal",BI.FlexHorizontalLayout),BI.FlexVerticalCenter=BI.inherit(BI.Layout,{props:function(){return BI.extend(BI.FlexVerticalCenter.superclass.props.apply(this,arguments),{baseCls:"bi-flex-vertical-center-adapt-layout",horizontalAlign:BI.HorizontalAlign.Left,columnSize:[],scrollx:!1,hgap:0,vgap:0,lgap:0,rgap:0,tgap:0,bgap:0})},render:function(){var self=this,o=this.options;return{type:"bi.flex_horizontal",ref:function(_ref){self.wrapper=_ref},verticalAlign:BI.VerticalAlign.Middle,horizontalAlign:o.horizontalAlign,columnSize:o.columnSize,scrollx:o.scrollx,scrolly:o.scrolly,scrollable:o.scrollable,vgap:o.vgap,lgap:o.lgap,rgap:o.rgap,hgap:o.hgap,items:o.items}},resize:function(){},update:function(opt){return this.wrapper.update(opt)},populate:function(items){this.wrapper.populate(items)}}),BI.shortcut("bi.flex_vertical_adapt",BI.FlexVerticalCenter),BI.shortcut("bi.flex_vertical_center_adapt",BI.FlexVerticalCenter),BI.FlexVerticalLayout=BI.inherit(BI.Layout,{props:function(){return BI.extend(BI.FlexVerticalLayout.superclass.props.apply(this,arguments),{baseCls:"bi-flex-vertical-layout",horizontalAlign:BI.HorizontalAlign.Left,verticalAlign:BI.VerticalAlign.Top,rowSize:[],scrolly:!0,hgap:0,vgap:0,lgap:0,rgap:0,tgap:0,bgap:0})},render:function(){BI.FlexVerticalLayout.superclass.render.apply(this,arguments);var o=this.options;this.element.addClass("h-"+o.horizontalAlign).addClass("v-"+o.verticalAlign),this.populate(this.options.items)},_addElement:function(i,item){var w=BI.FlexVerticalLayout.superclass._addElement.apply(this,arguments),o=this.options;return w.element.css({position:"relative","flex-shrink":"0"}),o.rowSize[i]>0&&w.element.height(o.rowSize[i]),"fill"===o.rowSize[i]&&w.element.css("flex","1"),o.vgap+o.tgap+(item.tgap||0)+(item.vgap||0)!==0&&w.element.css({"margin-top":(0===i?o.vgap:0)+o.tgap+(item.tgap||0)+(item.vgap||0)+"px"}),o.hgap+o.lgap+(item.lgap||0)+(item.hgap||0)!==0&&w.element.css({"margin-left":o.hgap+o.lgap+(item.lgap||0)+(item.hgap||0)+"px"}),o.hgap+o.rgap+(item.rgap||0)+(item.hgap||0)!==0&&w.element.css({"margin-right":o.hgap+o.rgap+(item.rgap||0)+(item.hgap||0)+"px"}),o.vgap+o.bgap+(item.bgap||0)+(item.vgap||0)!==0&&w.element.css({"margin-bottom":o.vgap+o.bgap+(item.bgap||0)+(item.vgap||0)+"px"}),w},resize:function(){},populate:function(items){BI.FlexVerticalLayout.superclass.populate.apply(this,arguments),this._mount()}}),BI.shortcut("bi.flex_vertical",BI.FlexVerticalLayout),BI.FlexWrapperCenterLayout=BI.inherit(BI.Layout,{props:function(){return BI.extend(BI.FlexWrapperCenterLayout.superclass.props.apply(this,arguments),{baseCls:"bi-flex-scrollable-center-adapt-layout clearfix",scrollable:!0})},render:function(){BI.FlexWrapperCenterLayout.superclass.render.apply(this,arguments),this.$wrapper=BI.Widget._renderEngine.createElement("
    ").addClass("flex-scrollable-center-adapt-layout-wrapper"),this.populate(this.options.items)},_addElement:function(i,item){var o=this.options,w=BI.FlexWrapperCenterLayout.superclass._addElement.apply(this,arguments);return w.element.css({position:"relative","margin-left":(0===i?o.hgap:0)+"px","margin-right":o.hgap+"px","margin-top":o.vgap+"px","margin-bottom":o.vgap+"px"}),w},appendFragment:function(frag){this.$wrapper.append(frag),this.element.append(this.$wrapper)},_getWrapper:function(){return this.$wrapper},resize:function(){},populate:function(items){BI.FlexWrapperCenterLayout.superclass.populate.apply(this,arguments),this._mount()}}),BI.shortcut("bi.flex_scrollable_center_adapt",BI.FlexWrapperCenterLayout),BI.FlexWrapperHorizontalCenter=BI.inherit(BI.Layout,{props:function(){return BI.extend(BI.FlexWrapperHorizontalCenter.superclass.props.apply(this,arguments),{baseCls:"bi-flex-scrollable-vertical-center-adapt-layout clearfix",verticalAlign:BI.VerticalAlign.Top,rowSize:[],scrollable:!0,scrolly:!1,hgap:0,vgap:0,lgap:0,rgap:0,tgap:0,bgap:0})},render:function(){var self=this,o=this.options;return{type:"bi.flex_scrollable_vertical",ref:function(_ref){self.wrapper=_ref},horizontalAlign:BI.HorizontalAlign.Center,verticalAlign:o.verticalAlign,rowSize:o.rowSize,scrollx:o.scrollx,scrolly:o.scrolly,scrollable:o.scrollable,hgap:o.hgap,vgap:o.vgap,tgap:o.tgap,bgap:o.bgap,items:o.items}},update:function(opt){return this.wrapper.update(opt)},populate:function(items){this.wrapper.populate(items)}}),BI.shortcut("bi.flex_scrollable_horizontal_adapt",BI.FlexWrapperHorizontalCenter),BI.shortcut("bi.flex_scrollable_horizontal_center_adapt",BI.FlexWrapperHorizontalCenter),BI.FlexWrapperHorizontalLayout=BI.inherit(BI.Layout,{props:function(){return BI.extend(BI.FlexWrapperHorizontalLayout.superclass.props.apply(this,arguments),{baseCls:"bi-flex-scrollable-horizontal-layout clearfix",verticalAlign:BI.VerticalAlign.Top,horizontalAlign:BI.HorizontalAlign.Left,columnSize:[],scrollable:null,scrollx:!0,hgap:0,vgap:0,lgap:0,rgap:0,tgap:0,bgap:0})},render:function(){BI.FlexWrapperHorizontalLayout.superclass.render.apply(this,arguments);var o=this.options;this.$wrapper=BI.Widget._renderEngine.createElement("
    ").addClass("flex-scrollable-horizontal-layout-wrapper v-"+o.verticalAlign).addClass("h-"+o.horizontalAlign),this.populate(this.options.items)},_addElement:function(i,item){var o=this.options,w=BI.FlexWrapperHorizontalLayout.superclass._addElement.apply(this,arguments);return w.element.css({position:"relative","flex-shrink":"0"}),o.columnSize[i]>0&&w.element.width(o.columnSize[i]),"fill"===o.columnSize[i]&&w.element.css("flex","1"),o.vgap+o.tgap+(item.tgap||0)+(item.vgap||0)!==0&&w.element.css({"margin-top":o.vgap+o.tgap+(item.tgap||0)+(item.vgap||0)+"px"}),o.hgap+o.lgap+(item.lgap||0)+(item.hgap||0)!==0&&w.element.css({"margin-left":(0===i?o.hgap:0)+o.lgap+(item.lgap||0)+(item.hgap||0)+"px"}),o.hgap+o.rgap+(item.rgap||0)+(item.hgap||0)!==0&&w.element.css({"margin-right":o.hgap+o.rgap+(item.rgap||0)+(item.hgap||0)+"px"}),o.vgap+o.bgap+(item.bgap||0)+(item.vgap||0)!==0&&w.element.css({"margin-bottom":o.vgap+o.bgap+(item.bgap||0)+(item.vgap||0)+"px"}),w},appendFragment:function(frag){this.$wrapper.append(frag),this.element.append(this.$wrapper)},_getWrapper:function(){return this.$wrapper},resize:function(){},populate:function(items){BI.FlexWrapperHorizontalLayout.superclass.populate.apply(this,arguments),this._mount()}}),BI.shortcut("bi.flex_scrollable_horizontal",BI.FlexWrapperHorizontalLayout),BI.FlexWrapperVerticalCenter=BI.inherit(BI.Layout,{props:function(){return BI.extend(BI.FlexWrapperVerticalCenter.superclass.props.apply(this,arguments),{baseCls:"bi-flex-scrollable-vertical-center-adapt-layout clearfix",horizontalAlign:BI.HorizontalAlign.Left,columnSize:[],scrollx:!1,scrollable:!0,hgap:0,vgap:0,lgap:0,rgap:0,tgap:0,bgap:0})},render:function(){var self=this,o=this.options;return{type:"bi.flex_scrollable_horizontal",ref:function(_ref){self.wrapper=_ref},verticalAlign:BI.VerticalAlign.Middle,horizontalAlign:o.horizontalAlign,columnSize:o.columnSize,scrollx:o.scrollx,scrolly:o.scrolly,scrollable:o.scrollable,hgap:o.hgap,vgap:o.vgap,lgap:o.lgap,rgap:o.rgap,items:o.items}},update:function(opt){return this.wrapper.update(opt)},populate:function(items){this.wrapper.populate(items)}}),BI.shortcut("bi.flex_scrollable_vertical_adapt",BI.FlexWrapperVerticalCenter),BI.shortcut("bi.flex_scrollable_vertical_center_adapt",BI.FlexWrapperVerticalCenter),BI.FlexWrapperVerticalLayout=BI.inherit(BI.Layout,{props:function(){return BI.extend(BI.FlexWrapperVerticalLayout.superclass.props.apply(this,arguments),{baseCls:"bi-flex-scrollable-vertical-layout clearfix",horizontalAlign:BI.HorizontalAlign.Left,verticalAlign:BI.VerticalAlign.Top,rowSize:[],scrollable:null,scrolly:!0,hgap:0,vgap:0,lgap:0,rgap:0,tgap:0,bgap:0})},render:function(){BI.FlexWrapperVerticalLayout.superclass.render.apply(this,arguments);var o=this.options;this.$wrapper=BI.Widget._renderEngine.createElement("
    ").addClass("flex-scrollable-vertical-layout-wrapper h-"+o.horizontalAlign).addClass("v-"+o.verticalAlign),this.populate(this.options.items)},_addElement:function(i,item){var o=this.options,w=BI.FlexWrapperVerticalLayout.superclass._addElement.apply(this,arguments);return w.element.css({position:"relative","flex-shrink":"0"}),o.rowSize[i]>0&&w.element.height(o.rowSize[i]),"fill"===o.rowSize[i]&&w.element.css("flex","1"),o.vgap+o.tgap+(item.tgap||0)+(item.vgap||0)!==0&&w.element.css({"margin-top":(0===i?o.vgap:0)+o.tgap+(item.tgap||0)+(item.vgap||0)+"px"}),o.hgap+o.lgap+(item.lgap||0)+(item.hgap||0)!==0&&w.element.css({"margin-left":o.hgap+o.lgap+(item.lgap||0)+(item.hgap||0)+"px"}),o.hgap+o.rgap+(item.rgap||0)+(item.hgap||0)!==0&&w.element.css({"margin-right":o.hgap+o.rgap+(item.rgap||0)+(item.hgap||0)+"px"}),o.vgap+o.bgap+(item.bgap||0)+(item.vgap||0)!==0&&w.element.css({"margin-bottom":o.vgap+o.bgap+(item.bgap||0)+(item.vgap||0)+"px"}),w},appendFragment:function(frag){this.$wrapper.append(frag),this.element.append(this.$wrapper)},_getWrapper:function(){return this.$wrapper},resize:function(){},populate:function(items){BI.FlexWrapperVerticalLayout.superclass.populate.apply(this,arguments),this._mount()}}),BI.shortcut("bi.flex_scrollable_vertical",BI.FlexWrapperVerticalLayout),BI.AbsoluteLayout=BI.inherit(BI.Layout,{props:function(){return BI.extend(BI.AbsoluteLayout.superclass.props.apply(this,arguments),{baseCls:"bi-absolute-layout",hgap:null,vgap:null,lgap:null,rgap:null,tgap:null,bgap:null})},render:function(){BI.AbsoluteLayout.superclass.render.apply(this,arguments),this.populate(this.options.items)},_addElement:function(i,item){var o=this.options,w=BI.AbsoluteLayout.superclass._addElement.apply(this,arguments),left=0,right=0,top=0,bottom=0;return BI.isNotNull(item.left)&&(w.element.css({left:item.left}),left+=item.left),BI.isNotNull(item.right)&&(w.element.css({right:item.right}),right+=item.right),BI.isNotNull(item.top)&&(w.element.css({top:item.top}),top+=item.top),BI.isNotNull(item.bottom)&&(w.element.css({bottom:item.bottom}),bottom+=item.bottom),BI.isNotNull(o.hgap)&&(left+=o.hgap,w.element.css({left:left}),right+=o.hgap,w.element.css({right:right})),BI.isNotNull(o.vgap)&&(top+=o.vgap,w.element.css({top:top}),bottom+=o.vgap,w.element.css({bottom:bottom})),BI.isNotNull(o.lgap)&&(left+=o.lgap,w.element.css({left:left})),BI.isNotNull(o.rgap)&&(right+=o.rgap,w.element.css({right:right})),BI.isNotNull(o.tgap)&&(top+=o.tgap,w.element.css({top:top})),BI.isNotNull(o.bgap)&&(bottom+=o.bgap,w.element.css({bottom:bottom})),BI.isNotNull(item.width)&&w.element.css({width:item.width}),BI.isNotNull(item.height)&&w.element.css({height:item.height}),w.element.css({position:"absolute"}),w},resize:function(){this.stroke(this.options.items)},stroke:function(items){this.options.items=items||[];var self=this;BI.each(items,function(i,item){if(item){if(!BI.isWidget(item)&&!item.el)throw new Error("el must be exist");self._addElement(i,item)}})},populate:function(items){BI.AbsoluteLayout.superclass.populate.apply(this,arguments),this._mount()}}),BI.shortcut("bi.absolute",BI.AbsoluteLayout),BI.AdaptiveLayout=BI.inherit(BI.Layout,{props:function(){return BI.extend(BI.AdaptiveLayout.superclass.props.apply(this,arguments),{baseCls:"bi-adaptive-layout",hgap:null,vgap:null,lgap:null,rgap:null,tgap:null,bgap:null})},render:function(){BI.AdaptiveLayout.superclass.render.apply(this,arguments),this.populate(this.options.items)},_addElement:function(i,item){var o=this.options,w=BI.AdaptiveLayout.superclass._addElement.apply(this,arguments);w.element.css({position:"relative"});var left=0,right=0,top=0,bottom=0;return BI.isNotNull(item.left)&&w.element.css({left:item.left}),BI.isNotNull(item.right)&&w.element.css({right:item.right}),BI.isNotNull(item.top)&&w.element.css({top:item.top}),BI.isNotNull(item.bottom)&&w.element.css({bottom:item.bottom}),BI.isNotNull(o.hgap)&&(left+=o.hgap,w.element.css({"margin-left":left}),right+=o.hgap,w.element.css({"margin-right":right})),BI.isNotNull(o.vgap)&&(top+=o.vgap,w.element.css({"margin-top":top}),bottom+=o.vgap,w.element.css({"margin-bottom":bottom})),BI.isNotNull(o.lgap)&&(left+=o.lgap,w.element.css({"margin-left":left})),BI.isNotNull(o.rgap)&&(right+=o.rgap,w.element.css({"margin-right":right})),BI.isNotNull(o.tgap)&&(top+=o.tgap,w.element.css({"margin-top":top})),BI.isNotNull(o.bgap)&&(bottom+=o.bgap,w.element.css({"margin-bottom":bottom})),BI.isNotNull(item.width)&&w.element.css({width:item.width}),BI.isNotNull(item.height)&&w.element.css({height:item.height}),w},resize:function(){this.stroke(this.options.items)},populate:function(items){BI.AbsoluteLayout.superclass.populate.apply(this,arguments),this._mount()}}),BI.shortcut("bi.adaptive",BI.AdaptiveLayout),BI.BorderLayout=BI.inherit(BI.Layout,{props:function(){return BI.extend(BI.BorderLayout.superclass.props.apply(this,arguments),{baseCls:"bi-border-layout",items:{}})},render:function(){BI.BorderLayout.superclass.render.apply(this,arguments),this.populate(this.options.items)},resize:function(){this.stroke(this.options.items)},addItem:function(item){throw new Error("cannot be added")},stroke:function(regions){var item,top=0,bottom=0,left=0,right=0;if("north"in regions&&(item=regions.north,null!=item)){if(item.el){if(!this.hasWidget(this.getName()+"north")){var w=BI.createWidget(item);this.addWidget(this.getName()+"north",w)}this.getWidgetByName(this.getName()+"north").element.height(item.height).css({position:"absolute",top:item.top||0,left:item.left||0,right:item.right||0,bottom:"initial"})}top=(item.height||0)+(item.top||0)+(item.bottom||0)}if("south"in regions&&(item=regions.south,null!=item)){if(item.el){if(!this.hasWidget(this.getName()+"south")){var w=BI.createWidget(item);this.addWidget(this.getName()+"south",w)}this.getWidgetByName(this.getName()+"south").element.height(item.height).css({position:"absolute",bottom:item.bottom||0,left:item.left||0,right:item.right||0,top:"initial"})}bottom=(item.height||0)+(item.top||0)+(item.bottom||0)}if("west"in regions&&(item=regions.west,null!=item)){if(item.el){if(!this.hasWidget(this.getName()+"west")){var w=BI.createWidget(item);this.addWidget(this.getName()+"west",w)}this.getWidgetByName(this.getName()+"west").element.width(item.width).css({position:"absolute",left:item.left||0,top:top,bottom:bottom,right:"initial"})}left=(item.width||0)+(item.left||0)+(item.right||0)}if("east"in regions&&(item=regions.east,null!=item)){if(item.el){if(!this.hasWidget(this.getName()+"east")){var w=BI.createWidget(item);this.addWidget(this.getName()+"east",w)}this.getWidgetByName(this.getName()+"east").element.width(item.width).css({position:"absolute",right:item.right||0,top:top,bottom:bottom,left:"initial"})}right=(item.width||0)+(item.left||0)+(item.right||0)}if("center"in regions&&(item=regions.center,null!=item)){if(!this.hasWidget(this.getName()+"center")){var w=BI.createWidget(item);this.addWidget(this.getName()+"center",w)}this.getWidgetByName(this.getName()+"center").element.css({position:"absolute",top:top,bottom:bottom,left:left,right:right})}},update:function(opt){},populate:function(items){BI.BorderLayout.superclass.populate.apply(this,arguments),this._mount()}}),BI.shortcut("bi.border",BI.BorderLayout),BI.CardLayout=BI.inherit(BI.Layout,{props:function(){return BI.extend(BI.CardLayout.superclass.props.apply(this,arguments),{baseCls:"bi-card-layout",items:[]})},render:function(){BI.CardLayout.superclass.render.apply(this,arguments),this.populate(this.options.items)},resize:function(){},stroke:function(items){var self=this,o=this.options;this.showIndex=void 0,BI.each(items,function(i,item){if(item){if(self.hasWidget(item.cardName))var w=self.getWidgetByName(item.cardName);else{var w=BI.createWidget(item);w.on(BI.Events.DESTROY,function(){var index=BI.findIndex(o.items,function(i,tItem){return tItem.cardName==item.cardName});index>-1&&o.items.splice(index,1)}),self.addWidget(item.cardName,w)}w.element.css({position:"absolute",top:"0",right:"0",bottom:"0",left:"0"}),w.setVisible(!1)}})},update:function(){},empty:function(){BI.CardLayout.superclass.empty.apply(this,arguments),this.options.items=[]},populate:function(items){BI.CardLayout.superclass.populate.apply(this,arguments),this._mount(),this.options.defaultShowName&&this.showCardByName(this.options.defaultShowName)},isCardExisted:function(cardName){return BI.some(this.options.items,function(i,item){return item.cardName==cardName&&item.el})},getCardByName:function(cardName){if(!this.isCardExisted(cardName))throw new Error("cardName is not exist");return this._children[cardName]},_deleteCardByName:function(cardName){delete this._children[cardName];var index=BI.findIndex(this.options.items,function(i,item){return item.cardName==cardName});index>-1&&this.options.items.splice(index,1)},deleteCardByName:function(cardName){if(!this.isCardExisted(cardName))throw new Error("cardName is not exist");var child=this._children[cardName];this._deleteCardByName(cardName),child&&child._destroy()},addCardByName:function(cardName,cardItem){if(this.isCardExisted(cardName))throw new Error("cardName is already exist");var widget=BI.createWidget(cardItem,this);return widget.element.css({position:"relative",top:"0",left:"0",width:"100%",height:"100%"}).appendTo(this.element),widget.invisible(),this.addWidget(cardName,widget),this.options.items.push({el:cardItem,cardName:cardName}),widget},showCardByName:function(name,action,callback){var self=this,exist=this.isCardExisted(name);null!=this.showIndex&&(this.lastShowIndex=this.showIndex),this.showIndex=name;var flag=!1;BI.each(this.options.items,function(i,item){var el=self._children[item.cardName];el&&(name!=item.cardName?!flag&&!exist&&BI.Action&&action instanceof BI.Action?(action.actionBack(el),flag=!0):el.invisible():BI.Action&&action instanceof BI.Action?action.actionPerformed(void 0,el,callback):(el.visible(),callback&&callback()))})},showLastCard:function(){var self=this;this.showIndex=this.lastShowIndex,BI.each(this.options.items,function(i,item){self._children[item.cardName].setVisible(self.showIndex==i)})},setDefaultShowName:function(name){return this.options.defaultShowName=name,this},getDefaultShowName:function(){return this.options.defaultShowName},getAllCardNames:function(){return BI.map(this.options.items,function(i,item){return item.cardName})},getShowingCard:function(){if(BI.isKey(this.showIndex))return this.getWidgetByName(this.showIndex)},deleteAllCard:function(){var self=this;BI.each(this.getAllCardNames(),function(i,name){self.deleteCardByName(name)})},hideAllCard:function(){var self=this;BI.each(this.options.items,function(i,item){self._children[item.cardName].invisible()})},isAllCardHide:function(){var self=this,flag=!0;return BI.some(this.options.items,function(i,item){if(self._children[item.cardName].isVisible())return flag=!1,!1}),flag},removeWidget:function(nameOrWidget){var removeName;BI.isWidget(nameOrWidget)?BI.each(this._children,function(name,child){child===nameOrWidget&&(removeName=name)}):removeName=nameOrWidget,removeName&&this._deleteCardByName(removeName)}}),BI.shortcut("bi.card",BI.CardLayout),BI.DefaultLayout=BI.inherit(BI.Layout,{props:function(){return BI.extend(BI.DefaultLayout.superclass.props.apply(this,arguments),{hgap:0,vgap:0,lgap:0,rgap:0,tgap:0,bgap:0,items:[]})},render:function(){BI.DefaultLayout.superclass.render.apply(this,arguments),this.populate(this.options.items)},_addElement:function(i,item){var o=this.options,w=BI.DefaultLayout.superclass._addElement.apply(this,arguments);return o.vgap+o.tgap+(item.tgap||0)!==0&&w.element.css({"margin-top":o.vgap+o.tgap+(item.tgap||0)+"px"}),o.hgap+o.lgap+(item.lgap||0)!==0&&w.element.css({"margin-left":o.hgap+o.lgap+(item.lgap||0)+"px"}),o.hgap+o.rgap+(item.rgap||0)!==0&&w.element.css({"margin-right":o.hgap+o.rgap+(item.rgap||0)+"px"}),o.vgap+o.bgap+(item.bgap||0)!==0&&w.element.css({"margin-bottom":o.vgap+o.bgap+(item.bgap||0)+"px"}),w},resize:function(){},populate:function(items){BI.DefaultLayout.superclass.populate.apply(this,arguments),this._mount()}}),BI.shortcut("bi.default",BI.DefaultLayout),BI.DivisionLayout=BI.inherit(BI.Layout,{props:function(){return BI.extend(BI.DivisionLayout.superclass.props.apply(this,arguments),{baseCls:"bi-division-layout",columns:null,rows:null,items:[]})},render:function(){BI.DivisionLayout.superclass.render.apply(this,arguments),this.populate(this.options.items)},resize:function(){this.stroke(this.opitons.items)},addItem:function(item){throw new Error("cannot be added")},stroke:function(items){function firstElement(item,row,col){0===row&&item.addClass("first-row"),0===col&&item.addClass("first-col"),item.addClass(BI.isOdd(row+1)?"odd-row":"even-row"),item.addClass(BI.isOdd(col+1)?"odd-col":"even-col"),item.addClass("center-element")}function firstObject(item,row,col){var cls="";0===row&&(cls+=" first-row"),0===col&&(cls+=" first-col"),cls+=BI.isOdd(row+1)?" odd-row":" even-row",cls+=BI.isOdd(col+1)?" odd-col":" even-col",item.cls=(item.cls||"")+cls+" center-element"}function first(item,row,col){item instanceof BI.Widget?firstElement(item.element,row,col):item.el instanceof BI.Widget?firstElement(item.el.element,row,col):item.el?firstObject(item.el,row,col):firstObject(item,row,col)}var o=this.options,rows=o.rows||o.items.length,columns=o.columns||0|(o.items[0]&&o.items[0].length),map=BI.makeArray(rows),widths={},heights={};BI.each(map,function(i){map[i]=BI.makeArray(columns)}),BI.each(items,function(i,item){return BI.isArray(item)?void BI.each(item,function(j,el){widths[i]=(widths[i]||0)+item.width,heights[j]=(heights[j]||0)+item.height,map[i][j]=el}):(widths[item.row]=(widths[item.row]||0)+item.width,heights[item.column]=(heights[item.column]||0)+item.height,void(map[item.row][item.column]=item))});for(var i=0;i0){var lastW=this.getWidgetByName(this.getName()+i+"_"+(j-1));lastW.element.css({right:100-left+"%"})}j==o.columns-1&&w.element.css({right:"0%"}),first(w,i,j),totalW+=map[i][j].width}for(var j=0;j0){var lastW=this.getWidgetByName(this.getName()+(i-1)+"_"+j);lastW.element.css({bottom:100-top+"%"})}i==o.rows-1&&w.element.css({bottom:"0%"}),totalH+=map[i][j].height}},update:function(){},populate:function(items){BI.DivisionLayout.superclass.populate.apply(this,arguments),this._mount()}}),BI.shortcut("bi.division",BI.DivisionLayout),BI.FloatLeftLayout=BI.inherit(BI.Layout,{props:function(){return BI.extend(BI.FloatLeftLayout.superclass.props.apply(this,arguments),{baseCls:"bi-float-left-layout clearfix",hgap:0,vgap:0,lgap:0,rgap:0,tgap:0,bgap:0})},render:function(){BI.FloatLeftLayout.superclass.render.apply(this,arguments),this.populate(this.options.items)},_addElement:function(i,item){var o=this.options,w=BI.FloatLeftLayout.superclass._addElement.apply(this,arguments);return w.element.css({position:"relative","float":"left"}),BI.isNotNull(item.left)&&w.element.css({left:item.left}),BI.isNotNull(item.right)&&w.element.css({right:item.right}),BI.isNotNull(item.top)&&w.element.css({top:item.top}),BI.isNotNull(item.bottom)&&w.element.css({bottom:item.bottom}),o.vgap+o.tgap+(item.tgap||0)+(item.vgap||0)!==0&&w.element.css({"margin-top":o.vgap+o.tgap+(item.tgap||0)+(item.vgap||0)+"px"}),o.hgap+o.lgap+(item.lgap||0)+(item.hgap||0)!==0&&w.element.css({"margin-left":(0===i?o.hgap:0)+o.lgap+(item.lgap||0)+(item.hgap||0)+"px"}),o.hgap+o.rgap+(item.rgap||0)+(item.hgap||0)!==0&&w.element.css({"margin-right":o.hgap+o.rgap+(item.rgap||0)+(item.hgap||0)+"px"}),o.vgap+o.bgap+(item.bgap||0)+(item.vgap||0)!==0&&w.element.css({"margin-bottom":o.vgap+o.bgap+(item.bgap||0)+(item.vgap||0)+"px"}),w},resize:function(){this.stroke(this.options.items)},populate:function(items){BI.FloatLeftLayout.superclass.populate.apply(this,arguments),this._mount()}}),BI.shortcut("bi.left",BI.FloatLeftLayout),BI.FloatRightLayout=BI.inherit(BI.Layout,{props:function(){return BI.extend(BI.FloatRightLayout.superclass.props.apply(this,arguments),{baseCls:"bi-float-right-layout clearfix",hgap:0,vgap:0,lgap:0,rgap:0,tgap:0,bgap:0})},render:function(){BI.FloatRightLayout.superclass.render.apply(this,arguments),this.populate(this.options.items)},_addElement:function(i,item){var o=this.options,w=BI.FloatRightLayout.superclass._addElement.apply(this,arguments);return w.element.css({position:"relative","float":"right"}),BI.isNotNull(item.left)&&w.element.css({left:item.left}),BI.isNotNull(item.right)&&w.element.css({right:item.right}),BI.isNotNull(item.top)&&w.element.css({top:item.top}),BI.isNotNull(item.bottom)&&w.element.css({bottom:item.bottom}),o.vgap+o.tgap+(item.tgap||0)+(item.vgap||0)!==0&&w.element.css({"margin-top":o.vgap+o.tgap+(item.tgap||0)+(item.vgap||0)+"px"}),o.hgap+o.lgap+(item.lgap||0)+(item.hgap||0)!==0&&w.element.css({"margin-left":o.hgap+o.lgap+(item.lgap||0)+(item.hgap||0)+"px"}),o.hgap+o.rgap+(item.rgap||0)+(item.hgap||0)!==0&&w.element.css({"margin-right":(0===i?o.hgap:0)+o.rgap+(item.rgap||0)+(item.hgap||0)+"px"}),o.vgap+o.bgap+(item.bgap||0)+(item.vgap||0)!==0&&w.element.css({"margin-bottom":o.vgap+o.bgap+(item.bgap||0)+(item.vgap||0)+"px"}),w},resize:function(){this.stroke(this.options.items)},populate:function(items){BI.FloatRightLayout.superclass.populate.apply(this,arguments),this._mount()}}),BI.shortcut("bi.right",BI.FloatRightLayout),BI.GridLayout=BI.inherit(BI.Layout,{props:function(){return BI.extend(BI.GridLayout.superclass.props.apply(this,arguments),{baseCls:"bi-grid-layout",columns:null,rows:null,items:[]})},render:function(){BI.GridLayout.superclass.render.apply(this,arguments),this.populate(this.options.items)},resize:function(){},addItem:function(){throw new Error("cannot be added")},stroke:function(items){function firstElement(item,row,col){0===row&&item.addClass("first-row"),0===col&&item.addClass("first-col"),item.addClass(BI.isOdd(row+1)?"odd-row":"even-row"),item.addClass(BI.isOdd(col+1)?"odd-col":"even-col"),item.addClass("center-element")}function firstObject(item,row,col){var cls="";0===row&&(cls+=" first-row"),0===col&&(cls+=" first-col"),cls+=BI.isOdd(row+1)?" odd-row":" even-row",cls+=BI.isOdd(col+1)?" odd-col":" even-col",item.cls=(item.cls||"")+cls+" center-element"}function first(item,row,col){item instanceof BI.Widget?firstElement(item.element,row,col):item.el instanceof BI.Widget?firstElement(item.el.element,row,col):item.el?firstObject(item.el,row,col):firstObject(item,row,col)}for(var self=this,o=this.options,rows=o.rows||o.items.length,columns=o.columns||0|(o.items[0]&&o.items[0].length),width=100/columns,height=100/rows,els=[],i=0;i").attr({cellspacing:0,cellpadding:0}).css({position:"relative","white-space":"nowrap",height:o.verticalAlign===BI.VerticalAlign.Middle?"100%":"auto",width:o.horizontalAlign===BI.HorizontalAlign.Center||o.horizontalAlign===BI.HorizontalAlign.Stretch?"100%":"auto","border-spacing":"0px",border:"none","border-collapse":"separate"}),this.$tr=BI.Widget._renderEngine.createElement("
    "),this.$tr.appendTo(this.$table),this.populate(this.options.items)},_addElement:function(i,item){var o=this.options,td,width=o.columnSize[i]<=1?100*o.columnSize[i]+"%":o.columnSize[i];if(this.hasWidget(this._getChildName(i)))td=this.getWidgetByName(this._getChildName(i)),td.element.attr("width",width);else{var w=BI.createWidget(item);w.element.css({position:"relative",margin:"0px auto"}),td=BI.createWidget({type:"bi.default",tagName:"td",attributes:{width:width},items:[w]}),this.addWidget(this._getChildName(i),td)}return td.element.css({"max-width":o.columnSize[i]<=1?width:width+"px"}),0===i&&td.element.addClass("first-element"),td.element.css({position:"relative","vertical-align":o.verticalAlign,margin:"0",padding:"0",border:"none"}),o.vgap+o.tgap+(item.tgap||0)+(item.vgap||0)!==0&&w.element.css({"margin-top":o.vgap+o.tgap+(item.tgap||0)+(item.vgap||0)+"px"}),o.hgap+o.lgap+(item.lgap||0)+(item.hgap||0)!==0&&w.element.css({"margin-left":(0===i?o.hgap:0)+o.lgap+(item.lgap||0)+(item.hgap||0)+"px"}),o.hgap+o.rgap+(item.rgap||0)+(item.hgap||0)!==0&&w.element.css({"margin-right":o.hgap+o.rgap+(item.rgap||0)+(item.hgap||0)+"px"}),o.vgap+o.bgap+(item.bgap||0)+(item.vgap||0)!==0&&w.element.css({"margin-bottom":o.vgap+o.bgap+(item.bgap||0)+(item.vgap||0)+"px"}),td},appendFragment:function(frag){this.$tr.append(frag),this.element.append(this.$table)},resize:function(){},_getWrapper:function(){return this.$tr},populate:function(items){BI.HorizontalLayout.superclass.populate.apply(this,arguments),this._mount()}}),BI.shortcut("bi.horizontal",BI.HorizontalLayout),BI.HorizontalCellLayout=BI.inherit(BI.Layout,{props:function(){return BI.extend(BI.HorizontalCellLayout.superclass.props.apply(this,arguments),{baseCls:"bi-horizontal-cell-layout",scrollable:!0,hgap:0,vgap:0,lgap:0,rgap:0,tgap:0,bgap:0})},render:function(){BI.HorizontalCellLayout.superclass.render.apply(this,arguments),this.element.css({display:"table","vertical-align":"top"}),this.populate(this.options.items)},_addElement:function(i,item){var o=this.options,w=BI.HorizontalCellLayout.superclass._addElement.apply(this,arguments);return w.element.css({position:"relative",display:"table-cell","vertical-align":"middle"}),o.hgap+o.lgap>0&&w.element.css({"margin-left":o.hgap+o.lgap+"px"}),o.hgap+o.rgap>0&&w.element.css({"margin-right":o.hgap+o.rgap+"px"}),o.vgap+o.tgap>0&&w.element.css({"margin-top":o.vgap+o.tgap+"px"}),o.vgap+o.bgap>0&&w.element.css({"margin-bottom":o.vgap+o.bgap+"px"}),w},resize:function(){},populate:function(items){BI.HorizontalCellLayout.superclass.populate.apply(this,arguments),this._mount()}}),BI.shortcut("bi.horizontal_cell",BI.HorizontalCellLayout),BI.InlineLayout=BI.inherit(BI.Layout,{props:function(){return BI.extend(BI.InlineLayout.superclass.props.apply(this,arguments),{baseCls:"bi-inline-layout",hgap:0,vgap:0,lgap:0,rgap:0,tgap:0,bgap:0})},render:function(){BI.InlineLayout.superclass.render.apply(this,arguments),this.populate(this.options.items)},_addElement:function(i,item){var o=this.options,w=BI.InlineLayout.superclass._addElement.apply(this,arguments);return w.element.css({position:"relative",display:"inline-block","*display":"inline","*zoom":1}),o.vgap+o.tgap+(item.tgap||0)+(item.vgap||0)!==0&&w.element.css({"margin-top":o.vgap+o.tgap+(item.tgap||0)+(item.vgap||0)+"px" +}),o.hgap+o.lgap+(item.lgap||0)+(item.hgap||0)!==0&&w.element.css({"margin-left":(0===i?o.hgap:0)+o.lgap+(item.lgap||0)+(item.hgap||0)+"px"}),o.hgap+o.rgap+(item.rgap||0)+(item.hgap||0)!==0&&w.element.css({"margin-right":o.hgap+o.rgap+(item.rgap||0)+(item.hgap||0)+"px"}),o.vgap+o.bgap+(item.bgap||0)+(item.vgap||0)!==0&&w.element.css({"margin-bottom":o.vgap+o.bgap+(item.bgap||0)+(item.vgap||0)+"px"}),w},resize:function(){this.stroke(this.options.items)},populate:function(items){BI.InlineLayout.superclass.populate.apply(this,arguments),this._mount()}}),BI.shortcut("bi.inline",BI.InlineLayout),BI.LatticeLayout=BI.inherit(BI.Layout,{props:function(){return BI.extend(BI.LatticeLayout.superclass.props.apply(this,arguments),{baseCls:"bi-lattice-layout clearfix"})},render:function(){BI.LatticeLayout.superclass.render.apply(this,arguments),this.populate(this.options.items)},_addElement:function(i,item){var o=this.options,w=BI.LatticeLayout.superclass._addElement.apply(this,arguments);if(o.columnSize&&o.columnSize[i])var width=o.columnSize[i]/BI.sum(o.columnSize)*100+"%";else var width=1/this.options.items.length*100+"%";return w.element.css({position:"relative","float":"left",width:width}),w},addItem:function(item){var w=BI.LatticeLayout.superclass.addItem.apply(this,arguments);return this.resize(),w},addItemAt:function(item){var w=BI.LatticeLayout.superclass.addItemAt.apply(this,arguments);return this.resize(),w},resize:function(){this.stroke(this.options.items)},populate:function(items){BI.LatticeLayout.superclass.populate.apply(this,arguments),this._mount()}}),BI.shortcut("bi.lattice",BI.LatticeLayout),BI.TableLayout=BI.inherit(BI.Layout,{props:function(){return BI.extend(BI.TableLayout.superclass.props.apply(this,arguments),{baseCls:"bi-table-layout",scrolly:!0,columnSize:[200,200,"fill"],rowSize:30,hgap:0,vgap:0,items:[[{el:{text:"label1"}},{el:{text:"label2"}},{el:{text:"label3"}}]]})},render:function(){BI.TableLayout.superclass.render.apply(this,arguments),this.rows=0,this.populate(this.options.items)},_addElement:function(idx,arr){function firstElement(item,row,col){0===row&&item.addClass("first-row"),0===col&&item.addClass("first-col"),item.addClass(BI.isOdd(row+1)?"odd-row":"even-row"),item.addClass(BI.isOdd(col+1)?"odd-col":"even-col"),item.addClass("center-element")}function firstObject(item,row,col){var cls="";0===row&&(cls+=" first-row"),0===col&&(cls+=" first-col"),cls+=BI.isOdd(row+1)?" odd-row":" even-row",cls+=BI.isOdd(col+1)?" odd-col":" even-col",item.cls=(item.cls||"")+cls+" center-element"}function first(item,row,col){item instanceof BI.Widget?firstElement(item.element,row,col):item.el instanceof BI.Widget?firstElement(item.el.element,row,col):item.el?firstObject(item.el,row,col):firstObject(item,row,col)}var o=this.options,abs=[],left=0,right=0,i,j;for(i=0;ii;j--){if(!BI.isNumber(o.columnSize[j]))throw new Error("item with fill can only be one");first(arr[j],this.rows,j),abs.push(BI.extend({top:0,bottom:0,right:o.columnSize[j]<=1?100*right+"%":right,width:o.columnSize[j]<=1?100*o.columnSize[j]+"%":o.columnSize[j]},arr[j])),right+=o.columnSize[j]+(o.columnSize[j]<1?0:o.hgap)}i>=0&&i0&&this.getWidgetByName(this.getName()+(this.rows-1)).element.css({"margin-bottom":o.vgap}),w.element.css({position:"relative"}),this.addWidget(this.getName()+this.rows++,w),w},resize:function(){},addItem:function(arr){if(!BI.isArray(arr))throw new Error("item must be array");return BI.TableLayout.superclass.addItem.apply(this,arguments)},update:function(){},populate:function(items){BI.TableLayout.superclass.populate.apply(this,arguments),this._mount()}}),BI.shortcut("bi.table",BI.TableLayout),BI.HTapeLayout=BI.inherit(BI.Layout,{props:function(){return BI.extend(BI.HTapeLayout.superclass.props.apply(this,arguments),{baseCls:"bi-h-tape-layout",hgap:0,vgap:0,lgap:0,rgap:0,tgap:0,bgap:0,items:[{width:100,el:{type:"bi.button",text:"button1"}},{width:"fill",el:{type:"bi.button",text:"button2"}},{width:200,el:{type:"bi.button",text:"button3"}}]})},render:function(){BI.HTapeLayout.superclass.render.apply(this,arguments),this.populate(this.options.items)},resize:function(){this.stroke(this.options.items)},addItem:function(item){throw new Error("cannot be added")},stroke:function(items){var self=this,o=this.options;items=BI.compact(items),BI.each(items,function(i,item){if(self.hasWidget(self.getName()+i+""))w=self.getWidgetByName(self.getName()+i+"");else{var w=BI.createWidget(item);self.addWidget(self.getName()+i+"",w)}w.element.css({position:"absolute",top:(item.vgap||0)+(item.tgap||0)+o.vgap+o.tgap+"px",bottom:(item.bgap||0)+(item.vgap||0)+o.vgap+o.bgap+"px"})});var left={},right={};left[0]=0,right[items.length-1]=0,BI.any(items,function(i,item){var w=self.getWidgetByName(self.getName()+i+"");if(BI.isNull(left[i])&&(left[i]=left[i-1]+items[i-1].width+(items[i-1].lgap||0)+2*(items[i-1].hgap||0)+o.hgap+o.lgap+o.rgap),item.width<1&&item.width>=0?w.element.css({left:100*left[i]+"%",width:100*item.width+"%"}):w.element.css({left:left[i]+(item.lgap||0)+(item.hgap||0)+o.hgap+o.lgap+"px",width:BI.isNumber(item.width)?item.width:""}),!BI.isNumber(item.width))return!0}),BI.backAny(items,function(i,item){var w=self.getWidgetByName(self.getName()+i+"");if(BI.isNull(right[i])&&(right[i]=right[i+1]+items[i+1].width+(items[i+1].rgap||0)+2*(items[i+1].hgap||0)+o.hgap+o.lgap+o.rgap),item.width<1&&item.width>=0?w.element.css({right:100*right[i]+"%",width:100*item.width+"%"}):w.element.css({right:right[i]+(item.rgap||0)+(item.hgap||0)+o.hgap+o.rgap+"px",width:BI.isNumber(item.width)?item.width:""}),!BI.isNumber(item.width))return!0})},update:function(){var updated;return BI.each(this._children,function(i,child){updated=child.update()||updated}),updated},populate:function(items){BI.HTapeLayout.superclass.populate.apply(this,arguments),this._mount()}}),BI.shortcut("bi.htape",BI.HTapeLayout),BI.VTapeLayout=BI.inherit(BI.Layout,{props:function(){return BI.extend(BI.VTapeLayout.superclass.props.apply(this,arguments),{baseCls:"bi-v-tape-layout",hgap:0,vgap:0,lgap:0,rgap:0,tgap:0,bgap:0,items:[{height:100,el:{type:"bi.button",text:"button1"}},{height:"fill",el:{type:"bi.button",text:"button2"}},{height:200,el:{type:"bi.button",text:"button3"}}]})},render:function(){BI.VTapeLayout.superclass.render.apply(this,arguments),this.populate(this.options.items)},resize:function(){this.stroke(this.options.items)},addItem:function(item){throw new Error("cannot be added")},stroke:function(items){var self=this,o=this.options;items=BI.compact(items),BI.each(items,function(i,item){if(self.hasWidget(self.getName()+i+""))w=self.getWidgetByName(self.getName()+i+"");else{var w=BI.createWidget(item);self.addWidget(self.getName()+i+"",w)}w.element.css({position:"absolute",left:(item.lgap||0)+(item.hgap||0)+o.hgap+o.lgap+"px",right:+(item.hgap||0)+(item.rgap||0)+o.hgap+o.rgap+"px"})});var top={},bottom={};top[0]=0,bottom[items.length-1]=0,BI.any(items,function(i,item){var w=self.getWidgetByName(self.getName()+i+"");if(BI.isNull(top[i])&&(top[i]=top[i-1]+items[i-1].height+(items[i-1].tgap||0)+2*(items[i-1].vgap||0)+o.vgap+o.tgap+o.bgap),item.height<1&&item.height>=0?w.element.css({top:100*top[i]+"%",height:100*item.height+"%"}):w.element.css({top:top[i]+(item.vgap||0)+(item.tgap||0)+o.vgap+o.tgap+"px",height:BI.isNumber(item.height)?item.height:""}),!BI.isNumber(item.height))return!0}),BI.backAny(items,function(i,item){var w=self.getWidgetByName(self.getName()+i+"");if(BI.isNull(bottom[i])&&(bottom[i]=bottom[i+1]+items[i+1].height+(items[i+1].bgap||0)+2*(items[i+1].vgap||0)+o.vgap+o.tgap+o.bgap),item.height<1&&item.height>=0?w.element.css({bottom:100*bottom[i]+"%",height:100*item.height+"%"}):w.element.css({bottom:bottom[i]+(item.vgap||0)+(item.bgap||0)+o.vgap+o.bgap+"px",height:BI.isNumber(item.height)?item.height:""}),!BI.isNumber(item.height))return!0})},update:function(){},populate:function(items){BI.VTapeLayout.superclass.populate.apply(this,arguments),this._mount()}}),BI.shortcut("bi.vtape",BI.VTapeLayout),BI.TdLayout=BI.inherit(BI.Layout,{props:function(){return BI.extend(BI.TdLayout.superclass.props.apply(this,arguments),{baseCls:"bi-td-layout",columnSize:[200,200,200],hgap:0,vgap:0,items:[[{el:{text:"label1"}},{el:{text:"label2"}},{el:{text:"label3"}}]]})},render:function(){BI.TdLayout.superclass.render.apply(this,arguments),this.$table=BI.Widget._renderEngine.createElement("
    ").attr({cellspacing:0,cellpadding:0}).css({position:"relative",width:"100%",height:"100%","border-spacing":"0px",border:"none","border-collapse":"separate"}),this.rows=0,this.populate(this.options.items)},_addElement:function(idx,arr){function firstElement(item,row,col){0===row&&item.addClass("first-row"),0===col&&item.addClass("first-col"),item.addClass(BI.isOdd(row+1)?"odd-row":"even-row"),item.addClass(BI.isOdd(col+1)?"odd-col":"even-col"),item.addClass("center-element")}function firstObject(item,row,col){var cls="";0===row&&(cls+=" first-row"),0===col&&(cls+=" first-col"),cls+=BI.isOdd(row+1)?" odd-row":" even-row",cls+=BI.isOdd(col+1)?" odd-col":" even-col",item.cls=(item.cls||"")+cls+" center-element"}function first(item,row,col){item instanceof BI.Widget?firstElement(item.element,row,col):item.el instanceof BI.Widget?firstElement(item.el.element,row,col):item.el?firstObject(item.el,row,col):firstObject(item,row,col)}for(var o=this.options,tr=BI.createWidget({type:"bi.default",tagName:"tr"}),i=0;i=0;i--){for(var j=0;j=0;j--){for(var i=0;i-1)return arr.splice(_index,1)}}function parsePath(path){if(!bailRE.test(path)){var segments=path.split(".");return function(obj){for(var i=0;iindex&&queue[i].watcher.id>watcher.id;)i--;queue.splice(i+1,0,{watcher:watcher,options:options})}else queue.push({watcher:watcher,options:options});waiting||(waiting=!0,nextTick(flushSchedulerQueue))}}function traverse(val){seenObjects.clear(),_traverse(val,seenObjects)}function _traverse(val,seen){var i=void 0,keys=void 0,isA=_.isArray(val);if(isA||_.isObject(val)){if(val.__ob__){var depId=val.__ob__.dep.id;if(seen.has(depId))return;seen.add(depId)}if(isA)for(i=val.length;i--;)_traverse(val[i],seen);else for(keys=_.keys(val),i=keys.length;i--;)_traverse(val[keys[i]],seen)}}function runBinaryFunction(binarys){for(var expr="",i=0,len=binarys.length;i 0 Then","\t\t["+name+'] = [$vbsetter](Me, [$accessors],"'+name+'")',"\tEnd If","\tOn Error Goto 0","\tEnd Property"));for(name in properties)uniq[name]||(uniq[name]=!0,buffer.push("\tPublic ["+name+"]"));buffer.push("\tPublic [hasOwnProperty]"),buffer.push("End Class");var body=buffer.join("\r\n"),className=VBClassPool[body];className||(className=makeHashCode("VBClass"),window.parseVB("Class "+className+body),window.parseVB(["Function "+className+"Factory(acc, vbm)","\tDim o","\tSet o = (New "+className+")(acc, vbm)","\tSet "+className+"Factory = o","End Function"].join("\r\n")),VBClassPool[body]=className);var ret=window[className+"Factory"](accessors,VBMediator);return ret}}var createViewModel$1=createViewModel,arrayKeys=_.keys(arrayMethods),observerState={shouldConvert:!0},Observer=function(){function Observer(value){if(_classCallCheck(this,Observer),this.value=value,this.dep=new Dep,this.vmCount=0,_.isArray(value)){var augment=hasProto?protoAugment:copyAugment;augment(value,arrayMethods,arrayKeys),this.model=this.observeArray(value)}else this.model=this.walk(value);isIE9Below?this.model.__ob__=this:def(this.model,"__ob__",this)}return Observer.prototype.walk=function walk(obj){return defineReactive(obj,this)},Observer.prototype.observeArray=function observeArray(items){for(var i=0,l=items.length;i=1?"floor":"ceil"](delta/lowestDelta),deltaX=Math[deltaX>=1?"floor":"ceil"](deltaX/lowestDelta),deltaY=Math[deltaY>=1?"floor":"ceil"](deltaY/lowestDelta),special.settings.normalizeOffset&&this.getBoundingClientRect){var boundingRect=this.getBoundingClientRect();offsetX=event.clientX-boundingRect.left,offsetY=event.clientY-boundingRect.top}return event.deltaX=deltaX,event.deltaY=deltaY,event.deltaFactor=lowestDelta,event.offsetX=offsetX,event.offsetY=offsetY,event.deltaMode=0,args.unshift(event,delta,deltaX,deltaY),nullLowestDeltaTimeout&&clearTimeout(nullLowestDeltaTimeout),nullLowestDeltaTimeout=setTimeout(nullLowestDelta,200),($.event.dispatch||$.event.handle).apply(this,args)}}function nullLowestDelta(){lowestDelta=null}function shouldAdjustOldDeltas(orgEvent,absDelta){return special.settings.adjustOldDeltas&&"mousewheel"===orgEvent.type&&absDelta%120===0}var toFix=["wheel","mousewheel","DOMMouseScroll","MozMousePixelScroll"],toBind="onwheel"in document||document.documentMode>=9?["wheel"]:["mousewheel","DomMouseScroll","MozMousePixelScroll"],slice=Array.prototype.slice,nullLowestDeltaTimeout,lowestDelta;if($.event.fixHooks)for(var i=toFix.length;i;)$.event.fixHooks[toFix[--i]]=$.event.mouseHooks;var special=$.event.special.mousewheel={version:"3.1.12",setup:function(){if(this.addEventListener)for(var i=toBind.length;i;)this.addEventListener(toBind[--i],handler,!1);else this.onmousewheel=handler},teardown:function(){if(this.removeEventListener)for(var i=toBind.length;i;)this.removeEventListener(toBind[--i],handler,!1);else this.onmousewheel=null},settings:{adjustOldDeltas:!0,normalizeOffset:!0}};$.fn.extend({mousewheel:function(fn){return fn?this.bind("mousewheel",fn):this.trigger("mousewheel")},unmousewheel:function(fn){return this.unbind("mousewheel",fn)}})}),BI.Pane=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.Pane.superclass._defaultConfig.apply(this,arguments),{_baseCls:"bi-pane",tipText:BI.i18nText("BI-No_Selected_Item"),overlap:!0,onLoaded:BI.emptyFn})},_assertTip:function(){var o=this.options;this._tipText||(this._tipText=BI.createWidget({type:"bi.label",cls:"bi-tips",text:o.tipText,height:25}),BI.createWidget({type:"bi.absolute_center_adapt",element:this,items:[this._tipText]}))},loading:function(){var self=this,o=this.options,isIE=BI.isIE(),loadingAnimation=BI.createWidget({type:"bi.horizontal",cls:"bi-loading-widget"+(isIE?" wave-loading hack":""),height:30,width:30,hgap:5,vgap:2.5,items:isIE?[]:[{type:"bi.layout",cls:"animate-rect rect1",height:25,width:3},{type:"bi.layout",cls:"animate-rect rect2",height:25,width:3},{type:"bi.layout",cls:"animate-rect rect3",height:25,width:3}]});this.setTipVisible(!1),o.overlap===!0?(BI.Layers.has(this.getName())||BI.createWidget({type:"bi.absolute_center_adapt",cls:"loading-container",items:[{el:loadingAnimation}],element:BI.Layers.make(this.getName(),this)}),BI.Layers.show(self.getName())):BI.isNull(this._loading)&&(this._loading=loadingAnimation,this._loading.element.css("zIndex",1),BI.createWidget({type:"bi.absolute_center_adapt",element:this,cls:"loading-container",items:[{el:this._loading,left:0,right:0,top:0}]})),this.element.addClass("loading-status")},loaded:function(){var self=this,o=this.options;BI.Layers.remove(self.getName()),this._loading&&this._loading.destroy(),this._loading&&(this._loading=null),o.onLoaded(),self.fireEvent(BI.Pane.EVENT_LOADED),this.element.removeClass("loading-status")},check:function(){this.setTipVisible(BI.isEmpty(this.options.items))},setTipVisible:function(b){b===!0?(this._assertTip(),this._tipText.setVisible(!0)):this._tipText&&this._tipText.setVisible(!1)},populate:function(items){this.options.items=items||[],this.check()},empty:function(){}}),BI.Pane.EVENT_LOADED="EVENT_LOADED",BI.Single=BI.inherit(BI.Widget,{_defaultConfig:function(){var conf=BI.Single.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{_baseCls:(conf._baseCls||"")+" bi-single",readonly:!1,title:null,warningTitle:null,tipType:null,value:null,belowMouse:!1})},_showToolTip:function(e,opt){opt||(opt={});var self=this,o=this.options,type=this.getTipType()||(this.isEnabled()?"success":"warning"),title="success"===type?this.getTitle():this.getWarningTitle()||this.getTitle();BI.isKey(title)&&(BI.Tooltips.show(e,this.getName(),title,type,this,opt),o.action&&BI.Actions.runAction(o.action,"hover",o,this),BI.Actions.runGlobalAction("hover",o,this))},_hideTooltip:function(){var self=this,tooltip=BI.Tooltips.get(this.getName());BI.isNotNull(tooltip)&&tooltip.element.fadeOut(200,function(){BI.Tooltips.remove(self.getName())})},_init:function(){BI.Single.superclass._init.apply(this,arguments);var self=this,o=this.options;(BI.isKey(o.title)||BI.isKey(o.warningTitle)||BI.isFunction(o.title)||BI.isFunction(o.warningTitle))&&this.enableHover({belowMouse:o.belowMouse,container:o.container})},_clearTimeOut:function(){BI.isNotNull(this.showTimeout)&&(clearTimeout(this.showTimeout),this.showTimeout=null),BI.isNotNull(this.hideTimeout)&&(clearTimeout(this.hideTimeout),this.hideTimeout=null)},enableHover:function(opt){opt||(opt={});var self=this;this._hoverBinded||(this.element.on("mouseenter.title"+this.getName(),function(e){self._e=e,"warning"===self.getTipType()||BI.isKey(self.getWarningTitle())&&!self.isEnabled()?self.showTimeout=BI.delay(function(){BI.isNotNull(self.showTimeout)&&self._showToolTip(self._e||e,opt)},200):("success"===self.getTipType()||self.isEnabled())&&(self.showTimeout=BI.delay(function(){BI.isNotNull(self.showTimeout)&&self._showToolTip(self._e||e,opt)},500))}),this.element.on("mousemove.title"+this.getName(),function(e){self._e=e,BI.isNotNull(self.showTimeout)&&(clearTimeout(self.showTimeout),self.showTimeout=null),BI.isNull(self.hideTimeout)&&(self.hideTimeout=BI.delay(function(){BI.isNotNull(self.hideTimeout)&&self._hideTooltip()},500)),self.showTimeout=BI.delay(function(){BI.isNotNull(self.showTimeout)&&(BI.isNotNull(self.hideTimeout)&&(clearTimeout(self.hideTimeout),self.hideTimeout=null),self.element.__isMouseInBounds__(self._e||e)&&self._showToolTip(self._e||e,opt))},500)}),this.element.on("mouseleave.title"+this.getName(),function(e){self._e=null,self._clearTimeOut(),self._hideTooltip()}),this._hoverBinded=!0)},disabledHover:function(){this._clearTimeOut(),this._hideTooltip(),this.element.unbind("mouseenter.title"+this.getName()).unbind("mousemove.title"+this.getName()).unbind("mouseleave.title"+this.getName()),this._hoverBinded=!1},populate:function(items){this.items=items||[]},setTitle:function(title,opt){this.options.title=title,BI.isKey(title)||BI.isFunction(title)?this.enableHover(opt):this.disabledHover()},setWarningTitle:function(title,opt){this.options.warningTitle=title,BI.isKey(title)||BI.isFunction(title)?this.enableHover(opt):this.disabledHover()},getTipType:function(){return this.options.tipType},isReadOnly:function(){return!!this.options.readonly},getTitle:function(){var title=this.options.title;return BI.isFunction(title)?title():title},getWarningTitle:function(){var title=this.options.warningTitle;return BI.isFunction(title)?title():title},setValue:function(val){this.options.readonly||(this.options.value=val)},getValue:function(){return this.options.value},_unMount:function(){BI.Single.superclass._unMount.apply(this,arguments),BI.Tooltips.remove(this.getName())}}),BI.Text=BI.inherit(BI.Single,{props:{baseCls:"bi-text",textAlign:"left",whiteSpace:"normal",lineHeight:null,handler:null,hgap:0,vgap:0,lgap:0,rgap:0,tgap:0,bgap:0,text:"",py:"",highLight:!1},render:function(){var self=this,o=this.options;o.hgap+o.lgap>0&&this.element.css({"padding-left":o.hgap+o.lgap+"px"}),o.hgap+o.rgap>0&&this.element.css({"padding-right":o.hgap+o.rgap+"px"}),o.vgap+o.tgap>0&&this.element.css({"padding-top":o.vgap+o.tgap+"px"}),o.vgap+o.bgap>0&&this.element.css({"padding-bottom":o.vgap+o.bgap+"px"}),BI.isNumber(o.height)&&this.element.css({lineHeight:o.height+"px"}),BI.isNumber(o.lineHeight)&&this.element.css({lineHeight:o.lineHeight+"px"}),BI.isWidthOrHeight(o.maxWidth)&&this.element.css({maxWidth:o.maxWidth}),this.element.css({textAlign:o.textAlign,whiteSpace:o.whiteSpace,textOverflow:"nowrap"===o.whiteSpace?"ellipsis":"",overflow:"nowrap"===o.whiteSpace?"":BI.isWidthOrHeight(o.height)?"auto":""}),o.handler?(this.text=BI.createWidget({type:"bi.layout",tagName:"span"}),this.text.element.click(function(){o.handler(self.getValue())}),BI.createWidget({type:"bi.default",element:this,items:[this.text]})):this.text=this;var text=this._getShowText();BI.isKey(text)?this.setText(text):BI.isKey(o.value)&&this.setText(o.value),BI.isKey(o.keyword)&&this.doRedMark(o.keyword),o.highLight&&this.doHighLight()},_getShowText:function(){var o=this.options;return BI.isFunction(o.text)?o.text():o.text},doRedMark:function(keyword){var o=this.options;o.keyword=keyword,this.text.element.__textKeywordMarked__(this._getShowText()||o.value,keyword,o.py)},unRedMark:function(){var o=this.options;o.keyword="",this.text.element.__textKeywordMarked__(this._getShowText()||o.value,"",o.py)},doHighLight:function(){this.text.element.addClass("bi-high-light")},unHighLight:function(){this.text.element.removeClass("bi-high-light")},setValue:function(text){BI.Text.superclass.setValue.apply(this,arguments),this.isReadOnly()||this.setText(text)},setStyle:function(css){this.text.element.css(css)},setText:function(text){return BI.Text.superclass.setText.apply(this,arguments),this.options.text=BI.isNotNull(text)?text:"",BI.isIE9Below()?void this.text.element.html(BI.htmlEncode(this._getShowText())):void(/\s/.test(text)?this.text.element[0].innerHTML=BI.htmlEncode(this._getShowText()):this.text.element[0].textContent=this._getShowText())}}),BI.shortcut("bi.text",BI.Text),BI.BasicButton=BI.inherit(BI.Single,{_defaultConfig:function(){var conf=BI.BasicButton.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{_baseCls:(conf._baseCls||"")+" bi-basic-button"+(conf.invalid?"":" cursor-pointer")+(BI.isIE()&&BI.getIEVersion()<10?" hack":""),value:"",text:"",stopEvent:!1,stopPropagation:!1,selected:!1,once:!1,forceSelected:!1,forceNotSelected:!1,disableSelected:!1,shadow:!1,isShadowShowingOnSelected:!1,trigger:null,handler:BI.emptyFn,bubble:null})},_init:function(){BI.BasicButton.superclass._init.apply(this,arguments);var opts=this.options;opts.selected===!0&&BI.nextTick(BI.bind(function(){this.setSelected(opts.selected)},this)),BI.nextTick(BI.bind(this.bindEvent,this)),opts.shadow&&this._createShadow(),opts.level&&this.element.addClass("button-"+opts.level)},_createShadow:function(){var self=this,o=this.options,assertMask=function(){self.$mask||(self.$mask=BI.createWidget(BI.isObject(o.shadow)?o.shadow:{},{type:"bi.layout",cls:"bi-button-mask"}),self.$mask.invisible(),BI.createWidget({type:"bi.absolute",element:self,items:[{el:self.$mask,left:0,right:0,top:0,bottom:0}]}))};this.element.mouseup(function(){self._hover||o.isShadowShowingOnSelected||(assertMask(),self.$mask.invisible())}),this.element.on("mouseenter."+this.getName(),function(e){self.element.__isMouseInBounds__(e)&&(!self.isEnabled()||self._hover||!o.isShadowShowingOnSelected&&self.isSelected()||(assertMask(),self.$mask.visible()))}),this.element.on("mousemove."+this.getName(),function(e){self.element.__isMouseInBounds__(e)||self.isEnabled()&&!self._hover&&(assertMask(),self.$mask.invisible())}),this.element.on("mouseleave."+this.getName(),function(){self.isEnabled()&&!self._hover&&(assertMask(),self.$mask.invisible())})},bindEvent:function(){function ev(e){o.stopEvent&&e.stopEvent(),o.stopPropagation&&e.stopPropagation()}function clk(e){if(ev(e),!(!self.isEnabled()||self.isOnce()&&self.isSelected())){if(BI.isKey(o.bubble)||BI.isFunction(o.bubble)){if(BI.isNull(self.combo)){var popup;BI.createWidget({type:"bi.absolute",element:self,items:[{el:{type:"bi.bubble_combo",trigger:"",destroyWhenHide:!0,ref:function(){self.combo=this},el:{type:"bi.layout",height:"100%"},popup:{type:"bi.text_bubble_bar_popup_view",text:getBubble(),ref:function(){popup=this},listeners:[{eventName:BI.BubblePopupBarView.EVENT_CLICK_TOOLBAR_BUTTON,action:function(v){self.combo.hideView(),v&&onClick.apply(self,arguments)}}]},listeners:[{eventName:BI.BubbleCombo.EVENT_BEFORE_POPUPVIEW,action:function(){popup.populate(getBubble())}}]},left:0,right:0,bottom:0,top:0}]})}return void(self.combo.isViewVisible()?self.combo.hideView():self.combo.showView())}onClick.apply(self,arguments)}}function getBubble(){var bubble=self.options.bubble;return BI.isFunction(bubble)?bubble():bubble}var self=this,o=this.options,hand=this.handle();if(hand){hand=hand.element;var triggerArr=(o.trigger||"").split(",");BI.each(triggerArr,function(idx,trigger){switch(trigger){case"mouseup":var mouseDown=!1;hand.mousedown(function(){mouseDown=!0}),hand.mouseup(function(e){mouseDown===!0&&clk(e),mouseDown=!1,ev(e)});break;case"mousedown":var mouseDown=!1,selected=!1;hand.mousedown(function(e){BI.Widget._renderEngine.createElement(document).bind("mouseup."+self.getName(),function(e){!BI.DOM.isExist(self)||hand.__isMouseInBounds__(e)||mouseDown!==!0||selected||self._trigger(),mouseDown=!1,BI.Widget._renderEngine.createElement(document).unbind("mouseup."+self.getName())}),mouseDown!==!0&&(self.isSelected()?selected=!0:clk(e),mouseDown=!0,ev(e))}),hand.mouseup(function(e){BI.DOM.isExist(self)&&mouseDown===!0&&selected===!0&&clk(e),mouseDown=!1,selected=!1,BI.Widget._renderEngine.createElement(document).unbind("mouseup."+self.getName())});break;case"dblclick":hand.dblclick(clk);break;case"lclick":var mouseDown=!1,interval;hand.mousedown(function(e){BI.Widget._renderEngine.createElement(document).bind("mouseup."+self.getName(),function(e){interval&&clearInterval(interval),interval=null,mouseDown=!1,BI.Widget._renderEngine.createElement(document).unbind("mouseup."+self.getName())}),mouseDown!==!0&&(!self.isEnabled()||self.isOnce()&&self.isSelected()||(interval=setInterval(function(){self.isEnabled()&&self.doClick()},180),mouseDown=!0,ev(e)))});break;default:(o.stopEvent||o.stopPropagation)&&hand.mousedown(function(e){ev(e)}),hand.click(clk)}});var onClick=BI.debounce(this._doClick,BI.EVENT_RESPONSE_TIME,{leading:!0,trailing:!1})}},_trigger:function(e){var o=this.options;if(this.isEnabled()&&(this.isDisableSelected()||(this.isForceSelected()?this.setSelected(!0):this.isForceNotSelected()?this.setSelected(!1):this.setSelected(!this.isSelected())),this.isValid())){o.handler.call(this,this.getValue(),this,e);var v=this.getValue();this.fireEvent(BI.Controller.EVENT_CHANGE,BI.Events.CLICK,v,this,e),this.fireEvent(BI.BasicButton.EVENT_CHANGE,v,this),o.action&&BI.Actions.runAction(o.action,"click",o,this),BI.Actions.runGlobalAction("click",o,this)}},_doClick:function(e){this.isValid()&&this.beforeClick(e),this._trigger(e),this.isValid()&&this.doClick(e)},beforeClick:function(){},doClick:function(){},handle:function(){return this},hover:function(){this._hover=!0,this.handle().element.addClass("hover"),this.options.shadow&&this.$mask&&this.$mask.setVisible(!0)},dishover:function(){this._hover=!1,this.handle().element.removeClass("hover"),this.options.shadow&&this.$mask&&this.$mask.setVisible(!1)},setSelected:function(b){var o=this.options;o.selected=b,b?this.handle().element.addClass("active"):this.handle().element.removeClass("active"),o.shadow&&!o.isShadowShowingOnSelected&&this.$mask&&this.$mask.setVisible(!1)},isSelected:function(){return this.options.selected},isOnce:function(){return this.options.once},isForceSelected:function(){return this.options.forceSelected},isForceNotSelected:function(){return this.options.forceNotSelected},isDisableSelected:function(){return this.options.disableSelected},setText:function(text){this.options.text=text},getText:function(){return this.options.text},_setEnable:function(enable){BI.BasicButton.superclass._setEnable.apply(this,arguments),enable===!0?this.element.removeClass("base-disabled disabled"):enable===!1&&this.element.addClass("base-disabled disabled"),enable||this.options.shadow&&this.$mask&&this.$mask.setVisible(!1)},empty:function(){BI.Widget._renderEngine.createElement(document).unbind("mouseup."+this.getName()),BI.BasicButton.superclass.empty.apply(this,arguments)},destroy:function(){BI.BasicButton.superclass.destroy.apply(this,arguments)}}),BI.BasicButton.EVENT_CHANGE="BasicButton.EVENT_CHANGE",BI.NodeButton=BI.inherit(BI.BasicButton,{_defaultConfig:function(){var conf=BI.NodeButton.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{_baseCls:(conf._baseCls||"")+" bi-node",open:!1})},_init:function(){BI.NodeButton.superclass._init.apply(this,arguments);var self=this;BI.nextTick(function(){self.setOpened(self.isOpened())})},doClick:function(){BI.NodeButton.superclass.doClick.apply(this,arguments),this.setOpened(!this.isOpened())},isOnce:function(){return!1},isOpened:function(){return!!this.options.open},setOpened:function(b){this.options.open=!!b},triggerCollapse:function(){this.isOpened()&&(this.setOpened(!1),this.fireEvent(BI.Controller.EVENT_CHANGE,BI.Events.COLLAPSE,this.getValue(),this))},triggerExpand:function(){this.isOpened()||(this.setOpened(!0),this.fireEvent(BI.Controller.EVENT_CHANGE,BI.Events.EXPAND,this.getValue(),this))}}),BI.Tip=BI.inherit(BI.Single,{_defaultConfig:function(){var conf=BI.Tip.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{_baseCls:(conf._baseCls||"")+" bi-tip",zIndex:BI.zIndex_tip})},_init:function(){BI.Tip.superclass._init.apply(this,arguments),this.element.css({zIndex:this.options.zIndex})}}),BI.ButtonGroup=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.ButtonGroup.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-button-group",behaviors:{},items:[],value:"",chooseType:BI.Selection.Single,layouts:[{type:"bi.center",hgap:0,vgap:0}]})},_init:function(){BI.ButtonGroup.superclass._init.apply(this,arguments);var o=this.options,behaviors={};BI.each(o.behaviors,function(key,rule){behaviors[key]=BI.BehaviorFactory.createBehavior(key,{rule:rule})}),this.behaviors=behaviors,this.populate(o.items),(BI.isKey(o.value)||BI.isNotEmptyArray(o.value))&&this.setValue(o.value)},_createBtns:function(items){var o=this.options;return BI.createWidgets(BI.createItems(items,{type:"bi.text_button"}))},_btnsCreator:function(items){var self=this,args=Array.prototype.slice.call(arguments),o=this.options,buttons=this._createBtns(items);return args[0]=buttons,BI.each(this.behaviors,function(i,behavior){behavior.doBehavior.apply(behavior,args)}),BI.each(buttons,function(i,btn){btn.on(BI.Controller.EVENT_CHANGE,function(type,value,obj){if(type===BI.Events.CLICK){switch(o.chooseType){case BI.ButtonGroup.CHOOSE_TYPE_SINGLE:self.setValue(btn.getValue());break;case BI.ButtonGroup.CHOOSE_TYPE_NONE:self.setValue([])}self.fireEvent(BI.Controller.EVENT_CHANGE,arguments),self.fireEvent(BI.ButtonGroup.EVENT_CHANGE,value,obj)}else self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),btn.on(BI.Events.DESTROY,function(){BI.remove(self.buttons,btn)})}),buttons},_packageBtns:function(btns){ +for(var o=this.options,i=o.layouts.length-1;i>0;i--)btns=BI.map(btns,function(k,it){return BI.extend({},o.layouts[i],{items:[BI.extend({},o.layouts[i].el,{el:it})]})});return btns},_packageSimpleItems:function(btns){var o=this.options;return BI.map(o.items,function(i,item){return BI.stripEL(item)===item?btns[i]:BI.extend({},item,{el:btns[i]})})},_packageItems:function(items,packBtns){return BI.createItems(BI.makeArrayByArray(items,{}),BI.clone(packBtns))},_packageLayout:function(items){for(var o=this.options,layout=BI.deepClone(o.layouts[0]),lay=BI.formatEL(layout).el;lay&&lay.items&&!BI.isEmpty(lay.items);)lay=BI.formatEL(lay.items[0]).el;return lay.items=items,layout},_isSimpleLayout:function(){var o=this.options;return 1===o.layouts.length&&!BI.isArray(o.items[0])},doBehavior:function(){var args=Array.prototype.slice.call(arguments);args.unshift(this.buttons),BI.each(this.behaviors,function(i,behavior){behavior.doBehavior.apply(behavior,args)})},prependItems:function(items){var o=this.options,btns=this._btnsCreator.apply(this,arguments);return this.buttons=BI.concat(btns,this.buttons),this._isSimpleLayout()&&this.layouts&&this.layouts.prependItems?void this.layouts.prependItems(btns):(items=this._packageItems(items,this._packageBtns(btns)),void this.layouts.prependItems(this._packageLayout(items).items))},addItems:function(items){var o=this.options,btns=this._btnsCreator.apply(this,arguments);return this.buttons=BI.concat(this.buttons,btns),this._isSimpleLayout()&&this.layouts&&this.layouts.addItems?void this.layouts.addItems(btns):(items=this._packageItems(items,this._packageBtns(btns)),void this.layouts.addItems(this._packageLayout(items).items))},removeItemAt:function(indexes){BI.removeAt(this.buttons,indexes),this.layouts.removeItemAt(indexes)},removeItems:function(values){values=BI.isArray(values)?values:[values];var deleted=[];BI.each(this.buttons,function(i,button){BI.deepContains(values,button.getValue())&&deleted.push(i)}),BI.removeAt(this.buttons,deleted),this.layouts.removeItemAt(deleted)},populate:function(items){items=items||[],this.empty(),this.options.items=items,this.buttons=this._btnsCreator.apply(this,arguments),items=this._isSimpleLayout()?this._packageSimpleItems(this.buttons):this._packageItems(items,this._packageBtns(this.buttons)),this.layouts=BI.createWidget(BI.extend({element:this},this._packageLayout(items)))},setNotSelectedValue:function(v){v=BI.isArray(v)?v:[v],BI.each(this.buttons,function(i,item){BI.deepContains(v,item.getValue())?item.setSelected&&item.setSelected(!1):item.setSelected&&item.setSelected(!0)})},setEnabledValue:function(v){v=BI.isArray(v)?v:[v],BI.each(this.buttons,function(i,item){BI.deepContains(v,item.getValue())?item.setEnable(!0):item.setEnable(!1)})},setValue:function(v){v=BI.isArray(v)?v:[v],BI.each(this.buttons,function(i,item){BI.deepContains(v,item.getValue())?item.setSelected&&item.setSelected(!0):item.setSelected&&item.setSelected(!1)})},getNotSelectedValue:function(){var v=[];return BI.each(this.buttons,function(i,item){!item.isEnabled()||item.isSelected&&item.isSelected()||v.push(item.getValue())}),v},getValue:function(){var v=[];return BI.each(this.buttons,function(i,item){item.isEnabled()&&item.isSelected&&item.isSelected()&&v.push(item.getValue())}),v},getAllButtons:function(){return this.buttons},getAllLeaves:function(){return this.buttons},getSelectedButtons:function(){var btns=[];return BI.each(this.buttons,function(i,item){item.isSelected&&item.isSelected()&&btns.push(item)}),btns},getNotSelectedButtons:function(){var btns=[];return BI.each(this.buttons,function(i,item){item.isSelected&&!item.isSelected()&&btns.push(item)}),btns},getIndexByValue:function(value){var index=-1;return BI.any(this.buttons,function(i,item){if(item.isEnabled()&&item.getValue()===value)return index=i,!0}),index},getNodeById:function(id){var node;return BI.any(this.buttons,function(i,item){if(item.isEnabled()&&item.options.id===id)return node=item,!0}),node},getNodeByValue:function(value){var node;return BI.any(this.buttons,function(i,item){if(item.isEnabled()&&item.getValue()===value)return node=item,!0}),node},empty:function(){BI.ButtonGroup.superclass.empty.apply(this,arguments),this.options.items=[]},destroy:function(){BI.ButtonGroup.superclass.destroy.apply(this,arguments),this.options.items=[]}}),BI.extend(BI.ButtonGroup,{CHOOSE_TYPE_SINGLE:BI.Selection.Single,CHOOSE_TYPE_MULTI:BI.Selection.Multi,CHOOSE_TYPE_ALL:BI.Selection.All,CHOOSE_TYPE_NONE:BI.Selection.None,CHOOSE_TYPE_DEFAULT:BI.Selection.Default}),BI.ButtonGroup.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.button_group",BI.ButtonGroup),BI.ButtonTree=BI.inherit(BI.ButtonGroup,{_defaultConfig:function(){return BI.extend(BI.ButtonTree.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-button-tree"})},_init:function(){BI.ButtonTree.superclass._init.apply(this,arguments)},setNotSelectedValue:function(v){v=BI.isArray(v)?v:[v],BI.each(this.buttons,function(i,item){return BI.isFunction(item.setSelected)?void(BI.deepContains(v,item.getValue())?item.setSelected(!1):item.setSelected(!0)):void item.setNotSelectedValue(v)})},setEnabledValue:function(v){v=BI.isArray(v)?v:[v],BI.each(this.buttons,function(i,item){return BI.isFunction(item.setEnabledValue)?void item.setEnabledValue(v):void(BI.deepContains(v,item.getValue())?item.setEnable(!0):item.setEnable(!1))})},setValue:function(v){v=BI.isArray(v)?v:[v],BI.each(this.buttons,function(i,item){return BI.isFunction(item.setSelected)?void(BI.deepContains(v,item.getValue())?item.setSelected(!0):item.setSelected(!1)):void item.setValue(v)})},getNotSelectedValue:function(){var v=[];return BI.each(this.buttons,function(i,item){return item.isEnabled()&&!BI.isFunction(item.setSelected)?void(v=BI.concat(v,item.getNotSelectedValue())):void(item.isEnabled()&&item.isSelected&&!item.isSelected()&&v.push(item.getValue()))}),v},getValue:function(){var v=[];return BI.each(this.buttons,function(i,item){return item.isEnabled()&&!BI.isFunction(item.setSelected)?void(v=BI.concat(v,item.getValue())):void(item.isEnabled()&&item.isSelected&&item.isSelected()&&v.push(item.getValue()))}),v},getSelectedButtons:function(){var btns=[];return BI.each(this.buttons,function(i,item){return item.isEnabled()&&!BI.isFunction(item.setSelected)?void(btns=btns.concat(item.getSelectedButtons())):void(item.isSelected&&item.isSelected()&&btns.push(item))}),btns},getNotSelectedButtons:function(){var btns=[];return BI.each(this.buttons,function(i,item){return item.isEnabled()&&!BI.isFunction(item.setSelected)?void(btns=btns.concat(item.getNotSelectedButtons())):void(item.isSelected&&!item.isSelected()&&btns.push(item))}),btns},getAllLeaves:function(){var leaves=[];return BI.each(this.buttons,function(i,item){return item.isEnabled()&&!BI.isFunction(item.setSelected)?void(leaves=leaves.concat(item.getAllLeaves())):void(item.isEnabled()&&leaves.push(item))}),leaves},getIndexByValue:function(value){var index=-1;return BI.any(this.buttons,function(i,item){var vs=item.getValue();if(item.isEnabled()&&(vs===value||BI.contains(vs,value)))return index=i,!0}),index},getNodeById:function(id){var node;return BI.any(this.buttons,function(i,item){if(item.isEnabled()){if(item.attr("id")===id)return node=item,!0;if(BI.isFunction(item.getNodeById)&&(node=item.getNodeById(id)))return!0}}),node},getNodeByValue:function(value){var node;return BI.any(this.buttons,function(i,item){if(item.isEnabled())if(BI.isFunction(item.getNodeByValue)){if(node=item.getNodeByValue(value))return!0}else if(item.attr("value")===value)return node=item,!0}),node}}),BI.ButtonTree.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.button_tree",BI.ButtonTree),BI.TreeView=BI.inherit(BI.Pane,{_defaultConfig:function(){return BI.extend(BI.TreeView.superclass._defaultConfig.apply(this,arguments),{_baseCls:"bi-tree",paras:{selectedValues:{}},itemsCreator:BI.emptyFn})},_init:function(){BI.TreeView.superclass._init.apply(this,arguments);var o=this.options;this._stop=!1,this._createTree(),this.tip=BI.createWidget({type:"bi.loading_bar",invisible:!0,handler:BI.bind(this._loadMore,this)}),BI.createWidget({type:"bi.vertical",scrollable:!0,scrolly:!1,element:this,items:[this.tip]}),BI.isNotNull(o.value)&&this.setSelectedValue(o.value),BI.isIE9Below&&BI.isIE9Below()&&this.element.addClass("hack")},_createTree:function(){this.id="bi-tree"+BI.UUID(),this.nodes&&this.nodes.destroy(),this.tree&&this.tree.destroy(),this.tree=BI.createWidget({type:"bi.layout",element:"
      "}),BI.createWidget({type:"bi.default",element:this.element,items:[this.tree]})},_selectTreeNode:function(treeId,treeNode){this.fireEvent(BI.Controller.EVENT_CHANGE,BI.Events.CLICK,treeNode,this),this.fireEvent(BI.TreeView.EVENT_CHANGE,treeNode,this)},_configSetting:function(){function onClick(event,treeId,treeNode){var checked=treeNode.checked,status=treeNode.getCheckStatus();status.half===!0&&status.checked===!0&&(checked=!1),self.nodes.checkNode(treeNode,!checked,!0,!0)}function getUrl(treeId,treeNode){var parentNode=self._getParentValues(treeNode);treeNode.times=treeNode.times||1;var param="id="+treeNode.id+"×="+treeNode.times++ +"&parentValues= "+_global.encodeURIComponent(BI.jsonEncode(parentNode))+"&checkState="+_global.encodeURIComponent(BI.jsonEncode(treeNode.getCheckStatus()));return"&"+param}function beforeExpand(treeId,treeNode){return treeNode.isAjaxing?(BI.Msg.toast("Please Wait。","warning"),!1):(treeNode.children||(treeNode.times=1,ajaxGetNodes(treeNode,"refresh")),!0)}function onAsyncSuccess(event,treeId,treeNode,msg){if(treeNode.halfCheck=!1,msg&&0!==msg.length&&!/^[\s,\S]*<\/html>$/gi.test(msg)&&!self._stop){var zTree=self.nodes,totalCount=treeNode.count||0;treeNode.children.length>totalCount?(treeNode.count=treeNode.children.length,BI.delay(function(){ajaxGetNodes(treeNode)},perTime)):(zTree.updateNode(treeNode),zTree.selectNode(treeNode.children[0]))}}function onAsyncError(event,treeId,treeNode,XMLHttpRequest,textStatus,errorThrown){var zTree=self.nodes;BI.Msg.toast("Error!","warning")}function ajaxGetNodes(treeNode,reloadType){var zTree=self.nodes;"refresh"==reloadType&&zTree.updateNode(treeNode),zTree.reAsyncChildNodes(treeNode,reloadType,!0)}function beforeCheck(treeId,treeNode){function track(children){BI.each(children,function(i,ch){ch.halfCheck===!0&&(ch.halfCheck=!1,track(ch.children))})}if(treeNode.halfCheck=!1,treeNode.checked===!0){track(treeNode.children);var treeObj=self.nodes,nodes=treeObj.getSelectedNodes();BI.$.each(nodes,function(index,node){node.halfCheck=!1})}var status=treeNode.getCheckStatus();status.half===!0&&status.checked===!0&&(treeNode.checked=!1)}function onCheck(event,treeId,treeNode){self._selectTreeNode(treeId,treeNode)}function onExpand(event,treeId,treeNode){treeNode.halfCheck=!1}function onCollapse(event,treeId,treeNode){}var paras=this.options.paras,self=this,setting={async:{enable:!0,url:getUrl,autoParam:["id","name"],otherParam:BI.cjkEncodeDO(paras)},check:{enable:!0},data:{key:{title:"title",name:"text"},simpleData:{enable:!0}},view:{showIcon:!1,expandSpeed:"",nameIsHTML:!0,dblClickExpand:!1},callback:{beforeExpand:beforeExpand,onAsyncSuccess:onAsyncSuccess,onAsyncError:onAsyncError,beforeCheck:beforeCheck,onCheck:onCheck,onExpand:onExpand,onCollapse:onCollapse,onClick:onClick}},className="dark",perTime=100;return setting},_getParentValues:function(treeNode){if(!treeNode.getParentNode())return[];var parentNode=treeNode.getParentNode(),result=this._getParentValues(parentNode);return result=result.concat([this._getNodeValue(parentNode)])},_getNodeValue:function(node){return null==node.value?BI.replaceAll(node.text.replace(/<[^>]+>/g,"")," "," "):node.value},_getHalfSelectedValues:function(map,node){var self=this,checkState=node.getCheckStatus();if(checkState.checked!==!1||checkState.half!==!1){if(BI.isNotEmptyArray(node.children)&&checkState.half===!0){var children=node.children;return void BI.each(children,function(i,ch){self._getHalfSelectedValues(map,ch)})}var parent=node.parentValues||self._getParentValues(node),path=parent.concat(this._getNodeValue(node));if(BI.isNotEmptyArray(node.children)||checkState.half===!1)return void this._buildTree(map,path);var storeValues=BI.deepClone(this.options.paras.selectedValues),treeNode=this._getTree(storeValues,path);this._addTreeNode(map,parent,this._getNodeValue(node),treeNode)}},_getTree:function(map,values){var cur=map;return BI.any(values,function(i,value){return null==cur[value]||void(cur=cur[value])}),cur},_addTreeNode:function(map,values,key,value){var cur=map;BI.each(values,function(i,value){null==cur[value]&&(cur[value]={}),cur=cur[value]}),cur[key]=value},_buildTree:function(map,values){var cur=map;BI.each(values,function(i,value){null==cur[value]&&(cur[value]={}),cur=cur[value]})},_getSelectedValues:function(){function track(nodes){BI.each(nodes,function(i,node){var checkState=node.getCheckStatus();if(checkState.checked===!0||checkState.half===!0)if(checkState.half===!0)self._getHalfSelectedValues(hashMap,node);else{var parentValues=node.parentValues||self._getParentValues(node),values=parentValues.concat([self._getNodeValue(node)]);self._buildTree(hashMap,values)}})}var self=this,hashMap={},rootNoots=this.nodes.getNodes();return track(rootNoots),hashMap},_dealWidthNodes:function(nodes){var self=this,o=this.options,ns=BI.Tree.arrayFormat(nodes);return BI.each(ns,function(i,n){n.title=n.title||n.text||n.value,n.isParent=n.isParent||n.parent,BI.isKey(o.paras.keyword)?n.text=BI.$("
      ").__textKeywordMarked__(n.text,o.paras.keyword,n.py).html():n.text=BI.htmlEncode(n.text+"")}),nodes},_loadMore:function(){var self=this,o=this.options;this.tip.setLoading();var op=BI.extend({},o.paras,{times:++this.times});o.itemsCreator(op,function(res){if(self._stop!==!0){var hasNext=!!res.hasNext,nodes=res.items||[];hasNext?self.tip.setLoaded():self.tip.setEnd(),nodes.length>0&&self.nodes.addNodes(null,self._dealWidthNodes(nodes))}})},_initTree:function(setting){var self=this,o=this.options;self.fireEvent(BI.Events.INIT),this.times=1;var tree=this.tree;tree.empty(),this.loading(),this.tip.setVisible(!1);var callback=function(nodes){self._stop!==!0&&(self.nodes=BI.$.fn.zTree.init(tree.element,setting,nodes))},op=BI.extend({},o.paras,{times:1});o.itemsCreator(op,function(res){if(self._stop!==!0){var hasNext=!!res.hasNext,nodes=res.items||[];nodes.length>0&&callback(self._dealWidthNodes(nodes)),self.setTipVisible(nodes.length<=0),self.loaded(),hasNext?self.tip.setLoaded():self.tip.invisible(),1===op.times&&self.fireEvent(BI.Events.AFTERINIT)}})},initTree:function(nodes,setting){var setting=setting||{async:{enable:!1},check:{enable:!1},data:{key:{title:"title",name:"text"},simpleData:{enable:!0}},view:{showIcon:!1,expandSpeed:"",nameIsHTML:!0},callback:{}};this.nodes=BI.$.fn.zTree.init(this.tree.element,setting,nodes)},start:function(){this._stop=!1},stop:function(){this._stop=!0},stroke:function(config){delete this.options.keyword,BI.extend(this.options.paras,config);var setting=this._configSetting();this._createTree(),this.start(),this._initTree(setting)},populate:function(){this.stroke.apply(this,arguments)},hasChecked:function(){var treeObj=this.nodes;return treeObj.getCheckedNodes(!0).length>0},checkAll:function(checked){function setNode(children){BI.each(children,function(i,child){child.halfCheck=!1,setNode(child.children)})}this.nodes&&(BI.each(this.nodes.getNodes(),function(i,node){node.halfCheck=!1,setNode(node.children)}),this.nodes.checkAllNodes(checked))},expandAll:function(flag){this.nodes&&this.nodes.expandAll(flag)},setValue:function(value,param){this.checkAll(!1),this.updateValue(value,param),this.refresh()},setSelectedValue:function(value){this.options.paras.selectedValues=BI.deepClone(value||{})},updateValue:function(values,param){if(this.nodes){param||(param="value");var treeObj=this.nodes;BI.each(values,function(v,op){var nodes=treeObj.getNodesByParam(param,v,null);BI.each(nodes,function(j,node){BI.extend(node,{checked:!0},op),treeObj.updateNode(node)})})}},refresh:function(){this.nodes&&this.nodes.refresh()},getValue:function(){return this.nodes?this._getSelectedValues():null},destroyed:function(){this.stop(),this.nodes&&this.nodes.destroy()}}),BI.extend(BI.TreeView,{REQ_TYPE_INIT_DATA:1,REQ_TYPE_ADJUST_DATA:2,REQ_TYPE_SELECT_DATA:3,REQ_TYPE_GET_SELECTED_DATA:4}),BI.TreeView.EVENT_CHANGE="EVENT_CHANGE",BI.TreeView.EVENT_INIT=BI.Events.INIT,BI.TreeView.EVENT_AFTERINIT=BI.Events.AFTERINIT,BI.shortcut("bi.tree_view",BI.TreeView),BI.AsyncTree=BI.inherit(BI.TreeView,{_defaultConfig:function(){return BI.extend(BI.AsyncTree.superclass._defaultConfig.apply(this,arguments),{})},_init:function(){BI.AsyncTree.superclass._init.apply(this,arguments)},_configSetting:function(){function onClick(event,treeId,treeNode){var zTree=BI.$.fn.zTree.getZTreeObj(treeId),checked=treeNode.checked,status=treeNode.getCheckStatus();status.half===!0&&status.checked===!0&&(checked=!1),zTree.checkNode(treeNode,!checked,!0,!0)}function beforeCheck(treeId,treeNode){function track(children){BI.each(children,function(i,ch){ch.halfCheck===!0&&(ch.halfCheck=!1,track(ch.children))})}if(treeNode.halfCheck=!1,treeNode.checked===!0){track(treeNode.children);var treeObj=BI.$.fn.zTree.getZTreeObj(treeId),nodes=treeObj.getSelectedNodes();BI.each(nodes,function(index,node){node.halfCheck=!1})}var status=treeNode.getCheckStatus();status.half===!0&&status.checked===!0&&(treeNode.checked=!1)}function beforeExpand(treeId,treeNode){self._beforeExpandNode(treeId,treeNode)}function onCheck(event,treeId,treeNode){self._selectTreeNode(treeId,treeNode)}function onExpand(event,treeId,treeNode){treeNode.halfCheck=!1}function onCollapse(event,treeId,treeNode){treeNode.halfCheck=!1}var paras=this.options.paras,self=this,setting={async:{enable:!1,otherParam:BI.cjkEncodeDO(paras)},check:{enable:!0},data:{key:{title:"title",name:"text"},simpleData:{enable:!0}},view:{showIcon:!1,expandSpeed:"",nameIsHTML:!0,dblClickExpand:!1},callback:{beforeCheck:beforeCheck,onCheck:onCheck,beforeExpand:beforeExpand,onExpand:onExpand,onCollapse:onCollapse,onClick:onClick}};return setting},_selectTreeNode:function(treeId,treeNode){var self=this,o=this.options,parentValues=BI.deepClone(treeNode.parentValues||self._getParentValues(treeNode)),name=this._getNodeValue(treeNode);if(treeNode.checked===!0);else{var tNode=treeNode,pNode=this._getTree(this.options.paras.selectedValues,parentValues);for(BI.isNotNull(pNode[name])&&delete pNode[name];null!=tNode&&BI.isEmpty(pNode);)parentValues=parentValues.slice(0,parentValues.length-1),tNode=tNode.getParentNode(),null!=tNode&&(pNode=this._getTree(this.options.paras.selectedValues,parentValues),name=this._getNodeValue(tNode),delete pNode[name])}BI.AsyncTree.superclass._selectTreeNode.apply(self,arguments)},_beforeExpandNode:function(treeId,treeNode){function callback(nodes,hasNext){self.nodes.addNodes(treeNode,nodes),hasNext===!0&&BI.delay(function(){times++,op.times=times,o.itemsCreator(op,complete)},100)}var self=this,o=this.options,parentValues=treeNode.parentValues||self._getParentValues(treeNode),op=BI.extend({},o.paras,{id:treeNode.id,times:1,parentValues:parentValues.concat(this._getNodeValue(treeNode)),checkState:treeNode.getCheckStatus()}),complete=function(d){var nodes=d.items||[];nodes.length>0&&callback(self._dealWidthNodes(nodes),!!d.hasNext)},times=1;treeNode.children||setTimeout(function(){o.itemsCreator(op,complete)},17)},_join:function(valueA,valueB){function track(parent,node,compare){BI.each(node,function(n,item){BI.isNull(compare[n])?self._addTreeNode(map,parent,n,item):BI.isEmpty(compare[n])?self._addTreeNode(map,parent,n,{}):track(parent.concat([n]),node[n],compare[n])})}var self=this,map={};return track([],valueA,valueB),track([],valueB,valueA),map},hasChecked:function(){return!BI.isEmpty(this.options.paras.selectedValues)||BI.AsyncTree.superclass.hasChecked.apply(this,arguments)},_getJoinValue:function(){if(!this.nodes)return{};var checkedValues=this._getSelectedValues();return BI.isEmpty(checkedValues)?BI.deepClone(this.options.paras.selectedValues):BI.isEmpty(this.options.paras.selectedValues)?checkedValues:this._join(checkedValues,this.options.paras.selectedValues)},getValue:function(){return this._getJoinValue()},stroke:function(config){delete this.options.keyword,BI.extend(this.options.paras,config);var setting=this._configSetting();this._initTree(setting)}}),BI.shortcut("bi.async_tree",BI.AsyncTree),BI.PartTree=BI.inherit(BI.AsyncTree,{_defaultConfig:function(){return BI.extend(BI.PartTree.superclass._defaultConfig.apply(this,arguments),{})},_init:function(){BI.PartTree.superclass._init.apply(this,arguments)},_loadMore:function(){var self=this,o=this.options,op=BI.extend({},o.paras,{type:BI.TreeView.REQ_TYPE_INIT_DATA,times:++this.times});this.tip.setLoading(),o.itemsCreator(op,function(d){var hasNext=!!d.hasNext,nodes=d.items||[];o.paras.lastSearchValue=d.lastSearchValue,self._stop!==!0&&(hasNext?self.tip.setLoaded():self.tip.setEnd(),nodes.length>0&&self.nodes.addNodes(null,self._dealWidthNodes(nodes)))})},_selectTreeNode:function(treeId,treeNode){var self=this,o=this.options,parentValues=BI.deepClone(treeNode.parentValues||self._getParentValues(treeNode)),name=this._getNodeValue(treeNode);if(treeNode.checked===!0)this.options.paras.selectedValues=this._getJoinValue(),o.itemsCreator(BI.extend({},o.paras,{type:BI.TreeView.REQ_TYPE_ADJUST_DATA,curSelectedValue:name,parentValues:parentValues}),function(res){self.options.paras.selectedValues=res,BI.AsyncTree.superclass._selectTreeNode.apply(self,arguments)});else{for(var t=this.options.paras.selectedValues,p=parentValues.concat(name),i=0,len=p.length;i0?self._dealWidthNodes(nodes):[]),self.setTipVisible(nodes.length<=0),self.loaded(),hasNext?self.tip.setLoaded():self.tip.invisible(),self.fireEvent(BI.Events.AFTERINIT)}};BI.delay(function(){o.itemsCreator(op,complete)},100)},getValue:function(){return BI.deepClone(this.options.paras.selectedValues||{})},stroke:function(config){var o=this.options;delete o.paras.keyword,BI.extend(o.paras,config),delete o.paras.lastSearchValue;var setting=this._configSetting();this._initTree(setting,o.paras.keyword)}}),BI.shortcut("bi.part_tree",BI.PartTree),BI.ListTreeView=BI.inherit(BI.TreeView,{_constants:{SPLIT:"<|>"},_defaultConfig:function(){return BI.extend(BI.ListTreeView.superclass._defaultConfig.apply(this,arguments),{})},_init:function(){BI.ListTreeView.superclass._init.apply(this,arguments);var o=this.options;this.storeValue=o.value||{}},_configSetting:function(){function onClick(event,treeId,treeNode){var zTree=BI.$.fn.zTree.getZTreeObj(treeId),checked=treeNode.checked;self._checkValue(treeNode,!checked),zTree.checkNode(treeNode,!checked,!0,!0)}function onCheck(event,treeId,treeNode){self._selectTreeNode(treeId,treeNode)}var paras=this.options.paras,self=this,setting={async:{enable:!1},check:{enable:!0,chkboxType:{Y:"",N:""}},data:{key:{title:"title",name:"text"},simpleData:{enable:!0}},view:{showIcon:!1,expandSpeed:"",nameIsHTML:!0,dblClickExpand:!1},callback:{onCheck:onCheck,onClick:onClick}};return setting},_selectTreeNode:function(treeId,treeNode){this._checkValue(treeNode,treeNode.checked),BI.ListTreeView.superclass._selectTreeNode.apply(this,arguments)},_transArrayToMap:function(treeArrays){var self=this,map={};return BI.each(treeArrays,function(idx,array){var key=array.join(self._constants.SPLIT);map[key]=!0}),map},_transMapToArray:function(treeMap){var self=this,array=[];return BI.each(treeMap,function(key){var item=key.split(self._constants.SPLIT);array.push(item)}),array},_checkValue:function(treeNode,checked){var key=BI.concat(this._getParentValues(treeNode),this._getNodeValue(treeNode)).join(this._constants.SPLIT);checked?this.storeValue[key]=!0:delete this.storeValue[key]},setSelectedValue:function(value){this.options.paras.selectedValues=value||[],this.storeValue=this._transArrayToMap(value)},getValue:function(){return this._transMapToArray(this.storeValue)}}),BI.shortcut("bi.list_tree_view",BI.ListTreeView),BI.ListAsyncTree=BI.inherit(BI.ListTreeView,{_defaultConfig:function(){return BI.extend(BI.ListAsyncTree.superclass._defaultConfig.apply(this,arguments),{})},_init:function(){BI.ListAsyncTree.superclass._init.apply(this,arguments)},_configSetting:function(){function beforeCheck(treeId,treeNode){treeNode.half=!1}function onClick(event,treeId,treeNode){var zTree=BI.$.fn.zTree.getZTreeObj(treeId),checked=treeNode.checked;self._checkValue(treeNode,!checked),zTree.checkNode(treeNode,!checked,!0,!0)}function beforeExpand(treeId,treeNode){self._beforeExpandNode(treeId,treeNode)}function onCheck(event,treeId,treeNode){self._selectTreeNode(treeId,treeNode)}var paras=this.options.paras,self=this,setting={async:{enable:!1,otherParam:BI.cjkEncodeDO(paras)},check:{enable:!0,chkboxType:{Y:"",N:""}},data:{key:{title:"title",name:"text"},simpleData:{enable:!0}},view:{showIcon:!1,expandSpeed:"",nameIsHTML:!0,dblClickExpand:!1},callback:{onCheck:onCheck,beforeExpand:beforeExpand,beforeCheck:beforeCheck,onClick:onClick}};return setting},_beforeExpandNode:function(treeId,treeNode){function callback(nodes,hasNext){self.nodes.addNodes(treeNode,nodes),hasNext===!0&&BI.delay(function(){times++,op.times=times,o.itemsCreator(op,complete)},100)}var self=this,o=this.options,parentValues=treeNode.parentValues||self._getParentValues(treeNode),op=BI.extend({},o.paras,{id:treeNode.id,times:1,parentValues:parentValues.concat(this._getNodeValue(treeNode))}),complete=function(d){var nodes=d.items||[];nodes.length>0&&callback(self._dealWidthNodes(nodes),!!d.hasNext)},times=1;treeNode.children||setTimeout(function(){o.itemsCreator(op,complete)},17)},hasChecked:function(){return!BI.isEmpty(this.options.paras.selectedValues)||BI.ListAsyncTree.superclass.hasChecked.apply(this,arguments)},stroke:function(config){delete this.options.keyword,BI.extend(this.options.paras,config);var setting=this._configSetting();this._initTree(setting)}}),BI.shortcut("bi.list_async_tree",BI.ListAsyncTree),BI.ListPartTree=BI.inherit(BI.ListAsyncTree,{_defaultConfig:function(){return BI.extend(BI.ListPartTree.superclass._defaultConfig.apply(this,arguments),{})},_init:function(){BI.ListPartTree.superclass._init.apply(this,arguments)},_loadMore:function(){var self=this,o=this.options,op=BI.extend({},o.paras,{type:BI.TreeView.REQ_TYPE_INIT_DATA,times:++this.times});this.tip.setLoading(),o.itemsCreator(op,function(d){var hasNext=!!d.hasNext,nodes=d.items||[];o.paras.lastSearchValue=d.lastSearchValue,self._stop!==!0&&(hasNext?self.tip.setLoaded():self.tip.setEnd(),nodes.length>0&&self.nodes.addNodes(null,self._dealWidthNodes(nodes)))})},_initTree:function(setting,keyword){function callback(nodes){self._stop!==!0&&(self.nodes=BI.$.fn.zTree.init(tree.element,setting,nodes))}var self=this,o=this.options;this.times=1;var tree=this.tree;tree.empty(),self.tip.setVisible(!1),this.loading();var op=BI.extend({},o.paras,{type:BI.TreeView.REQ_TYPE_INIT_DATA,times:this.times}),complete=function(d){if(self._stop!==!0&&keyword==o.paras.keyword){var hasNext=!!d.hasNext,nodes=d.items||[];o.paras.lastSearchValue=d.lastSearchValue,callback(nodes.length>0?self._dealWidthNodes(nodes):[]),self.setTipVisible(nodes.length<=0),self.loaded(),hasNext?self.tip.setLoaded():self.tip.invisible(),self.fireEvent(BI.Events.AFTERINIT)}};BI.delay(function(){o.itemsCreator(op,complete)},100)},stroke:function(config){var o=this.options;delete o.paras.keyword,BI.extend(o.paras,config),delete o.paras.lastSearchValue;var setting=this._configSetting();this._initTree(setting,o.paras.keyword)}}),BI.shortcut("bi.list_part_tree",BI.ListPartTree),BI.prepares.push(function(){BI.Resizers=new BI.ResizeController,BI.Layers=new BI.LayerController,BI.Maskers=new BI.MaskersController,BI.Bubbles=new BI.BubblesController,BI.Tooltips=new BI.TooltipsController,BI.Popovers=new BI.PopoverController,BI.Broadcasts=new BI.BroadcastController,BI.StyleLoaders=new BI.StyleLoaderManager}),BI.CollectionView=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.CollectionView.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-collection",overflowX:!0,overflowY:!0,cellSizeAndPositionGetter:BI.emptyFn,horizontalOverscanSize:0,verticalOverscanSize:0,scrollLeft:0,scrollTop:0,items:[]})},_init:function(){BI.CollectionView.superclass._init.apply(this,arguments);var self=this,o=this.options;this.renderedCells=[],this.renderedKeys=[],this.renderRange={},this._scrollLock=!1,this._debounceRelease=BI.debounce(function(){self._scrollLock=!1},1e3/60),this.container=BI.createWidget({type:"bi.absolute"}),this.element.scroll(function(){self._scrollLock!==!0&&(o.scrollLeft=self.element.scrollLeft(),o.scrollTop=self.element.scrollTop(),self._calculateChildrenToRender(),self.fireEvent(BI.CollectionView.EVENT_SCROLL,{scrollLeft:o.scrollLeft,scrollTop:o.scrollTop}))}),BI.createWidget({type:"bi.vertical",element:this,scrollable:o.overflowX===!0&&o.overflowY===!0,scrolly:o.overflowX===!1&&o.overflowY===!0,scrollx:o.overflowX===!0&&o.overflowY===!1,items:[this.container]}),o.items.length>0&&(this._calculateSizeAndPositionData(),this._populate())},mounted:function(){var o=this.options;0===o.scrollLeft&&0===o.scrollTop||(this.element.scrollTop(o.scrollTop),this.element.scrollLeft(o.scrollLeft))},_calculateSizeAndPositionData:function(){for(var o=this.options,cellMetadata=[],sectionManager=new BI.SectionManager,height=0,width=0,index=0,len=o.items.length;index0&&bottom>0){if(top>=this.renderRange.minY&&bottom<=this.renderRange.maxY&&left>=this.renderRange.minX&&right<=this.renderRange.maxX)return;for(var childrenToDisplay=this._cellRenderers(bottom-top,right-left,left,top),renderedCells=[],renderedKeys={},renderedWidgets={},lefts={},tops={},i=0,len=childrenToDisplay.length;i=0?(datum.width!==this.renderedCells[index]._width&&(this.renderedCells[index]._width=datum.width,this.renderedCells[index].el.setWidth(datum.width)),datum.height!==this.renderedCells[index]._height&&(this.renderedCells[index]._height=datum.height,this.renderedCells[index].el.setHeight(datum.height)),this.renderedCells[index]._left!==datum.x&&this.renderedCells[index].el.element.css("left",datum.x+"px"),this.renderedCells[index]._top!==datum.y&&this.renderedCells[index].el.element.css("top",datum.y+"px"),renderedCells.push(child=this.renderedCells[index])):(child=BI.createWidget(BI.extend({type:"bi.label",width:datum.width,height:datum.height},o.items[datum.index],{cls:(o.items[datum.index].cls||"")+" container-cell"+(0===datum.y?" first-row":"")+(0===datum.x?" first-col":""),_left:datum.x,_top:datum.y})),renderedCells.push({el:child,left:datum.x,top:datum.y,_left:datum.x,_top:datum.y,_width:datum.width,_height:datum.height}));for(var startTopIndex=0|topMap[datum.y],endTopIndex=0|topMap[datum.y+datum.height],k=startTopIndex;k<=endTopIndex;k++){var t=tops[k];assertMinBorder(leftBorder,t),assertMaxBorder(rightBorder,t),leftBorder[t]=Math.min(leftBorder[t],datum.x),rightBorder[t]=Math.max(rightBorder[t],datum.x+datum.width)}for(var startLeftIndex=0|leftMap[datum.x],endLeftIndex=0|leftMap[datum.x+datum.width],k=startLeftIndex;k<=endLeftIndex;k++){var l=lefts[k];assertMinBorder(topBorder,l),assertMaxBorder(bottomBorder,l),topBorder[l]=Math.min(topBorder[l],datum.y),bottomBorder[l]=Math.max(bottomBorder[l],datum.y+datum.height)}renderedKeys[datum.index]=[datum.index,i],renderedWidgets[i]=child}var existSet={},addSet={},deleteArray=[];BI.each(renderedKeys,function(i,key){self.renderedKeys[i]?existSet[i]=key:addSet[i]=key}),BI.each(this.renderedKeys,function(i,key){existSet[i]||addSet[i]||deleteArray.push(key[1])}),BI.each(deleteArray,function(i,index){self.renderedCells[index].el._destroy()});var addedItems=[];BI.each(addSet,function(index,key){addedItems.push(renderedCells[key[1]])}),this.container.addItems(addedItems),this.container._children=renderedWidgets,this.container.attr("items",renderedCells),this.renderedCells=renderedCells,this.renderedKeys=renderedKeys;var minX=BI.min(leftBorder),maxX=BI.max(rightBorder),minY=BI.max(topBorder),maxY=BI.min(bottomBorder);this.renderRange={minX:minX,minY:minY,maxX:maxX,maxY:maxY}}},_getMaxScrollLeft:function(){return Math.max(0,this._width-this.options.width+(this.options.overflowX?BI.DOM.getScrollWidth():0))},_getMaxScrollTop:function(){return Math.max(0,this._height-this.options.height+(this.options.overflowY?BI.DOM.getScrollWidth():0))},_populate:function(items){var o=this.options;if(this._reRange(),items&&items!==this.options.items&&(this.options.items=items,this._calculateSizeAndPositionData()),o.items.length>0){this.container.setWidth(this._width),this.container.setHeight(this._height),this._calculateChildrenToRender();try{this.element.scrollTop(o.scrollTop),this.element.scrollLeft(o.scrollLeft)}catch(e){}}},setScrollLeft:function(scrollLeft){this.options.scrollLeft!==scrollLeft&&(this._scrollLock=!0,this.options.scrollLeft=BI.clamp(scrollLeft||0,0,this._getMaxScrollLeft()),this._debounceRelease(),this._calculateChildrenToRender(),this.element.scrollLeft(this.options.scrollLeft))},setScrollTop:function(scrollTop){this.options.scrollTop!==scrollTop&&(this._scrollLock=!0,this.options.scrollTop=BI.clamp(scrollTop||0,0,this._getMaxScrollTop()),this._debounceRelease(),this._calculateChildrenToRender(),this.element.scrollTop(this.options.scrollTop))},setOverflowX:function(b){var self=this;this.options.overflowX!==!!b&&(this.options.overflowX=!!b,BI.nextTick(function(){self.element.css({overflowX:b?"auto":"hidden"})}))},setOverflowY:function(b){var self=this;this.options.overflowY!==!!b&&(this.options.overflowY=!!b,BI.nextTick(function(){self.element.css({overflowY:b?"auto":"hidden"})}))},getScrollLeft:function(){return this.options.scrollLeft},getScrollTop:function(){return this.options.scrollTop},getMaxScrollLeft:function(){return this._getMaxScrollLeft()},getMaxScrollTop:function(){return this._getMaxScrollTop()},_reRange:function(){this.renderRange={}},_clearChildren:function(){this.container._children={},this.container.attr("items",[])},restore:function(){BI.each(this.renderedCells,function(i,cell){cell.el._destroy()}),this._clearChildren(),this.renderedCells=[],this.renderedKeys=[],this.renderRange={},this._scrollLock=!1},populate:function(items){items&&items!==this.options.items&&this.restore(),this._populate(items)}}),BI.CollectionView.EVENT_SCROLL="EVENT_SCROLL",BI.shortcut("bi.collection_view",BI.CollectionView),BI.Combo=BI.inherit(BI.Widget,{_defaultConfig:function(){var conf=BI.Combo.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{baseCls:(conf.baseCls||"")+" bi-combo",trigger:"click",toggle:!0,direction:"bottom",logic:{dynamic:!0},container:null,isDefaultInit:!1,destroyWhenHide:!1,isNeedAdjustHeight:!0,isNeedAdjustWidth:!0,stopEvent:!1,stopPropagation:!1,adjustLength:0,adjustXOffset:0,adjustYOffset:0,hideChecker:BI.emptyFn,offsetStyle:"left",el:{},popup:{},comboClass:"bi-combo-popup",hoverClass:"bi-combo-hover"})},_init:function(){BI.Combo.superclass._init.apply(this,arguments);var self=this,o=this.options;this._initCombo(),this._initPullDownAction(),this.combo.on(BI.Controller.EVENT_CHANGE,function(type,value,obj){self.isEnabled()&&self.isValid()&&(type===BI.Events.EXPAND&&self._popupView(),type===BI.Events.COLLAPSE&&self._hideView(),type===BI.Events.EXPAND&&(self.fireEvent(BI.Controller.EVENT_CHANGE,arguments),self.fireEvent(BI.Combo.EVENT_EXPAND)),type===BI.Events.COLLAPSE&&(self.fireEvent(BI.Controller.EVENT_CHANGE,arguments),self.isViewVisible()&&self.fireEvent(BI.Combo.EVENT_COLLAPSE)),type===BI.Events.CLICK&&self.fireEvent(BI.Combo.EVENT_TRIGGER_CHANGE,obj))}),self.element.on("mouseenter."+self.getName(),function(e){self.isEnabled()&&self.isValid()&&self.combo.isEnabled()&&self.combo.isValid()&&self.element.addClass(o.hoverClass)}),self.element.on("mouseleave."+self.getName(),function(e){self.isEnabled()&&self.isValid()&&self.combo.isEnabled()&&self.combo.isValid()&&self.element.removeClass(o.hoverClass)}),BI.createWidget(BI.extend({element:this},BI.LogicFactory.createLogic("vertical",BI.extend(o.logic,{items:[{el:this.combo}]})))),o.isDefaultInit&&this._assertPopupView(),BI.Resizers.add(this.getName(),BI.bind(function(){this.isViewVisible()&&this._hideView()},this))},_toggle:function(){this._assertPopupViewRender(),this.popupView.isVisible()?this._hideView():this.isEnabled()&&this._popupView()},_initPullDownAction:function(){function hide(){self.isEnabled()&&self.isValid()&&self.combo.isEnabled()&&self.combo.isValid()&&o.toggle===!0&&(self._hideView(),self.fireEvent(BI.Controller.EVENT_CHANGE,BI.Events.COLLAPSE,"",self.combo),self.fireEvent(BI.Combo.EVENT_COLLAPSE)),self.popupView&&self.popupView.element.off("mouseenter."+self.getName()).off("mouseleave."+self.getName()),enterPopup=!1}var self=this,o=this.options,evs=(this.options.trigger||"").split(","),st=function(e){o.stopEvent&&e.stopEvent(),o.stopPropagation&&e.stopPropagation()},enterPopup=!1;BI.each(evs,function(i,ev){switch(ev){case"hover":self.element.on("mouseenter."+self.getName(),function(e){self.isEnabled()&&self.isValid()&&self.combo.isEnabled()&&self.combo.isValid()&&(self._popupView(),self.fireEvent(BI.Controller.EVENT_CHANGE,BI.Events.EXPAND,"",self.combo),self.fireEvent(BI.Combo.EVENT_EXPAND))}),self.element.on("mouseleave."+self.getName(),function(e){self.popupView&&(self.popupView.element.on("mouseenter."+self.getName(),function(e){enterPopup=!0,self.popupView.element.on("mouseleave."+self.getName(),function(e){hide()}),self.popupView.element.off("mouseenter."+self.getName())}),BI.defer(function(){enterPopup||hide()},50))});break;case"click":var debounce=BI.debounce(function(e){self.combo.element.__isMouseInBounds__(e)&&self.isEnabled()&&self.isValid()&&self.combo.isEnabled()&&self.combo.isValid()&&(o.toggle?self._toggle():self._popupView(),self.isViewVisible()?(self.fireEvent(BI.Controller.EVENT_CHANGE,BI.Events.EXPAND,"",self.combo),self.fireEvent(BI.Combo.EVENT_EXPAND)):(self.fireEvent(BI.Controller.EVENT_CHANGE,BI.Events.COLLAPSE,"",self.combo),self.fireEvent(BI.Combo.EVENT_COLLAPSE)))},BI.EVENT_RESPONSE_TIME,{leading:!0,trailing:!1});self.element.off(ev+"."+self.getName()).on(ev+"."+self.getName(),function(e){debounce(e),st(e)});break;case"click-hover":var debounce=BI.debounce(function(e){self.combo.element.__isMouseInBounds__(e)&&self.isEnabled()&&self.isValid()&&self.combo.isEnabled()&&self.combo.isValid()&&(self._popupView(),self.isViewVisible()&&(self.fireEvent(BI.Controller.EVENT_CHANGE,BI.Events.EXPAND,"",self.combo),self.fireEvent(BI.Combo.EVENT_EXPAND)))},BI.EVENT_RESPONSE_TIME,{leading:!0,trailing:!1});self.element.off("click."+self.getName()).on("click."+self.getName(),function(e){debounce(e),st(e)}),self.element.on("mouseleave."+self.getName(),function(e){self.popupView&&(self.popupView.element.on("mouseenter."+self.getName(),function(e){enterPopup=!0,self.popupView.element.on("mouseleave."+self.getName(),function(e){hide()}),self.popupView.element.off("mouseenter."+self.getName())}),BI.defer(function(){enterPopup||hide()},50))})}})},_initCombo:function(){this.combo=BI.createWidget(this.options.el,{value:this.options.value})},_assertPopupView:function(){var self=this,o=this.options;null==this.popupView&&(this.popupView=BI.createWidget(this.options.popup,{type:"bi.popup_view",value:o.value},this),this.popupView.on(BI.Controller.EVENT_CHANGE,function(type,value,obj){type===BI.Events.CLICK&&(self.combo.setValue(self.getValue()),self.fireEvent(BI.Combo.EVENT_CHANGE,value,obj)),self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.popupView.setVisible(!1),BI.nextTick(function(){self.fireEvent(BI.Combo.EVENT_AFTER_INIT)}))},_assertPopupViewRender:function(){this._assertPopupView(),this._rendered||(BI.createWidget({type:"bi.vertical",scrolly:!1,element:this.options.container||this,items:[{el:this.popupView}]}),this._rendered=!0)},_hideIf:function(e){if(this.element.find(e.target).length>0||this.popupView&&this.popupView.element.find(e.target).length>0||"CodeMirror-cursor"===e.target.className||BI.Widget._renderEngine.createElement(e.target).closest(".CodeMirror-hints").length>0){var directions=this.options.direction.split(",");return void((BI.contains(directions,"innerLeft")||BI.contains(directions,"innerRight"))&&(this.adjustWidth(),this.adjustHeight()))}var isHide=this.options.hideChecker.apply(this,[e]);isHide!==!1&&this._hideView()},_hideView:function(){this.fireEvent(BI.Combo.EVENT_BEFORE_HIDEVIEW),this.options.destroyWhenHide===!0?(this.popupView&&this.popupView.destroy(),this.popupView=null,this._rendered=!1):this.popupView&&this.popupView.invisible(),this.element.removeClass(this.options.comboClass),BI.Widget._renderEngine.createElement(document).unbind("mousedown."+this.getName()).unbind("mousewheel."+this.getName()),this.fireEvent(BI.Combo.EVENT_AFTER_HIDEVIEW)},_popupView:function(e){this._assertPopupViewRender(),this.fireEvent(BI.Combo.EVENT_BEFORE_POPUPVIEW),this.popupView.visible(),this.adjustWidth(e),this.adjustHeight(e),this.element.addClass(this.options.comboClass),BI.Widget._renderEngine.createElement(document).unbind("mousedown."+this.getName()).unbind("mousewheel."+this.getName()),BI.Widget._renderEngine.createElement(document).bind("mousedown."+this.getName(),BI.bind(this._hideIf,this)).bind("mousewheel."+this.getName(),BI.bind(this._hideIf,this)),this.fireEvent(BI.Combo.EVENT_AFTER_POPUPVIEW)},adjustWidth:function(e){var o=this.options;if(this.popupView&&o.isNeedAdjustWidth===!0){this.resetListWidth("");var width=this.popupView.element.outerWidth(),maxW=this.element.outerWidth()||o.width;width>maxW+80?maxW+=80:width>maxW&&(maxW=width),this.resetListWidth(maxW<100?100:maxW)}},adjustHeight:function(e){var o=this.options,p={};if(this.popupView){var isVisible=this.popupView.isVisible();this.popupView.visible();var combo=BI.isNotNull(e)?{element:{offset:function(){return{left:e.pageX,top:e.pageY}},bounds:function(){return{x:e.offsetX,y:e.offsetY,width:0,height:24}},outerWidth:function(){return 0},outerHeight:function(){return 24}}}:this.combo;switch(o.direction){case"bottom":case"bottom,right":p=BI.DOM.getComboPosition(combo,this.popupView,o.adjustXOffset,o.adjustYOffset||o.adjustLength,o.isNeedAdjustHeight,["bottom","top","right","left"],o.offsetStyle);break;case"top":case"top,right":p=BI.DOM.getComboPosition(combo,this.popupView,o.adjustXOffset,o.adjustYOffset||o.adjustLength,o.isNeedAdjustHeight,["top","bottom","right","left"],o.offsetStyle);break;case"left":case"left,bottom":p=BI.DOM.getComboPosition(combo,this.popupView,o.adjustXOffset||o.adjustLength,o.adjustYOffset,o.isNeedAdjustHeight,["left","right","bottom","top"],o.offsetStyle);break;case"right":case"right,bottom":p=BI.DOM.getComboPosition(combo,this.popupView,o.adjustXOffset||o.adjustLength,o.adjustYOffset,o.isNeedAdjustHeight,["right","left","bottom","top"],o.offsetStyle);break;case"top,left":p=BI.DOM.getComboPosition(combo,this.popupView,o.adjustXOffset,o.adjustYOffset||o.adjustLength,o.isNeedAdjustHeight,["top","bottom","left","right"],o.offsetStyle);break;case"bottom,left":p=BI.DOM.getComboPosition(combo,this.popupView,o.adjustXOffset,o.adjustYOffset||o.adjustLength,o.isNeedAdjustHeight,["bottom","top","left","right"],o.offsetStyle);break;case"left,top":p=BI.DOM.getComboPosition(combo,this.popupView,o.adjustXOffset||o.adjustLength,o.adjustYOffset,o.isNeedAdjustHeight,["left","right","top","bottom"],o.offsetStyle);break;case"right,top":p=BI.DOM.getComboPosition(combo,this.popupView,o.adjustXOffset||o.adjustLength,o.adjustYOffset,o.isNeedAdjustHeight,["right","left","top","bottom"],o.offsetStyle);break;case"right,innerRight":p=BI.DOM.getComboPosition(combo,this.popupView,o.adjustXOffset||o.adjustLength,o.adjustYOffset,o.isNeedAdjustHeight,["right","left","innerRight","innerLeft","bottom","top"],o.offsetStyle);break;case"right,innerLeft":p=BI.DOM.getComboPosition(combo,this.popupView,o.adjustXOffset||o.adjustLength,o.adjustYOffset,o.isNeedAdjustHeight,["right","left","innerLeft","innerRight","bottom","top"],o.offsetStyle);break;case"innerRight":p=BI.DOM.getComboPosition(combo,this.popupView,o.adjustXOffset||o.adjustLength,o.adjustYOffset,o.isNeedAdjustHeight,["innerRight","innerLeft","right","left","bottom","top"],o.offsetStyle);break;case"innerLeft":p=BI.DOM.getComboPosition(combo,this.popupView,o.adjustXOffset||o.adjustLength,o.adjustYOffset,o.isNeedAdjustHeight,["innerLeft","innerRight","left","right","bottom","top"],o.offsetStyle);break;case"top,custom":case"custom,top":p=BI.DOM.getTopAdaptPosition(combo,this.popupView,o.adjustYOffset||o.adjustLength,o.isNeedAdjustHeight);break;case"custom,bottom":case"bottom,custom":p=BI.DOM.getBottomAdaptPosition(combo,this.popupView,o.adjustYOffset||o.adjustLength,o.isNeedAdjustHeight);break;case"left,custom":case"custom,left":p=BI.DOM.getLeftAdaptPosition(combo,this.popupView,o.adjustXOffset||o.adjustLength),delete p.top,delete p.adaptHeight;break;case"custom,right":case"right,custom":p=BI.DOM.getRightAdaptPosition(combo,this.popupView,o.adjustXOffset||o.adjustLength),delete p.top,delete p.adaptHeight}"adaptHeight"in p&&this.resetListHeight(p.adaptHeight),"left"in p&&this.popupView.element.css({left:p.left}),"top"in p&&this.popupView.element.css({top:p.top}),this.position=p,this.popupView.setVisible(isVisible)}},resetListHeight:function(h){this._assertPopupView(),this.popupView.resetHeight&&this.popupView.resetHeight(h)},resetListWidth:function(w){this._assertPopupView(),this.popupView.resetWidth&&this.popupView.resetWidth(w)},populate:function(items){this._assertPopupView(),this.popupView.populate.apply(this.popupView,arguments),this.combo.populate.apply(this.combo,arguments)},_setEnable:function(arg){BI.Combo.superclass._setEnable.apply(this,arguments),arg===!0?this.element.removeClass("base-disabled disabled"):arg===!1&&this.element.addClass("base-disabled disabled"),!arg&&this.element.removeClass(this.options.hoverClass),!arg&&this.isViewVisible()&&this._hideView()},setValue:function(v){this.combo.setValue(v),BI.isNull(this.popupView)?this.options.popup.value=v:this.popupView.setValue(v)},getValue:function(){return BI.isNull(this.popupView)?this.options.popup.value:this.popupView.getValue()},isViewVisible:function(){return this.isEnabled()&&this.combo.isEnabled()&&!!this.popupView&&this.popupView.isVisible()},showView:function(e){this.isEnabled()&&this.combo.isEnabled()&&!this.isViewVisible()&&this._popupView(e)},hideView:function(){this._hideView()},getView:function(){return this.popupView},getPopupPosition:function(){return this.position},toggle:function(){this._toggle()},destroyed:function(){BI.Widget._renderEngine.createElement(document).unbind("mousedown."+this.getName()).unbind("mousewheel."+this.getName()).unbind("mouseenter."+this.getName()).unbind("mousemove."+this.getName()).unbind("mouseleave."+this.getName()),BI.Resizers.remove(this.getName())}}),BI.Combo.EVENT_TRIGGER_CHANGE="EVENT_TRIGGER_CHANGE",BI.Combo.EVENT_CHANGE="EVENT_CHANGE",BI.Combo.EVENT_EXPAND="EVENT_EXPAND",BI.Combo.EVENT_COLLAPSE="EVENT_COLLAPSE",BI.Combo.EVENT_AFTER_INIT="EVENT_AFTER_INIT",BI.Combo.EVENT_BEFORE_POPUPVIEW="EVENT_BEFORE_POPUPVIEW",BI.Combo.EVENT_AFTER_POPUPVIEW="EVENT_AFTER_POPUPVIEW",BI.Combo.EVENT_BEFORE_HIDEVIEW="EVENT_BEFORE_HIDEVIEW",BI.Combo.EVENT_AFTER_HIDEVIEW="EVENT_AFTER_HIDEVIEW",BI.shortcut("bi.combo",BI.Combo),BI.Expander=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.Expander.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-expander",trigger:"click",toggle:!0,isDefaultInit:!1,el:{},popup:{},expanderClass:"bi-expander-popup",hoverClass:"bi-expander-hover"})},_init:function(){BI.Expander.superclass._init.apply(this,arguments);var self=this,o=this.options;this._expanded=!!o.el.open,this._initExpander(),this._initPullDownAction(),this.expander.on(BI.Controller.EVENT_CHANGE,function(type,value,obj){self.isEnabled()&&self.isValid()&&(type===BI.Events.EXPAND&&self._popupView(),type===BI.Events.COLLAPSE&&self._hideView(),type===BI.Events.EXPAND&&(self.fireEvent(BI.Controller.EVENT_CHANGE,arguments),self.fireEvent(BI.Expander.EVENT_EXPAND)),type===BI.Events.COLLAPSE&&(self.fireEvent(BI.Controller.EVENT_CHANGE,arguments),self.isViewVisible()&&self.fireEvent(BI.Expander.EVENT_COLLAPSE)),type===BI.Events.CLICK&&self.fireEvent(BI.Expander.EVENT_TRIGGER_CHANGE,value,obj))}),this.element.hover(function(){self.isEnabled()&&self.isValid()&&self.expander.isEnabled()&&self.expander.isValid()&&self.element.addClass(o.hoverClass)},function(){self.isEnabled()&&self.isValid()&&self.expander.isEnabled()&&self.expander.isValid()&&self.element.removeClass(o.hoverClass)}),BI.createWidget({type:"bi.vertical",scrolly:!1,element:this,items:[{el:this.expander}]}),o.isDefaultInit&&this._assertPopupView(),this.expander.isOpened()===!0&&this._popupView()},_toggle:function(){this._assertPopupViewRender(),this.popupView.isVisible()?this._hideView():this.isEnabled()&&this._popupView()},_initPullDownAction:function(){var self=this,o=this.options,evs=this.options.trigger.split(",");BI.each(evs,function(i,e){switch(e){case"hover":self.element[e](function(e){self.isEnabled()&&self.isValid()&&self.expander.isEnabled()&&self.expander.isValid()&&(self._popupView(),self.fireEvent(BI.Controller.EVENT_CHANGE,BI.Events.EXPAND,"",self.expander),self.fireEvent(BI.Expander.EVENT_EXPAND))},function(){self.isEnabled()&&self.isValid()&&self.expander.isEnabled()&&self.expander.isValid()&&o.toggle&&(self._hideView(),self.fireEvent(BI.Controller.EVENT_CHANGE,BI.Events.COLLAPSE,"",self.expander),self.fireEvent(BI.Expander.EVENT_COLLAPSE))});break;case"click":e&&self.element.off(e+"."+self.getName()).on(e+"."+self.getName(),BI.debounce(function(e){self.expander.element.__isMouseInBounds__(e)&&self.isEnabled()&&self.isValid()&&self.expander.isEnabled()&&self.expander.isValid()&&(o.toggle?self._toggle():self._popupView(),self.isExpanded()?(self.fireEvent(BI.Controller.EVENT_CHANGE,BI.Events.EXPAND,"",self.expander),self.fireEvent(BI.Expander.EVENT_EXPAND)):(self.fireEvent(BI.Controller.EVENT_CHANGE,BI.Events.COLLAPSE,"",self.expander),self.fireEvent(BI.Expander.EVENT_COLLAPSE)))},BI.EVENT_RESPONSE_TIME,{leading:!0,trailing:!1}))}})},_initExpander:function(){this.expander=BI.createWidget(this.options.el)},_assertPopupView:function(){var self=this,o=this.options;null==this.popupView&&(this.popupView=BI.createWidget(this.options.popup,{type:"bi.button_group",cls:"expander-popup",layouts:[{type:"bi.vertical",hgap:0,vgap:0}],value:o.value},this),this.popupView.on(BI.Controller.EVENT_CHANGE,function(type,value,obj){self.fireEvent(BI.Controller.EVENT_CHANGE,arguments),type===BI.Events.CLICK&&self.fireEvent(BI.Expander.EVENT_CHANGE,value,obj)}),this.popupView.setVisible(this.isExpanded()),BI.nextTick(function(){self.fireEvent(BI.Expander.EVENT_AFTER_INIT)}))},_assertPopupViewRender:function(){this._assertPopupView(),this._rendered||(BI.createWidget({type:"bi.vertical",scrolly:!1,element:this,items:[{el:this.popupView}]}),this._rendered=!0)},_hideView:function(){this.fireEvent(BI.Expander.EVENT_BEFORE_HIDEVIEW),this._expanded=!1,this.expander.setOpened(!1),this.popupView&&this.popupView.invisible(),this.element.removeClass(this.options.expanderClass),this.fireEvent(BI.Expander.EVENT_AFTER_HIDEVIEW)},_popupView:function(){this._assertPopupViewRender(),this.fireEvent(BI.Expander.EVENT_BEFORE_POPUPVIEW),this._expanded=!0,this.expander.setOpened(!0),this.popupView.visible(),this.element.addClass(this.options.expanderClass),this.fireEvent(BI.Expander.EVENT_AFTER_POPUPVIEW)},populate:function(items){this.popupView&&this.popupView.populate.apply(this.popupView,arguments),this.expander.populate.apply(this.expander,arguments)},_setEnable:function(arg){BI.Expander.superclass._setEnable.apply(this,arguments),!arg&&this.element.removeClass(this.options.hoverClass),!arg&&this.isViewVisible()&&this._hideView()},setValue:function(v){this.expander.setValue(v),BI.isNull(this.popupView)?this.options.popup.value=v:this.popupView.setValue(v)},getValue:function(){return BI.isNull(this.popupView)?this.options.popup.value:this.popupView.getValue()},isViewVisible:function(){return this.isEnabled()&&this.expander.isEnabled()&&!!this.popupView&&this.popupView.isVisible()},isExpanded:function(){return this._expanded},showView:function(){this.isEnabled()&&this.expander.isEnabled()&&this._popupView()},hideView:function(){this._hideView()},getView:function(){return this.popupView},getAllLeaves:function(){return this.popupView&&this.popupView.getAllLeaves()},getNodeById:function(id){return this.expander.options.id===id?this.expander:this.popupView&&this.popupView.getNodeById(id)},getNodeByValue:function(value){return this.expander.getValue()===value?this.expander:this.popupView&&this.popupView.getNodeByValue(value)},destroy:function(){BI.Expander.superclass.destroy.apply(this,arguments)}}),BI.Expander.EVENT_EXPAND="EVENT_EXPAND",BI.Expander.EVENT_COLLAPSE="EVENT_COLLAPSE",BI.Expander.EVENT_TRIGGER_CHANGE="EVENT_TRIGGER_CHANGE",BI.Expander.EVENT_CHANGE="EVENT_CHANGE",BI.Expander.EVENT_AFTER_INIT="EVENT_AFTER_INIT",BI.Expander.EVENT_BEFORE_POPUPVIEW="EVENT_BEFORE_POPUPVIEW",BI.Expander.EVENT_AFTER_POPUPVIEW="EVENT_AFTER_POPUPVIEW",BI.Expander.EVENT_BEFORE_HIDEVIEW="EVENT_BEFORE_HIDEVIEW",BI.Expander.EVENT_AFTER_HIDEVIEW="EVENT_AFTER_HIDEVIEW",BI.shortcut("bi.expander",BI.Expander),BI.ComboGroup=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.ComboGroup.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-combo-group bi-list-item",trigger:"click,hover",direction:"right",adjustLength:0,isDefaultInit:!1,isNeedAdjustHeight:!1,isNeedAdjustWidth:!1,el:{type:"bi.text_button",text:"",value:""},children:[],popup:{el:{type:"bi.button_tree",chooseType:0,layouts:[{type:"bi.vertical"}]}}})},_init:function(){BI.ComboGroup.superclass._init.apply(this,arguments),this._populate(this.options.el)},_populate:function(item){var self=this,o=this.options,children=o.children;if(BI.isEmpty(children))throw new Error("ComboGroup构造错误");BI.each(children,function(i,ch){var son=BI.formatEL(ch).el.children;ch=BI.formatEL(ch).el,BI.isEmpty(son)||(ch.el=BI.clone(ch),ch.children=son,ch.type="bi.combo_group",ch.action=o.action,ch.height=o.height,ch.direction=o.direction,ch.isDefaultInit=o.isDefaultInit,ch.isNeedAdjustHeight=o.isNeedAdjustHeight,ch.isNeedAdjustWidth=o.isNeedAdjustWidth,ch.adjustLength=o.adjustLength,ch.popup=o.popup)}),this.combo=BI.createWidget({type:"bi.combo",element:this,container:o.container,height:o.height,trigger:o.trigger,direction:o.direction,isDefaultInit:o.isDefaultInit,isNeedAdjustWidth:o.isNeedAdjustWidth,isNeedAdjustHeight:o.isNeedAdjustHeight,adjustLength:o.adjustLength,el:item,popup:BI.extend({},o.popup,{el:BI.extend({items:children},o.popup.el)})}),this.combo.on(BI.Controller.EVENT_CHANGE,function(type,value,obj){self.fireEvent(BI.Controller.EVENT_CHANGE,arguments),type===BI.Events.CLICK&&self.fireEvent(BI.ComboGroup.EVENT_CHANGE,obj)})},getValue:function(){return this.combo.getValue()},setValue:function(v){this.combo.setValue(v)}}),BI.ComboGroup.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.combo_group",BI.ComboGroup),BI.VirtualGroup=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.VirtualGroup.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-virtual-group",items:[],layouts:[{type:"bi.center",hgap:0,vgap:0}]})},render:function(){var o=this.options;this.populate(o.items),BI.isKey(o.value)&&this.setValue(o.value)},_packageBtns:function(items){for(var o=this.options,map=this.buttonMap={},i=o.layouts.length-1;i>0;i--)items=BI.map(items,function(k,it){var el=BI.stripEL(it);return BI.extend({},o.layouts[i],{items:[BI.extend({},o.layouts[i].el,{el:BI.extend({ref:function(_ref){BI.isKey(map[el.value])&&(map[el.value]=_ref)}},el)})]})});return items},_packageLayout:function(items){for(var o=this.options,layout=BI.deepClone(o.layouts[0]),lay=BI.formatEL(layout).el;lay&&lay.items&&!BI.isEmpty(lay.items);)lay=BI.formatEL(lay.items[0]).el;return lay.items=items,layout},addItems:function(items){this.layouts.addItems(items)},prependItems:function(items){this.layouts.prependItems(items)},setValue:function(v){v=BI.isArray(v)?v:[v],BI.each(this.buttonMap,function(key,item){item&&(v.deepContains(key)?item.setSelected&&item.setSelected(!0):item.setSelected&&item.setSelected(!1))})},getNotSelectedValue:function(){var v=[];return BI.each(this.buttonMap,function(i,item){item&&(!item.isEnabled()||item.isSelected&&item.isSelected()||v.push(item.getValue()))}),v},getValue:function(){var v=[];return BI.each(this.buttonMap,function(i,item){item&&item.isEnabled()&&item.isSelected&&item.isSelected()&&v.push(item.getValue())}),v},populate:function(items){var self=this;items=items||[],this.options.items=items,items=this._packageBtns(items),this.layouts?this.layouts.populate(items):this.layouts=BI.createWidget(BI.extend({element:this},this._packageLayout(items)))}}),BI.VirtualGroup.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.virtual_group",BI.VirtualGroup),BI.Loader=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.Loader.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-loader",direction:"top",isDefaultInit:!0,logic:{dynamic:!0,scrolly:!0},el:{type:"bi.button_group"},items:[],itemsCreator:BI.emptyFn,onLoaded:BI.emptyFn,count:!1,prev:!1,next:{},hasPrev:BI.emptyFn,hasNext:BI.emptyFn})},_prevLoad:function(){var self=this,o=this.options;this.prev.setLoading(),o.itemsCreator.apply(this,[{times:--this.times},function(){self.prev.setLoaded(),self.prependItems.apply(self,arguments)}])},_nextLoad:function(){var self=this,o=this.options;this.next.setLoading(),o.itemsCreator.apply(this,[{times:++this.times},function(){self.next.setLoaded(),self.addItems.apply(self,arguments)}])},_init:function(){BI.Loader.superclass._init.apply(this,arguments);var self=this,o=this.options;o.itemsCreator===!1&&(o.prev=!1,o.next=!1),o.prev!==!1&&(this.prev=BI.createWidget(BI.extend({type:"bi.loading_bar"},o.prev)),this.prev.on(BI.Controller.EVENT_CHANGE,function(type){type===BI.Events.CLICK&&self._prevLoad()})),this.button_group=BI.createWidget(o.el,{type:"bi.button_group",chooseType:0,items:o.items,behaviors:{},layouts:[{type:"bi.vertical"}],value:o.value}),this.button_group.on(BI.Controller.EVENT_CHANGE,function(type,value,obj){self.fireEvent(BI.Controller.EVENT_CHANGE,arguments),type===BI.Events.CLICK&&self.fireEvent(BI.Loader.EVENT_CHANGE,obj)}),o.next!==!1&&(this.next=BI.createWidget(BI.extend({type:"bi.loading_bar"},o.next)),this.next.on(BI.Controller.EVENT_CHANGE,function(type){type===BI.Events.CLICK&&self._nextLoad()})),BI.createWidget(BI.extend({element:this},BI.LogicFactory.createLogic(BI.LogicFactory.createLogicTypeByDirection(o.direction),BI.extend({scrolly:!0},o.logic,{items:BI.LogicFactory.createLogicItemsByDirection(o.direction,this.prev,this.button_group,this.next)})))),o.isDefaultInit&&BI.isEmpty(o.items)&&BI.nextTick(BI.bind(function(){o.isDefaultInit&&BI.isEmpty(o.items)&&this._populate()},this)),BI.isNotEmptyArray(o.items)&&this._populate(o.items)},hasPrev:function(){var o=this.options;return BI.isNumber(o.count)?this.count0&&args.push(keyword),BI.Maskers.show(self.getName()),self.popupView.populate.apply(self.popupView,args),o.isAutoSync&&o.adapter&&o.adapter.getValue&&self.popupView.setValue(o.adapter.getValue()),self.popupView.loaded&&self.popupView.loaded(),self.fireEvent(BI.Searcher.EVENT_SEARCHING)}})}},setAdapter:function(adapter){this.options.adapter=adapter,BI.Maskers.remove(this.getName())},doSearch:function(){this.isSearching()&&this._search()},stopSearch:function(){this._stopSearch();try{this.editor.blur()}catch(e){if(!this.editor.blur)throw new Error("editor没有实现blur方法")}finally{this.editor.setValue("")}},isSearching:function(){return this._isSearching},isViewVisible:function(){return this.editor.isEnabled()&&BI.Maskers.isVisible(this.getName())},getView:function(){return this.popupView},hasMatched:function(){return this._assertPopupView(),this.popupView.hasMatched()},adjustHeight:function(){BI.Maskers.has(this.getName())&&BI.Maskers.get(this.getName()).isVisible()&&BI.Maskers.show(this.getName())},adjustView:function(){this.isViewVisible()&&BI.Maskers.show(this.getName())},setValue:function(v){BI.isNull(this.popupView)?this.options.popup.value=v:this.popupView.setValue(v)},getKeyword:function(){return this.editor.getValue()},getKeywords:function(){return this.editor.getKeywords()},getValue:function(){var o=this.options;return o.isAutoSync&&o.adapter&&o.adapter.getValue?o.adapter.getValue():this.isSearching()?this.popupView.getValue():o.adapter&&o.adapter.getValue?o.adapter.getValue():BI.isNull(this.popupView)?o.popup.value:this.popupView.getValue()},populate:function(result,searchResult,keyword){var o=this.options;this._assertPopupView(),this.popupView.populate.apply(this.popupView,arguments),o.isAutoSync&&o.adapter&&o.adapter.getValue&&this.popupView.setValue(o.adapter.getValue())},empty:function(){this.popupView&&this.popupView.empty()},destroyed:function(){BI.Maskers.remove(this.getName())}}),BI.Searcher.EVENT_CHANGE="EVENT_CHANGE",BI.Searcher.EVENT_START="EVENT_START",BI.Searcher.EVENT_STOP="EVENT_STOP",BI.Searcher.EVENT_PAUSE="EVENT_PAUSE",BI.Searcher.EVENT_SEARCHING="EVENT_SEARCHING",BI.Searcher.EVENT_AFTER_INIT="EVENT_AFTER_INIT",BI.shortcut("bi.searcher",BI.Searcher),BI.Switcher=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.Switcher.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-switcher",direction:BI.Direction.Top,trigger:"click",toggle:!0,el:{},popup:{},adapter:null,masker:{},switcherClass:"bi-switcher-popup",hoverClass:"bi-switcher-hover"})},_init:function(){BI.Switcher.superclass._init.apply(this,arguments);var self=this,o=this.options;this._initSwitcher(),this._initPullDownAction(),this.switcher.on(BI.Controller.EVENT_CHANGE,function(type,value,obj){self.isEnabled()&&self.isValid()&&(type===BI.Events.EXPAND&&self._popupView(),type===BI.Events.COLLAPSE&&self._hideView(),type===BI.Events.EXPAND&&(self.fireEvent(BI.Controller.EVENT_CHANGE,arguments),self.fireEvent(BI.Switcher.EVENT_EXPAND)),type===BI.Events.COLLAPSE&&(self.fireEvent(BI.Controller.EVENT_CHANGE,arguments),self.isViewVisible()&&self.fireEvent(BI.Switcher.EVENT_COLLAPSE)),type===BI.Events.CLICK&&self.fireEvent(BI.Switcher.EVENT_TRIGGER_CHANGE,value,obj))}),this.element.hover(function(){self.isEnabled()&&self.switcher.isEnabled()&&self.element.addClass(o.hoverClass)},function(){self.isEnabled()&&self.switcher.isEnabled()&&self.element.removeClass(o.hoverClass)}),BI.createWidget({type:"bi.vertical",scrolly:!1,element:this,items:[{el:this.switcher}]}),o.isDefaultInit&&this._assertPopupView()},_toggle:function(){this._assertPopupView(),this.isExpanded()?this._hideView():this.isEnabled()&&this._popupView()},_initPullDownAction:function(){var self=this,o=this.options,evs=this.options.trigger.split(",");BI.each(evs,function(i,e){switch(e){case"hover":self.element[e](function(e){self.isEnabled()&&self.switcher.isEnabled()&&(self._popupView(),self.fireEvent(BI.Controller.EVENT_CHANGE,BI.Events.EXPAND,"",self.switcher),self.fireEvent(BI.Switcher.EVENT_EXPAND))},function(){self.isEnabled()&&self.switcher.isEnabled()&&o.toggle&&(self._hideView(),self.fireEvent(BI.Controller.EVENT_CHANGE,BI.Events.COLLAPSE,"",self.switcher),self.fireEvent(BI.Switcher.EVENT_COLLAPSE))});break;default:e&&self.element.off(e+"."+self.getName()).on(e+"."+self.getName(),BI.debounce(function(e){self.switcher.element.__isMouseInBounds__(e)&&self.isEnabled()&&self.switcher.isEnabled()&&(o.toggle?self._toggle():self._popupView(),self.isExpanded()?(self.fireEvent(BI.Controller.EVENT_CHANGE,BI.Events.EXPAND,"",self.switcher),self.fireEvent(BI.Switcher.EVENT_EXPAND)):(self.fireEvent(BI.Controller.EVENT_CHANGE,BI.Events.COLLAPSE,"",self.switcher),self.fireEvent(BI.Switcher.EVENT_COLLAPSE)))},BI.EVENT_RESPONSE_TIME,{leading:!0,trailing:!1}))}})},_initSwitcher:function(){this.switcher=BI.createWidget(this.options.el,{value:this.options.value})},_assertPopupView:function(){var self=this,o=this.options;this._created||(this.popupView=BI.createWidget(o.popup,{type:"bi.button_group",element:o.adapter&&BI.Maskers.create(this.getName(),o.adapter,BI.extend({container:this},o.masker)),cls:"switcher-popup",layouts:[{type:"bi.vertical",hgap:0,vgap:0}],value:o.value},this),this.popupView.on(BI.Controller.EVENT_CHANGE,function(type,value,obj){self.fireEvent(BI.Controller.EVENT_CHANGE,arguments),type===BI.Events.CLICK&&self.fireEvent(BI.Switcher.EVENT_CHANGE,value,obj)}),o.direction===BI.Direction.Custom||o.adapter||BI.createWidget({type:"bi.vertical",scrolly:!1,element:this,items:[{el:this.popupView}]}),this._created=!0,BI.nextTick(function(){self.fireEvent(BI.Switcher.EVENT_AFTER_INIT)}))},_hideView:function(){this.fireEvent(BI.Switcher.EVENT_BEFORE_HIDEVIEW);var self=this,o=this.options;o.adapter?BI.Maskers.hide(self.getName()):self.popupView&&self.popupView.setVisible(!1),BI.nextTick(function(){o.adapter?BI.Maskers.hide(self.getName()):self.popupView&&self.popupView.setVisible(!1),self.element.removeClass(o.switcherClass),self.fireEvent(BI.Switcher.EVENT_AFTER_HIDEVIEW)})},_popupView:function(){var self=this,o=this.options;this._assertPopupView(),this.fireEvent(BI.Switcher.EVENT_BEFORE_POPUPVIEW),o.adapter?BI.Maskers.show(this.getName()):self.popupView.setVisible(!0),BI.nextTick(function(name){o.adapter?BI.Maskers.show(name):self.popupView.setVisible(!0),self.element.addClass(o.switcherClass),self.fireEvent(BI.Switcher.EVENT_AFTER_POPUPVIEW)},this.getName())},populate:function(items){this._assertPopupView(),this.popupView.populate.apply(this.popupView,arguments),this.switcher.populate.apply(this.switcher,arguments)},_setEnable:function(arg){BI.Switcher.superclass._setEnable.apply(this,arguments),!arg&&this.isViewVisible()&&this._hideView()},setValue:function(v){this.switcher.setValue(v),BI.isNull(this.popupView)?this.options.popup.value=v:this.popupView.setValue(v)},getValue:function(){return BI.isNull(this.popupView)?this.options.popup.value:this.popupView.getValue()},setAdapter:function(adapter){this.options.adapter=adapter,BI.Maskers.remove(this.getName())},isViewVisible:function(){return this.isEnabled()&&this.switcher.isEnabled()&&(this.options.adapter?BI.Maskers.isVisible(this.getName()):this.popupView&&this.popupView.isVisible())},isExpanded:function(){return this.isViewVisible()},showView:function(){this.isEnabled()&&this.switcher.isEnabled()&&this._popupView()},hideView:function(){this._hideView()},getView:function(){return this.popupView},adjustView:function(){this.isViewVisible()&&BI.Maskers.show(this.getName())},getAllLeaves:function(){return this.popupView&&this.popupView.getAllLeaves()},getNodeById:function(id){return this.switcher.attr("id")===id?this.switcher:this.popupView&&this.popupView.getNodeById(id)},getNodeByValue:function(value){return this.switcher.getValue()===value?this.switcher:this.popupView&&this.popupView.getNodeByValue(value)},empty:function(){this.popupView&&this.popupView.empty()},destroy:function(){BI.Switcher.superclass.destroy.apply(this,arguments)}}),BI.Switcher.EVENT_EXPAND="EVENT_EXPAND",BI.Switcher.EVENT_COLLAPSE="EVENT_COLLAPSE",BI.Switcher.EVENT_TRIGGER_CHANGE="EVENT_TRIGGER_CHANGE",BI.Switcher.EVENT_CHANGE="EVENT_CHANGE",BI.Switcher.EVENT_AFTER_INIT="EVENT_AFTER_INIT",BI.Switcher.EVENT_BEFORE_POPUPVIEW="EVENT_BEFORE_POPUPVIEW",BI.Switcher.EVENT_AFTER_POPUPVIEW="EVENT_AFTER_POPUPVIEW",BI.Switcher.EVENT_BEFORE_HIDEVIEW="EVENT_BEFORE_HIDEVIEW",BI.Switcher.EVENT_AFTER_HIDEVIEW="EVENT_AFTER_HIDEVIEW",BI.shortcut("bi.switcher",BI.Switcher),BI.Tab=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.Tab.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-tab",direction:"top",single:!1,logic:{dynamic:!1},showIndex:!1,tab:!1,cardCreator:function(v){return BI.createWidget()}})},render:function(){var self=this,o=this.options;BI.isObject(o.tab)&&(this.tab=BI.createWidget(this.options.tab,{type:"bi.button_group"}),this.tab.on(BI.Controller.EVENT_CHANGE,function(type,value,obj){self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)})),this.cardMap={},this.layout=BI.createWidget({type:"bi.card"}),BI.createWidget(BI.extend({element:this},BI.LogicFactory.createLogic(BI.LogicFactory.createLogicTypeByDirection(o.direction),BI.extend({},o.logic,{items:BI.LogicFactory.createLogicItemsByDirection(o.direction,this.tab,this.layout)}))));var listener=new BI.ShowListener({eventObj:this.tab,cardLayout:this.layout,cardCreator:function(v){var card=o.cardCreator.apply(self,arguments);return self.cardMap[v]=card,card},afterCardShow:function(v){self._deleteOtherCards(v),self.curr=v}});listener.on(BI.ShowListener.EVENT_CHANGE,function(value){self.fireEvent(BI.Tab.EVENT_CHANGE,value,self)})},_deleteOtherCards:function(currCardName){var self=this,o=this.options;o.single===!0&&BI.each(this.cardMap,function(name,card){name!==currCardName+""&&(self.layout.deleteCardByName(name),delete self.cardMap[name])})},_assertCard:function(v){if(!this.layout.isCardExisted(v)){var card=this.options.cardCreator(v);this.cardMap[v]=card,this.layout.addCardByName(v,card)}},mounted:function(){var o=this.options;o.showIndex!==!1&&this.setSelect(o.showIndex)},setSelect:function(v){this.tab&&this.tab.setValue(v),this._assertCard(v),this.layout.showCardByName(v),this._deleteOtherCards(v),this.curr!==v&&(this.curr=v)},removeTab:function(cardname){var self=this,o=this.options;BI.any(this.cardMap,function(name,card){if(BI.isEqual(name,cardname+""))return self.layout.deleteCardByName(name),delete self.cardMap[name],!0})},getSelect:function(){return this.curr},getSelectedTab:function(){return this.layout.getShowingCard()},getTab:function(v){return this._assertCard(v),this.layout.getCardByName(v)},setValue:function(v){var card=this.layout.getShowingCard();card&&card.setValue(v)},getValue:function(){var card=this.layout.getShowingCard();if(card)return card.getValue()},populate:function(){var card=this.layout.getShowingCard();if(card)return card.populate&&card.populate.apply(card,arguments)},empty:function(){this.layout.deleteAllCard(),this.cardMap={}},destroy:function(){this.cardMap={},BI.Tab.superclass.destroy.apply(this,arguments)}}),BI.Tab.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.tab",BI.Tab),BI.EL=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.EL.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-el",el:{},layout:{}})},_init:function(){BI.EL.superclass._init.apply(this,arguments);var self=this,o=this.options;this.ele=BI.createWidget(o.el),BI.createWidget(o.layout,{type:"bi.adaptive",element:this,items:[this.ele]}),this.ele.on(BI.Controller.EVENT_CHANGE,function(){self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)})},setValue:function(v){this.ele.setValue(v)},getValue:function(){return this.ele.getValue()},populate:function(){this.ele.populate.apply(this,arguments)}}),BI.shortcut("bi.el",BI.EL),BI.Msg=function(){var messageShow,$mask,$pop,toastStack=[];return{alert:function(title,message,callback){this._show(!1,title,message,callback)},confirm:function(title,message,callback){this._show(!0,title,message,callback)},prompt:function(title,message,value,callback,min_width){},toast:function(message,options,context){options=options||{},context=context||BI.Widget._renderEngine.createElement("body");var level=options.level||"normal",autoClose=!!BI.isNull(options.autoClose)||options.autoClose,toast=BI.createWidget({type:"bi.toast",cls:"bi-message-animate bi-message-leave",level:level,autoClose:autoClose,text:message,listeners:[{eventName:BI.Toast.EVENT_DESTORY,action:function(){BI.remove(toastStack,toast.element);var _height=10;BI.each(toastStack,function(i,element){element.css({top:_height}),_height+=element.outerHeight()+10})}}]}),height=10;BI.each(toastStack,function(i,element){height+=element.outerHeight()+10}),BI.createWidget({type:"bi.absolute",element:context,items:[{el:toast,left:"50%",top:height}]}),toastStack.push(toast.element),toast.element.css({"margin-left":-1*toast.element.outerWidth()/2}),toast.element.removeClass("bi-message-leave").addClass("bi-message-enter"),autoClose&&BI.delay(function(){toast.element.removeClass("bi-message-enter").addClass("bi-message-leave"),toast.destroy()},5e3)},_show:function(hasCancel,title,message,callback){$mask=BI.Widget._renderEngine.createElement('
      ').css({position:"absolute",zIndex:BI.zIndex_tip-2,top:0,left:0,right:0,bottom:0,opacity:.5}).appendTo("body"),$pop=BI.Widget._renderEngine.createElement('
      ').css({position:"absolute",zIndex:BI.zIndex_tip-1,top:0,left:0,right:0,bottom:0}).appendTo("body");var close=function(){messageShow.destroy(),$mask.remove()},controlItems=[];hasCancel===!0&&controlItems.push({el:{type:"bi.button",text:BI.i18nText("BI-Basic_Cancel"),level:"ignore",handler:function(){close(),BI.isFunction(callback)&&callback.apply(null,[!1])}}}),controlItems.push({el:{type:"bi.button",text:BI.i18nText("BI-Basic_OK"),handler:function(){close(),BI.isFunction(callback)&&callback.apply(null,[!0])}}});var conf={element:$pop,type:"bi.center_adapt",items:[{type:"bi.border",cls:"bi-card",items:{north:{el:{type:"bi.border",cls:"bi-message-title bi-background",items:{center:{el:{type:"bi.label",cls:"bi-font-bold",text:title||BI.i18nText("BI-Basic_Prompt"),textAlign:"left",hgap:20,height:40}},east:{el:{type:"bi.icon_button",cls:"bi-message-close close-font",handler:function(){close(),BI.isFunction(callback)&&callback.apply(null,[!1])}},width:60}}},height:40},center:{el:{type:"bi.label",vgap:10,hgap:20,whiteSpace:"normal",text:message}},south:{el:{type:"bi.absolute",items:[{el:{type:"bi.right_vertical_adapt",lgap:10,items:controlItems},top:0,left:20,right:20,bottom:0}]},height:44}},width:450,height:200}]};messageShow=BI.createWidget(conf)}}}(),BI.GridView=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.GridView.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-grid-view",overflowX:!0,overflowY:!0,overscanColumnCount:0,overscanRowCount:0,rowHeightGetter:BI.emptyFn,columnWidthGetter:BI.emptyFn,scrollLeft:0,scrollTop:0,items:[]})},_init:function(){BI.GridView.superclass._init.apply(this,arguments);var self=this,o=this.options;this.renderedCells=[],this.renderedKeys=[],this.renderRange={},this._scrollLock=!1,this._debounceRelease=BI.debounce(function(){self._scrollLock=!1},1e3/60),this.container=BI.createWidget({type:"bi.absolute"}),this.element.scroll(function(){self._scrollLock!==!0&&(o.scrollLeft=self.element.scrollLeft(),o.scrollTop=self.element.scrollTop(),self._calculateChildrenToRender(),self.fireEvent(BI.GridView.EVENT_SCROLL,{scrollLeft:o.scrollLeft,scrollTop:o.scrollTop}))}),BI.createWidget({type:"bi.vertical",element:this,scrollable:o.overflowX===!0&&o.overflowY===!0,scrolly:o.overflowX===!1&&o.overflowY===!0,scrollx:o.overflowX===!0&&o.overflowY===!1,items:[this.container]}),o.items.length>0&&this._populate()},mounted:function(){var o=this.options;0===o.scrollLeft&&0===o.scrollTop||(this.element.scrollTop(o.scrollTop),this.element.scrollLeft(o.scrollLeft))},_getOverscanIndices:function(cellCount,overscanCellsCount,startIndex,stopIndex){return{overscanStartIndex:Math.max(0,startIndex-overscanCellsCount),overscanStopIndex:Math.min(cellCount-1,stopIndex+overscanCellsCount)}},_calculateChildrenToRender:function(){var self=this,o=this.options,width=o.width,height=o.height,scrollLeft=BI.clamp(o.scrollLeft,0,this._getMaxScrollLeft()),scrollTop=BI.clamp(o.scrollTop,0,this._getMaxScrollTop()),overscanColumnCount=o.overscanColumnCount,overscanRowCount=o.overscanRowCount;if(height>0&&width>0){var visibleColumnIndices=this._columnSizeAndPositionManager.getVisibleCellRange(width,scrollLeft),visibleRowIndices=this._rowSizeAndPositionManager.getVisibleCellRange(height,scrollTop);if(BI.isEmpty(visibleColumnIndices)||BI.isEmpty(visibleRowIndices))return;var horizontalOffsetAdjustment=this._columnSizeAndPositionManager.getOffsetAdjustment(width,scrollLeft),verticalOffsetAdjustment=this._rowSizeAndPositionManager.getOffsetAdjustment(height,scrollTop);this._renderedColumnStartIndex=visibleColumnIndices.start,this._renderedColumnStopIndex=visibleColumnIndices.stop,this._renderedRowStartIndex=visibleRowIndices.start,this._renderedRowStopIndex=visibleRowIndices.stop;var overscanColumnIndices=this._getOverscanIndices(this.columnCount,overscanColumnCount,this._renderedColumnStartIndex,this._renderedColumnStopIndex),overscanRowIndices=this._getOverscanIndices(this.rowCount,overscanRowCount,this._renderedRowStartIndex,this._renderedRowStopIndex),columnStartIndex=overscanColumnIndices.overscanStartIndex,columnStopIndex=overscanColumnIndices.overscanStopIndex,rowStartIndex=overscanRowIndices.overscanStartIndex,rowStopIndex=overscanRowIndices.overscanStopIndex,minRowDatum=this._rowSizeAndPositionManager.getSizeAndPositionOfCell(rowStartIndex),minColumnDatum=this._columnSizeAndPositionManager.getSizeAndPositionOfCell(columnStartIndex),maxRowDatum=this._rowSizeAndPositionManager.getSizeAndPositionOfCell(rowStopIndex),maxColumnDatum=this._columnSizeAndPositionManager.getSizeAndPositionOfCell(columnStopIndex),top=minRowDatum.offset+verticalOffsetAdjustment,left=minColumnDatum.offset+horizontalOffsetAdjustment,bottom=maxRowDatum.offset+verticalOffsetAdjustment+maxRowDatum.size,right=maxColumnDatum.offset+horizontalOffsetAdjustment+maxColumnDatum.size;if(top>=this.renderRange.minY&&bottom<=this.renderRange.maxY&&left>=this.renderRange.minX&&right<=this.renderRange.maxX)return;for(var renderedCells=[],renderedKeys={},renderedWidgets={},minX=this._getMaxScrollLeft(),minY=this._getMaxScrollTop(),maxX=0,maxY=0,count=0,rowIndex=rowStartIndex;rowIndex<=rowStopIndex;rowIndex++)for(var rowDatum=this._rowSizeAndPositionManager.getSizeAndPositionOfCell(rowIndex),columnIndex=columnStartIndex;columnIndex<=columnStopIndex;columnIndex++){var key=rowIndex+"-"+columnIndex,columnDatum=this._columnSizeAndPositionManager.getSizeAndPositionOfCell(columnIndex),index=this.renderedKeys[key]&&this.renderedKeys[key][2],child;index>=0?(columnDatum.size!==this.renderedCells[index]._width&&(this.renderedCells[index]._width=columnDatum.size,this.renderedCells[index].el.setWidth(columnDatum.size)),rowDatum.size!==this.renderedCells[index]._height&&(this.renderedCells[index]._height=rowDatum.size,this.renderedCells[index].el.setHeight(rowDatum.size)),this.renderedCells[index]._left!==columnDatum.offset+horizontalOffsetAdjustment&&this.renderedCells[index].el.element.css("left",columnDatum.offset+horizontalOffsetAdjustment+"px"),this.renderedCells[index]._top!==rowDatum.offset+verticalOffsetAdjustment&&this.renderedCells[index].el.element.css("top",rowDatum.offset+verticalOffsetAdjustment+"px"),renderedCells.push(child=this.renderedCells[index])):(child=BI.createWidget(BI.extend({type:"bi.label",width:columnDatum.size,height:rowDatum.size},o.items[rowIndex][columnIndex],{cls:(o.items[rowIndex][columnIndex].cls||"")+" grid-cell"+(0===rowIndex?" first-row":"")+(0===columnIndex?" first-col":""),_rowIndex:rowIndex,_columnIndex:columnIndex,_left:columnDatum.offset+horizontalOffsetAdjustment,_top:rowDatum.offset+verticalOffsetAdjustment}),this),renderedCells.push({el:child,left:columnDatum.offset+horizontalOffsetAdjustment,top:rowDatum.offset+verticalOffsetAdjustment,_left:columnDatum.offset+horizontalOffsetAdjustment,_top:rowDatum.offset+verticalOffsetAdjustment,_width:columnDatum.size,_height:rowDatum.size})),minX=Math.min(minX,columnDatum.offset+horizontalOffsetAdjustment),maxX=Math.max(maxX,columnDatum.offset+horizontalOffsetAdjustment+columnDatum.size),minY=Math.min(minY,rowDatum.offset+verticalOffsetAdjustment),maxY=Math.max(maxY,rowDatum.offset+verticalOffsetAdjustment+rowDatum.size),renderedKeys[key]=[rowIndex,columnIndex,count],renderedWidgets[count]=child,count++}var existSet={},addSet={},deleteArray=[];BI.each(renderedKeys,function(i,key){self.renderedKeys[i]?existSet[i]=key:addSet[i]=key}),BI.each(this.renderedKeys,function(i,key){existSet[i]||addSet[i]||deleteArray.push(key[2])}),BI.each(deleteArray,function(i,index){self.renderedCells[index].el._destroy()});var addedItems=[];BI.each(addSet,function(index,key){addedItems.push(renderedCells[key[2]])}),this.container.addItems(addedItems,this),this.container._children=renderedWidgets,this.container.attr("items",renderedCells),this.renderedCells=renderedCells,this.renderedKeys=renderedKeys,this.renderRange={minX:minX,minY:minY,maxX:maxX,maxY:maxY}}},_getRealMaxScrollLeft:function(){var o=this.options,totalWidth=0;return BI.count(0,this.columnCount,function(index){totalWidth+=o.columnWidthGetter(index)}),Math.max(0,totalWidth-this.options.width+(this.options.overflowX?BI.DOM.getScrollWidth():0))},_getMaxScrollLeft:function(){return Math.max(0,this._columnSizeAndPositionManager.getTotalSize()-this.options.width+(this.options.overflowX?BI.DOM.getScrollWidth():0))},_getMaxScrollTop:function(){return Math.max(0,this._rowSizeAndPositionManager.getTotalSize()-this.options.height+(this.options.overflowY?BI.DOM.getScrollWidth():0))},_populate:function(items){var self=this,o=this.options;this._reRange(),this.columnCount=0,this.rowCount=0,items&&items!==this.options.items&&(this.options.items=items),BI.isNumber(o.columnCount)?this.columnCount=o.columnCount:o.items.length>0&&(this.columnCount=o.items[0].length),BI.isNumber(o.rowCount)?this.rowCount=o.rowCount:this.rowCount=o.items.length,this.container.setWidth(this.columnCount*o.estimatedColumnSize),this.container.setHeight(this.rowCount*o.estimatedRowSize),this._columnSizeAndPositionManager=new BI.ScalingCellSizeAndPositionManager(this.columnCount,o.columnWidthGetter,o.estimatedColumnSize),this._rowSizeAndPositionManager=new BI.ScalingCellSizeAndPositionManager(this.rowCount,o.rowHeightGetter,o.estimatedRowSize),this._calculateChildrenToRender();try{this.element.scrollTop(o.scrollTop),this.element.scrollLeft(o.scrollLeft)}catch(e){}},setScrollLeft:function(scrollLeft){this.options.scrollLeft!==scrollLeft&&(this._scrollLock=!0,this.options.scrollLeft=BI.clamp(scrollLeft||0,0,this._getRealMaxScrollLeft()),this._debounceRelease(),this._calculateChildrenToRender(),this.element.scrollLeft(this.options.scrollLeft))},setScrollTop:function(scrollTop){this.options.scrollTop!==scrollTop&&(this._scrollLock=!0,this.options.scrollTop=BI.clamp(scrollTop||0,0,this._getMaxScrollTop()),this._debounceRelease(),this._calculateChildrenToRender(),this.element.scrollTop(this.options.scrollTop))},setColumnCount:function(columnCount){this.options.columnCount=columnCount},setRowCount:function(rowCount){this.options.rowCount=rowCount},setOverflowX:function(b){var self=this;this.options.overflowX!==!!b&&(this.options.overflowX=!!b,BI.nextTick(function(){self.element.css({overflowX:b?"auto":"hidden"})}))},setOverflowY:function(b){var self=this;this.options.overflowY!==!!b&&(this.options.overflowY=!!b,BI.nextTick(function(){self.element.css({overflowY:b?"auto":"hidden"})}))},getScrollLeft:function(){return this.options.scrollLeft},getScrollTop:function(){return this.options.scrollTop},getMaxScrollLeft:function(){return this._getMaxScrollLeft()},getMaxScrollTop:function(){return this._getMaxScrollTop()},setEstimatedColumnSize:function(width){this.options.estimatedColumnSize=width},setEstimatedRowSize:function(height){this.options.estimatedRowSize=height},_reRange:function(){this.renderRange={}},_clearChildren:function(){this.container._children={},this.container.attr("items",[])},restore:function(){BI.each(this.renderedCells,function(i,cell){cell.el._destroy()}),this._clearChildren(),this.renderedCells=[],this.renderedKeys=[],this.renderRange={},this._scrollLock=!1},populate:function(items){items&&items!==this.options.items&&this.restore(),this._populate(items)}}),BI.GridView.EVENT_SCROLL="EVENT_SCROLL", +BI.shortcut("bi.grid_view",BI.GridView),BI.Popover=BI.inherit(BI.Widget,{_constant:{SIZE:{SMALL:"small",NORMAL:"normal",BIG:"big"},HEADER_HEIGHT:40},_defaultConfig:function(){return BI.extend(BI.Popover.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-popover bi-card bi-border-radius",size:"normal",logic:{dynamic:!1},header:null,body:null,footer:null,closable:!0})},render:function(){var self=this,o=this.options;this.startX=0,this.startY=0,this.tracker=new BI.MouseMoveTracker(function(deltaX,deltaY){var size=self._calculateSize(),W=BI.Widget._renderEngine.createElement("body").width(),H=BI.Widget._renderEngine.createElement("body").height();self.startX+=deltaX,self.startY+=deltaY,self.element.css({left:BI.clamp(self.startX,0,W-self.element.width())+"px",top:BI.clamp(self.startY,0,H-self.element.height())+"px"}),BI.Resizers._resize()},function(){self.tracker.releaseMouseMoves()},_global);var items=[{el:{type:"bi.htape",cls:"bi-message-title bi-header-background",ref:function(_ref){self.dragger=_ref},items:[{type:"bi.absolute",items:[{el:BI.isPlainObject(o.header)?BI.createWidget(o.header,{extraCls:"bi-font-bold"}):{type:"bi.label",cls:"bi-font-bold",height:this._constant.HEADER_HEIGHT,text:o.header,title:o.header,textAlign:"left"},left:20,top:0,right:0,bottom:0}]},{el:o.closable?{type:"bi.icon_button",cls:"bi-message-close close-font",height:this._constant.HEADER_HEIGHT,handler:function(){self.close()}}:{type:"bi.layout"},width:56}],height:this._constant.HEADER_HEIGHT},height:this._constant.HEADER_HEIGHT},{el:o.logic.dynamic?{type:"bi.vertical",scrolly:!1,cls:"popover-body",ref:function(){self.body=this},hgap:20,tgap:10,items:[{el:BI.createWidget(o.body)}]}:{type:"bi.absolute",items:[{el:BI.createWidget(o.body),left:20,top:10,right:20,bottom:0}]}}];o.footer&&items.push({el:{type:"bi.absolute",items:[{el:BI.createWidget(o.footer),left:20,top:0,right:20,bottom:0}],height:44},height:44});var size=this._calculateSize();return BI.extend({type:o.logic.dynamic?"bi.vertical":"bi.vtape",items:items,width:size.width},o.logic.dynamic?{type:"bi.vertical",scrolly:!1}:{type:"bi.vtape",height:size.height})},mounted:function(){var self=this,o=this.options;if(this.dragger.element.mousedown(function(e){var pos=self.element.offset();self.startX=pos.left,self.startY=pos.top,self.tracker.captureMouseMoves(e)}),o.logic.dynamic){var size=this._calculateSize(),height=this.element.height(),compareHeight=BI.clamp(height,size.height,600)-(o.footer?84:44);this.body.element.height(compareHeight)}},_calculateSize:function(){var o=this.options,size={};if(BI.isNotNull(o.size))switch(o.size){case this._constant.SIZE.SMALL:size.width=450,size.height=200;break;case this._constant.SIZE.BIG:size.width=900,size.height=500;break;default:size.width=550,size.height=500}return{width:o.width||size.width,height:o.height||size.height}},hide:function(){},open:function(){this.show(),this.fireEvent(BI.Popover.EVENT_OPEN,arguments)},close:function(){this.hide(),this.fireEvent(BI.Popover.EVENT_CLOSE,arguments)},setZindex:function(zindex){this.element.css({"z-index":zindex})},destroyed:function(){}}),BI.shortcut("bi.popover",BI.Popover),BI.BarPopover=BI.inherit(BI.Popover,{_defaultConfig:function(){return BI.extend(BI.BarPopover.superclass._defaultConfig.apply(this,arguments),{btns:[BI.i18nText("BI-Basic_Sure"),BI.i18nText("BI-Basic_Cancel")]})},beforeCreate:function(){var self=this,o=this.options;o.footer||(o.footer={type:"bi.right_vertical_adapt",lgap:10,items:[{type:"bi.button",text:this.options.btns[1],value:1,level:"ignore",handler:function(v){self.fireEvent(BI.Popover.EVENT_CANCEL,v),self.close(v)}},{type:"bi.button",text:this.options.btns[0],warningTitle:o.warningTitle,value:0,handler:function(v){self.fireEvent(BI.Popover.EVENT_CONFIRM,v),self.close(v)}}]})}}),BI.shortcut("bi.bar_popover",BI.BarPopover),BI.Popover.EVENT_CLOSE="EVENT_CLOSE",BI.Popover.EVENT_OPEN="EVENT_OPEN",BI.Popover.EVENT_CANCEL="EVENT_CANCEL",BI.Popover.EVENT_CONFIRM="EVENT_CONFIRM",BI.PopupView=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.PopupView.superclass._defaultConfig.apply(this,arguments),{_baseCls:"bi-popup-view",maxWidth:"auto",minWidth:100,minHeight:24,lgap:0,rgap:0,tgap:0,bgap:0,vgap:0,hgap:0,innerVGap:0,direction:BI.Direction.Top,stopEvent:!1,stopPropagation:!1,logic:{dynamic:!0},tool:!1,tabs:[],buttons:[],el:{type:"bi.button_group",items:[],chooseType:0,behaviors:{},layouts:[{type:"bi.vertical"}]}})},_init:function(){BI.PopupView.superclass._init.apply(this,arguments);var self=this,o=this.options,fn=function(e){e.stopPropagation()},stop=function(e){return e.stopEvent(),!1};this.element.css({"z-index":BI.zIndex_popup,"min-width":o.minWidth+"px","max-width":o.maxWidth+"px"}).bind({click:fn}),this.element.bind("mousewheel",fn),o.stopPropagation&&this.element.bind({mousedown:fn,mouseup:fn,mouseover:fn}),o.stopEvent&&this.element.bind({mousedown:stop,mouseup:stop,mouseover:stop}),this.tool=this._createTool(),this.tab=this._createTab(),this.view=this._createView(),this.toolbar=this._createToolBar(),this.view.on(BI.Controller.EVENT_CHANGE,function(type){self.fireEvent(BI.Controller.EVENT_CHANGE,arguments),type===BI.Events.CLICK&&self.fireEvent(BI.PopupView.EVENT_CHANGE)}),BI.createWidget(BI.extend({element:this},BI.LogicFactory.createLogic(BI.LogicFactory.createLogicTypeByDirection(o.direction),BI.extend({},o.logic,{scrolly:!1,lgap:o.lgap,rgap:o.rgap,tgap:o.tgap,bgap:o.bgap,vgap:o.vgap,hgap:o.hgap,items:BI.LogicFactory.createLogicItemsByDirection(o.direction,BI.extend({cls:"list-view-outer bi-card list-view-shadow"},BI.LogicFactory.createLogic(BI.LogicFactory.createLogicTypeByDirection(o.direction),BI.extend({},o.logic,{items:BI.LogicFactory.createLogicItemsByDirection(o.direction,this.tool,this.tab,this.view,this.toolbar)}))))}))))},_createView:function(){var o=this.options;return this.button_group=BI.createWidget(o.el,{type:"bi.button_group",value:o.value}),this.button_group.element.css({"min-height":o.minHeight+"px","padding-top":o.innerVGap+"px","padding-bottom":o.innerVGap+"px"}),this.button_group},_createTool:function(){var o=this.options;if(!1!==o.tool)return BI.createWidget(o.tool)},_createTab:function(){var o=this.options;if(0!==o.tabs.length)return BI.createWidget({type:"bi.center",cls:"list-view-tab",height:25,items:o.tabs,value:o.value})},_createToolBar:function(){var o=this.options;if(0!==o.buttons.length)return BI.createWidget({type:"bi.center",cls:"list-view-toolbar bi-high-light bi-split-top",height:24,items:BI.createItems(o.buttons,{once:!1,shadow:!0,isShadowShowingOnSelected:!0})})},getView:function(){return this.view},populate:function(items){this.view.populate.apply(this.view,arguments)},resetWidth:function(w){this.options.width=w,this.element.width(w)},resetHeight:function(h){var tbHeight=this.toolbar?this.toolbar.attr("height")||24:0,tabHeight=this.tab?this.tab.attr("height")||24:0,toolHeight=(this.tool&&this.tool.attr("height")||24)*(this.tool&&this.tool.isVisible()?1:0),resetHeight=h-tbHeight-tabHeight-toolHeight-2*this.options.innerVGap;this.view.resetHeight?this.view.resetHeight(resetHeight):this.view.element.css({"max-height":resetHeight+"px"})},setValue:function(selectedValues){this.tab&&this.tab.setValue(selectedValues),this.view.setValue(selectedValues)},getValue:function(){return this.view.getValue()}}),BI.PopupView.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.popup_view",BI.PopupView),BI.SearcherView=BI.inherit(BI.Pane,{_defaultConfig:function(){var conf=BI.SearcherView.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{baseCls:(conf.baseCls||"")+" bi-searcher-view bi-card",tipText:BI.i18nText("BI-No_Select"),chooseType:BI.Selection.Single,matcher:{type:"bi.button_group",behaviors:{redmark:function(){return!0}},items:[],layouts:[{type:"bi.vertical"}]},searcher:{type:"bi.button_group",behaviors:{redmark:function(){return!0}},items:[],layouts:[{type:"bi.vertical"}]}})},_init:function(){BI.SearcherView.superclass._init.apply(this,arguments);var self=this,o=this.options;this.matcher=BI.createWidget(o.matcher,{type:"bi.button_group",chooseType:o.chooseType,behaviors:{redmark:function(){return!0}},layouts:[{type:"bi.vertical"}],value:o.value}),this.matcher.on(BI.Controller.EVENT_CHANGE,function(type,val,ob){self.fireEvent(BI.Controller.EVENT_CHANGE,arguments),type===BI.Events.CLICK&&self.fireEvent(BI.SearcherView.EVENT_CHANGE,val,ob)}),this.spliter=BI.createWidget({type:"bi.vertical",height:1,hgap:10,items:[{type:"bi.layout",height:1,cls:"searcher-view-spliter bi-background"}]}),this.searcher=BI.createWidget(o.searcher,{type:"bi.button_group",chooseType:o.chooseType,behaviors:{redmark:function(){return!0}},layouts:[{type:"bi.vertical"}],value:o.value}),this.searcher.on(BI.Controller.EVENT_CHANGE,function(type,val,ob){self.fireEvent(BI.Controller.EVENT_CHANGE,arguments),type===BI.Events.CLICK&&self.fireEvent(BI.SearcherView.EVENT_CHANGE,val,ob)}),BI.createWidget({type:"bi.vertical",element:this,items:[this.matcher,this.spliter,this.searcher]})},startSearch:function(){},stopSearch:function(){},setValue:function(v){this.matcher.setValue(v),this.searcher.setValue(v)},getValue:function(){return this.matcher.getValue().concat(this.searcher.getValue())},populate:function(searchResult,matchResult,keyword){searchResult||(searchResult=[]),matchResult||(matchResult=[]),this.setTipVisible(searchResult.length+matchResult.length===0),this.spliter.setVisible(BI.isNotEmptyArray(matchResult)&&BI.isNotEmptyArray(searchResult)),this.matcher.populate(matchResult,keyword),this.searcher.populate(searchResult,keyword)},empty:function(){this.searcher.empty(),this.matcher.empty()},hasMatched:function(){return this.matcher.getAllButtons().length>0}}),BI.SearcherView.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.searcher_view",BI.SearcherView),BI.ListView=BI.inherit(BI.Widget,{props:function(){return{baseCls:"bi-list-view",overscanHeight:100,blockSize:10,scrollTop:0,el:{},items:[]}},init:function(){var self=this;this.renderedIndex=-1,this.cache={}},render:function(){var self=this,o=this.options;return{type:"bi.vertical",items:[BI.extend({type:"bi.vertical",scrolly:!1,ref:function(){self.container=this}},o.el)],element:this}},mounted:function(){var self=this,o=this.options;this._populate(),this.element.scroll(function(e){o.scrollTop=self.element.scrollTop(),self._calculateBlocksToRender()});var lastWidth=this.element.width(),lastHeight=this.element.height();BI.ResizeDetector.addResizeListener(this,function(){var width=self.element.width(),height=self.element.height();width===lastWidth&&height===lastHeight||(lastWidth=width,lastHeight=height,self._calculateBlocksToRender())})},_renderMoreIf:function(){for(var self=this,o=this.options,height=this.element.height(),minContentHeight=o.scrollTop+height+o.overscanHeight,index=this.cache[this.renderedIndex]&&this.cache[this.renderedIndex].index+o.blockSize||0,cnt=this.renderedIndex+1,lastHeight,getElementHeight=function(){return self.container.element.height()};(lastHeight=getElementHeight())pages&&(groups=pages),dict.index=Math.ceil((curr+(groups>1&&groups!==pages?1:0))/(0===groups?1:groups)),(!o.dynamicShow&&!o.dynamicShowPrevNext||curr>1)&&prev!==!1&&(BI.isKey(prev)?view.push({text:prev,value:"prev",disabled:pages===!1?o.hasPrev(curr)===!1:!(curr>1&&prev!==!1)}):view.push(BI.extend({disabled:pages===!1?o.hasPrev(curr)===!1:!(curr>1&&prev!==!1)},prev))),(!o.dynamicShow&&!o.dynamicShowFirstLast||dict.index>1&&0!==groups)&&first&&(view.push({text:first,value:"first",disabled:!(dict.index>1&&0!==groups)}),dict.index>1&&0!==groups&&view.push({type:"bi.label",cls:"page-ellipsis",text:"…"})),dict.poor=Math.floor((groups-1)/2),dict.start=dict.index>1?curr-dict.poor:1,dict.end=dict.index>1?function(){var max=curr+(groups-dict.poor-1);return max>pages?pages:max}():groups,dict.end-dict.start1&&0!==groups&&pages>groups&&dict.endgroups&&dict.endgroups&&dict.endgroups&&dict.end1},hasNext:function(v){v||(v=1);var o=this.options,pages=this.options.pages;return pages===!1?o.hasNext(v):vlastPage?lastPage:(firstPage=BI.result(o,"firstPage"),vo.pages?o.pages:v,this.currPage=v;this._populate()},getValue:function(){var val=this.button_group.getValue()[0];switch(val){case"prev":return-1;case"next":return 1;case"first":return BI.MIN;case"last":return BI.MAX;default:return val}},attr:function(key,value){BI.Pager.superclass.attr.apply(this,arguments),"curr"===key&&(this.currPage=BI.result(this.options,"curr"))},populate:function(){this._populate()}}),BI.Pager.EVENT_CHANGE="EVENT_CHANGE",BI.Pager.EVENT_AFTER_POPULATE="EVENT_AFTER_POPULATE",BI.shortcut("bi.pager",BI.Pager),BI.A=BI.inherit(BI.Text,{_defaultConfig:function(){var conf=BI.A.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{baseCls:(conf.baseCls||"")+" bi-a display-block",href:"",target:"_blank",el:null,tagName:"a"})},_init:function(){var o=this.options;BI.A.superclass._init.apply(this,arguments),this.element.attr({href:o.href,target:o.target}),o.el&&BI.createWidget(o.el,{element:this})}}),BI.shortcut("bi.a",BI.A),BI.LoadingBar=BI.inherit(BI.Single,{_defaultConfig:function(){var conf=BI.LoadingBar.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{baseCls:(conf.baseCls||"")+" bi-loading-bar bi-tips",height:30,handler:BI.emptyFn})},_init:function(){BI.LoadingBar.superclass._init.apply(this,arguments);var self=this;this.loaded=BI.createWidget({type:"bi.text_button",cls:"loading-text bi-list-item-simple",text:BI.i18nText("BI-Load_More"),width:120,handler:this.options.handler}),this.loaded.on(BI.Controller.EVENT_CHANGE,function(type){self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.loading=BI.createWidget({type:"bi.layout",width:this.options.height,height:this.options.height,cls:"loading-background cursor-default"});var loaded=BI.createWidget({type:"bi.center_adapt",items:[this.loaded]}),loading=BI.createWidget({type:"bi.center_adapt",items:[this.loading]});this.cardLayout=BI.createWidget({type:"bi.card",element:this,items:[{el:loaded,cardName:"loaded"},{el:loading,cardName:"loading"}]}),this.invisible()},_reset:function(){this.visible(),this.loaded.setText(BI.i18nText("BI-Load_More")),this.loaded.enable()},setLoaded:function(){this._reset(),this.cardLayout.showCardByName("loaded")},setEnd:function(){this.setLoaded(),this.loaded.setText(BI.i18nText("BI-No_More_Data")),this.loaded.disable()},setLoading:function(){this._reset(),this.cardLayout.showCardByName("loading")}}),BI.shortcut("bi.loading_bar",BI.LoadingBar),BI.IconButton=BI.inherit(BI.BasicButton,{_defaultConfig:function(){var conf=BI.IconButton.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{_baseCls:(conf._baseCls||"")+" bi-icon-button horizon-center",iconWidth:null,iconHeight:null})},_init:function(){BI.IconButton.superclass._init.apply(this,arguments);var o=this.options;this.element.css({textAlign:"center"}),this.icon=BI.createWidget({type:"bi.icon",width:o.iconWidth,height:o.iconHeight}),BI.isNumber(o.height)&&o.height>0&&BI.isNull(o.iconWidth)&&BI.isNull(o.iconHeight)?(this.element.css("lineHeight",o.height+"px"),BI.createWidget({type:"bi.default",element:this,items:[this.icon]})):(this.element.css("lineHeight","1"),BI.createWidget({element:this,type:"bi.center_adapt",items:[this.icon]}))},doClick:function(){BI.IconButton.superclass.doClick.apply(this,arguments),this.isValid()&&this.fireEvent(BI.IconButton.EVENT_CHANGE,this)}}),BI.IconButton.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.icon_button",BI.IconButton),BI.ImageButton=BI.inherit(BI.BasicButton,{_defaultConfig:function(){var conf=BI.ImageButton.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{baseCls:(conf.baseCls||"")+" bi-image-button",src:"",iconWidth:"100%",iconHeight:"100%"})},_init:function(){BI.ImageButton.superclass._init.apply(this,arguments);var o=this.options;this.image=BI.createWidget({type:"bi.img",width:o.iconWidth,height:o.iconHeight,src:o.src}),BI.isNumber(o.iconWidth)||BI.isNumber(o.iconHeight)?BI.createWidget({type:"bi.center_adapt",element:this,items:[this.image]}):BI.createWidget({type:"bi.adaptive",element:this,items:[this.image],scrollable:!1})},setWidth:function(w){BI.ImageButton.superclass.setWidth.apply(this,arguments),this.options.width=w},setHeight:function(h){BI.ImageButton.superclass.setHeight.apply(this,arguments),this.options.height=h},setImageWidth:function(w){this.image.setWidth(w)},setImageHeight:function(h){this.image.setHeight(h)},getImageWidth:function(){return this.image.element.width()},getImageHeight:function(){return this.image.element.height()},setSrc:function(src){this.options.src=src,this.image.setSrc(src)},getSrc:function(){return this.image.getSrc()},doClick:function(){BI.ImageButton.superclass.doClick.apply(this,arguments),this.isValid()&&this.fireEvent(BI.ImageButton.EVENT_CHANGE,this)}}),BI.ImageButton.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.image_button",BI.ImageButton),BI.Button=BI.inherit(BI.BasicButton,{_defaultConfig:function(props){var conf=BI.Button.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{baseCls:(conf.baseCls||"")+" bi-button"+(BI.isIE()&&BI.isIE9Below()?" hack":""),minWidth:props.block===!0||props.clear===!0?0:80,height:24,shadow:props.clear!==!0,isShadowShowingOnSelected:!0,readonly:!0,iconCls:"",level:"common",block:!1,clear:!1,ghost:!1,textAlign:"center",whiteSpace:"nowrap",textWidth:null,textHeight:null,hgap:props.clear?0:10,vgap:0,tgap:0,bgap:0,lgap:0,rgap:0})},_init:function(){BI.Button.superclass._init.apply(this,arguments);var o=this.options,self=this;!BI.isNumber(o.height)||o.clear||o.block?o.clear||o.block?this.element.css({lineHeight:o.height+"px"}):this.element.css({lineHeight:o.height-2+"px"}):this.element.css({height:o.height+"px",lineHeight:o.height-2+"px"}),BI.isKey(o.iconCls)?(this.icon=BI.createWidget({type:"bi.icon_label",cls:o.iconCls,width:18,height:o.height-2,iconWidth:o.iconWidth,iconHeight:o.iconHeight}),this.text=BI.createWidget({type:"bi.label",text:o.text,value:o.value,height:o.height-2}),BI.createWidget({type:"bi.center_adapt",element:this,hgap:o.hgap,vgap:o.vgap,items:[{type:"bi.horizontal",items:[this.icon,this.text]}]})):this.text=BI.createWidget({type:"bi.label",textAlign:o.textAlign,whiteSpace:o.whiteSpace,textWidth:o.textWidth,textHeight:o.textHeight,hgap:o.hgap,vgap:o.vgap,tgap:o.tgap,bgap:o.bgap,lgap:o.lgap,rgap:o.rgap,element:this,text:o.text,value:o.value}),o.block===!0&&this.element.addClass("block"),o.clear===!0&&this.element.addClass("clear"),o.ghost===!0&&this.element.addClass("ghost"),o.minWidth>0&&this.element.css({"min-width":o.minWidth+"px"})},doClick:function(){BI.Button.superclass.doClick.apply(this,arguments),this.isValid()&&this.fireEvent(BI.Button.EVENT_CHANGE,this)},setText:function(text){BI.Button.superclass.setText.apply(this,arguments),this.text.setText(text)},setValue:function(text){BI.Button.superclass.setValue.apply(this,arguments),this.isReadOnly()||this.text.setValue(text)},doRedMark:function(){this.text.doRedMark.apply(this.text,arguments)},unRedMark:function(){this.text.unRedMark.apply(this.text,arguments)},doHighLight:function(){this.text.doHighLight.apply(this.text,arguments)},unHighLight:function(){this.text.unHighLight.apply(this.text,arguments)},destroy:function(){BI.Button.superclass.destroy.apply(this,arguments)}}),BI.shortcut("bi.button",BI.Button),BI.Button.EVENT_CHANGE="EVENT_CHANGE",BI.TextButton=BI.inherit(BI.BasicButton,{_defaultConfig:function(){var conf=BI.TextButton.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{baseCls:(conf.baseCls||"")+" bi-text-button",textAlign:"center",whiteSpace:"nowrap",textWidth:null,textHeight:null,hgap:0,lgap:0,rgap:0,text:"",py:""})},_init:function(){BI.TextButton.superclass._init.apply(this,arguments);var o=this.options;this.text=BI.createWidget({type:"bi.label",element:this,textAlign:o.textAlign,whiteSpace:o.whiteSpace,textWidth:o.textWidth,textHeight:o.textHeight,width:o.width,height:o.height,hgap:o.hgap,lgap:o.lgap,rgap:o.rgap,text:o.text,value:o.value,py:o.py,keyword:o.keyword})},doClick:function(){BI.TextButton.superclass.doClick.apply(this,arguments),this.isValid()&&this.fireEvent(BI.TextButton.EVENT_CHANGE,this.getValue(),this)},doRedMark:function(){this.text.doRedMark.apply(this.text,arguments)},unRedMark:function(){this.text.unRedMark.apply(this.text,arguments)},doHighLight:function(){this.text.doHighLight.apply(this.text,arguments)},unHighLight:function(){this.text.unHighLight.apply(this.text,arguments)},setText:function(text){BI.TextButton.superclass.setText.apply(this,arguments),text=BI.isArray(text)?text.join(","):text,this.text.setText(text)},setStyle:function(style){this.text.setStyle(style)},setValue:function(text){BI.TextButton.superclass.setValue.apply(this,arguments),this.isReadOnly()||(text=BI.isArray(text)?text.join(","):text,this.text.setValue(text))}}),BI.TextButton.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.text_button",BI.TextButton),BI.BlankIconIconTextItem=BI.inherit(BI.BasicButton,{_defaultConfig:function(){var conf=BI.BlankIconIconTextItem.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{baseCls:(conf.baseCls||"")+" bi-blank-icon-text-item",logic:{dynamic:!1},iconCls1:"close-ha-font",iconCls2:"close-ha-font",blankWidth:0,iconHeight:null,iconWidth:null,textHgap:0,textVgap:0,textLgap:0,textRgap:0})},_init:function(){BI.BlankIconIconTextItem.superclass._init.apply(this,arguments);var o=this.options,c=this._const,blank=BI.createWidget({type:"bi.layout",width:o.blankWidth,height:o.height});this.text=BI.createWidget({type:"bi.label",cls:"list-item-text",textAlign:"left",hgap:o.textHgap,vgap:o.textVgap,lgap:o.textLgap,rgap:o.textRgap,text:o.text,value:o.value,keyword:o.keyword,height:o.height}),this.icon1=BI.createWidget({type:"bi.icon_button",cls:o.iconCls1,forceNotSelected:!0,width:o.height,height:o.height}),this.icon2=BI.createWidget({type:"bi.icon_button",cls:o.iconCls2,forceNotSelected:!0,width:o.height,height:o.height}),BI.createWidget(BI.extend({element:this},BI.LogicFactory.createLogic("horizontal",BI.extend(o.logic,{items:BI.LogicFactory.createLogicItemsByDirection("left",blank,this.icon1,this.icon2,this.text)}))))},doClick:function(){BI.BlankIconIconTextItem.superclass.doClick.apply(this,arguments),this.isValid()&&this.fireEvent(BI.BlankIconIconTextItem.EVENT_CHANGE,this.getValue(),this)},setSelected:function(b){BI.BlankIconIconTextItem.superclass.setSelected.apply(this,arguments),this.icon1.setSelected(b),this.icon2.setSelected(b)},setValue:function(){this.isReadOnly()||this.text.setValue.apply(this.text,arguments)},getValue:function(){return this.text.getValue()},setText:function(){this.text.setText.apply(this.text,arguments)},getText:function(){return this.text.getText()},doRedMark:function(){this.text.doRedMark.apply(this.text,arguments)},unRedMark:function(){this.text.unRedMark.apply(this.text,arguments)},doHighLight:function(){this.text.doHighLight.apply(this.text,arguments)},unHighLight:function(){this.text.unHighLight.apply(this.text,arguments)}}),BI.BlankIconIconTextItem.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.blank_icon_icon_text_item",BI.BlankIconIconTextItem),BI.BlankIconTextIconItem=BI.inherit(BI.BasicButton,{_defaultConfig:function(){var conf=BI.BlankIconTextIconItem.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{baseCls:(conf.baseCls||"")+" bi-blank-icon-text-icon-item",logic:{dynamic:!1},iconCls1:"close-ha-font",iconCls2:"close-ha-font",blankWidth:0,iconHeight:null,iconWidth:null,textHgap:0,textVgap:0,textLgap:0,textRgap:0})},_init:function(){BI.BlankIconTextIconItem.superclass._init.apply(this,arguments);var o=this.options,c=this._const;this.text=BI.createWidget({type:"bi.label",textAlign:"left",hgap:o.textHgap,vgap:o.textVgap,lgap:o.textLgap,rgap:o.textRgap,text:o.text,value:o.value,keyword:o.keyword,height:o.height});var icon1=BI.createWidget({type:"bi.icon_label",cls:o.iconCls1,width:o.height,height:o.height,iconWidth:o.iconWidth,iconHeight:o.iconHeight});BI.createWidget({type:"bi.absolute",element:this,items:[{el:{type:"bi.icon_label",cls:o.iconCls2,width:o.height,height:o.height,iconWidth:o.iconWidth,iconHeight:o.iconHeight},top:0,bottom:0,right:0}]}),BI.createWidget(BI.extend({element:this},BI.LogicFactory.createLogic("horizontal",BI.extend(o.logic,{ +items:BI.LogicFactory.createLogicItemsByDirection("left",{type:"bi.layout",width:o.blankWidth},icon1,this.text,{type:"bi.layout",width:o.height})}))))},doClick:function(){BI.BlankIconTextIconItem.superclass.doClick.apply(this,arguments),this.isValid()&&this.fireEvent(BI.BlankIconTextIconItem.EVENT_CHANGE,this.getValue(),this)},doRedMark:function(){this.text.doRedMark.apply(this.text,arguments)},unRedMark:function(){this.text.unRedMark.apply(this.text,arguments)},doHighLight:function(){this.text.doHighLight.apply(this.text,arguments)},unHighLight:function(){this.text.unHighLight.apply(this.text,arguments)},setValue:function(){this.isReadOnly()||this.text.setValue.apply(this.text,arguments)},getValue:function(){return this.text.getValue()},setText:function(){this.text.setText.apply(this.text,arguments)},getText:function(){return this.text.getText()}}),BI.BlankIconTextIconItem.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.blank_icon_text_icon_item",BI.BlankIconTextIconItem),BI.BlankIconTextItem=BI.inherit(BI.BasicButton,{_defaultConfig:function(){var conf=BI.BlankIconTextItem.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{baseCls:(conf.baseCls||"")+" bi-blank-icon-text-item",logic:{dynamic:!1},cls:"close-ha-font",blankWidth:0,iconHeight:null,iconWidth:null,textHgap:0,textVgap:0,textLgap:0,textRgap:0})},_init:function(){BI.BlankIconTextItem.superclass._init.apply(this,arguments);var o=this.options,c=this._const,blank=BI.createWidget({type:"bi.layout",width:o.blankWidth});this.text=BI.createWidget({type:"bi.label",cls:"list-item-text",textAlign:"left",hgap:o.textHgap,vgap:o.textVgap,lgap:o.textLgap,rgap:o.textRgap,text:o.text,value:o.value,keyword:o.keyword,height:o.height}),this.icon=BI.createWidget({type:"bi.icon_label",width:o.height,height:o.height,iconWidth:o.iconWidth,iconHeight:o.iconHeight}),BI.createWidget(BI.extend({element:this},BI.LogicFactory.createLogic("horizontal",BI.extend(o.logic,{items:BI.LogicFactory.createLogicItemsByDirection("left",blank,this.icon,this.text)}))))},doClick:function(){BI.BlankIconTextItem.superclass.doClick.apply(this,arguments),this.isValid()&&this.fireEvent(BI.BlankIconTextItem.EVENT_CHANGE,this.getValue(),this)},setValue:function(){this.isReadOnly()||this.text.setValue.apply(this.text,arguments)},getValue:function(){return this.text.getValue()},setText:function(){this.text.setText.apply(this.text,arguments)},getText:function(){return this.text.getText()},doRedMark:function(){this.text.doRedMark.apply(this.text,arguments)},unRedMark:function(){this.text.unRedMark.apply(this.text,arguments)},doHighLight:function(){this.text.doHighLight.apply(this.text,arguments)},unHighLight:function(){this.text.unHighLight.apply(this.text,arguments)}}),BI.BlankIconTextItem.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.blank_icon_text_item",BI.BlankIconTextItem),BI.IconTextIconItem=BI.inherit(BI.BasicButton,{_defaultConfig:function(){var conf=BI.IconTextIconItem.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{baseCls:(conf.baseCls||"")+" bi-icon-text-icon-item",logic:{dynamic:!1},iconCls1:"close-ha-font",iconCls2:"close-ha-font",iconHeight:null,iconWidth:null,textHgap:0,textVgap:0,textLgap:0,textRgap:0})},_init:function(){BI.IconTextIconItem.superclass._init.apply(this,arguments);var o=this.options,c=this._const;this.text=BI.createWidget({type:"bi.label",textAlign:"left",hgap:o.textHgap,vgap:o.textVgap,lgap:o.textLgap,rgap:o.textRgap,text:o.text,value:o.value,keyword:o.keyword,height:o.height});var icon1=BI.createWidget({type:"bi.icon_label",cls:o.iconCls1,width:o.leftIconWrapperWidth,height:o.height,iconWidth:o.iconWidth,iconHeight:o.iconHeight}),blank=BI.createWidget({type:"bi.layout",width:o.height});BI.createWidget({type:"bi.absolute",element:this,items:[{el:{type:"bi.icon_label",cls:o.iconCls2,width:o.rightIconWrapperWidth,height:o.height,iconWidth:o.iconWidth,iconHeight:o.iconHeight},top:0,bottom:0,right:0}]}),BI.createWidget(BI.extend({element:this},BI.LogicFactory.createLogic("horizontal",BI.extend(o.logic,{items:BI.LogicFactory.createLogicItemsByDirection("left",icon1,this.text,blank)}))))},doClick:function(){BI.IconTextIconItem.superclass.doClick.apply(this,arguments),this.isValid()&&this.fireEvent(BI.IconTextIconItem.EVENT_CHANGE,this.getValue(),this)},doRedMark:function(){this.text.doRedMark.apply(this.text,arguments)},unRedMark:function(){this.text.unRedMark.apply(this.text,arguments)},doHighLight:function(){this.text.doHighLight.apply(this.text,arguments)},unHighLight:function(){this.text.unHighLight.apply(this.text,arguments)},setValue:function(){this.isReadOnly()||this.text.setValue.apply(this.text,arguments)},getValue:function(){return this.text.getValue()},setText:function(){this.text.setText.apply(this.text,arguments)},getText:function(){return this.text.getText()}}),BI.IconTextIconItem.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.icon_text_icon_item",BI.IconTextIconItem),BI.IconTextItem=BI.inherit(BI.BasicButton,{_defaultConfig:function(){var conf=BI.IconTextItem.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{baseCls:(conf.baseCls||"")+" bi-icon-text-item",direction:BI.Direction.Left,logic:{dynamic:!1},iconWrapperWidth:null,iconHeight:null,iconWidth:null,textHgap:0,textVgap:0,textLgap:0,textRgap:0})},_init:function(){BI.IconTextItem.superclass._init.apply(this,arguments);var o=this.options,c=this._const;this.text=BI.createWidget({type:"bi.label",cls:"list-item-text",textAlign:"left",hgap:o.textHgap,vgap:o.textVgap,lgap:o.textLgap,rgap:o.textRgap,text:o.text,value:o.value,keyword:o.keyword,height:o.height}),this.icon=BI.createWidget({type:"bi.icon_label",width:o.iconWrapperWidth||o.height,height:o.height,iconWidth:o.iconWidth,iconHeight:o.iconHeight}),BI.createWidget(BI.extend({element:this},BI.LogicFactory.createLogic(BI.LogicFactory.createLogicTypeByDirection(o.direction),BI.extend(o.logic,{items:BI.LogicFactory.createLogicItemsByDirection(o.direction,this.icon,this.text)}))))},setValue:function(){this.isReadOnly()||this.text.setValue.apply(this.text,arguments)},getValue:function(){return this.text.getValue()},setText:function(){this.text.setText.apply(this.text,arguments)},getText:function(){return this.text.getText()},doClick:function(){BI.IconTextItem.superclass.doClick.apply(this,arguments),this.isValid()&&this.fireEvent(BI.IconTextItem.EVENT_CHANGE,this.getValue(),this)},doRedMark:function(){this.text.doRedMark.apply(this.text,arguments)},unRedMark:function(){this.text.unRedMark.apply(this.text,arguments)},doHighLight:function(){this.text.doHighLight.apply(this.text,arguments)},unHighLight:function(){this.text.unHighLight.apply(this.text,arguments)}}),BI.IconTextItem.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.icon_text_item",BI.IconTextItem),BI.TextIconItem=BI.inherit(BI.BasicButton,{_defaultConfig:function(){var conf=BI.TextIconItem.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{baseCls:(conf.baseCls||"")+" bi-text-icon-item",logic:{dynamic:!1},cls:"close-ha-font",iconHeight:null,iconWidth:null,textHgap:0,textVgap:0,textLgap:0,textRgap:0})},_init:function(){BI.TextIconItem.superclass._init.apply(this,arguments);var o=this.options,c=this._const;this.text=BI.createWidget({type:"bi.label",cls:"list-item-text",textAlign:"left",hgap:o.textHgap,vgap:o.textVgap,lgap:o.textLgap,rgap:o.textRgap,text:o.text,value:o.value,keyword:o.keyword,height:o.height}),this.icon=BI.createWidget({type:"bi.icon_label",width:o.height,height:o.height,iconWidth:o.iconWidth,iconHeight:o.iconHeight}),BI.createWidget(BI.extend({element:this},BI.LogicFactory.createLogic("horizontal",BI.extend(o.logic,{items:BI.LogicFactory.createLogicItemsByDirection("left",this.text,this.icon)}))))},doClick:function(){BI.TextIconItem.superclass.doClick.apply(this,arguments),this.isValid()&&this.fireEvent(BI.TextIconItem.EVENT_CHANGE,this.getValue(),this)},setValue:function(){this.isReadOnly()||this.text.setValue.apply(this.text,arguments)},getValue:function(){return this.text.getValue()},setText:function(){this.text.setText.apply(this.text,arguments)},getText:function(){return this.text.getText()},doRedMark:function(){this.text.doRedMark.apply(this.text,arguments)},unRedMark:function(){this.text.unRedMark.apply(this.text,arguments)},doHighLight:function(){this.text.doHighLight.apply(this.text,arguments)},unHighLight:function(){this.text.unHighLight.apply(this.text,arguments)}}),BI.TextIconItem.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.text_icon_item",BI.TextIconItem),BI.TextItem=BI.inherit(BI.BasicButton,{_defaultConfig:function(){var conf=BI.TextItem.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{baseCls:(conf.baseCls||"")+" bi-text-item",textAlign:"left",whiteSpace:"nowrap",textHgap:0,textVgap:0,textLgap:0,textRgap:0})},_init:function(){BI.TextItem.superclass._init.apply(this,arguments);var o=this.options;this.text=BI.createWidget({type:"bi.label",element:this,textAlign:o.textAlign,whiteSpace:o.whiteSpace,textHeight:"nowrap"==o.whiteSpace?o.height:o.textHeight,height:o.height,hgap:o.textHgap,vgap:o.textVgap,lgap:o.textLgap,rgap:o.textRgap,text:o.text,value:o.value,keyword:o.keyword,py:o.py})},doClick:function(){BI.TextItem.superclass.doClick.apply(this,arguments),this.isValid()&&this.fireEvent(BI.TextItem.EVENT_CHANGE,this.getValue(),this)},doRedMark:function(){this.text.doRedMark.apply(this.text,arguments)},unRedMark:function(){this.text.unRedMark.apply(this.text,arguments)},doHighLight:function(){this.text.doHighLight.apply(this.text,arguments)},unHighLight:function(){this.text.unHighLight.apply(this.text,arguments)},setValue:function(){this.isReadOnly()||this.text.setValue.apply(this.text,arguments)},getValue:function(){return this.text.getValue()},setText:function(){this.text.setText.apply(this.text,arguments)},getText:function(){return this.text.getText()}}),BI.TextItem.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.text_item",BI.TextItem),BI.IconTextIconNode=BI.inherit(BI.NodeButton,{_defaultConfig:function(){var conf=BI.IconTextIconNode.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{baseCls:(conf.baseCls||"")+" bi-icon-text-icon-node",logic:{dynamic:!1},iconCls1:"close-ha-font",iconCls2:"close-ha-font",iconHeight:null,iconWidth:null,textHgap:0,textVgap:0,textLgap:0,textRgap:0})},_init:function(){BI.IconTextIconNode.superclass._init.apply(this,arguments);var o=this.options,c=this._const;this.text=BI.createWidget({type:"bi.label",textAlign:"left",hgap:o.textHgap,vgap:o.textVgap,lgap:o.textLgap,rgap:o.textRgap,text:o.text,value:o.value,keyword:o.keyword,height:o.height});var icon1=BI.createWidget({type:"bi.icon_label",cls:o.iconCls1,width:o.height,height:o.height,iconWidth:o.iconWidth,iconHeight:o.iconHeight}),blank=BI.createWidget({type:"bi.layout",width:o.height,height:o.height});BI.createWidget({type:"bi.absolute",element:this,items:[{el:{type:"bi.icon_label",cls:o.iconCls2,width:o.height,iconWidth:o.iconWidth,iconHeight:o.iconHeight},top:0,bottom:0,right:0}]}),BI.createWidget(BI.extend({element:this},BI.LogicFactory.createLogic("horizontal",BI.extend(o.logic,{items:BI.LogicFactory.createLogicItemsByDirection("left",icon1,this.text,blank)}))))},doClick:function(){BI.IconTextIconNode.superclass.doClick.apply(this,arguments),this.isValid()&&this.fireEvent(BI.IconTextIconNode.EVENT_CHANGE,this.getValue(),this)},doRedMark:function(){this.text.doRedMark.apply(this.text,arguments)},unRedMark:function(){this.text.unRedMark.apply(this.text,arguments)},setValue:function(){this.isReadOnly()||this.text.setValue.apply(this.text,arguments)},getValue:function(){return this.text.getValue()},setText:function(){this.text.setText.apply(this.text,arguments)},getText:function(){return this.text.getText()}}),BI.IconTextIconNode.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.icon_text_icon_node",BI.IconTextIconNode),BI.IconTextNode=BI.inherit(BI.NodeButton,{_defaultConfig:function(){var conf=BI.IconTextNode.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{baseCls:(conf.baseCls||"")+" bi-icon-text-node",logic:{dynamic:!1},cls:"close-ha-font",iconHeight:null,iconWidth:null,textHgap:0,textVgap:0,textLgap:0,textRgap:0})},_init:function(){BI.IconTextNode.superclass._init.apply(this,arguments);var o=this.options,c=this._const;this.text=BI.createWidget({type:"bi.label",cls:"list-item-text",textAlign:"left",hgap:o.textHgap,vgap:o.textVgap,lgap:o.textLgap,rgap:o.textRgap,text:o.text,value:o.value,keyword:o.keyword,height:o.height}),this.icon=BI.createWidget({type:"bi.icon_label",width:o.height,height:o.height,iconWidth:o.iconWidth,iconHeight:o.iconHeight}),BI.createWidget(BI.extend({element:this},BI.LogicFactory.createLogic("horizontal",BI.extend(o.logic,{items:BI.LogicFactory.createLogicItemsByDirection("left",this.icon,this.text)}))))},setValue:function(){this.isReadOnly()||this.text.setValue.apply(this.text,arguments)},getValue:function(){return this.text.getValue()},setText:function(){this.text.setText.apply(this.text,arguments)},getText:function(){return this.text.getText()},doClick:function(){BI.IconTextNode.superclass.doClick.apply(this,arguments),this.isValid()&&this.fireEvent(BI.IconTextNode.EVENT_CHANGE,this.getValue(),this)},doRedMark:function(){this.text.doRedMark.apply(this.text,arguments)},unRedMark:function(){this.text.unRedMark.apply(this.text,arguments)}}),BI.IconTextNode.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.icon_text_node",BI.IconTextNode),BI.TextIconNode=BI.inherit(BI.NodeButton,{_defaultConfig:function(){var conf=BI.TextIconNode.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{baseCls:(conf.baseCls||"")+" bi-text-icon-node",logic:{dynamic:!1},cls:"close-ha-font",iconHeight:null,iconWidth:null,textHgap:0,textVgap:0,textLgap:0,textRgap:0})},_init:function(){BI.TextIconNode.superclass._init.apply(this,arguments);var o=this.options,c=this._const;this.text=BI.createWidget({type:"bi.label",cls:"list-item-text",textAlign:"left",hgap:o.textHgap,vgap:o.textVgap,lgap:o.textLgap,rgap:o.textRgap,text:o.text,value:o.value,keyword:o.keyword,height:o.height}),this.icon=BI.createWidget({type:"bi.icon_label",width:o.height,height:o.height,iconWidth:o.iconWidth,iconHeight:o.iconHeight}),BI.createWidget(BI.extend({element:this},BI.LogicFactory.createLogic("horizontal",BI.extend(o.logic,{items:BI.LogicFactory.createLogicItemsByDirection("left",this.text,this.icon)}))))},doClick:function(){BI.TextIconNode.superclass.doClick.apply(this,arguments),this.isValid()&&this.fireEvent(BI.TextIconNode.EVENT_CHANGE,this.getValue(),this)},setValue:function(){this.isReadOnly()||this.text.setValue.apply(this.text,arguments)},getValue:function(){return this.text.getValue()},setText:function(){this.text.setText.apply(this.text,arguments)},getText:function(){return this.text.getText()},doRedMark:function(){this.text.doRedMark.apply(this.text,arguments)},unRedMark:function(){this.text.unRedMark.apply(this.text,arguments)}}),BI.TextIconNode.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.text_icon_node",BI.TextIconNode),BI.TextNode=BI.inherit(BI.NodeButton,{_defaultConfig:function(){var conf=BI.TextNode.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{baseCls:(conf.baseCls||"")+" bi-text-node",textAlign:"left",whiteSpace:"nowrap",textHgap:0,textVgap:0,textLgap:0,textRgap:0})},_init:function(){BI.TextNode.superclass._init.apply(this,arguments);var o=this.options;this.text=BI.createWidget({type:"bi.label",element:this,textAlign:o.textAlign,whiteSpace:o.whiteSpace,textHeight:"nowrap"==o.whiteSpace?o.height:o.textHeight,height:o.height,hgap:o.textHgap,vgap:o.textVgap,lgap:o.textLgap,rgap:o.textRgap,text:o.text,value:o.value,keyword:o.keyword,py:o.py})},doClick:function(){BI.TextNode.superclass.doClick.apply(this,arguments),this.isValid()&&this.fireEvent(BI.TextNode.EVENT_CHANGE,this.getValue(),this)},doRedMark:function(){this.text.doRedMark.apply(this.text,arguments)},unRedMark:function(){this.text.unRedMark.apply(this.text,arguments)},setValue:function(){this.isReadOnly()||this.text.setValue.apply(this.text,arguments)},getValue:function(){return this.text.getValue()},setText:function(){this.text.setText.apply(this.text,arguments)},getText:function(){return this.text.getText()}}),BI.TextNode.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.text_node",BI.TextNode),BI.Editor=BI.inherit(BI.Single,{_defaultConfig:function(){var conf=BI.Editor.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{baseCls:"bi-editor bi-focus-shadow",hgap:4,vgap:2,lgap:0,rgap:0,tgap:0,bgap:0,tipType:"warning",inputType:"text",validationChecker:BI.emptyFn,quitChecker:BI.emptyFn,allowBlank:!1,watermark:"",errorText:""})},_init:function(){BI.Editor.superclass._init.apply(this,arguments);var self=this,o=this.options;this.editor=this.addWidget(BI.createWidget({type:"bi.input",element:"",root:!0,value:o.value,watermark:o.watermark,validationChecker:o.validationChecker,quitChecker:o.quitChecker,allowBlank:o.allowBlank})),this.editor.element.css({width:"100%",height:"100%",border:"none",outline:"none",padding:"0",margin:"0"}),BI.isKey(this.options.watermark)&&this._assertWaterMark();var _items=[];this.watermark&&_items.push({el:this.watermark,left:3,right:3,top:0,bottom:0}),_items.push({el:this.editor,left:0,right:0,top:0,bottom:0});var items=[{el:{type:"bi.absolute",ref:function(_ref){self.contentWrapper=_ref},items:_items},left:o.hgap+o.lgap,right:o.hgap+o.rgap,top:o.vgap+o.tgap,bottom:o.vgap+o.bgap}];BI.createWidget({type:"bi.absolute",element:this,items:items}),this.editor.on(BI.Controller.EVENT_CHANGE,function(){self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.editor.on(BI.Input.EVENT_FOCUS,function(){self._checkError(),self.element.addClass("bi-editor-focus"),self.fireEvent(BI.Editor.EVENT_FOCUS,arguments)}),this.editor.on(BI.Input.EVENT_BLUR,function(){self._setErrorVisible(!1),self.element.removeClass("bi-editor-focus"),self.fireEvent(BI.Editor.EVENT_BLUR,arguments)}),this.editor.on(BI.Input.EVENT_CLICK,function(){self.fireEvent(BI.Editor.EVENT_CLICK,arguments)}),this.editor.on(BI.Input.EVENT_CHANGE,function(){self.fireEvent(BI.Editor.EVENT_CHANGE,arguments)}),this.editor.on(BI.Input.EVENT_KEY_DOWN,function(v){self.fireEvent(BI.Editor.EVENT_KEY_DOWN,arguments)}),this.editor.on(BI.Input.EVENT_QUICK_DOWN,function(e){e.keyCode!==BI.KeyCode.TAB&&self.watermark&&self.watermark.invisible()}),this.editor.on(BI.Input.EVENT_VALID,function(){self._checkWaterMark(),self._setErrorVisible(!1),self.fireEvent(BI.Editor.EVENT_VALID,arguments)}),this.editor.on(BI.Input.EVENT_ERROR,function(){self._checkWaterMark(),self.fireEvent(BI.Editor.EVENT_ERROR,arguments),self._setErrorVisible(self.isEditing())}),this.editor.on(BI.Input.EVENT_RESTRICT,function(){self._checkWaterMark();var tip=self._setErrorVisible(!0);tip&&tip.element.fadeOut(100,function(){tip.element.fadeIn(100)}),self.fireEvent(BI.Editor.EVENT_RESTRICT,arguments)}),this.editor.on(BI.Input.EVENT_EMPTY,function(){self._checkWaterMark(),self.fireEvent(BI.Editor.EVENT_EMPTY,arguments)}),this.editor.on(BI.Input.EVENT_ENTER,function(){self.fireEvent(BI.Editor.EVENT_ENTER,arguments)}),this.editor.on(BI.Input.EVENT_SPACE,function(){self.fireEvent(BI.Editor.EVENT_SPACE,arguments)}),this.editor.on(BI.Input.EVENT_BACKSPACE,function(){self.fireEvent(BI.Editor.EVENT_BACKSPACE,arguments)}),this.editor.on(BI.Input.EVENT_REMOVE,function(){self.fireEvent(BI.Editor.EVENT_REMOVE,arguments)}),this.editor.on(BI.Input.EVENT_START,function(){self.fireEvent(BI.Editor.EVENT_START,arguments)}),this.editor.on(BI.Input.EVENT_PAUSE,function(){self.fireEvent(BI.Editor.EVENT_PAUSE,arguments)}),this.editor.on(BI.Input.EVENT_STOP,function(){self.fireEvent(BI.Editor.EVENT_STOP,arguments)}),this.editor.on(BI.Input.EVENT_CONFIRM,function(){self.fireEvent(BI.Editor.EVENT_CONFIRM,arguments)}),this.editor.on(BI.Input.EVENT_CHANGE_CONFIRM,function(){self.fireEvent(BI.Editor.EVENT_CHANGE_CONFIRM,arguments)}),this.element.click(function(e){return e.stopPropagation(),!1}),BI.isKey(this.options.value)||BI.isEmptyString(this.options.value)?(this._checkError(),this._checkWaterMark()):this._checkWaterMark()},_checkToolTip:function(){var o=this.options,errorText=o.errorText;BI.isFunction(errorText)&&(errorText=errorText(this.editor.getValue())),BI.isKey(errorText)&&(!this.isEnabled()||this.isValid()||BI.Bubbles.has(this.getName())&&BI.Bubbles.get(this.getName()).isVisible()?this.setTitle(""):this.setTitle(errorText))},_assertWaterMark:function(){var self=this,o=this.options;BI.isNull(this.watermark)&&(this.watermark=BI.createWidget({type:"bi.label",cls:"bi-water-mark",text:this.options.watermark,height:o.height-2*(o.vgap+o.tgap),whiteSpace:"nowrap",textAlign:"left"}),this.watermark.element.bind({mousedown:function(e){self.isEnabled()?self.editor.isEditing()||self.editor.focus():self.editor.isEditing()&&self.editor.blur(),e.stopEvent()}}),this.watermark.element.bind("click",function(e){self.isEnabled()?self.editor.isEditing()||self.editor.focus():self.editor.isEditing()&&self.editor.blur(),e.stopEvent()}))},_checkError:function(){this._setErrorVisible(this.isEnabled()&&!this.isValid()),this._checkToolTip()},_checkWaterMark:function(){var o=this.options;!this.disabledWaterMark&&""===this.editor.getValue()&&BI.isKey(o.watermark)?this.watermark&&this.watermark.visible():this.watermark&&this.watermark.invisible()},setErrorText:function(text){this.options.errorText=text},getErrorText:function(){return this.options.errorText},setWaterMark:function(v){this.options.watermark=v,BI.isNull(this.watermark)&&(this._assertWaterMark(),BI.createWidget({type:"bi.absolute",element:this.contentWrapper,items:[{el:this.watermark,left:3,right:3,top:0,bottom:0}]})),BI.isKey(v)&&this.watermark.setText(v)},_setErrorVisible:function(b){var o=this.options,errorText=o.errorText;if(BI.isFunction(errorText)&&(errorText=errorText(BI.trim(this.editor.getValue()))),!this.disabledError&&BI.isKey(errorText))return BI.Bubbles[b?"show":"hide"](this.getName(),errorText,this,{adjustYOffset:2}),this._checkToolTip(),BI.Bubbles.get(this.getName())},disableError:function(){this.disabledError=!0,this._checkError()},enableError:function(){this.disabledError=!1,this._checkError()},disableWaterMark:function(){this.disabledWaterMark=!0,this._checkWaterMark()},enableWaterMark:function(){this.disabledWaterMark=!1,this._checkWaterMark()},focus:function(){this.element.addClass("text-editor-focus"),this.editor.focus()},blur:function(){this.element.removeClass("text-editor-focus"),this.editor.blur()},selectAll:function(){this.editor.selectAll()},onKeyDown:function(k){this.editor.onKeyDown(k)},setValue:function(v){BI.Editor.superclass.setValue.apply(this,arguments),this.editor.setValue(v),this._checkError(),this._checkWaterMark()},getLastValidValue:function(){return this.editor.getLastValidValue()},getLastChangedValue:function(){return this.editor.getLastChangedValue()},getValue:function(){return this.isValid()?BI.trim(this.editor.getValue()):BI.trim(this.editor.getLastValidValue())},isEditing:function(){return this.editor.isEditing()},isValid:function(){return this.editor.isValid()},destroyed:function(){BI.Bubbles.remove(this.getName())}}),BI.Editor.EVENT_CHANGE="EVENT_CHANGE",BI.Editor.EVENT_FOCUS="EVENT_FOCUS",BI.Editor.EVENT_BLUR="EVENT_BLUR",BI.Editor.EVENT_CLICK="EVENT_CLICK",BI.Editor.EVENT_KEY_DOWN="EVENT_KEY_DOWN",BI.Editor.EVENT_SPACE="EVENT_SPACE",BI.Editor.EVENT_BACKSPACE="EVENT_BACKSPACE",BI.Editor.EVENT_START="EVENT_START",BI.Editor.EVENT_PAUSE="EVENT_PAUSE",BI.Editor.EVENT_STOP="EVENT_STOP",BI.Editor.EVENT_CONFIRM="EVENT_CONFIRM",BI.Editor.EVENT_CHANGE_CONFIRM="EVENT_CHANGE_CONFIRM",BI.Editor.EVENT_VALID="EVENT_VALID",BI.Editor.EVENT_ERROR="EVENT_ERROR",BI.Editor.EVENT_ENTER="EVENT_ENTER",BI.Editor.EVENT_RESTRICT="EVENT_RESTRICT",BI.Editor.EVENT_REMOVE="EVENT_REMOVE",BI.Editor.EVENT_EMPTY="EVENT_EMPTY",BI.shortcut("bi.editor",BI.Editor),BI.MultifileEditor=BI.inherit(BI.Widget,{_defaultConfig:function(){var conf=BI.MultifileEditor.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{baseCls:(conf.baseCls||"")+" bi-multifile-editor",multiple:!1,maxSize:-1,accept:"",url:""})},_init:function(){var self=this,o=this.options;BI.MultifileEditor.superclass._init.apply(this,arguments),this.file=BI.createWidget({type:"bi.file",cls:"multifile-editor",width:"100%",height:"100%",name:o.name,url:o.url,multiple:o.multiple,accept:o.accept,maxSize:o.maxSize,title:o.title}),this.file.on(BI.File.EVENT_CHANGE,function(){self.fireEvent(BI.MultifileEditor.EVENT_CHANGE,arguments)}),this.file.on(BI.File.EVENT_UPLOADSTART,function(){self.fireEvent(BI.MultifileEditor.EVENT_UPLOADSTART,arguments)}),this.file.on(BI.File.EVENT_ERROR,function(){self.fireEvent(BI.MultifileEditor.EVENT_ERROR,arguments)}),this.file.on(BI.File.EVENT_PROGRESS,function(){self.fireEvent(BI.MultifileEditor.EVENT_PROGRESS,arguments)}),this.file.on(BI.File.EVENT_UPLOADED,function(){self.fireEvent(BI.MultifileEditor.EVENT_UPLOADED,arguments)}),BI.createWidget({type:"bi.absolute",element:this,items:[{el:{type:"bi.adaptive",scrollable:!1,items:[this.file]},top:0,right:0,left:0,bottom:0}]})},select:function(){this.file.select()},getValue:function(){return this.file.getValue()},upload:function(){this.file.upload()},reset:function(){this.file.reset()}}),BI.MultifileEditor.EVENT_CHANGE="EVENT_CHANGE",BI.MultifileEditor.EVENT_UPLOADSTART="EVENT_UPLOADSTART",BI.MultifileEditor.EVENT_ERROR="EVENT_ERROR",BI.MultifileEditor.EVENT_PROGRESS="EVENT_PROGRESS",BI.MultifileEditor.EVENT_UPLOADED="EVENT_UPLOADED",BI.shortcut("bi.multifile_editor",BI.MultifileEditor),BI.TextAreaEditor=BI.inherit(BI.Single,{_defaultConfig:function(){return BI.extend(BI.TextAreaEditor.superclass._defaultConfig.apply(),{baseCls:"bi-textarea-editor",value:""})},render:function(){var o=this.options,self=this;this.content=BI.createWidget({type:"bi.layout",tagName:"textarea",width:"100%",height:"100%",cls:"bi-textarea textarea-editor-content display-block"}),this.content.element.css({resize:"none"}),BI.createWidget({type:"bi.absolute",element:this,items:[{el:{type:"bi.adaptive",items:[this.content]},left:4,right:4,top:4,bottom:8}]}),this.content.element.on("input propertychange",function(e){self._checkWaterMark(),self.fireEvent(BI.TextAreaEditor.EVENT_CHANGE)}),this.content.element.focus(function(){self.isValid()&&(self._focus(),self.fireEvent(BI.TextAreaEditor.EVENT_FOCUS)),BI.Widget._renderEngine.createElement(document).bind("mousedown."+self.getName(),function(e){BI.DOM.isExist(self)&&!self.element.__isMouseInBounds__(e)&&(BI.Widget._renderEngine.createElement(document).unbind("mousedown."+self.getName()),self.content.element.blur())})}),this.content.element.blur(function(){self.isValid()&&(self._blur(),self.fireEvent(BI.TextAreaEditor.EVENT_BLUR)),BI.Widget._renderEngine.createElement(document).unbind("mousedown."+self.getName())}),BI.isKey(o.value)&&this.setValue(o.value),BI.isNotNull(o.style)&&this.setStyle(o.style),this._checkWaterMark()},_checkWaterMark:function(){var self=this,o=this.options,val=this.getValue();BI.isNotEmptyString(val)?(this.watermark&&this.watermark.destroy(),this.watermark=null):BI.isNotEmptyString(o.watermark)&&(this.watermark?(this.watermark.setText(o.watermark),this.watermark.setValid(!o.invalid),this.watermark.setEnable(!o.disabled)):(this.watermark=BI.createWidget({type:"bi.text_button",cls:"bi-water-mark cursor-default",textAlign:"left",whiteSpace:"normal",text:o.watermark,invalid:o.invalid,disabled:o.disabled}),this.watermark.on(BI.TextButton.EVENT_CHANGE,function(){self.focus()}),BI.createWidget({type:"bi.absolute",element:this,items:[{el:this.watermark,left:4,top:4,right:0}]})))},_focus:function(){this.content.element.addClass("textarea-editor-focus"),this._checkWaterMark()},_blur:function(){this.content.element.removeClass("textarea-editor-focus"),this._checkWaterMark()},focus:function(){this._focus(),this.content.element.focus()},blur:function(){this._blur(),this.content.element.blur()},getValue:function(){return this.content.element.val()},setValue:function(value){this.content.element.val(value),this._checkWaterMark()},setStyle:function(style){this.style=style,this.element.css(style),this.content.element.css(BI.extend({},style,{color:style.color||BI.DOM.getContrastColor(BI.DOM.isRGBColor(style.backgroundColor)?BI.DOM.rgb2hex(style.backgroundColor):style.backgroundColor)}))},getStyle:function(){return this.style},_setValid:function(b){BI.TextAreaEditor.superclass._setValid.apply(this,arguments)},_setEnable:function(b){BI.TextAreaEditor.superclass._setEnable.apply(this,[b]),this.content&&(this.content.element[0].disabled=!b)}}),BI.TextAreaEditor.EVENT_CHANGE="EVENT_CHANGE",BI.TextAreaEditor.EVENT_BLUR="EVENT_BLUR",BI.TextAreaEditor.EVENT_FOCUS="EVENT_FOCUS",BI.shortcut("bi.textarea_editor",BI.TextAreaEditor),BI.Html=BI.inherit(BI.Single,{props:{baseCls:"bi-html",textAlign:"left",whiteSpace:"normal",lineHeight:null,handler:null,hgap:0,vgap:0,lgap:0,rgap:0,tgap:0,bgap:0,text:"",highLight:!1},render:function(){var self=this,o=this.options;o.hgap+o.lgap>0&&this.element.css({"padding-left":o.hgap+o.lgap+"px"}),o.hgap+o.rgap>0&&this.element.css({"padding-right":o.hgap+o.rgap+"px"}),o.vgap+o.tgap>0&&this.element.css({"padding-top":o.vgap+o.tgap+"px"}),o.vgap+o.bgap>0&&this.element.css({"padding-bottom":o.vgap+o.bgap+"px"}),BI.isNumber(o.height)&&this.element.css({lineHeight:o.height+"px"}),BI.isNumber(o.lineHeight)&&this.element.css({lineHeight:o.lineHeight+"px"}),BI.isWidthOrHeight(o.maxWidth)&&this.element.css({maxWidth:o.maxWidth}),this.element.css({textAlign:o.textAlign,whiteSpace:o.whiteSpace,textOverflow:"nowrap"===o.whiteSpace?"ellipsis":"",overflow:"nowrap"===o.whiteSpace?"":"auto"}),o.handler?(this.text=BI.createWidget({type:"bi.layout",tagName:"span"}),this.text.element.click(function(){o.handler(self.getValue())}),BI.createWidget({type:"bi.default",element:this,items:[this.text]})):this.text=this,BI.isKey(o.text)?this.setText(o.text):BI.isKey(o.value)&&this.setText(o.value),o.highLight&&this.doHighLight()},doHighLight:function(){this.text.element.addClass("bi-high-light")},unHighLight:function(){this.text.element.removeClass("bi-high-light")},setValue:function(text){BI.Html.superclass.setValue.apply(this,arguments),this.isReadOnly()||this.setText(text)},setStyle:function(css){this.text.element.css(css)},setText:function(text){BI.Html.superclass.setText.apply(this,arguments),this.options.text=text,this.text.element.html(text)}}),BI.shortcut("bi.html",BI.Html),BI.Icon=BI.inherit(BI.Single,{_defaultConfig:function(){var conf=BI.Icon.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{tagName:"i",baseCls:(conf.baseCls||"")+" x-icon b-font horizon-center display-block"})},_init:function(){BI.Icon.superclass._init.apply(this,arguments),BI.isIE9Below&&BI.isIE9Below()&&this.element.addClass("hack")}}),BI.shortcut("bi.icon",BI.Icon),BI.Iframe=BI.inherit(BI.Single,{_defaultConfig:function(){var conf=BI.Iframe.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{tagName:"iframe",baseCls:(conf.baseCls||"")+" bi-iframe",src:"",name:"",attributes:{},width:"100%",height:"100%"})},_init:function(){var o=this.options;o.attributes.frameborder="0",o.attributes.src=o.src,o.attributes.name=o.name,BI.Iframe.superclass._init.apply(this,arguments)},setSrc:function(src){this.options.src=src,this.element.attr("src",src)},getSrc:function(){return this.options.src},setName:function(name){this.options.name=name,this.element.attr("name",name)},getName:function(){return this.options.name}}),BI.shortcut("bi.iframe",BI.Iframe),BI.Img=BI.inherit(BI.Single,{_defaultConfig:function(){var conf=BI.Img.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{tagName:"img",baseCls:(conf.baseCls||"")+" bi-img display-block",src:"",attributes:{},width:"100%",height:"100%"})},_init:function(){var o=this.options;o.attributes.src=o.src,BI.Img.superclass._init.apply(this,arguments); +},setSrc:function(src){this.options.src=src,this.element.attr("src",src)},getSrc:function(){return this.options.src}}),BI.shortcut("bi.img",BI.Img),BI.ImageCheckbox=BI.inherit(BI.IconButton,{_defaultConfig:function(){var conf=BI.ImageCheckbox.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{baseCls:(conf.baseCls||"")+" bi-image-checkbox check-box-icon",selected:!1,handler:BI.emptyFn,width:16,height:16,iconWidth:16,iconHeight:16})}}),BI.ImageCheckbox.EVENT_CHANGE=BI.IconButton.EVENT_CHANGE,BI.shortcut("bi.image_checkbox",BI.ImageCheckbox),BI.Checkbox=BI.inherit(BI.BasicButton,{props:{baseCls:"bi-checkbox",selected:!1,handler:BI.emptyFn,width:16,height:16,iconWidth:16,iconHeight:16},render:function(){var self=this,o=this.options;return{type:"bi.center_adapt",items:[{type:"bi.default",ref:function(_ref){self.checkbox=_ref},cls:"checkbox-content",width:o.iconWidth-2,height:o.iconHeight-2}]}},_setEnable:function(enable){BI.Checkbox.superclass._setEnable.apply(this,arguments),enable===!0?this.checkbox.element.removeClass("base-disabled disabled"):this.checkbox.element.addClass("base-disabled disabled")},doClick:function(){BI.Checkbox.superclass.doClick.apply(this,arguments),this.isValid()&&this.fireEvent(BI.Checkbox.EVENT_CHANGE)},setSelected:function(b){BI.Checkbox.superclass.setSelected.apply(this,arguments),b?this.checkbox.element.addClass("bi-high-light-background"):this.checkbox.element.removeClass("bi-high-light-background")}}),BI.Checkbox.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.checkbox",BI.Checkbox),function(document){var F=function(item){return function(input){var files=input.files||[input];return files.item||(files.item=item),files}}(function(i){return this[i]}),event={add:document.addEventListener?function(node,name,callback){return node.addEventListener(name,callback,!1),this}:function(node,name,callback){return node.attachEvent("on"+name,callback),this},del:document.removeEventListener?function(node,name,callback){return node.removeEventListener(name,callback,!1),this}:function(node,name,callback){return node.detachEvent("on"+name,callback),this},stop:function(e){return e?(e.stopPropagation?e.stopPropagation():e.cancelBubble=!0,e.preventDefault?e.preventDefault():e.returnValue=!1):self.event&&(event.returnValue=!(event.cancelBubble=!0)),!1}},sendFile=function(toString){var multipart=function(boundary,name,file){return"--".concat(boundary,CRLF,'Content-Disposition: form-data; name="',name,'"; filename="',_global.encodeURIComponent(file.fileName),'"',CRLF,"Content-Type: application/octet-stream",CRLF,CRLF,file.getAsBinary(),CRLF,"--",boundary,"--",CRLF)},isFunction=function(Function){return"[object Function]"===toString.call(Function)},split="onabort.onerror.onloadstart.onprogress".split("."),length=split.length,CRLF="\r\n",xhr=this.XMLHttpRequest?new XMLHttpRequest:new ActiveXObject("Microsoft.XMLHTTP"),sendFile;return sendFile=xhr.upload||xhr.sendAsBinary?function(handler,maxSize,width,height){if(-1'),iframe=handler.iframe||(handler.iframe=document.createElement(''))}catch(e){var form=document.createElement("form"),iframe=handler.iframe||(handler.iframe=document.createElement("iframe"));form.setAttribute("enctype","multipart/form-data"),iframe.setAttribute("name",iframe.id=target),iframe.setAttribute("src",url)}with(iframe.style.position="absolute",iframe.style.left=iframe.style.top="-10000px",iframe.onload=onload,iframe.onerror=function(event){isFunction(handler.onerror)&&handler.onerror(rpe,event||_global.event)},iframe.onreadystatechange=function(){/loaded|complete/i.test(iframe.readyState)?onload():isFunction(handler.onloadprogress)&&(rpe.loadedxhr.status||xhr.status>399)return BI.Msg.toast(BI.i18nText("BI-Upload_File_Error"),{level:"error"}),void self.fireEvent(BI.File.EVENT_ERROR);var error=BI.some(_wrap.attach_array,function(index,attach){if(attach.errorCode)return BI.Msg.toast(attach.errorMsg,{level:"error"}),self.fireEvent(BI.File.EVENT_ERROR,attach),!0});!error&&self.fireEvent(BI.File.EVENT_UPLOADED)},1e3)},_wrap.url=o.url,_wrap.fileType=o.accept,_wrap.attach_array=[],_wrap.attach_names=[],_wrap.attachNum=0},_events:function(wrap){var self=this;return event.add(wrap.dom.input,"change",function(){event.del(wrap.dom.input,"change",arguments.callee);for(var input=wrap.dom.input.cloneNode(!0),i=0,files=F(wrap.dom.input);i0&&self.fireEvent(BI.File.EVENT_CHANGE,{files:wrap.files}),input.value="",wrap.dom.input.parentNode.replaceChild(input,wrap.dom.input),wrap.dom.input=input,event.add(wrap.dom.input,"change",arguments.callee)}),wrap},_wrap:function(){var self=this,o=this.options,input=this.element[0];return o.multiple===!0&&this.element.attr("multiple","multiple"),input.value="",this._events({dom:{input:input,disabled:!1},name:input.name,maxSize:o.maxSize?o.maxSize>>0:-1,files:[],clean:function(){this.files=[]},upload:function(handler){if(handler)for(var key in handler)this[key]=handler[key];return sendFiles(this,this.maxSize),this},hide:function(){this.dom.disabled&&(this.dom.disabled=!1,this.dom.input.removeAttribute("disabled"))},show:function(total,current,totalProp,currentProp){this.dom.disabled||(this.dom.disabled=!0,this.dom.input.setAttribute("disabled","disabled"))}})},select:function(){this.wrap&&BI.Widget._renderEngine.createElement(this.wrap.dom.input).click()},upload:function(handler){this.wrap&&this.wrap.upload(handler)},getValue:function(){return this.wrap?this.wrap.attach_array:[]},reset:function(){this.wrap&&(this.wrap.attach_array=[],this.wrap.attach_names=[],this.wrap.attachNum=0)},_setEnable:function(enable){BI.File.superclass._setEnable.apply(this,arguments),enable===!0?this.element.attr("disabled","disabled"):this.element.removeAttr("disabled")}}),BI.File.EVENT_CHANGE="EVENT_CHANGE",BI.File.EVENT_UPLOADSTART="EVENT_UPLOADSTART",BI.File.EVENT_ERROR="EVENT_ERROR",BI.File.EVENT_PROGRESS="EVENT_PROGRESS",BI.File.EVENT_UPLOADED="EVENT_UPLOADED",BI.shortcut("bi.file",BI.File)}(_global.document||{}),BI.Input=BI.inherit(BI.Single,{_defaultConfig:function(){var conf=BI.Input.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{baseCls:(conf.baseCls||"")+" bi-input display-block overflow-dot",tagName:"input",validationChecker:BI.emptyFn,quitChecker:BI.emptyFn,allowBlank:!1})},_init:function(){BI.Input.superclass._init.apply(this,arguments);var self=this,ctrlKey=!1,keyCode=null,inputEventValid=!1,_keydown=BI.debounce(function(keyCode){self.onKeyDown(keyCode,ctrlKey),self._keydown_=!1},300),_clk=BI.debounce(BI.bind(this._click,this),BI.EVENT_RESPONSE_TIME,{leading:!0,trailing:!1});this._focusDebounce=BI.debounce(BI.bind(this._focus,this),BI.EVENT_RESPONSE_TIME,{leading:!0,trailing:!1}),this._blurDebounce=BI.debounce(BI.bind(this._blur,this),BI.EVENT_RESPONSE_TIME,{leading:!0,trailing:!1}),this.element.keydown(function(e){inputEventValid=!1,ctrlKey=e.ctrlKey||e.metaKey,keyCode=e.keyCode,self.fireEvent(BI.Input.EVENT_QUICK_DOWN,arguments)}).keyup(function(e){keyCode=null,inputEventValid&&e.keyCode===BI.KeyCode.ENTER||(self._keydown_=!0,_keydown(e.keyCode))}).on("input propertychange",function(e){var originalEvent=e.originalEvent;(BI.isNull(originalEvent.propertyName)||"value"===originalEvent.propertyName)&&(inputEventValid=!0,self._keydown_=!0,_keydown(keyCode),keyCode=null)}).click(function(e){e.stopPropagation(),_clk()}).mousedown(function(e){self.element.val(self.element.val())}).focus(function(e){self._focusDebounce()}).focusout(function(e){self._blurDebounce()}),(BI.isKey(this.options.value)||BI.isEmptyString(this.options.value))&&this.setValue(this.options.value)},_focus:function(){this.element.addClass("bi-input-focus"),this._checkValidationOnValueChange(),this._isEditing=!0,""==this.getValue()&&(this.fireEvent(BI.Controller.EVENT_CHANGE,BI.Events.EMPTY,this.getValue(),this),this.fireEvent(BI.Input.EVENT_EMPTY)),this.fireEvent(BI.Input.EVENT_FOCUS)},_blur:function(){function blur(){if(self.isValid()||self.options.quitChecker.apply(self,[BI.trim(self.getValue())])===!1||(self.element.val(self._lastValidValue?self._lastValidValue:""),self._checkValidationOnValueChange(),self._defaultState()),self.element.removeClass("bi-input-focus"),self._isEditing=!1,self._start=!1,self.isValid()){var lastValidValue=self._lastValidValue;self._lastValidValue=self.getValue(),self.fireEvent(BI.Controller.EVENT_CHANGE,BI.Events.CONFIRM,self.getValue(),self),self.fireEvent(BI.Input.EVENT_CONFIRM),self._lastValidValue!==lastValidValue&&self.fireEvent(BI.Input.EVENT_CHANGE_CONFIRM)}self.fireEvent(BI.Input.EVENT_BLUR)}var self=this;self._keydown_===!0?BI.delay(blur,300):blur()},_click:function(){this._isEditing!==!0&&(this.selectAll(),this.fireEvent(BI.Input.EVENT_CLICK))},onClick:function(){this._click()},onKeyDown:function(keyCode,ctrlKey){this.isValid()&&BI.trim(this._lastChangedValue)===BI.trim(this.getValue())||this._checkValidationOnValueChange(),this.isValid()&&""!==BI.trim(this.getValue())&&((BI.trim(this.getValue())===this._lastValue||this._start&&null!=this._lastValue&&""!==this._lastValue)&&(this._pause!==!0||/(\s|\u00A0)$/.test(this.getValue()))||(this._start=!0,this._pause=!1,this.fireEvent(BI.Controller.EVENT_CHANGE,BI.Events.STARTEDIT,this.getValue(),this),this.fireEvent(BI.Input.EVENT_START))),keyCode==BI.KeyCode.ENTER&&(this.isValid()||this.options.quitChecker.apply(this,[BI.trim(this.getValue())])!==!1?(this.blur(),this.fireEvent(BI.Input.EVENT_ENTER)):this.fireEvent(BI.Input.EVENT_RESTRICT)),keyCode==BI.KeyCode.SPACE&&this.fireEvent(BI.Input.EVENT_SPACE),keyCode==BI.KeyCode.BACKSPACE&&""==this._lastValue&&this.fireEvent(BI.Input.EVENT_REMOVE),keyCode!=BI.KeyCode.BACKSPACE&&keyCode!=BI.KeyCode.DELETE||this.fireEvent(BI.Input.EVENT_BACKSPACE),this.fireEvent(BI.Input.EVENT_KEY_DOWN,arguments);var lastValue=this._lastValue;BI.trim(this.getValue())!==BI.trim(this._lastValue||"")&&this._valueChange(),BI.isEndWithBlank(this.getValue())?(this._pause=!0,this.fireEvent(BI.Controller.EVENT_CHANGE,BI.Events.PAUSE,"",this),this.fireEvent(BI.Input.EVENT_PAUSE),this._defaultState()):keyCode!==BI.KeyCode.BACKSPACE&&keyCode!==BI.KeyCode.DELETE||""!==BI.trim(this.getValue())||null===lastValue||""===BI.trim(lastValue)||(this.fireEvent(BI.Controller.EVENT_CHANGE,BI.Events.STOPEDIT,this.getValue(),this),this.fireEvent(BI.Input.EVENT_STOP))},_defaultState:function(){""==this.getValue()&&(this.fireEvent(BI.Controller.EVENT_CHANGE,BI.Events.EMPTY,this.getValue(),this),this.fireEvent(BI.Input.EVENT_EMPTY)),this._lastValue=this.getValue(),this._lastSubmitValue=null},_valueChange:function(){this.isValid()&&BI.trim(this.getValue())!==this._lastSubmitValue&&(this.fireEvent(BI.Controller.EVENT_CHANGE,BI.Events.CHANGE,this.getValue(),this),this.fireEvent(BI.Input.EVENT_CHANGE),this._lastSubmitValue=BI.trim(this.getValue())),""==this.getValue()&&(this.fireEvent(BI.Controller.EVENT_CHANGE,BI.Events.EMPTY,this.getValue(),this),this.fireEvent(BI.Input.EVENT_EMPTY)),this._lastValue=this.getValue()},_checkValidationOnValueChange:function(){var o=this.options,v=this.getValue();this.setValid(o.allowBlank===!0&&""==BI.trim(v)||BI.isNotEmptyString(BI.trim(v))&&o.validationChecker.apply(this,[BI.trim(v)])!==!1)},focus:function(){if(!this.element.is(":visible"))throw new Error("input输入框在不可见下不能focus");!this._isEditing==!0&&(this.element.focus(),this.selectAll())},blur:function(){if(!this.element.is(":visible"))throw new Error("input输入框在不可见下不能blur");this._isEditing===!0&&(this.element.blur(),this._blurDebounce())},selectAll:function(){if(!this.element.is(":visible"))throw new Error("input输入框在不可见下不能select");this.element.select(),this._isEditing=!0},setValue:function(textValue){this.element.val(textValue),BI.nextTick(BI.bind(function(){this._checkValidationOnValueChange(),this._defaultState(),this.isValid()&&(this._lastValidValue=this._lastSubmitValue=this.getValue())},this))},getValue:function(){return this.element.val()||""},isEditing:function(){return this._isEditing},getLastValidValue:function(){return this._lastValidValue},getLastChangedValue:function(){return this._lastChangedValue},_setValid:function(){BI.Input.superclass._setValid.apply(this,arguments),this.isValid()?(this._lastChangedValue=this.getValue(),this.element.removeClass("bi-input-error"),this.fireEvent(BI.Input.EVENT_VALID,BI.trim(this.getValue()),this)):(this._lastChangedValue===this.getValue()&&(this._lastChangedValue=null),this.element.addClass("bi-input-error"),this.fireEvent(BI.Input.EVENT_ERROR,BI.trim(this.getValue()),this))},_setEnable:function(b){BI.Input.superclass._setEnable.apply(this,[b]),this.element[0].disabled=!b}}),BI.Input.EVENT_CHANGE="EVENT_CHANGE",BI.Input.EVENT_FOCUS="EVENT_FOCUS",BI.Input.EVENT_CLICK="EVENT_CLICK",BI.Input.EVENT_BLUR="EVENT_BLUR",BI.Input.EVENT_KEY_DOWN="EVENT_KEY_DOWN",BI.Input.EVENT_QUICK_DOWN="EVENT_QUICK_DOWN",BI.Input.EVENT_SPACE="EVENT_SPACE",BI.Input.EVENT_BACKSPACE="EVENT_BACKSPACE",BI.Input.EVENT_START="EVENT_START",BI.Input.EVENT_PAUSE="EVENT_PAUSE",BI.Input.EVENT_STOP="EVENT_STOP",BI.Input.EVENT_CHANGE_CONFIRM="EVENT_CHANGE_CONFIRM",BI.Input.EVENT_CONFIRM="EVENT_CONFIRM",BI.Input.EVENT_REMOVE="EVENT_REMOVE",BI.Input.EVENT_EMPTY="EVENT_EMPTY",BI.Input.EVENT_VALID="EVENT_VALID",BI.Input.EVENT_ERROR="EVENT_ERROR",BI.Input.EVENT_ENTER="EVENT_ENTER",BI.Input.EVENT_RESTRICT="EVENT_RESTRICT",BI.shortcut("bi.input",BI.Input),BI.ImageRadio=BI.inherit(BI.IconButton,{_defaultConfig:function(){var conf=BI.ImageRadio.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{baseCls:(conf.baseCls||"")+" bi-radio radio-icon",selected:!1,handler:BI.emptyFn,width:16,height:16,iconWidth:16,iconHeight:16})},_init:function(){BI.ImageRadio.superclass._init.apply(this,arguments)},doClick:function(){BI.ImageRadio.superclass.doClick.apply(this,arguments),this.isValid()&&this.fireEvent(BI.ImageRadio.EVENT_CHANGE)}}),BI.ImageRadio.EVENT_CHANGE=BI.IconButton.EVENT_CHANGE,BI.shortcut("bi.image_radio",BI.ImageRadio),BI.Radio=BI.inherit(BI.BasicButton,{props:{baseCls:"bi-radio",selected:!1,handler:BI.emptyFn,width:16,height:16,iconWidth:14,iconHeight:14},render:function(){var self=this,o=this.options;return{type:"bi.center_adapt",element:this.element,items:[{type:"bi.layout",cls:"radio-content",ref:function(_ref){self.radio=_ref},width:o.iconWidth,height:o.iconHeight}]}},_setEnable:function(enable){BI.Radio.superclass._setEnable.apply(this,arguments),enable===!0?this.radio.element.removeClass("base-disabled disabled"):this.radio.element.addClass("base-disabled disabled")},doClick:function(){BI.Radio.superclass.doClick.apply(this,arguments),this.isValid()&&this.fireEvent(BI.Radio.EVENT_CHANGE)},setSelected:function(b){BI.Radio.superclass.setSelected.apply(this,arguments),b?this.radio.element.addClass("bi-high-light-background"):this.radio.element.removeClass("bi-high-light-background")}}),BI.Radio.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.radio",BI.Radio),BI.AbstractLabel=BI.inherit(BI.Single,{_defaultConfig:function(props){var conf=BI.AbstractLabel.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{textAlign:"center",whiteSpace:"nowrap",textWidth:null,textHeight:null,hgap:0,vgap:0,lgap:0,rgap:0,tgap:0,bgap:0,text:"",highLight:!1})},_createJson:function(){var o=this.options;return{type:"bi.text",textAlign:o.textAlign,whiteSpace:o.whiteSpace,lineHeight:o.textHeight,text:o.text,value:o.value,py:o.py,keyword:o.keyword,highLight:o.highLight}},_init:function(){BI.AbstractLabel.superclass._init.apply(this,arguments),"center"===this.options.textAlign?this._createCenterEl():this._createNotCenterEl()},_createCenterEl:function(){var o=this.options,json=this._createJson();return json.textAlign="left",BI.isNumber(o.width)&&o.width>0?BI.isNumber(o.textWidth)&&o.textWidth>0?(json.maxWidth=o.textWidth,BI.isNumber(o.height)&&o.height>0?void BI.createWidget({type:"bi.center_adapt",height:o.height,scrollable:"normal"===o.whiteSpace,element:this,items:[{el:this.text=BI.createWidget(json)}]}):void BI.createWidget({type:"bi.center_adapt",scrollable:"normal"===o.whiteSpace,element:this,items:[{el:this.text=BI.createWidget(json)}]})):"normal"==o.whiteSpace?(BI.extend(json,{hgap:o.hgap,vgap:o.vgap,lgap:o.lgap,rgap:o.rgap,tgap:o.tgap,bgap:o.bgap}),this.text=BI.createWidget(json),void BI.createWidget({type:"bi.center_adapt",scrollable:"normal"===o.whiteSpace,element:this,items:[this.text]})):BI.isNumber(o.height)&&o.height>0?(this.element.css({"line-height":o.height+"px"}),json.textAlign=o.textAlign,void(this.text=BI.createWidget(BI.extend(json,{element:this,hgap:o.hgap,vgap:o.vgap,lgap:o.lgap,rgap:o.rgap,tgap:o.tgap,bgap:o.bgap})))):(BI.extend(json,{hgap:o.hgap,vgap:o.vgap,lgap:o.lgap,rgap:o.rgap,tgap:o.tgap,bgap:o.bgap,maxWidth:"100%"}),this.text=BI.createWidget(json),void BI.createWidget({type:"bi.center_adapt",scrollable:"normal"===o.whiteSpace,element:this,items:[this.text]})):BI.isNumber(o.textWidth)&&o.textWidth>0?(json.maxWidth=o.textWidth,void BI.createWidget({type:"bi.center_adapt",scrollable:"normal"===o.whiteSpace,element:this,items:[{el:this.text=BI.createWidget(json)}]})):"normal"==o.whiteSpace?(BI.extend(json,{hgap:o.hgap,vgap:o.vgap,lgap:o.lgap,rgap:o.rgap,tgap:o.tgap,bgap:o.bgap}),this.text=BI.createWidget(json),void BI.createWidget({type:"bi.center_adapt",scrollable:!0,element:this,items:[this.text]})):BI.isNumber(o.height)&&o.height>0?(this.element.css({"line-height":o.height+"px"}),json.textAlign=o.textAlign,void(this.text=BI.createWidget(BI.extend(json,{element:this,hgap:o.hgap,vgap:o.vgap,lgap:o.lgap,rgap:o.rgap,tgap:o.tgap,bgap:o.bgap})))):(BI.extend(json,{hgap:o.hgap,vgap:o.vgap,lgap:o.lgap,rgap:o.rgap,tgap:o.tgap,bgap:o.bgap}),this.text=BI.createWidget(BI.extend(json,{maxWidth:"100%"})),void BI.createWidget({type:"bi.center_adapt",element:this,items:[this.text]}))},_createNotCenterEl:function(){var o=this.options,adaptLayout="right"===o.textAlign?"bi.right_vertical_adapt":"bi.vertical_adapt",json=this._createJson();return BI.isNumber(o.width)&&o.width>0?BI.isNumber(o.textWidth)&&o.textWidth>0?(json.width=o.textWidth,BI.isNumber(o.height)&&o.height>0?void BI.createWidget({type:adaptLayout,height:o.height,scrollable:"normal"===o.whiteSpace,element:this,items:[{el:this.text=BI.createWidget(json)}]}):void BI.createWidget({type:adaptLayout,scrollable:"normal"===o.whiteSpace,hgap:o.hgap,vgap:o.vgap,lgap:o.lgap,rgap:o.rgap,tgap:o.tgap,bgap:o.bgap,element:this,items:[{el:this.text=BI.createWidget(json)}]})):BI.isNumber(o.height)&&o.height>0?(this.text=BI.createWidget(BI.extend(json,{element:this,hgap:o.hgap,vgap:o.vgap,lgap:o.lgap,rgap:o.rgap,tgap:o.tgap,bgap:o.bgap})),void("normal"!==o.whiteSpace&&this.element.css({"line-height":o.height-2*o.vgap+"px"}))):(json.width=o.width-2*o.hgap-o.lgap-o.rgap,void BI.createWidget({type:adaptLayout,scrollable:"normal"===o.whiteSpace,hgap:o.hgap,vgap:o.vgap,lgap:o.lgap,rgap:o.rgap,tgap:o.tgap,bgap:o.bgap,element:this,items:[{el:this.text=BI.createWidget(json)}]})):BI.isNumber(o.textWidth)&&o.textWidth>0?(json.width=o.textWidth,void BI.createWidget({type:adaptLayout,scrollable:"normal"===o.whiteSpace,hgap:o.hgap,vgap:o.vgap,lgap:o.lgap,rgap:o.rgap,tgap:o.tgap,bgap:o.bgap,element:this,items:[{el:this.text=BI.createWidget(json)}]})):BI.isNumber(o.height)&&o.height>0?("normal"!==o.whiteSpace&&this.element.css({"line-height":o.height-2*o.vgap+"px"}),void(this.text=BI.createWidget(BI.extend(json,{element:this,hgap:o.hgap,vgap:o.vgap,lgap:o.lgap,rgap:o.rgap,tgap:o.tgap,bgap:o.bgap})))):(BI.extend(json,{hgap:o.hgap,vgap:o.vgap,lgap:o.lgap,rgap:o.rgap,tgap:o.tgap,bgap:o.bgap}),this.text=BI.createWidget(BI.extend(json,{maxWidth:"100%"})),void BI.createWidget({type:adaptLayout,element:this,items:[this.text]}))},doRedMark:function(){this.text.doRedMark.apply(this.text,arguments)},unRedMark:function(){this.text.unRedMark.apply(this.text,arguments)},doHighLight:function(){this.text.doHighLight.apply(this.text,arguments)},unHighLight:function(){this.text.unHighLight.apply(this.text,arguments)},setText:function(v){this.options.text=v,this.text.setText(v)},getText:function(){return this.options.text},setStyle:function(css){this.text.setStyle(css)},setValue:function(v){BI.AbstractLabel.superclass.setValue.apply(this,arguments),this.isReadOnly()||this.text.setValue(v)},populate:function(){BI.AbstractLabel.superclass.populate.apply(this,arguments)}}),BI.HtmlLabel=BI.inherit(BI.AbstractLabel,{props:{baseCls:"bi-html-label"},_createJson:function(){var o=this.options;return{type:"bi.html",textAlign:o.textAlign,whiteSpace:o.whiteSpace,lineHeight:o.textHeight,text:o.text,value:o.value}}}),BI.shortcut("bi.html_label",BI.HtmlLabel),BI.IconLabel=BI.inherit(BI.Single,{props:{baseCls:"bi-icon-label horizon-center",iconWidth:null,iconHeight:null},_init:function(){BI.IconLabel.superclass._init.apply(this,arguments);var o=this.options;this.element.css({textAlign:"center"}),this.icon=BI.createWidget({type:"bi.icon",width:o.iconWidth,height:o.iconHeight}),BI.isNumber(o.height)&&o.height>0&&BI.isNull(o.iconWidth)&&BI.isNull(o.iconHeight)?(this.element.css("lineHeight",o.height+"px"),BI.createWidget({type:"bi.default",element:this,items:[this.icon]})):(this.element.css("lineHeight","1"),BI.createWidget({element:this,type:"bi.center_adapt",items:[this.icon]}))}}),BI.shortcut("bi.icon_label",BI.IconLabel),BI.Label=BI.inherit(BI.AbstractLabel,{props:{baseCls:"bi-label",py:"",keyword:""},_createJson:function(){var o=this.options;return{type:"bi.text",textAlign:o.textAlign,whiteSpace:o.whiteSpace,lineHeight:o.textHeight,text:o.text,value:o.value,py:o.py,keyword:o.keyword,highLight:o.highLight}},doRedMark:function(){this.text.doRedMark.apply(this.text,arguments)},unRedMark:function(){this.text.unRedMark.apply(this.text,arguments)}}),BI.shortcut("bi.label",BI.Label),BI.Link=BI.inherit(BI.Label,{_defaultConfig:function(){var conf=BI.Link.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{baseCls:(conf.baseCls||"")+" bi-link display-block",tagName:"a",href:"",target:"_blank"})},_createJson:function(){var o=this.options;return{type:"bi.a",textAlign:o.textAlign,whiteSpace:o.whiteSpace,lineHeight:o.textHeight,text:o.text,keyword:o.keyword,value:o.value,py:o.py,href:o.href,target:o.target}},_init:function(){BI.Link.superclass._init.apply(this,arguments)}}),BI.shortcut("bi.link",BI.Link),BI.Bubble=BI.inherit(BI.Tip,{_defaultConfig:function(){return BI.extend(BI.Bubble.superclass._defaultConfig.apply(this,arguments),{extraCls:"bi-bubble",direction:"top",text:"",level:"error",height:18})},_init:function(){BI.Bubble.superclass._init.apply(this,arguments);var fn=function(e){return e.stopPropagation(),e.stopEvent(),!1};this.element.bind({click:fn,mousedown:fn,mouseup:fn,mouseover:fn,mouseenter:fn,mouseleave:fn,mousemove:fn}),BI.createWidget({type:"bi.left",element:this,items:[this["_"+this.options.direction]()]})},_createBubbleText:function(){var o=this.options;return this.text=BI.createWidget({type:"bi.label",cls:"bubble-text bubble-"+o.level,text:o.text,hgap:5,height:18})},_top:function(){return BI.createWidget({type:"bi.vertical",items:[{el:this._createBubbleText(),height:18},{el:{type:"bi.layout"},height:3}]})},_bottom:function(){return BI.createWidget({type:"bi.vertical",items:[{el:{type:"bi.layout"},height:3},{el:this._createBubbleText(),height:18}]})},_left:function(){return BI.createWidget({type:"bi.right",items:[{el:{type:"bi.layout",width:3,height:18}},{el:this._createBubbleText()}]})},_right:function(){return BI.createWidget({type:"bi.left",items:[{el:{type:"bi.layout",width:3,height:18}},{el:this._createBubbleText()}]})},setText:function(text){this.text.setText(text)}}),BI.shortcut("bi.bubble",BI.Bubble),BI.Toast=BI.inherit(BI.Tip,{_const:{minWidth:200,hgap:10},_defaultConfig:function(){return BI.extend(BI.Toast.superclass._defaultConfig.apply(this,arguments),{extraCls:"bi-toast",text:"",level:"success"})},_init:function(){BI.Toast.superclass._init.apply(this,arguments);var self=this,o=this.options;this.element.css({minWidth:this._const.minWidth+"px"}),this.element.addClass("toast-"+o.level);var fn=function(e){return e.stopPropagation(),e.stopEvent(),!1};this.element.bind({click:fn,mousedown:fn,mouseup:fn,mouseover:fn,mouseenter:fn,mouseleave:fn,mousemove:fn});var cls="close-font";switch(o.level){case"success":cls="toast-success-font";break;case"error":cls="toast-error-font";break;case"warning":cls="toast-warning-font";break;case"normal":default:cls="toast-message-font"}var items=[{type:"bi.icon_label",cls:cls+" toast-icon",width:36},{el:{type:"bi.label",whiteSpace:"normal",text:o.text,textHeight:16,textAlign:"left"},rgap:o.autoClose?this._const.hgap:0}],columnSize=[36,""];o.autoClose===!1&&(items.push({ +type:"bi.icon_button",cls:"close-font toast-icon",handler:function(){self.destroy()},width:36}),columnSize.push(36)),this.text=BI.createWidget({type:"bi.horizontal_adapt",element:this,items:items,vgap:7,columnSize:columnSize})},setText:function(text){this.text.setText(text)},beforeDestroy:function(){this.fireEvent(BI.Toast.EVENT_DESTORY)}}),BI.Toast.EVENT_DESTORY="EVENT_DESTORY",BI.shortcut("bi.toast",BI.Toast),BI.Tooltip=BI.inherit(BI.Tip,{_const:{hgap:5,vgap:3},_defaultConfig:function(){return BI.extend(BI.Tooltip.superclass._defaultConfig.apply(this,arguments),{extraCls:"bi-tooltip",text:"",level:"success",stopEvent:!1,stopPropagation:!1})},_init:function(){BI.Tooltip.superclass._init.apply(this,arguments);var self=this,o=this.options;this.element.addClass("tooltip-"+o.level);var fn=function(e){o.stopPropagation&&e.stopPropagation(),o.stopEvent&&e.stopEvent()};this.element.bind({click:fn,mousedown:fn,mouseup:fn,mouseover:fn,mouseenter:fn,mouseleave:fn,mousemove:fn});var texts=(o.text+"").split("\n");texts.length>1?BI.createWidget({type:"bi.vertical",element:this,hgap:this._const.hgap,items:BI.map(texts,function(i,text){return{type:"bi.label",textAlign:"left",whiteSpace:"normal",text:text,textHeight:18}})}):this.text=BI.createWidget({type:"bi.label",element:this,textAlign:"left",whiteSpace:"normal",text:o.text,textHeight:18,hgap:this._const.hgap})},setWidth:function(width){this.element.width(width-2*this._const.hgap)},setText:function(text){this.text&&this.text.setText(text)},setLevel:function(level){this.element.removeClass("tooltip-success").removeClass("tooltip-warning"),this.element.addClass("tooltip-"+level)}}),BI.shortcut("bi.tooltip",BI.Tooltip),BI.Trigger=BI.inherit(BI.Single,{_defaultConfig:function(){var conf=BI.Trigger.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{_baseCls:(conf._baseCls||"")+" bi-trigger cursor-pointer",height:24})},_init:function(){BI.Trigger.superclass._init.apply(this,arguments)},setKey:function(){},getKey:function(){}}),BI.CustomTree=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.CustomTree.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-custom-tree",expander:{el:{},popup:{type:"bi.custom_tree"}},items:[],itemsCreator:BI.emptyFn,el:{type:"bi.button_tree",chooseType:0,layouts:[{type:"bi.vertical"}]}})},_init:function(){BI.CustomTree.superclass._init.apply(this,arguments),this.initTree(this.options.items)},_formatItems:function(nodes){var self=this,o=this.options;nodes=BI.Tree.transformToTreeFormat(nodes);var items=[];return BI.each(nodes,function(i,node){if(BI.isNotEmptyArray(node.children)||node.isParent===!0){var item=BI.extend({type:"bi.expander",el:{value:node.value},popup:{type:"bi.custom_tree"}},BI.deepClone(o.expander),{id:node.id,pId:node.pId}),el=BI.stripEL(node);BI.isWidget(el)?item.el=el:(el=BI.clone(el),delete el.children,BI.extend(item.el,el)),item.popup.expander=BI.deepClone(o.expander),item.items=item.popup.items=node.children,item.itemsCreator=item.popup.itemsCreator=function(op){if(BI.isNotNull(op.node))return o.itemsCreator.apply(self,arguments);var args=Array.prototype.slice.call(arguments,0);return args[0].node=node,o.itemsCreator.apply(self,args)},BI.isNull(item.popup.el)&&(item.popup.el=BI.deepClone(o.el)),items.push(item)}else items.push(node)}),items},initTree:function(nodes){var self=this,o=this.options;this.tree=BI.createWidget(o.el,{element:this,items:this._formatItems(nodes),itemsCreator:function(op,callback){o.itemsCreator.apply(this,[op,function(items){var args=Array.prototype.slice.call(arguments,0);args[0]=self._formatItems(items),callback.apply(null,args)}])},value:o.value}),this.tree.on(BI.Controller.EVENT_CHANGE,function(type,val,obj){self.fireEvent(BI.Controller.EVENT_CHANGE,arguments),type===BI.Events.CLICK&&self.fireEvent(BI.CustomTree.EVENT_CHANGE,val,obj)})},stroke:function(nodes){this.populate.apply(this,arguments)},populate:function(nodes){var args=Array.prototype.slice.call(arguments,0);arguments.length>0&&(args[0]=this._formatItems(nodes)),this.tree.populate.apply(this.tree,args)},setValue:function(v){this.tree&&this.tree.setValue(v)},getValue:function(){return this.tree?this.tree.getValue():[]},getAllButtons:function(){return this.tree?this.tree.getAllButtons():[]},getAllLeaves:function(){return this.tree?this.tree.getAllLeaves():[]},getNodeById:function(id){return this.tree&&this.tree.getNodeById(id)},getNodeByValue:function(id){return this.tree&&this.tree.getNodeByValue(id)},empty:function(){this.tree.empty()}}),BI.CustomTree.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.custom_tree",BI.CustomTree),function($){var settings={},roots={},caches={},_consts={className:{BUTTON:"button",LEVEL:"level",ICO_LOADING:"ico_loading",SWITCH:"switch"},event:{NODECREATED:"ztree_nodeCreated",CLICK:"ztree_click",EXPAND:"ztree_expand",COLLAPSE:"ztree_collapse",ASYNC_SUCCESS:"ztree_async_success",ASYNC_ERROR:"ztree_async_error",REMOVE:"ztree_remove",SELECTED:"ztree_selected",UNSELECTED:"ztree_unselected"},id:{A:"_a",ICON:"_ico",SPAN:"_span",SWITCH:"_switch",UL:"_ul"},line:{ROOT:"root",ROOTS:"roots",CENTER:"center",BOTTOM:"bottom",NOLINE:"noline",LINE:"line"},folder:{OPEN:"open",CLOSE:"close",DOCU:"docu"},node:{CURSELECTED:"curSelectedNode"}},_setting={treeId:"",treeObj:null,view:{addDiyDom:null,autoCancelSelected:!0,dblClickExpand:!0,expandSpeed:"fast",fontCss:{},nameIsHTML:!1,selectedMulti:!0,showIcon:!0,showLine:!0,showTitle:!0,txtSelectedEnable:!1},data:{key:{children:"children",name:"name",title:"",url:"url"},simpleData:{enable:!1,idKey:"id",pIdKey:"pId",rootPId:null},keep:{parent:!1,leaf:!1}},async:{enable:!1,contentType:"application/x-www-form-urlencoded",type:"post",dataType:"text",url:"",autoParam:[],otherParam:[],dataFilter:null},callback:{beforeAsync:null,beforeClick:null,beforeDblClick:null,beforeRightClick:null,beforeMouseDown:null,beforeMouseUp:null,beforeExpand:null,beforeCollapse:null,beforeRemove:null,onAsyncError:null,onAsyncSuccess:null,onNodeCreated:null,onClick:null,onDblClick:null,onRightClick:null,onMouseDown:null,onMouseUp:null,onExpand:null,onCollapse:null,onRemove:null}},_initRoot=function(setting){var r=data.getRoot(setting);r||(r={},data.setRoot(setting,r)),r[setting.data.key.children]=[],r.expandTriggerFlag=!1,r.curSelectedList=[],r.noSelection=!0,r.createdNodes=[],r.zId=0,r._ver=(new Date).getTime()},_initCache=function(setting){var c=data.getCache(setting);c||(c={},data.setCache(setting,c)),c.nodes=[],c.doms=[]},_bindEvent=function(setting){var o=setting.treeObj,c=consts.event;o.bind(c.NODECREATED,function(event,treeId,node){tools.apply(setting.callback.onNodeCreated,[event,treeId,node])}),o.bind(c.CLICK,function(event,srcEvent,treeId,node,clickFlag){tools.apply(setting.callback.onClick,[srcEvent,treeId,node,clickFlag])}),o.bind(c.EXPAND,function(event,treeId,node){tools.apply(setting.callback.onExpand,[event,treeId,node])}),o.bind(c.COLLAPSE,function(event,treeId,node){tools.apply(setting.callback.onCollapse,[event,treeId,node])}),o.bind(c.ASYNC_SUCCESS,function(event,treeId,node,msg){tools.apply(setting.callback.onAsyncSuccess,[event,treeId,node,msg])}),o.bind(c.ASYNC_ERROR,function(event,treeId,node,XMLHttpRequest,textStatus,errorThrown){tools.apply(setting.callback.onAsyncError,[event,treeId,node,XMLHttpRequest,textStatus,errorThrown])}),o.bind(c.REMOVE,function(event,treeId,treeNode){tools.apply(setting.callback.onRemove,[event,treeId,treeNode])}),o.bind(c.SELECTED,function(event,srcEvent,treeId,node){tools.apply(setting.callback.onSelected,[srcEvent,treeId,node])}),o.bind(c.UNSELECTED,function(event,srcEvent,treeId,node){tools.apply(setting.callback.onUnSelected,[srcEvent,treeId,node])})},_unbindEvent=function(setting){var o=setting.treeObj,c=consts.event;o.unbind(c.NODECREATED).unbind(c.CLICK).unbind(c.EXPAND).unbind(c.COLLAPSE).unbind(c.ASYNC_SUCCESS).unbind(c.ASYNC_ERROR).unbind(c.REMOVE).unbind(c.SELECTED).unbind(c.UNSELECTED)},_eventProxy=function(event){var target=event.target,setting=data.getSetting(event.data.treeId),tId="",node=null,nodeEventType="",treeEventType="",nodeEventCallback=null,treeEventCallback=null,tmp=null;if(tools.eqs(event.type,"mousedown")?treeEventType="mousedown":tools.eqs(event.type,"mouseup")?treeEventType="mouseup":tools.eqs(event.type,"contextmenu")?treeEventType="contextmenu":tools.eqs(event.type,"click")?tools.eqs(target.tagName,"span")&&null!==target.getAttribute("treeNode"+consts.id.SWITCH)?(tId=tools.getNodeMainDom(target).id,nodeEventType="switchNode"):(tmp=tools.getMDom(setting,target,[{tagName:"a",attrName:"treeNode"+consts.id.A}]),tmp&&(tId=tools.getNodeMainDom(tmp).id,nodeEventType="clickNode")):tools.eqs(event.type,"dblclick")&&(treeEventType="dblclick",tmp=tools.getMDom(setting,target,[{tagName:"a",attrName:"treeNode"+consts.id.A}]),tmp&&(tId=tools.getNodeMainDom(tmp).id,nodeEventType="switchNode")),treeEventType.length>0&&0==tId.length&&(tmp=tools.getMDom(setting,target,[{tagName:"a",attrName:"treeNode"+consts.id.A}]),tmp&&(tId=tools.getNodeMainDom(tmp).id)),tId.length>0)switch(node=data.getNodeCache(setting,tId),nodeEventType){case"switchNode":node.isParent&&(tools.eqs(event.type,"click")||tools.eqs(event.type,"dblclick")&&tools.apply(setting.view.dblClickExpand,[setting.treeId,node],setting.view.dblClickExpand))?nodeEventCallback=handler.onSwitchNode:nodeEventType="";break;case"clickNode":nodeEventCallback=handler.onClickNode}switch(treeEventType){case"mousedown":treeEventCallback=handler.onZTreeMousedown;break;case"mouseup":treeEventCallback=handler.onZTreeMouseup;break;case"dblclick":treeEventCallback=handler.onZTreeDblclick;break;case"contextmenu":treeEventCallback=handler.onZTreeContextmenu}var proxyResult={stop:!1,node:node,nodeEventType:nodeEventType,nodeEventCallback:nodeEventCallback,treeEventType:treeEventType,treeEventCallback:treeEventCallback};return proxyResult},_initNode=function(setting,level,n,parentNode,isFirstNode,isLastNode,openFlag){if(n){var r=data.getRoot(setting),childKey=setting.data.key.children;n.level=level,n.tId=setting.treeId+"_"+ ++r.zId,n.parentTId=parentNode?parentNode.tId:null,n.open="string"==typeof n.open?tools.eqs(n.open,"true"):!!n.open,n[childKey]&&n[childKey].length>0?(n.isParent=!0,n.zAsync=!0):(n.isParent="string"==typeof n.isParent?tools.eqs(n.isParent,"true"):!!n.isParent,n.open=!(!n.isParent||setting.async.enable)&&n.open,n.zAsync=!n.isParent),n.isFirstNode=isFirstNode,n.isLastNode=isLastNode,n.getParentNode=function(){return data.getNodeCache(setting,n.parentTId)},n.getPreNode=function(){return data.getPreNode(setting,n)},n.getNextNode=function(){return data.getNextNode(setting,n)},n.isAjaxing=!1,data.fixPIdKeyValue(setting,n)}},_init={bind:[_bindEvent],unbind:[_unbindEvent],caches:[_initCache],nodes:[_initNode],proxys:[_eventProxy],roots:[_initRoot],beforeA:[],afterA:[],innerBeforeA:[],innerAfterA:[],zTreeTools:[]},data={addNodeCache:function(setting,node){data.getCache(setting).nodes[data.getNodeCacheId(node.tId)]=node},getNodeCacheId:function(tId){return tId.substring(tId.lastIndexOf("_")+1)},addAfterA:function(afterA){_init.afterA.push(afterA)},addBeforeA:function(beforeA){_init.beforeA.push(beforeA)},addInnerAfterA:function(innerAfterA){_init.innerAfterA.push(innerAfterA)},addInnerBeforeA:function(innerBeforeA){_init.innerBeforeA.push(innerBeforeA)},addInitBind:function(bindEvent){_init.bind.push(bindEvent)},addInitUnBind:function(unbindEvent){_init.unbind.push(unbindEvent)},addInitCache:function(initCache){_init.caches.push(initCache)},addInitNode:function(initNode){_init.nodes.push(initNode)},addInitProxy:function(initProxy,isFirst){isFirst?_init.proxys.splice(0,0,initProxy):_init.proxys.push(initProxy)},addInitRoot:function(initRoot){_init.roots.push(initRoot)},addNodesData:function(setting,parentNode,nodes){var childKey=setting.data.key.children;parentNode[childKey]||(parentNode[childKey]=[]),parentNode[childKey].length>0&&(parentNode[childKey][parentNode[childKey].length-1].isLastNode=!1,view.setNodeLineIcos(setting,parentNode[childKey][parentNode[childKey].length-1])),parentNode.isParent=!0,parentNode[childKey]=parentNode[childKey].concat(nodes)},addSelectedNode:function(setting,node){var root=data.getRoot(setting);data.isSelectedNode(setting,node)||root.curSelectedList.push(node)},addCreatedNode:function(setting,node){if(setting.callback.onNodeCreated||setting.view.addDiyDom){var root=data.getRoot(setting);root.createdNodes.push(node)}},addZTreeTools:function(zTreeTools){_init.zTreeTools.push(zTreeTools)},exSetting:function(s){$.extend(!0,_setting,s)},fixPIdKeyValue:function(setting,node){setting.data.simpleData.enable&&(node[setting.data.simpleData.pIdKey]=node.parentTId?node.getParentNode()[setting.data.simpleData.idKey]:setting.data.simpleData.rootPId)},getAfterA:function(setting,node,array){for(var i=0,j=_init.afterA.length;i-1&&result.push(nodes[i]),result=result.concat(data.getNodesByParamFuzzy(setting,nodes[i][childKey],key,value));return result},getNodesByFilter:function(setting,nodes,filter,isSingle,invokeParam){if(!nodes)return isSingle?null:[];for(var childKey=setting.data.key.children,result=isSingle?null:[],i=0,l=nodes.length;i0)},clone:function(obj){if(null===obj)return null;var o=tools.isArray(obj)?[]:{};for(var i in obj)o[i]=obj[i]instanceof Date?new Date(obj[i].getTime()):"object"==typeof obj[i]?arguments.callee(obj[i]):obj[i];return o},eqs:function(str1,str2){return str1.toLowerCase()===str2.toLowerCase()},isArray:function(arr){return"[object Array]"===Object.prototype.toString.apply(arr)},$:function(node,exp,setting){return exp&&"string"!=typeof exp&&(setting=exp,exp=""),"string"==typeof node?$(node,setting?setting.treeObj.get(0).ownerDocument:null):$("#"+node.tId+exp,setting?setting.treeObj:null)},getMDom:function(setting,curDom,targetExpr){if(!curDom)return null;for(;curDom&&curDom.id!==setting.treeId;){for(var i=0,l=targetExpr.length;curDom.tagName&&i0},uCanDo:function(setting,e){return!0}},view={addNodes:function(setting,parentNode,newNodes,isSilent){if(!setting.data.keep.leaf||!parentNode||parentNode.isParent)if(tools.isArray(newNodes)||(newNodes=[newNodes]),setting.data.simpleData.enable&&(newNodes=data.transformTozTreeFormat(setting,newNodes)),parentNode){var target_switchObj=$$(parentNode,consts.id.SWITCH,setting),target_icoObj=$$(parentNode,consts.id.ICON,setting),target_ulObj=$$(parentNode,consts.id.UL,setting);parentNode.open||(view.replaceSwitchClass(parentNode,target_switchObj,consts.folder.CLOSE),view.replaceIcoClass(parentNode,target_icoObj,consts.folder.CLOSE),parentNode.open=!1,target_ulObj.css({display:"none"})),data.addNodesData(setting,parentNode,newNodes),view.createNodes(setting,parentNode.level+1,newNodes,parentNode),isSilent||view.expandCollapseParentNode(setting,parentNode,!0)}else data.addNodesData(setting,data.getRoot(setting),newNodes),view.createNodes(setting,0,newNodes,null)},appendNodes:function(setting,level,nodes,parentNode,initFlag,openFlag){if(!nodes)return[];for(var html=[],childKey=setting.data.key.children,i=0,l=nodes.length;i0&&(childHtml=view.appendNodes(setting,level+1,node[childKey],node,initFlag,openFlag&&node.open)),openFlag&&(view.makeDOMNodeMainBefore(html,setting,node),view.makeDOMNodeLine(html,setting,node),data.getBeforeA(setting,node,html),view.makeDOMNodeNameBefore(html,setting,node),data.getInnerBeforeA(setting,node,html),view.makeDOMNodeIcon(html,setting,node),data.getInnerAfterA(setting,node,html),view.makeDOMNodeNameAfter(html,setting,node),data.getAfterA(setting,node,html),node.isParent&&node.open&&view.makeUlHtml(setting,node,html,childHtml.join("")),view.makeDOMNodeMainAfter(html,setting,node),data.addCreatedNode(setting,node))}return html},appendParentULDom:function(setting,node){var html=[],nObj=$$(node,setting);!nObj.get(0)&&node.parentTId&&(view.appendParentULDom(setting,node.getParentNode()),nObj=$$(node,setting));var ulObj=$$(node,consts.id.UL,setting);ulObj.get(0)&&ulObj.remove();var childKey=setting.data.key.children,childHtml=view.appendNodes(setting,node.level+1,node[childKey],node,!1,!0);view.makeUlHtml(setting,node,html,childHtml.join("")),nObj.append(html.join(""))},asyncNode:function(setting,node,isSilent,callback){var i,l;if(node&&!node.isParent)return tools.apply(callback),!1;if(node&&node.isAjaxing)return!1;if(0==tools.apply(setting.callback.beforeAsync,[setting.treeId,node],!0))return tools.apply(callback),!1;if(node){node.isAjaxing=!0;var icoObj=$$(node,consts.id.ICON,setting);icoObj.attr({style:"","class":consts.className.BUTTON+" "+consts.className.ICO_LOADING})}var tmpParam={};for(i=0,l=setting.async.autoParam.length;node&&i1&&(spKey=pKey[1],pKey=pKey[0]),tmpParam[spKey]=node[pKey]}if(tools.isArray(setting.async.otherParam))for(i=0,l=setting.async.otherParam.length;i=0;i--)if(n=list[i],node===n||!node&&(!excludeNode||excludeNode!==n)){if($$(n,consts.id.A,setting).removeClass(consts.node.CURSELECTED),node){data.removeSelectedNode(setting,node),setting.treeObj.trigger(consts.event.UNSELECTED,[event,setting.treeId,n]);break}list.splice(i,1),setting.treeObj.trigger(consts.event.UNSELECTED,[event,setting.treeId,n])}},createNodeCallback:function(setting){if(setting.callback.onNodeCreated||setting.view.addDiyDom)for(var root=data.getRoot(setting);root.createdNodes.length>0;){var node=root.createdNodes.shift();tools.apply(setting.view.addDiyDom,[setting.treeId,node]),setting.callback.onNodeCreated&&setting.treeObj.trigger(consts.event.NODECREATED,[setting.treeId,node])}},createNodes:function(setting,level,nodes,parentNode){if(nodes&&0!=nodes.length){var root=data.getRoot(setting),childKey=setting.data.key.children,openFlag=!parentNode||parentNode.open||!!$$(parentNode[childKey][0],setting).get(0);root.createdNodes=[];var zTreeHtml=view.appendNodes(setting,level,nodes,parentNode,!0,openFlag);if(parentNode){var ulObj=$$(parentNode,consts.id.UL,setting);ulObj.get(0)&&ulObj.append(zTreeHtml.join(""))}else setting.treeObj.append(zTreeHtml.join(""));view.createNodeCallback(setting)}},destroy:function(setting){setting&&(data.initCache(setting),data.initRoot(setting),event.unbindTree(setting),event.unbindEvent(setting),setting.treeObj.empty(),delete settings[setting.treeId])},expandCollapseNode:function(setting,node,expandFlag,animateFlag,callback){var root=data.getRoot(setting),childKey=setting.data.key.children;if(!node)return void tools.apply(callback,[]);if(root.expandTriggerFlag){var _callback=callback;callback=function(){_callback&&_callback(),node.open?setting.treeObj.trigger(consts.event.EXPAND,[setting.treeId,node]):setting.treeObj.trigger(consts.event.COLLAPSE,[setting.treeId,node])},root.expandTriggerFlag=!1}if(!node.open&&node.isParent&&(!$$(node,consts.id.UL,setting).get(0)||node[childKey]&&node[childKey].length>0&&!$$(node[childKey][0],setting).get(0))&&(view.appendParentULDom(setting,node),view.createNodeCallback(setting)),node.open==expandFlag)return void tools.apply(callback,[]);var ulObj=$$(node,consts.id.UL,setting),switchObj=$$(node,consts.id.SWITCH,setting),icoObj=$$(node,consts.id.ICON,setting);node.isParent?(node.open=!node.open,node.iconOpen&&node.iconClose&&icoObj.attr("style",view.makeNodeIcoStyle(setting,node)),node.open?(view.replaceSwitchClass(node,switchObj,consts.folder.OPEN),view.replaceIcoClass(node,icoObj,consts.folder.OPEN),0==animateFlag||""==setting.view.expandSpeed?(ulObj.show(),tools.apply(callback,[])):node[childKey]&&node[childKey].length>0?ulObj.slideDown(setting.view.expandSpeed,callback):(ulObj.show(),tools.apply(callback,[]))):(view.replaceSwitchClass(node,switchObj,consts.folder.CLOSE),view.replaceIcoClass(node,icoObj,consts.folder.CLOSE),0!=animateFlag&&""!=setting.view.expandSpeed&&node[childKey]&&node[childKey].length>0?ulObj.slideUp(setting.view.expandSpeed,callback):(ulObj.hide(),tools.apply(callback,[])))):tools.apply(callback,[])},expandCollapseParentNode:function(setting,node,expandFlag,animateFlag,callback){if(node){if(!node.parentTId)return void view.expandCollapseNode(setting,node,expandFlag,animateFlag,callback);view.expandCollapseNode(setting,node,expandFlag,animateFlag),node.parentTId&&view.expandCollapseParentNode(setting,node.getParentNode(),expandFlag,animateFlag,callback)}},expandCollapseSonNode:function(setting,node,expandFlag,animateFlag,callback){var root=data.getRoot(setting),childKey=setting.data.key.children,treeNodes=node?node[childKey]:root[childKey],selfAnimateSign=!node&&animateFlag,expandTriggerFlag=data.getRoot(setting).expandTriggerFlag;if(data.getRoot(setting).expandTriggerFlag=!1,treeNodes)for(var i=0,l=treeNodes.length;i=0;i--)if(node===list[i])return!0;return!1},makeDOMNodeIcon:function(html,setting,node){var nameStr=data.getNodeName(setting,node),name=setting.view.nameIsHTML?nameStr:nameStr.replace(/&/g,"&").replace(//g,">");html.push("",name,"")},makeDOMNodeLine:function(html,setting,node){html.push("")},makeDOMNodeMainAfter:function(html,setting,node){html.push("")},makeDOMNodeMainBefore:function(html,setting,node){html.push("
    • ")},makeDOMNodeNameAfter:function(html,setting,node){html.push("")},makeDOMNodeNameBefore:function(html,setting,node){var title=data.getNodeTitle(setting,node),url=view.makeNodeUrl(setting,node),fontcss=view.makeNodeFontCss(setting,node),fontStyle=[];for(var f in fontcss)fontStyle.push(f,":",fontcss[f],";");html.push("0?"href='"+url+"'":""," target='",view.makeNodeTarget(node),"' style='",fontStyle.join(""),"'"),tools.apply(setting.view.showTitle,[setting.treeId,node],setting.view.showTitle)&&title&&html.push("title='",title.replace(/'/g,"'").replace(//g,">"),"'"),html.push(">")},makeNodeFontCss:function(setting,node){var fontCss=tools.apply(setting.view.fontCss,[setting.treeId,node],setting.view.fontCss);return fontCss&&"function"!=typeof fontCss?fontCss:{}},makeNodeIcoClass:function(setting,node){var icoCss=["ico"];return node.isAjaxing||(icoCss[0]=(node.iconSkin?node.iconSkin+"_":"")+icoCss[0],node.isParent?icoCss.push(node.open?consts.folder.OPEN:consts.folder.CLOSE):icoCss.push(consts.folder.DOCU)),consts.className.BUTTON+" "+icoCss.join("_")},makeNodeIcoStyle:function(setting,node){var icoStyle=[];if(!node.isAjaxing){var icon=node.isParent&&node.iconOpen&&node.iconClose?node.open?node.iconOpen:node.iconClose:node.icon;icon&&icoStyle.push("background:url(",icon,") 0 0 no-repeat;"),0!=setting.view.showIcon&&tools.apply(setting.view.showIcon,[setting.treeId,node],!0)||icoStyle.push("width:0px;height:0px;")}return icoStyle.join("")},makeNodeLineClass:function(setting,node){var lineClass=[];return setting.view.showLine?0==node.level&&node.isFirstNode&&node.isLastNode?lineClass.push(consts.line.ROOT):0==node.level&&node.isFirstNode?lineClass.push(consts.line.ROOTS):node.isLastNode?lineClass.push(consts.line.BOTTOM):lineClass.push(consts.line.CENTER):lineClass.push(consts.line.NOLINE),node.isParent?lineClass.push(node.open?consts.folder.OPEN:consts.folder.CLOSE):lineClass.push(consts.folder.DOCU),view.makeNodeLineClassEx(node)+lineClass.join("_")},makeNodeLineClassEx:function(node){return consts.className.BUTTON+" "+consts.className.LEVEL+node.level+" "+consts.className.SWITCH+" "},makeNodeTarget:function(node){return node.target||"_blank"},makeNodeUrl:function(setting,node){var urlKey=setting.data.key.url;return node[urlKey]?node[urlKey]:null},makeUlHtml:function(setting,node,html,content){html.push("
        "),html.push(content),html.push("
      ")},makeUlLineClass:function(setting,node){return setting.view.showLine&&!node.isLastNode?consts.line.LINE:""},removeChildNodes:function(setting,node){if(node){var childKey=setting.data.key.children,nodes=node[childKey];if(nodes){for(var i=0,l=nodes.length;i0&&(parentNode[childKey][0].isFirstNode=!0)},setLastNode:function(setting,parentNode){var childKey=setting.data.key.children,childLength=parentNode[childKey].length;childLength>0&&(parentNode[childKey][childLength-1].isLastNode=!0)},removeNode:function(setting,node){var root=data.getRoot(setting),childKey=setting.data.key.children,parentNode=node.parentTId?node.getParentNode():root;if(node.isFirstNode=!1,node.isLastNode=!1,node.getPreNode=function(){return null},node.getNextNode=function(){return null},data.getNodeCache(setting,node.tId)){$$(node,setting).remove(),data.removeNodeCache(setting,node),data.removeSelectedNode(setting,node);for(var i=0,l=parentNode[childKey].length;i0){var newLast=parentNode[childKey][childLength-1];if(tmp_ulObj=$$(newLast,consts.id.UL,setting),tmp_switchObj=$$(newLast,consts.id.SWITCH,setting),tmp_icoObj=$$(newLast,consts.id.ICON,setting),parentNode==root)if(1==parentNode[childKey].length)view.replaceSwitchClass(newLast,tmp_switchObj,consts.line.ROOT);else{var tmp_first_switchObj=$$(parentNode[childKey][0],consts.id.SWITCH,setting);view.replaceSwitchClass(parentNode[childKey][0],tmp_first_switchObj,consts.line.ROOTS),view.replaceSwitchClass(newLast,tmp_switchObj,consts.line.BOTTOM)}else view.replaceSwitchClass(newLast,tmp_switchObj,consts.line.BOTTOM);tmp_ulObj.removeClass(consts.line.LINE)}}else parentNode.isParent=!1,parentNode.open=!1,tmp_ulObj=$$(parentNode,consts.id.UL,setting),tmp_switchObj=$$(parentNode,consts.id.SWITCH,setting),tmp_icoObj=$$(parentNode,consts.id.ICON,setting),view.replaceSwitchClass(parentNode,tmp_switchObj,consts.folder.DOCU),view.replaceIcoClass(parentNode,tmp_icoObj,consts.folder.DOCU),tmp_ulObj.css("display","none")}},replaceIcoClass:function(node,obj,newName){if(obj&&!node.isAjaxing){var tmpName=obj.attr("class");if(void 0!=tmpName){var tmpList=tmpName.split("_");switch(newName){case consts.folder.OPEN:case consts.folder.CLOSE:case consts.folder.DOCU:tmpList[tmpList.length-1]=newName}obj.attr("class",tmpList.join("_"))}}},replaceSwitchClass:function(node,obj,newName){if(obj){var tmpName=obj.attr("class");if(void 0!=tmpName){var tmpList=tmpName.split("_");switch(newName){case consts.line.ROOT:case consts.line.ROOTS:case consts.line.CENTER:case consts.line.BOTTOM:case consts.line.NOLINE:tmpList[0]=view.makeNodeLineClassEx(node)+newName;break;case consts.folder.OPEN:case consts.folder.CLOSE:case consts.folder.DOCU:tmpList[1]=newName}obj.attr("class",tmpList.join("_")),newName!==consts.folder.DOCU?obj.removeAttr("disabled"):obj.attr("disabled","disabled")}}},selectNode:function(setting,node,addFlag){addFlag||view.cancelPreSelectedNode(setting,null,node),$$(node,consts.id.A,setting).addClass(consts.node.CURSELECTED),data.addSelectedNode(setting,node),setting.treeObj.trigger(consts.event.SELECTED,[event,setting.treeId,node])},setNodeFontCss:function(setting,treeNode){var aObj=$$(treeNode,consts.id.A,setting),fontCss=view.makeNodeFontCss(setting,treeNode);fontCss&&aObj.css(fontCss)},setNodeLineIcos:function(setting,node){if(node){var switchObj=$$(node,consts.id.SWITCH,setting),ulObj=$$(node,consts.id.UL,setting),icoObj=$$(node,consts.id.ICON,setting),ulLine=view.makeUlLineClass(setting,node);0==ulLine.length?ulObj.removeClass(consts.line.LINE):ulObj.addClass(ulLine),switchObj.attr("class",view.makeNodeLineClass(setting,node)),node.isParent?switchObj.removeAttr("disabled"):switchObj.attr("disabled","disabled"),icoObj.removeAttr("style"),icoObj.attr("style",view.makeNodeIcoStyle(setting,node)),icoObj.attr("class",view.makeNodeIcoClass(setting,node))}},setNodeName:function(setting,node){var title=data.getNodeTitle(setting,node),nObj=$$(node,consts.id.SPAN,setting);if(nObj.empty(),setting.view.nameIsHTML?nObj.html(data.getNodeName(setting,node)):nObj.text(data.getNodeName(setting,node)),tools.apply(setting.view.showTitle,[setting.treeId,node],setting.view.showTitle)){var aObj=$$(node,consts.id.A,setting);aObj.attr("title",title?title:"")}},setNodeTarget:function(setting,node){var aObj=$$(node,consts.id.A,setting);aObj.attr("target",view.makeNodeTarget(node))},setNodeUrl:function(setting,node){var aObj=$$(node,consts.id.A,setting),url=view.makeNodeUrl(setting,node);null==url||0==url.length?aObj.removeAttr("href"):aObj.attr("href",url)},switchNode:function(setting,node){if(node.open||!tools.canAsync(setting,node))view.expandCollapseNode(setting,node,!node.open);else if(setting.async.enable){if(!view.asyncNode(setting,node))return void view.expandCollapseNode(setting,node,!node.open)}else node&&view.expandCollapseNode(setting,node,!node.open)}};$.fn.zTree={consts:_consts,_z:{tools:tools,view:view,event:event,data:data},getZTreeObj:function(treeId){var o=data.getZTreeTools(treeId);return o?o:null},destroy:function(treeId){if(treeId&&treeId.length>0)view.destroy(data.getSetting(treeId));else for(var s in settings)view.destroy(settings[s])},init:function(obj,zSetting,zNodes){var setting=tools.clone(_setting);$.extend(!0,setting,zSetting),setting.treeId=obj.attr("id"),setting.treeObj=obj,setting.treeObj.empty(),settings[setting.treeId]=setting,"undefined"==typeof document.body.style.maxHeight&&(setting.view.expandSpeed=""),data.initRoot(setting);var root=data.getRoot(setting),childKey=setting.data.key.children;zNodes=zNodes?tools.clone(tools.isArray(zNodes)?zNodes:[zNodes]):[],setting.data.simpleData.enable?root[childKey]=data.transformTozTreeFormat(setting,zNodes):root[childKey]=zNodes,data.initCache(setting),event.unbindTree(setting),event.bindTree(setting),event.unbindEvent(setting),event.bindEvent(setting);var zTreeTools={setting:setting,addNodes:function(parentNode,newNodes,isSilent){function addCallback(){view.addNodes(setting,parentNode,xNewNodes,1==isSilent)}if(!newNodes)return null;if(parentNode||(parentNode=null),parentNode&&!parentNode.isParent&&setting.data.keep.leaf)return null;var xNewNodes=tools.clone(tools.isArray(newNodes)?newNodes:[newNodes]);return tools.canAsync(setting,parentNode)?view.asyncNode(setting,parentNode,isSilent,addCallback):addCallback(),xNewNodes},cancelSelectedNode:function(node){view.cancelPreSelectedNode(setting,node)},destroy:function(){view.destroy(setting)},expandAll:function(expandFlag){return expandFlag=!!expandFlag,view.expandCollapseSonNode(setting,null,expandFlag,!0),expandFlag},expandNode:function(node,expandFlag,sonSign,focus,callbackFlag){if(!node||!node.isParent)return null;if(expandFlag!==!0&&expandFlag!==!1&&(expandFlag=!node.open),callbackFlag=!!callbackFlag,callbackFlag&&expandFlag&&0==tools.apply(setting.callback.beforeExpand,[setting.treeId,node],!0))return null;if(callbackFlag&&!expandFlag&&0==tools.apply(setting.callback.beforeCollapse,[setting.treeId,node],!0))return null;if(expandFlag&&node.parentTId&&view.expandCollapseParentNode(setting,node.getParentNode(),expandFlag,!1),expandFlag===node.open&&!sonSign)return null;if(data.getRoot(setting).expandTriggerFlag=callbackFlag,!tools.canAsync(setting,node)&&sonSign)view.expandCollapseSonNode(setting,node,expandFlag,!0,function(){if(focus!==!1)try{$$(node,setting).focus().blur()}catch(e){}});else if(node.open=!expandFlag,view.switchNode(this.setting,node),focus!==!1)try{$$(node,setting).focus().blur()}catch(e){}return expandFlag},getNodes:function(){return data.getNodes(setting)},getNodeByParam:function(key,value,parentNode){return key?data.getNodeByParam(setting,parentNode?parentNode[setting.data.key.children]:data.getNodes(setting),key,value):null},getNodeByTId:function(tId){return data.getNodeCache(setting,tId)},getNodesByParam:function(key,value,parentNode){return key?data.getNodesByParam(setting,parentNode?parentNode[setting.data.key.children]:data.getNodes(setting),key,value):null},getNodesByParamFuzzy:function(key,value,parentNode){return key?data.getNodesByParamFuzzy(setting,parentNode?parentNode[setting.data.key.children]:data.getNodes(setting),key,value):null},getNodesByFilter:function(filter,isSingle,parentNode,invokeParam){return isSingle=!!isSingle,filter&&"function"==typeof filter?data.getNodesByFilter(setting,parentNode?parentNode[setting.data.key.children]:data.getNodes(setting),filter,isSingle,invokeParam):isSingle?null:[]},getNodeIndex:function(node){if(!node)return null;for(var childKey=setting.data.key.children,parentNode=node.parentTId?node.getParentNode():data.getRoot(setting),i=0,l=parentNode[childKey].length;i0?view.createNodes(setting,0,root[childKey]):setting.async.enable&&setting.async.url&&""!==setting.async.url&&view.asyncNode(setting),zTreeTools}};var zt=$.fn.zTree,$$=tools.$,consts=zt.consts}(BI.jQuery),function($){var _consts={event:{CHECK:"ztree_check"},id:{CHECK:"_check"},checkbox:{STYLE:"checkbox",DEFAULT:"chk",DISABLED:"disable",FALSE:"false",TRUE:"true",FULL:"full",PART:"part",FOCUS:"focus"},radio:{STYLE:"radio",TYPE_ALL:"all",TYPE_LEVEL:"level"}},_setting={check:{enable:!1,autoCheckTrigger:!1,chkStyle:_consts.checkbox.STYLE,nocheckInherit:!1,chkDisabledInherit:!1,radioType:_consts.radio.TYPE_LEVEL,chkboxType:{Y:"ps",N:"ps"}},data:{key:{checked:"checked"}},callback:{beforeCheck:null,onCheck:null}},_initRoot=function(setting){var r=data.getRoot(setting);r.radioCheckedList=[]},_initCache=function(treeId){},_bindEvent=function(setting){var o=setting.treeObj,c=consts.event;o.bind(c.CHECK,function(event,srcEvent,treeId,node){event.srcEvent=srcEvent,tools.apply(setting.callback.onCheck,[event,treeId,node])})},_unbindEvent=function(setting){var o=setting.treeObj,c=consts.event;o.unbind(c.CHECK)},_eventProxy=function(e){var target=e.target,setting=data.getSetting(e.data.treeId),tId="",node=null,nodeEventType="",treeEventType="",nodeEventCallback=null,treeEventCallback=null;if(tools.eqs(e.type,"mouseover")?setting.check.enable&&tools.eqs(target.tagName,"span")&&null!==target.getAttribute("treeNode"+consts.id.CHECK)&&(tId=tools.getNodeMainDom(target).id,nodeEventType="mouseoverCheck"):tools.eqs(e.type,"mouseout")?setting.check.enable&&tools.eqs(target.tagName,"span")&&null!==target.getAttribute("treeNode"+consts.id.CHECK)&&(tId=tools.getNodeMainDom(target).id,nodeEventType="mouseoutCheck"):tools.eqs(e.type,"click")&&setting.check.enable&&tools.eqs(target.tagName,"span")&&null!==target.getAttribute("treeNode"+consts.id.CHECK)&&(tId=tools.getNodeMainDom(target).id,nodeEventType="checkNode"),tId.length>0)switch(node=data.getNodeCache(setting,tId),nodeEventType){case"checkNode":nodeEventCallback=_handler.onCheckNode;break;case"mouseoverCheck":nodeEventCallback=_handler.onMouseoverCheck;break;case"mouseoutCheck":nodeEventCallback=_handler.onMouseoutCheck}var proxyResult={stop:"checkNode"===nodeEventType,node:node,nodeEventType:nodeEventType,nodeEventCallback:nodeEventCallback,treeEventType:treeEventType,treeEventCallback:treeEventCallback};return proxyResult},_initNode=function(setting,level,n,parentNode,isFirstNode,isLastNode,openFlag){if(n){var checkedKey=setting.data.key.checked;if("string"==typeof n[checkedKey]&&(n[checkedKey]=tools.eqs(n[checkedKey],"true")),n[checkedKey]=!!n[checkedKey],n.checkedOld=n[checkedKey],"string"==typeof n.nocheck&&(n.nocheck=tools.eqs(n.nocheck,"true")),n.nocheck=!!n.nocheck||setting.check.nocheckInherit&&parentNode&&!!parentNode.nocheck,"string"==typeof n.chkDisabled&&(n.chkDisabled=tools.eqs(n.chkDisabled,"true")),n.chkDisabled=!!n.chkDisabled||setting.check.chkDisabledInherit&&parentNode&&!!parentNode.chkDisabled,"string"==typeof n.halfCheck&&(n.halfCheck=tools.eqs(n.halfCheck,"true")),n.halfCheck=!!n.halfCheck,n.check_Child_State=-1,n.check_Focus=!1,n.getCheckStatus=function(){return data.getCheckStatus(setting,n)},setting.check.chkStyle==consts.radio.STYLE&&setting.check.radioType==consts.radio.TYPE_ALL&&n[checkedKey]){var r=data.getRoot(setting);r.radioCheckedList.push(n)}}},_beforeA=function(setting,node,html){var checkedKey=setting.data.key.checked;setting.check.enable&&(data.makeChkFlag(setting,node),html.push(""))},_zTreeTools=function(setting,zTreeTools){zTreeTools.checkNode=function(node,checked,checkTypeFlag,callbackFlag){var checkedKey=this.setting.data.key.checked;if(node.chkDisabled!==!0&&(checked!==!0&&checked!==!1&&(checked=!node[checkedKey]),callbackFlag=!!callbackFlag,(node[checkedKey]!==checked||checkTypeFlag)&&(!callbackFlag||0!=tools.apply(this.setting.callback.beforeCheck,[this.setting.treeId,node],!0))&&tools.uCanDo(this.setting)&&this.setting.check.enable&&node.nocheck!==!0)){node[checkedKey]=checked;var checkObj=$$(node,consts.id.CHECK,this.setting);(checkTypeFlag||this.setting.check.chkStyle===consts.radio.STYLE)&&view.checkNodeRelation(this.setting,node),view.setChkClass(this.setting,checkObj,node),view.repairParentChkClassWithSelf(this.setting,node),callbackFlag&&this.setting.treeObj.trigger(consts.event.CHECK,[null,this.setting.treeId,node])}},zTreeTools.checkAllNodes=function(checked){view.repairAllChk(this.setting,!!checked)},zTreeTools.getCheckedNodes=function(checked){var childKey=this.setting.data.key.children;return checked=checked!==!1,data.getTreeCheckedNodes(this.setting,data.getRoot(this.setting)[childKey],checked)},zTreeTools.getChangeCheckedNodes=function(){var childKey=this.setting.data.key.children;return data.getTreeChangeCheckedNodes(this.setting,data.getRoot(this.setting)[childKey])},zTreeTools.setChkDisabled=function(node,disabled,inheritParent,inheritChildren){disabled=!!disabled,inheritParent=!!inheritParent,inheritChildren=!!inheritChildren,view.repairSonChkDisabled(this.setting,node,disabled,inheritChildren),view.repairParentChkDisabled(this.setting,node.getParentNode(),disabled,inheritParent)};var _updateNode=zTreeTools.updateNode;zTreeTools.updateNode=function(node,checkTypeFlag){if(_updateNode&&_updateNode.apply(zTreeTools,arguments),node&&this.setting.check.enable){var nObj=$$(node,this.setting);if(nObj.get(0)&&tools.uCanDo(this.setting)){var checkObj=$$(node,consts.id.CHECK,this.setting);1!=checkTypeFlag&&this.setting.check.chkStyle!==consts.radio.STYLE||view.checkNodeRelation(this.setting,node),view.setChkClass(this.setting,checkObj,node),view.repairParentChkClassWithSelf(this.setting,node)}}}},_data={getRadioCheckedList:function(setting){for(var checkedList=data.getRoot(setting).radioCheckedList,i=0,j=checkedList.length;i-1&&node.check_Child_State<2:node.check_Child_State>0};return r},getTreeCheckedNodes:function(setting,nodes,checked,results){if(!nodes)return[];var childKey=setting.data.key.children,checkedKey=setting.data.key.checked,onlyOne=checked&&setting.check.chkStyle==consts.radio.STYLE&&setting.check.radioType==consts.radio.TYPE_ALL;results=results?results:[];for(var i=0,l=nodes.length;i0));i++);return results},getTreeChangeCheckedNodes:function(setting,nodes,results){if(!nodes)return[];var childKey=setting.data.key.children,checkedKey=setting.data.key.checked;results=results?results:[];for(var i=0,l=nodes.length;i0?2:0,2==tmp){chkFlag=2;break}0==tmp&&(chkFlag=0)}else if(setting.check.chkStyle==consts.checkbox.STYLE){if(tmp=cNode.nocheck===!0||cNode.chkDisabled===!0?cNode.check_Child_State:cNode.halfCheck===!0?1:cNode[checkedKey]?cNode.check_Child_State===-1||2===cNode.check_Child_State?2:1:cNode.check_Child_State>0?1:0,1===tmp){chkFlag=1;break}if(2===tmp&&chkFlag>-1&&i>0&&tmp!==chkFlag){chkFlag=1;break}if(2===chkFlag&&tmp>-1&&tmp<2){chkFlag=1;break}tmp>-1&&(chkFlag=tmp)}}node.check_Child_State=chkFlag}}},_event={},_handler={onCheckNode:function(event,node){if(node.chkDisabled===!0)return!1;var setting=data.getSetting(event.data.treeId),checkedKey=setting.data.key.checked;if(0==tools.apply(setting.callback.beforeCheck,[setting.treeId,node],!0))return!0;node[checkedKey]=!node[checkedKey],view.checkNodeRelation(setting,node);var checkObj=$$(node,consts.id.CHECK,setting);return view.setChkClass(setting,checkObj,node),view.repairParentChkClassWithSelf(setting,node),setting.treeObj.trigger(consts.event.CHECK,[event,setting.treeId,node]),!0},onMouseoverCheck:function(event,node){if(node.chkDisabled===!0)return!1;var setting=data.getSetting(event.data.treeId),checkObj=$$(node,consts.id.CHECK,setting);return node.check_Focus=!0,view.setChkClass(setting,checkObj,node),!0},onMouseoutCheck:function(event,node){if(node.chkDisabled===!0)return!1;var setting=data.getSetting(event.data.treeId),checkObj=$$(node,consts.id.CHECK,setting);return node.check_Focus=!1,view.setChkClass(setting,checkObj,node),!0}},_tools={},_view={checkNodeRelation:function(setting,node){var pNode,i,l,childKey=setting.data.key.children,checkedKey=setting.data.key.checked,r=consts.radio;if(setting.check.chkStyle==r.STYLE){var checkedList=data.getRadioCheckedList(setting);if(node[checkedKey])if(setting.check.radioType==r.TYPE_ALL){for(i=checkedList.length-1;i>=0;i--)pNode=checkedList[i],pNode[checkedKey]&&pNode!=node&&(pNode[checkedKey]=!1,checkedList.splice(i,1),view.setChkClass(setting,$$(pNode,consts.id.CHECK,setting),pNode),pNode.parentTId!=node.parentTId&&view.repairParentChkClassWithSelf(setting,pNode));checkedList.push(node)}else{var parentNode=node.parentTId?node.getParentNode():data.getRoot(setting);for(i=0,l=parentNode[childKey].length;i-1)&&view.setSonNodeCheckBox(setting,node,!0),node[checkedKey]||node[childKey]&&0!=node[childKey].length&&!(setting.check.chkboxType.N.indexOf("s")>-1)||view.setSonNodeCheckBox(setting,node,!1),node[checkedKey]&&setting.check.chkboxType.Y.indexOf("p")>-1&&view.setParentNodeCheckBox(setting,node,!0),!node[checkedKey]&&setting.check.chkboxType.N.indexOf("p")>-1&&view.setParentNodeCheckBox(setting,node,!1)},makeChkClass:function(setting,node){var checkedKey=setting.data.key.checked,c=consts.checkbox,r=consts.radio,checkboxType=setting.check.chkboxType,notEffectByOtherNode=""===checkboxType.Y&&""===checkboxType.N;fullStyle="",node.chkDisabled===!0?fullStyle=c.DISABLED:node.halfCheck?fullStyle=c.PART:setting.check.chkStyle==r.STYLE?fullStyle=node.check_Child_State<1?c.FULL:c.PART:fullStyle=node[checkedKey]?2===node.check_Child_State||node.check_Child_State===-1||notEffectByOtherNode?c.FULL:c.PART:node.check_Child_State<1||notEffectByOtherNode?c.FULL:c.PART;var chkName=setting.check.chkStyle+"_"+(node[checkedKey]?c.TRUE:c.FALSE)+"_"+fullStyle;return chkName=node.check_Focus&&node.chkDisabled!==!0?chkName+"_"+c.FOCUS:chkName,consts.className.BUTTON+" "+c.DEFAULT+" "+chkName},repairAllChk:function(setting,checked){if(setting.check.enable&&setting.check.chkStyle===consts.checkbox.STYLE)for(var checkedKey=setting.data.key.checked,childKey=setting.data.key.children,root=data.getRoot(setting),i=0,l=root[childKey].length;i0?view.repairParentChkClass(setting,node[childKey][0]):view.repairParentChkClass(setting,node)}},repairSonChkDisabled:function(setting,node,chkDisabled,inherit){if(node){var childKey=setting.data.key.children;if(node.chkDisabled!=chkDisabled&&(node.chkDisabled=chkDisabled),view.repairChkClass(setting,node),node[childKey]&&inherit)for(var i=0,l=node[childKey].length;i0){pSign=!1;break}pSign&&view.setParentNodeCheckBox(setting,node.getParentNode(),value,srcNode)}},setSonNodeCheckBox:function(setting,node,value,srcNode){if(node){var childKey=setting.data.key.children,checkedKey=setting.data.key.checked,checkObj=$$(node,consts.id.CHECK,setting);srcNode||(srcNode=node);var hasDisable=!1;if(node[childKey])for(var i=0,l=node[childKey].length;i0?value?2:0:-1)):node.check_Child_State=-1,view.setChkClass(setting,checkObj,node),setting.check.autoCheckTrigger&&node!=srcNode&&node.nocheck!==!0&&node.chkDisabled!==!0&&setting.treeObj.trigger(consts.event.CHECK,[null,setting.treeId,node]))}}},_z={tools:_tools,view:_view,event:_event,data:_data};$.extend(!0,$.fn.zTree.consts,_consts),$.extend(!0,$.fn.zTree._z,_z);var zt=$.fn.zTree,tools=zt._z.tools,consts=zt.consts,view=zt._z.view,data=zt._z.data,event=zt._z.event,$$=tools.$;data.exSetting(_setting),data.addInitBind(_bindEvent),data.addInitUnBind(_unbindEvent),data.addInitCache(_initCache),data.addInitNode(_initNode),data.addInitProxy(_eventProxy,!0),data.addInitRoot(_initRoot),data.addBeforeA(_beforeA),data.addZTreeTools(_zTreeTools);var _createNodes=view.createNodes;view.createNodes=function(setting,level,nodes,parentNode){_createNodes&&_createNodes.apply(view,arguments),nodes&&view.repairParentChkClassWithSelf(setting,parentNode)};var _removeNode=view.removeNode;view.removeNode=function(setting,node){var parentNode=node.getParentNode();_removeNode&&_removeNode.apply(view,arguments),node&&parentNode&&(view.repairChkClass(setting,parentNode),view.repairParentChkClass(setting,parentNode)); +};var _appendNodes=view.appendNodes;view.appendNodes=function(setting,level,nodes,parentNode,initFlag,openFlag){var html="";return _appendNodes&&(html=_appendNodes.apply(view,arguments)),parentNode&&data.makeChkFlag(setting,parentNode),html}}(BI.jQuery),BI.IconChangeButton=BI.inherit(BI.Single,{_defaultConfig:function(){var conf=BI.IconChangeButton.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{baseCls:"bi-icon-change-button",iconCls:"",iconWidth:null,iconHeight:null,stopEvent:!1,stopPropagation:!1,selected:!1,once:!1,forceSelected:!1,forceNotSelected:!1,disableSelected:!1,shadow:!1,isShadowShowingOnSelected:!1,trigger:null,handler:BI.emptyFn})},_init:function(){BI.IconChangeButton.superclass._init.apply(this,arguments);var self=this,o=this.options;this.button=BI.createWidget({type:"bi.icon_button",element:this,cls:o.iconCls,height:o.height,iconWidth:o.iconWidth,iconHeight:o.iconHeight,stopEvent:o.stopEvent,stopPropagation:o.stopPropagation,selected:o.selected,once:o.once,forceSelected:o.forceSelected,forceNotSelected:o.forceNotSelected,disableSelected:o.disableSelected,shadow:o.shadow,isShadowShowingOnSelected:o.isShadowShowingOnSelected,trigger:o.trigger,handler:o.handler}),this.button.on(BI.Controller.EVENT_CHANGE,function(){self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.button.on(BI.IconButton.EVENT_CHANGE,function(){self.fireEvent(BI.IconChangeButton.EVENT_CHANGE,arguments)})},isSelected:function(){return this.button.isSelected()},setSelected:function(b){this.button.setSelected(b)},setIcon:function(cls){var o=this.options;o.iconCls!==cls&&(this.element.removeClass(o.iconCls).addClass(cls),o.iconCls=cls)}}),BI.IconChangeButton.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.icon_change_button",BI.IconChangeButton),BI.TriggerIconButton=BI.inherit(BI.IconButton,{_defaultConfig:function(){var conf=BI.TriggerIconButton.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{baseCls:(conf.baseCls||"")+" bi-trigger-icon-button",extraCls:"pull-down-font"})}}),BI.TriggerIconButton.EVENT_CHANGE=BI.IconButton.EVENT_CHANGE,BI.shortcut("bi.trigger_icon_button",BI.TriggerIconButton),BI.HalfIconButton=BI.inherit(BI.IconButton,{_defaultConfig:function(){var conf=BI.HalfIconButton.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{extraCls:"bi-half-icon-button check-half-select-icon",height:16,width:16,iconWidth:16,iconHeight:16,selected:!1})}}),BI.HalfIconButton.EVENT_CHANGE=BI.IconButton.EVENT_CHANGE,BI.shortcut("bi.half_icon_button",BI.HalfIconButton),BI.HalfButton=BI.inherit(BI.BasicButton,{_defaultConfig:function(){var conf=BI.HalfIconButton.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{extraCls:"bi-half-button bi-high-light-border",height:14,width:14,selected:!1})},_init:function(){BI.HalfButton.superclass._init.apply(this,arguments),BI.createWidget({type:"bi.center_adapt",element:this.element,items:[{type:"bi.layout",cls:"bi-high-light-background",width:8,height:8}]})},doClick:function(){BI.HalfButton.superclass.doClick.apply(this,arguments),this.isValid()&&this.fireEvent(BI.HalfButton.EVENT_CHANGE)}}),BI.HalfButton.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.half_button",BI.HalfButton),BI.MultiSelectItem=BI.inherit(BI.BasicButton,{_defaultConfig:function(){return BI.extend(BI.MultiSelectItem.superclass._defaultConfig.apply(this,arguments),{extraCls:"bi-multi-select-item",height:24,logic:{dynamic:!1},iconWrapperWidth:26})},_init:function(){BI.MultiSelectItem.superclass._init.apply(this,arguments);var self=this,o=this.options;this.checkbox=BI.createWidget({type:"bi.checkbox"}),this.text=BI.createWidget({type:"bi.label",cls:"list-item-text",textAlign:"left",whiteSpace:"nowrap",textHeight:o.height,height:o.height,hgap:o.hgap,rgap:o.rgap,text:o.text,keyword:o.keyword,value:o.value,py:o.py}),this.checkbox.on(BI.Controller.EVENT_CHANGE,function(type){type===BI.Events.CLICK&&self.setSelected(self.isSelected())}),BI.createWidget(BI.extend({element:this},BI.LogicFactory.createLogic("horizontal",BI.extend(o.logic,{items:BI.LogicFactory.createLogicItemsByDirection("left",{type:"bi.center_adapt",items:[this.checkbox],width:o.iconWrapperWidth},this.text)}))))},doRedMark:function(){this.text.doRedMark.apply(this.text,arguments)},unRedMark:function(){this.text.unRedMark.apply(this.text,arguments)},doClick:function(){BI.MultiSelectItem.superclass.doClick.apply(this,arguments),this.checkbox.setSelected(this.isSelected()),this.isValid()&&this.fireEvent(BI.MultiSelectItem.EVENT_CHANGE,this.getValue(),this)},setSelected:function(v){BI.MultiSelectItem.superclass.setSelected.apply(this,arguments),this.checkbox.setSelected(v)}}),BI.MultiSelectItem.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.multi_select_item",BI.MultiSelectItem),BI.SingleSelectIconTextItem=BI.inherit(BI.Single,{_defaultConfig:function(){return BI.extend(BI.SingleSelectIconTextItem.superclass._defaultConfig.apply(this,arguments),{extraCls:"bi-single-select-icon-text-item bi-list-item-active",iconCls:"",height:24})},_init:function(){BI.SingleSelectIconTextItem.superclass._init.apply(this,arguments);var self=this,o=this.options;this.text=BI.createWidget({type:"bi.icon_text_item",element:this,cls:o.iconCls,once:o.once,iconWrapperWidth:o.iconWrapperWidth,selected:o.selected,height:o.height,iconHeight:o.iconHeight,iconWidth:o.iconWidth,text:o.text,keyword:o.keyword,value:o.value,py:o.py}),this.text.on(BI.Controller.EVENT_CHANGE,function(){self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)})},isSelected:function(){return this.text.isSelected()},setSelected:function(b){this.text.setSelected(b)},doRedMark:function(){this.text.doRedMark.apply(this.text,arguments)},unRedMark:function(){this.text.unRedMark.apply(this.text,arguments)},doClick:function(){BI.SingleSelectIconTextItem.superclass.doClick.apply(this,arguments)}}),BI.shortcut("bi.single_select_icon_text_item",BI.SingleSelectIconTextItem),BI.SingleSelectItem=BI.inherit(BI.BasicButton,{_defaultConfig:function(){return BI.extend(BI.SingleSelectItem.superclass._defaultConfig.apply(this,arguments),{extraCls:"bi-single-select-item bi-list-item-active",hgap:10,height:24,textAlign:"left"})},_init:function(){BI.SingleSelectItem.superclass._init.apply(this,arguments);var self=this,o=this.options;this.text=BI.createWidget({type:"bi.label",element:this,textAlign:o.textAlign,whiteSpace:"nowrap",textHeight:o.height,height:o.height,hgap:o.hgap,text:o.text,keyword:o.keyword,value:o.value,title:o.title||o.text,warningTitle:o.warningTitle,py:o.py})},doRedMark:function(){this.text.doRedMark.apply(this.text,arguments)},unRedMark:function(){this.text.unRedMark.apply(this.text,arguments)},doClick:function(){BI.SingleSelectItem.superclass.doClick.apply(this,arguments),this.isValid()&&this.fireEvent(BI.SingleSelectItem.EVENT_CHANGE,this.isSelected(),this)},setSelected:function(v){BI.SingleSelectItem.superclass.setSelected.apply(this,arguments)}}),BI.SingleSelectItem.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.single_select_item",BI.SingleSelectItem),BI.SingleSelectRadioItem=BI.inherit(BI.BasicButton,{_defaultConfig:function(){return BI.extend(BI.SingleSelectRadioItem.superclass._defaultConfig.apply(this,arguments),{extraCls:"bi-single-select-radio-item",logic:{dynamic:!1},hgap:10,height:24})},_init:function(){BI.SingleSelectRadioItem.superclass._init.apply(this,arguments);var self=this,o=this.options;this.radio=BI.createWidget({type:"bi.radio"}),this.text=BI.createWidget({type:"bi.label",cls:"list-item-text",textAlign:"left",whiteSpace:"nowrap",textHeight:o.height,height:o.height,hgap:o.hgap,text:o.text,keyword:o.keyword,value:o.value,py:o.py}),BI.createWidget(BI.extend({element:this},BI.LogicFactory.createLogic("horizontal",BI.extend(o.logic,{items:BI.LogicFactory.createLogicItemsByDirection("left",{type:"bi.center_adapt",items:[this.radio],width:16},this.text)}))))},doRedMark:function(){this.text.doRedMark.apply(this.text,arguments)},unRedMark:function(){this.text.unRedMark.apply(this.text,arguments)},doClick:function(){BI.SingleSelectRadioItem.superclass.doClick.apply(this,arguments),this.radio.setSelected(this.isSelected()),this.isValid()&&this.fireEvent(BI.SingleSelectRadioItem.EVENT_CHANGE,this.isSelected(),this)},setSelected:function(v){BI.SingleSelectRadioItem.superclass.setSelected.apply(this,arguments),this.radio.setSelected(v)}}),BI.SingleSelectRadioItem.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.single_select_radio_item",BI.SingleSelectRadioItem),BI.ArrowNode=BI.inherit(BI.NodeButton,{_defaultConfig:function(){var conf=BI.ArrowNode.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{baseCls:(conf.baseCls||"")+" bi-arrow-group-node bi-list-item",logic:{dynamic:!1},id:"",pId:"",open:!1,height:24})},_init:function(){var self=this,o=this.options;BI.ArrowNode.superclass._init.apply(this,arguments),this.checkbox=BI.createWidget({type:"bi.arrow_group_node_checkbox"}),this.text=BI.createWidget({type:"bi.label",textAlign:"left",whiteSpace:"nowrap",textHeight:o.height,height:o.height,hgap:o.hgap,text:o.text,value:o.value,py:o.py}),this.checkbox.on(BI.Controller.EVENT_CHANGE,function(type){type===BI.Events.CLICK&&self.setSelected(self.isSelected()),self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)});var type=BI.LogicFactory.createLogicTypeByDirection(BI.Direction.Left),items=BI.LogicFactory.createLogicItemsByDirection(BI.Direction.Left,{width:16,el:this.checkbox},this.text);BI.createWidget(BI.extend({element:this},BI.LogicFactory.createLogic(type,BI.extend(o.logic,{items:items}))))},doRedMark:function(){this.text.doRedMark.apply(this.text,arguments)},unRedMark:function(){this.text.unRedMark.apply(this.text,arguments)},doClick:function(){BI.ArrowNode.superclass.doClick.apply(this,arguments),this.checkbox.setSelected(this.isOpened())},setText:function(text){BI.ArrowNode.superclass.setText.apply(this,arguments),this.text.setText(text)},setOpened:function(v){BI.ArrowNode.superclass.setOpened.apply(this,arguments),this.checkbox.setSelected(v)}}),BI.shortcut("bi.arrow_group_node",BI.ArrowNode),BI.FirstPlusGroupNode=BI.inherit(BI.NodeButton,{_defaultConfig:function(){var conf=BI.FirstPlusGroupNode.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{baseCls:(conf.baseCls||"")+" bi-first-plus-group-node bi-list-item",logic:{dynamic:!1},id:"",pId:"",open:!1,height:24})},_init:function(){BI.FirstPlusGroupNode.superclass._init.apply(this,arguments);var self=this,o=this.options;this.checkbox=BI.createWidget({type:"bi.first_tree_node_checkbox",stopPropagation:!0}),this.text=BI.createWidget({type:"bi.label",textAlign:"left",whiteSpace:"nowrap",textHeight:o.height,height:o.height,hgap:o.hgap,text:o.text,value:o.value,py:o.py,keyword:o.keyword}),this.checkbox.on(BI.Controller.EVENT_CHANGE,function(type){type===BI.Events.CLICK&&(this.isSelected()?self.triggerExpand():self.triggerCollapse())});var type=BI.LogicFactory.createLogicTypeByDirection(BI.Direction.Left),items=BI.LogicFactory.createLogicItemsByDirection(BI.Direction.Left,{width:24,el:this.checkbox},this.text);BI.createWidget(BI.extend({element:this},BI.LogicFactory.createLogic(type,BI.extend(o.logic,{items:items}))))},doRedMark:function(){this.text.doRedMark.apply(this.text,arguments)},unRedMark:function(){this.text.unRedMark.apply(this.text,arguments)},doClick:function(){BI.FirstPlusGroupNode.superclass.doClick.apply(this,arguments),this.checkbox.setSelected(this.isSelected())},setOpened:function(v){BI.FirstPlusGroupNode.superclass.setOpened.apply(this,arguments),BI.isNotNull(this.checkbox)&&this.checkbox.setSelected(v)}}),BI.shortcut("bi.first_plus_group_node",BI.FirstPlusGroupNode),BI.IconArrowNode=BI.inherit(BI.NodeButton,{_defaultConfig:function(){var conf=BI.IconArrowNode.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{baseCls:(conf.baseCls||"")+" bi-icon-arrow-node bi-list-item",logic:{dynamic:!1},id:"",pId:"",open:!1,height:24,iconHeight:12,iconWidth:12,iconCls:""})},_init:function(){BI.IconArrowNode.superclass._init.apply(this,arguments);var self=this,o=this.options;this.checkbox=BI.createWidget({type:"bi.arrow_group_node_checkbox",width:24,stopPropagation:!0});var icon=BI.createWidget({type:"bi.icon_label",width:24,cls:o.iconCls,iconWidth:o.iconWidth,iconHeight:o.iconHeight});this.text=BI.createWidget({type:"bi.label",textAlign:"left",whiteSpace:"nowrap",textHeight:o.height,height:o.height,hgap:o.hgap,text:o.text,value:o.value,py:o.py}),this.checkbox.on(BI.Controller.EVENT_CHANGE,function(type){type===BI.Events.CLICK&&(this.isSelected()?self.triggerExpand():self.triggerCollapse())});var type=BI.LogicFactory.createLogicTypeByDirection(BI.Direction.Left),items=BI.LogicFactory.createLogicItemsByDirection(BI.Direction.Left,{width:16,el:this.checkbox},{width:16,el:icon},this.text);BI.createWidget(BI.extend({element:this},BI.LogicFactory.createLogic(type,BI.extend(o.logic,{items:items,rgap:5}))))},doRedMark:function(){this.text.doRedMark.apply(this.text,arguments)},unRedMark:function(){this.text.unRedMark.apply(this.text,arguments)},doClick:function(){BI.IconArrowNode.superclass.doClick.apply(this,arguments),this.checkbox.setSelected(this.isSelected())},setOpened:function(v){BI.IconArrowNode.superclass.setOpened.apply(this,arguments),BI.isNotNull(this.checkbox)&&this.checkbox.setSelected(v)}}),BI.shortcut("bi.icon_arrow_node",BI.IconArrowNode),BI.LastPlusGroupNode=BI.inherit(BI.NodeButton,{_defaultConfig:function(){var conf=BI.LastPlusGroupNode.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{baseCls:(conf.baseCls||"")+" bi-last-plus-group-node bi-list-item",logic:{dynamic:!1},id:"",pId:"",open:!1,height:24})},_init:function(){BI.LastPlusGroupNode.superclass._init.apply(this,arguments);var self=this,o=this.options;this.checkbox=BI.createWidget({type:"bi.last_tree_node_checkbox",stopPropagation:!0}),this.text=BI.createWidget({type:"bi.label",textAlign:"left",whiteSpace:"nowrap",textHeight:o.height,height:o.height,hgap:o.hgap,text:o.text,value:o.value,py:o.py,keyword:o.keyword}),this.checkbox.on(BI.Controller.EVENT_CHANGE,function(type){type===BI.Events.CLICK&&(this.isSelected()?self.triggerExpand():self.triggerCollapse())});var type=BI.LogicFactory.createLogicTypeByDirection(BI.Direction.Left),items=BI.LogicFactory.createLogicItemsByDirection(BI.Direction.Left,{width:24,el:this.checkbox},this.text);BI.createWidget(BI.extend({element:this},BI.LogicFactory.createLogic(type,BI.extend(o.logic,{items:items}))))},doRedMark:function(){this.text.doRedMark.apply(this.text,arguments)},unRedMark:function(){this.text.unRedMark.apply(this.text,arguments)},doClick:function(){BI.LastPlusGroupNode.superclass.doClick.apply(this,arguments),this.checkbox.setSelected(this.isSelected())},setOpened:function(v){BI.LastPlusGroupNode.superclass.setOpened.apply(this,arguments),BI.isNotNull(this.checkbox)&&this.checkbox.setSelected(v)}}),BI.shortcut("bi.last_plus_group_node",BI.LastPlusGroupNode),BI.MidPlusGroupNode=BI.inherit(BI.NodeButton,{_defaultConfig:function(){var conf=BI.MidPlusGroupNode.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{baseCls:(conf.baseCls||"")+" bi-mid-plus-group-node bi-list-item",logic:{dynamic:!1},id:"",pId:"",open:!1,height:24})},_init:function(){BI.MidPlusGroupNode.superclass._init.apply(this,arguments);var self=this,o=this.options;this.checkbox=BI.createWidget({type:"bi.mid_tree_node_checkbox",stopPropagation:!0}),this.text=BI.createWidget({type:"bi.label",textAlign:"left",whiteSpace:"nowrap",textHeight:o.height,height:o.height,hgap:o.hgap,text:o.text,value:o.value,py:o.py,keyword:o.keyword}),this.checkbox.on(BI.Controller.EVENT_CHANGE,function(type){type===BI.Events.CLICK&&(this.isSelected()?self.triggerExpand():self.triggerCollapse())});var type=BI.LogicFactory.createLogicTypeByDirection(BI.Direction.Left),items=BI.LogicFactory.createLogicItemsByDirection(BI.Direction.Left,{width:24,el:this.checkbox},this.text);BI.createWidget(BI.extend({element:this},BI.LogicFactory.createLogic(type,BI.extend(o.logic,{items:items}))))},doRedMark:function(){this.text.doRedMark.apply(this.text,arguments)},unRedMark:function(){this.text.unRedMark.apply(this.text,arguments)},doClick:function(){BI.MidPlusGroupNode.superclass.doClick.apply(this,arguments),this.checkbox.setSelected(this.isSelected())},setOpened:function(v){BI.MidPlusGroupNode.superclass.setOpened.apply(this,arguments),BI.isNotNull(this.checkbox)&&this.checkbox.setSelected(v)}}),BI.shortcut("bi.mid_plus_group_node",BI.MidPlusGroupNode),BI.MultiLayerIconArrowNode=BI.inherit(BI.NodeButton,{_defaultConfig:function(){var conf=BI.MultiLayerIconArrowNode.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{extraCls:"bi-multilayer-icon-arrow-node bi-list-item",layer:0,id:"",pId:"",open:!1,height:24,iconHeight:16,iconWidth:16,iconCls:""})},_init:function(){BI.MultiLayerIconArrowNode.superclass._init.apply(this,arguments);var self=this,o=this.options;this.node=BI.createWidget({type:"bi.icon_arrow_node",iconCls:o.iconCls,cls:"bi-list-item-none",id:o.id,pId:o.pId,open:o.open,height:o.height,iconHeight:o.iconHeight,iconWidth:o.iconWidth,hgap:o.hgap,text:o.text,value:o.value,py:o.py}),this.node.on(BI.Controller.EVENT_CHANGE,function(type){self.setSelected(self.isSelected()),self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)});var items=[];BI.count(0,o.layer,function(){items.push({type:"bi.layout",width:15,height:o.height})}),items.push(this.node),BI.createWidget({type:"bi.td",element:this,columnSize:BI.makeArray(o.layer,15),items:[items]})},isOnce:function(){return!0},doRedMark:function(){this.node.doRedMark.apply(this.node,arguments)},unRedMark:function(){this.node.unRedMark.apply(this.node,arguments)},isSelected:function(){return this.node.isSelected()},setSelected:function(b){BI.MultiLayerIconArrowNode.superclass.setSelected.apply(this,arguments),this.node.setSelected(b)},doClick:function(){BI.NodeButton.superclass.doClick.apply(this,arguments),this.node.setSelected(this.isSelected())},setOpened:function(v){BI.MultiLayerIconArrowNode.superclass.setOpened.apply(this,arguments),this.node.setOpened(v)}}),BI.shortcut("bi.multilayer_icon_arrow_node",BI.MultiLayerIconArrowNode),BI.PlusGroupNode=BI.inherit(BI.NodeButton,{_defaultConfig:function(){var conf=BI.PlusGroupNode.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{baseCls:(conf.baseCls||"")+" bi-plus-group-node bi-list-item",logic:{dynamic:!1},id:"",pId:"",open:!1,height:24})},_init:function(){BI.PlusGroupNode.superclass._init.apply(this,arguments);var self=this,o=this.options;this.checkbox=BI.createWidget({type:"bi.tree_node_checkbox"}),this.text=BI.createWidget({type:"bi.label",textAlign:"left",whiteSpace:"nowrap",textHeight:o.height,height:o.height,hgap:o.hgap,text:o.text,value:o.value,keyword:o.keyword,py:o.py}),this.checkbox.on(BI.Controller.EVENT_CHANGE,function(type){type===BI.Events.CLICK&&self.setSelected(self.isSelected()),self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)});var type=BI.LogicFactory.createLogicTypeByDirection(BI.Direction.Left),items=BI.LogicFactory.createLogicItemsByDirection(BI.Direction.Left,{width:24,el:this.checkbox},this.text);BI.createWidget(BI.extend({element:this},BI.LogicFactory.createLogic(type,BI.extend(o.logic,{items:items}))))},doRedMark:function(){this.text.doRedMark.apply(this.text,arguments)},unRedMark:function(){this.text.unRedMark.apply(this.text,arguments)},doClick:function(){BI.PlusGroupNode.superclass.doClick.apply(this,arguments),this.checkbox.setSelected(this.isSelected())},setOpened:function(v){BI.PlusGroupNode.superclass.setOpened.apply(this,arguments),this.checkbox&&this.checkbox.setSelected(v)}}),BI.shortcut("bi.plus_group_node",BI.PlusGroupNode),BI.Switch=BI.inherit(BI.BasicButton,{props:{extraCls:"bi-switch",height:22,width:44,logic:{dynamic:!1}},render:function(){var self=this;return{type:"bi.absolute",ref:function(){self.layout=this},items:[{el:{type:"bi.text_button",cls:"circle-button bi-card"},width:18,height:18,top:2,left:this.options.selected?24:2}]}},setSelected:function(v){BI.Switch.superclass.setSelected.apply(this,arguments),this.layout.attr("items")[0].left=v?24:2,this.layout.resize()},doClick:function(){BI.Switch.superclass.doClick.apply(this,arguments),this.fireEvent(BI.Switch.EVENT_CHANGE)}}),BI.Switch.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.switch",BI.Switch),BI.FirstTreeLeafItem=BI.inherit(BI.BasicButton,{_defaultConfig:function(){return BI.extend(BI.FirstTreeLeafItem.superclass._defaultConfig.apply(this,arguments),{extraCls:"bi-first-tree-leaf-item bi-list-item-active",logic:{dynamic:!1},id:"",pId:"",layer:0,height:24})},_init:function(){BI.FirstTreeLeafItem.superclass._init.apply(this,arguments);var self=this,o=this.options;this.checkbox=BI.createWidget({type:"bi.checkbox"}),this.text=BI.createWidget({type:"bi.label",textAlign:"left",whiteSpace:"nowrap",textHeight:o.height,height:o.height,hgap:o.hgap,text:o.text,value:o.value,py:o.py,keyword:o.keyword}),this.checkbox.on(BI.Controller.EVENT_CHANGE,function(type){type===BI.Events.CLICK&&self.setSelected(self.isSelected()),self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)});var type=BI.LogicFactory.createLogicTypeByDirection(BI.Direction.Left),items=BI.LogicFactory.createLogicItemsByDirection(BI.Direction.Left,0===o.layer?"":{width:12,el:{type:"bi.layout",cls:o.pNode&&o.pNode.isLastNode?"":"base-line-conn-background",width:12,height:o.height}},{width:24,el:{type:"bi.layout",cls:"first-line-conn-background",width:24,height:o.height}},{el:this.text});BI.createWidget(BI.extend({element:this},BI.LogicFactory.createLogic(type,BI.extend(o.logic,{items:items}))))},doRedMark:function(){this.text.doRedMark.apply(this.text,arguments)},unRedMark:function(){this.text.unRedMark.apply(this.text,arguments)},doHighLight:function(){this.text.doHighLight.apply(this.text,arguments)},unHighLight:function(){this.text.unHighLight.apply(this.text,arguments)},getId:function(){return this.options.id},getPId:function(){return this.options.pId},doClick:function(){BI.FirstTreeLeafItem.superclass.doClick.apply(this,arguments),this.checkbox.setSelected(this.isSelected())},setSelected:function(v){BI.FirstTreeLeafItem.superclass.setSelected.apply(this,arguments),this.checkbox.setSelected(v)}}),BI.shortcut("bi.first_tree_leaf_item",BI.FirstTreeLeafItem),BI.IconTreeLeafItem=BI.inherit(BI.BasicButton,{_defaultConfig:function(){return BI.extend(BI.IconTreeLeafItem.superclass._defaultConfig.apply(this,arguments),{extraCls:"bi-icon-tree-leaf-item bi-list-item-active",logic:{dynamic:!1},height:24,iconWidth:16,iconHeight:16,iconCls:""})},_init:function(){BI.IconTreeLeafItem.superclass._init.apply(this,arguments);var self=this,o=this.options,icon=BI.createWidget({type:"bi.center_adapt",width:24,cls:o.iconCls,items:[{type:"bi.icon",width:o.iconWidth,height:o.iconHeight}]});this.text=BI.createWidget({type:"bi.label",textAlign:"left",whiteSpace:"nowrap",textHeight:o.height,height:o.height,hgap:o.hgap,text:o.text,value:o.value,py:o.py});var type=BI.LogicFactory.createLogicTypeByDirection(BI.Direction.Left),items=BI.LogicFactory.createLogicItemsByDirection(BI.Direction.Left,{width:16,el:icon},{el:this.text});BI.createWidget(BI.extend({element:this},BI.LogicFactory.createLogic(type,BI.extend(o.logic,{items:items,hgap:5}))))},doRedMark:function(){this.text.doRedMark.apply(this.text,arguments)},unRedMark:function(){this.text.unRedMark.apply(this.text,arguments)},doHighLight:function(){this.text.doHighLight.apply(this.text,arguments)},unHighLight:function(){this.text.unHighLight.apply(this.text,arguments)},getId:function(){return this.options.id},getPId:function(){return this.options.pId},doClick:function(){BI.IconTreeLeafItem.superclass.doClick.apply(this,arguments)},setSelected:function(v){BI.IconTreeLeafItem.superclass.setSelected.apply(this,arguments)}}),BI.shortcut("bi.icon_tree_leaf_item",BI.IconTreeLeafItem),BI.LastTreeLeafItem=BI.inherit(BI.BasicButton,{_defaultConfig:function(){return BI.extend(BI.LastTreeLeafItem.superclass._defaultConfig.apply(this,arguments),{extraCls:"bi-last-tree-leaf-item bi-list-item-active",logic:{dynamic:!1},id:"",pId:"",layer:0,height:24})},_init:function(){BI.LastTreeLeafItem.superclass._init.apply(this,arguments);var self=this,o=this.options;this.checkbox=BI.createWidget({type:"bi.checkbox"}),this.text=BI.createWidget({type:"bi.label",textAlign:"left",whiteSpace:"nowrap",textHeight:o.height,height:o.height,hgap:o.hgap,text:o.text,value:o.value,py:o.py,keyword:o.keyword}),this.checkbox.on(BI.Controller.EVENT_CHANGE,function(type){type===BI.Events.CLICK&&self.setSelected(self.isSelected()),self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)});var type=BI.LogicFactory.createLogicTypeByDirection(BI.Direction.Left),items=BI.LogicFactory.createLogicItemsByDirection(BI.Direction.Left,0===o.layer?"":{width:12,el:{type:"bi.layout",cls:o.pNode&&o.pNode.isLastNode?"":"base-line-conn-background",width:12,height:o.height}},{width:24,el:{type:"bi.layout",cls:"last-line-conn-background",width:24,height:o.height}},{el:this.text});BI.createWidget(BI.extend({element:this},BI.LogicFactory.createLogic(type,BI.extend(o.logic,{items:items}))))},doRedMark:function(){this.text.doRedMark.apply(this.text,arguments)},unRedMark:function(){this.text.unRedMark.apply(this.text,arguments)},doHighLight:function(){this.text.doHighLight.apply(this.text,arguments)},unHighLight:function(){this.text.unHighLight.apply(this.text,arguments)},getId:function(){return this.options.id},getPId:function(){return this.options.pId},doClick:function(){BI.LastTreeLeafItem.superclass.doClick.apply(this,arguments)},setSelected:function(v){BI.LastTreeLeafItem.superclass.setSelected.apply(this,arguments)}}),BI.shortcut("bi.last_tree_leaf_item",BI.LastTreeLeafItem),BI.MidTreeLeafItem=BI.inherit(BI.BasicButton,{_defaultConfig:function(){return BI.extend(BI.MidTreeLeafItem.superclass._defaultConfig.apply(this,arguments),{extraCls:"bi-mid-tree-leaf-item bi-list-item-active",logic:{dynamic:!1},id:"",pId:"",layer:0,height:24})},_init:function(){BI.MidTreeLeafItem.superclass._init.apply(this,arguments);var self=this,o=this.options;this.checkbox=BI.createWidget({type:"bi.checkbox"}),this.text=BI.createWidget({type:"bi.label",textAlign:"left",whiteSpace:"nowrap",textHeight:o.height,height:o.height,hgap:o.hgap,text:o.text,value:o.value,py:o.py,keyword:o.keyword}),this.checkbox.on(BI.Controller.EVENT_CHANGE,function(type){type===BI.Events.CLICK&&self.setSelected(self.isSelected()),self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)});var type=BI.LogicFactory.createLogicTypeByDirection(BI.Direction.Left),items=BI.LogicFactory.createLogicItemsByDirection(BI.Direction.Left,0===o.layer?"":{width:12,el:{type:"bi.layout",cls:o.pNode&&o.pNode.isLastNode?"":"base-line-conn-background",width:12,height:o.height}},{width:24,el:{type:"bi.layout",cls:"mid-line-conn-background",width:24,height:o.height}},{el:this.text});BI.createWidget(BI.extend({element:this},BI.LogicFactory.createLogic(type,BI.extend(o.logic,{items:items}))))},doRedMark:function(){this.text.doRedMark.apply(this.text,arguments)},unRedMark:function(){this.text.unRedMark.apply(this.text,arguments)},doHighLight:function(){this.text.doHighLight.apply(this.text,arguments)},unHighLight:function(){this.text.unHighLight.apply(this.text,arguments)},getId:function(){return this.options.id},getPId:function(){return this.options.pId},doClick:function(){BI.MidTreeLeafItem.superclass.doClick.apply(this,arguments),this.checkbox.setSelected(this.isSelected())},setSelected:function(v){BI.MidTreeLeafItem.superclass.setSelected.apply(this,arguments),this.checkbox.setSelected(v)}}),BI.shortcut("bi.mid_tree_leaf_item",BI.MidTreeLeafItem),BI.MultiLayerIconTreeLeafItem=BI.inherit(BI.BasicButton,{_defaultConfig:function(){return BI.extend(BI.MultiLayerIconTreeLeafItem.superclass._defaultConfig.apply(this,arguments),{extraCls:"bi-multilayer-icon-tree-leaf-item bi-list-item-active",layer:0,height:24,iconCls:"",iconHeight:16,iconWidth:16})},_init:function(){BI.MultiLayerIconTreeLeafItem.superclass._init.apply(this,arguments);var self=this,o=this.options;this.item=BI.createWidget({type:"bi.icon_tree_leaf_item",cls:"bi-list-item-none",iconCls:o.iconCls,id:o.id,pId:o.pId,isFront:!0,height:o.height,hgap:o.hgap,text:o.text,value:o.value,py:o.py,iconWidth:o.iconWidth,iconHeight:o.iconHeight}),this.item.on(BI.Controller.EVENT_CHANGE,function(type){type!==BI.Events.CLICK&&self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)});var items=[];BI.count(0,o.layer,function(){items.push({type:"bi.layout",width:15,height:o.height})}),items.push(this.item),BI.createWidget({type:"bi.td",element:this,columnSize:BI.makeArray(o.layer,15),items:[items]})},doRedMark:function(){this.item.doRedMark.apply(this.item,arguments)},unRedMark:function(){this.item.unRedMark.apply(this.item,arguments)},doHighLight:function(){this.item.doHighLight.apply(this.item,arguments)},unHighLight:function(){this.item.unHighLight.apply(this.item,arguments)},getId:function(){return this.options.id},getPId:function(){return this.options.pId},doClick:function(){BI.MultiLayerIconTreeLeafItem.superclass.doClick.apply(this,arguments),this.item.setSelected(this.isSelected())},setSelected:function(v){BI.MultiLayerIconTreeLeafItem.superclass.setSelected.apply(this,arguments),this.item.setSelected(v)},getValue:function(){return this.options.value}}),BI.shortcut("bi.multilayer_icon_tree_leaf_item",BI.MultiLayerIconTreeLeafItem),BI.TreeTextLeafItem=BI.inherit(BI.BasicButton,{_defaultConfig:function(){return BI.extend(BI.TreeTextLeafItem.superclass._defaultConfig.apply(this,arguments),{extraCls:"bi-tree-text-leaf-item bi-list-item-active",id:"",pId:"",height:24,hgap:0,lgap:0,rgap:0})},_init:function(){BI.TreeTextLeafItem.superclass._init.apply(this,arguments);var self=this,o=this.options;this.text=BI.createWidget({type:"bi.label",textAlign:"left",whiteSpace:"nowrap",textHeight:o.height,height:o.height,hgap:o.hgap,lgap:o.lgap,rgap:o.hgap,text:o.text,value:o.value,py:o.py}),BI.createWidget({type:"bi.htape",element:this,items:[{el:this.text}]})},doRedMark:function(){this.text.doRedMark.apply(this.text,arguments)},unRedMark:function(){this.text.unRedMark.apply(this.text,arguments)},doHighLight:function(){this.text.doHighLight.apply(this.text,arguments)},unHighLight:function(){this.text.unHighLight.apply(this.text,arguments)},getId:function(){return this.options.id},getPId:function(){return this.options.pId}}),BI.shortcut("bi.tree_text_leaf_item",BI.TreeTextLeafItem),BI.CalendarDateItem=BI.inherit(BI.BasicButton,{render:function(){var self=this,o=this.options;return{type:"bi.absolute",items:[{el:{type:"bi.text_item",cls:"bi-list-item-select",textAlign:"center",whiteSpace:"normal",text:o.text,value:o.value,ref:function(){self.text=this}},left:o.lgap,right:o.rgap,top:0,bottom:0}]}},doHighLight:function(){this.text.doHighLight.apply(this.text,arguments)},unHighLight:function(){this.text.unHighLight.apply(this.text,arguments)},setValue:function(){this.isReadOnly()||this.text.setValue.apply(this.text,arguments)},setSelected:function(b){BI.CalendarDateItem.superclass.setSelected.apply(this,arguments),this.text.setSelected(b)},getValue:function(){return this.text.getValue()}}),BI.shortcut("bi.calendar_date_item",BI.CalendarDateItem),BI.Calendar=BI.inherit(BI.Widget,{_defaultConfig:function(){var conf=BI.Calendar.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{baseCls:"bi-calendar",logic:{dynamic:!1},min:"1900-01-01",max:"2099-12-31",year:2015,month:8,day:25})},_dateCreator:function(Y,M,D){var self=this,o=this.options,log={},De=BI.getDate(),mins=o.min.match(/\d+/g),maxs=o.max.match(/\d+/g);Y<(0|mins[0])&&(Y=0|mins[0]),Y>(0|maxs[0])&&(Y=0|maxs[0]),De.setFullYear(Y,M,D),log.ymd=[De.getFullYear(),De.getMonth(),De.getDate()];var MD=BI.Date._MD.slice(0);MD[1]=BI.isLeapYear(log.ymd[0])?29:28,De.setFullYear(log.ymd[0],log.ymd[1],1),log.FDay=De.getDay();var offSetFDay=(7-BI.StartOfWeek+log.FDay)%7;log.PDay=MD[0===M?11:M-1]-offSetFDay+1, +log.NDay=1;var items=[];return BI.each(BI.range(42),function(i){var td={},YY=log.ymd[0],MM=log.ymd[1]+1,DD;i=offSetFDay&&i=0?page%12:(12+page%12)%12;return{year:BI.getDate().getFullYear()+year,month:month+1}}}),BI.shortcut("bi.calendar",BI.Calendar),BI.YearCalendar=BI.inherit(BI.Widget,{_defaultConfig:function(){var conf=BI.YearCalendar.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{baseCls:"bi-year-calendar",behaviors:{},logic:{dynamic:!1},min:"1900-01-01",max:"2099-12-31",year:null})},_yearCreator:function(Y){var o=this.options;Y=0|Y;var start=BI.YearCalendar.getStartYear(Y),items=[],startDate=BI.parseDateTime(o.min,"%Y-%X-%d"),endDate=BI.parseDateTime(o.max,"%Y-%X-%d");return BI.each(BI.range(BI.YearCalendar.INTERVAL),function(i){var td={};BI.checkDateVoid(start+i,1,1,BI.print(BI.getDate(startDate.getFullYear(),0,1),"%Y-%X-%d"),BI.print(BI.getDate(endDate.getFullYear(),0,1),"%Y-%X-%d"))[0]&&(td.disabled=!0),td.text=start+i,items.push(td)}),items},_init:function(){BI.YearCalendar.superclass._init.apply(this,arguments);var self=this,o=this.options;this.currentYear=BI.getDate().getFullYear();var years=this._yearCreator(o.year||this.currentYear),len=years.length,tyears=BI.makeArray(len,""),map=[0,6,1,7,2,8,3,9,4,10,5,11];BI.each(years,function(i,y){tyears[i]=years[map[i]]});var items=[];items.push(tyears.slice(0,2)),items.push(tyears.slice(2,4)),items.push(tyears.slice(4,6)),items.push(tyears.slice(6,8)),items.push(tyears.slice(8,10)),items.push(tyears.slice(10,12)),items=BI.map(items,function(i,item){return BI.map(item,function(j,td){return BI.extend(td,{type:"bi.text_item",cls:"bi-list-item-select",textAlign:"center",whiteSpace:"normal",once:!1,forceSelected:!0,height:24,width:45,value:td.text,disabled:td.disabled})})}),this.years=BI.createWidget({type:"bi.button_group",behaviors:o.behaviors,items:BI.createItems(items,{}),layouts:[BI.LogicFactory.createLogic("table",BI.extend({},o.logic,{columns:2,rows:6,columnSize:[.5,.5],rowSize:24})),{type:"bi.center_adapt",vgap:1}]}),this.years.on(BI.Controller.EVENT_CHANGE,function(){self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),BI.createWidget(BI.extend({element:this},BI.LogicFactory.createLogic("vertical",BI.extend({},o.logic,{items:BI.LogicFactory.createLogicItemsByDirection("top",this.years)}))))},isFrontYear:function(){var o=this.options,Y=o.year;return Y=0|Y,!!BI.checkDateVoid(BI.YearCalendar.getStartYear(Y)-1,1,1,o.min,o.max)[0]},isFinalYear:function(){var o=this.options,c=this._const,Y=o.year;return Y=0|Y,!!BI.checkDateVoid(BI.YearCalendar.getEndYear(Y)+1,1,1,o.min,o.max)[0]},setValue:function(val){this.years.setValue([val])},getValue:function(){return this.years.getValue()[0]}}),BI.extend(BI.YearCalendar,{INTERVAL:12,getStartYear:function(year){var cur=BI.getDate().getFullYear();return year-((year-cur+3)%BI.YearCalendar.INTERVAL+12)%BI.YearCalendar.INTERVAL},getEndYear:function(year){return BI.YearCalendar.getStartYear(year)+BI.YearCalendar.INTERVAL-1},getPageByYear:function(year){var cur=BI.getDate().getFullYear();return year=BI.YearCalendar.getStartYear(year),(year-cur+3)/BI.YearCalendar.INTERVAL}}),BI.shortcut("bi.year_calendar",BI.YearCalendar),BI.ArrowTreeGroupNodeCheckbox=BI.inherit(BI.IconButton,{_defaultConfig:function(){return BI.extend(BI.ArrowTreeGroupNodeCheckbox.superclass._defaultConfig.apply(this,arguments),{extraCls:"bi-arrow-group-node-checkbox"})},setSelected:function(v){BI.ArrowTreeGroupNodeCheckbox.superclass.setSelected.apply(this,arguments),v?this.element.removeClass("expander-right-font").addClass("expander-down-font"):this.element.removeClass("expander-down-font").addClass("expander-right-font")}}),BI.shortcut("bi.arrow_group_node_checkbox",BI.ArrowTreeGroupNodeCheckbox),BI.CheckingMarkNode=BI.inherit(BI.IconButton,{_defaultConfig:function(){return BI.extend(BI.CheckingMarkNode.superclass._defaultConfig.apply(this,arguments),{extraCls:"check-mark-font"})},_init:function(){BI.CheckingMarkNode.superclass._init.apply(this,arguments),this.setSelected(this.options.selected)},setSelected:function(v){BI.CheckingMarkNode.superclass.setSelected.apply(this,arguments),v===!0?this.element.addClass("check-mark-font"):this.element.removeClass("check-mark-font")}}),BI.shortcut("bi.checking_mark_node",BI.CheckingMarkNode),BI.FirstTreeNodeCheckbox=BI.inherit(BI.IconButton,{_defaultConfig:function(){return BI.extend(BI.FirstTreeNodeCheckbox.superclass._defaultConfig.apply(this,arguments),{extraCls:"tree-collapse-icon-type2",iconWidth:24,iconHeight:24})},setSelected:function(v){BI.FirstTreeNodeCheckbox.superclass.setSelected.apply(this,arguments),v===!0?this.element.addClass("tree-expand-icon-type2"):this.element.removeClass("tree-expand-icon-type2")}}),BI.shortcut("bi.first_tree_node_checkbox",BI.FirstTreeNodeCheckbox),BI.LastTreeNodeCheckbox=BI.inherit(BI.IconButton,{_defaultConfig:function(){return BI.extend(BI.LastTreeNodeCheckbox.superclass._defaultConfig.apply(this,arguments),{extraCls:"tree-collapse-icon-type4",iconWidth:24,iconHeight:24})},setSelected:function(v){BI.LastTreeNodeCheckbox.superclass.setSelected.apply(this,arguments),v===!0?this.element.addClass("tree-expand-icon-type4"):this.element.removeClass("tree-expand-icon-type4")}}),BI.shortcut("bi.last_tree_node_checkbox",BI.LastTreeNodeCheckbox),BI.MidTreeNodeCheckbox=BI.inherit(BI.IconButton,{_defaultConfig:function(){return BI.extend(BI.MidTreeNodeCheckbox.superclass._defaultConfig.apply(this,arguments),{extraCls:"tree-collapse-icon-type3",iconWidth:24,iconHeight:24})},setSelected:function(v){BI.MidTreeNodeCheckbox.superclass.setSelected.apply(this,arguments),v===!0?this.element.addClass("tree-expand-icon-type3"):this.element.removeClass("tree-expand-icon-type3")}}),BI.shortcut("bi.mid_tree_node_checkbox",BI.MidTreeNodeCheckbox),BI.TreeNodeCheckbox=BI.inherit(BI.IconButton,{_defaultConfig:function(){return BI.extend(BI.TreeNodeCheckbox.superclass._defaultConfig.apply(this,arguments),{extraCls:"tree-collapse-icon-type1",iconWidth:24,iconHeight:24})},setSelected:function(v){BI.TreeNodeCheckbox.superclass.setSelected.apply(this,arguments),v?this.element.addClass("tree-expand-icon-type1"):this.element.removeClass("tree-expand-icon-type1")}}),BI.shortcut("bi.tree_node_checkbox",BI.TreeNodeCheckbox),BI.CustomColorChooser=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.CustomColorChooser.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-custom-color-chooser",width:227,height:245})},_init:function(){BI.CustomColorChooser.superclass._init.apply(this,arguments);var self=this,o=this.options;this.editor=BI.createWidget(o.editor,{type:"bi.simple_color_picker_editor"}),this.editor.on(BI.ColorPickerEditor.EVENT_CHANGE,function(){self.setValue(this.getValue())}),this.farbtastic=BI.createWidget({type:"bi.farbtastic"}),this.farbtastic.on(BI.Farbtastic.EVENT_CHANGE,function(){self.setValue(this.getValue())}),BI.createWidget({type:"bi.vtape",element:this,items:[{type:"bi.absolute",items:[{el:this.editor,left:0,top:0,right:0}],height:30},{type:"bi.absolute",items:[{el:this.farbtastic,left:15,right:15,top:7}],height:215}]})},setValue:function(color){this.editor.setValue(color),this.farbtastic.setValue(color)},getValue:function(){return this.editor.getValue()}}),BI.CustomColorChooser.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.custom_color_chooser",BI.CustomColorChooser),BI.ColorChooser=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.ColorChooser.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-color-chooser",value:"",height:24})},_init:function(){BI.ColorChooser.superclass._init.apply(this,arguments);var self=this,o=this.options;this.combo=BI.createWidget({type:"bi.combo",element:this,container:o.container,adjustLength:1,isNeedAdjustWidth:!1,isNeedAdjustHeight:!1,el:BI.extend({type:o.width<=24?"bi.color_chooser_trigger":"bi.long_color_chooser_trigger",ref:function(_ref){self.trigger=_ref},width:o.width-2,height:o.height-2},o.el),popup:{el:BI.extend({type:"bi.color_chooser_popup",ref:function(_ref){self.colorPicker=_ref},listeners:[{eventName:BI.ColorChooserPopup.EVENT_VALUE_CHANGE,action:function(){fn(),self._isRGBColor(self.colorPicker.getValue())||self.combo.hideView()}},{eventName:BI.ColorChooserPopup.EVENT_CHANGE,action:function(){fn(),self.combo.hideView()}}]},o.popup),width:230},value:o.value});var fn=function(){var color=self.colorPicker.getValue();self.trigger.setValue(color)};this.combo.on(BI.Combo.EVENT_AFTER_HIDEVIEW,function(){self.fireEvent(BI.ColorChooser.EVENT_CHANGE,arguments)})},_isRGBColor:function(color){return BI.isNotEmptyString(color)&&"transparent"!==color},isViewVisible:function(){return this.combo.isViewVisible()},hideView:function(){this.combo.hideView()},showView:function(){this.combo.showView()},setValue:function(color){this.combo.setValue(color)},getValue:function(){return this.combo.getValue()}}),BI.ColorChooser.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.color_chooser",BI.ColorChooser),BI.ColorChooserPopup=BI.inherit(BI.Widget,{props:{baseCls:"bi-color-chooser-popup",width:230,height:145,simple:!1},render:function(){var self=this,o=this.options;this.colorEditor=BI.createWidget(o.editor,{type:o.simple?"bi.simple_color_picker_editor":"bi.color_picker_editor",value:o.value,cls:"bi-header-background bi-border-bottom",height:30}),this.colorEditor.on(BI.ColorPickerEditor.EVENT_CHANGE,function(){self.setValue(this.getValue()),self._dealStoreColors(),self.fireEvent(BI.ColorChooserPopup.EVENT_VALUE_CHANGE,arguments)}),this.storeColors=BI.createWidget({type:"bi.color_picker",cls:"bi-border-bottom bi-border-right",items:[this._digestStoreColors(this._getStoreColors())],width:210,height:24,value:o.value}),this.storeColors.on(BI.ColorPicker.EVENT_CHANGE,function(){self.setValue(this.getValue()[0]),self._dealStoreColors(),self.fireEvent(BI.ColorChooserPopup.EVENT_CHANGE,arguments)}),this.colorPicker=BI.createWidget({type:"bi.color_picker",width:210,height:50,value:o.value}),this.colorPicker.on(BI.ColorPicker.EVENT_CHANGE,function(){self.setValue(this.getValue()[0]),self._dealStoreColors(),self.fireEvent(BI.ColorChooserPopup.EVENT_CHANGE,arguments)}),this.customColorChooser=BI.createWidget({type:"bi.custom_color_chooser",editor:o.editor});var panel=BI.createWidget({type:"bi.popup_panel",buttons:[BI.i18nText("BI-Basic_Cancel"),BI.i18nText("BI-Basic_Save")],title:BI.i18nText("BI-Custom_Color"),el:this.customColorChooser,stopPropagation:!1,bgap:-1,rgap:1,lgap:1,minWidth:227});return this.more=BI.createWidget({type:"bi.combo",cls:"bi-border-top",container:null,direction:"right,top",isNeedAdjustHeight:!1,el:{type:"bi.text_item",cls:"color-chooser-popup-more bi-list-item",textAlign:"center",height:24,textLgap:10,text:BI.i18nText("BI-Basic_More")+"..."},popup:panel}),this.more.on(BI.Combo.EVENT_AFTER_POPUPVIEW,function(){self.customColorChooser.setValue(self.getValue())}),panel.on(BI.PopupPanel.EVENT_CLICK_TOOLBAR_BUTTON,function(index){switch(index){case 0:self.more.hideView();break;case 1:self.setValue(self.customColorChooser.getValue()),self._dealStoreColors(),self.more.hideView(),self.fireEvent(BI.ColorChooserPopup.EVENT_CHANGE,arguments)}}),{type:"bi.absolute",items:[{el:{type:"bi.vtape",items:[this.colorEditor,{el:{type:"bi.absolute",items:[{el:this.storeColors,left:10,right:10,top:5}]},height:29},{el:{type:"bi.absolute",items:[{el:this.colorPicker,left:10,right:10,top:5,bottom:5}]},height:60},{el:this.more,height:24}]},left:0,right:0,top:0,bottom:0},{el:{type:"bi.layout",cls:"disable-mask",invisible:!o.disabled,ref:function(){self.mask=this}},left:0,right:0,top:0,bottom:0}]}},mounted:function(){var self=this,o=this.options;BI.isNotNull(o.value)&&this.setValue(o.value)},_setEnable:function(enable){BI.ColorChooserPopup.superclass._setEnable.apply(this,arguments),this.mask.setVisible(!enable)},_dealStoreColors:function(){var color=this.getValue(),colors=this._getStoreColors(),que=new BI.Queue(8);que.fromArray(colors),que.remove(color),que.unshift(color);var array=que.toArray();BI.Cache.setItem("colors",BI.array2String(array)),this.setStoreColors(array)},_digestStoreColors:function(colors){var items=BI.map(colors,function(i,color){return{value:color}});return BI.count(colors.length,8,function(i){items.push({value:"",disabled:!0})}),items},_getStoreColors:function(){var self=this,o=this.options,colorsArray=BI.string2Array(BI.Cache.getItem("colors")||"");return BI.filter(colorsArray,function(idx,color){return!o.simple||self._isRGBColor(color)})},_isRGBColor:function(color){return BI.isNotEmptyString(color)&&"transparent"!==color},setStoreColors:function(colors){BI.isArray(colors)&&this.storeColors.populate([this._digestStoreColors(colors)])},setValue:function(color){this.colorEditor.setValue(color),this.colorPicker.setValue(color),this.storeColors.setValue(color)},getValue:function(){return this.colorEditor.getValue()}}),BI.ColorChooserPopup.EVENT_VALUE_CHANGE="EVENT_VALUE_CHANGE",BI.ColorChooserPopup.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.color_chooser_popup",BI.ColorChooserPopup),BI.SimpleColorChooserPopup=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.SimpleColorChooserPopup.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-color-chooser-popup"})},_init:function(){BI.SimpleColorChooserPopup.superclass._init.apply(this,arguments);var self=this,o=this.options;this.popup=BI.createWidget({type:"bi.color_chooser_popup",value:o.value,element:this,simple:!0}),this.popup.on(BI.ColorChooserPopup.EVENT_CHANGE,function(){self.fireEvent(BI.SimpleColorChooserPopup.EVENT_CHANGE,arguments)}),this.popup.on(BI.ColorChooserPopup.EVENT_VALUE_CHANGE,function(){self.fireEvent(BI.SimpleColorChooserPopup.EVENT_VALUE_CHANGE,arguments)})},setStoreColors:function(colors){this.popup.setStoreColors(colors)},setValue:function(color){this.popup.setValue(color)},getValue:function(){return this.popup.getValue()}}),BI.SimpleColorChooserPopup.EVENT_VALUE_CHANGE="EVENT_VALUE_CHANGE",BI.SimpleColorChooserPopup.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.simple_color_chooser_popup",BI.SimpleColorChooserPopup),BI.SimpleColorChooser=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.SimpleColorChooser.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-simple-color-chooser",value:"#ffffff"})},_init:function(){BI.SimpleColorChooser.superclass._init.apply(this,arguments);var self=this,o=this.options;this.combo=BI.createWidget({type:"bi.color_chooser",element:this,container:o.container,value:o.value,width:o.width,height:o.height,popup:{type:"bi.simple_color_chooser_popup"}}),this.combo.on(BI.ColorChooser.EVENT_CHANGE,function(){self.fireEvent(BI.SimpleColorChooser.EVENT_CHANGE,arguments)})},isViewVisible:function(){return this.combo.isViewVisible()},hideView:function(){this.combo.hideView()},showView:function(){this.combo.showView()},setValue:function(color){this.combo.setValue(color)},getValue:function(){return this.combo.getValue()}}),BI.SimpleColorChooser.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.simple_color_chooser",BI.SimpleColorChooser),BI.ColorChooserTrigger=BI.inherit(BI.Trigger,{_defaultConfig:function(){var conf=BI.ColorChooserTrigger.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{baseCls:(conf.baseCls||"")+" bi-color-chooser-trigger bi-border",height:22})},_init:function(){BI.ColorChooserTrigger.superclass._init.apply(this,arguments),this.colorContainer=BI.createWidget({type:"bi.layout",cls:"color-chooser-trigger-content"+(BI.isIE9Below&&BI.isIE9Below()?" hack":"")});var down=BI.createWidget({type:"bi.icon_button",disableSelected:!0,cls:"icon-combo-down-icon trigger-triangle-font icon-size-12",width:12,height:8});BI.createWidget({type:"bi.absolute",element:this,items:[{el:this.colorContainer,left:3,right:3,top:3,bottom:3},{el:down,right:-1,bottom:1}]}),BI.isNotNull(this.options.value)&&this.setValue(this.options.value)},setValue:function(color){BI.ColorChooserTrigger.superclass.setValue.apply(this,arguments),""===color?this.colorContainer.element.css("background-color","").removeClass("trans-color-background").addClass("auto-color-background"):"transparent"===color?this.colorContainer.element.css("background-color","").removeClass("auto-color-background").addClass("trans-color-background"):this.colorContainer.element.css({"background-color":color}).removeClass("auto-color-background").removeClass("trans-color-background")}}),BI.ColorChooserTrigger.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.color_chooser_trigger",BI.ColorChooserTrigger),BI.LongColorChooserTrigger=BI.inherit(BI.Trigger,{_defaultConfig:function(){var conf=BI.LongColorChooserTrigger.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{baseCls:(conf.baseCls||"")+" bi-color-chooser-trigger bi-border",height:22})},_init:function(){BI.LongColorChooserTrigger.superclass._init.apply(this,arguments);var self=this,o=this.options;this.colorContainer=BI.createWidget({type:"bi.htape",cls:"color-chooser-trigger-content",items:[{type:"bi.icon_change_button",ref:function(_ref){self.changeIcon=_ref},disableSelected:!0,iconCls:"auto-color-icon",width:24,iconWidth:16,iconHeight:16},{el:{type:"bi.label",ref:function(_ref){self.label=_ref},textAlign:"left",hgap:5,height:18,text:BI.i18nText("BI-Basic_Auto")}}]});var down=BI.createWidget({type:"bi.icon_button",disableSelected:!0,cls:"icon-combo-down-icon trigger-triangle-font icon-size-12",width:12,height:8});BI.createWidget({type:"bi.absolute",element:this,items:[{el:this.colorContainer,left:3,right:3,top:3,bottom:3},{el:down,right:3,bottom:3}]}),this.options.value&&this.setValue(this.options.value)},setValue:function(color){BI.LongColorChooserTrigger.superclass.setValue.apply(this,arguments),""===color?(this.colorContainer.element.css("background-color",""),this.changeIcon.setVisible(!0),this.label.setVisible(!0),this.changeIcon.setIcon("auto-color-icon"),this.label.setText(BI.i18nText("BI-Basic_Auto"))):"transparent"===color?(this.colorContainer.element.css("background-color",""),this.changeIcon.setVisible(!0),this.label.setVisible(!0),this.changeIcon.setIcon("trans-color-icon"),this.label.setText(BI.i18nText("BI-Transparent_Color"))):(this.colorContainer.element.css({"background-color":color}),this.changeIcon.setVisible(!1),this.label.setVisible(!1))}}),BI.LongColorChooserTrigger.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.long_color_chooser_trigger",BI.LongColorChooserTrigger),BI.ColorPickerButton=BI.inherit(BI.BasicButton,{_defaultConfig:function(){var conf=BI.ColorPickerButton.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{baseCls:(conf.baseCls||"")+" bi-color-picker-button bi-background bi-border-top bi-border-left"})},_init:function(){BI.ColorPickerButton.superclass._init.apply(this,arguments);var self=this,o=this.options;if(o.value){this.element.css("background-color",o.value);var name=this.getName();this.element.hover(function(){self._createMask(),self.isEnabled()&&BI.Maskers.show(name)},function(){self.isSelected()||BI.Maskers.hide(name)})}},_createMask:function(){var o=this.options,name=this.getName();if(this.isEnabled()&&!BI.Maskers.has(name)){var w=BI.Maskers.make(name,this,{offset:{left:-1,top:-1,right:-1,bottom:-1}});w.element.addClass("color-picker-button-mask").css("background-color",o.value)}},setSelected:function(b){BI.ColorPickerButton.superclass.setSelected.apply(this,arguments),b&&this._createMask(),BI.Maskers[b?"show":"hide"](this.getName())}}),BI.ColorPickerButton.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.color_picker_button",BI.ColorPickerButton),BI.ColorPicker=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.ColorPicker.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-color-picker",items:null})},_items:[[{value:"#ffffff"},{value:"#f2f2f2"},{value:"#e5e5e5"},{value:"#d9d9d9"},{value:"#cccccc"},{value:"#bfbfbf"},{value:"#b2b2b2"},{value:"#a6a6a6"},{value:"#999999"},{value:"#8c8c8c"},{value:"#808080"},{value:"#737373"},{value:"#666666"},{value:"#4d4d4d"},{value:"#333333"},{value:"#000000"}],[{value:"#d8b5a6"},{value:"#ff9e9a"},{value:"#ffc17d"},{value:"#f5e56b"},{value:"#d8e698"},{value:"#e0ebaf"},{value:"#c3d825"},{value:"#bce2e8"},{value:"#85d3cd"},{value:"#bce2e8"},{value:"#a0d8ef"},{value:"#89c3eb"},{value:"#bbc8e6"},{value:"#bbbcde"},{value:"#d6b4cc"},{value:"#fbc0d3"}],[{value:"#bb9581"},{value:"#f37d79"},{value:"#fba74f"},{value:"#ffdb4f"},{value:"#c7dc68"},{value:"#b0ca71"},{value:"#99ab4e"},{value:"#84b9cb"},{value:"#00a3af"},{value:"#2ca9e1"},{value:"#0095d9"},{value:"#4c6cb3"},{value:"#8491c3"},{value:"#a59aca"},{value:"#cc7eb1"},{value:"#e89bb4"}],[{value:"#9d775f"},{value:"#dd4b4b"},{value:"#ef8b07"},{value:"#fcc800"},{value:"#aacf53"},{value:"#82ae46"},{value:"#69821b"},{value:"#59b9c6"},{value:"#2a83a2"},{value:"#007bbb"},{value:"#19448e"},{value:"#274a78"},{value:"#4a488e"},{value:"#7058a3"},{value:"#884898"},{value:"#d47596"}]],_init:function(){BI.ColorPicker.superclass._init.apply(this,arguments);var self=this,o=this.options;this.colors=BI.createWidget({type:"bi.button_group",element:this,items:BI.createItems(o.items||this._items,{type:"bi.color_picker_button",once:!1}),layouts:[{type:"bi.grid"}],value:o.value}),this.colors.on(BI.ButtonGroup.EVENT_CHANGE,function(){self.fireEvent(BI.ColorPicker.EVENT_CHANGE,arguments)})},populate:function(items){var args=[].slice.call(arguments);args[0]=BI.createItems(items,{type:"bi.color_picker_button",once:!1}),this.colors.populate.apply(this.colors,args)},setValue:function(color){this.colors.setValue(color)},getValue:function(){return this.colors.getValue()}}),BI.ColorPicker.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.color_picker",BI.ColorPicker),BI.ColorPickerEditor=BI.inherit(BI.Widget,{constants:{REB_WIDTH:32},_defaultConfig:function(){return BI.extend(BI.ColorPickerEditor.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-color-picker-editor",height:30})},_init:function(){BI.ColorPickerEditor.superclass._init.apply(this,arguments);var self=this,o=this.options,c=this.constants;this.storeValue={},this.colorShow=BI.createWidget({type:"bi.layout",cls:"color-picker-editor-display bi-card bi-border",height:16,width:16});var RGB=BI.createWidgets(BI.createItems([{text:"R"},{text:"G"},{text:"B"}],{type:"bi.label",cls:"color-picker-editor-label",width:20,height:20})),checker=function(v){return BI.isNumeric(v)&&(0|v)>=0&&(0|v)<=255},Ws=BI.createWidgets([{},{},{}],{type:"bi.small_text_editor",cls:"color-picker-editor-input",validationChecker:checker,errorText:BI.i18nText("BI-Color_Picker_Error_Text"),allowBlank:!0,value:255,width:c.REB_WIDTH,height:20});BI.each(Ws,function(i,w){w.on(BI.TextEditor.EVENT_CHANGE,function(){self._checkEditors(),checker(self.storeValue.r)&&checker(self.storeValue.g)&&checker(self.storeValue.b)&&(self.colorShow.element.css("background-color",self.getValue()),self.fireEvent(BI.ColorPickerEditor.EVENT_CHANGE))})}),this.R=Ws[0],this.G=Ws[1],this.B=Ws[2],this.none=BI.createWidget({type:"bi.icon_button",cls:"auto-color-icon",width:16,height:16,iconWidth:16,iconHeight:16,title:BI.i18nText("BI-Basic_Auto")}),this.none.on(BI.IconButton.EVENT_CHANGE,function(){this.isSelected()?(self.lastColor=self.getValue(),self.setValue("")):self.setValue(self.lastColor||"#ffffff"),(self.R.isValid()&&self.G.isValid()&&self.B.isValid()||self._isEmptyRGB())&&(self.colorShow.element.css("background-color",self.getValue()),self.fireEvent(BI.ColorPickerEditor.EVENT_CHANGE))}),this.transparent=BI.createWidget({type:"bi.icon_button",cls:"trans-color-icon",width:16,height:16,iconWidth:16,iconHeight:16,title:BI.i18nText("BI-Transparent_Color")}),this.transparent.on(BI.IconButton.EVENT_CHANGE,function(){this.isSelected()?(self.lastColor=self.getValue(),self.setValue("transparent")):("transparent"===self.lastColor&&(self.lastColor=""),self.setValue(self.lastColor||"#ffffff")),(self.R.isValid()&&self.G.isValid()&&self.B.isValid()||self._isEmptyRGB())&&(self.colorShow.element.css("background-color",self.getValue()),self.fireEvent(BI.ColorPickerEditor.EVENT_CHANGE))}),BI.createWidget({type:"bi.absolute",element:this,items:[{el:{type:"bi.vertical_adapt",items:[{el:this.colorShow,width:16},{el:RGB[0],width:20},{el:this.R,width:c.REB_WIDTH},{el:RGB[1],width:20},{el:this.G,width:c.REB_WIDTH},{el:RGB[2],width:20},{el:this.B,width:c.REB_WIDTH},{el:this.transparent,width:16,lgap:5},{el:this.none,width:16,lgap:5}]},left:10,right:10,top:0,bottom:0}]})},_checkEditors:function(){BI.isEmptyString(this.R.getValue())&&this.R.setValue(0),BI.isEmptyString(this.G.getValue())&&this.G.setValue(0),BI.isEmptyString(this.B.getValue())&&this.B.setValue(0),this.storeValue={r:this.R.getValue()||0,g:this.G.getValue()||0,b:this.B.getValue()||0}},_isEmptyRGB:function(){return BI.isEmptyString(this.storeValue.r)&&BI.isEmptyString(this.storeValue.g)&&BI.isEmptyString(this.storeValue.b)},_showPreColor:function(color){""===color?this.colorShow.element.css("background-color","").removeClass("trans-color-background").addClass("auto-color-normal-background"):"transparent"===color?this.colorShow.element.css("background-color","").removeClass("auto-color-normal-background").addClass("trans-color-background"):this.colorShow.element.css({"background-color":color}).removeClass("auto-color-normal-background").removeClass("trans-color-background")},_setEnable:function(enable){BI.ColorPickerEditor.superclass._setEnable.apply(this,arguments),enable===!0?this.element.removeClass("base-disabled disabled"):enable===!1&&this.element.addClass("base-disabled disabled")},setValue:function(color){if("transparent"===color)return this.transparent.setSelected(!0),this.none.setSelected(!1),this._showPreColor("transparent"),this.R.setValue(""),this.G.setValue(""),this.B.setValue(""),void(this.storeValue={r:"",g:"",b:""});color?this.none.setSelected(!1):(color="",this.none.setSelected(!0)),this.transparent.setSelected(!1),this._showPreColor(color);var json=BI.DOM.rgb2json(BI.DOM.hex2rgb(color));this.storeValue={r:BI.isNull(json.r)?"":json.r,g:BI.isNull(json.r)?"":json.g,b:BI.isNull(json.r)?"":json.b},this.R.setValue(this.storeValue.r),this.G.setValue(this.storeValue.g),this.B.setValue(this.storeValue.b)},getValue:function(){return this._isEmptyRGB()&&this.transparent.isSelected()?"transparent":BI.DOM.rgb2hex(BI.DOM.json2rgb({r:this.storeValue.r,g:this.storeValue.g,b:this.storeValue.b}))}}),BI.ColorPickerEditor.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.color_picker_editor",BI.ColorPickerEditor),BI.SimpleColorPickerEditor=BI.inherit(BI.Widget,{constants:{REB_WIDTH:32},_defaultConfig:function(){return BI.extend(BI.SimpleColorPickerEditor.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-color-picker-editor",height:30})},_init:function(){BI.SimpleColorPickerEditor.superclass._init.apply(this,arguments);var self=this,o=this.options,c=this.constants;this.colorShow=BI.createWidget({type:"bi.layout",cls:"color-picker-editor-display bi-card bi-border",height:16,width:16});var RGB=BI.createWidgets(BI.createItems([{text:"R"},{text:"G"},{text:"B"}],{type:"bi.label",cls:"color-picker-editor-label",width:20,height:20})),checker=function(v){return BI.isNumeric(v)&&(0|v)>=0&&(0|v)<=255},Ws=BI.createWidgets([{},{},{}],{type:"bi.small_text_editor",cls:"color-picker-editor-input",validationChecker:checker,errorText:BI.i18nText("BI-Color_Picker_Error_Text"),allowBlank:!0,value:255,width:c.REB_WIDTH,height:20});BI.each(Ws,function(i,w){w.on(BI.TextEditor.EVENT_CHANGE,function(){self._checkEditors(),self.R.isValid()&&self.G.isValid()&&self.B.isValid()&&(self.colorShow.element.css("background-color",self.getValue()),self.fireEvent(BI.SimpleColorPickerEditor.EVENT_CHANGE))})}),this.R=Ws[0],this.G=Ws[1],this.B=Ws[2],BI.createWidget({type:"bi.vertical_adapt",element:this,items:[{el:this.colorShow,width:16,lgap:20,rgap:15},{el:RGB[0],width:20},{el:this.R,width:c.REB_WIDTH},{el:RGB[1],width:20},{el:this.G,width:c.REB_WIDTH},{el:RGB[2],width:20},{el:this.B,width:c.REB_WIDTH}]})},_checkEditors:function(){BI.isEmptyString(this.R.getValue())&&this.R.setValue(0),BI.isEmptyString(this.G.getValue())&&this.G.setValue(0),BI.isEmptyString(this.B.getValue())&&this.B.setValue(0)},setValue:function(color){this.colorShow.element.css({"background-color":color});var json=BI.DOM.rgb2json(BI.DOM.hex2rgb(color));this.R.setValue(BI.isNull(json.r)?"":json.r),this.G.setValue(BI.isNull(json.g)?"":json.g),this.B.setValue(BI.isNull(json.b)?"":json.b)},getValue:function(){return BI.DOM.rgb2hex(BI.DOM.json2rgb({r:this.R.getValue(),g:this.G.getValue(),b:this.B.getValue()}))}}),BI.SimpleColorPickerEditor.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.simple_color_picker_editor",BI.SimpleColorPickerEditor),BI.Farbtastic=BI.inherit(BI.BasicButton,{constants:{RADIUS:84,SQUARE:100,WIDTH:194},props:{baseCls:"bi-farbtastic",width:195,height:195,stopPropagation:!0,value:"#000000"},render:function(){var self=this;return{type:"bi.absolute",items:[{el:{type:"bi.layout",cls:"",ref:function(_ref){self.colorWrapper=_ref}},top:47,left:47,width:101,height:101},{el:{type:"bi.layout",cls:"wheel", +ref:function(_ref){self.wheel=_ref}},left:0,right:0,top:0,bottom:0},{el:{type:"bi.layout",cls:"overlay",ref:function(_ref){self.overlay=_ref}},top:47,left:47,width:101,height:101},{el:{type:"bi.layout",cls:"marker",ref:function(_ref){self.hMarker=_ref},scrollable:!1,width:17,height:17}},{el:{type:"bi.layout",cls:"marker",ref:function(_ref){self.slMarker=_ref},scrollable:!1,width:17,height:17}}]}},mounted:function(){var o=this.options;BI.isKey(o.value)&&this.setValue(o.value)},_unpack:function(color){return 7===color.length?[parseInt("0x"+color.substring(1,3))/255,parseInt("0x"+color.substring(3,5))/255,parseInt("0x"+color.substring(5,7))/255]:4===color.length?[parseInt("0x"+color.substring(1,2))/15,parseInt("0x"+color.substring(2,3))/15,parseInt("0x"+color.substring(3,4))/15]:void 0},_pack:function(rgb){var r=Math.round(255*rgb[0]),g=Math.round(255*rgb[1]),b=Math.round(255*rgb[2]);return"#"+(r<16?"0":"")+r.toString(16)+(g<16?"0":"")+g.toString(16)+(b<16?"0":"")+b.toString(16)},_setColor:function(color){var unpack=this._unpack(color);this.value!==color&&unpack&&(this.value=color,this.rgb=unpack,this.hsl=this._RGBToHSL(this.rgb),this._updateDisplay())},_setHSL:function(hsl){return this.hsl=hsl,this.rgb=this._HSLToRGB(hsl),this.value=this._pack(this.rgb),this._updateDisplay(),this},_HSLToRGB:function(hsl){var m1,m2,r,g,b,h=hsl[0],s=hsl[1],l=hsl[2];return m2=l<=.5?l*(s+1):l+s-l*s,m1=2*l-m2,[this._hueToRGB(m1,m2,h+.33333),this._hueToRGB(m1,m2,h),this._hueToRGB(m1,m2,h-.33333)]},_hueToRGB:function(m1,m2,h){return h=h<0?h+1:h>1?h-1:h,6*h<1?m1+(m2-m1)*h*6:2*h<1?m2:3*h<2?m1+(m2-m1)*(.66666-h)*6:m1},_RGBToHSL:function(rgb){var min,max,delta,h,s,l,r=rgb[0],g=rgb[1],b=rgb[2];return min=Math.min(r,Math.min(g,b)),max=Math.max(r,Math.max(g,b)),delta=max-min,l=(min+max)/2,s=0,l>0&&l<1&&(s=delta/(l<.5?2*l:2-2*l)),h=0,delta>0&&(max==r&&max!=g&&(h+=(g-b)/delta),max==g&&max!=b&&(h+=2+(b-r)/delta),max==b&&max!=r&&(h+=4+(r-g)/delta),h/=6),[h,s,l]},_updateDisplay:function(){var angle=6.28*this.hsl[0];this.hMarker.element.css({left:Math.round(Math.sin(angle)*this.constants.RADIUS+this.constants.WIDTH/2)+"px",top:Math.round(-Math.cos(angle)*this.constants.RADIUS+this.constants.WIDTH/2)+"px"}),this.slMarker.element.css({left:Math.round(this.constants.SQUARE*(.5-this.hsl[1])+this.constants.WIDTH/2)+"px",top:Math.round(this.constants.SQUARE*(.5-this.hsl[2])+this.constants.WIDTH/2)+"px"}),this.colorWrapper.element.css("backgroundColor",this._pack(this._HSLToRGB([this.hsl[0],1,.5]))),this.fireEvent(BI.Farbtastic.EVENT_CHANGE,this.getValue(),this)},_absolutePosition:function(el){var r={x:el.offsetLeft,y:el.offsetTop};if(el.offsetParent){var tmp=this._absolutePosition(el.offsetParent);r.x+=tmp.x,r.y+=tmp.y}return r},_widgetCoords:function(event){var x,y,el=event.target||event.srcElement,reference=this.wheel.element[0];if("undefined"!=typeof event.offsetX){for(var pos={x:event.offsetX,y:event.offsetY},e=el;e;)e.mouseX=pos.x,e.mouseY=pos.y,pos.x+=e.offsetLeft,pos.y+=e.offsetTop,e=e.offsetParent;for(var e=reference,offset={x:0,y:0};e;){if("undefined"!=typeof e.mouseX){x=e.mouseX-offset.x,y=e.mouseY-offset.y;break}offset.x+=e.offsetLeft,offset.y+=e.offsetTop,e=e.offsetParent}for(e=el;e;)e.mouseX=void 0,e.mouseY=void 0,e=e.offsetParent}else{var pos=this._absolutePosition(reference);x=(event.pageX||0)-pos.x,y=(event.pageY||0)-pos.y}return{x:x-this.constants.WIDTH/2,y:y-this.constants.WIDTH/2}},_doMouseMove:function(event){var pos=this._widgetCoords(event);if(this.circleDrag){var hue=Math.atan2(pos.x,-pos.y)/6.28;hue<0&&(hue+=1),this._setHSL([hue,this.hsl[1],this.hsl[2]])}else{var sat=Math.max(0,Math.min(1,-(pos.x/this.constants.SQUARE)+.5)),lum=Math.max(0,Math.min(1,-(pos.y/this.constants.SQUARE)+.5));this._setHSL([this.hsl[0],sat,lum])}},doClick:function(event){var pos=this._widgetCoords(event);return this.circleDrag=2*Math.max(Math.abs(pos.x),Math.abs(pos.y))>this.constants.SQUARE,this._doMouseMove(event),!1},setValue:function(color){this._setColor(color)},getValue:function(){return this.value}}),BI.Farbtastic.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.farbtastic",BI.Farbtastic),BI.BubbleCombo=BI.inherit(BI.Widget,{_const:{TRIANGLE_LENGTH:6},_defaultConfig:function(){return BI.extend(BI.BubbleCombo.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-bubble-combo",trigger:"click",toggle:!0,direction:"bottom,left",isDefaultInit:!1,destroyWhenHide:!1,isNeedAdjustHeight:!0,isNeedAdjustWidth:!0,stopPropagation:!1,adjustLength:0,hideChecker:BI.emptyFn,offsetStyle:"left",el:{},popup:{}})},_init:function(){BI.BubbleCombo.superclass._init.apply(this,arguments);var self=this,o=this.options;this.combo=BI.createWidget({type:"bi.combo",element:this,trigger:o.trigger,toggle:o.toggle,container:o.container,direction:o.direction,isDefaultInit:o.isDefaultInit,destroyWhenHide:o.destroyWhenHide,isNeedAdjustHeight:o.isNeedAdjustHeight,isNeedAdjustWidth:o.isNeedAdjustWidth,adjustLength:this._getAdjustLength(),stopPropagation:o.stopPropagation,adjustXOffset:0,adjustYOffset:0,hideChecker:o.hideChecker,offsetStyle:o.offsetStyle,el:o.el,popup:BI.extend({type:"bi.bubble_popup_view"},o.popup)}),this.combo.on(BI.Combo.EVENT_TRIGGER_CHANGE,function(){self.fireEvent(BI.BubbleCombo.EVENT_TRIGGER_CHANGE,arguments)}),this.combo.on(BI.Combo.EVENT_CHANGE,function(){self.fireEvent(BI.BubbleCombo.EVENT_CHANGE,arguments)}),this.combo.on(BI.Combo.EVENT_EXPAND,function(){self.fireEvent(BI.BubbleCombo.EVENT_EXPAND,arguments)}),this.combo.on(BI.Combo.EVENT_COLLAPSE,function(){self.fireEvent(BI.BubbleCombo.EVENT_COLLAPSE,arguments)}),this.combo.on(BI.Combo.EVENT_AFTER_INIT,function(){self.fireEvent(BI.BubbleCombo.EVENT_AFTER_INIT,arguments)}),this.combo.on(BI.Combo.EVENT_BEFORE_POPUPVIEW,function(){self.fireEvent(BI.BubbleCombo.EVENT_BEFORE_POPUPVIEW,arguments)}),this.combo.on(BI.Combo.EVENT_AFTER_POPUPVIEW,function(){self._showTriangle(),self.fireEvent(BI.BubbleCombo.EVENT_AFTER_POPUPVIEW,arguments)}),this.combo.on(BI.Combo.EVENT_BEFORE_HIDEVIEW,function(){self._hideTriangle(),self.fireEvent(BI.BubbleCombo.EVENT_BEFORE_HIDEVIEW,arguments)}),this.combo.on(BI.Combo.EVENT_AFTER_HIDEVIEW,function(){self.fireEvent(BI.BubbleCombo.EVENT_AFTER_HIDEVIEW,arguments)})},_getAdjustLength:function(){return this._const.TRIANGLE_LENGTH+this.options.adjustLength},_createTriangle:function(direction){var pos={},op={},adjustLength=this.options.adjustLength,offset=this.element.offset(),left=offset.left,right=offset.left+this.element.outerWidth(),top=offset.top,bottom=offset.top+this.element.outerHeight();switch(direction){case"left":pos={top:top,height:this.element.outerHeight(),left:left-adjustLength-this._const.TRIANGLE_LENGTH},op={width:this._const.TRIANGLE_LENGTH};break;case"right":pos={top:top,height:this.element.outerHeight(),left:right+adjustLength},op={width:this._const.TRIANGLE_LENGTH};break;case"top":pos={left:left,width:this.element.outerWidth(),top:top-adjustLength-this._const.TRIANGLE_LENGTH},op={height:this._const.TRIANGLE_LENGTH};break;case"bottom":pos={left:left,width:this.element.outerWidth(),top:bottom+adjustLength},op={height:this._const.TRIANGLE_LENGTH}}this.triangle&&this.triangle.destroy(),this.triangle=BI.createWidget(op,{type:"bi.center_adapt",cls:"button-combo-triangle-wrapper",items:[{type:"bi.layout",cls:"bubble-combo-triangle-"+direction}]}),pos.el=this.triangle,BI.createWidget({type:"bi.absolute",element:this,items:[pos]})},_createLeftTriangle:function(){this._createTriangle("left")},_createRightTriangle:function(){this._createTriangle("right")},_createTopTriangle:function(){this._createTriangle("top")},_createBottomTriangle:function(){this._createTriangle("bottom")},_showTriangle:function(){var pos=this.combo.getPopupPosition();switch(pos.dir){case"left,top":case"left,bottom":this._createLeftTriangle();break;case"right,top":case"right,bottom":this._createRightTriangle();break;case"top,left":case"top,right":this._createTopTriangle();break;case"bottom,left":case"bottom,right":this._createBottomTriangle()}},_hideTriangle:function(){this.triangle&&this.triangle.destroy(),this.triangle=null},hideView:function(){this._hideTriangle(),this.combo&&this.combo.hideView()},showView:function(){this.combo&&this.combo.showView()},isViewVisible:function(){return this.combo.isViewVisible()}}),BI.BubbleCombo.EVENT_TRIGGER_CHANGE="EVENT_TRIGGER_CHANGE",BI.BubbleCombo.EVENT_CHANGE="EVENT_CHANGE",BI.BubbleCombo.EVENT_EXPAND="EVENT_EXPAND",BI.BubbleCombo.EVENT_COLLAPSE="EVENT_COLLAPSE",BI.BubbleCombo.EVENT_AFTER_INIT="EVENT_AFTER_INIT",BI.BubbleCombo.EVENT_BEFORE_POPUPVIEW="EVENT_BEFORE_POPUPVIEW",BI.BubbleCombo.EVENT_AFTER_POPUPVIEW="EVENT_AFTER_POPUPVIEW",BI.BubbleCombo.EVENT_BEFORE_HIDEVIEW="EVENT_BEFORE_HIDEVIEW",BI.BubbleCombo.EVENT_AFTER_HIDEVIEW="EVENT_AFTER_HIDEVIEW",BI.shortcut("bi.bubble_combo",BI.BubbleCombo),BI.BubblePopupView=BI.inherit(BI.PopupView,{_defaultConfig:function(){var config=BI.BubblePopupView.superclass._defaultConfig.apply(this,arguments);return BI.extend(config,{baseCls:config.baseCls+" bi-bubble-popup-view",minWidth:220,maxWidth:300,minHeight:90})},_init:function(){BI.BubblePopupView.superclass._init.apply(this,arguments)}}),BI.shortcut("bi.bubble_popup_view",BI.BubblePopupView),BI.BubblePopupBarView=BI.inherit(BI.BubblePopupView,{_defaultConfig:function(){return BI.extend(BI.BubblePopupBarView.superclass._defaultConfig.apply(this,arguments),{extraCls:"bi-bubble-bar-popup-view",buttons:[{value:!1,text:BI.i18nText("BI-Basic_Cancel"),ghost:!0},{text:BI.i18nText(BI.i18nText("BI-Basic_Sure")),value:!0}]})},_init:function(){BI.BubblePopupBarView.superclass._init.apply(this,arguments)},_createToolBar:function(){var o=this.options,self=this,items=[];return BI.each(o.buttons,function(i,buttonOpt){BI.isWidget(buttonOpt)?items.push(buttonOpt):items.push(BI.extend({type:"bi.button",height:24,handler:function(v){self.fireEvent(BI.BubblePopupBarView.EVENT_CLICK_TOOLBAR_BUTTON,v)}},buttonOpt))}),BI.createWidget({type:"bi.center",height:44,rgap:15,items:[{type:"bi.right_vertical_adapt",lgap:10,items:items}]})},_createView:function(){var o=this.options,button=BI.createWidget({type:"bi.button_group",items:[o.el],layouts:[{type:"bi.vertical",cls:"bar-popup-container",hgap:15,tgap:10}]});return button.element.css("min-height",o.minHeight-44),button}}),BI.BubblePopupBarView.EVENT_CLICK_TOOLBAR_BUTTON="EVENT_CLICK_TOOLBAR_BUTTON",BI.shortcut("bi.bubble_bar_popup_view",BI.BubblePopupBarView),BI.TextBubblePopupBarView=BI.inherit(BI.Widget,{props:function(){return{baseCls:"bi-text-bubble-bar-popup-view",text:"",buttons:[{level:"ignore",value:!1,stopPropagation:!0,text:BI.i18nText("BI-Basic_Cancel")},{value:!0,stopPropagation:!0,text:BI.i18nText("BI-Basic_Sure")}]}},render:function(){var self=this,o=this.options,buttons=BI.map(o.buttons,function(index,buttonOpt){return BI.isWidget(buttonOpt)?buttonOpt:BI.extend({type:"bi.button",height:24,handler:function(v){self.fireEvent(BI.TextBubblePopupBarView.EVENT_CHANGE,v)}},buttonOpt)});return{type:"bi.bubble_bar_popup_view",minWidth:o.minWidth,maxWidth:o.maxWidth,minHeight:o.minHeight,ref:function(){self.popup=this},el:{type:"bi.label",text:o.text,whiteSpace:"normal",textAlign:"left",ref:function(){self.text=this}},buttons:buttons}},populate:function(v){this.text.setText(v||this.options.text)}}),BI.TextBubblePopupBarView.EVENT_CHANGE="EVENT_CLICK_TOOLBAR_BUTTON",BI.shortcut("bi.text_bubble_bar_popup_view",BI.TextBubblePopupBarView),BI.EditorIconCheckCombo=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.EditorIconCheckCombo.superclass._defaultConfig.apply(this,arguments),{baseClass:"bi-check-editor-combo",width:100,height:24,chooseType:BI.ButtonGroup.CHOOSE_TYPE_SINGLE,validationChecker:BI.emptyFn,quitChecker:BI.emptyFn,allowBlank:!0,watermark:"",errorText:""})},_init:function(){BI.EditorIconCheckCombo.superclass._init.apply(this,arguments);var self=this,o=this.options;this.trigger=BI.createWidget({type:"bi.editor_trigger",items:o.items,height:o.height,validationChecker:o.validationChecker,quitChecker:o.quitChecker,allowBlank:o.allowBlank,watermark:o.watermark,errorText:o.errorText,value:o.value}),this.trigger.on(BI.EditorTrigger.EVENT_CHANGE,function(){self.popup.setValue(this.getValue()),self.fireEvent(BI.EditorIconCheckCombo.EVENT_CHANGE)}),this.popup=BI.createWidget({type:"bi.text_value_check_combo_popup",chooseType:o.chooseType,items:o.items,value:o.value}),this.popup.on(BI.TextValueCheckComboPopup.EVENT_CHANGE,function(){self.setValue(self.popup.getValue()),self.editorIconCheckCombo.hideView(),self.fireEvent(BI.EditorIconCheckCombo.EVENT_CHANGE)}),this.popup.on(BI.Controller.EVENT_CHANGE,function(){self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.editorIconCheckCombo=BI.createWidget({type:"bi.combo",container:o.container,element:this,adjustLength:2,el:this.trigger,popup:{el:this.popup,maxHeight:300}})},setValue:function(v){this.editorIconCheckCombo.setValue(v)},getValue:function(){return this.trigger.getValue()},populate:function(items){this.options.items=items,this.editorIconCheckCombo.populate(items)}}),BI.EditorIconCheckCombo.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.editor_icon_check_combo",BI.EditorIconCheckCombo),BI.IconCombo=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.IconCombo.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-icon-combo",width:24,height:24,el:{},popup:{},minWidth:100,maxWidth:"auto",maxHeight:300,direction:"bottom",adjustLength:3,adjustXOffset:0,adjustYOffset:0,offsetStyle:"left",chooseType:BI.ButtonGroup.CHOOSE_TYPE_SINGLE})},_init:function(){BI.IconCombo.superclass._init.apply(this,arguments);var self=this,o=this.options;this.trigger=BI.createWidget(o.el,{type:"bi.icon_combo_trigger",iconCls:o.iconCls,title:o.title,items:o.items,width:o.width,height:o.height,iconWidth:o.iconWidth,iconHeight:o.iconHeight,value:o.value}),this.popup=BI.createWidget(o.popup,{type:"bi.icon_combo_popup",chooseType:o.chooseType,items:o.items,value:o.value}),this.popup.on(BI.IconComboPopup.EVENT_CHANGE,function(){self.setValue(self.popup.getValue()),self.iconCombo.hideView(),self.fireEvent(BI.IconCombo.EVENT_CHANGE)}),this.popup.on(BI.Controller.EVENT_CHANGE,function(){self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.iconCombo=BI.createWidget({type:"bi.combo",element:this,direction:o.direction,trigger:o.trigger,container:o.container,adjustLength:o.adjustLength,adjustXOffset:o.adjustXOffset,adjustYOffset:o.adjustYOffset,offsetStyle:o.offsetStyle,el:this.trigger,popup:{el:this.popup,maxWidth:o.maxWidth,maxHeight:o.maxHeight,minWidth:o.minWidth}})},showView:function(){this.iconCombo.showView()},hideView:function(){this.iconCombo.hideView()},setValue:function(v){this.trigger.setValue(v),this.popup.setValue(v)},getValue:function(){var value=this.popup.getValue();return BI.isNull(value)?[]:BI.isArray(value)?value:[value]},populate:function(items){this.options.items=items,this.iconCombo.populate(items)}}),BI.IconCombo.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.icon_combo",BI.IconCombo),BI.IconComboPopup=BI.inherit(BI.Pane,{_defaultConfig:function(){return BI.extend(BI.IconComboPopup.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi.icon-combo-popup",chooseType:BI.ButtonGroup.CHOOSE_TYPE_SINGLE})},_init:function(){BI.IconComboPopup.superclass._init.apply(this,arguments);var o=this.options,self=this;this.popup=BI.createWidget({type:"bi.button_group",items:BI.createItems(o.items,{type:"bi.single_select_icon_text_item",height:24}),chooseType:o.chooseType,layouts:[{type:"bi.vertical"}],value:o.value}),this.popup.on(BI.Controller.EVENT_CHANGE,function(type,val,obj){self.fireEvent(BI.Controller.EVENT_CHANGE,arguments),type===BI.Events.CLICK&&self.fireEvent(BI.IconComboPopup.EVENT_CHANGE,val,obj)}),BI.createWidget({type:"bi.vertical",element:this,vgap:5,items:[this.popup]})},populate:function(items){BI.IconComboPopup.superclass.populate.apply(this,arguments),items=BI.createItems(items,{type:"bi.single_select_icon_text_item",height:24}),this.popup.populate(items)},getValue:function(){return this.popup.getValue()},setValue:function(v){this.popup.setValue(v)}}),BI.IconComboPopup.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.icon_combo_popup",BI.IconComboPopup),BI.IconComboTrigger=BI.inherit(BI.Trigger,{_defaultConfig:function(){return BI.extend(BI.IconComboTrigger.superclass._defaultConfig.apply(this,arguments),{extraCls:"bi-icon-combo-trigger",el:{},items:[],iconCls:"",width:24,height:24,isShowDown:!0,value:""})},_init:function(){BI.IconComboTrigger.superclass._init.apply(this,arguments);var o=this.options,self=this,iconCls="";BI.isKey(o.value)&&(iconCls=this._digest(o.value,o.items)),this.button=BI.createWidget(o.el,{type:"bi.icon_change_button",cls:"icon-combo-trigger-icon",iconCls:iconCls,disableSelected:!0,width:o.isShowDown?o.width-12:o.width,height:o.height,iconWidth:o.iconWidth,iconHeight:o.iconHeight,selected:BI.isNotEmptyString(iconCls)}),this.down=BI.createWidget({type:"bi.icon_button",disableSelected:!0,cls:"icon-combo-down-icon trigger-triangle-font font-size-12",width:12,height:8,selected:BI.isNotEmptyString(iconCls)}),this.down.setVisible(o.isShowDown),BI.createWidget({type:"bi.absolute",element:this,items:[{el:this.button,left:0,right:0,top:0,bottom:0},{el:this.down,right:3,bottom:0}]})},_digest:function(v,items){var iconCls="";return v=BI.isArray(v)?v[0]:v,BI.any(items,function(i,item){if(v===item.value)return iconCls=item.iconCls,!0}),iconCls},populate:function(items){var o=this.options;this.options.items=items||[],this.button.setIcon(o.iconCls),this.button.setSelected(!1),this.down.setSelected(!1)},setValue:function(v){BI.IconComboTrigger.superclass.setValue.apply(this,arguments);var o=this.options,iconCls=this._digest(v,this.options.items);v=BI.isArray(v)?v[0]:v,BI.isNotEmptyString(iconCls)?(this.button.setIcon(iconCls),this.button.setSelected(!0),this.down.setSelected(!0)):(this.button.setIcon(o.iconCls),this.button.setSelected(!1),this.down.setSelected(!1))}}),BI.IconComboTrigger.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.icon_combo_trigger",BI.IconComboTrigger),BI.IconTextValueCombo=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.IconTextValueCombo.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-icon-text-value-combo",height:24,iconHeight:null,iconWidth:null,value:"",attributes:{tabIndex:0}})},_init:function(){BI.IconTextValueCombo.superclass._init.apply(this,arguments);var self=this,o=this.options;this.trigger=BI.createWidget({type:"bi.select_icon_text_trigger",cls:"icon-text-value-trigger",items:o.items,height:o.height,text:o.text,iconCls:o.iconCls,value:o.value,iconHeight:o.iconHeight,iconWidth:o.iconWidth,iconWrapperWidth:o.iconWrapperWidth,title:o.title,warningTitle:o.warningTitle}),this.popup=BI.createWidget({type:"bi.icon_text_value_combo_popup",items:o.items,value:o.value,iconHeight:o.iconHeight,iconWidth:o.iconWidth,iconWrapperWidth:o.iconWrapperWidth}),this.popup.on(BI.IconTextValueComboPopup.EVENT_CHANGE,function(){self.setValue(self.popup.getValue()),self.textIconCombo.hideView(),self.fireEvent(BI.IconTextValueCombo.EVENT_CHANGE,arguments)}),this.popup.on(BI.Controller.EVENT_CHANGE,function(){self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.textIconCombo=BI.createWidget({type:"bi.combo",element:this,container:o.container,adjustLength:2,el:this.trigger,popup:{el:this.popup,maxHeight:240,minHeight:25}}),BI.isKey(o.value)&&this.setValue(o.value)},_checkError:function(v){if(BI.isNotNull(v)){v=BI.isArray(v)?v:[v];var result=BI.find(this.options.items,function(idx,item){return BI.contains(v,item.value)});BI.isNull(result)?(this.trigger.options.tipType="warning",this.element.removeClass("combo-error").addClass("combo-error")):(this.trigger.options.tipType="success",this.element.removeClass("combo-error"))}},setValue:function(v){this.trigger.setValue(v),this.popup.setValue(v),this._checkError(v)},getValue:function(){var value=this.popup.getValue();return BI.isNull(value)?[]:BI.isArray(value)?value:[value]},populate:function(items){this.options.items=items,this.textIconCombo.populate(items)}}),BI.IconTextValueCombo.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.icon_text_value_combo",BI.IconTextValueCombo),BI.IconTextValueComboPopup=BI.inherit(BI.Pane,{_defaultConfig:function(){return BI.extend(BI.IconTextValueComboPopup.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-icon-text-icon-popup",behaviors:{redmark:function(){return!0}}})},_init:function(){BI.IconTextValueComboPopup.superclass._init.apply(this,arguments);var o=this.options,self=this;this.popup=BI.createWidget({type:"bi.button_group",items:BI.createItems(o.items,{type:"bi.single_select_icon_text_item",height:24,iconHeight:o.iconHeight,iconWidth:o.iconWidth,iconWrapperWidth:o.iconWrapperWidth}),chooseType:BI.ButtonGroup.CHOOSE_TYPE_SINGLE,layouts:[{type:"bi.vertical"}],behaviors:o.behaviors,value:o.value}),this.popup.on(BI.Controller.EVENT_CHANGE,function(type,val,obj){self.fireEvent(BI.Controller.EVENT_CHANGE,arguments),type===BI.Events.CLICK&&self.fireEvent(BI.IconTextValueComboPopup.EVENT_CHANGE,val,obj)}),this.check(),BI.createWidget({type:"bi.vertical",element:this,vgap:5,items:[this.popup]})},populate:function(items,keyword){BI.IconTextValueComboPopup.superclass.populate.apply(this,arguments);var o=this.options;items=BI.createItems(items,{type:"bi.single_select_icon_text_item",height:24,iconWrapperWidth:o.iconWrapperWidth,iconHeight:o.iconHeight,iconWidth:o.iconWidth}),this.popup.populate(items,keyword)},getValue:function(){return this.popup.getValue()},setValue:function(v){this.popup.setValue(v)}}),BI.IconTextValueComboPopup.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.icon_text_value_combo_popup",BI.IconTextValueComboPopup),BI.SearchTextValueCombo=BI.inherit(BI.Widget,{props:{baseCls:"bi-search-text-value-combo",height:24,text:"",items:[],tipType:"",warningTitle:"",attributes:{tabIndex:0}},render:function(){var self=this,o=this.options;return{type:"bi.absolute",items:[{el:{type:"bi.combo",container:o.container,adjustLength:2,toggle:!1,ref:function(){self.combo=this},el:{type:"bi.search_text_value_trigger",cls:"search-text-value-trigger",ref:function(){self.trigger=this},items:o.items,height:o.height-2,text:o.text,value:o.value,tipType:o.tipType,warningTitle:o.warningTitle,title:o.title,listeners:[{eventName:BI.SearchTextValueTrigger.EVENT_CHANGE,action:function(){self.setValue(this.getValue()),self.combo.hideView(),self.fireEvent(BI.SearchTextValueCombo.EVENT_CHANGE)}}]},popup:{el:{type:"bi.text_value_combo_popup",chooseType:BI.ButtonGroup.CHOOSE_TYPE_SINGLE,value:o.value,items:o.items,ref:function(){self.popup=this,self.trigger.getSearcher().setAdapter(self.popup)},listeners:[{eventName:BI.TextValueComboPopup.EVENT_CHANGE,action:function(){self.setValue(this.getValue()),self.combo.hideView(),self.fireEvent(BI.SearchTextValueCombo.EVENT_CHANGE)}}]},value:o.value,maxHeight:252,minHeight:25},listeners:[{eventName:BI.Combo.EVENT_AFTER_HIDEVIEW,action:function(){self.trigger.stopEditing()}},{eventName:BI.Combo.EVENT_BEFORE_POPUPVIEW,action:function(){self.fireEvent(BI.SearchTextValueCombo.EVENT_BEFORE_POPUPVIEW)}}],hideChecker:function(e){return 0===self.triggerBtn.element.find(e.target).length}},left:0,right:0,bottom:0,top:0},{el:{type:"bi.trigger_icon_button",cls:"trigger-icon-button",ref:function(){self.triggerBtn=this},width:o.height,height:o.height,handler:function(){self.combo.isViewVisible()?self.combo.hideView():self.combo.showView()}},right:0,bottom:0,top:0}]}},mounted:function(){var o=this.options;BI.isKey(o.value)&&this._checkError(o.value)},_checkError:function(v){if(BI.isNotNull(v)){v=BI.isArray(v)?v:[v];var result=BI.find(this.options.items,function(idx,item){return BI.contains(v,item.value)});BI.isNull(result)?(this.element.removeClass("combo-error").addClass("combo-error"),this.trigger.attr("tipType","warning")):(this.element.removeClass("combo-error"),this.trigger.attr("tipType","success"))}},populate:function(items){this.options.items=items,this.combo.populate(items)},setValue:function(v){this.combo.setValue(v),this._checkError(v)},getValue:function(){var value=this.combo.getValue();return BI.isNull(value)?[]:BI.isArray(value)?value:[value]}}),BI.SearchTextValueCombo.EVENT_CHANGE="EVENT_CHANGE",BI.SearchTextValueCombo.EVENT_BEFORE_POPUPVIEW="EVENT_BEFORE_POPUPVIEW",BI.shortcut("bi.search_text_value_combo",BI.SearchTextValueCombo),BI.SearchTextValueComboPopup=BI.inherit(BI.Pane,{props:{baseCls:"bi-search-text-value-popup"},render:function(){var self=this,o=this.options;return{type:"bi.vertical",vgap:5,items:[{type:"bi.button_group",ref:function(){self.popup=this},items:BI.createItems(o.items,{type:"bi.single_select_item",textAlign:o.textAlign,height:24}),chooseType:BI.ButtonGroup.CHOOSE_TYPE_SINGLE,layouts:[{type:"bi.vertical"}],behaviors:{redmark:function(){return!0}},value:o.value,listeners:[{eventName:BI.Controller.EVENT_CHANGE,action:function(type,val,obj){self.fireEvent(BI.Controller.EVENT_CHANGE,arguments),type===BI.Events.CLICK&&self.fireEvent(BI.SearchTextValueComboPopup.EVENT_CHANGE,val,obj)}}]}]}},mounted:function(){this.check()},populate:function(find,match,keyword){var items=BI.concat(find,match);BI.SearchTextValueComboPopup.superclass.populate.apply(this,items),items=BI.createItems(items,{type:"bi.single_select_item",height:24}),this.popup.populate(items,keyword)},getValue:function(){return this.popup.getValue()},setValue:function(v){this.popup.setValue(v)}}),BI.SearchTextValueComboPopup.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.search_text_value_combo_popup",BI.SearchTextValueComboPopup),BI.SearchTextValueTrigger=BI.inherit(BI.Trigger,{props:{extraCls:"bi-search-text-value-trigger bi-border",height:24},render:function(){var self=this,o=this.options;return{type:"bi.htape",items:[{el:{type:"bi.searcher",ref:function(){self.searcher=this},isAutoSearch:!1,el:{type:"bi.state_editor",ref:function(){self.editor=this},defaultText:o.text,text:this._digest(o.value,o.items),value:o.value,height:o.height,tipText:""},popup:{type:"bi.search_text_value_combo_popup",cls:"bi-card",chooseType:BI.ButtonGroup.CHOOSE_TYPE_SINGLE},onSearch:function(obj,callback){var keyword=obj.keyword,finding=BI.Func.getSearchResult(o.items,keyword),matched=finding.match,find=finding.find;callback(find,matched)},listeners:[{eventName:BI.Searcher.EVENT_CHANGE,action:function(){self.fireEvent(BI.SearchTextValueTrigger.EVENT_CHANGE)}}]}},{el:{type:"bi.layout",width:24},width:24}]}},_setState:function(v){this.editor.setState(v)},_digest:function(vals,items){var o=this.options;vals=BI.isArray(vals)?vals:[vals];var result=[],formatItems=BI.Tree.transformToArrayFormat(items);return BI.each(formatItems,function(i,item){BI.deepContains(vals,item.value)&&!BI.contains(result,item.text||item.value)&&result.push(item.text||item.value)}),result.length>0?result.join(","):BI.isFunction(o.text)?o.text():o.text},stopEditing:function(){this.searcher.stopSearch()},getSearcher:function(){return this.searcher},populate:function(items){this.options.items=items},setValue:function(vals){this._setState(this._digest(vals,this.options.items))},getValue:function(){return this.searcher.getValue()}}),BI.SearchTextValueTrigger.EVENT_SEARCHING="EVENT_SEARCHING",BI.SearchTextValueTrigger.EVENT_STOP="EVENT_STOP",BI.SearchTextValueTrigger.EVENT_START="EVENT_START",BI.SearchTextValueTrigger.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.search_text_value_trigger",BI.SearchTextValueTrigger),BI.TextValueCheckCombo=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.TextValueCheckCombo.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-text-value-check-combo",width:100,height:24,chooseType:BI.ButtonGroup.CHOOSE_TYPE_SINGLE,value:"",attributes:{tabIndex:0}})},_init:function(){BI.TextValueCheckCombo.superclass._init.apply(this,arguments);var self=this,o=this.options;this.trigger=BI.createWidget({type:"bi.select_text_trigger",cls:"text-value-trigger",items:o.items,height:o.height,text:o.text,value:o.value}),this.popup=BI.createWidget({type:"bi.text_value_check_combo_popup",chooseType:o.chooseType,items:o.items,value:o.value}),this.popup.on(BI.TextValueCheckComboPopup.EVENT_CHANGE,function(){self.setValue(self.popup.getValue()),self.textIconCheckCombo.hideView(),self.fireEvent(BI.TextValueCheckCombo.EVENT_CHANGE)}),this.popup.on(BI.Controller.EVENT_CHANGE,function(){self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.textIconCheckCombo=BI.createWidget({type:"bi.combo",container:o.container,element:this,adjustLength:2,el:this.trigger,popup:{el:this.popup,maxHeight:300}}),BI.isKey(o.value)&&this.setValue(o.value)},setTitle:function(title){this.trigger.setTitle(title)},setValue:function(v){this.trigger.setValue(v),this.popup.setValue(v)},setWarningTitle:function(title){this.trigger.setWarningTitle(title)},getValue:function(){var value=this.popup.getValue();return BI.isNull(value)?[]:BI.isArray(value)?value:[value]},populate:function(items){this.options.items=items,this.textIconCheckCombo.populate(items)}}),BI.TextValueCheckCombo.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.text_value_check_combo",BI.TextValueCheckCombo),BI.TextValueCheckComboPopup=BI.inherit(BI.Pane,{_defaultConfig:function(){return BI.extend(BI.TextValueCheckComboPopup.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-text-icon-popup",chooseType:BI.ButtonGroup.CHOOSE_TYPE_SINGLE})},_init:function(){BI.TextValueCheckComboPopup.superclass._init.apply(this,arguments);var o=this.options,self=this;this.popup=BI.createWidget({type:"bi.button_group",items:this._formatItems(o.items),chooseType:o.chooseType,layouts:[{type:"bi.vertical"}],value:o.value}),this.popup.on(BI.Controller.EVENT_CHANGE,function(type,val,obj){self.fireEvent(BI.Controller.EVENT_CHANGE,arguments),type===BI.Events.CLICK&&self.fireEvent(BI.TextValueCheckComboPopup.EVENT_CHANGE,val,obj)}),BI.createWidget({type:"bi.vertical",element:this,vgap:5,items:[this.popup]})},_formatItems:function(items){return BI.map(items,function(i,item){return BI.extend({type:"bi.single_select_item",cls:"bi-list-item",height:24},item)})},populate:function(items){BI.TextValueCheckComboPopup.superclass.populate.apply(this,arguments),this.popup.populate(this._formatItems(items))},getValue:function(){return this.popup.getValue()},setValue:function(v){this.popup.setValue(v)}}),BI.TextValueCheckComboPopup.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.text_value_check_combo_popup",BI.TextValueCheckComboPopup),BI.TextValueCombo=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.TextValueCombo.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-text-value-combo",height:24,chooseType:BI.ButtonGroup.CHOOSE_TYPE_SINGLE,text:"",value:"",attributes:{tabIndex:0}})},_init:function(){BI.TextValueCombo.superclass._init.apply(this,arguments);var self=this,o=this.options;this.trigger=BI.createWidget({type:"bi.select_text_trigger",cls:"text-value-trigger",items:o.items,height:o.height,text:o.text,value:o.value,warningTitle:o.warningTitle}),this.popup=BI.createWidget({type:"bi.text_value_combo_popup",chooseType:o.chooseType,value:o.value,items:o.items}),this.popup.on(BI.TextValueComboPopup.EVENT_CHANGE,function(){self.setValue(self.popup.getValue()),self.textIconCombo.hideView(),self.fireEvent(BI.TextValueCombo.EVENT_CHANGE,arguments)}),this.popup.on(BI.Controller.EVENT_CHANGE,function(){self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.textIconCombo=BI.createWidget({type:"bi.combo",container:o.container,element:this,adjustLength:2,el:this.trigger,popup:{el:this.popup,maxHeight:240,minHeight:25}}),BI.isKey(o.value)&&this._checkError(o.value)},_checkError:function(v){if(BI.isNotNull(v)){v=BI.isArray(v)?v:[v];var result=BI.find(this.options.items,function(idx,item){return BI.contains(v,item.value)});BI.isNull(result)?(this.trigger.setTipType("warning"),this.element.removeClass("combo-error").addClass("combo-error")):(this.trigger.setTipType("success"),this.element.removeClass("combo-error"))} +},setValue:function(v){this.trigger.setValue(v),this.popup.setValue(v),this._checkError(v)},getValue:function(){var value=this.popup.getValue();return BI.isNull(value)?[]:BI.isArray(value)?value:[value]},populate:function(items){this.options.items=items,this.textIconCombo.populate(items)}}),BI.TextValueCombo.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.text_value_combo",BI.TextValueCombo),BI.SmallTextValueCombo=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.SmallTextValueCombo.superclass._defaultConfig.apply(this,arguments),{width:100,height:20,chooseType:BI.ButtonGroup.CHOOSE_TYPE_SINGLE,el:{},text:""})},_init:function(){BI.SmallTextValueCombo.superclass._init.apply(this,arguments);var self=this,o=this.options;this.trigger=BI.createWidget(o.el,{type:"bi.small_select_text_trigger",items:o.items,height:o.height,text:o.text}),this.popup=BI.createWidget({type:"bi.text_value_combo_popup",chooseType:o.chooseType,items:o.items}),this.popup.on(BI.TextValueComboPopup.EVENT_CHANGE,function(){self.setValue(self.popup.getValue()),self.SmallTextValueCombo.hideView(),self.fireEvent(BI.SmallTextValueCombo.EVENT_CHANGE)}),this.popup.on(BI.Controller.EVENT_CHANGE,function(){self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.SmallTextValueCombo=BI.createWidget({type:"bi.combo",element:this,container:o.container,adjustLength:2,el:this.trigger,popup:{el:this.popup,maxHeight:240,minHeight:25}})},setValue:function(v){this.trigger.setValue(v),this.popup.setValue(v)},getValue:function(){return this.popup.getValue()},populate:function(items){this.options.items=items,this.SmallTextValueCombo.populate(items)}}),BI.SmallTextValueCombo.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.small_text_value_combo",BI.SmallTextValueCombo),BI.TextValueComboPopup=BI.inherit(BI.Pane,{_defaultConfig:function(){return BI.extend(BI.TextValueComboPopup.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-text-icon-popup",chooseType:BI.ButtonGroup.CHOOSE_TYPE_SINGLE})},_init:function(){BI.TextValueComboPopup.superclass._init.apply(this,arguments);var o=this.options,self=this;this.popup=BI.createWidget({type:"bi.button_group",items:BI.createItems(o.items,{type:"bi.single_select_item",textAlign:o.textAlign,height:24}),chooseType:o.chooseType,layouts:[{type:"bi.vertical"}],value:o.value}),this.popup.on(BI.Controller.EVENT_CHANGE,function(type,val,obj){self.fireEvent(BI.Controller.EVENT_CHANGE,arguments),type===BI.Events.CLICK&&self.fireEvent(BI.TextValueComboPopup.EVENT_CHANGE,val,obj)}),this.check(),BI.createWidget({type:"bi.vertical",element:this,vgap:5,items:[this.popup]})},populate:function(items){BI.TextValueComboPopup.superclass.populate.apply(this,arguments),items=BI.createItems(items,{type:"bi.single_select_item",height:24}),this.popup.populate(items)},getValue:function(){return this.popup.getValue()},setValue:function(v){this.popup.setValue(v)}}),BI.TextValueComboPopup.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.text_value_combo_popup",BI.TextValueComboPopup),BI.ClearEditor=BI.inherit(BI.Widget,{_defaultConfig:function(){var conf=BI.ClearEditor.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{baseCls:"bi-clear-editor",height:24,errorText:"",watermark:"",validationChecker:BI.emptyFn,quitChecker:BI.emptyFn})},_init:function(){BI.ClearEditor.superclass._init.apply(this,arguments);var self=this,o=this.options;this.editor=BI.createWidget({type:"bi.editor",height:o.height,watermark:o.watermark,allowBlank:!0,errorText:o.errorText,validationChecker:o.validationChecker,quitChecker:o.quitChecker,value:o.value}),this.clear=BI.createWidget({type:"bi.icon_button",stopEvent:!0,cls:"search-close-h-font"}),this.clear.on(BI.IconButton.EVENT_CHANGE,function(){self.setValue(""),self.fireEvent(BI.Controller.EVENT_CHANGE,BI.Events.STOPEDIT),self.fireEvent(BI.ClearEditor.EVENT_CLEAR)}),BI.createWidget({element:this,type:"bi.htape",items:[{el:this.editor},{el:this.clear,width:24}]}),this.editor.on(BI.Controller.EVENT_CHANGE,function(){self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.editor.on(BI.Editor.EVENT_FOCUS,function(){self.fireEvent(BI.ClearEditor.EVENT_FOCUS)}),this.editor.on(BI.Editor.EVENT_BLUR,function(){self.fireEvent(BI.ClearEditor.EVENT_BLUR)}),this.editor.on(BI.Editor.EVENT_CLICK,function(){self.fireEvent(BI.ClearEditor.EVENT_CLICK)}),this.editor.on(BI.Editor.EVENT_CHANGE,function(){self._checkClear(),self.fireEvent(BI.ClearEditor.EVENT_CHANGE)}),this.editor.on(BI.Editor.EVENT_KEY_DOWN,function(v){self.fireEvent(BI.ClearEditor.EVENT_KEY_DOWN,v)}),this.editor.on(BI.Editor.EVENT_SPACE,function(){self.fireEvent(BI.ClearEditor.EVENT_SPACE)}),this.editor.on(BI.Editor.EVENT_BACKSPACE,function(){self.fireEvent(BI.ClearEditor.EVENT_BACKSPACE)}),this.editor.on(BI.Editor.EVENT_VALID,function(){self.fireEvent(BI.ClearEditor.EVENT_VALID)}),this.editor.on(BI.Editor.EVENT_ERROR,function(){self.fireEvent(BI.ClearEditor.EVENT_ERROR)}),this.editor.on(BI.Editor.EVENT_ENTER,function(){self.fireEvent(BI.ClearEditor.EVENT_ENTER)}),this.editor.on(BI.Editor.EVENT_RESTRICT,function(){self.fireEvent(BI.ClearEditor.EVENT_RESTRICT)}),this.editor.on(BI.Editor.EVENT_EMPTY,function(){self._checkClear(),self.fireEvent(BI.ClearEditor.EVENT_EMPTY)}),this.editor.on(BI.Editor.EVENT_REMOVE,function(){self.fireEvent(BI.ClearEditor.EVENT_REMOVE)}),this.editor.on(BI.Editor.EVENT_CONFIRM,function(){self.fireEvent(BI.ClearEditor.EVENT_CONFIRM)}),this.editor.on(BI.Editor.EVENT_CHANGE_CONFIRM,function(){self.fireEvent(BI.ClearEditor.EVENT_CHANGE_CONFIRM)}),this.editor.on(BI.Editor.EVENT_START,function(){self.fireEvent(BI.ClearEditor.EVENT_START)}),this.editor.on(BI.Editor.EVENT_PAUSE,function(){self.fireEvent(BI.ClearEditor.EVENT_PAUSE)}),this.editor.on(BI.Editor.EVENT_STOP,function(){self.fireEvent(BI.ClearEditor.EVENT_STOP)}),BI.isKey(o.value)?this.clear.visible():this.clear.invisible()},_checkClear:function(){this.getValue()?this.clear.visible():this.clear.invisible()},setWaterMark:function(v){this.options.watermark=v,this.editor.setWaterMark(v)},focus:function(){this.editor.focus()},blur:function(){this.editor.blur()},getValue:function(){if(this.isValid()){var res=this.editor.getValue().match(/[\S]+/g);return BI.isNull(res)?"":res[res.length-1]}},setValue:function(v){this.editor.setValue(v),BI.isKey(v)&&this.clear.visible()},isValid:function(){return this.editor.isValid()}}),BI.ClearEditor.EVENT_CHANGE="EVENT_CHANGE",BI.ClearEditor.EVENT_FOCUS="EVENT_FOCUS",BI.ClearEditor.EVENT_BLUR="EVENT_BLUR",BI.ClearEditor.EVENT_CLICK="EVENT_CLICK",BI.ClearEditor.EVENT_KEY_DOWN="EVENT_KEY_DOWN",BI.ClearEditor.EVENT_SPACE="EVENT_SPACE",BI.ClearEditor.EVENT_BACKSPACE="EVENT_BACKSPACE",BI.ClearEditor.EVENT_CLEAR="EVENT_CLEAR",BI.ClearEditor.EVENT_START="EVENT_START",BI.ClearEditor.EVENT_PAUSE="EVENT_PAUSE",BI.ClearEditor.EVENT_STOP="EVENT_STOP",BI.ClearEditor.EVENT_CONFIRM="EVENT_CONFIRM",BI.ClearEditor.EVENT_CHANGE_CONFIRM="EVENT_CHANGE_CONFIRM",BI.ClearEditor.EVENT_VALID="EVENT_VALID",BI.ClearEditor.EVENT_ERROR="EVENT_ERROR",BI.ClearEditor.EVENT_ENTER="EVENT_ENTER",BI.ClearEditor.EVENT_RESTRICT="EVENT_RESTRICT",BI.ClearEditor.EVENT_REMOVE="EVENT_REMOVE",BI.ClearEditor.EVENT_EMPTY="EVENT_EMPTY",BI.shortcut("bi.clear_editor",BI.ClearEditor),BI.ShelterEditor=BI.inherit(BI.Widget,{_defaultConfig:function(){var conf=BI.ShelterEditor.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{baseCls:(conf.baseCls||"")+" bi-shelter-editor",hgap:4,vgap:2,lgap:0,rgap:0,tgap:0,bgap:0,validationChecker:BI.emptyFn,quitChecker:BI.emptyFn,allowBlank:!0,watermark:"",errorText:"",height:24,textAlign:"left"})},_init:function(){BI.ShelterEditor.superclass._init.apply(this,arguments);var self=this,o=this.options;this.editor=BI.createWidget({type:"bi.editor",height:o.height,hgap:o.hgap,vgap:o.vgap,lgap:o.lgap,rgap:o.rgap,tgap:o.tgap,bgap:o.bgap,value:o.value,validationChecker:o.validationChecker,quitChecker:o.quitChecker,allowBlank:o.allowBlank,watermark:o.watermark,errorText:o.errorText}),this.text=BI.createWidget({type:"bi.text_button",cls:"shelter-editor-text",title:o.title,warningTitle:o.warningTitle,tipType:o.tipType,textAlign:o.textAlign,height:o.height,hgap:o.hgap}),BI.createWidget({type:"bi.absolute",element:this,items:[{el:this.text,left:0,right:0,top:0,bottom:0}]}),this.text.on(BI.Controller.EVENT_CHANGE,function(){arguments[2]=self,self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.text.on(BI.TextButton.EVENT_CHANGE,function(){self.fireEvent(BI.ShelterEditor.EVENT_CLICK_LABEL)}),this.editor.on(BI.Controller.EVENT_CHANGE,function(){self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.editor.on(BI.Editor.EVENT_FOCUS,function(){self.fireEvent(BI.ShelterEditor.EVENT_FOCUS,arguments)}),this.editor.on(BI.Editor.EVENT_BLUR,function(){self.fireEvent(BI.ShelterEditor.EVENT_BLUR,arguments)}),this.editor.on(BI.Editor.EVENT_CLICK,function(){self.fireEvent(BI.ShelterEditor.EVENT_CLICK,arguments)}),this.editor.on(BI.Editor.EVENT_CHANGE,function(){self.fireEvent(BI.ShelterEditor.EVENT_CHANGE,arguments)}),this.editor.on(BI.Editor.EVENT_KEY_DOWN,function(v){self.fireEvent(BI.ShelterEditor.EVENT_KEY_DOWN,arguments)}),this.editor.on(BI.Editor.EVENT_VALID,function(){self.fireEvent(BI.ShelterEditor.EVENT_VALID,arguments)}),this.editor.on(BI.Editor.EVENT_CONFIRM,function(){self._showHint(),self._checkText(),self.fireEvent(BI.ShelterEditor.EVENT_CONFIRM,arguments)}),this.editor.on(BI.Editor.EVENT_CHANGE_CONFIRM,function(){self._showHint(),self._checkText(),self.fireEvent(BI.ShelterEditor.EVENT_CHANGE_CONFIRM,arguments)}),this.editor.on(BI.Editor.EVENT_START,function(){self.fireEvent(BI.ShelterEditor.EVENT_START,arguments)}),this.editor.on(BI.Editor.EVENT_PAUSE,function(){self.fireEvent(BI.ShelterEditor.EVENT_PAUSE,arguments)}),this.editor.on(BI.Editor.EVENT_STOP,function(){self.fireEvent(BI.ShelterEditor.EVENT_STOP,arguments)}),this.editor.on(BI.Editor.EVENT_SPACE,function(){self.fireEvent(BI.ShelterEditor.EVENT_SPACE,arguments)}),this.editor.on(BI.Editor.EVENT_ERROR,function(){self._checkText(),self.fireEvent(BI.ShelterEditor.EVENT_ERROR,arguments)}),this.editor.on(BI.Editor.EVENT_ENTER,function(){self.fireEvent(BI.ShelterEditor.EVENT_ENTER,arguments)}),this.editor.on(BI.Editor.EVENT_RESTRICT,function(){self.fireEvent(BI.ShelterEditor.EVENT_RESTRICT,arguments)}),this.editor.on(BI.Editor.EVENT_EMPTY,function(){self.fireEvent(BI.ShelterEditor.EVENT_EMPTY,arguments)}),BI.createWidget({type:"bi.vertical",scrolly:!1,element:this,items:[this.editor]}),this._showHint(),self._checkText(),BI.isKey(o.keyword)&&this.text.doRedMark(o.keyword)},_checkText:function(){var o=this.options;""===this.editor.getValue()?(this.text.setValue(o.watermark||""),this.text.element.addClass("bi-water-mark")):(this.text.setValue(this.editor.getValue()),this.text.element.removeClass("bi-water-mark"))},_showInput:function(){this.editor.visible(),this.text.invisible()},_showHint:function(){this.editor.invisible(),this.text.visible()},setWaterMark:function(v){this.options.watermark=v,this.editor.setWaterMark(v)},setTitle:function(title){this.text.setTitle(title)},setWarningTitle:function(title){this.text.setWarningTitle(title)},focus:function(){this._showInput(),this.editor.focus()},blur:function(){this.editor.blur(),this._showHint(),this._checkText()},doRedMark:function(){""===this.editor.getValue()&&BI.isKey(this.options.watermark)||this.text.doRedMark.apply(this.text,arguments)},unRedMark:function(){this.text.unRedMark.apply(this.text,arguments)},doHighLight:function(){""===this.editor.getValue()&&BI.isKey(this.options.watermark)||this.text.doHighLight.apply(this.text,arguments)},unHighLight:function(){this.text.unHighLight.apply(this.text,arguments)},isValid:function(){return this.editor.isValid()},setErrorText:function(text){this.editor.setErrorText(text)},getErrorText:function(){return this.editor.getErrorText()},isEditing:function(){return this.editor.isEditing()},getLastValidValue:function(){return this.editor.getLastValidValue()},getLastChangedValue:function(){return this.editor.getLastChangedValue()},setTextStyle:function(style){this.text.setStyle(style)},setValue:function(k){var o=this.options;this.editor.setValue(k),this._checkText(),BI.isKey(o.keyword)&&this.text.doRedMark(o.keyword)},getValue:function(){return this.editor.getValue()},getState:function(){return this.text.getValue()},setState:function(v){this._showHint(),this.text.setValue(v)}}),BI.ShelterEditor.EVENT_CHANGE="EVENT_CHANGE",BI.ShelterEditor.EVENT_FOCUS="EVENT_FOCUS",BI.ShelterEditor.EVENT_BLUR="EVENT_BLUR",BI.ShelterEditor.EVENT_CLICK="EVENT_CLICK",BI.ShelterEditor.EVENT_KEY_DOWN="EVENT_KEY_DOWN",BI.ShelterEditor.EVENT_CLICK_LABEL="EVENT_CLICK_LABEL",BI.ShelterEditor.EVENT_START="EVENT_START",BI.ShelterEditor.EVENT_PAUSE="EVENT_PAUSE",BI.ShelterEditor.EVENT_STOP="EVENT_STOP",BI.ShelterEditor.EVENT_CONFIRM="EVENT_CONFIRM",BI.ShelterEditor.EVENT_CHANGE_CONFIRM="EVENT_CHANGE_CONFIRM",BI.ShelterEditor.EVENT_VALID="EVENT_VALID",BI.ShelterEditor.EVENT_ERROR="EVENT_ERROR",BI.ShelterEditor.EVENT_ENTER="EVENT_ENTER",BI.ShelterEditor.EVENT_RESTRICT="EVENT_RESTRICT",BI.ShelterEditor.EVENT_SPACE="EVENT_SPACE",BI.ShelterEditor.EVENT_EMPTY="EVENT_EMPTY",BI.shortcut("bi.shelter_editor",BI.ShelterEditor),BI.SignEditor=BI.inherit(BI.Widget,{_defaultConfig:function(){var conf=BI.SignEditor.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{baseCls:(conf.baseCls||"")+" bi-sign-editor",hgap:4,vgap:2,lgap:0,rgap:0,tgap:0,bgap:0,validationChecker:BI.emptyFn,quitChecker:BI.emptyFn,allowBlank:!0,watermark:"",errorText:"",height:24})},_init:function(){BI.SignEditor.superclass._init.apply(this,arguments);var self=this,o=this.options;this.editor=BI.createWidget({type:"bi.editor",height:o.height,hgap:o.hgap,vgap:o.vgap,lgap:o.lgap,rgap:o.rgap,tgap:o.tgap,bgap:o.bgap,value:o.value,validationChecker:o.validationChecker,quitChecker:o.quitChecker,allowBlank:o.allowBlank,watermark:o.watermark,errorText:o.errorText}),this.text=BI.createWidget({type:"bi.text_button",cls:"sign-editor-text",title:o.title,warningTitle:o.warningTitle,tipType:o.tipType,textAlign:"left",height:o.height,hgap:o.hgap,handler:function(){self._showInput(),self.editor.focus(),self.editor.selectAll()}}),this.text.on(BI.TextButton.EVENT_CHANGE,function(){BI.nextTick(function(){self.fireEvent(BI.SignEditor.EVENT_CLICK_LABEL)})}),BI.createWidget({type:"bi.absolute",element:this,items:[{el:this.text,left:0,right:0,top:0,bottom:0}]}),this.editor.on(BI.Controller.EVENT_CHANGE,function(){self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.editor.on(BI.Editor.EVENT_FOCUS,function(){self.fireEvent(BI.SignEditor.EVENT_FOCUS,arguments)}),this.editor.on(BI.Editor.EVENT_BLUR,function(){self.fireEvent(BI.SignEditor.EVENT_BLUR,arguments)}),this.editor.on(BI.Editor.EVENT_CLICK,function(){self.fireEvent(BI.SignEditor.EVENT_CLICK,arguments)}),this.editor.on(BI.Editor.EVENT_CHANGE,function(){self.fireEvent(BI.SignEditor.EVENT_CHANGE,arguments)}),this.editor.on(BI.Editor.EVENT_KEY_DOWN,function(v){self.fireEvent(BI.SignEditor.EVENT_KEY_DOWN,arguments)}),this.editor.on(BI.Editor.EVENT_VALID,function(){self.fireEvent(BI.SignEditor.EVENT_VALID,arguments)}),this.editor.on(BI.Editor.EVENT_CONFIRM,function(){self._showHint(),self._checkText(),self.fireEvent(BI.SignEditor.EVENT_CONFIRM,arguments)}),this.editor.on(BI.Editor.EVENT_CHANGE_CONFIRM,function(){self._showHint(),self._checkText(),self.fireEvent(BI.SignEditor.EVENT_CHANGE_CONFIRM,arguments)}),this.editor.on(BI.Editor.EVENT_START,function(){self.fireEvent(BI.SignEditor.EVENT_START,arguments)}),this.editor.on(BI.Editor.EVENT_PAUSE,function(){self.fireEvent(BI.SignEditor.EVENT_PAUSE,arguments)}),this.editor.on(BI.Editor.EVENT_STOP,function(){self.fireEvent(BI.SignEditor.EVENT_STOP,arguments)}),this.editor.on(BI.Editor.EVENT_SPACE,function(){self.fireEvent(BI.SignEditor.EVENT_SPACE,arguments)}),this.editor.on(BI.Editor.EVENT_ERROR,function(){self._checkText(),self.fireEvent(BI.SignEditor.EVENT_ERROR,arguments)}),this.editor.on(BI.Editor.EVENT_ENTER,function(){self.fireEvent(BI.SignEditor.EVENT_ENTER,arguments)}),this.editor.on(BI.Editor.EVENT_RESTRICT,function(){self.fireEvent(BI.SignEditor.EVENT_RESTRICT,arguments)}),this.editor.on(BI.Editor.EVENT_EMPTY,function(){self.fireEvent(BI.SignEditor.EVENT_EMPTY,arguments)}),BI.createWidget({type:"bi.vertical",scrolly:!1,element:this,items:[this.editor]}),this._showHint(),self._checkText()},_checkText:function(){var o=this.options;BI.nextTick(BI.bind(function(){""===this.editor.getValue()?(this.text.setValue(o.watermark||""),this.text.element.addClass("bi-water-mark")):(this.text.setValue(this.editor.getValue()),this.text.element.removeClass("bi-water-mark"),BI.isKey(o.keyword)&&this.text.doRedMark(o.keyword))},this))},_showInput:function(){this.editor.visible(),this.text.invisible()},_showHint:function(){this.editor.invisible(),this.text.visible()},setTitle:function(title){this.text.setTitle(title)},setWarningTitle:function(title){this.text.setWarningTitle(title)},setWaterMark:function(v){this.options.watermark=v,this.editor.setWaterMark(v)},focus:function(){this._showInput(),this.editor.focus()},blur:function(){this.editor.blur(),this._showHint(),this._checkText()},doRedMark:function(){""===this.editor.getValue()&&BI.isKey(this.options.watermark)||this.text.doRedMark.apply(this.text,arguments)},unRedMark:function(){this.text.unRedMark.apply(this.text,arguments)},doHighLight:function(){""===this.editor.getValue()&&BI.isKey(this.options.watermark)||this.text.doHighLight.apply(this.text,arguments)},unHighLight:function(){this.text.unHighLight.apply(this.text,arguments)},isValid:function(){return this.editor.isValid()},setErrorText:function(text){this.editor.setErrorText(text)},getErrorText:function(){return this.editor.getErrorText()},isEditing:function(){return this.editor.isEditing()},getLastValidValue:function(){return this.editor.getLastValidValue()},getLastChangedValue:function(){return this.editor.getLastChangedValue()},setValue:function(k){this.editor.setValue(k),this._checkText()},getValue:function(){return this.editor.getValue()},getState:function(){return this.text.getValue()},setState:function(v){this._showHint(),this.text.setValue(v)}}),BI.SignEditor.EVENT_CHANGE="EVENT_CHANGE",BI.SignEditor.EVENT_FOCUS="EVENT_FOCUS",BI.SignEditor.EVENT_BLUR="EVENT_BLUR",BI.SignEditor.EVENT_CLICK="EVENT_CLICK",BI.SignEditor.EVENT_KEY_DOWN="EVENT_KEY_DOWN",BI.SignEditor.EVENT_CLICK_LABEL="EVENT_CLICK_LABEL",BI.SignEditor.EVENT_START="EVENT_START",BI.SignEditor.EVENT_PAUSE="EVENT_PAUSE",BI.SignEditor.EVENT_STOP="EVENT_STOP",BI.SignEditor.EVENT_CONFIRM="EVENT_CONFIRM",BI.SignEditor.EVENT_CHANGE_CONFIRM="EVENT_CHANGE_CONFIRM",BI.SignEditor.EVENT_VALID="EVENT_VALID",BI.SignEditor.EVENT_ERROR="EVENT_ERROR",BI.SignEditor.EVENT_ENTER="EVENT_ENTER",BI.SignEditor.EVENT_RESTRICT="EVENT_RESTRICT",BI.SignEditor.EVENT_SPACE="EVENT_SPACE",BI.SignEditor.EVENT_EMPTY="EVENT_EMPTY",BI.shortcut("bi.sign_editor",BI.SignEditor),BI.StateEditor=BI.inherit(BI.Widget,{_defaultConfig:function(){var conf=BI.StateEditor.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{baseCls:(conf.baseCls||"")+" bi-state-editor",hgap:4,vgap:2,lgap:0,rgap:0,tgap:0,bgap:0,validationChecker:BI.emptyFn,quitChecker:BI.emptyFn,allowBlank:!0,watermark:"",errorText:"",height:24,defaultText:"",text:BI.i18nText("BI-Basic_Unrestricted")})},_init:function(){BI.StateEditor.superclass._init.apply(this,arguments);var self=this,o=this.options;this.editor=BI.createWidget({type:"bi.editor",height:o.height,hgap:o.hgap,vgap:o.vgap,lgap:o.lgap,rgap:o.rgap,tgap:o.tgap,bgap:o.bgap,value:o.value,validationChecker:o.validationChecker,quitChecker:o.quitChecker,allowBlank:o.allowBlank,watermark:o.watermark,errorText:o.errorText}),this.text=BI.createWidget({type:"bi.text_button",cls:"bi-water-mark tip-text-style",textAlign:"left",height:o.height,text:o.text,hgap:o.hgap,handler:function(){self._showInput(),self.editor.focus(),self.editor.setValue("")},title:BI.isNotNull(o.tipText)?o.tipText:function(){var title="";return BI.isString(self.stateValue)&&(title=self.stateValue),BI.isArray(self.stateValue)&&1===self.stateValue.length&&(title=self.stateValue[0]),title},warningTitle:o.warningTitle,tipType:o.tipType}),this.text.on(BI.TextButton.EVENT_CHANGE,function(){BI.nextTick(function(){self.fireEvent(BI.StateEditor.EVENT_CLICK_LABEL)})}),BI.createWidget({type:"bi.absolute",element:this,items:[{el:this.text,left:0,right:0,top:0,bottom:0}]}),this.editor.on(BI.Controller.EVENT_CHANGE,function(){self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.editor.on(BI.Editor.EVENT_FOCUS,function(){self.fireEvent(BI.StateEditor.EVENT_FOCUS,arguments)}),this.editor.on(BI.Editor.EVENT_BLUR,function(){self.fireEvent(BI.StateEditor.EVENT_BLUR,arguments)}),this.editor.on(BI.Editor.EVENT_CLICK,function(){self.fireEvent(BI.StateEditor.EVENT_CLICK,arguments)}),this.editor.on(BI.Editor.EVENT_CHANGE,function(){self.fireEvent(BI.StateEditor.EVENT_CHANGE,arguments)}),this.editor.on(BI.Editor.EVENT_KEY_DOWN,function(v){self.fireEvent(BI.StateEditor.EVENT_KEY_DOWN,arguments)}),this.editor.on(BI.Editor.EVENT_VALID,function(){self.fireEvent(BI.StateEditor.EVENT_VALID,arguments)}),this.editor.on(BI.Editor.EVENT_CONFIRM,function(){self._showHint(),self.fireEvent(BI.StateEditor.EVENT_CONFIRM,arguments)}),this.editor.on(BI.Editor.EVENT_CHANGE_CONFIRM,function(){self._showHint(),self.fireEvent(BI.StateEditor.EVENT_CHANGE_CONFIRM,arguments)}),this.editor.on(BI.Editor.EVENT_START,function(){self.fireEvent(BI.StateEditor.EVENT_START,arguments)}),this.editor.on(BI.Editor.EVENT_PAUSE,function(){self.fireEvent(BI.StateEditor.EVENT_PAUSE,arguments)}),this.editor.on(BI.Editor.EVENT_STOP,function(){self.fireEvent(BI.StateEditor.EVENT_STOP,arguments)}),this.editor.on(BI.Editor.EVENT_SPACE,function(){self.fireEvent(BI.StateEditor.EVENT_SPACE,arguments)}),this.editor.on(BI.Editor.EVENT_ERROR,function(){self.fireEvent(BI.StateEditor.EVENT_ERROR,arguments)}),this.editor.on(BI.Editor.EVENT_ENTER,function(){self.fireEvent(BI.StateEditor.EVENT_ENTER,arguments)}),this.editor.on(BI.Editor.EVENT_RESTRICT,function(){self.fireEvent(BI.StateEditor.EVENT_RESTRICT,arguments)}),this.editor.on(BI.Editor.EVENT_EMPTY,function(){self.fireEvent(BI.StateEditor.EVENT_EMPTY,arguments)}),BI.createWidget({type:"bi.vertical",scrolly:!1,element:this,items:[this.editor]}),this._showHint(),BI.isNotNull(o.text)&&this.setState(o.text)},setWaterMark:function(v){this.options.watermark=v,this.editor.setWaterMark(v)},doRedMark:function(){""===this.editor.getValue()&&BI.isKey(this.options.watermark)||this.text.doRedMark.apply(this.text,arguments)},unRedMark:function(){this.text.unRedMark.apply(this.text,arguments)},doHighLight:function(){""===this.editor.getValue()&&BI.isKey(this.options.watermark)||this.text.doHighLight.apply(this.text,arguments)},unHighLight:function(){this.text.unHighLight.apply(this.text,arguments)},focus:function(){this.options.disabled===!1&&(this._showInput(),this.editor.focus())},blur:function(){this.editor.blur(),this._showHint()},_showInput:function(){this.editor.visible(),this.text.invisible()},_showHint:function(){this.editor.invisible(),this.text.visible()},isValid:function(){return this.editor.isValid()},setErrorText:function(text){this.editor.setErrorText(text)},getErrorText:function(){return this.editor.getErrorText()},isEditing:function(){return this.editor.isEditing()},getLastValidValue:function(){return this.editor.getLastValidValue()},getLastChangedValue:function(){return this.editor.getLastChangedValue()},setValue:function(k){this.editor.setValue(k)},getValue:function(){return this.editor.getValue()},getState:function(){return this.editor.getValue().match(/[^\s]+/g)},setState:function(v){var o=this.options;return BI.StateEditor.superclass.setValue.apply(this,arguments),this.stateValue=v,BI.isNumber(v)?void(v===BI.Selection.All?(this.text.setText(BI.i18nText("BI-Select_All")),this.text.element.removeClass("bi-water-mark")):v===BI.Selection.Multi?(this.text.setText(BI.i18nText("BI-Select_Part")),this.text.element.removeClass("bi-water-mark")):(this.text.setText(BI.isKey(o.defaultText)?o.defaultText:o.text),BI.isKey(o.defaultText)?this.text.element.addClass("bi-water-mark"):this.text.element.removeClass("bi-water-mark"))):BI.isString(v)?(this.text.setText(v),void(BI.isKey(o.defaultText)&&o.defaultText===v?this.text.element.addClass("bi-water-mark"):this.text.element.removeClass("bi-water-mark"))):void(BI.isArray(v)&&(BI.isEmpty(v)?(this.text.setText(BI.isKey(o.defaultText)?o.defaultText:o.text),BI.isKey(o.defaultText)?this.text.element.addClass("bi-water-mark"):this.text.element.removeClass("bi-water-mark")):1===v.length?(this.text.setText(v[0]),this.text.element.removeClass("bi-water-mark")):(this.text.setText(BI.i18nText("BI-Select_Part")),this.text.element.removeClass("bi-water-mark"))))},setTipType:function(v){this.text.options.tipType=v}}),BI.StateEditor.EVENT_CHANGE="EVENT_CHANGE",BI.StateEditor.EVENT_FOCUS="EVENT_FOCUS",BI.StateEditor.EVENT_BLUR="EVENT_BLUR",BI.StateEditor.EVENT_CLICK="EVENT_CLICK",BI.StateEditor.EVENT_KEY_DOWN="EVENT_KEY_DOWN",BI.StateEditor.EVENT_CLICK_LABEL="EVENT_CLICK_LABEL",BI.StateEditor.EVENT_START="EVENT_START",BI.StateEditor.EVENT_PAUSE="EVENT_PAUSE",BI.StateEditor.EVENT_STOP="EVENT_STOP",BI.StateEditor.EVENT_CONFIRM="EVENT_CONFIRM",BI.StateEditor.EVENT_CHANGE_CONFIRM="EVENT_CHANGE_CONFIRM",BI.StateEditor.EVENT_VALID="EVENT_VALID",BI.StateEditor.EVENT_ERROR="EVENT_ERROR",BI.StateEditor.EVENT_ENTER="EVENT_ENTER",BI.StateEditor.EVENT_RESTRICT="EVENT_RESTRICT",BI.StateEditor.EVENT_SPACE="EVENT_SPACE",BI.StateEditor.EVENT_EMPTY="EVENT_EMPTY",BI.shortcut("bi.state_editor",BI.StateEditor),BI.SimpleStateEditor=BI.inherit(BI.Widget,{_defaultConfig:function(){var conf=BI.SimpleStateEditor.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{baseCls:(conf.baseCls||"")+" bi-simple-state-editor",hgap:4,vgap:2,lgap:0,rgap:0,tgap:0,bgap:0,validationChecker:BI.emptyFn,quitChecker:BI.emptyFn,mouseOut:!1,allowBlank:!0,watermark:"",errorText:"",height:24,text:BI.i18nText("BI-Basic_Unrestricted")})},_init:function(){BI.SimpleStateEditor.superclass._init.apply(this,arguments);var self=this,o=this.options;this.editor=BI.createWidget({type:"bi.editor",height:o.height,hgap:o.hgap,vgap:o.vgap,lgap:o.lgap,rgap:o.rgap,tgap:o.tgap,bgap:o.bgap,value:o.value,validationChecker:o.validationChecker,quitChecker:o.quitChecker,allowBlank:o.allowBlank,watermark:o.watermark,errorText:o.errorText}),this.text=BI.createWidget({type:"bi.text_button",cls:"bi-water-mark",textAlign:"left",text:o.text,height:o.height,hgap:o.hgap,handler:function(){self._showInput(),self.editor.focus(),self.editor.setValue("")}}),this.text.on(BI.TextButton.EVENT_CHANGE,function(){BI.nextTick(function(){self.fireEvent(BI.SimpleStateEditor.EVENT_CLICK_LABEL)})}),BI.createWidget({type:"bi.absolute",element:this,items:[{el:this.text,left:0,right:0,top:0,bottom:0}]}),this.editor.on(BI.Controller.EVENT_CHANGE,function(){self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.editor.on(BI.Editor.EVENT_FOCUS,function(){self.fireEvent(BI.SimpleStateEditor.EVENT_FOCUS,arguments)}),this.editor.on(BI.Editor.EVENT_BLUR,function(){self.fireEvent(BI.SimpleStateEditor.EVENT_BLUR,arguments)}),this.editor.on(BI.Editor.EVENT_CLICK,function(){self.fireEvent(BI.SimpleStateEditor.EVENT_CLICK,arguments)}),this.editor.on(BI.Editor.EVENT_CHANGE,function(){self.fireEvent(BI.SimpleStateEditor.EVENT_CHANGE,arguments)}),this.editor.on(BI.Editor.EVENT_KEY_DOWN,function(v){self.fireEvent(BI.SimpleStateEditor.EVENT_KEY_DOWN,arguments)}),this.editor.on(BI.Editor.EVENT_VALID,function(){self.fireEvent(BI.SimpleStateEditor.EVENT_VALID,arguments)}),this.editor.on(BI.Editor.EVENT_CONFIRM,function(){self._showHint(),self.fireEvent(BI.SimpleStateEditor.EVENT_CONFIRM,arguments)}),this.editor.on(BI.Editor.EVENT_CHANGE_CONFIRM,function(){self._showHint(),self.fireEvent(BI.SimpleStateEditor.EVENT_CHANGE_CONFIRM,arguments)}),this.editor.on(BI.Editor.EVENT_START,function(){self.fireEvent(BI.SimpleStateEditor.EVENT_START,arguments)}),this.editor.on(BI.Editor.EVENT_PAUSE,function(){self.fireEvent(BI.SimpleStateEditor.EVENT_PAUSE,arguments)}),this.editor.on(BI.Editor.EVENT_STOP,function(){self.fireEvent(BI.SimpleStateEditor.EVENT_STOP,arguments)}),this.editor.on(BI.Editor.EVENT_SPACE,function(){self.fireEvent(BI.SimpleStateEditor.EVENT_SPACE,arguments)}),this.editor.on(BI.Editor.EVENT_ERROR,function(){self.fireEvent(BI.SimpleStateEditor.EVENT_ERROR,arguments)}),this.editor.on(BI.Editor.EVENT_ENTER,function(){self.fireEvent(BI.SimpleStateEditor.EVENT_ENTER,arguments)}),this.editor.on(BI.Editor.EVENT_RESTRICT,function(){self.fireEvent(BI.SimpleStateEditor.EVENT_RESTRICT,arguments)}),this.editor.on(BI.Editor.EVENT_EMPTY,function(){self.fireEvent(BI.SimpleStateEditor.EVENT_EMPTY,arguments)}),BI.createWidget({type:"bi.vertical",scrolly:!1,element:this,items:[this.editor]}),this._showHint(),BI.isNotNull(o.text)&&this.setState(o.text)},setWaterMark:function(v){this.options.watermark=v,this.editor.setWaterMark(v)},doRedMark:function(){""===this.editor.getValue()&&BI.isKey(this.options.watermark)||this.text.doRedMark.apply(this.text,arguments)},unRedMark:function(){this.text.unRedMark.apply(this.text,arguments)},doHighLight:function(){""===this.editor.getValue()&&BI.isKey(this.options.watermark)||this.text.doHighLight.apply(this.text,arguments)},unHighLight:function(){this.text.unHighLight.apply(this.text,arguments)},focus:function(){this._showInput(),this.editor.focus()},blur:function(){this.editor.blur(),this._showHint()},_showInput:function(){this.editor.visible(),this.text.invisible()},_showHint:function(){this.editor.invisible(),this.text.visible()},isValid:function(){return this.editor.isValid()},setErrorText:function(text){this.editor.setErrorText(text)},getErrorText:function(){return this.editor.getErrorText()},isEditing:function(){return this.editor.isEditing()},getLastValidValue:function(){return this.editor.getLastValidValue()},getLastChangedValue:function(){return this.editor.getLastChangedValue()},setValue:function(k){this.editor.setValue(k)},getValue:function(){return this.editor.getValue()},getState:function(){return this.editor.getValue().match(/[^\s]+/g)},setState:function(v){var o=this.options;return BI.SimpleStateEditor.superclass.setValue.apply(this,arguments),BI.isNumber(v)?void(v===BI.Selection.All?(this.text.setText(BI.i18nText("BI-Already_Selected")),this.text.element.removeClass("bi-water-mark")):v===BI.Selection.Multi?(this.text.setText(BI.i18nText("BI-Already_Selected")),this.text.element.removeClass("bi-water-mark")):(this.text.setText(o.text),this.text.element.addClass("bi-water-mark"))):void(BI.isArray(v)&&1!==v.length?BI.isEmpty(v)?(this.text.setText(o.text),this.text.element.addClass("bi-water-mark")):(this.text.setText(BI.i18nText("BI-Already_Selected")),this.text.element.removeClass("bi-water-mark")):(this.text.setText(v),this.text.setTitle(v),this.text.element.removeClass("bi-water-mark")))}}),BI.SimpleStateEditor.EVENT_CHANGE="EVENT_CHANGE",BI.SimpleStateEditor.EVENT_FOCUS="EVENT_FOCUS",BI.SimpleStateEditor.EVENT_BLUR="EVENT_BLUR",BI.SimpleStateEditor.EVENT_CLICK="EVENT_CLICK",BI.SimpleStateEditor.EVENT_KEY_DOWN="EVENT_KEY_DOWN",BI.SimpleStateEditor.EVENT_CLICK_LABEL="EVENT_CLICK_LABEL",BI.SimpleStateEditor.EVENT_START="EVENT_START",BI.SimpleStateEditor.EVENT_PAUSE="EVENT_PAUSE",BI.SimpleStateEditor.EVENT_STOP="EVENT_STOP",BI.SimpleStateEditor.EVENT_CONFIRM="EVENT_CONFIRM",BI.SimpleStateEditor.EVENT_CHANGE_CONFIRM="EVENT_CHANGE_CONFIRM",BI.SimpleStateEditor.EVENT_VALID="EVENT_VALID",BI.SimpleStateEditor.EVENT_ERROR="EVENT_ERROR",BI.SimpleStateEditor.EVENT_ENTER="EVENT_ENTER",BI.SimpleStateEditor.EVENT_RESTRICT="EVENT_RESTRICT",BI.SimpleStateEditor.EVENT_SPACE="EVENT_SPACE",BI.SimpleStateEditor.EVENT_EMPTY="EVENT_EMPTY",BI.shortcut("bi.simple_state_editor",BI.SimpleStateEditor), +BI.MultiPopupView=BI.inherit(BI.PopupView,{_defaultConfig:function(){var conf=BI.MultiPopupView.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{_baseCls:(conf._baseCls||"")+" bi-multi-list-view",buttons:[BI.i18nText("BI-Basic_Sure")]})},_init:function(){BI.MultiPopupView.superclass._init.apply(this,arguments)},_createToolBar:function(){var o=this.options,self=this;if(0!==o.buttons.length){var text=[];return BI.each(o.buttons,function(idx,item){text.push({text:item,value:idx})}),this.buttongroup=BI.createWidget({type:"bi.button_group",cls:"list-view-toolbar bi-high-light bi-split-top",height:24,items:BI.createItems(text,{type:"bi.text_button",once:!1,shadow:!0,isShadowShowingOnSelected:!0}),layouts:[{type:"bi.center",hgap:0,vgap:0}]}),this.buttongroup.on(BI.ButtonGroup.EVENT_CHANGE,function(value,obj){self.fireEvent(BI.MultiPopupView.EVENT_CLICK_TOOLBAR_BUTTON,value,obj)}),this.buttongroup}}}),BI.MultiPopupView.EVENT_CHANGE="EVENT_CHANGE",BI.MultiPopupView.EVENT_CLICK_TOOLBAR_BUTTON="EVENT_CLICK_TOOLBAR_BUTTON",BI.shortcut("bi.multi_popup_view",BI.MultiPopupView),BI.PopupPanel=BI.inherit(BI.MultiPopupView,{_defaultConfig:function(){var conf=BI.PopupPanel.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{baseCls:(conf.baseCls||"")+" bi-popup-panel",title:""})},_init:function(){BI.PopupPanel.superclass._init.apply(this,arguments)},_createTool:function(){var self=this,o=this.options,close=BI.createWidget({type:"bi.icon_button",cls:"close-h-font",width:25,height:25});return close.on(BI.IconButton.EVENT_CHANGE,function(){self.setVisible(!1),self.fireEvent(BI.PopupPanel.EVENT_CLOSE)}),BI.createWidget({type:"bi.htape",cls:"popup-panel-title bi-header-background",height:25,items:[{el:{type:"bi.label",textAlign:"left",text:o.title,height:25,lgap:10}},{el:close,width:25}]})}}),BI.PopupPanel.EVENT_CHANGE="EVENT_CHANGE",BI.PopupPanel.EVENT_CLOSE="EVENT_CLOSE",BI.PopupPanel.EVENT_CLICK_TOOLBAR_BUTTON="EVENT_CLICK_TOOLBAR_BUTTON",BI.shortcut("bi.popup_panel",BI.PopupPanel),BI.ListPane=BI.inherit(BI.Pane,{_defaultConfig:function(){var conf=BI.ListPane.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{baseCls:(conf.baseCls||"")+" bi-list-pane",logic:{dynamic:!0},lgap:0,rgap:0,tgap:0,bgap:0,vgap:0,hgap:0,items:[],itemsCreator:BI.emptyFn,hasNext:BI.emptyFn,onLoaded:BI.emptyFn,el:{type:"bi.button_group"}})},_init:function(){BI.ListPane.superclass._init.apply(this,arguments);var self=this,o=this.options;this.button_group=BI.createWidget(o.el,{type:"bi.button_group",chooseType:BI.ButtonGroup.CHOOSE_TYPE_SINGLE,behaviors:{},items:o.items,itemsCreator:function(op,calback){1===op.times&&(self.empty(),BI.nextTick(function(){self.loading()})),o.itemsCreator(op,function(){calback.apply(self,arguments),1===op.times&&BI.nextTick(function(){self.loaded(),self.check()})})},hasNext:o.hasNext,layouts:[{type:"bi.vertical"}]}),this.button_group.on(BI.Controller.EVENT_CHANGE,function(type,value,obj){self.fireEvent(BI.Controller.EVENT_CHANGE,arguments),type===BI.Events.CLICK&&self.fireEvent(BI.ListPane.EVENT_CHANGE,value,obj)}),this.check(),BI.createWidget(BI.extend({element:this},BI.LogicFactory.createLogic(BI.LogicFactory.createLogicTypeByDirection(BI.Direction.Top),BI.extend({scrolly:!0,lgap:o.lgap,rgap:o.rgap,tgap:o.tgap,bgap:o.bgap,vgap:o.vgap,hgap:o.hgap},o.logic,{items:BI.LogicFactory.createLogicItemsByDirection(BI.Direction.Top,this.button_group)}))))},hasPrev:function(){return this.button_group.hasPrev&&this.button_group.hasPrev()},hasNext:function(){return this.button_group.hasNext&&this.button_group.hasNext()},prependItems:function(items){this.options.items=items.concat(this.options.items),this.button_group.prependItems.apply(this.button_group,arguments),this.check()},addItems:function(items){this.options.items=this.options.items.concat(items),this.button_group.addItems.apply(this.button_group,arguments),this.check()},removeItemAt:function(indexes){indexes=indexes||[],BI.removeAt(this.options.items,indexes),this.button_group.removeItemAt.apply(this.button_group,arguments),this.check()},populate:function(items){var self=this,o=this.options;return 0===arguments.length&&BI.isFunction(this.button_group.attr("itemsCreator"))?void this.button_group.attr("itemsCreator").apply(this,[{times:1},function(){if(0===arguments.length)throw new Error("参数不能为空");self.populate.apply(self,arguments)}]):(BI.ListPane.superclass.populate.apply(this,arguments),void this.button_group.populate.apply(this.button_group,arguments))},empty:function(){this.button_group.empty()},setNotSelectedValue:function(){this.button_group.setNotSelectedValue.apply(this.button_group,arguments)},getNotSelectedValue:function(){return this.button_group.getNotSelectedValue()},setValue:function(){this.button_group.setValue.apply(this.button_group,arguments)},getValue:function(){return this.button_group.getValue.apply(this.button_group,arguments)},getAllButtons:function(){return this.button_group.getAllButtons()},getAllLeaves:function(){return this.button_group.getAllLeaves()},getSelectedButtons:function(){return this.button_group.getSelectedButtons()},getNotSelectedButtons:function(){return this.button_group.getNotSelectedButtons()},getIndexByValue:function(value){return this.button_group.getIndexByValue(value)},getNodeById:function(id){return this.button_group.getNodeById(id)},getNodeByValue:function(value){return this.button_group.getNodeByValue(value)}}),BI.ListPane.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.list_pane",BI.ListPane),BI.Panel=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.Panel.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-panel bi-border",title:"",titleButtons:[],el:{},logic:{dynamic:!1}})},_init:function(){BI.Panel.superclass._init.apply(this,arguments);var o=this.options;BI.createWidget(BI.extend({element:this},BI.LogicFactory.createLogic("vertical",BI.extend(o.logic,{items:BI.LogicFactory.createLogicItemsByDirection("top",this._createTitle(),this.options.el)}))))},_createTitle:function(){var self=this,o=this.options;return this.text=BI.createWidget({type:"bi.label",cls:"panel-title-text",text:o.title,height:30}),this.button_group=BI.createWidget({type:"bi.button_group",items:o.titleButtons,layouts:[{type:"bi.center_adapt",lgap:10}]}),this.button_group.on(BI.Controller.EVENT_CHANGE,function(){self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.button_group.on(BI.ButtonGroup.EVENT_CHANGE,function(value,obj){self.fireEvent(BI.Panel.EVENT_CHANGE,value,obj)}),{el:{type:"bi.left_right_vertical_adapt",cls:"panel-title bi-header-background bi-border-bottom",height:29,items:{left:[this.text],right:[this.button_group]},lhgap:10,rhgap:10},height:29}},setTitle:function(title){this.text.setValue(title)}}),BI.Panel.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.panel",BI.Panel),BI.LinearSegmentButton=BI.inherit(BI.BasicButton,{props:{extraCls:"bi-line-segment-button bi-list-item-effect",once:!0,readonly:!0,hgap:10,height:25},render:function(){var self=this,o=this.options;return[{type:"bi.label",text:o.text,height:o.height,value:o.value,hgap:o.hgap,ref:function(){self.text=this}},{type:"bi.absolute",items:[{el:{type:"bi.layout",cls:"line-segment-button-line",height:2,ref:function(){self.line=this}},left:0,right:0,bottom:0}]}]},setSelected:function(v){BI.LinearSegmentButton.superclass.setSelected.apply(this,arguments),v?this.line.element.addClass("bi-high-light-background"):this.line.element.removeClass("bi-high-light-background")},setText:function(text){this.text.setText(text)}}),BI.shortcut("bi.linear_segment_button",BI.LinearSegmentButton),BI.LinearSegment=BI.inherit(BI.Widget,{props:{baseCls:"bi-linear-segment bi-split-bottom",items:[],height:29},render:function(){var self=this,o=this.options;return{type:"bi.button_group",items:BI.createItems(o.items,{type:"bi.linear_segment_button",height:o.height-1}),layout:[{type:"bi.center"}],listeners:[{eventName:"__EVENT_CHANGE__",action:function(){self.fireEvent("__EVENT_CHANGE__",arguments)}},{eventName:"EVENT_CHANGE",action:function(){self.fireEvent("EVENT_CHANGE")}}],ref:function(){self.buttonGroup=this}}},setValue:function(v){this.buttonGroup.setValue(v)},setEnabledValue:function(v){this.buttonGroup.setEnabledValue(v)},getValue:function(){return this.buttonGroup.getValue()}}),BI.shortcut("bi.linear_segment",BI.LinearSegment),BI.SelectList=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.SelectList.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-select-list",direction:BI.Direction.Top,logic:{dynamic:!0},items:[],itemsCreator:BI.emptyFn,hasNext:BI.emptyFn,onLoaded:BI.emptyFn,toolbar:{type:"bi.multi_select_bar",iconWrapperWidth:36},el:{type:"bi.list_pane"}})},_init:function(){BI.SelectList.superclass._init.apply(this,arguments);var self=this,o=this.options;this.toolbar=BI.createWidget(o.toolbar),this.allSelected=!1,this.toolbar.on(BI.Controller.EVENT_CHANGE,function(type,value,obj){self.allSelected=this.isSelected(),type===BI.Events.CLICK&&(self.setAllSelected(self.allSelected),self.fireEvent(BI.SelectList.EVENT_CHANGE,value,obj)),self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.list=BI.createWidget(o.el,{type:"bi.list_pane",items:o.items,itemsCreator:function(op,callback){1===op.times&&self.toolbar.setVisible(!1),o.itemsCreator(op,function(items){callback.apply(self,arguments),1===op.times&&(self.toolbar.setVisible(items&&items.length>0),self.toolbar.setEnable(self.isEnabled()&&items&&items.length>0)),self._checkAllSelected()})},onLoaded:o.onLoaded,hasNext:o.hasNext}),this.list.on(BI.Controller.EVENT_CHANGE,function(type,value,obj){type===BI.Events.CLICK&&(self._checkAllSelected(),self.fireEvent(BI.SelectList.EVENT_CHANGE,value,obj)),self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),BI.createWidget(BI.extend({element:this},BI.LogicFactory.createLogic(BI.LogicFactory.createLogicTypeByDirection(o.direction),BI.extend({scrolly:!0},o.logic,{items:BI.LogicFactory.createLogicItemsByDirection(o.direction,this.toolbar,this.list)})))),o.items.length<=0&&(this.toolbar.setVisible(!1),this.toolbar.setEnable(!1)),BI.isNotNull(o.value)&&this.setValue(o.value)},_checkAllSelected:function(){var selectLength=this.list.getValue().length,notSelectLength=this.getAllLeaves().length-selectLength,hasNext=this.list.hasNext(),isAlreadyAllSelected=this.toolbar.isSelected(),isHalf=selectLength>0&&(notSelectLength>0||!isAlreadyAllSelected&&hasNext);isHalf=isHalf||notSelectLength>0&&hasNext&&isAlreadyAllSelected,this.toolbar.setHalfSelected(isHalf),!isHalf&&this.toolbar.setSelected(selectLength>0&¬SelectLength<=0&&(!hasNext||isAlreadyAllSelected))},setAllSelected:function(v){BI.each(this.getAllButtons(),function(i,btn){(btn.setSelected||btn.setAllSelected).apply(btn,[v])}),this.allSelected=!!v,this.toolbar.setSelected(v),this.toolbar.setHalfSelected(!1)},setToolBarVisible:function(b){this.toolbar.setVisible(b)},isAllSelected:function(){return this.allSelected},hasPrev:function(){return this.list.hasPrev()},hasNext:function(){return this.list.hasNext()},prependItems:function(items){this.list.prependItems.apply(this.list,arguments)},addItems:function(items){this.list.addItems.apply(this.list,arguments)},setValue:function(data){var selectAll=data.type===BI.ButtonGroup.CHOOSE_TYPE_ALL;this.setAllSelected(selectAll),this.list[selectAll?"setNotSelectedValue":"setValue"](data.value),this._checkAllSelected()},getValue:function(){return this.isAllSelected()===!1?{type:BI.ButtonGroup.CHOOSE_TYPE_MULTI,value:this.list.getValue(),assist:this.list.getNotSelectedValue()}:{type:BI.ButtonGroup.CHOOSE_TYPE_ALL,value:this.list.getNotSelectedValue(),assist:this.list.getValue()}},empty:function(){this.list.empty()},populate:function(items){this.toolbar.setVisible(!BI.isEmptyArray(items)),this.toolbar.setEnable(this.isEnabled()&&!BI.isEmptyArray(items)),this.list.populate.apply(this.list,arguments),this._checkAllSelected()},_setEnable:function(enable){BI.SelectList.superclass._setEnable.apply(this,arguments),this.toolbar.setEnable(enable)},resetHeight:function(h){var toolHeight=(this.toolbar.element.outerHeight()||25)*(this.toolbar.isVisible()?1:0);this.list.resetHeight?this.list.resetHeight(h-toolHeight):this.list.element.css({"max-height":h-toolHeight+"px"})},setNotSelectedValue:function(){this.list.setNotSelectedValue.apply(this.list,arguments),this._checkAllSelected()},getNotSelectedValue:function(){return this.list.getNotSelectedValue()},getAllButtons:function(){return this.list.getAllButtons()},getAllLeaves:function(){return this.list.getAllLeaves()},getSelectedButtons:function(){return this.list.getSelectedButtons()},getNotSelectedButtons:function(){return this.list.getNotSelectedButtons()},getIndexByValue:function(value){return this.list.getIndexByValue(value)},getNodeById:function(id){return this.list.getNodeById(id)},getNodeByValue:function(value){return this.list.getNodeByValue(value)}}),BI.SelectList.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.select_list",BI.SelectList),BI.LazyLoader=BI.inherit(BI.Widget,{_const:{PAGE:100},_defaultConfig:function(){return BI.extend(BI.LazyLoader.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-lazy-loader",el:{}})},_init:function(){var self=this,o=this.options;BI.LazyLoader.superclass._init.apply(this,arguments);var all=o.items.length;this.loader=BI.createWidget({type:"bi.loader",element:this,el:o.el,itemsCreator:function(options,populate){populate(self._getNextItems(options))},hasNext:function(option){return option.count=1),this.setPagerVisible(v>1)},setValue:function(v){this.pager.setValue(v)},setVPage:function(v){this.pager.setValue(v)},setCount:function(count){this.rowCount.setText(count),this.rowCount.setTitle(count)},getCurrentPage:function(){return this.pager.getCurrentPage()},hasPrev:function(){return this.pager.hasPrev()},hasNext:function(){return this.pager.hasNext()},setPagerVisible:function(b){this.editor.setVisible(b),this.allPages.setVisible(b),this.pager.setVisible(b)},populate:function(){this.pager.populate(),this.setPagerVisible(this.options.pages>1)}}),BI.AllCountPager.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.all_count_pager",BI.AllCountPager),BI.DirectionPager=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.DirectionPager.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-direction-pager",height:24,horizontal:{pages:!1,curr:1,hasPrev:BI.emptyFn,hasNext:BI.emptyFn,firstPage:1,lastPage:BI.emptyFn},vertical:{pages:!1,curr:1,hasPrev:BI.emptyFn,hasNext:BI.emptyFn,firstPage:1,lastPage:BI.emptyFn}})},_init:function(){BI.DirectionPager.superclass._init.apply(this,arguments);var self=this,o=this.options,v=o.vertical,h=o.horizontal;this._createVPager(),this._createHPager(),this.layout=BI.createWidget({type:"bi.absolute",scrollable:!1,element:this,items:[{el:this.vpager,top:0,right:86},{el:this.vlabel,top:0,right:110},{el:this.hpager,top:0,right:0},{el:this.hlabel,top:0,right:24}]})},_createVPager:function(){var self=this,o=this.options,v=o.vertical;this.vlabel=BI.createWidget({type:"bi.label",width:24,height:24,value:v.curr,title:v.curr,invisible:!0}),this.vpager=BI.createWidget({type:"bi.pager",width:72,layouts:[{type:"bi.horizontal",scrollx:!1,rgap:24}],invisible:!0,dynamicShow:!1,pages:v.pages,curr:v.curr,groups:0,first:!1,last:!1,prev:{type:"bi.icon_button",value:"prev",title:BI.i18nText("BI-Up_Page"),warningTitle:BI.i18nText("BI-Current_Is_First_Page"),height:22,width:22,cls:"bi-border bi-border-radius direction-pager-prev column-pre-page-h-font bi-list-item-select2"},next:{type:"bi.icon_button",value:"next",title:BI.i18nText("BI-Down_Page"),warningTitle:BI.i18nText("BI-Current_Is_Last_Page"),height:22,width:22,cls:"bi-border bi-border-radius direction-pager-next column-next-page-h-font bi-list-item-select2"},hasPrev:v.hasPrev,hasNext:v.hasNext,firstPage:v.firstPage,lastPage:v.lastPage}),this.vpager.on(BI.Pager.EVENT_CHANGE,function(){self.fireEvent(BI.DirectionPager.EVENT_CHANGE)}),this.vpager.on(BI.Pager.EVENT_AFTER_POPULATE,function(){self.vlabel.setValue(this.getCurrentPage()),self.vlabel.setTitle(this.getCurrentPage())})},_createHPager:function(){var self=this,o=this.options,h=o.horizontal;this.hlabel=BI.createWidget({type:"bi.label",width:24,height:24,value:h.curr,title:h.curr,invisible:!0}),this.hpager=BI.createWidget({type:"bi.pager",width:72,layouts:[{type:"bi.horizontal",scrollx:!1,rgap:24}],invisible:!0,dynamicShow:!1,pages:h.pages,curr:h.curr,groups:0,first:!1,last:!1,prev:{type:"bi.icon_button",value:"prev",title:BI.i18nText("BI-Left_Page"),warningTitle:BI.i18nText("BI-Current_Is_First_Page"),height:22,width:22,cls:"bi-border bi-border-radius direction-pager-prev row-pre-page-h-font bi-list-item-select2"},next:{type:"bi.icon_button",value:"next",title:BI.i18nText("BI-Right_Page"),warningTitle:BI.i18nText("BI-Current_Is_Last_Page"),height:22,width:22,cls:"bi-border bi-border-radius direction-pager-next row-next-page-h-font bi-list-item-select2"},hasPrev:h.hasPrev,hasNext:h.hasNext,firstPage:h.firstPage,lastPage:h.lastPage}),this.hpager.on(BI.Pager.EVENT_CHANGE,function(){self.fireEvent(BI.DirectionPager.EVENT_CHANGE)}),this.hpager.on(BI.Pager.EVENT_AFTER_POPULATE,function(){self.hlabel.setValue(this.getCurrentPage()),self.hlabel.setTitle(this.getCurrentPage())})},getVPage:function(){return this.vpager.getCurrentPage()},getHPage:function(){return this.hpager.getCurrentPage()},setVPage:function(v){this.vpager.setValue(v),this.vlabel.setValue(v),this.vlabel.setTitle(v)},setHPage:function(v){this.hpager.setValue(v),this.hlabel.setValue(v),this.hlabel.setTitle(v)},hasVNext:function(){return this.vpager.hasNext()},hasHNext:function(){return this.hpager.hasNext()},hasVPrev:function(){return this.vpager.hasPrev()},hasHPrev:function(){return this.hpager.hasPrev()},setHPagerVisible:function(b){this.hpager.setVisible(b),this.hlabel.setVisible(b)},setVPagerVisible:function(b){this.vpager.setVisible(b),this.vlabel.setVisible(b)},populate:function(){this.vpager.populate(),this.hpager.populate();var vShow=!1,hShow=!1;this.hasHNext()||this.hasHPrev()?(this.setHPagerVisible(!0),hShow=!0):this.setHPagerVisible(!1),this.hasVNext()||this.hasVPrev()?(this.setVPagerVisible(!0),vShow=!0):this.setVPagerVisible(!1),this.setVisible(hShow||vShow);var num=[86,110,0,24],items=this.layout.attr("items");vShow===!0&&hShow===!0?(items[0].right=num[0],items[1].right=num[1],items[2].right=num[2],items[3].right=num[3]):vShow===!0?(items[0].right=num[2],items[1].right=num[3]):hShow===!0&&(items[2].right=num[2],items[3].right=num[3]),this.layout.attr("items",items),this.layout.resize()},clear:function(){this.vpager.attr("curr",1),this.hpager.attr("curr",1)}}),BI.DirectionPager.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.direction_pager",BI.DirectionPager),BI.DetailPager=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.DetailPager.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-detail-pager",behaviors:{},layouts:[{type:"bi.horizontal",hgap:10,vgap:0}],dynamicShow:!0,dynamicShowFirstLast:!1,dynamicShowPrevNext:!1,pages:!1,curr:function(){return 1},groups:0,jump:BI.emptyFn,first:!1,last:!1,prev:"上一页",next:"下一页",firstPage:1,lastPage:function(){return 1},hasPrev:BI.emptyFn,hasNext:BI.emptyFn})},_init:function(){BI.DetailPager.superclass._init.apply(this,arguments);var self=this;this.currPage=BI.result(this.options,"curr"),this._lock=!1,this._debouce=BI.debounce(function(){self._lock=!1},300),this._populate()},_populate:function(){var self=this,o=this.options,view=[],dict={};this.empty();var pages=BI.result(o,"pages"),curr=BI.result(this,"currPage"),groups=BI.result(o,"groups"),first=BI.result(o,"first"),last=BI.result(o,"last"),prev=BI.result(o,"prev"),next=BI.result(o,"next");pages===!1?(groups=0,first=!1,last=!1):groups>pages&&(groups=pages),dict.index=Math.ceil((curr+(groups>1&&groups!==pages?1:0))/(0===groups?1:groups)),(!o.dynamicShow&&!o.dynamicShowPrevNext||curr>1)&&prev!==!1&&(BI.isKey(prev)?view.push({text:prev,value:"prev",disabled:pages===!1?o.hasPrev(curr)===!1:!(curr>1&&prev!==!1)}):view.push(BI.extend({disabled:pages===!1?o.hasPrev(curr)===!1:!(curr>1&&prev!==!1)},prev))),(!o.dynamicShow&&!o.dynamicShowFirstLast||dict.index>1&&0!==groups)&&first&&(view.push({text:first,value:"first",disabled:!(dict.index>1&&0!==groups)}),dict.index>1&&0!==groups&&view.push({type:"bi.label",cls:"page-ellipsis",text:"…"})),dict.poor=Math.floor((groups-1)/2),dict.start=dict.index>1?curr-dict.poor:1,dict.end=dict.index>1?function(){var max=curr+(groups-dict.poor-1);return max>pages?pages:max}():groups,dict.end-dict.start1&&0!==groups&&pages>groups&&dict.endgroups&&dict.endgroups&&dict.endgroups&&dict.end1},hasNext:function(v){v||(v=1);var o=this.options,pages=this.options.pages;return pages===!1?o.hasNext(v):vlastPage?lastPage:(firstPage=BI.result(o,"firstPage"),vo.pages?o.pages:v,this.currPage=v;this._populate()},getValue:function(){var val=this.button_group.getValue()[0];switch(val){case"prev":return-1;case"next":return 1;case"first":return BI.MIN;case"last":return BI.MAX;default:return val}},attr:function(key,value){BI.DetailPager.superclass.attr.apply(this,arguments),"curr"===key&&(this.currPage=BI.result(this.options,"curr"))},populate:function(){this._populate()}}),BI.DetailPager.EVENT_CHANGE="EVENT_CHANGE",BI.DetailPager.EVENT_AFTER_POPULATE="EVENT_AFTER_POPULATE",BI.shortcut("bi.detail_pager",BI.DetailPager),BI.SegmentButton=BI.inherit(BI.BasicButton,{_defaultConfig:function(){var conf=BI.SegmentButton.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{baseCls:(conf.baseCls||"")+" bi-segment-button bi-list-item-select",shadow:!0,readonly:!0,hgap:5})},_init:function(){BI.SegmentButton.superclass._init.apply(this,arguments);var opts=this.options,self=this;this.text=BI.createWidget({type:"bi.label",element:this,textHeight:opts.height,whiteSpace:opts.whiteSpace,text:opts.text,value:opts.value,hgap:opts.hgap})},setSelected:function(){BI.SegmentButton.superclass.setSelected.apply(this,arguments)},setText:function(text){BI.SegmentButton.superclass.setText.apply(this,arguments),this.text.setText(text)},destroy:function(){BI.SegmentButton.superclass.destroy.apply(this,arguments)}}),BI.shortcut("bi.segment_button",BI.SegmentButton),BI.Segment=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.Segment.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-segment",items:[],height:24})},_init:function(){BI.Segment.superclass._init.apply(this,arguments);var self=this,o=this.options;this.buttonGroup=BI.createWidget({element:this,type:"bi.button_group",value:o.value,items:BI.createItems(o.items,{type:"bi.segment_button",height:o.height-2,whiteSpace:o.whiteSpace}),layout:[{type:"bi.center"}]}),this.buttonGroup.on(BI.Controller.EVENT_CHANGE,function(){self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.buttonGroup.on(BI.ButtonGroup.EVENT_CHANGE,function(value,obj){self.fireEvent(BI.Segment.EVENT_CHANGE,value,obj)})},_setEnable:function(enable){BI.Segment.superclass._setEnable.apply(this,arguments),enable===!0?this.element.removeClass("base-disabled disabled"):enable===!1&&this.element.addClass("base-disabled disabled")},setValue:function(v){this.buttonGroup.setValue(v)},setEnabledValue:function(v){this.buttonGroup.setEnabledValue(v)},getValue:function(){return this.buttonGroup.getValue()}}),BI.Segment.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.segment",BI.Segment),BI.MultiSelectBar=BI.inherit(BI.BasicButton,{_defaultConfig:function(){return BI.extend(BI.MultiSelectBar.superclass._defaultConfig.apply(this,arguments),{extraCls:"bi-multi-select-bar",height:25,text:BI.i18nText("BI-Select_All"),isAllCheckedBySelectedValue:BI.emptyFn,disableSelected:!0,isHalfCheckedBySelectedValue:function(selectedValues){return selectedValues.length>0},halfSelected:!1,iconWrapperWidth:26})},_init:function(){BI.MultiSelectBar.superclass._init.apply(this,arguments);var self=this,o=this.options,isSelect=o.selected===!0,isHalfSelect=!o.selected&&o.halfSelected;this.checkbox=BI.createWidget({type:"bi.checkbox",stopPropagation:!0,handler:function(){self.setSelected(self.isSelected())},selected:isSelect,invisible:isHalfSelect}),this.half=BI.createWidget({type:"bi.half_icon_button",stopPropagation:!0,handler:function(){self.setSelected(!0)},invisible:isSelect||!isHalfSelect}),this.checkbox.on(BI.Controller.EVENT_CHANGE,function(){self.fireEvent(BI.Controller.EVENT_CHANGE,BI.Events.CLICK,self.isSelected(),self)}),this.checkbox.on(BI.Checkbox.EVENT_CHANGE,function(){self.fireEvent(BI.MultiSelectBar.EVENT_CHANGE,self.isSelected(),self)}),this.half.on(BI.Controller.EVENT_CHANGE,function(){self.fireEvent(BI.Controller.EVENT_CHANGE,BI.Events.CLICK,self.isSelected(),self)}),this.half.on(BI.HalfIconButton.EVENT_CHANGE,function(){self.fireEvent(BI.MultiSelectBar.EVENT_CHANGE,self.isSelected(),self)}),this.text=BI.createWidget({type:"bi.label",textAlign:"left",whiteSpace:"nowrap",textHeight:o.height,height:o.height,hgap:o.hgap,text:o.text,keyword:o.keyword,value:o.value,py:o.py}),BI.createWidget({type:"bi.htape",element:this,items:[{width:o.iconWrapperWidth,el:{type:"bi.center_adapt",items:[this.checkbox,this.half]}},{el:this.text}]})},_setSelected:function(v){this.checkbox.setSelected(!!v)},beforeClick:function(){var isHalf=this.isHalfSelected(),isSelected=this.isSelected();isHalf===!0?this.setSelected(!0):this.setSelected(!isSelected)},setSelected:function(v){this.checkbox.setSelected(v),this.setHalfSelected(!1)},setHalfSelected:function(b){this.halfSelected=!!b,b===!0?(this.checkbox.setSelected(!1),this.half.visible(),this.checkbox.invisible()):(this.half.invisible(),this.checkbox.visible())},isHalfSelected:function(){return!this.isSelected()&&!!this.halfSelected},isSelected:function(){return this.checkbox.isSelected()},setValue:function(selectedValues){BI.MultiSelectBar.superclass.setValue.apply(this,arguments);var isAllChecked=this.options.isAllCheckedBySelectedValue.apply(this,arguments);this._setSelected(isAllChecked),!isAllChecked&&this.setHalfSelected(this.options.isHalfCheckedBySelectedValue.apply(this,arguments))},doClick:function(){BI.MultiSelectBar.superclass.doClick.apply(this,arguments),this.isValid()&&this.fireEvent(BI.MultiSelectBar.EVENT_CHANGE,this.isSelected(),this)}}),BI.MultiSelectBar.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.multi_select_bar",BI.MultiSelectBar),BI.LevelTree=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.LevelTree.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-level-tree",el:{chooseType:0},expander:{},items:[],value:""})},_init:function(){BI.LevelTree.superclass._init.apply(this,arguments),this.initTree(this.options.items)},_formatItems:function(nodes,layer,pNode){var self=this;return BI.each(nodes,function(i,node){var extend={layer:layer};BI.isKey(node.id)||(node.id=BI.UUID()),extend.pNode=pNode,node.isParent===!0||node.parent===!0||BI.isNotEmptyArray(node.children)?(extend.type="bi.mid_plus_group_node",i===nodes.length-1&&(extend.type="bi.last_plus_group_node",extend.isLastNode=!0),0!==i||pNode||(extend.type="bi.first_plus_group_node"),0===i&&i===nodes.length-1&&(extend.type="bi.plus_group_node"),BI.defaults(node,extend),self._formatItems(node.children,layer+1,node)):(extend.type="bi.mid_tree_leaf_item",0!==i||pNode||(extend.type="bi.first_tree_leaf_item"),i===nodes.length-1&&(extend.type="bi.last_tree_leaf_item"),BI.defaults(node,extend))}),nodes},_assertId:function(sNodes){BI.each(sNodes,function(i,node){BI.isKey(node.id)||(node.id=BI.UUID())})},initTree:function(nodes){var self=this,o=this.options;this.empty(),this._assertId(nodes),this.tree=BI.createWidget({type:"bi.custom_tree",element:this,expander:BI.extend({el:{},popup:{type:"bi.custom_tree"}},o.expander),items:this._formatItems(BI.Tree.transformToTreeFormat(nodes),0),value:o.value,el:BI.extend({type:"bi.button_tree",chooseType:0,layouts:[{type:"bi.vertical"}]},o.el)}),this.tree.on(BI.Controller.EVENT_CHANGE,function(type,value,ob){self.fireEvent(BI.Controller.EVENT_CHANGE,arguments),type===BI.Events.CLICK&&self.fireEvent(BI.LevelTree.EVENT_CHANGE,value,ob)})},stroke:function(nodes){this.tree.stroke.apply(this.tree,arguments)},populate:function(items,keyword){items=this._formatItems(BI.Tree.transformToTreeFormat(items),0),this.tree.populate(items,keyword)},setValue:function(v){this.tree.setValue(v)},getValue:function(){return this.tree.getValue()},getAllLeaves:function(){return this.tree.getAllLeaves()},getNodeById:function(id){return this.tree.getNodeById(id)},getNodeByValue:function(id){return this.tree.getNodeByValue(id)}}),BI.LevelTree.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.level_tree",BI.LevelTree),BI.DisplayTree=BI.inherit(BI.TreeView,{_defaultConfig:function(){return BI.extend(BI.DisplayTree.superclass._defaultConfig.apply(this,arguments),{extraCls:"bi-display-tree"})},_init:function(){BI.DisplayTree.superclass._init.apply(this,arguments)},_configSetting:function(){function beforeCollapse(treeId,treeNode){return!1}var setting={view:{selectedMulti:!1,dblClickExpand:!1,showIcon:!1,nameIsHTML:!0,showTitle:!1},data:{key:{title:"title",name:"text"},simpleData:{enable:!0}},callback:{beforeCollapse:beforeCollapse}};return setting},_dealWidthNodes:function(nodes){nodes=BI.DisplayTree.superclass._dealWidthNodes.apply(this,arguments);var self=this,o=this.options;return BI.each(nodes,function(i,node){node.isParent=node.isParent||node.parent,null==node.text&&node.count>0&&(node.text=node.value+"("+BI.i18nText("BI-Basic_Altogether")+node.count+BI.i18nText("BI-Basic_Count")+")")}),nodes},initTree:function(nodes,setting){var setting=setting||this._configSetting();this.nodes=BI.$.fn.zTree.init(this.tree.element,setting,nodes)},destroy:function(){BI.DisplayTree.superclass.destroy.apply(this,arguments)}}),BI.DisplayTree.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.display_tree",BI.DisplayTree),BI.ListDisplayTree=BI.inherit(BI.ListTreeView,{_defaultConfig:function(){return BI.extend(BI.ListDisplayTree.superclass._defaultConfig.apply(this,arguments),{extraCls:"bi-list-display-tree"})},_init:function(){BI.ListDisplayTree.superclass._init.apply(this,arguments)},_configSetting:function(){function beforeCollapse(treeId,treeNode){return!1}function getFont(treeId,node){return node.isLeaf?{}:{color:"#999999"}}var setting={view:{selectedMulti:!1,dblClickExpand:!1,showIcon:!1,nameIsHTML:!0,showTitle:!1,fontCss:getFont},data:{key:{title:"title",name:"text"},simpleData:{enable:!0}},callback:{beforeCollapse:beforeCollapse}};return setting},_dealWidthNodes:function(nodes){nodes=BI.ListDisplayTree.superclass._dealWidthNodes.apply(this,arguments);var self=this,o=this.options;return BI.each(nodes,function(i,node){node.isParent=node.isParent||node.parent,null==node.text&&node.count>0&&(node.text=node.value+"("+BI.i18nText("BI-Basic_Altogether")+node.count+BI.i18nText("BI-Basic_Count")+")")}),nodes},initTree:function(nodes,setting){var setting=setting||this._configSetting();this.nodes=BI.$.fn.zTree.init(this.tree.element,setting,nodes)},destroy:function(){BI.ListDisplayTree.superclass.destroy.apply(this,arguments)}}),BI.ListDisplayTree.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.list_display_tree",BI.ListDisplayTree),BI.SimpleTreeView=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.SimpleTreeView.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-simple-tree",itemsCreator:BI.emptyFn,items:null})},_init:function(){BI.SimpleTreeView.superclass._init.apply(this,arguments);var self=this,o=this.options;this.structure=new BI.Tree,this.tree=BI.createWidget({type:"bi.tree_view",element:this,itemsCreator:function(op,callback){var fn=function(items){callback({items:items}),self.structure.initTree(BI.Tree.transformToTreeFormat(items))};BI.isNotNull(o.items)?fn(o.items):o.itemsCreator(op,fn)}}),this.tree.on(BI.TreeView.EVENT_CHANGE,function(){self.fireEvent(BI.SimpleTreeView.EVENT_CHANGE,arguments)}),BI.isNotEmptyArray(o.items)&&this.populate(),BI.isNotNull(o.value)&&this.setValue(o.value)},populate:function(items,keyword){items&&(this.options.items=items),this.tree.stroke({keyword:keyword})},_digest:function(v){v||(v=[]);var self=this,map={},selected=[];return BI.each(v,function(i,val){var node=self.structure.search(val,"value");if(node){var p=node;for(p=p.getParent(),p&&(map[p.value]||(map[p.value]=0),map[p.value]++);p&&p.getChildrenLength()<=map[p.value];)selected.push(p.value),p=p.getParent(),p&&(map[p.value]||(map[p.value]=0),map[p.value]++)}}),BI.makeObject(v.concat(selected))},setValue:function(v){this.tree.setValue(this._digest(v))},_getValue:function(){var self=this,result=[],val=this.tree.getValue(),track=function(nodes){BI.each(nodes,function(key,node){BI.isEmpty(node)?result.push(key):track(node)})};return track(val),result},empty:function(){this.tree.empty()},getValue:function(){var self=this,result=[],val=this._getValue();return BI.each(val,function(i,key){var target=self.structure.search(key,"value");target&&self.structure._traverse(target,function(node){node.isLeaf()&&result.push(node.value)})}),result}}),BI.SimpleTreeView.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.simple_tree",BI.SimpleTreeView),BI.EditorTrigger=BI.inherit(BI.Trigger,{_const:{hgap:4},_defaultConfig:function(){var conf=BI.EditorTrigger.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{baseCls:(conf.baseCls||"")+" bi-editor-trigger bi-border",height:24,validationChecker:BI.emptyFn,quitChecker:BI.emptyFn,allowBlank:!1,watermark:"",errorText:""})},_init:function(){this.options.height-=2,BI.EditorTrigger.superclass._init.apply(this,arguments);var self=this,o=this.options,c=this._const;this.editor=BI.createWidget({type:"bi.sign_editor",height:o.height,value:o.value,validationChecker:o.validationChecker,quitChecker:o.quitChecker,allowBlank:o.allowBlank,watermark:o.watermark,errorText:o.errorText,title:function(){return self.getValue()}}),this.editor.on(BI.Controller.EVENT_CHANGE,function(){self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.editor.on(BI.SignEditor.EVENT_CHANGE,function(){self.fireEvent(BI.EditorTrigger.EVENT_CHANGE,arguments)}),BI.createWidget({element:this,type:"bi.htape",items:[{el:this.editor},{el:{type:"bi.trigger_icon_button",width:o.triggerWidth||o.height},width:o.triggerWidth||o.height}]})},getValue:function(){return this.editor.getValue()},setValue:function(value){this.editor.setValue(value)},setText:function(text){this.editor.setState(text)}}),BI.EditorTrigger.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.editor_trigger",BI.EditorTrigger),BI.IconTrigger=BI.inherit(BI.Trigger,{_defaultConfig:function(){return BI.extend(BI.IconTrigger.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-icon-trigger",extraCls:"pull-down-font",el:{},height:24})},_init:function(){var o=this.options;BI.IconTrigger.superclass._init.apply(this,arguments),this.iconButton=BI.createWidget(o.el,{type:"bi.trigger_icon_button",element:this,width:o.width,height:o.height,extraCls:o.extraCls})}}),BI.shortcut("bi.icon_trigger",BI.IconTrigger),BI.IconTextTrigger=BI.inherit(BI.Trigger,{_const:{hgap:4},_defaultConfig:function(){var conf=BI.IconTextTrigger.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{baseCls:(conf.baseCls||"")+" bi-text-trigger",height:24,iconHeight:null,iconWidth:null,textCls:""})},_init:function(){BI.IconTextTrigger.superclass._init.apply(this,arguments);var self=this,o=this.options,c=this._const;this.text=BI.createWidget({type:"bi.label",cls:"select-text-label"+(BI.isKey(o.textCls)?" "+o.textCls:""),textAlign:"left",height:o.height,text:o.text}),this.trigerButton=BI.createWidget({type:"bi.trigger_icon_button",width:o.triggerWidth||o.height}),BI.createWidget({element:this,type:"bi.htape",ref:function(_ref){self.wrapper=_ref},items:[{el:{type:"bi.icon_change_button",cls:"icon-combo-trigger-icon",iconCls:o.iconCls,ref:function(_ref){self.icon=_ref},iconHeight:o.iconHeight,iconWidth:o.iconWidth,disableSelected:!0},width:BI.isEmptyString(o.iconCls)?0:o.iconWrapperWidth||o.height},{el:this.text,lgap:BI.isEmptyString(o.iconCls)?5:0},{el:this.trigerButton,width:o.triggerWidth||o.height}]})},setValue:function(value){this.text.setValue(value)},setIcon:function(iconCls){var o=this.options;this.icon.setIcon(iconCls);var iconItem=this.wrapper.attr("items")[0],textItem=this.wrapper.attr("items")[1];BI.isNull(iconCls)||BI.isEmptyString(iconCls)?0!==iconItem.width&&(iconItem.width=0,textItem.lgap=5,this.wrapper.resize()):iconItem.width!==(o.iconWrapperWidth||o.height)&&(iconItem.width=o.iconWrapperWidth||o.height,textItem.lgap=0,this.wrapper.resize())},setTextCls:function(cls){var o=this.options,oldCls=o.textCls;o.textCls=cls,this.text.element.removeClass(oldCls).addClass(cls)},setText:function(text){this.text.setText(text)}}),BI.shortcut("bi.icon_text_trigger",BI.IconTextTrigger),BI.SelectIconTextTrigger=BI.inherit(BI.Trigger,{_defaultConfig:function(){return BI.extend(BI.SelectIconTextTrigger.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-select-text-trigger bi-border",height:24,iconHeight:null,iconWidth:null,iconCls:""})},_init:function(){this.options.height-=2,BI.SelectIconTextTrigger.superclass._init.apply(this,arguments);var self=this,o=this.options,obj=this._digist(o.value,o.items);this.trigger=BI.createWidget({type:"bi.icon_text_trigger",element:this,text:obj.text,textCls:obj.textCls,iconCls:obj.iconCls,height:o.height,iconHeight:o.iconHeight,iconWidth:o.iconWidth,iconWrapperWidth:o.iconWrapperWidth})},_digist:function(vals,items){var o=this.options;vals=BI.isArray(vals)?vals:[vals];var result,formatItems=BI.Tree.transformToArrayFormat(items);return BI.any(formatItems,function(i,item){if(BI.deepContains(vals,item.value))return result={text:item.text||item.value,iconCls:item.iconCls},!0}),BI.isNotNull(result)?{text:result.text,textCls:"",iconCls:result.iconCls}:{text:BI.isFunction(o.text)?o.text():o.text,textCls:"bi-water-mark",iconCls:o.iconCls}},setValue:function(vals){var obj=this._digist(vals,this.options.items);this.trigger.setText(obj.text),this.trigger.setIcon(obj.iconCls),this.trigger.setTextCls(obj.textCls)},populate:function(items){this.options.items=items}}),BI.shortcut("bi.select_icon_text_trigger",BI.SelectIconTextTrigger),BI.TextTrigger=BI.inherit(BI.Trigger,{_const:{hgap:4},_defaultConfig:function(){var conf=BI.TextTrigger.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{baseCls:(conf.baseCls||"")+" bi-text-trigger",height:24,textCls:""})},_init:function(){BI.TextTrigger.superclass._init.apply(this,arguments);var self=this,o=this.options,c=this._const;this.text=BI.createWidget({type:"bi.label",cls:"select-text-label"+(BI.isKey(o.textCls)?" "+o.textCls:""),textAlign:"left",height:o.height,text:o.text,title:function(){return self.text.getText()},tipType:o.tipType,warningTitle:o.warningTitle,hgap:c.hgap,readonly:o.readonly}),this.trigerButton=BI.createWidget({type:"bi.trigger_icon_button",width:o.triggerWidth||o.height}),BI.createWidget({element:this,type:"bi.htape",items:[{el:this.text},{el:this.trigerButton,width:o.triggerWidth||o.height}]})},setTextCls:function(cls){var o=this.options,oldCls=o.textCls;o.textCls=cls,this.text.element.removeClass(oldCls).addClass(cls)},setText:function(text){this.text.setText(text)},setTipType:function(v){this.text.options.tipType=v}}),BI.shortcut("bi.text_trigger",BI.TextTrigger),BI.SelectTextTrigger=BI.inherit(BI.Trigger,{_defaultConfig:function(){return BI.extend(BI.SelectTextTrigger.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-select-text-trigger bi-border bi-focus-shadow",height:24})},_init:function(){this.options.height-=2,BI.SelectTextTrigger.superclass._init.apply(this,arguments);var self=this,o=this.options,obj=this._digest(o.value,o.items);this.trigger=BI.createWidget({type:"bi.text_trigger",element:this,height:o.height,readonly:o.readonly,text:obj.text,textCls:obj.textCls,tipType:o.tipType,warningTitle:o.warningTitle})},_digest:function(vals,items){var o=this.options;vals=BI.isArray(vals)?vals:[vals];var result=[],formatItems=BI.Tree.transformToArrayFormat(items);return BI.each(formatItems,function(i,item){BI.deepContains(vals,item.value)&&!BI.contains(result,item.text||item.value)&&result.push(item.text||item.value)}),result.length>0?{textCls:"",text:result.join(",")}:{textCls:"bi-water-mark",text:BI.isFunction(o.text)?o.text():o.text}},setValue:function(vals){var formatValue=this._digest(vals,this.options.items);this.trigger.setTextCls(formatValue.textCls),this.trigger.setText(formatValue.text)},setTipType:function(v){this.trigger.setTipType(v)},populate:function(items){this.options.items=items}}),BI.shortcut("bi.select_text_trigger",BI.SelectTextTrigger),BI.SmallSelectTextTrigger=BI.inherit(BI.Trigger,{_defaultConfig:function(){return BI.extend(BI.SmallSelectTextTrigger.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-small-select-text-trigger bi-border",height:20})},_init:function(){this.options.height-=2,BI.SmallSelectTextTrigger.superclass._init.apply(this,arguments);var self=this,o=this.options,obj=this._digest(o.value,o.items);this.trigger=BI.createWidget({type:"bi.small_text_trigger",element:this,height:o.height-2,text:obj.text,cls:obj.cls})},_digest:function(vals,items){var o=this.options;vals=BI.isArray(vals)?vals:[vals];var result=[],formatItems=BI.Tree.transformToArrayFormat(items);return BI.each(formatItems,function(i,item){BI.deepContains(vals,item.value)&&!BI.contains(result,item.text||item.value)&&result.push(item.text||item.value)}),result.length>0?{cls:"",text:result.join(",")}:{cls:"bi-water-mark",text:o.text}},setValue:function(vals){var formatValue=this._digest(vals,this.options.items);this.trigger.element.removeClass("bi-water-mark").addClass(formatValue.cls),this.trigger.setText(formatValue.text)},populate:function(items){this.options.items=items}}),BI.shortcut("bi.small_select_text_trigger",BI.SmallSelectTextTrigger),BI.SmallTextTrigger=BI.inherit(BI.Trigger,{_const:{hgap:4},_defaultConfig:function(){var conf=BI.SmallTextTrigger.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{baseCls:(conf.baseCls||"")+" bi-text-trigger",height:20})},_init:function(){BI.SmallTextTrigger.superclass._init.apply(this,arguments);var self=this,o=this.options,c=this._const;this.text=BI.createWidget({type:"bi.label",textAlign:"left",height:o.height,text:o.text,hgap:c.hgap}),this.trigerButton=BI.createWidget({type:"bi.trigger_icon_button",width:o.triggerWidth||o.height}),BI.createWidget({element:this,type:"bi.htape",items:[{el:this.text},{el:this.trigerButton,width:o.triggerWidth||o.height}]})},setValue:function(value){this.text.setValue(value)},setText:function(text){this.text.setText(text)}}),BI.shortcut("bi.small_text_trigger",BI.SmallTextTrigger),BI.MonthDateCombo=BI.inherit(BI.Trigger,{_defaultConfig:function(){return BI.extend(BI.MonthDateCombo.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-month-combo",height:24,container:null})},_init:function(){BI.MonthDateCombo.superclass._init.apply(this,arguments);var self=this,o=this.options;this.trigger=BI.createWidget({type:"bi.date_triangle_trigger"}),this.popup=BI.createWidget({type:"bi.month_popup",behaviors:o.behaviors}),this.popup.on(BI.YearPopup.EVENT_CHANGE,function(){self.setValue(self.popup.getValue())}),this.combo=BI.createWidget({type:"bi.combo",offsetStyle:"center",container:o.container,element:this,isNeedAdjustHeight:!1,isNeedAdjustWidth:!1,el:this.trigger,popup:{minWidth:85,stopPropagation:!1,el:this.popup}}),this.combo.on(BI.Combo.EVENT_CHANGE,function(){self.combo.hideView(),self.fireEvent(BI.MonthDateCombo.EVENT_CHANGE)}),this.combo.on(BI.Combo.EVENT_BEFORE_POPUPVIEW,function(){self.doBehavior()})},setValue:function(v){this.trigger.setValue(v),this.popup.setValue(v)},getValue:function(){return this.popup.getValue()}}),BI.MonthDateCombo.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.month_date_combo",BI.MonthDateCombo),BI.YearDateCombo=BI.inherit(BI.Trigger,{_defaultConfig:function(){return BI.extend(BI.YearDateCombo.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-year-combo",min:"1900-01-01",max:"2099-12-31",behaviors:{},height:24,container:null})},_init:function(){BI.YearDateCombo.superclass._init.apply(this,arguments);var self=this,o=this.options;this.trigger=BI.createWidget({type:"bi.date_triangle_trigger"}),this.popup=BI.createWidget({type:"bi.year_popup",behaviors:o.behaviors,min:o.min,max:o.max}),this.popup.on(BI.YearPopup.EVENT_CHANGE,function(){self.setValue(self.popup.getValue()),self.combo.hideView(),self.fireEvent(BI.YearDateCombo.EVENT_CHANGE)}),this.combo=BI.createWidget({type:"bi.combo",offsetStyle:"center",element:this,container:o.container,isNeedAdjustHeight:!1,isNeedAdjustWidth:!1,el:this.trigger,popup:{minWidth:100,stopPropagation:!1,el:this.popup}}),this.combo.on(BI.Combo.EVENT_CHANGE,function(){self.fireEvent(BI.YearDateCombo.EVENT_CHANGE)}),this.combo.on(BI.Combo.EVENT_BEFORE_POPUPVIEW,function(){self.doBehavior()})},setValue:function(v){this.trigger.setValue(v),this.popup.setValue(v)},getValue:function(){return this.popup.getValue()}}),BI.YearDateCombo.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.year_date_combo",BI.YearDateCombo),BI.DatePicker=BI.inherit(BI.Widget,{_defaultConfig:function(){var conf=BI.DatePicker.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{baseCls:"bi-date-picker",height:40,min:"1900-01-01",max:"2099-12-31"})},_init:function(){BI.DatePicker.superclass._init.apply(this,arguments);var self=this,o=this.options;this._year=BI.getDate().getFullYear(),this._month=BI.getDate().getMonth()+1,this.left=BI.createWidget({type:"bi.icon_button",cls:"pre-page-h-font",width:24,height:24}),this.left.on(BI.IconButton.EVENT_CHANGE,function(){1===self._month?self.setValue({year:self.year.getValue()-1,month:12}):self.setValue({year:self.year.getValue(),month:self.month.getValue()-1}),self.fireEvent(BI.DatePicker.EVENT_CHANGE),self._checkLeftValid(),self._checkRightValid()}),this.right=BI.createWidget({type:"bi.icon_button",cls:"next-page-h-font",width:24,height:24}),this.right.on(BI.IconButton.EVENT_CHANGE,function(){12===self._month?self.setValue({year:self.year.getValue()+1,month:1}):self.setValue({year:self.year.getValue(),month:self.month.getValue()+1}),self.fireEvent(BI.DatePicker.EVENT_CHANGE),self._checkLeftValid(),self._checkRightValid()}),this.year=BI.createWidget({type:"bi.year_date_combo",behaviors:o.behaviors,min:o.min,max:o.max}),this.year.on(BI.YearDateCombo.EVENT_CHANGE,function(){self.setValue({year:self.year.getValue(),month:self.month.getValue()}),self.fireEvent(BI.DatePicker.EVENT_CHANGE)}),this.month=BI.createWidget({type:"bi.month_date_combo",behaviors:o.behaviors}),this.month.on(BI.MonthDateCombo.EVENT_CHANGE,function(){self.setValue({year:self.year.getValue(),month:self.month.getValue()}),self.fireEvent(BI.DatePicker.EVENT_CHANGE)}),BI.createWidget({type:"bi.htape",element:this,items:[{el:{type:"bi.center_adapt",items:[this.left]},width:24},{type:"bi.center_adapt",items:[{el:{type:"bi.horizontal",width:120,rgap:10,items:[{el:this.year,lgap:10},this.month]}}]},{el:{type:"bi.center_adapt",items:[this.right]},width:24}]}),this.setValue({year:this._year,month:this._month})},_checkLeftValid:function(){var o=this.options,valid=!(1===this._month&&this._year===BI.parseDateTime(o.min,"%Y-%X-%d").getFullYear());return this.left.setEnable(valid),valid},_checkRightValid:function(){var o=this.options,valid=!(12===this._month&&this._year===BI.parseDateTime(o.max,"%Y-%X-%d").getFullYear());return this.right.setEnable(valid),valid},setValue:function(ob){this._year=BI.parseInt(ob.year),this._month=BI.parseInt(ob.month),this.year.setValue(ob.year),this.month.setValue(ob.month),this._checkLeftValid(),this._checkRightValid()},getValue:function(){return{year:this.year.getValue(),month:this.month.getValue()}}}),BI.DatePicker.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.date_picker",BI.DatePicker),BI.YearPicker=BI.inherit(BI.Widget,{_defaultConfig:function(){var conf=BI.YearPicker.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{baseCls:"bi-year-picker",behaviors:{},height:40,min:"1900-01-01",max:"2099-12-31"})},_init:function(){BI.YearPicker.superclass._init.apply(this,arguments);var self=this,o=this.options;this._year=BI.getDate().getFullYear(),this.left=BI.createWidget({type:"bi.icon_button",cls:"pre-page-h-font",width:25,height:25}),this.left.on(BI.IconButton.EVENT_CHANGE,function(){self.setValue(self.year.getValue()-1),self.fireEvent(BI.YearPicker.EVENT_CHANGE),self._checkLeftValid(),self._checkRightValid()}),this.right=BI.createWidget({type:"bi.icon_button",cls:"next-page-h-font",width:25,height:25}),this.right.on(BI.IconButton.EVENT_CHANGE,function(){self.setValue(self.year.getValue()+1),self.fireEvent(BI.YearPicker.EVENT_CHANGE),self._checkLeftValid(),self._checkRightValid()}),this.year=BI.createWidget({type:"bi.year_date_combo",min:o.min,behaviors:o.behaviors,max:o.max}),this.year.on(BI.YearDateCombo.EVENT_CHANGE,function(){self.setValue(self.year.getValue()),self.fireEvent(BI.YearPicker.EVENT_CHANGE)}),BI.createWidget({type:"bi.htape",element:this,items:[{el:{type:"bi.center_adapt",items:[this.left]},width:25},{type:"bi.center_adapt",items:[{el:{type:"bi.horizontal_float",width:50,items:[{el:this.year}]}}]},{el:{type:"bi.center_adapt",items:[this.right]},width:25}]}),this.setValue({year:this._year})},_checkLeftValid:function(){var o=this.options,valid=!(this._year===BI.parseDateTime(o.min,"%Y-%X-%d").getFullYear());return this.left.setEnable(valid),valid},_checkRightValid:function(){var o=this.options,valid=!(this._year===BI.parseDateTime(o.max,"%Y-%X-%d").getFullYear());return this.right.setEnable(valid),valid},setValue:function(v){this._year=v,this.year.setValue(v),this._checkLeftValid(),this._checkRightValid()},getValue:function(){return this.year.getValue()}}),BI.YearPicker.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.year_picker",BI.YearPicker),BI.DateCalendarPopup=BI.inherit(BI.Widget,{_defaultConfig:function(){var conf=BI.DateCalendarPopup.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{baseCls:"bi-date-calendar-popup",min:"1900-01-01",max:"2099-12-31",selectedTime:null})},_createNav:function(v){var date=BI.Calendar.getDateJSONByPage(v),calendar=BI.createWidget({type:"bi.calendar",logic:{dynamic:!0},min:this.options.min,max:this.options.max,year:date.year,month:date.month,day:1});return calendar},_init:function(){BI.DateCalendarPopup.superclass._init.apply(this,arguments);var self=this,o=this.options;this.today=BI.getDate(),this._year=this.today.getFullYear(),this._month=this.today.getMonth()+1,this._day=this.today.getDate(),this.selectedTime=o.selectedTime||{year:this._year,month:this._month,day:this._day},this.datePicker=BI.createWidget({type:"bi.date_picker",behaviors:o.behaviors,min:o.min,max:o.max}),this.calendar=BI.createWidget({direction:"top",logic:{ +dynamic:!0},type:"bi.navigation",tab:this.datePicker,cardCreator:BI.bind(this._createNav,this),afterCardCreated:function(){},afterCardShow:function(){this.setValue(self.selectedTime)}}),this.datePicker.on(BI.DatePicker.EVENT_CHANGE,function(){self.selectedTime=self.datePicker.getValue(),self.selectedTime.day=1,self.calendar.setSelect(BI.Calendar.getPageByDateJSON(self.selectedTime))}),this.calendar.on(BI.Navigation.EVENT_CHANGE,function(){self.selectedTime=self.calendar.getValue(),self.setValue(self.selectedTime),self.fireEvent(BI.DateCalendarPopup.EVENT_CHANGE)}),BI.createWidget({type:"bi.absolute",element:this,items:[{el:this.calendar,left:5,right:5},{el:{type:"bi.layout",cls:"bi-split-top"},height:1,top:40,left:0,right:0}]})},setValue:function(timeOb){this.datePicker.setValue(timeOb),this.calendar.setSelect(BI.Calendar.getPageByDateJSON(timeOb)),this.calendar.setValue(timeOb),this.selectedTime=timeOb},getValue:function(){return this.selectedTime}}),BI.DateCalendarPopup.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.date_calendar_popup",BI.DateCalendarPopup),BI.MonthPopup=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.MonthPopup.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-month-popup",behaviors:{}})},_init:function(){BI.MonthPopup.superclass._init.apply(this,arguments);var self=this,o=this.options,month=[1,7,2,8,3,9,4,10,5,11,6,12],items=[];items.push(month.slice(0,2)),items.push(month.slice(2,4)),items.push(month.slice(4,6)),items.push(month.slice(6,8)),items.push(month.slice(8,10)),items.push(month.slice(10,12)),items=BI.map(items,function(i,item){return BI.map(item,function(j,td){return{type:"bi.text_item",cls:"bi-list-item-select",textAlign:"center",whiteSpace:"nowrap",once:!1,forceSelected:!0,height:23,width:38,value:td,text:td}})}),this.month=BI.createWidget({type:"bi.button_group",element:this,behaviors:o.behaviors,items:BI.createItems(items,{}),layouts:[BI.LogicFactory.createLogic("table",BI.extend({dynamic:!0},{columns:2,rows:6,columnSize:[.5,.5],rowSize:25})),{type:"bi.center_adapt",vgap:1,hgap:2}],value:o.value}),this.month.on(BI.Controller.EVENT_CHANGE,function(type){self.fireEvent(BI.Controller.EVENT_CHANGE,arguments),type===BI.Events.CLICK&&self.fireEvent(BI.MonthPopup.EVENT_CHANGE)})},getValue:function(){return this.month.getValue()[0]},setValue:function(v){v=BI.parseInt(v),this.month.setValue([v])}}),BI.MonthPopup.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.month_popup",BI.MonthPopup),BI.YearPopup=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.YearPopup.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-year-popup",behaviors:{},min:"1900-01-01",max:"2099-12-31"})},_createYearCalendar:function(v){var o=this.options,y=this._year,calendar=BI.createWidget({type:"bi.year_calendar",behaviors:o.behaviors,min:o.min,max:o.max,logic:{dynamic:!0},year:y+12*v});return calendar.setValue(this._year),calendar},_init:function(){BI.YearPopup.superclass._init.apply(this,arguments);var self=this,o=this.options;this.selectedYear=this._year=BI.getDate().getFullYear();var backBtn=BI.createWidget({type:"bi.icon_button",cls:"pre-page-h-font",width:24,height:24,value:-1}),preBtn=BI.createWidget({type:"bi.icon_button",cls:"next-page-h-font",width:24,height:24,value:1});this.navigation=BI.createWidget({type:"bi.navigation",element:this,single:!0,logic:{dynamic:!0},tab:{cls:"year-popup-navigation bi-high-light bi-split-top",height:24,items:[backBtn,preBtn]},cardCreator:BI.bind(this._createYearCalendar,this),afterCardShow:function(){this.setValue(self.selectedYear);var calendar=this.getSelectedCard();backBtn.setEnable(!calendar.isFrontYear()),preBtn.setEnable(!calendar.isFinalYear())}}),this.navigation.on(BI.Navigation.EVENT_CHANGE,function(){self.selectedYear=this.getValue(),self.fireEvent(BI.Controller.EVENT_CHANGE,arguments),self.fireEvent(BI.YearPopup.EVENT_CHANGE,self.selectedYear)}),BI.isKey(o.value)&&this.setValue(o.value)},getValue:function(){return this.selectedYear},setValue:function(v){var o=this.options;v=BI.parseInt(v);var startDate=BI.parseDateTime(o.min,"%Y-%X-%d"),endDate=BI.parseDateTime(o.max,"%Y-%X-%d");BI.checkDateVoid(v,1,1,BI.print(BI.getDate(startDate.getFullYear(),0,1),"%Y-%X-%d"),BI.print(BI.getDate(endDate.getFullYear(),0,1),"%Y-%X-%d"))[0]?(v=BI.getDate().getFullYear(),this.selectedYear="",this.navigation.setSelect(BI.YearCalendar.getPageByYear(v)),this.navigation.setValue("")):(this.selectedYear=v,this.navigation.setSelect(BI.YearCalendar.getPageByYear(v)),this.navigation.setValue(v))}}),BI.YearPopup.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.year_popup",BI.YearPopup),BI.DateTriangleTrigger=BI.inherit(BI.Trigger,{_const:{height:24,iconWidth:12,iconHeight:12},_defaultConfig:function(){return BI.extend(BI.DateTriangleTrigger.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-date-triangle-trigger pull-down-ha-font cursor-pointer",height:24})},_init:function(){BI.DateTriangleTrigger.superclass._init.apply(this,arguments);var o=this.options,c=this._const;this.text=BI.createWidget({type:"bi.label",cls:"list-item-text",textAlign:"right",text:o.text,value:o.value,height:c.height}),BI.createWidget({type:"bi.vertical_adapt",element:this,items:[{el:this.text,rgap:5},{type:"bi.icon_label",width:16}]})},setValue:function(v){this.text.setValue(v)},getValue:function(){return this.text.getValue()},setText:function(v){this.text.setText(v)},getText:function(){return this.item.getText()},getKey:function(){}}),BI.shortcut("bi.date_triangle_trigger",BI.DateTriangleTrigger),BI.StaticDatePaneCard=BI.inherit(BI.Widget,{_defaultConfig:function(){var conf=BI.StaticDatePaneCard.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{baseCls:"bi-date-pane",min:"1900-01-01",max:"2099-12-31",selectedTime:null})},_init:function(){BI.StaticDatePaneCard.superclass._init.apply(this,arguments);var self=this,o=this.options;this.today=BI.getDate(),this._year=this.today.getFullYear(),this._month=this.today.getMonth()+1,this.selectedTime=o.selectedTime||{year:this._year,month:this._month},this.datePicker=BI.createWidget({type:"bi.date_picker",behaviors:o.behaviors,min:o.min,max:o.max}),this.datePicker.on(BI.DatePicker.EVENT_CHANGE,function(){var value=self.datePicker.getValue(),monthDay=BI.getMonthDays(BI.getDate(value.year,value.month-1,1)),day=self.selectedTime.day||0;day>monthDay&&(day=monthDay),self.selectedTime={year:value.year,month:value.month},0!==day&&(self.selectedTime.day=day),self.calendar.setSelect(BI.Calendar.getPageByDateJSON(self.selectedTime)),self.calendar.setValue(self.selectedTime),0!==day&&self.fireEvent(BI.DateCalendarPopup.EVENT_CHANGE)}),this.calendar=BI.createWidget({direction:"custom",type:"bi.navigation",tab:this.datePicker,cardCreator:BI.bind(this._createNav,this)}),this.calendar.on(BI.Navigation.EVENT_CHANGE,function(){self.selectedTime=self.calendar.getValue(),self.calendar.empty(),self.setValue(self.selectedTime),self.fireEvent(BI.DateCalendarPopup.EVENT_CHANGE)}),this.setValue(o.selectedTime),BI.createWidget({type:"bi.vtape",element:this,items:[{el:this.datePicker,height:40},this.calendar],hgap:10}),BI.createWidget({type:"bi.absolute",element:this,items:[{el:{type:"bi.layout",cls:"bi-split-top"},height:1,top:40,left:0,right:0}]})},_createNav:function(v){var date=BI.Calendar.getDateJSONByPage(v),calendar=BI.createWidget({type:"bi.calendar",logic:{dynamic:!1},min:this.options.min,max:this.options.max,year:date.year,month:date.month,day:this.selectedTime.day});return calendar},_getNewCurrentDate:function(){var today=BI.getDate();return{year:today.getFullYear(),month:today.getMonth()+1}},_setCalenderValue:function(date){this.calendar.setSelect(BI.Calendar.getPageByDateJSON(date)),this.calendar.setValue(date),this.selectedTime=date},_setDatePicker:function(timeOb){BI.isNull(timeOb)||BI.isNull(timeOb.year)||BI.isNull(timeOb.month)?this.datePicker.setValue(this._getNewCurrentDate()):this.datePicker.setValue(timeOb)},_setCalendar:function(timeOb){BI.isNull(timeOb)||BI.isNull(timeOb.day)?(this.calendar.empty(),this._setCalenderValue(this._getNewCurrentDate())):this._setCalenderValue(timeOb)},setValue:function(timeOb){this._setDatePicker(timeOb),this._setCalendar(timeOb)},getValue:function(){return this.selectedTime}}),BI.shortcut("bi.static_date_pane_card",BI.StaticDatePaneCard),BI.DynamicDatePane=BI.inherit(BI.Widget,{props:{baseCls:"bi-dynamic-date-pane"},render:function(){var self=this,o=this.options;return{type:"bi.vtape",items:[{el:{type:"bi.linear_segment",cls:"bi-split-bottom",height:30,items:BI.createItems([{text:BI.i18nText("BI-Multi_Date_YMD"),value:BI.DynamicDatePane.Static},{text:BI.i18nText("BI-Basic_Dynamic_Title"),value:BI.DynamicDatePane.Dynamic}],{textAlign:"center"}),listeners:[{eventName:BI.ButtonGroup.EVENT_CHANGE,action:function(){var value=this.getValue()[0];switch(self.dateTab.setSelect(value),value){case BI.DynamicDatePane.Static:var date=BI.DynamicDateHelper.getCalculation(self.dynamicPane.getValue());self.ymd.setValue({year:date.getFullYear(),month:date.getMonth()+1,day:date.getDate()});break;case BI.DynamicDatePane.Dynamic:self.dynamicPane.setValue({year:0})}self.fireEvent("EVENT_CHANGE")}}],ref:function(){self.switcher=this}},height:30},{type:"bi.tab",ref:function(){self.dateTab=this},showIndex:BI.DynamicDatePane.Static,cardCreator:function(v){switch(v){case BI.DynamicDatePane.Static:return{type:"bi.static_date_pane_card",behaviors:o.behaviors,listeners:[{eventName:"EVENT_CHANGE",action:function(){self.fireEvent("EVENT_CHANGE")}}],ref:function(){self.ymd=this}};case BI.DynamicDatePane.Dynamic:default:return{type:"bi.dynamic_date_card",listeners:[{eventName:"EVENT_CHANGE",action:function(){self._checkValue(self.getValue())&&self.fireEvent("EVENT_CHANGE")}}],ref:function(){self.dynamicPane=this}}}}}]}},mounted:function(){this.setValue(this.options.value)},_checkValueValid:function(value){return BI.isNull(value)||BI.isEmptyObject(value)||BI.isEmptyString(value)},_checkValue:function(v){switch(v.type){case BI.DynamicDateCombo.Dynamic:return BI.isNotEmptyObject(v.value);case BI.DynamicDateCombo.Static:default:return!0}},setValue:function(v){v=v||{};var type=v.type||BI.DynamicDateCombo.Static,value=v.value||v;switch(this.switcher.setValue(type),this.dateTab.setSelect(type),type){case BI.DynamicDateCombo.Dynamic:this.dynamicPane.setValue(value);break;case BI.DynamicDateCombo.Static:default:if(this._checkValueValid(value)){var date=BI.getDate();this.ymd.setValue({year:date.getFullYear(),month:date.getMonth()+1})}else this.ymd.setValue(value)}},getValue:function(){return{type:this.dateTab.getSelect(),value:this.dateTab.getValue()}}}),BI.shortcut("bi.dynamic_date_pane",BI.DynamicDatePane),BI.extend(BI.DynamicDatePane,{Static:1,Dynamic:2}),BI.DateTimeCombo=BI.inherit(BI.Single,{constants:{popupHeight:290,popupWidth:270,comboAdjustHeight:1,border:1},_defaultConfig:function(){return BI.extend(BI.DateTimeCombo.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-date-time-combo bi-border bi-border-radius",width:200,height:24,minDate:"1900-01-01",maxDate:"2099-12-31"})},_init:function(){BI.DateTimeCombo.superclass._init.apply(this,arguments);var self=this,opts=this.options,date=BI.getDate();this.storeValue=BI.isNotNull(opts.value)?opts.value:{year:date.getFullYear(),month:date.getMonth()+1,day:date.getDate(),hour:date.getHours(),minute:date.getMinutes(),second:date.getSeconds()},this.trigger=BI.createWidget({type:"bi.date_time_trigger",min:opts.minDate,max:opts.maxDate,value:opts.value}),this.popup=BI.createWidget({type:"bi.date_time_popup",behaviors:opts.behaviors,min:opts.minDate,max:opts.maxDate,value:opts.value}),self.setValue(this.storeValue),this.popup.on(BI.DateTimePopup.BUTTON_CANCEL_EVENT_CHANGE,function(){self.setValue(self.storeValue),self.hidePopupView(),self.fireEvent(BI.DateTimeCombo.EVENT_CANCEL)}),this.popup.on(BI.DateTimePopup.BUTTON_OK_EVENT_CHANGE,function(){self.storeValue=self.popup.getValue(),self.setValue(self.storeValue),self.hidePopupView(),self.fireEvent(BI.DateTimeCombo.EVENT_CONFIRM)}),this.combo=BI.createWidget({type:"bi.combo",container:opts.container,toggle:!1,isNeedAdjustHeight:!1,isNeedAdjustWidth:!1,el:this.trigger,adjustLength:this.constants.comboAdjustHeight,popup:{el:this.popup,width:this.constants.popupWidth,stopPropagation:!1},hideChecker:function(e){return 0===triggerBtn.element.find(e.target).length}}),this.combo.on(BI.Combo.EVENT_BEFORE_POPUPVIEW,function(){self.popup.setValue(self.storeValue),self.fireEvent(BI.DateTimeCombo.EVENT_BEFORE_POPUPVIEW)});var triggerBtn=BI.createWidget({type:"bi.icon_button",cls:"bi-trigger-icon-button date-font",width:24,height:24});triggerBtn.on(BI.IconButton.EVENT_CHANGE,function(){self.combo.isViewVisible()||self.combo.showView()}),BI.createWidget({type:"bi.htape",element:this,items:[{type:"bi.absolute",items:[{el:this.combo,top:0,left:0,right:0,bottom:0},{el:triggerBtn,top:0,right:0}]}]})},setValue:function(v){this.storeValue=v,this.popup.setValue(v),this.trigger.setValue(v)},getValue:function(){return this.storeValue},hidePopupView:function(){this.combo.hideView()}}),BI.DateTimeCombo.EVENT_CANCEL="EVENT_CANCEL",BI.DateTimeCombo.EVENT_CONFIRM="EVENT_CONFIRM",BI.DateTimeCombo.EVENT_CHANGE="EVENT_CHANGE",BI.DateTimeCombo.EVENT_BEFORE_POPUPVIEW="EVENT_BEFORE_POPUPVIEW",BI.shortcut("bi.date_time_combo",BI.DateTimeCombo),BI.DateTimePopup=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.DateTimePopup.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-date-time-popup",width:268,height:374})},_init:function(){BI.DateTimePopup.superclass._init.apply(this,arguments);var self=this,opts=this.options;this.cancelButton=BI.createWidget({type:"bi.text_button",cls:"multidate-popup-button bi-border-top bi-border-right",shadow:!0,text:BI.i18nText("BI-Basic_Cancel")}),this.cancelButton.on(BI.TextButton.EVENT_CHANGE,function(){self.fireEvent(BI.DateTimePopup.BUTTON_CANCEL_EVENT_CHANGE)}),this.okButton=BI.createWidget({type:"bi.text_button",cls:"multidate-popup-button bi-border-top",shadow:!0,text:BI.i18nText("BI-Basic_OK")}),this.okButton.on(BI.TextButton.EVENT_CHANGE,function(){self.fireEvent(BI.DateTimePopup.BUTTON_OK_EVENT_CHANGE)}),this.dateCombo=BI.createWidget({type:"bi.date_calendar_popup",behaviors:opts.behaviors,min:self.options.min,max:self.options.max}),self.dateCombo.on(BI.DateCalendarPopup.EVENT_CHANGE,function(){self.fireEvent(BI.DateTimePopup.CALENDAR_EVENT_CHANGE)}),this.dateButton=BI.createWidget({type:"bi.grid",items:[[this.cancelButton,this.okButton]]}),BI.createWidget({element:this,type:"bi.vtape",items:[{el:this.dateCombo},{el:{type:"bi.center_adapt",cls:"bi-split-top",items:[{type:"bi.dynamic_date_time_select",ref:function(_ref){self.timeSelect=_ref}}]},height:50},{el:this.dateButton,height:30}]}),this.setValue(opts.value)},setValue:function(v){var value=v,date;BI.isNull(value)?(date=BI.getDate(),this.dateCombo.setValue({year:date.getFullYear(),month:date.getMonth()+1,day:date.getDate()}),this.timeSelect.setValue({hour:date.getHours(),minute:date.getMinutes(),second:date.getSeconds()})):(this.dateCombo.setValue({year:value.year,month:value.month,day:value.day}),this.timeSelect.setValue({hour:value.hour,minute:value.minute,second:value.second}))},getValue:function(){return BI.extend({year:this.dateCombo.getValue().year,month:this.dateCombo.getValue().month,day:this.dateCombo.getValue().day},this.timeSelect.getValue())}}),BI.DateTimePopup.BUTTON_OK_EVENT_CHANGE="BUTTON_OK_EVENT_CHANGE",BI.DateTimePopup.BUTTON_CANCEL_EVENT_CHANGE="BUTTON_CANCEL_EVENT_CHANGE",BI.DateTimePopup.CALENDAR_EVENT_CHANGE="CALENDAR_EVENT_CHANGE",BI.shortcut("bi.date_time_popup",BI.DateTimePopup),BI.DateTimeTrigger=BI.inherit(BI.Trigger,{_const:{hgap:4},_defaultConfig:function(){return BI.extend(BI.DateTimeTrigger.superclass._defaultConfig.apply(this,arguments),{extraCls:"bi-date-time-trigger",min:"1900-01-01",max:"2099-12-31",height:24,width:200})},_init:function(){BI.DateTimeTrigger.superclass._init.apply(this,arguments);var self=this,o=this.options,c=this._const;this.text=BI.createWidget({type:"bi.label",textAlign:"left",height:o.height,width:o.width,hgap:c.hgap}),BI.createWidget({type:"bi.htape",element:this,items:[{el:this.text},{el:BI.createWidget(),width:o.height}]}),this.setValue(o.value)},_printTime:function(v){return v<10?"0"+v:v},setValue:function(v){var self=this,value=v,dateStr;if(BI.isNull(value))value=BI.getDate(),dateStr=BI.print(value,"%Y-%X-%d %H:%M:%S");else{var date=BI.getDate(value.year,value.month-1,value.day,value.hour,value.minute,value.second);dateStr=BI.print(date,"%Y-%X-%d %H:%M:%S")}this.text.setText(dateStr),this.text.setTitle(dateStr)}}),BI.shortcut("bi.date_time_trigger",BI.DateTimeTrigger),BI.StaticDateTimePaneCard=BI.inherit(BI.Widget,{_defaultConfig:function(){var conf=BI.StaticDateTimePaneCard.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{baseCls:"bi-date-time-pane",min:"1900-01-01",max:"2099-12-31",selectedTime:null})},_init:function(){BI.StaticDateTimePaneCard.superclass._init.apply(this,arguments);var self=this,o=this.options;this.today=BI.getDate(),this._year=this.today.getFullYear(),this._month=this.today.getMonth()+1,this.selectedTime=o.selectedTime||{year:this._year,month:this._month},this.datePicker=BI.createWidget({type:"bi.date_picker",behaviors:o.behaviors,min:o.min,max:o.max}),this.datePicker.on(BI.DatePicker.EVENT_CHANGE,function(){var value=self.datePicker.getValue(),monthDay=BI.getMonthDays(BI.getDate(value.year,value.month-1,1)),day=self.selectedTime.day||0;day>monthDay&&(day=monthDay),self.selectedTime=BI.extend(self.selectedTime,{year:value.year,month:value.month,day:day}),0!==day&&(self.selectedTime.day=day),self.calendar.setSelect(BI.Calendar.getPageByDateJSON(self.selectedTime)),self.calendar.setValue(self.selectedTime),0!==day&&self.fireEvent(BI.DateCalendarPopup.EVENT_CHANGE)}),this.calendar=BI.createWidget({direction:"custom",type:"bi.navigation",tab:this.datePicker,cardCreator:BI.bind(this._createNav,this)}),this.calendar.on(BI.Navigation.EVENT_CHANGE,function(){self.selectedTime=BI.extend(self.calendar.getValue(),self.timeSelect.getValue()),self.calendar.empty(),self.setValue(self.selectedTime),self.fireEvent(BI.DateCalendarPopup.EVENT_CHANGE)}),BI.createWidget({type:"bi.vtape",element:this,hgap:10,items:[{el:this.datePicker,height:40},this.calendar,{el:{type:"bi.dynamic_date_time_select",cls:"bi-split-top",ref:function(){self.timeSelect=this},listeners:[{eventName:BI.DynamicDateTimeSelect.EVENT_CONFIRM,action:function(){self.selectedTime=BI.extend(self.calendar.getValue(),self.timeSelect.getValue()),self.fireEvent("EVENT_CHANGE")}}]},height:40}]}),BI.createWidget({type:"bi.absolute",element:this,items:[{el:{type:"bi.layout",cls:"bi-split-top"},height:1,top:40,left:0,right:0}]}),this.setValue(o.selectedTime)},_createNav:function(v){var date=BI.Calendar.getDateJSONByPage(v),calendar=BI.createWidget({type:"bi.calendar",logic:{dynamic:!1},min:this.options.min,max:this.options.max,year:date.year,month:date.month,day:this.selectedTime.day});return calendar},_getNewCurrentDate:function(){var today=BI.getDate();return{year:today.getFullYear(),month:today.getMonth()+1}},_setCalenderValue:function(date){this.calendar.setSelect(BI.Calendar.getPageByDateJSON(date)),this.calendar.setValue(date),this.selectedTime=BI.extend({},this.timeSelect.getValue(),date)},_setDatePicker:function(timeOb){BI.isNull(timeOb)||BI.isNull(timeOb.year)||BI.isNull(timeOb.month)?this.datePicker.setValue(this._getNewCurrentDate()):this.datePicker.setValue(timeOb)},_setCalendar:function(timeOb){BI.isNull(timeOb)||BI.isNull(timeOb.day)?(this.calendar.empty(),this._setCalenderValue(this._getNewCurrentDate())):this._setCalenderValue(timeOb)},setValue:function(timeOb){timeOb=timeOb||{},this._setDatePicker(timeOb),this._setCalendar(timeOb),this.timeSelect.setValue({hour:timeOb.hour,minute:timeOb.minute,second:timeOb.second})},getValue:function(){return this.selectedTime}}),BI.shortcut("bi.static_date_time_pane_card",BI.StaticDateTimePaneCard),BI.DynamicDateTimePane=BI.inherit(BI.Widget,{props:{baseCls:"bi-dynamic-date-pane"},render:function(){var self=this,o=this.options;return{type:"bi.vtape",items:[{el:{type:"bi.linear_segment",cls:"bi-split-bottom",height:30,items:BI.createItems([{text:BI.i18nText("BI-Multi_Date_YMD"),value:BI.DynamicDateTimePane.Static},{text:BI.i18nText("BI-Basic_Dynamic_Title"),value:BI.DynamicDateTimePane.Dynamic}],{textAlign:"center"}),listeners:[{eventName:BI.ButtonGroup.EVENT_CHANGE,action:function(){var value=this.getValue()[0];switch(self.dateTab.setSelect(value),value){case BI.DynamicDateTimePane.Static:var date=BI.DynamicDateHelper.getCalculation(self.dynamicPane.getValue());self.ymd.setValue({year:date.getFullYear(),month:date.getMonth()+1,day:date.getDate()});break;case BI.DynamicDateTimePane.Dynamic:self.dynamicPane.setValue({year:0})}}}],ref:function(){self.switcher=this}},height:30},{type:"bi.tab",ref:function(){self.dateTab=this},showIndex:BI.DynamicDateTimePane.Static,cardCreator:function(v){switch(v){case BI.DynamicDateTimePane.Static:return{type:"bi.static_date_time_pane_card",behaviors:o.behaviors,listeners:[{eventName:"EVENT_CHANGE",action:function(){self.fireEvent("EVENT_CHANGE")}}],ref:function(){self.ymd=this}};case BI.DynamicDateTimePane.Dynamic:default:return{type:"bi.dynamic_date_card",listeners:[{eventName:"EVENT_CHANGE",action:function(){self._checkValue(self.getValue())&&self.fireEvent("EVENT_CHANGE")}}],ref:function(){self.dynamicPane=this}}}}}]}},mounted:function(){this.setValue(this.options.value)},_checkValueValid:function(value){return BI.isNull(value)||BI.isEmptyObject(value)||BI.isEmptyString(value)},_checkValue:function(v){switch(v.type){case BI.DynamicDateCombo.Dynamic:return BI.isNotEmptyObject(v.value);case BI.DynamicDateCombo.Static:default:return!0}},setValue:function(v){v=v||{};var type=v.type||BI.DynamicDateTimePane.Static,value=v.value||v;switch(this.switcher.setValue(type),this.dateTab.setSelect(type),type){case BI.DynamicDateTimePane.Dynamic:this.dynamicPane.setValue(value);break;case BI.DynamicDateTimePane.Static:default:if(this._checkValueValid(value)){var date=BI.getDate();this.ymd.setValue({year:date.getFullYear(),month:date.getMonth()+1})}else this.ymd.setValue(value)}},getValue:function(){return{type:this.dateTab.getSelect(),value:this.dateTab.getValue()}}}),BI.shortcut("bi.dynamic_date_time_pane",BI.DynamicDateTimePane),BI.extend(BI.DynamicDateTimePane,{Static:1,Dynamic:2}),BI.DownListCombo=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.DownListCombo.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-down-list-combo",height:24,items:[],adjustLength:0,direction:"bottom",trigger:"click",container:null,stopPropagation:!1,el:{}})},_init:function(){BI.DownListCombo.superclass._init.apply(this,arguments);var self=this,o=this.options;this.popupview=BI.createWidget({type:"bi.down_list_popup",items:o.items,chooseType:o.chooseType,value:o.value}),this.popupview.on(BI.DownListPopup.EVENT_CHANGE,function(value){self.fireEvent(BI.DownListCombo.EVENT_CHANGE,value),self.downlistcombo.hideView()}),this.popupview.on(BI.DownListPopup.EVENT_SON_VALUE_CHANGE,function(value,fatherValue){self.fireEvent(BI.DownListCombo.EVENT_SON_VALUE_CHANGE,value,fatherValue),self.downlistcombo.hideView()}),this.downlistcombo=BI.createWidget({element:this,type:"bi.combo",trigger:o.trigger,isNeedAdjustWidth:!1,container:o.container,adjustLength:o.adjustLength,direction:o.direction,stopPropagation:o.stopPropagation,el:BI.createWidget(o.el,{type:"bi.icon_trigger",extraCls:o.iconCls,width:o.width,height:o.height}),popup:{el:this.popupview,stopPropagation:o.stopPropagation,maxHeight:1e3,minWidth:140}}),this.downlistcombo.on(BI.Combo.EVENT_BEFORE_POPUPVIEW,function(){self.fireEvent(BI.DownListCombo.EVENT_BEFORE_POPUPVIEW)})},hideView:function(){this.downlistcombo.hideView()},showView:function(e){this.downlistcombo.showView(e)},populate:function(items){this.popupview.populate(items)},setValue:function(v){this.popupview.setValue(v)},getValue:function(){return this.popupview.getValue()}}),BI.DownListCombo.EVENT_CHANGE="EVENT_CHANGE",BI.DownListCombo.EVENT_SON_VALUE_CHANGE="EVENT_SON_VALUE_CHANGE",BI.DownListCombo.EVENT_BEFORE_POPUPVIEW="EVENT_BEFORE_POPUPVIEW",BI.shortcut("bi.down_list_combo",BI.DownListCombo),BI.DownListGroup=BI.inherit(BI.Widget,{constants:{iconCls:"check-mark-ha-font"},_defaultConfig:function(){return BI.extend(BI.DownListGroup.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-down-list-group",items:[{el:{}}]})},_init:function(){BI.DownListGroup.superclass._init.apply(this,arguments);var o=this.options,self=this;this.downlistgroup=BI.createWidget({element:this,type:"bi.button_tree",items:o.items,chooseType:0,layouts:[{type:"bi.vertical",hgap:0,vgap:0}],value:o.value}),this.downlistgroup.on(BI.Controller.EVENT_CHANGE,function(type){self.fireEvent(BI.Controller.EVENT_CHANGE,arguments),type===BI.Events.CLICK&&self.fireEvent(BI.DownListGroup.EVENT_CHANGE,arguments)})},getValue:function(){return this.downlistgroup.getValue()},setValue:function(v){this.downlistgroup.setValue(v)}}),BI.DownListGroup.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.down_list_group",BI.DownListGroup),BI.DownListItem=BI.inherit(BI.BasicButton,{_defaultConfig:function(){var conf=BI.DownListItem.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{baseCls:"bi-down-list-item bi-list-item-active",cls:"",height:24,logic:{dynamic:!0},selected:!1,iconHeight:null,iconWidth:null,textHgap:0,textVgap:0,textLgap:0,textRgap:0})},_init:function(){BI.DownListItem.superclass._init.apply(this,arguments);var self=this,o=this.options;this.text=BI.createWidget({type:"bi.label",cls:"list-item-text",textAlign:"left",hgap:o.textHgap,vgap:o.textVgap,lgap:o.textLgap,rgap:o.textRgap,text:o.text,value:o.value,keyword:o.keyword,height:o.height}),this.icon=BI.createWidget({type:"bi.center_adapt",width:36,height:o.height,items:[{el:{type:"bi.icon",width:o.iconWidth,height:o.iconHeight}}]}),BI.createWidget(BI.extend({element:this},BI.LogicFactory.createLogic(BI.LogicFactory.createLogicTypeByDirection(BI.Direction.Left),BI.extend(o.logic,{items:BI.LogicFactory.createLogicItemsByDirection(BI.Direction.Left,this.icon,this.text)}))))},setValue:function(){this.isReadOnly()||this.text.setValue.apply(this.text,arguments)},getValue:function(){return this.text.getValue()},setText:function(){this.text.setText.apply(this.text,arguments)},getText:function(){return this.text.getText()},doClick:function(){BI.DownListItem.superclass.doClick.apply(this,arguments),this.isValid()&&this.fireEvent(BI.DownListItem.EVENT_CHANGE,this.getValue(),this)},doRedMark:function(){this.text.doRedMark.apply(this.text,arguments)},unRedMark:function(){this.text.unRedMark.apply(this.text,arguments)},doHighLight:function(){this.text.doHighLight.apply(this.text,arguments)},unHighLight:function(){this.text.unHighLight.apply(this.text,arguments)}}),BI.DownListItem.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.down_list_item",BI.DownListItem),BI.DownListGroupItem=BI.inherit(BI.BasicButton,{_defaultConfig:function(){var conf=BI.DownListGroupItem.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{baseCls:(conf.baseCls||"")+" bi-down-list-group-item",logic:{dynamic:!1},iconCls1:"dot-e-font",iconCls2:"pull-right-e-font"})},_init:function(){BI.DownListGroupItem.superclass._init.apply(this,arguments);var o=this.options,self=this;this.text=BI.createWidget({type:"bi.label",cls:"list-group-item-text",textAlign:"left",text:o.text,value:o.value,height:o.height}),this.icon1=BI.createWidget({type:"bi.icon_button",cls:o.iconCls1,width:36,disableSelected:!0,selected:this._digest(o.value)}),this.icon2=BI.createWidget({type:"bi.icon_button",cls:o.iconCls2,width:24,forceNotSelected:!0});var blank=BI.createWidget({type:"bi.layout",width:24});BI.createWidget({type:"bi.absolute",element:this,items:[{el:this.icon2,top:0,bottom:0,right:0}]}),BI.createWidget(BI.extend({element:this},BI.LogicFactory.createLogic("horizontal",BI.extend(o.logic,{items:BI.LogicFactory.createLogicItemsByDirection("left",this.icon1,this.text,blank)})))),this.element.hover(function(){self.isEnabled()&&self.hover()},function(){self.isEnabled()&&self.dishover()})},_digest:function(v){var self=this,o=this.options;return v=BI.isArray(v)?v:[v],BI.any(v,function(idx,value){return BI.contains(o.childValues,value)})},hover:function(){BI.DownListGroupItem.superclass.hover.apply(this,arguments),this.icon1.element.addClass("hover"),this.icon2.element.addClass("hover")},dishover:function(){BI.DownListGroupItem.superclass.dishover.apply(this,arguments),this.icon1.element.removeClass("hover"),this.icon2.element.removeClass("hover")},doClick:function(){BI.DownListGroupItem.superclass.doClick.apply(this,arguments),this.isValid()&&this.fireEvent(BI.DownListGroupItem.EVENT_CHANGE,this.getValue())},doRedMark:function(){this.text.doRedMark.apply(this.text,arguments)},unRedMark:function(){this.text.unRedMark.apply(this.text,arguments)},setValue:function(v){this.icon1.setSelected(this._digest(v))}}),BI.DownListGroupItem.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.down_list_group_item",BI.DownListGroupItem),BI.DownListPopup=BI.inherit(BI.Pane,{constants:{nextIcon:"pull-right-e-font",height:24,iconHeight:12,iconWidth:12,hgap:0,vgap:0,border:1},_defaultConfig:function(){var conf=BI.DownListPopup.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{baseCls:"bi-down-list-popup",items:[],chooseType:BI.Selection.Multi})},_init:function(){BI.DownListPopup.superclass._init.apply(this,arguments),this.singleValues=[],this.childValueMap={},this.fatherValueMap={},this.items=BI.deepClone(this.options.items);var self=this,o=this.options,children=this._createChildren(this.items);this.popup=BI.createWidget({type:"bi.button_tree",items:BI.createItems(children,{},{adjustLength:-2}),layouts:[{type:"bi.vertical",hgap:this.constants.hgap,vgap:this.constants.vgap}],value:this._digest(o.value),chooseType:o.chooseType}),this.popup.on(BI.ButtonTree.EVENT_CHANGE,function(value,object){var changedValue=value;if(BI.isNotNull(self.childValueMap[value])?(changedValue=self.childValueMap[value],self.fireEvent(BI.DownListPopup.EVENT_SON_VALUE_CHANGE,changedValue,self.fatherValueMap[value])):self.fireEvent(BI.DownListPopup.EVENT_CHANGE,changedValue,object),!BI.contains(self.singleValues,changedValue)){var item=self.getValue(),result=[];BI.each(item,function(i,valueObject){valueObject.value!=changedValue&&result.push(valueObject)}),self.setValue(result)}}),BI.createWidget({type:"bi.vertical",element:this,items:[this.popup],vgap:5})},_createChildren:function(items){var self=this,result=[];return BI.each(items,function(i,it){var item_done={type:"bi.down_list_group",items:[]};if(BI.each(it,function(i,item){BI.isNotEmptyArray(item.children)&&!BI.isEmpty(item.el)?(item.type="bi.combo_group",item.isDefaultInit=!0,item.cls="down-list-group",item.trigger="hover",item.isNeedAdjustWidth=!1,item.el.title=item.el.title||item.el.text,item.el.type="bi.down_list_group_item",item.el.logic={dynamic:!0},item.el.height=self.constants.height,item.el.iconCls2=self.constants.nextIcon,item.popup={lgap:1,el:{type:"bi.button_tree",chooseType:0,layouts:[{type:"bi.vertical"}]},innerVGap:5,maxHeight:378},item.el.childValues=[],BI.each(item.children,function(i,child){var fatherValue=BI.deepClone(item.el.value),childValue=BI.deepClone(child.value);self.singleValues.push(child.value),child.type="bi.down_list_item",child.extraCls=" child-down-list-item",child.title=child.title||child.text,child.textRgap=10,child.isNeedAdjustWidth=!1,child.logic={dynamic:!0},child.father=fatherValue,self.fatherValueMap[self._createChildValue(fatherValue,childValue)]=fatherValue,self.childValueMap[self._createChildValue(fatherValue,childValue)]=childValue,child.value=self._createChildValue(fatherValue,childValue),item.el.childValues.push(child.value)})):(item.type="bi.down_list_item", +item.title=item.title||item.text,item.textRgap=10,item.isNeedAdjustWidth=!1,item.logic={dynamic:!0});var el_done={};el_done.el=item,item_done.items.push(el_done)}),self._isGroup(item_done.items)&&BI.each(item_done.items,function(i,item){self.singleValues.push(item.el.value)}),result.push(item_done),self._needSpliter(i,items.length)){var spliter_container=BI.createWidget({type:"bi.vertical",items:[{el:{type:"bi.layout",cls:"bi-down-list-spliter bi-split-top cursor-pointer",height:0}}],cls:"bi-down-list-spliter-container cursor-pointer",vgap:5,lgap:10,rgap:0});result.push(spliter_container)}}),result},_isGroup:function(i){return i.length>1},_needSpliter:function(i,itemLength){return i0?1:0}},setValue:function(v){v=v||{},this.position=v.position||BI.DynamicDateCard.OFFSET.CURRENT;var values=[],valuesItems=[];BI.isNotNull(v.year)&&(values.push(BI.DynamicDateCard.TYPE.YEAR),valuesItems.push(this._createValue(BI.DynamicDateCard.TYPE.YEAR,v.year))),BI.isNotNull(v.quarter)&&(values.push(BI.DynamicDateCard.TYPE.QUARTER),valuesItems.push(this._createValue(BI.DynamicDateCard.TYPE.QUARTER,v.quarter))),BI.isNotNull(v.month)&&(values.push(BI.DynamicDateCard.TYPE.MONTH),valuesItems.push(this._createValue(BI.DynamicDateCard.TYPE.MONTH,v.month))),BI.isNotNull(v.week)&&(values.push(BI.DynamicDateCard.TYPE.WEEK),valuesItems.push(this._createValue(BI.DynamicDateCard.TYPE.WEEK,v.week))),BI.isNotNull(v.day)&&(values.push(BI.DynamicDateCard.TYPE.DAY),valuesItems.push(this._createValue(BI.DynamicDateCard.TYPE.DAY,v.day))),BI.isNotNull(v.workDay)&&(values.push(BI.DynamicDateCard.TYPE.WORK_DAY),valuesItems.push(this._createValue(BI.DynamicDateCard.TYPE.WORK_DAY,v.workDay))),this.checkgroup.setValue(values),this.workDayBox.setSelected(BI.isNotNull(v.workDay)),this.resultPane.populate(this._getParamJson(valuesItems,v.position))},getValue:function(){var self=this,valueMap={},selectValues=this.checkgroup.getValue(),buttons=this.resultPane.getAllButtons();if(0!==selectValues.length&&BI.each(buttons,function(idx,button){var value=button.getValue();switch(value.dateType){case BI.DynamicDateCard.TYPE.YEAR:valueMap.year=0===value.offset?-value.value:value.value;break;case BI.DynamicDateCard.TYPE.QUARTER:valueMap.quarter=0===value.offset?-value.value:value.value;break;case BI.DynamicDateCard.TYPE.MONTH:valueMap.month=0===value.offset?-value.value:value.value;break;case BI.DynamicDateCard.TYPE.WEEK:valueMap.week=0===value.offset?-value.value:value.value;break;case BI.DynamicDateCard.TYPE.DAY:valueMap.day=0===value.offset?-value.value:value.value}BI.isNull(value.dateType)&&(valueMap.position=self.position||BI.DynamicDateCard.OFFSET.CURRENT)}),this.workDayBox.isSelected()){var value=buttons[0].getValue();valueMap.workDay=0===value.offset?-value.value:value.value}return valueMap}}),BI.shortcut("bi.dynamic_date_card",BI.DynamicDateCard),BI.extend(BI.DynamicDateCard,{TYPE:{YEAR:1,QUARTER:2,MONTH:3,WEEK:4,DAY:5,WORK_DAY:6},OFFSET:{CURRENT:1,BEGIN:2,END:3}}),BI.DynamicDateCombo=BI.inherit(BI.Single,{constants:{popupHeight:259,popupWidth:270,comboAdjustHeight:1,border:1},props:{baseCls:"bi-dynamic-date-combo bi-border bi-focus-shadow bi-border-radius",height:22,minDate:"1900-01-01",maxDate:"2099-12-31",format:"",allowEdit:!0},render:function(){var self=this,opts=this.options;this.storeTriggerValue="";var date=BI.getDate();return this.storeValue=opts.value,{type:"bi.htape",items:[{el:{type:"bi.icon_button",cls:"bi-trigger-icon-button date-change-h-font",width:opts.height,height:opts.height,ref:function(){self.changeIcon=this}},width:opts.height},{type:"bi.absolute",items:[{el:{type:"bi.combo",container:opts.container,ref:function(){self.combo=this},toggle:!1,isNeedAdjustHeight:!1,isNeedAdjustWidth:!1,el:{type:"bi.dynamic_date_trigger",min:opts.minDate,max:opts.maxDate,format:opts.format,allowEdit:opts.allowEdit,watermark:opts.watermark,height:opts.height,value:opts.value,ref:function(){self.trigger=this},listeners:[{eventName:BI.DynamicDateTrigger.EVENT_KEY_DOWN,action:function(){self.combo.isViewVisible()&&self.combo.hideView(),self.fireEvent(BI.DynamicDateCombo.EVENT_KEY_DOWN,arguments)}},{eventName:BI.DynamicDateTrigger.EVENT_STOP,action:function(){self.combo.isViewVisible()||self.combo.showView()}},{eventName:BI.DynamicDateTrigger.EVENT_FOCUS,action:function(){self.storeTriggerValue=self.trigger.getKey(),self.combo.isViewVisible()||self.combo.showView(),self.fireEvent(BI.DynamicDateCombo.EVENT_FOCUS)}},{eventName:BI.DynamicDateTrigger.EVENT_BLUR,action:function(){self.fireEvent(BI.DynamicDateCombo.EVENT_BLUR)}},{eventName:BI.DynamicDateTrigger.EVENT_ERROR,action:function(){self.storeValue={type:BI.DynamicDateCombo.Static,value:{year:date.getFullYear(),month:date.getMonth()+1}},self.fireEvent(BI.DynamicDateCombo.EVENT_ERROR)}},{eventName:BI.DynamicDateTrigger.EVENT_VALID,action:function(){self.fireEvent(BI.DynamicDateCombo.EVENT_VALID)}},{eventName:BI.DynamicDateTrigger.EVENT_CHANGE,action:function(){self.fireEvent(BI.DynamicDateCombo.EVENT_CHANGE)}},{eventName:BI.DynamicDateTrigger.EVENT_CONFIRM,action:function(){if(!self.combo.isViewVisible()){var dateStore=self.storeTriggerValue,dateObj=self.trigger.getKey();BI.isNotEmptyString(dateObj)&&!BI.isEqual(dateObj,dateStore)?(self.storeValue=self.trigger.getValue(),self.setValue(self.trigger.getValue())):BI.isEmptyString(dateObj)&&(self.storeValue=null,self.trigger.setValue()),self._checkDynamicValue(self.storeValue),self.fireEvent(BI.DynamicDateCombo.EVENT_CONFIRM)}}}]},adjustLength:this.constants.comboAdjustHeight,popup:{el:{type:"bi.dynamic_date_popup",behaviors:opts.behaviors,min:opts.minDate,max:opts.maxDate,value:opts.value,ref:function(){self.popup=this},listeners:[{eventName:BI.DynamicDatePopup.BUTTON_CLEAR_EVENT_CHANGE,action:function(){self.setValue(),self.combo.hideView(),self.fireEvent(BI.DynamicDateCombo.EVENT_CONFIRM)}},{eventName:BI.DynamicDatePopup.BUTTON_lABEL_EVENT_CHANGE,action:function(){var date=BI.getDate();self.setValue({type:BI.DynamicDateCombo.Static,value:{year:date.getFullYear(),month:date.getMonth()+1,day:date.getDate()}}),self.combo.hideView(),self.fireEvent(BI.DynamicDateCombo.EVENT_CONFIRM)}},{eventName:BI.DynamicDatePopup.BUTTON_OK_EVENT_CHANGE,action:function(){var value=self.popup.getValue();self._checkValue(value)&&self.setValue(value),self.combo.hideView(),self.fireEvent(BI.DynamicDateCombo.EVENT_CONFIRM)}},{eventName:BI.DynamicDatePopup.EVENT_CHANGE,action:function(){self.setValue(self.popup.getValue()),self.combo.hideView(),self.fireEvent(BI.DynamicDateCombo.EVENT_CONFIRM)}}]},stopPropagation:!1},hideChecker:function(e){return 0===self.triggerBtn.element.find(e.target).length},listeners:[{eventName:BI.Combo.EVENT_BEFORE_POPUPVIEW,action:function(){self.popup.setValue(self.storeValue),self.fireEvent(BI.DynamicDateCombo.EVENT_BEFORE_POPUPVIEW)}}]},top:0,left:0,right:0,bottom:0},{el:{type:"bi.icon_button",cls:"bi-trigger-icon-button date-font",width:opts.height,height:opts.height,listeners:[{eventName:BI.IconButton.EVENT_CHANGE,action:function(){self.combo.isViewVisible()||self.combo.showView()}}],ref:function(){self.triggerBtn=this}},top:0,right:0}]}],ref:function(_ref){self.comboWrapper=_ref}}},mounted:function(){this._checkDynamicValue(this.storeValue)},_checkDynamicValue:function(v){var o=this.options,type=null;switch(BI.isNotNull(v)&&(type=v.type),type){case BI.DynamicDateCombo.Dynamic:this.changeIcon.setVisible(!0),this.comboWrapper.attr("items")[0].width=o.height,this.comboWrapper.resize();break;default:this.comboWrapper.attr("items")[0].width=0,this.comboWrapper.resize(),this.changeIcon.setVisible(!1)}},_checkValue:function(v){switch(v.type){case BI.DynamicDateCombo.Dynamic:return BI.isNotEmptyObject(v.value);case BI.DynamicDateCombo.Static:default:return!0}},_defaultState:function(){},setValue:function(v){this.storeValue=v,this.trigger.setValue(v),this._checkDynamicValue(v)},getValue:function(){return this.storeValue},getKey:function(){return this.trigger.getKey()},hidePopupView:function(){this.combo.hideView()}}),BI.DynamicDateCombo.EVENT_KEY_DOWN="EVENT_KEY_DOWN",BI.DynamicDateCombo.EVENT_CONFIRM="EVENT_CONFIRM",BI.DynamicDateCombo.EVENT_FOCUS="EVENT_FOCUS",BI.DynamicDateCombo.EVENT_BLUR="EVENT_BLUR",BI.DynamicDateCombo.EVENT_CHANGE="EVENT_CHANGE",BI.DynamicDateCombo.EVENT_VALID="EVENT_VALID",BI.DynamicDateCombo.EVENT_ERROR="EVENT_ERROR",BI.DynamicDateCombo.EVENT_BEFORE_POPUPVIEW="EVENT_BEFORE_POPUPVIEW",BI.shortcut("bi.dynamic_date_combo",BI.DynamicDateCombo),BI.extend(BI.DynamicDateCombo,{Static:1,Dynamic:2}),BI.DynamicDateParamItem=BI.inherit(BI.Widget,{props:{baseCls:"bi-dynamic-date-param-item",dateType:BI.DynamicDateCard.TYPE.YEAR,value:0,offset:0,height:24},render:function(){var self=this,o=this.options;return{type:"bi.htape",items:[{el:{type:"bi.sign_editor",cls:"bi-border",height:22,validationChecker:function(v){return BI.isNaturalNumber(v)},value:o.value,ref:function(){self.editor=this},errorText:function(v){return BI.isEmptyString(v)?BI.i18nText("BI-Basic_Please_Input_Content"):BI.i18nText("BI-Please_Input_Natural_Number")},allowBlank:!1,listeners:[{eventName:BI.SignEditor.EVENT_CONFIRM,action:function(){self.fireEvent(BI.DynamicDateParamItem.EVENT_CHANGE)}}]},width:60},{el:{type:"bi.label",height:24,text:this._getText()},width:o.dateType===BI.DynamicDateCard.TYPE.WORK_DAY?60:20},{type:"bi.text_value_combo",height:24,items:[{text:BI.i18nText("BI-Basic_Front"),value:0},{text:BI.i18nText("BI-Basic_Behind"),value:1}],ref:function(){self.offsetCombo=this},container:null,value:o.offset,listeners:[{eventName:BI.TextValueCombo.EVENT_CHANGE,action:function(){self.fireEvent(BI.DynamicDateParamItem.EVENT_CHANGE)}}]}]}},_getText:function(){var text="";switch(this.options.dateType){case BI.DynamicDateCard.TYPE.YEAR:text=BI.i18nText("BI-Basic_Year");break;case BI.DynamicDateCard.TYPE.QUARTER:text=BI.i18nText("BI-Basic_Single_Quarter");break;case BI.DynamicDateCard.TYPE.MONTH:text=BI.i18nText("BI-Basic_Month");break;case BI.DynamicDateCard.TYPE.WEEK:text=BI.i18nText("BI-Basic_Week");break;case BI.DynamicDateCard.TYPE.DAY:text=BI.i18nText("BI-Basic_Day");break;case BI.DynamicDateCard.TYPE.WORK_DAY:default:text=BI.i18nText("BI-Basic_Work_Day")}return text},setValue:function(v){v=v||{},v.value=v.value||0,v.offset=v.offset||0,this.editor.setValue(v.value),this.offsetCombo.setValue(v.offset)},getValue:function(){return{dateType:this.options.dateType,value:this.editor.getValue(),offset:this.offsetCombo.getValue()[0]}}}),BI.DynamicDateParamItem.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.dynamic_date_param_item",BI.DynamicDateParamItem),BI.DynamicDatePopup=BI.inherit(BI.Widget,{constants:{tabHeight:30,buttonHeight:24},props:{baseCls:"bi-dynamic-date-popup",width:248,height:344},_init:function(){BI.DynamicDatePopup.superclass._init.apply(this,arguments);var self=this,opts=this.options,c=this.constants;this.storeValue={type:BI.DynamicDateCombo.Static},BI.createWidget({element:this,type:"bi.vtape",items:[{el:this._getTabJson()},{el:{type:"bi.grid",items:[[{type:"bi.text_button",cls:"bi-high-light bi-split-top",shadow:!0,text:BI.i18nText("BI-Basic_Clear"),textHeight:c.buttonHeight-1,listeners:[{eventName:BI.TextButton.EVENT_CHANGE,action:function(){self.fireEvent(BI.DynamicDatePopup.BUTTON_CLEAR_EVENT_CHANGE)}}]},{type:"bi.text_button",cls:"bi-split-left bi-split-right bi-high-light bi-split-top",shadow:!0,textHeight:c.buttonHeight-1,text:BI.i18nText("BI-Multi_Date_Today"),ref:function(){self.textButton=this},listeners:[{eventName:BI.TextButton.EVENT_CHANGE,action:function(){self.fireEvent(BI.DynamicDatePopup.BUTTON_lABEL_EVENT_CHANGE)}}]},{type:"bi.text_button",cls:"bi-high-light bi-split-top",textHeight:c.buttonHeight-1,shadow:!0,text:BI.i18nText("BI-Basic_OK"),listeners:[{eventName:BI.TextButton.EVENT_CHANGE,action:function(){self.fireEvent(BI.DynamicDatePopup.BUTTON_OK_EVENT_CHANGE)}}]}]]},height:24}]}),this.setValue(opts.value)},_getTabJson:function(){var self=this,o=this.options;return{type:"bi.tab",ref:function(){self.dateTab=this},tab:{type:"bi.linear_segment",cls:"bi-split-bottom",height:this.constants.tabHeight,items:BI.createItems([{text:BI.i18nText("BI-Multi_Date_YMD"),value:BI.DynamicDateCombo.Static},{text:BI.i18nText("BI-Basic_Dynamic_Title"),value:BI.DynamicDateCombo.Dynamic}],{textAlign:"center"})},cardCreator:function(v){switch(v){case BI.DynamicDateCombo.Dynamic:return{type:"bi.dynamic_date_card",listeners:[{eventName:"EVENT_CHANGE",action:function(){self._setInnerValue(self.year,v)}}],ref:function(){self.dynamicPane=this}};case BI.DynamicDateCombo.Static:default:return{type:"bi.date_calendar_popup",behaviors:o.behaviors,min:self.options.min,max:self.options.max,listeners:[{eventName:BI.DateCalendarPopup.EVENT_CHANGE,action:function(){self.fireEvent(BI.DynamicDatePopup.EVENT_CHANGE)}}],ref:function(){self.ymd=this}}}},listeners:[{eventName:BI.Tab.EVENT_CHANGE,action:function(){var v=self.dateTab.getSelect();switch(v){case BI.DynamicDateCombo.Static:var date=BI.DynamicDateHelper.getCalculation(self.dynamicPane.getValue());self.ymd.setValue({year:date.getFullYear(),month:date.getMonth()+1,day:date.getDate()}),self._setInnerValue();break;case BI.DynamicDateCombo.Dynamic:default:self.storeValue&&self.storeValue.type===BI.DynamicDateCombo.Dynamic?self.dynamicPane.setValue(self.storeValue.value):self.dynamicPane.setValue({year:0}),self._setInnerValue()}}}]}},_setInnerValue:function(){if(this.dateTab.getSelect()===BI.DynamicDateCombo.Static)this.textButton.setValue(BI.i18nText("BI-Multi_Date_Today")),this.textButton.setEnable(!0);else{var date=BI.DynamicDateHelper.getCalculation(this.dynamicPane.getValue());date=BI.print(date,"%Y-%X-%d"),this.textButton.setValue(date),this.textButton.setEnable(!1)}},_checkValueValid:function(value){return BI.isNull(value)||BI.isEmptyObject(value)||BI.isEmptyString(value)},setValue:function(v){this.storeValue=v;var self=this,type,value;switch(v=v||{},type=v.type||BI.DynamicDateCombo.Static,value=v.value||v,this.dateTab.setSelect(type),type){case BI.DynamicDateCombo.Dynamic:this.dynamicPane.setValue(value),self._setInnerValue();break;case BI.DynamicDateCombo.Static:default:if(this._checkValueValid(value)){var date=BI.getDate();this.ymd.setValue({year:date.getFullYear(),month:date.getMonth()+1,day:date.getDate()}),this.textButton.setValue(BI.i18nText("BI-Multi_Date_Today"))}else this.ymd.setValue(value),this.textButton.setValue(BI.i18nText("BI-Multi_Date_Today"));this.textButton.setEnable(!0)}},getValue:function(){return{type:this.dateTab.getSelect(),value:this.dateTab.getValue()}}}),BI.DynamicDatePopup.EVENT_CHANGE="EVENT_CHANGE",BI.DynamicDatePopup.BUTTON_OK_EVENT_CHANGE="BUTTON_OK_EVENT_CHANGE",BI.DynamicDatePopup.BUTTON_lABEL_EVENT_CHANGE="BUTTON_lABEL_EVENT_CHANGE",BI.DynamicDatePopup.BUTTON_CLEAR_EVENT_CHANGE="BUTTON_CLEAR_EVENT_CHANGE",BI.shortcut("bi.dynamic_date_popup",BI.DynamicDatePopup),BI.DynamicDateTrigger=BI.inherit(BI.Trigger,{_const:{hgap:4,vgap:2,yearLength:4,yearMonthLength:6,yearFullMonthLength:7,compareFormat:"%Y-%X-%d"},props:{extraCls:"bi-date-trigger",min:"1900-01-01",max:"2099-12-31",height:24,format:"",allowEdit:!0,watermark:""},_init:function(){BI.DynamicDateTrigger.superclass._init.apply(this,arguments);var self=this,o=this.options,c=this._const;this.storeTriggerValue="",this.editor=BI.createWidget({type:"bi.sign_editor",height:o.height,validationChecker:function(v){var formatStr=self._getStandardDateStr(v),date=formatStr.match(/\d+/g);return!BI.isKey(o.format)&&self._autoAppend(v,date),self._dateCheck(formatStr)&&BI.checkDateLegal(formatStr)&&self._checkVoid({year:0|date[0],month:0|date[1],day:0|date[2]})},quitChecker:function(){return!1},hgap:c.hgap,vgap:c.vgap,allowBlank:!0,watermark:BI.isKey(o.watermark)?o.watermark:BI.i18nText("BI-Basic_Unrestricted"),errorText:function(){var str="";return BI.isKey(o.format)||(str=self.editor.isEditing()?BI.i18nText("BI-Date_Trigger_Error_Text"):BI.i18nText("BI-Year_Trigger_Invalid_Text")),str},title:BI.bind(this._getTitle,this)}),this.editor.on(BI.SignEditor.EVENT_KEY_DOWN,function(){self.fireEvent(BI.DynamicDateTrigger.EVENT_KEY_DOWN,arguments)}),this.editor.on(BI.SignEditor.EVENT_FOCUS,function(){self.storeTriggerValue=self.getKey(),self.fireEvent(BI.DynamicDateTrigger.EVENT_FOCUS)}),this.editor.on(BI.SignEditor.EVENT_BLUR,function(){self.fireEvent(BI.DynamicDateTrigger.EVENT_BLUR)}),this.editor.on(BI.SignEditor.EVENT_STOP,function(){self.fireEvent(BI.DynamicDateTrigger.EVENT_STOP)}),this.editor.on(BI.SignEditor.EVENT_VALID,function(){self.fireEvent(BI.DynamicDateTrigger.EVENT_VALID)}),this.editor.on(BI.SignEditor.EVENT_ERROR,function(){self.fireEvent(BI.DynamicDateTrigger.EVENT_ERROR)}),this.editor.on(BI.SignEditor.EVENT_CONFIRM,function(){var value=self.editor.getValue();if(BI.isNotNull(value)&&self.editor.setState(value),BI.isNotEmptyString(value)&&!BI.isEqual(self.storeTriggerValue,self.getKey())){var formatStr=self._getStandardDateStr(value),date=formatStr.match(/\d+/g);self.storeValue={type:BI.DynamicDateCombo.Static,value:{year:0|date[0],month:0|date[1],day:0|date[2]}}}self.fireEvent(BI.DynamicDateTrigger.EVENT_CONFIRM)}),this.editor.on(BI.SignEditor.EVENT_SPACE,function(){self.editor.isValid()&&self.editor.blur()}),this.editor.on(BI.SignEditor.EVENT_START,function(){self.fireEvent(BI.DynamicDateTrigger.EVENT_START)}),this.editor.on(BI.SignEditor.EVENT_CHANGE,function(){self.fireEvent(BI.DynamicDateTrigger.EVENT_CHANGE)}),BI.createWidget({type:"bi.htape",element:this,items:[{el:this.editor},{el:BI.createWidget(),width:24}]}),!o.allowEdit&&BI.createWidget({type:"bi.absolute",element:this,items:[{el:{type:"bi.text",title:BI.bind(this._getTitle,this)},left:0,right:24,top:0,bottom:0}]}),this.setValue(o.value)},_getTitle:function(){var storeValue=this.storeValue||{},type=storeValue.type||BI.DynamicDateCombo.Static,value=storeValue.value;switch(type){case BI.DynamicDateCombo.Dynamic:var text=this._getText(value),date=BI.getDate();date=BI.DynamicDateHelper.getCalculation(value);var dateStr=BI.print(date,this._getFormatString());return BI.isEmptyString(text)?dateStr:text+":"+dateStr;case BI.DynamicDateCombo.Static:default:return BI.isNull(value)||BI.isNull(value.day)?"":BI.print(BI.getDate(value.year,value.month-1,value.day),this._getFormatString())}},_getStandardDateStr:function(v){var c=this._const,result=[0,1,2],formatArray=this._getFormatString().match(/%./g);BI.each(formatArray,function(idx,v){switch(v){case"%Y":case"%y":result[0]=idx;break;case"%X":case"%x":result[1]=idx;break;case"%d":case"%e":default:result[2]=idx}});var date=BI.parseDateTime(v,this._getFormatString());BI.print(date,this._getFormatString())===v&&(v=BI.print(date,c.compareFormat),result=[0,1,2]);var dateArray=v.match(/\d+/g),newArray=[];return BI.each(dateArray,function(idx){newArray[idx]=dateArray[result[idx]]}),newArray.length===result.length&&2===newArray[0].length?BI.print(BI.parseDateTime(newArray.join("-"),c.compareFormat),c.compareFormat):newArray.join("-")},_getFormatString:function(){return this.options.format||this._const.compareFormat},_dateCheck:function(date){return BI.print(BI.parseDateTime(date,"%Y-%x-%d"),"%Y-%x-%d")===date||BI.print(BI.parseDateTime(date,"%Y-%X-%d"),"%Y-%X-%d")===date||BI.print(BI.parseDateTime(date,"%Y-%x-%e"),"%Y-%x-%e")===date||BI.print(BI.parseDateTime(date,"%Y-%X-%e"),"%Y-%X-%e")===date},_checkVoid:function(obj){return!BI.checkDateVoid(obj.year,obj.month,obj.day,this.options.min,this.options.max)[0]},_autoAppend:function(v,dateObj){if(BI.isNotNull(dateObj)&&BI.checkDateLegal(v))switch(v.length){case this._const.yearLength:this._yearCheck(v)&&this.editor.setValue(v+"-");break;case this._const.yearMonthLength:case this._const.yearFullMonthLength:var splitMonth=v.split("-")[1];(BI.isNotNull(splitMonth)&&2===splitMonth.length||this._monthCheck(v))&&this.editor.setValue(v+"-")}},_yearCheck:function(v){var date=BI.print(BI.parseDateTime(v,this._getFormatString()),this._const.compareFormat);return BI.print(BI.parseDateTime(v,"%Y"),"%Y")===v&&date>=this.options.min&&date<=this.options.max},_monthCheck:function(v){var date=BI.parseDateTime(v,this._getFormatString()),dateStr=BI.print(date,this._const.compareFormat);return date.getMonth()>=0&&(BI.print(BI.parseDateTime(v,"%Y-%X"),"%Y-%X")===v||BI.print(BI.parseDateTime(v,"%Y-%x"),"%Y-%x")===v)&&dateStr>=this.options.min&&dateStr<=this.options.max},_setInnerValue:function(date){var dateStr=BI.print(date,this._getFormatString());this.editor.setState(dateStr),this.editor.setValue(dateStr)},_getText:function(obj){function getPositionText(baseText,position){switch(position){case BI.DynamicDateCard.OFFSET.BEGIN:return baseText+BI.i18nText("BI-Basic_Begin_Start");case BI.DynamicDateCard.OFFSET.END:return baseText+BI.i18nText("BI-Basic_End_Stop");case BI.DynamicDateCard.OFFSET.CURRENT:default:return BI.i18nText("BI-Basic_Current_Day")}}var value="",endText="";return BI.isNotNull(obj.year)&&(0!==BI.parseInt(obj.year)&&(value+=Math.abs(obj.year)+BI.i18nText("BI-Basic_Year")+(obj.year<0?BI.i18nText("BI-Basic_Front"):BI.i18nText("BI-Basic_Behind"))),endText=getPositionText(BI.i18nText("BI-Basic_Year"),obj.position)),BI.isNotNull(obj.quarter)&&(0!==BI.parseInt(obj.quarter)&&(value+=Math.abs(obj.quarter)+BI.i18nText("BI-Basic_Single_Quarter")+(obj.quarter<0?BI.i18nText("BI-Basic_Front"):BI.i18nText("BI-Basic_Behind"))),endText=getPositionText(BI.i18nText("BI-Basic_Single_Quarter"),obj.position)),BI.isNotNull(obj.month)&&(0!==BI.parseInt(obj.month)&&(value+=Math.abs(obj.month)+BI.i18nText("BI-Basic_Month")+(obj.month<0?BI.i18nText("BI-Basic_Front"):BI.i18nText("BI-Basic_Behind"))),endText=getPositionText(BI.i18nText("BI-Basic_Month"),obj.position)),BI.isNotNull(obj.week)&&(0!==BI.parseInt(obj.week)&&(value+=Math.abs(obj.week)+BI.i18nText("BI-Basic_Week")+(obj.week<0?BI.i18nText("BI-Basic_Front"):BI.i18nText("BI-Basic_Behind"))),endText=getPositionText(BI.i18nText("BI-Basic_Week"),obj.position)),BI.isNotNull(obj.day)&&(0!==BI.parseInt(obj.day)&&(value+=Math.abs(obj.day)+BI.i18nText("BI-Basic_Day")+(obj.day<0?BI.i18nText("BI-Basic_Front"):BI.i18nText("BI-Basic_Behind"))),endText=1===BI.size(obj)?getPositionText(BI.i18nText("BI-Basic_Month"),obj.position):""),BI.isNotNull(obj.workDay)&&0!==BI.parseInt(obj.workDay)&&(value+=Math.abs(obj.workDay)+BI.i18nText("BI-Basic_Work_Day")+(obj.workDay<0?BI.i18nText("BI-Basic_Front"):BI.i18nText("BI-Basic_Behind"))),value+endText},setValue:function(v){var type,value,self=this,date=BI.getDate();switch(this.storeValue=v,BI.isNotNull(v)&&(type=v.type||BI.DynamicDateCombo.Static,value=v.value||v),type){case BI.DynamicDateCombo.Dynamic:var text=this._getText(value);date=BI.DynamicDateHelper.getCalculation(value),this._setInnerValue(date,text);break;case BI.DynamicDateCombo.Static:default:if(BI.isNull(value)||BI.isNull(value.day))this.editor.setState(""),this.editor.setValue("");else{var dateStr=BI.print(BI.getDate(value.year,value.month-1,value.day),this._getFormatString());this.editor.setState(dateStr),this.editor.setValue(dateStr)}}},getKey:function(){return this.editor.getValue()},getValue:function(){return this.storeValue}}),BI.DynamicDateTrigger.EVENT_BLUR="EVENT_BLUR",BI.DynamicDateTrigger.EVENT_FOCUS="EVENT_FOCUS",BI.DynamicDateTrigger.EVENT_START="EVENT_START",BI.DynamicDateTrigger.EVENT_STOP="EVENT_STOP",BI.DynamicDateTrigger.EVENT_CONFIRM="EVENT_CONFIRM",BI.DynamicDateTrigger.EVENT_CHANGE="EVENT_CHANGE", +BI.DynamicDateTrigger.EVENT_VALID="EVENT_VALID",BI.DynamicDateTrigger.EVENT_ERROR="EVENT_ERROR",BI.DynamicDateTrigger.EVENT_TRIGGER_CLICK="EVENT_TRIGGER_CLICK",BI.DynamicDateTrigger.EVENT_KEY_DOWN="EVENT_KEY_DOWN",BI.shortcut("bi.dynamic_date_trigger",BI.DynamicDateTrigger),BI.DynamicDateTimeCombo=BI.inherit(BI.Single,{constants:{popupHeight:259,popupWidth:270,comboAdjustHeight:1,border:1},props:{baseCls:"bi-dynamic-date-combo bi-border bi-focus-shadow bi-border-radius",height:22,minDate:"1900-01-01",maxDate:"2099-12-31",format:"",allowEdit:!0},render:function(){var self=this,opts=this.options;this.storeTriggerValue="";var date=BI.getDate();return this.storeValue=opts.value,{type:"bi.htape",items:[{el:{type:"bi.icon_button",cls:"bi-trigger-icon-button date-change-h-font",width:opts.height,height:opts.height,ref:function(){self.changeIcon=this}},width:opts.height},{type:"bi.absolute",items:[{el:{type:"bi.combo",container:opts.container,ref:function(){self.combo=this},toggle:!1,isNeedAdjustHeight:!1,isNeedAdjustWidth:!1,el:{type:"bi.dynamic_date_time_trigger",min:opts.minDate,max:opts.maxDate,allowEdit:opts.allowEdit,watermark:opts.watermark,format:opts.format,height:opts.height,value:opts.value,ref:function(){self.trigger=this},listeners:[{eventName:BI.DynamicDateTimeTrigger.EVENT_KEY_DOWN,action:function(){self.combo.isViewVisible()&&self.combo.hideView(),self.fireEvent(BI.DynamicDateTimeCombo.EVENT_KEY_DOWN,arguments)}},{eventName:BI.DynamicDateTimeTrigger.EVENT_STOP,action:function(){self.combo.isViewVisible()||self.combo.showView()}},{eventName:BI.DynamicDateTimeTrigger.EVENT_TRIGGER_CLICK,action:function(){self.combo.toggle()}},{eventName:BI.DynamicDateTimeTrigger.EVENT_FOCUS,action:function(){self.storeTriggerValue=self.trigger.getKey(),self.combo.isViewVisible()||self.combo.showView(),self.fireEvent(BI.DynamicDateTimeCombo.EVENT_FOCUS)}},{eventName:BI.DynamicDateTimeTrigger.EVENT_BLUR,action:function(){self.fireEvent(BI.DynamicDateTimeCombo.EVENT_BLUR)}},{eventName:BI.DynamicDateTimeTrigger.EVENT_ERROR,action:function(){self.storeValue={type:BI.DynamicDateTimeCombo.Static,value:{year:date.getFullYear(),month:date.getMonth()+1}},self.fireEvent(BI.DynamicDateTimeCombo.EVENT_ERROR)}},{eventName:BI.DynamicDateTimeTrigger.EVENT_VALID,action:function(){self.fireEvent(BI.DynamicDateTimeCombo.EVENT_VALID)}},{eventName:BI.DynamicDateTimeTrigger.EVENT_CHANGE,action:function(){self.fireEvent(BI.DynamicDateTimeCombo.EVENT_CHANGE)}},{eventName:BI.DynamicDateTimeTrigger.EVENT_CONFIRM,action:function(){if(!self.combo.isViewVisible()){var dateStore=self.storeTriggerValue,dateObj=self.trigger.getKey();BI.isNotEmptyString(dateObj)&&!BI.isEqual(dateObj,dateStore)?(self.storeValue=self.trigger.getValue(),self.setValue(self.trigger.getValue())):BI.isEmptyString(dateObj)&&(self.storeValue=null,self.trigger.setValue()),self._checkDynamicValue(self.storeValue),self.fireEvent(BI.DynamicDateTimeCombo.EVENT_CONFIRM)}}}]},adjustLength:this.constants.comboAdjustHeight,popup:{el:{type:"bi.dynamic_date_time_popup",behaviors:opts.behaviors,min:opts.minDate,max:opts.maxDate,value:opts.value,ref:function(){self.popup=this},listeners:[{eventName:BI.DynamicDateTimePopup.BUTTON_CLEAR_EVENT_CHANGE,action:function(){self.setValue(),self.combo.hideView(),self.fireEvent(BI.DynamicDateTimeCombo.EVENT_CONFIRM)}},{eventName:BI.DynamicDateTimePopup.BUTTON_lABEL_EVENT_CHANGE,action:function(){var date=BI.getDate();self.setValue({type:BI.DynamicDateTimeCombo.Static,value:{year:date.getFullYear(),month:date.getMonth()+1,day:date.getDate(),hour:0,minute:0,second:0}}),self.combo.hideView(),self.fireEvent(BI.DynamicDateTimeCombo.EVENT_CONFIRM)}},{eventName:BI.DynamicDateTimePopup.BUTTON_OK_EVENT_CHANGE,action:function(){var value=self.popup.getValue();self._checkValue(value)&&self.setValue(value),self.combo.hideView(),self.fireEvent(BI.DynamicDateTimeCombo.EVENT_CONFIRM)}},{eventName:BI.DynamicDateTimePopup.EVENT_CHANGE,action:function(){self.setValue(self.popup.getValue()),self.combo.hideView(),self.fireEvent(BI.DynamicDateTimeCombo.EVENT_CONFIRM)}}]},stopPropagation:!1},listeners:[{eventName:BI.Combo.EVENT_BEFORE_POPUPVIEW,action:function(){self.popup.setValue(self.storeValue),self.fireEvent(BI.DynamicDateTimeCombo.EVENT_BEFORE_POPUPVIEW)}}],hideChecker:function(e){return 0===self.triggerBtn.element.find(e.target).length}},top:0,left:0,right:0,bottom:0},{el:{type:"bi.icon_button",cls:"bi-trigger-icon-button date-font",width:opts.height,height:opts.height,listeners:[{eventName:BI.IconButton.EVENT_CHANGE,action:function(){self.combo.isViewVisible()||self.combo.showView()}}],ref:function(){self.triggerBtn=this}},top:0,right:0}]}],ref:function(_ref){self.comboWrapper=_ref}}},mounted:function(){this._checkDynamicValue(this.storeValue)},_checkDynamicValue:function(v){var o=this.options,type=null;switch(BI.isNotNull(v)&&(type=v.type),type){case BI.DynamicDateTimeCombo.Dynamic:this.changeIcon.setVisible(!0),this.comboWrapper.attr("items")[0].width=o.height,this.comboWrapper.resize();break;default:this.comboWrapper.attr("items")[0].width=0,this.comboWrapper.resize(),this.changeIcon.setVisible(!1)}},_checkValue:function(v){switch(v.type){case BI.DynamicDateCombo.Dynamic:return BI.isNotEmptyObject(v.value);case BI.DynamicDateCombo.Static:default:return!0}},setValue:function(v){this.storeValue=v,this.trigger.setValue(v),this._checkDynamicValue(v)},getValue:function(){return this.storeValue},getKey:function(){return this.trigger.getKey()},hidePopupView:function(){this.combo.hideView()},isValid:function(){return this.trigger.isValid()}}),BI.DynamicDateTimeCombo.EVENT_KEY_DOWN="EVENT_KEY_DOWN",BI.DynamicDateTimeCombo.EVENT_CONFIRM="EVENT_CONFIRM",BI.DynamicDateTimeCombo.EVENT_FOCUS="EVENT_FOCUS",BI.DynamicDateTimeCombo.EVENT_BLUR="EVENT_BLUR",BI.DynamicDateTimeCombo.EVENT_CHANGE="EVENT_CHANGE",BI.DynamicDateTimeCombo.EVENT_VALID="EVENT_VALID",BI.DynamicDateTimeCombo.EVENT_ERROR="EVENT_ERROR",BI.DynamicDateTimeCombo.EVENT_BEFORE_POPUPVIEW="EVENT_BEFORE_POPUPVIEW",BI.shortcut("bi.dynamic_date_time_combo",BI.DynamicDateTimeCombo),BI.extend(BI.DynamicDateTimeCombo,{Static:1,Dynamic:2}),BI.DynamicDateTimePopup=BI.inherit(BI.Widget,{constants:{tabHeight:30,buttonHeight:24},props:{baseCls:"bi-dynamic-date-time-popup",width:248,height:385},_init:function(){BI.DynamicDateTimePopup.superclass._init.apply(this,arguments);var self=this,opts=this.options,c=this.constants;this.storeValue={type:BI.DynamicDateCombo.Static},BI.createWidget({element:this,type:"bi.vtape",items:[{el:this._getTabJson()},{el:{type:"bi.grid",items:[[{type:"bi.text_button",cls:"bi-high-light bi-split-top",textHeight:c.buttonHeight-1,shadow:!0,text:BI.i18nText("BI-Basic_Clear"),listeners:[{eventName:BI.TextButton.EVENT_CHANGE,action:function(){self.fireEvent(BI.DynamicDateTimePopup.BUTTON_CLEAR_EVENT_CHANGE)}}]},{type:"bi.text_button",cls:"bi-split-left bi-split-right bi-high-light bi-split-top",textHeight:c.buttonHeight-1,shadow:!0,text:BI.i18nText("BI-Multi_Date_Today"),ref:function(){self.textButton=this},listeners:[{eventName:BI.TextButton.EVENT_CHANGE,action:function(){self.fireEvent(BI.DynamicDateTimePopup.BUTTON_lABEL_EVENT_CHANGE)}}]},{type:"bi.text_button",cls:"bi-high-light bi-split-top",textHeight:c.buttonHeight-1,shadow:!0,text:BI.i18nText("BI-Basic_OK"),listeners:[{eventName:BI.TextButton.EVENT_CHANGE,action:function(){self.fireEvent(BI.DynamicDateTimePopup.BUTTON_OK_EVENT_CHANGE)}}]}]]},height:24}]}),this.setValue(opts.value)},_getTabJson:function(){var self=this,o=this.options;return{type:"bi.tab",ref:function(){self.dateTab=this},tab:{type:"bi.linear_segment",cls:"bi-split-bottom",height:this.constants.tabHeight,items:BI.createItems([{text:BI.i18nText("BI-Multi_Date_YMD"),value:BI.DynamicDateCombo.Static},{text:BI.i18nText("BI-Basic_Dynamic_Title"),value:BI.DynamicDateCombo.Dynamic}],{textAlign:"center"})},cardCreator:function(v){switch(v){case BI.DynamicDateCombo.Dynamic:return{type:"bi.dynamic_date_card",listeners:[{eventName:"EVENT_CHANGE",action:function(){self._setInnerValue(self.year,v)}}],ref:function(){self.dynamicPane=this}};case BI.DynamicDateCombo.Static:default:return{type:"bi.vtape",items:[{type:"bi.date_calendar_popup",behaviors:o.behaviors,min:self.options.min,max:self.options.max,ref:function(){self.ymd=this}},{el:{type:"bi.dynamic_date_time_select",cls:"bi-split-top",ref:function(){self.timeSelect=this}},height:40}]}}},listeners:[{eventName:BI.Tab.EVENT_CHANGE,action:function(){var v=self.dateTab.getSelect();switch(v){case BI.DynamicDateCombo.Static:var date=BI.DynamicDateHelper.getCalculation(self.dynamicPane.getValue());self.ymd.setValue({year:date.getFullYear(),month:date.getMonth()+1,day:date.getDate()}),self.timeSelect.setValue(),self._setInnerValue();break;case BI.DynamicDateCombo.Dynamic:default:self.storeValue&&self.storeValue.type===BI.DynamicDateCombo.Dynamic?self.dynamicPane.setValue(self.storeValue.value):self.dynamicPane.setValue({year:0}),self._setInnerValue()}}}]}},_setInnerValue:function(){if(this.dateTab.getSelect()===BI.DynamicDateCombo.Static)this.textButton.setValue(BI.i18nText("BI-Multi_Date_Today")),this.textButton.setEnable(!0);else{var date=BI.DynamicDateHelper.getCalculation(this.dynamicPane.getValue());date=BI.print(date,"%Y-%X-%d"),this.textButton.setValue(date),this.textButton.setEnable(!1)}},_checkValueValid:function(value){return BI.isNull(value)||BI.isEmptyObject(value)||BI.isEmptyString(value)},setValue:function(v){this.storeValue=v;var self=this,type,value;switch(v=v||{},type=v.type||BI.DynamicDateCombo.Static,value=v.value||v,this.dateTab.setSelect(type),type){case BI.DynamicDateCombo.Dynamic:this.dynamicPane.setValue(value),self._setInnerValue();break;case BI.DynamicDateCombo.Static:default:if(this._checkValueValid(value)){var date=BI.getDate();this.ymd.setValue({year:date.getFullYear(),month:date.getMonth()+1,day:date.getDate()}),this.timeSelect.setValue(),this.textButton.setValue(BI.i18nText("BI-Multi_Date_Today"))}else this.ymd.setValue(value),this.timeSelect.setValue({hour:value.hour,minute:value.minute,second:value.second}),this.textButton.setValue(BI.i18nText("BI-Multi_Date_Today"));this.textButton.setEnable(!0)}},getValue:function(){var type=this.dateTab.getSelect();return{type:type,value:type===BI.DynamicDateTimeCombo.Static?BI.extend(this.ymd.getValue(),this.timeSelect.getValue()):this.dynamicPane.getValue()}}}),BI.DynamicDateTimePopup.EVENT_CHANGE="EVENT_CHANGE",BI.DynamicDateTimePopup.BUTTON_OK_EVENT_CHANGE="BUTTON_OK_EVENT_CHANGE",BI.DynamicDateTimePopup.BUTTON_lABEL_EVENT_CHANGE="BUTTON_lABEL_EVENT_CHANGE",BI.DynamicDateTimePopup.BUTTON_CLEAR_EVENT_CHANGE="BUTTON_CLEAR_EVENT_CHANGE",BI.shortcut("bi.dynamic_date_time_popup",BI.DynamicDateTimePopup),BI.DynamicDateTimeSelect=BI.inherit(BI.Widget,{props:{baseCls:"bi-date-time-select"},render:function(){var self=this;return{type:"bi.center_adapt",items:[{type:"bi.vertical_adapt",items:[{el:{type:"bi.number_editor",ref:function(){self.hour=this},validationChecker:function(v){return BI.isNaturalNumber(v)&&BI.parseInt(v)<24},errorText:function(v){return BI.isNumeric(v)?BI.i18nText("BI-Basic_Input_From_To_Number",'"00-23"'):BI.i18nText("BI-Numerical_Interval_Input_Data")},listeners:[{eventName:BI.SignEditor.EVENT_CONFIRM,action:function(){var value=this.getValue();self._checkHour(value),this.setValue(self._formatValueToDoubleDigit(value)),self.fireEvent(BI.DynamicDateTimeSelect.EVENT_CONFIRM)}},{eventName:BI.SignEditor.EVENT_CHANGE,action:function(){var value=self._autoSwitch(this.getValue(),BI.DynamicDateTimeSelect.HOUR);this.setValue(value)}}],width:60,height:24}},{type:"bi.label",text:":",width:20},{type:"bi.number_editor",ref:function(){self.minute=this},validationChecker:function(v){return BI.isNaturalNumber(v)&&BI.parseInt(v)<60},errorText:function(v){return BI.isNumeric(v)?BI.i18nText("BI-Basic_Input_From_To_Number",'"00-59"'):BI.i18nText("BI-Numerical_Interval_Input_Data")},listeners:[{eventName:BI.SignEditor.EVENT_CONFIRM,action:function(){var value=this.getValue();self._checkMinute(value),this.setValue(self._formatValueToDoubleDigit(value),BI.DynamicDateTimeSelect.MINUTE),self.fireEvent(BI.DynamicDateTimeSelect.EVENT_CONFIRM)}},{eventName:BI.SignEditor.EVENT_CHANGE,action:function(){var value=self._autoSwitch(this.getValue(),BI.DynamicDateTimeSelect.MINUTE);this.setValue(value)}}],width:60,height:24},{type:"bi.label",text:":",width:20},{type:"bi.number_editor",ref:function(){self.second=this},validationChecker:function(v){return BI.isNaturalNumber(v)&&BI.parseInt(v)<60},errorText:function(v){return BI.isNumeric(v)?BI.i18nText("BI-Basic_Input_From_To_Number",'"00-59"'):BI.i18nText("BI-Numerical_Interval_Input_Data")},listeners:[{eventName:BI.SignEditor.EVENT_CONFIRM,action:function(){var value=this.getValue();self._checkSecond(value),this.setValue(self._formatValueToDoubleDigit(value)),self.fireEvent(BI.DynamicDateTimeSelect.EVENT_CONFIRM)}}],width:60,height:24}]}]}},_checkBorder:function(v){v=v||{},this._checkHour(v.hour),this._checkMinute(v.minute),this._checkSecond(v.second)},_checkHour:function(value){this.hour.setDownEnable(BI.parseInt(value)>0),this.hour.setUpEnable(BI.parseInt(value)<23)},_checkMinute:function(value){this.minute.setDownEnable(BI.parseInt(value)>0),this.minute.setUpEnable(BI.parseInt(value)<59)},_checkSecond:function(value){this.second.setDownEnable(BI.parseInt(value)>0),this.second.setUpEnable(BI.parseInt(value)<59)},_autoSwitch:function(v,type){var limit=0,value=v+"";switch(type){case BI.DynamicDateTimeSelect.HOUR:limit=2;break;case BI.DynamicDateTimeSelect.MINUTE:limit=5}if(1===value.length&&BI.parseInt(value)>limit&&(value="0"+value),2===value.length)switch(type){case BI.DynamicDateTimeSelect.HOUR:this.hour.isEditing()&&this.minute.focus();break;case BI.DynamicDateTimeSelect.MINUTE:this.minute.isEditing()&&this.second.focus();break;case BI.DynamicDateTimeSelect.SECOND:}return value},_formatValueToDoubleDigit:function(v){(BI.isNull(v)||BI.isEmptyString(v))&&(v=0);var value=BI.parseInt(v);return value<10&&(value="0"+value),value},_assertValue:function(v){return v=v||{},v.hour=this._formatValueToDoubleDigit(v.hour)||"00",v.minute=this._formatValueToDoubleDigit(v.minute)||"00",v.second=this._formatValueToDoubleDigit(v.second)||"00",v},getValue:function(){return{hour:BI.parseInt(this.hour.getValue()),minute:BI.parseInt(this.minute.getValue()),second:BI.parseInt(this.second.getValue())}},setValue:function(v){v=this._assertValue(v),this.hour.setValue(v.hour),this.minute.setValue(v.minute),this.second.setValue(v.second),this._checkBorder(v)}}),BI.DynamicDateTimeSelect.EVENT_CONFIRM="EVENT_CONFIRM",BI.shortcut("bi.dynamic_date_time_select",BI.DynamicDateTimeSelect),BI.extend(BI.DynamicDateTimeSelect,{HOUR:1,MINUTE:2,SECOND:3}),BI.DynamicDateTimeTrigger=BI.inherit(BI.Trigger,{_const:{hgap:4,vgap:2,yearLength:4,yearMonthLength:6,yearFullMonthLength:7,compareFormat:"%Y-%X-%d %H:%M:%S"},props:{extraCls:"bi-date-time-trigger",min:"1900-01-01",max:"2099-12-31",height:24,format:"",allowEdit:!0,watermark:""},_init:function(){BI.DynamicDateTimeTrigger.superclass._init.apply(this,arguments);var self=this,o=this.options,c=this._const;this.storeTriggerValue="",this.editor=BI.createWidget({type:"bi.sign_editor",height:o.height,validationChecker:function(v){var formatStr=self._getStandardDateStr(v),date=formatStr.match(/\d+/g);return!BI.isKey(o.format)&&self._autoAppend(v,date),self._dateCheck(formatStr)&&BI.checkDateLegal(formatStr)&&self._checkVoid({year:0|date[0],month:0|date[1],day:0|date[2]})},quitChecker:function(){return!1},hgap:c.hgap,vgap:c.vgap,allowBlank:!0,watermark:BI.isKey(o.watermark)?o.watermark:BI.i18nText("BI-Basic_Unrestricted"),errorText:function(){var str="";return BI.isKey(o.format)||(str=self.editor.isEditing()?BI.i18nText("BI-Basic_Date_Time_Error_Text"):BI.i18nText("BI-Year_Trigger_Invalid_Text")),str},title:BI.bind(this._getTitle,this)}),this.editor.on(BI.SignEditor.EVENT_KEY_DOWN,function(){self.fireEvent(BI.DynamicDateTimeTrigger.EVENT_KEY_DOWN,arguments)}),this.editor.on(BI.SignEditor.EVENT_FOCUS,function(){self.storeTriggerValue=self.getKey(),self.fireEvent(BI.DynamicDateTimeTrigger.EVENT_FOCUS)}),this.editor.on(BI.SignEditor.EVENT_BLUR,function(){self.fireEvent(BI.DynamicDateTimeTrigger.EVENT_BLUR)}),this.editor.on(BI.SignEditor.EVENT_STOP,function(){self.fireEvent(BI.DynamicDateTimeTrigger.EVENT_STOP)}),this.editor.on(BI.SignEditor.EVENT_VALID,function(){self.fireEvent(BI.DynamicDateTimeTrigger.EVENT_VALID)}),this.editor.on(BI.SignEditor.EVENT_ERROR,function(){self.fireEvent(BI.DynamicDateTimeTrigger.EVENT_ERROR)}),this.editor.on(BI.SignEditor.EVENT_CONFIRM,function(){var value=self.editor.getValue();if(BI.isNotNull(value)&&self.editor.setState(value),BI.isNotEmptyString(value)&&!BI.isEqual(self.storeTriggerValue,self.getKey())){var formatStr=self._getStandardDateStr(value),date=formatStr.match(/\d+/g);self.storeValue={type:BI.DynamicDateCombo.Static,value:{year:0|date[0],month:0|date[1],day:0|date[2],hour:0|date[3],minute:0|date[4],second:0|date[5]}}}self.fireEvent(BI.DynamicDateTimeTrigger.EVENT_CONFIRM)}),this.editor.on(BI.SignEditor.EVENT_START,function(){self.fireEvent(BI.DynamicDateTimeTrigger.EVENT_START)}),this.editor.on(BI.SignEditor.EVENT_CHANGE,function(){self.fireEvent(BI.DynamicDateTimeTrigger.EVENT_CHANGE)}),BI.createWidget({type:"bi.htape",element:this,items:[{el:this.editor},{el:BI.createWidget(),width:24}]}),!o.allowEdit&&BI.createWidget({type:"bi.absolute",element:this,items:[{el:{type:"bi.text",title:BI.bind(this._getTitle,this)},left:0,right:24,top:0,bottom:0}]}),this.setValue(o.value)},_getTitle:function(){var storeValue=this.storeValue||{},type=storeValue.type||BI.DynamicDateCombo.Static,value=storeValue.value;switch(type){case BI.DynamicDateCombo.Dynamic:var text=this._getText(value),date=BI.DynamicDateHelper.getCalculation(value),dateStr=BI.print(date,this._getFormatString());return BI.isEmptyString(text)?dateStr:text+":"+dateStr;case BI.DynamicDateCombo.Static:default:return BI.isNull(value)||BI.isNull(value.day)?"":BI.print(BI.getDate(value.year,value.month-1,value.day,value.hour||0,value.minute||0,value.second||0),this._getFormatString())}},_getStandardDateStr:function(v){var c=this._const,result=[],hasSecond=!1,formatArray=this._getFormatString().match(/%./g);BI.each(formatArray,function(idx,v){switch(v){case"%Y":case"%y":result[0]=idx;break;case"%X":case"%x":result[1]=idx;break;case"%d":case"%e":result[2]=idx;break;case"%S":hasSecond=!0}});var date=BI.parseDateTime(v,this._getFormatString());BI.print(date,this._getFormatString())===v&&(v=BI.print(date,c.compareFormat),result=[0,1,2]);var dateArray=v.match(/\d+/g)||[],newArray=[];BI.each(dateArray.slice(0,3),function(idx){newArray[idx]=dateArray[result[idx]]});var suffixArray=dateArray.slice(3);BI.each(suffixArray,function(idx,v){BI.isNumeric(v)&&1===v.length&&(suffixArray[idx]="0"+v)}),2!==suffixArray.length||hasSecond||suffixArray.push("00");var suffixString=suffixArray.join(":"),dateString=newArray.slice(0,3).join("-");return BI.isNotEmptyString(suffixString)&&(dateString+=" "+suffixString),dateString},_getFormatString:function(){return this.options.format||this._const.compareFormat},_dateCheck:function(date){return BI.print(BI.parseDateTime(date,"%Y-%x-%d %H:%M:%S"),"%Y-%x-%d %H:%M:%S")===date||BI.print(BI.parseDateTime(date,"%Y-%X-%d %H:%M:%S"),"%Y-%X-%d %H:%M:%S")===date||BI.print(BI.parseDateTime(date,"%Y-%x-%e %H:%M:%S"),"%Y-%x-%e %H:%M:%S")===date||BI.print(BI.parseDateTime(date,"%Y-%X-%e %H:%M:%S"),"%Y-%X-%e %H:%M:%S")===date||BI.print(BI.parseDateTime(date,"%Y-%x-%d"),"%Y-%x-%d")===date||BI.print(BI.parseDateTime(date,"%Y-%X-%d"),"%Y-%X-%d")===date||BI.print(BI.parseDateTime(date,"%Y-%x-%e"),"%Y-%x-%e")===date||BI.print(BI.parseDateTime(date,"%Y-%X-%e"),"%Y-%X-%e")===date},_checkVoid:function(obj){return!BI.checkDateVoid(obj.year,obj.month,obj.day,this.options.min,this.options.max)[0]},_autoAppend:function(v,dateObj){if(BI.isNotNull(dateObj)&&BI.checkDateLegal(v))switch(v.length){case this._const.yearLength:this._yearCheck(v)&&this.editor.setValue(v+"-");break;case this._const.yearMonthLength:case this._const.yearFullMonthLength:var splitMonth=v.split("-")[1];(BI.isNotNull(splitMonth)&&2===splitMonth.length||this._monthCheck(v))&&this.editor.setValue(v+"-")}},_yearCheck:function(v){var date=BI.print(BI.parseDateTime(v,"%Y-%X-%d"),"%Y-%X-%d");return BI.print(BI.parseDateTime(v,"%Y"),"%Y")===v&&date>=this.options.min&&date<=this.options.max},_monthCheck:function(v){var date=BI.parseDateTime(v,"%Y-%X-%d"),dateStr=BI.print(date,"%Y-%X-%d");return date.getMonth()>0&&(BI.print(BI.parseDateTime(v,"%Y-%X"),"%Y-%X")===v||BI.print(BI.parseDateTime(v,"%Y-%x"),"%Y-%x")===v)&&dateStr>=this.options.min&&dateStr<=this.options.max},_setInnerValue:function(date){var dateStr=BI.print(date,this._getFormatString());this.editor.setState(dateStr),this.editor.setValue(dateStr)},_getText:function(obj){function getPositionText(baseText,position){switch(position){case BI.DynamicDateCard.OFFSET.BEGIN:return baseText+BI.i18nText("BI-Basic_Begin_Start");case BI.DynamicDateCard.OFFSET.END:return baseText+BI.i18nText("BI-Basic_End_Stop");case BI.DynamicDateCard.OFFSET.CURRENT:default:return BI.i18nText("BI-Basic_Current_Day")}}var value="",endText="";return BI.isNotNull(obj.year)&&(0!==BI.parseInt(obj.year)&&(value+=Math.abs(obj.year)+BI.i18nText("BI-Basic_Year")+(obj.year<0?BI.i18nText("BI-Basic_Front"):BI.i18nText("BI-Basic_Behind"))),endText=getPositionText(BI.i18nText("BI-Basic_Year"),obj.position)),BI.isNotNull(obj.quarter)&&(0!==BI.parseInt(obj.quarter)&&(value+=Math.abs(obj.quarter)+BI.i18nText("BI-Basic_Single_Quarter")+(obj.quarter<0?BI.i18nText("BI-Basic_Front"):BI.i18nText("BI-Basic_Behind"))),endText=getPositionText(BI.i18nText("BI-Basic_Single_Quarter"),obj.position)),BI.isNotNull(obj.month)&&(0!==BI.parseInt(obj.month)&&(value+=Math.abs(obj.month)+BI.i18nText("BI-Basic_Month")+(obj.month<0?BI.i18nText("BI-Basic_Front"):BI.i18nText("BI-Basic_Behind"))),endText=getPositionText(BI.i18nText("BI-Basic_Month"),obj.position)),BI.isNotNull(obj.week)&&(0!==BI.parseInt(obj.week)&&(value+=Math.abs(obj.week)+BI.i18nText("BI-Basic_Week")+(obj.week<0?BI.i18nText("BI-Basic_Front"):BI.i18nText("BI-Basic_Behind"))),endText=getPositionText(BI.i18nText("BI-Basic_Week"),obj.position)),BI.isNotNull(obj.day)&&(0!==BI.parseInt(obj.day)&&(value+=Math.abs(obj.day)+BI.i18nText("BI-Basic_Day")+(obj.day<0?BI.i18nText("BI-Basic_Front"):BI.i18nText("BI-Basic_Behind"))),endText=1===BI.size(obj)?getPositionText(BI.i18nText("BI-Basic_Month"),obj.position):""),BI.isNotNull(obj.workDay)&&0!==BI.parseInt(obj.workDay)&&(value+=Math.abs(obj.workDay)+BI.i18nText("BI-Basic_Work_Day")+(obj.workDay<0?BI.i18nText("BI-Basic_Front"):BI.i18nText("BI-Basic_Behind"))),value+endText},setValue:function(v){var type,value,self=this,date=BI.getDate();switch(this.storeValue=v,BI.isNotNull(v)&&(type=v.type||BI.DynamicDateCombo.Static,value=v.value||v),type){case BI.DynamicDateCombo.Dynamic:var text=this._getText(value);date=BI.DynamicDateHelper.getCalculation(value),this._setInnerValue(date,text);break;case BI.DynamicDateCombo.Static:default:if(BI.isNull(value)||BI.isNull(value.day))this.editor.setState(""),this.editor.setValue("");else{var dateStr=BI.print(BI.getDate(value.year,value.month-1,value.day,value.hour||0,value.minute||0,value.second||0),this._getFormatString());this.editor.setState(dateStr),this.editor.setValue(dateStr)}}},getKey:function(){return this.editor.getValue()},getValue:function(){return this.storeValue},isValid:function(){return this.editor.isValid()}}),BI.DynamicDateTimeTrigger.EVENT_BLUR="EVENT_BLUR",BI.DynamicDateTimeTrigger.EVENT_FOCUS="EVENT_FOCUS",BI.DynamicDateTimeTrigger.EVENT_START="EVENT_START",BI.DynamicDateTimeTrigger.EVENT_STOP="EVENT_STOP",BI.DynamicDateTimeTrigger.EVENT_CONFIRM="EVENT_CONFIRM",BI.DynamicDateTimeTrigger.EVENT_CHANGE="EVENT_CHANGE",BI.DynamicDateTimeTrigger.EVENT_VALID="EVENT_VALID",BI.DynamicDateTimeTrigger.EVENT_ERROR="EVENT_ERROR",BI.DynamicDateTimeTrigger.EVENT_TRIGGER_CLICK="EVENT_TRIGGER_CLICK",BI.DynamicDateTimeTrigger.EVENT_KEY_DOWN="EVENT_KEY_DOWN",BI.shortcut("bi.dynamic_date_time_trigger",BI.DynamicDateTimeTrigger),BI.SearchEditor=BI.inherit(BI.Widget,{_defaultConfig:function(){var conf=BI.SearchEditor.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{baseCls:"bi-search-editor bi-border bi-focus-shadow",height:24,errorText:"",watermark:BI.i18nText("BI-Basic_Search"),validationChecker:BI.emptyFn,quitChecker:BI.emptyFn})},_init:function(){this.options.height-=2,BI.SearchEditor.superclass._init.apply(this,arguments);var self=this,o=this.options;this.editor=BI.createWidget({type:"bi.editor",height:o.height,watermark:o.watermark,allowBlank:!0,hgap:1,errorText:o.errorText,validationChecker:o.validationChecker,quitChecker:o.quitChecker,value:o.value}),this.clear=BI.createWidget({type:"bi.icon_button",stopEvent:!0,cls:"close-font"}),this.clear.on(BI.IconButton.EVENT_CHANGE,function(){self.setValue(""),self.fireEvent(BI.Controller.EVENT_CHANGE,BI.Events.STOPEDIT),self.fireEvent(BI.SearchEditor.EVENT_CHANGE),self.fireEvent(BI.SearchEditor.EVENT_CLEAR)}),BI.createWidget({element:this,type:"bi.htape",items:[{el:{type:"bi.icon_label",cls:"search-font"},width:24},{el:self.editor},{el:this.clear,width:24}]}),this.editor.on(BI.Controller.EVENT_CHANGE,function(){self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.editor.on(BI.Editor.EVENT_FOCUS,function(){self.fireEvent(BI.SearchEditor.EVENT_FOCUS)}),this.editor.on(BI.Editor.EVENT_BLUR,function(){self.fireEvent(BI.SearchEditor.EVENT_BLUR)}),this.editor.on(BI.Editor.EVENT_CLICK,function(){self.fireEvent(BI.SearchEditor.EVENT_CLICK)}),this.editor.on(BI.Editor.EVENT_CHANGE,function(){self._checkClear(),self.fireEvent(BI.SearchEditor.EVENT_CHANGE)}),this.editor.on(BI.Editor.EVENT_KEY_DOWN,function(v){self.fireEvent(BI.SearchEditor.EVENT_KEY_DOWN,v)}),this.editor.on(BI.Editor.EVENT_SPACE,function(){self.fireEvent(BI.SearchEditor.EVENT_SPACE)}),this.editor.on(BI.Editor.EVENT_BACKSPACE,function(){self.fireEvent(BI.SearchEditor.EVENT_BACKSPACE)}),this.editor.on(BI.Editor.EVENT_VALID,function(){self.fireEvent(BI.SearchEditor.EVENT_VALID)}),this.editor.on(BI.Editor.EVENT_ERROR,function(){self.fireEvent(BI.SearchEditor.EVENT_ERROR)}),this.editor.on(BI.Editor.EVENT_ENTER,function(){self.fireEvent(BI.SearchEditor.EVENT_ENTER)}),this.editor.on(BI.Editor.EVENT_RESTRICT,function(){self.fireEvent(BI.SearchEditor.EVENT_RESTRICT)}),this.editor.on(BI.Editor.EVENT_EMPTY,function(){self._checkClear(),self.fireEvent(BI.SearchEditor.EVENT_EMPTY)}),this.editor.on(BI.Editor.EVENT_REMOVE,function(){self.fireEvent(BI.SearchEditor.EVENT_REMOVE)}),this.editor.on(BI.Editor.EVENT_CONFIRM,function(){self.fireEvent(BI.SearchEditor.EVENT_CONFIRM)}),this.editor.on(BI.Editor.EVENT_CHANGE_CONFIRM,function(){self.fireEvent(BI.SearchEditor.EVENT_CHANGE_CONFIRM)}),this.editor.on(BI.Editor.EVENT_START,function(){self.fireEvent(BI.SearchEditor.EVENT_START)}),this.editor.on(BI.Editor.EVENT_PAUSE,function(){self.fireEvent(BI.SearchEditor.EVENT_PAUSE)}),this.editor.on(BI.Editor.EVENT_STOP,function(){self.fireEvent(BI.SearchEditor.EVENT_STOP)}),this.clear.invisible()},_checkClear:function(){this.getValue()?this.clear.visible():this.clear.invisible()},setWaterMark:function(v){this.options.watermark=v,this.editor.setWaterMark(v)},focus:function(){this.editor.focus()},blur:function(){this.editor.blur()},getValue:function(){if(this.isValid()){var res=this.editor.getValue().match(/[\S]+/g);return BI.isNull(res)?"":res[res.length-1]}},getKeywords:function(){var val=this.editor.getLastChangedValue(),keywords=val.match(/[\S]+/g);return BI.isEndWithBlank(val)?keywords.concat([" "]):keywords},getLastValidValue:function(){return this.editor.getLastValidValue()},getLastChangedValue:function(){return this.editor.getLastChangedValue()},setValue:function(v){this.editor.setValue(v),BI.isKey(v)&&this.clear.visible()},isEditing:function(){return this.editor.isEditing()},isValid:function(){return this.editor.isValid()}}),BI.SearchEditor.EVENT_CHANGE="EVENT_CHANGE",BI.SearchEditor.EVENT_FOCUS="EVENT_FOCUS",BI.SearchEditor.EVENT_BLUR="EVENT_BLUR",BI.SearchEditor.EVENT_CLICK="EVENT_CLICK",BI.SearchEditor.EVENT_KEY_DOWN="EVENT_KEY_DOWN",BI.SearchEditor.EVENT_SPACE="EVENT_SPACE",BI.SearchEditor.EVENT_BACKSPACE="EVENT_BACKSPACE",BI.SearchEditor.EVENT_CLEAR="EVENT_CLEAR",BI.SearchEditor.EVENT_START="EVENT_START",BI.SearchEditor.EVENT_PAUSE="EVENT_PAUSE",BI.SearchEditor.EVENT_STOP="EVENT_STOP",BI.SearchEditor.EVENT_CONFIRM="EVENT_CONFIRM",BI.SearchEditor.EVENT_CHANGE_CONFIRM="EVENT_CHANGE_CONFIRM",BI.SearchEditor.EVENT_VALID="EVENT_VALID",BI.SearchEditor.EVENT_ERROR="EVENT_ERROR",BI.SearchEditor.EVENT_ENTER="EVENT_ENTER",BI.SearchEditor.EVENT_RESTRICT="EVENT_RESTRICT",BI.SearchEditor.EVENT_REMOVE="EVENT_REMOVE",BI.SearchEditor.EVENT_EMPTY="EVENT_EMPTY",BI.shortcut("bi.search_editor",BI.SearchEditor),BI.SmallSearchEditor=BI.inherit(BI.SearchEditor,{_defaultConfig:function(){var conf=BI.SmallSearchEditor.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{baseCls:(conf.baseCls||"")+" bi-small-search-editor",height:20})},_init:function(){BI.SmallSearchEditor.superclass._init.apply(this,arguments)}}),BI.shortcut("bi.small_search_editor",BI.SmallSearchEditor),BI.TextEditor=BI.inherit(BI.Widget,{_defaultConfig:function(){var conf=BI.TextEditor.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{extraCls:"bi-text-editor bi-border bi-focus-shadow",hgap:4,vgap:2,lgap:0,rgap:0,tgap:0,bgap:0,validationChecker:BI.emptyFn,quitChecker:BI.emptyFn,allowBlank:!1,watermark:"",errorText:"",height:24})},_init:function(){BI.TextEditor.superclass._init.apply(this,arguments);var self=this,o=this.options;BI.isNumber(o.height)&&this.element.css({height:o.height-2}),BI.isNumber(o.width)&&this.element.css({width:o.width-2}),this.editor=BI.createWidget({type:"bi.editor",height:o.height-2,hgap:o.hgap,vgap:o.vgap,lgap:o.lgap,rgap:o.rgap,tgap:o.tgap,bgap:o.bgap,value:o.value,title:o.title,tipType:o.tipType,validationChecker:o.validationChecker,quitChecker:o.quitChecker,allowBlank:o.allowBlank,watermark:o.watermark,errorText:o.errorText}),this.editor.on(BI.Controller.EVENT_CHANGE,function(){self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.editor.on(BI.Editor.EVENT_FOCUS,function(){self.fireEvent(BI.TextEditor.EVENT_FOCUS)}),this.editor.on(BI.Editor.EVENT_BLUR,function(){self.fireEvent(BI.TextEditor.EVENT_BLUR)}),this.editor.on(BI.Editor.EVENT_CLICK,function(){self.fireEvent(BI.TextEditor.EVENT_CLICK)}),this.editor.on(BI.Editor.EVENT_CHANGE,function(){self.fireEvent(BI.TextEditor.EVENT_CHANGE)}),this.editor.on(BI.Editor.EVENT_KEY_DOWN,function(v){self.fireEvent(BI.TextEditor.EVENT_KEY_DOWN)}),this.editor.on(BI.Editor.EVENT_SPACE,function(v){self.fireEvent(BI.TextEditor.EVENT_SPACE)}),this.editor.on(BI.Editor.EVENT_BACKSPACE,function(v){self.fireEvent(BI.TextEditor.EVENT_BACKSPACE)}),this.editor.on(BI.Editor.EVENT_VALID,function(){self.fireEvent(BI.TextEditor.EVENT_VALID)}),this.editor.on(BI.Editor.EVENT_CONFIRM,function(){self.fireEvent(BI.TextEditor.EVENT_CONFIRM)}),this.editor.on(BI.Editor.EVENT_CHANGE_CONFIRM,function(){self.fireEvent(BI.TextEditor.EVENT_CHANGE_CONFIRM)}),this.editor.on(BI.Editor.EVENT_REMOVE,function(v){self.fireEvent(BI.TextEditor.EVENT_REMOVE)}),this.editor.on(BI.Editor.EVENT_START,function(){self.fireEvent(BI.TextEditor.EVENT_START)}),this.editor.on(BI.Editor.EVENT_PAUSE,function(){self.fireEvent(BI.TextEditor.EVENT_PAUSE)}),this.editor.on(BI.Editor.EVENT_STOP,function(){self.fireEvent(BI.TextEditor.EVENT_STOP)}),this.editor.on(BI.Editor.EVENT_ERROR,function(){self.fireEvent(BI.TextEditor.EVENT_ERROR,arguments)}),this.editor.on(BI.Editor.EVENT_ENTER,function(){self.fireEvent(BI.TextEditor.EVENT_ENTER)}),this.editor.on(BI.Editor.EVENT_RESTRICT,function(){self.fireEvent(BI.TextEditor.EVENT_RESTRICT)}),this.editor.on(BI.Editor.EVENT_EMPTY,function(){ +self.fireEvent(BI.TextEditor.EVENT_EMPTY)}),BI.createWidget({type:"bi.vertical",scrolly:!1,element:this,items:[this.editor]})},setWaterMark:function(v){this.options.watermark=v,this.editor.setWaterMark(v)},focus:function(){this.editor.focus()},blur:function(){this.editor.blur()},setErrorText:function(text){this.editor.setErrorText(text)},getErrorText:function(){return this.editor.getErrorText()},isValid:function(){return this.editor.isValid()},setValue:function(v){this.editor.setValue(v)},getValue:function(){return this.editor.getValue()}}),BI.TextEditor.EVENT_CHANGE="EVENT_CHANGE",BI.TextEditor.EVENT_FOCUS="EVENT_FOCUS",BI.TextEditor.EVENT_BLUR="EVENT_BLUR",BI.TextEditor.EVENT_CLICK="EVENT_CLICK",BI.TextEditor.EVENT_KEY_DOWN="EVENT_KEY_DOWN",BI.TextEditor.EVENT_SPACE="EVENT_SPACE",BI.TextEditor.EVENT_BACKSPACE="EVENT_BACKSPACE",BI.TextEditor.EVENT_START="EVENT_START",BI.TextEditor.EVENT_PAUSE="EVENT_PAUSE",BI.TextEditor.EVENT_STOP="EVENT_STOP",BI.TextEditor.EVENT_CONFIRM="EVENT_CONFIRM",BI.TextEditor.EVENT_CHANGE_CONFIRM="EVENT_CHANGE_CONFIRM",BI.TextEditor.EVENT_VALID="EVENT_VALID",BI.TextEditor.EVENT_ERROR="EVENT_ERROR",BI.TextEditor.EVENT_ENTER="EVENT_ENTER",BI.TextEditor.EVENT_RESTRICT="EVENT_RESTRICT",BI.TextEditor.EVENT_REMOVE="EVENT_REMOVE",BI.TextEditor.EVENT_EMPTY="EVENT_EMPTY",BI.shortcut("bi.text_editor",BI.TextEditor),BI.SmallTextEditor=BI.inherit(BI.TextEditor,{_defaultConfig:function(){var conf=BI.SmallTextEditor.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{baseCls:(conf.baseCls||"")+" bi-small-text-editor",height:20})},_init:function(){BI.SmallTextEditor.superclass._init.apply(this,arguments)}}),BI.shortcut("bi.small_text_editor",BI.SmallTextEditor),BI.IntervalSlider=BI.inherit(BI.Single,{_constant:{EDITOR_WIDTH:58,EDITOR_R_GAP:60,EDITOR_HEIGHT:30,SLIDER_WIDTH_HALF:15,SLIDER_WIDTH:30,SLIDER_HEIGHT:30,TRACK_HEIGHT:24},props:{baseCls:"bi-interval-slider bi-slider-track",digit:!1,unit:""},render:function(){var self=this,c=this._constant;return this.enable=!1,this.valueOne="",this.valueTwo="",this.calculation=new BI.AccurateCalculationModel,this.grayTrack=BI.createWidget({type:"bi.layout",cls:"gray-track",height:6}),this.blueTrack=BI.createWidget({type:"bi.layout",cls:"blue-track bi-high-light-background",height:6}),this.track=this._createTrackWrapper(),this.labelOne=BI.createWidget({type:"bi.sign_text_editor",cls:"slider-editor-button",text:this.options.unit,allowBlank:!1,width:c.EDITOR_WIDTH,validationChecker:function(v){return self._checkValidation(v)}}),this.labelOne.element.hover(function(){self.labelOne.element.removeClass("bi-border").addClass("bi-border")},function(){self.labelOne.element.removeClass("bi-border")}),this.labelOne.on(BI.Editor.EVENT_CONFIRM,function(){var oldValueOne=self.valueOne,v=BI.parseFloat(this.getValue());self.valueOne=v;var percent=self._getPercentByValue(v),significantPercent=BI.parseFloat(percent.toFixed(1));self._setSliderOnePosition(significantPercent),self._setBlueTrack(),self._checkLabelPosition(oldValueOne,self.valueTwo,self.valueOne,self.valueTwo),self.fireEvent(BI.IntervalSlider.EVENT_CHANGE)}),this.labelTwo=BI.createWidget({type:"bi.sign_text_editor",cls:"slider-editor-button",text:this.options.unit,allowBlank:!1,width:c.EDITOR_WIDTH,validationChecker:function(v){return self._checkValidation(v)}}),this.labelTwo.element.hover(function(){self.labelTwo.element.removeClass("bi-border").addClass("bi-border")},function(){self.labelTwo.element.removeClass("bi-border")}),this.labelTwo.on(BI.Editor.EVENT_CONFIRM,function(){var oldValueTwo=self.valueTwo,v=BI.parseFloat(this.getValue());self.valueTwo=v;var percent=self._getPercentByValue(v),significantPercent=BI.parseFloat(percent.toFixed(1));self._setSliderTwoPosition(significantPercent),self._setBlueTrack(),self._checkLabelPosition(self.valueOne,oldValueTwo,self.valueOne,self.valueTwo),self.fireEvent(BI.IntervalSlider.EVENT_CHANGE)}),this.sliderOne=BI.createWidget({type:"bi.single_slider_button"}),this.sliderTwo=BI.createWidget({type:"bi.single_slider_button"}),this._draggable(this.sliderOne,!0),this._draggable(this.sliderTwo,!1),this._setVisible(!1),{type:"bi.absolute",element:this,items:[{el:{type:"bi.vertical",items:[{type:"bi.absolute",items:[{el:this.track,width:"100%",height:c.TRACK_HEIGHT}]}],hgap:7,height:c.TRACK_HEIGHT},top:23,left:0,width:"100%"},this._createLabelWrapper(),this._createSliderWrapper()]}},_rePosBySizeAfterMove:function(size,isLeft){var o=this.options,percent=100*size/this._getGrayTrackLength(),significantPercent=BI.parseFloat(percent.toFixed(1)),v=this._getValueByPercent(significantPercent);v=this._assertValue(v),v=o.digit===!1?v:v.toFixed(o.digit);var oldValueOne=this.valueOne,oldValueTwo=this.valueTwo;isLeft?(this._setSliderOnePosition(significantPercent),this.labelOne.setValue(v),this.valueOne=v,this._checkLabelPosition(oldValueOne,oldValueTwo,v,this.valueTwo)):(this._setSliderTwoPosition(significantPercent),this.labelTwo.setValue(v),this.valueTwo=v,this._checkLabelPosition(oldValueOne,oldValueTwo,this.valueOne,v)),this._setBlueTrack()},_rePosBySizeAfterStop:function(size,isLeft){var percent=100*size/this._getGrayTrackLength(),significantPercent=BI.parseFloat(percent.toFixed(1));isLeft?this._setSliderOnePosition(significantPercent):this._setSliderTwoPosition(significantPercent)},_draggable:function(widget,isLeft){function optimizeSize(s){return BI.clamp(s,0,self._getGrayTrackLength())}var self=this,o=this.options,startDrag=!1,size=0,offset=0,defaultSize=0,mouseMoveTracker=new BI.MouseMoveTracker(function(deltaX){mouseMoveTracker.isDragging()&&(startDrag=!0,offset+=deltaX,size=optimizeSize(defaultSize+offset),widget.element.addClass("dragging"),self._rePosBySizeAfterMove(size,isLeft))},function(){startDrag===!0&&(size=optimizeSize(size),self._rePosBySizeAfterStop(size,isLeft),size=0,offset=0,defaultSize=size,startDrag=!1),widget.element.removeClass("dragging"),mouseMoveTracker.releaseMouseMoves(),self.fireEvent(BI.IntervalSlider.EVENT_CHANGE)},window);widget.element.on("mousedown",function(event){widget.isEnabled()&&(defaultSize=this.offsetLeft,optimizeSize(defaultSize),mouseMoveTracker.captureMouseMoves(event))})},_createLabelWrapper:function(){var c=this._constant;return{el:{type:"bi.vertical",items:[{type:"bi.absolute",items:[{el:this.labelOne,top:0,left:"0%"}]},{type:"bi.absolute",items:[{el:this.labelTwo,top:0,left:"100%"}]}],rgap:c.EDITOR_R_GAP,height:c.SLIDER_HEIGHT},top:0,left:0,width:"100%"}},_createSliderWrapper:function(){var c=this._constant;return{el:{type:"bi.vertical",items:[{type:"bi.absolute",items:[{el:this.sliderOne,top:0,left:"0%"}]},{type:"bi.absolute",items:[{el:this.sliderTwo,top:0,left:"100%"}]}],hgap:c.SLIDER_WIDTH_HALF,height:c.SLIDER_HEIGHT},top:20,left:0,width:"100%"}},_createTrackWrapper:function(){return BI.createWidget({type:"bi.absolute",items:[{el:{type:"bi.vertical",items:[{type:"bi.absolute",items:[{el:this.grayTrack,top:0,left:0,width:"100%"},{el:this.blueTrack,top:0,left:0,width:"0%"}]}],hgap:8,height:8},top:8,left:0,width:"100%"}]})},_checkValidation:function(v){var o=this.options,valid=!1,dotText=(v+"").split(".")[1];return BI.isEmptyString(dotText)||BI.isNumeric(v)&&!(BI.isNull(v)||vthis.max)&&(o.digit===!1?valid=!0:(dotText=dotText||"",valid=dotText.length===o.digit)),valid},_checkOverlap:function(){var labelOneLeft=this.labelOne.element[0].offsetLeft,labelTwoLeft=this.labelTwo.element[0].offsetLeft;labelOneLeft<=labelTwoLeft?labelTwoLeft-labelOneLeft<90?this.labelTwo.element.css({top:40}):this.labelTwo.element.css({top:0}):labelOneLeft-labelTwoLeft<90?this.labelTwo.element.css({top:40}):this.labelTwo.element.css({top:0})},_checkLabelPosition:function(oldValueOne,oldValueTwo,valueOne,valueTwo,isLeft){if(oldValueOne=BI.parseFloat(oldValueOne),oldValueTwo=BI.parseFloat(oldValueTwo),valueOne=BI.parseFloat(valueOne),valueTwo=BI.parseFloat(valueTwo),oldValueOne<=oldValueTwo&&valueOne>valueTwo||oldValueOne>=oldValueTwo&&valueOne-1){arr=pre.split("e");var decimalPartLength=BI.size(arr[0].split(".")[1]),sciencePartLength=BI.parseInt(arr[1].substring(1));return decimalPartLength-sciencePartLength}return arr=pre.split("."),arr.length>1?arr[1].length:0},_assertValue:function(value){return value<=this.min?this.min:value>=this.max?this.max:value},_setEnable:function(b){BI.IntervalSlider.superclass._setEnable.apply(this,[b]),b?this.blueTrack.element.removeClass("disabled-blue-track").addClass("blue-track"):this.blueTrack.element.removeClass("blue-track").addClass("disabled-blue-track")},getValue:function(){return this.valueOne<=this.valueTwo?{min:this.valueOne,max:this.valueTwo}:{min:this.valueTwo,max:this.valueOne}},setMinAndMax:function(v){var minNumber=BI.parseFloat(v.min),maxNumber=BI.parseFloat(v.max);!isNaN(minNumber)&&!isNaN(maxNumber)&&maxNumber>=minNumber&&(this.min=minNumber,this.max=maxNumber,this.valueOne=minNumber,this.valueTwo=maxNumber,this.precision=this._getPrecision(),this._setDraggableEnable(!0)),maxNumber===minNumber&&this._setDraggableEnable(!1)},setValue:function(v){var o=this.options,valueOne=BI.parseFloat(v.min),valueTwo=BI.parseFloat(v.max);valueOne=o.digit===!1?valueOne:valueOne.toFixed(o.digit),valueTwo=o.digit===!1?valueTwo:valueTwo.toFixed(o.digit),isNaN(valueOne)||isNaN(valueTwo)||(this._checkValidation(valueOne)&&(this.valueOne=this.valueOne<=this.valueTwo?valueOne:valueTwo),this._checkValidation(valueTwo)&&(this.valueTwo=this.valueOne<=this.valueTwo?valueTwo:valueOne),valueOnethis.max&&(this.valueTwo=this.max))},reset:function(){this._setVisible(!1),this.enable=!1,this.valueOne="",this.valueTwo="",this.min=NaN,this.max=NaN,this._setBlueTrackWidth(0)},populate:function(){isNaN(this.min)||isNaN(this.max)||(this.enable=!0,this._setVisible(!0),this._setErrorText(),(BI.isNumeric(this.valueOne)||BI.isNotEmptyString(this.valueOne))&&(BI.isNumeric(this.valueTwo)||BI.isNotEmptyString(this.valueTwo))?(this.labelOne.setValue(this.valueOne),this.labelTwo.setValue(this.valueTwo),this._setAllPosition(this._getPercentByValue(this.valueOne),this._getPercentByValue(this.valueTwo))):(this.labelOne.setValue(this.min),this.labelTwo.setValue(this.max),this._setAllPosition(0,100)))}}),BI.IntervalSlider.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.interval_slider",BI.IntervalSlider),BI.AccurateCalculationModel=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.AccurateCalculationModel.superclass._defaultConfig.apply(this,arguments),{baseCls:""})},_init:function(){BI.AccurateCalculationModel.superclass._init.apply(this,arguments)},_getMagnitude:function(n){for(var magnitude="1",i=0;i0)var needAddZero=stringNumber2;else{var needAddZero=stringNumber1;magnitudeDiff=0-magnitudeDiff}for(var i=0;i=num2.numDecimal.length?num1.numDecimal.length:num2.numDecimal.length}function addZero(resultTemp,length){for(var diff=length-resultTemp.length,i=0;i=BI.parseInt(stringNumber2.numDecimal))var decimalResultTemp=(BI.parseInt(stringNumber1.numDecimal)-BI.parseInt(stringNumber2.numDecimal)).toString(),decimalResult=addZero(decimalResultTemp,decimalMaxLength);else{integerResult--;var borrow=this._getMagnitude(decimalMaxLength),decimalResultTemp=(borrow+BI.parseInt(stringNumber1.numDecimal)-BI.parseInt(stringNumber2.numDecimal)).toString(),decimalResult=addZero(decimalResultTemp,decimalMaxLength)}var result=integerResult+"."+decimalResult;return BI.parseFloat(result)},_accurateAddition:function(num1,num2){function addZero(resultTemp,length){for(var diff=length-resultTemp.length,i=0;in)var integerResult=stringNumber.numInteger.slice(0,stringNumber.numInteger.length-n),partDecimalResult=stringNumber.numInteger.slice(-n);else var integerResult="0",partDecimalResult=addZero(stringNumber.numInteger,n);var result=integerResult+"."+partDecimalResult+stringNumber.numDecimal;return BI.parseFloat(result)},accurateSubtraction:function(num1,num2){return num1>=0&&num2>=0?num1>=num2?this._accurateSubtraction(num1,num2):-this._accurateSubtraction(num2,num1):num1>=0&&num2<0?this._accurateAddition(num1,-num2):num1<0&&num2>=0?-this._accurateAddition(-num1,num2):num1<0&&num2<0?num1>=num2?this._accurateSubtraction(-num2,-num1):this._accurateSubtraction(-num1,-num2):void 0},accurateAddition:function(num1,num2){return num1>=0&&num2>=0?this._accurateAddition(num1,num2):num1>=0&&num2<0?this.accurateSubtraction(num1,-num2):num1<0&&num2>=0?this.accurateSubtraction(num2,-num1):num1<0&&num2<0?-this._accurateAddition(-num1,-num2):void 0},accurateMultiplication:function(num1,num2){return num1>=0&&num2>=0?this._accurateMultiplication(num1,num2):num1>=0&&num2<0?-this._accurateMultiplication(num1,-num2):num1<0&&num2>=0?-this._accurateMultiplication(-num1,num2):num1<0&&num2<0?this._accurateMultiplication(-num1,-num2):void 0},accurateDivisionTenExponent:function(num1,n){return num1>=0?this._accurateDivisionTenExponent(num1,n):-this._accurateDivisionTenExponent(-num1,n)}}),BI.DownListCombo=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.DownListCombo.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-multilayer-down-list-combo",height:24,items:[],adjustLength:0,direction:"bottom",trigger:"click",container:null,stopPropagation:!1,el:{}})},_init:function(){BI.DownListCombo.superclass._init.apply(this,arguments);var self=this,o=this.options;this.popupview=BI.createWidget({type:"bi.multi_layer_down_list_popup",items:o.items,chooseType:o.chooseType,value:o.value}),this.popupview.on(BI.DownListPopup.EVENT_CHANGE,function(value){self.fireEvent(BI.DownListCombo.EVENT_CHANGE,value),self.downlistcombo.hideView()}),this.popupview.on(BI.DownListPopup.EVENT_SON_VALUE_CHANGE,function(value,fatherValue){self.fireEvent(BI.DownListCombo.EVENT_SON_VALUE_CHANGE,value,fatherValue),self.downlistcombo.hideView()}),this.downlistcombo=BI.createWidget({element:this,type:"bi.combo",trigger:o.trigger,isNeedAdjustWidth:!1,container:o.container,adjustLength:o.adjustLength,direction:o.direction,stopPropagation:o.stopPropagation,el:BI.createWidget(o.el,{type:"bi.icon_trigger",extraCls:o.iconCls?o.iconCls:"pull-down-font",width:o.width,height:o.height}),popup:{el:this.popupview,stopPropagation:o.stopPropagation,maxHeight:1e3}}),this.downlistcombo.on(BI.Combo.EVENT_BEFORE_POPUPVIEW,function(){self.fireEvent(BI.DownListCombo.EVENT_BEFORE_POPUPVIEW)})},hideView:function(){this.downlistcombo.hideView()},showView:function(e){this.downlistcombo.showView(e)},populate:function(items){this.popupview.populate(items)},setValue:function(v){this.popupview.setValue(v)},getValue:function(){return this.popupview.getValue()}}),BI.DownListCombo.EVENT_CHANGE="EVENT_CHANGE",BI.DownListCombo.EVENT_SON_VALUE_CHANGE="EVENT_SON_VALUE_CHANGE",BI.DownListCombo.EVENT_BEFORE_POPUPVIEW="EVENT_BEFORE_POPUPVIEW",BI.shortcut("bi.multi_layer_down_list_combo",BI.DownListCombo),BI.MultiLayerDownListPopup=BI.inherit(BI.Pane,{constants:{nextIcon:"pull-right-e-font",height:25,iconHeight:12,iconWidth:12,hgap:0,vgap:0,border:1},_defaultConfig:function(){var conf=BI.MultiLayerDownListPopup.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{baseCls:"bi-down-list-popup",items:[],chooseType:BI.Selection.Multi})},_init:function(){BI.MultiLayerDownListPopup.superclass._init.apply(this,arguments),this.singleValues=[],this.childValueMap={},this.fatherValueMap={};var self=this,o=this.options,children=this._createPopupItems(o.items);this.popup=BI.createWidget({type:"bi.button_tree",items:BI.createItems(children,{},{adjustLength:-2}),layouts:[{type:"bi.vertical",hgap:this.constants.hgap,vgap:this.constants.vgap}],value:this._digest(o.value),chooseType:o.chooseType}),this.popup.on(BI.ButtonTree.EVENT_CHANGE,function(value,object){var changedValue=value;if(BI.isNotNull(self.childValueMap[value])){changedValue=self.childValueMap[value];var fatherValue=self.fatherValueMap[value],fatherArrayValue=(fatherValue+"").split("_");self.fireEvent(BI.MultiLayerDownListPopup.EVENT_SON_VALUE_CHANGE,changedValue,fatherArrayValue.length>1?fatherArrayValue:fatherValue)}else self.fireEvent(BI.MultiLayerDownListPopup.EVENT_CHANGE,changedValue,object);if(!BI.contains(self.singleValues,changedValue)){var item=self.getValue(),result=[];BI.each(item,function(i,valueObject){valueObject.value!=changedValue&&result.push(valueObject)}),self.setValue(result)}}),BI.createWidget({type:"bi.vertical",element:this,items:[this.popup],vgap:5})},_createPopupItems:function(items){var self=this,result=[];return BI.each(items,function(i,it){var item_done={type:"bi.down_list_group",items:[]};if(BI.each(it,function(i,item){BI.isNotEmptyArray(item.children)&&!BI.isEmpty(item.el)?(item.type="bi.combo_group",item.cls="down-list-group",item.trigger="hover",item.isNeedAdjustWidth=!1,item.el.title=item.el.title||item.el.text,item.el.type="bi.down_list_group_item",item.el.logic={dynamic:!0},item.el.height=self.constants.height,item.el.iconCls2=self.constants.nextIcon,item.popup={lgap:1,el:{type:"bi.button_tree",chooseType:0,layouts:[{type:"bi.vertical"}]},innerVGap:5},item.el.childValues=[],BI.each(item.children,function(i,child){child=child.el?BI.extend(child.el,{children:child.children}):child;var fatherValue=BI.deepClone(item.el.value),childValue=BI.deepClone(child.value);self.singleValues.push(child.value),child.type="bi.down_list_item",child.extraCls=" child-down-list-item",child.title=child.title||child.text,child.textRgap=10,child.isNeedAdjustWidth=!1,child.logic={dynamic:!0},child.father=fatherValue,self.fatherValueMap[self._createChildValue(fatherValue,childValue)]=fatherValue,self.childValueMap[self._createChildValue(fatherValue,childValue)]=childValue,child.value=self._createChildValue(fatherValue,childValue),item.el.childValues.push(child.value),BI.isNotEmptyArray(child.children)&&(child.type="bi.down_list_group_item",self._createChildren(child),child.height=self.constants.height,child.iconCls2=self.constants.nextIcon,item.el.childValues=BI.concat(item.el.childValues,child.childValues))})):(item.type="bi.down_list_item",item.title=item.title||item.text,item.textRgap=10,item.isNeedAdjustWidth=!1,item.logic={dynamic:!0});var el_done={};el_done.el=item,item_done.items.push(el_done)}),self._isGroup(item_done.items)&&BI.each(item_done.items,function(i,item){self.singleValues.push(item.el.value)}),result.push(item_done),self._needSpliter(i,items.length)){var spliter_container=BI.createWidget({type:"bi.vertical",items:[{el:{type:"bi.layout",cls:"bi-down-list-spliter bi-border-top cursor-pointer",height:0}}],cls:"bi-down-list-spliter-container cursor-pointer",vgap:5,lgap:10});result.push(spliter_container)}}),result},_createChildren:function(child){var self=this;child.childValues=[],BI.each(child.children,function(i,c){var fatherValue=BI.deepClone(child.value),childValue=BI.deepClone(c.value);c.type="bi.down_list_item",c.title=c.title||c.text,c.textRgap=10,c.isNeedAdjustWidth=!1,c.logic={dynamic:!0},c.father=fatherValue,self.fatherValueMap[self._createChildValue(fatherValue,childValue)]=fatherValue,self.childValueMap[self._createChildValue(fatherValue,childValue)]=childValue,c.value=self._createChildValue(fatherValue,childValue),child.childValues.push(c.value)})},_isGroup:function(i){return i.length>1},_needSpliter:function(i,itemLength){return i1?fatherArrayValue:fartherValue}else valueItem.value=value;result.push(valueItem)}),result}}),BI.MultiLayerDownListPopup.EVENT_CHANGE="EVENT_CHANGE",BI.MultiLayerDownListPopup.EVENT_SON_VALUE_CHANGE="EVENT_SON_VALUE_CHANGE",BI.shortcut("bi.multi_layer_down_list_popup",BI.MultiLayerDownListPopup),BI.MultiLayerSelectTreeCombo=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.MultiLayerSelectTreeCombo.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-multilayer-select-tree-combo",isDefaultInit:!1,height:24,text:"",itemsCreator:BI.emptyFn,items:[],value:"",attributes:{tabIndex:0},allowEdit:!1,allowSearchValue:!1,allowInsertValue:!1})},render:function(){var self=this,o=this.options,combo=o.itemsCreator===BI.emptyFn?this._getSyncConfig():this._getAsyncConfig();return o.allowEdit||o.itemsCreator!==BI.emptyFn?{type:"bi.absolute",items:[{el:combo,left:0,right:0,top:0,bottom:0},{el:{type:"bi.trigger_icon_button",cls:"trigger-icon-button",ref:function(_ref){self.triggerBtn=_ref},width:o.height,height:o.height,handler:function(){self.combo.isViewVisible()?self.combo.hideView():self.combo.showView()}},right:0,bottom:0,top:0}]}:combo},_getBaseConfig:function(){var self=this,o=this.options;return{type:"bi.combo",container:o.container,adjustLength:2,ref:function(_ref){self.combo=_ref},popup:{el:{type:"bi.multilayer_select_tree_popup",isDefaultInit:o.isDefaultInit,itemsCreator:o.itemsCreator,items:o.items,ref:function(_ref){self.trigger&&self.trigger.getSearcher().setAdapter(_ref)},listeners:[{eventName:BI.MultiLayerSelectTreePopup.EVENT_CHANGE,action:function(){self.setValue(this.getValue()),self.combo.hideView(),self.fireEvent(BI.MultiLayerSelectTreeCombo.EVENT_CHANGE)}}]},value:o.value,maxHeight:400,minHeight:240}}},_getSearchConfig:function(){var self=this,o=this.options;return{el:{type:"bi.multilayer_select_tree_trigger",allowInsertValue:o.allowInsertValue,allowSearchValue:o.allowSearchValue,allowEdit:o.allowEdit,cls:"multilayer-select-tree-trigger",ref:function(_ref){self.trigger=_ref},items:o.items,itemsCreator:o.itemsCreator,valueFormatter:o.valueFormatter,watermark:o.watermark,height:o.height-2,text:o.text,value:o.value,tipType:o.tipType,warningTitle:o.warningTitle,title:o.title,listeners:[{eventName:BI.MultiLayerSelectTreeTrigger.EVENT_CHANGE,action:function(){self.setValue(this.getValue()),self.combo.hideView(),self.fireEvent(BI.MultiLayerSelectTreeCombo.EVENT_CHANGE)}},{eventName:BI.MultiLayerSelectTreeTrigger.EVENT_FOCUS,action:function(){self.fireEvent(BI.MultiLayerSelectTreeCombo.EVENT_FOCUS)}},{eventName:BI.MultiLayerSelectTreeTrigger.EVENT_BLUR,action:function(){self.fireEvent(BI.MultiLayerSelectTreeCombo.EVENT_BLUR)}},{eventName:BI.MultiLayerSelectTreeTrigger.EVENT_SEARCHING,action:function(){self.fireEvent(BI.MultiLayerSelectTreeCombo.EVENT_SEARCHING)}},{eventName:BI.MultiLayerSelectTreeTrigger.EVENT_ADD_ITEM,action:function(){var value=self.trigger.getSearcher().getKeyword();self.combo.setValue([value]),self.combo.hideView()}}]},hideChecker:function(e){return 0===self.triggerBtn.element.find(e.target).length},listeners:[{eventName:BI.Combo.EVENT_AFTER_HIDEVIEW,action:function(){self.trigger.stopEditing()}}]}},_getSyncConfig:function(){var o=this.options,baseConfig=this._getBaseConfig();return BI.extend(baseConfig,o.allowEdit?this._getSearchConfig():{el:{type:"bi.single_tree_trigger",text:o.text,height:o.height,items:o.items,value:o.value}})},_getAsyncConfig:function(){var config=this._getBaseConfig();return BI.extend(config,this._getSearchConfig())},setValue:function(v){v=BI.isArray(v)?v:[v],this.combo.setValue(v)},getValue:function(){return this.combo.getValue()},populate:function(items){this.combo.populate(items)}}),BI.MultiLayerSelectTreeCombo.EVENT_SEARCHING="EVENT_SEARCHING",BI.MultiLayerSelectTreeCombo.EVENT_BLUR="EVENT_BLUR",BI.MultiLayerSelectTreeCombo.EVENT_FOCUS="EVENT_FOCUS",BI.MultiLayerSelectTreeCombo.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.multilayer_select_tree_combo",BI.MultiLayerSelectTreeCombo),BI.MultiLayerSelectTreeInsertSearchPane=BI.inherit(BI.Widget,{props:function(){return{baseCls:"bi-multilayer-select-tree-popup",tipText:BI.i18nText("BI-No_Selected_Item"),isDefaultInit:!1,itemsCreator:BI.emptyFn,items:[],value:""}},render:function(){var self=this,o=this.options;return this.tree=BI.createWidget({type:"bi.multilayer_select_level_tree",isDefaultInit:o.isDefaultInit,items:o.items,itemsCreator:o.itemsCreator===BI.emptyFn?BI.emptyFn:function(op,callback){o.itemsCreator(op,function(res){callback(res),self.setKeyword(o.keywordGetter())})},keywordGetter:o.keywordGetter,value:o.value,scrollable:null,listeners:[{eventName:BI.Controller.EVENT_CHANGE,action:function(){self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}},{eventName:BI.MultiLayerSelectLevelTree.EVENT_CHANGE,action:function(){self.fireEvent(BI.MultiLayerSelectTreeInsertSearchPane.EVENT_CHANGE)}}]}),{type:"bi.vertical",scrolly:!1,scrollable:!0,vgap:5,items:[{type:"bi.text_button",invisible:!0,text:BI.i18nText("BI-Basic_Click_To_Add_Text",""),height:24,cls:"bi-high-light",hgap:5,ref:function(_ref){self.addNotMatchTip=_ref},handler:function(){self.fireEvent(BI.MultiLayerSelectTreeInsertSearchPane.EVENT_ADD_ITEM,o.keywordGetter())}},this.tree]}},setKeyword:function(keyword){var showTip=BI.isEmptyArray(this.tree.getAllLeaves()); +this.addNotMatchTip.setVisible(showTip),showTip&&this.addNotMatchTip.setText(BI.i18nText("BI-Basic_Click_To_Add_Text",keyword))},getValue:function(){return this.tree.getValue()},setValue:function(v){v=BI.isArray(v)?v:[v],this.tree.setValue(v)},populate:function(items){this.tree.populate(items)}}),BI.MultiLayerSelectTreeInsertSearchPane.EVENT_ADD_ITEM="EVENT_ADD_ITEM",BI.MultiLayerSelectTreeInsertSearchPane.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.multilayer_select_tree_insert_search_pane",BI.MultiLayerSelectTreeInsertSearchPane),BI.MultiLayerSelectLevelTree=BI.inherit(BI.Pane,{_defaultConfig:function(){return BI.extend(BI.MultiLayerSelectLevelTree.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-multilayer-select-level-tree",isDefaultInit:!1,items:[],itemsCreator:BI.emptyFn,keywordGetter:BI.emptyFn,value:"",scrollable:!0})},_init:function(){var o=this.options;BI.MultiLayerSelectLevelTree.superclass._init.apply(this,arguments),this.storeValue=o.value,this.initTree(this.options.items),this.check()},_formatItems:function(nodes,layer,pNode){var self=this,o=this.options,keyword=o.keywordGetter();return BI.each(nodes,function(i,node){var extend={};node.layer=layer,BI.isKey(node.id)||(node.id=BI.UUID()),node.keyword=node.keyword||keyword,extend.pNode=pNode,node.isParent===!0||node.parent===!0||BI.isNotEmptyArray(node.children)?(extend.type="bi.multilayer_select_tree_mid_plus_group_node",i===nodes.length-1&&(extend.type="bi.multilayer_select_tree_last_plus_group_node",extend.isLastNode=!0),0!==i||pNode||(extend.type="bi.multilayer_select_tree_first_plus_group_node"),0!==i||i!==nodes.length-1||pNode||(extend.type="bi.multilayer_select_tree_plus_group_node"),BI.defaults(node,extend),self._formatItems(node.children,layer+1,node)):(extend.type="bi.multilayer_single_tree_mid_tree_leaf_item",0!==i||pNode||(extend.type="bi.multilayer_single_tree_first_tree_leaf_item"),i===nodes.length-1&&(extend.type="bi.multilayer_single_tree_last_tree_leaf_item"),BI.defaults(node,extend))}),nodes},_assertId:function(sNodes){BI.each(sNodes,function(i,node){node.id=node.id||BI.UUID()})},initTree:function(nodes){var self=this,o=this.options,hasNext=!1;this.empty(),this._assertId(nodes),this.tree=BI.createWidget({type:"bi.custom_tree",cls:"tree-view display-table",expander:{type:"bi.select_tree_expander",isDefaultInit:o.isDefaultInit,el:{},popup:{type:"bi.custom_tree"}},items:this._formatItems(BI.Tree.transformToTreeFormat(nodes),0),itemsCreator:function(op,callback){1===op.times&&!op.node&&BI.nextTick(function(){self.loading()}),o.itemsCreator(op,function(ob){hasNext=ob.hasNext,1===op.times&&!op.node&&self._populate(ob.items),callback(self._formatItems(BI.Tree.transformToTreeFormat(ob.items),op.node?op.node.layer+1:0,op.node)),self.setValue(self.storeValue),1===op.times&&!op.node&&BI.nextTick(function(){self.loaded()})})},value:o.value,el:{type:"bi.loader",isDefaultInit:o.itemsCreator!==BI.emptyFn,el:{type:"bi.button_tree",chooseType:o.chooseType,behaviors:o.behaviors,layouts:[{type:"bi.vertical"}]},hasNext:function(){return hasNext}}}),this.tree.on(BI.Controller.EVENT_CHANGE,function(type,value){self.fireEvent(BI.Controller.EVENT_CHANGE,arguments),type===BI.Events.CLICK&&(self.setValue(value),self.fireEvent(BI.MultiLayerSelectLevelTree.EVENT_CHANGE,arguments))}),BI.createWidget({type:"bi.adaptive",element:this,scrollable:o.scrollable,items:[this.tree]})},_populate:function(){BI.MultiLayerSelectLevelTree.superclass.populate.apply(this,arguments)},populate:function(nodes){this._populate(nodes),BI.isNull(nodes)?this.tree.populate():this.tree.populate(this._formatItems(BI.Tree.transformToTreeFormat(nodes),0))},setValue:function(v){this.options.chooseType===BI.Selection.None||(this.storeValue=v,this.tree.setValue(v))},getValue:function(){return BI.isArray(this.storeValue)?this.storeValue:BI.isNull(this.storeValue)?[]:[this.storeValue]},getAllLeaves:function(){return this.tree.getAllLeaves()},getNodeById:function(id){return this.tree.getNodeById(id)},getNodeByValue:function(id){return this.tree.getNodeByValue(id)}}),BI.MultiLayerSelectLevelTree.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.multilayer_select_level_tree",BI.MultiLayerSelectLevelTree),BI.MultiLayerSelectTreePopup=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.MultiLayerSelectTreePopup.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-multilayer-select-tree-popup",tipText:BI.i18nText("BI-No_Selected_Item"),isDefaultInit:!1,itemsCreator:BI.emptyFn,items:[],value:""})},_init:function(){BI.MultiLayerSelectTreePopup.superclass._init.apply(this,arguments);var self=this,o=this.options;this.tree=BI.createWidget({type:"bi.multilayer_select_level_tree",isDefaultInit:o.isDefaultInit,items:o.items,itemsCreator:o.itemsCreator,keywordGetter:o.keywordGetter,value:o.value,scrollable:null}),BI.createWidget({type:"bi.vertical",scrolly:!1,scrollable:!0,element:this,vgap:5,items:[this.tree]}),this.tree.on(BI.Controller.EVENT_CHANGE,function(){self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.tree.on(BI.MultiLayerSelectLevelTree.EVENT_CHANGE,function(){self.fireEvent(BI.MultiLayerSelectTreePopup.EVENT_CHANGE)})},getValue:function(){return this.tree.getValue()},setValue:function(v){v=BI.isArray(v)?v:[v],this.tree.setValue(v)},populate:function(items){this.tree.populate(items)}}),BI.MultiLayerSelectTreePopup.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.multilayer_select_tree_popup",BI.MultiLayerSelectTreePopup),BI.MultiLayerSelectTreeTrigger=BI.inherit(BI.Trigger,{props:function(){return{extraCls:"bi-multi-layer-select-tree-trigger bi-border bi-focus-shadow",height:24,valueFormatter:function(v){return v},itemsCreator:BI.emptyFn,watermark:BI.i18nText("BI-Basic_Search"),allowSearchValue:!1}},render:function(){var self=this,o=this.options;o.itemsCreator===BI.emptyFn&&this._initData();var content={type:"bi.htape",items:[{el:{type:"bi.searcher",ref:function(){self.searcher=this},isAutoSearch:!1,el:{type:"bi.state_editor",ref:function(){self.editor=this},defaultText:o.text,text:this._digest(o.value),value:o.value,height:o.height,tipText:"",watermark:o.watermark,listeners:[{eventName:BI.StateEditor.EVENT_FOCUS,action:function(){self.fireEvent(BI.MultiLayerSelectTreeTrigger.EVENT_FOCUS)}},{eventName:BI.StateEditor.EVENT_BLUR,action:function(){self.fireEvent(BI.MultiLayerSelectTreeTrigger.EVENT_BLUR)}},{eventName:BI.StateEditor.EVENT_CHANGE,action:function(){self.fireEvent(BI.MultiLayerSelectTreeTrigger.EVENT_SEARCHING)}}]},popup:{type:o.allowInsertValue?"bi.multilayer_select_tree_insert_search_pane":"bi.multilayer_select_tree_popup",itemsCreator:o.itemsCreator===BI.emptyFn?BI.emptyFn:function(op,callback){op.keyword=self.editor.getValue(),o.itemsCreator(op,callback)},keywordGetter:function(){return self.editor.getValue()},cls:"bi-card",listeners:[{eventName:BI.MultiLayerSelectTreeInsertSearchPane.EVENT_ADD_ITEM,action:function(){self.options.text=self.getSearcher().getKeyword(),self.fireEvent(BI.MultiLayerSelectTreeTrigger.EVENT_ADD_ITEM)}}],ref:function(_ref){self.popup=_ref}},onSearch:function(obj,callback){var keyword=obj.keyword;o.itemsCreator===BI.emptyFn?(callback(self._getSearchItems(keyword)),o.allowInsertValue&&self.popup.setKeyword(keyword)):callback()},listeners:[{eventName:BI.Searcher.EVENT_CHANGE,action:function(){self.fireEvent(BI.MultiLayerSelectTreeTrigger.EVENT_CHANGE)}}]}},{el:{type:"bi.layout",width:24},width:24}]};return o.allowEdit?content:{type:"bi.absolute",items:[{el:content,left:0,right:0,top:0,bottom:0},{el:{type:"bi.layout"},left:0,right:24,top:0,bottom:0}]}},_initData:function(){var o=this.options;this.tree=new BI.Tree,this.nodes=BI.Tree.treeFormat(BI.deepClone(o.items)),this.tree.initTree(this.nodes)},_getSearchItems:function(keyword){var self=this,o=this.options,items=[];return this.tree.traverse(function(node){var find=BI.Func.getSearchResult(self.tree.isRoot(node)?[]:BI.concat([node.text],o.allowSearchValue?[node.value]:[]),keyword);if(find.find.length>0||find.match.length>0)return items.push(node),!0}),this._fillTreeStructure4Search(items,"id")},_createJson:function(node,open){return{id:node.id,pId:node.pId,text:node.text,value:node.value,isParent:BI.isNotEmptyArray(node.children),open:open}},_getChildren:function(node){var self=this;node.children=node.children||[];var nodes=[];return BI.each(node.children,function(idx,child){var children=self._getChildren(child);nodes=nodes.concat(children)}),node.children.concat(nodes)},_fillTreeStructure4Search:function(leaves){var self=this,result=[],queue=[];for(BI.each(leaves,function(idx,node){queue.push({pId:node.pId}),result.push(node),result=result.concat(self._getChildren(node))});BI.isNotEmptyArray(queue);){var node=queue.pop(),pNode=this.tree.search(this.tree.getRoot(),node.pId,"id");null!=pNode&&(pNode.open=!0,queue.push({pId:pNode.pId}),result.push(pNode))}return BI.uniqBy(BI.map(result,function(idx,node){return self._createJson(node,node.open)}),"id")},_digest:function(v){var o=this.options;if(o.itemsCreator===BI.emptyFn){var result=BI.find(o.items,function(i,item){return item.value===v});return BI.isNotNull(result)?result.text:o.text}return o.valueFormatter(v)},stopEditing:function(){this.searcher.stopSearch()},getSearcher:function(){return this.searcher},populate:function(items){this.options.items=items,this._initData(items)},setValue:function(v){this.editor.setState(this._digest(v[0]))},getValue:function(){return this.searcher.getValue()}}),BI.MultiLayerSelectTreeTrigger.EVENT_FOCUS="EVENT_FOCUS",BI.MultiLayerSelectTreeTrigger.EVENT_BLUR="EVENT_BLUR",BI.MultiLayerSelectTreeTrigger.EVENT_SEARCHING="EVENT_SEARCHING",BI.MultiLayerSelectTreeTrigger.EVENT_STOP="EVENT_STOP",BI.MultiLayerSelectTreeTrigger.EVENT_START="EVENT_START",BI.MultiLayerSelectTreeTrigger.EVENT_CHANGE="EVENT_CHANGE",BI.MultiLayerSelectTreeTrigger.EVENT_ADD_ITEM="EVENT_ADD_ITEM",BI.shortcut("bi.multilayer_select_tree_trigger",BI.MultiLayerSelectTreeTrigger),BI.MultiLayerSelectTreeFirstPlusGroupNode=BI.inherit(BI.NodeButton,{_defaultConfig:function(){var conf=BI.MultiLayerSelectTreeFirstPlusGroupNode.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{extraCls:"bi-multilayer-select-tree-first-plus-group-node bi-list-item-active",layer:0,id:"",pId:"",readonly:!0,open:!1,height:24})},_init:function(){BI.MultiLayerSelectTreeFirstPlusGroupNode.superclass._init.apply(this,arguments);var self=this,o=this.options;this.node=BI.createWidget({type:"bi.select_tree_first_plus_group_node",cls:"bi-list-item-none",stopPropagation:!0,logic:{dynamic:!0},id:o.id,pId:o.pId,keyword:o.keyword,open:o.open,height:o.height,hgap:o.hgap,text:o.text,value:o.value,py:o.py}),this.node.on(BI.Controller.EVENT_CHANGE,function(type){self.setSelected(self.isSelected()),self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)});for(var needBlankLayers=[],pNode=o.pNode;pNode;)pNode.isLastNode&&needBlankLayers.push(pNode.layer),pNode=pNode.pNode;var items=[];BI.count(0,o.layer,function(index){items.push({type:"bi.layout",cls:BI.contains(needBlankLayers,index)?"":"base-line-conn-background",width:12,height:o.height})}),items.push(this.node),BI.createWidget({type:"bi.td",element:this,columnSize:BI.makeArray(o.layer,12),items:[items]})},isOnce:function(){return!0},doRedMark:function(){this.node.doRedMark.apply(this.node,arguments)},unRedMark:function(){this.node.unRedMark.apply(this.node,arguments)},isSelected:function(){return this.node.isSelected()},setSelected:function(b){BI.MultiLayerSelectTreeFirstPlusGroupNode.superclass.setSelected.apply(this,arguments),this.node.setSelected(b)},doClick:function(){BI.NodeButton.superclass.doClick.apply(this,arguments),this.node.setSelected(this.isSelected())},setOpened:function(v){BI.MultiLayerSelectTreeFirstPlusGroupNode.superclass.setOpened.apply(this,arguments),this.node.setOpened(v)}}),BI.shortcut("bi.multilayer_select_tree_first_plus_group_node",BI.MultiLayerSelectTreeFirstPlusGroupNode),BI.MultiLayerSelectTreeLastPlusGroupNode=BI.inherit(BI.NodeButton,{_defaultConfig:function(){var conf=BI.MultiLayerSelectTreeLastPlusGroupNode.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{extraCls:"bi-multilayer-select-tree-last-plus-group-node bi-list-item-active",layer:0,id:"",pId:"",readonly:!0,open:!1,height:24})},_init:function(){BI.MultiLayerSelectTreeLastPlusGroupNode.superclass._init.apply(this,arguments);var self=this,o=this.options;this.node=BI.createWidget({type:"bi.select_tree_last_plus_group_node",cls:"bi-list-item-none",stopPropagation:!0,logic:{dynamic:!0},id:o.id,pId:o.pId,keyword:o.keyword,open:o.open,height:o.height,hgap:o.hgap,text:o.text,value:o.value,py:o.py}),this.node.on(BI.Controller.EVENT_CHANGE,function(type){self.setSelected(self.isSelected()),self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)});for(var needBlankLayers=[],pNode=o.pNode;pNode;)pNode.isLastNode&&needBlankLayers.push(pNode.layer),pNode=pNode.pNode;var items=[];BI.count(0,o.layer,function(index){items.push({type:"bi.layout",cls:BI.contains(needBlankLayers,index)?"":"base-line-conn-background",width:12,height:o.height})}),items.push(this.node),BI.createWidget({type:"bi.td",element:this,columnSize:BI.makeArray(o.layer,12),items:[items]})},doRedMark:function(){this.node.doRedMark.apply(this.node,arguments)},unRedMark:function(){this.node.unRedMark.apply(this.node,arguments)},isSelected:function(){return this.node.isSelected()},setSelected:function(b){BI.MultiLayerSelectTreeLastPlusGroupNode.superclass.setSelected.apply(this,arguments),this.node.setSelected(b)},doClick:function(){BI.MultiLayerSelectTreeLastPlusGroupNode.superclass.doClick.apply(this,arguments),this.node.setSelected(this.isSelected())},setOpened:function(v){BI.MultiLayerSelectTreeLastPlusGroupNode.superclass.setOpened.apply(this,arguments),this.node.setOpened(v)}}),BI.shortcut("bi.multilayer_select_tree_last_plus_group_node",BI.MultiLayerSelectTreeLastPlusGroupNode),BI.MultiLayerSelectTreeMidPlusGroupNode=BI.inherit(BI.NodeButton,{_defaultConfig:function(){var conf=BI.MultiLayerSelectTreeMidPlusGroupNode.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{extraCls:"bi-multilayer-select-tree-mid-plus-group-node bi-list-item-active",layer:0,id:"",pId:"",readonly:!0,open:!1,height:24})},_init:function(){BI.MultiLayerSelectTreeMidPlusGroupNode.superclass._init.apply(this,arguments);var self=this,o=this.options;this.node=BI.createWidget({type:"bi.select_tree_mid_plus_group_node",cls:"bi-list-item-none",stopPropagation:!0,logic:{dynamic:!0},id:o.id,pId:o.pId,keyword:o.keyword,open:o.open,height:o.height,hgap:o.hgap,text:o.text,value:o.value,py:o.py}),this.node.on(BI.Controller.EVENT_CHANGE,function(type){self.setSelected(self.isSelected()),self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)});for(var needBlankLayers=[],pNode=o.pNode;pNode;)pNode.isLastNode&&needBlankLayers.push(pNode.layer),pNode=pNode.pNode;var items=[];BI.count(0,o.layer,function(index){items.push({type:"bi.layout",cls:BI.contains(needBlankLayers,index)?"":"base-line-conn-background",width:12,height:o.height})}),items.push(this.node),BI.createWidget({type:"bi.td",element:this,columnSize:BI.makeArray(o.layer,12),items:[items]})},doRedMark:function(){this.node.doRedMark.apply(this.node,arguments)},unRedMark:function(){this.node.unRedMark.apply(this.node,arguments)},isSelected:function(){return this.node.isSelected()},setSelected:function(b){BI.MultiLayerSelectTreeMidPlusGroupNode.superclass.setSelected.apply(this,arguments),this.node.setSelected(b)},doClick:function(){BI.MultiLayerSelectTreeMidPlusGroupNode.superclass.doClick.apply(this,arguments),this.node.setSelected(this.isSelected())},setOpened:function(v){BI.MultiLayerSelectTreeMidPlusGroupNode.superclass.setOpened.apply(this,arguments),this.node.setOpened(v)}}),BI.shortcut("bi.multilayer_select_tree_mid_plus_group_node",BI.MultiLayerSelectTreeMidPlusGroupNode),BI.MultiLayerSelectTreePlusGroupNode=BI.inherit(BI.NodeButton,{_defaultConfig:function(){var conf=BI.MultiLayerSelectTreePlusGroupNode.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{extraCls:"bi-multilayer-select-tree-first-plus-group-node bi-list-item-active",layer:0,id:"",pId:"",readonly:!0,open:!1,height:24})},_init:function(){BI.MultiLayerSelectTreePlusGroupNode.superclass._init.apply(this,arguments);var self=this,o=this.options;this.node=BI.createWidget({type:"bi.select_tree_plus_group_node",cls:"bi-list-item-none",stopPropagation:!0,logic:{dynamic:!0},id:o.id,pId:o.pId,keyword:o.keyword,open:o.open,height:o.height,hgap:o.hgap,text:o.text,value:o.value,py:o.py}),this.node.on(BI.Controller.EVENT_CHANGE,function(type){self.setSelected(self.isSelected()),self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)});for(var needBlankLayers=[],pNode=o.pNode;pNode;)pNode.isLastNode&&needBlankLayers.push(pNode.layer),pNode=pNode.pNode;var items=[];BI.count(0,o.layer,function(index){items.push({type:"bi.layout",cls:BI.contains(needBlankLayers,index)?"":"base-line-conn-background",width:12,height:o.height})}),items.push(this.node),BI.createWidget({type:"bi.td",element:this,columnSize:BI.makeArray(o.layer,12),items:[items]})},isOnce:function(){return!0},doRedMark:function(){this.node.doRedMark.apply(this.node,arguments)},unRedMark:function(){this.node.unRedMark.apply(this.node,arguments)},isSelected:function(){return this.node.isSelected()},setSelected:function(b){BI.MultiLayerSelectTreePlusGroupNode.superclass.setSelected.apply(this,arguments),this.node.setSelected(b)},doClick:function(){BI.NodeButton.superclass.doClick.apply(this,arguments),this.node.setSelected(this.isSelected())},setOpened:function(v){BI.MultiLayerSelectTreePlusGroupNode.superclass.setOpened.apply(this,arguments),this.node.setOpened(v)}}),BI.shortcut("bi.multilayer_select_tree_plus_group_node",BI.MultiLayerSelectTreePlusGroupNode),BI.MultiLayerSingleTreeCombo=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.MultiLayerSingleTreeCombo.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-multilayer-single-tree-combo",isDefaultInit:!1,height:24,text:"",itemsCreator:BI.emptyFn,items:[],value:"",attributes:{tabIndex:0},allowEdit:!1,allowSearchValue:!1,allowInsertValue:!1})},render:function(){var self=this,o=this.options,combo=o.itemsCreator===BI.emptyFn?this._getSyncConfig():this._getAsyncConfig();return o.allowEdit||o.itemsCreator!==BI.emptyFn?{type:"bi.absolute",items:[{el:combo,left:0,right:0,top:0,bottom:0},{el:{type:"bi.trigger_icon_button",cls:"trigger-icon-button",ref:function(_ref){self.triggerBtn=_ref},width:o.height,height:o.height,handler:function(){self.combo.isViewVisible()?self.combo.hideView():self.combo.showView()}},right:0,bottom:0,top:0}]}:combo},_getBaseConfig:function(){var self=this,o=this.options;return{type:"bi.combo",container:o.container,adjustLength:2,ref:function(_ref){self.combo=_ref},popup:{el:{type:"bi.multilayer_single_tree_popup",isDefaultInit:o.isDefaultInit,itemsCreator:o.itemsCreator,items:o.items,ref:function(_ref){self.trigger&&self.trigger.getSearcher().setAdapter(_ref)},listeners:[{eventName:BI.MultiLayerSingleTreePopup.EVENT_CHANGE,action:function(){self.setValue(this.getValue()),self.combo.hideView(),self.fireEvent(BI.MultiLayerSingleTreeCombo.EVENT_CHANGE)}}]},value:o.value,maxHeight:400,minHeight:240}}},_getSearchConfig:function(){var self=this,o=this.options;return{el:{type:"bi.multilayer_single_tree_trigger",allowInsertValue:o.allowInsertValue,allowSearchValue:o.allowSearchValue,allowEdit:o.allowEdit,cls:"multilayer-single-tree-trigger",ref:function(_ref){self.trigger=_ref},watermark:o.watermark,items:o.items,itemsCreator:o.itemsCreator,valueFormatter:o.valueFormatter,height:o.height-2,text:o.text,value:o.value,tipType:o.tipType,warningTitle:o.warningTitle,title:o.title,listeners:[{eventName:BI.MultiLayerSingleTreeTrigger.EVENT_CHANGE,action:function(){self.setValue(this.getValue()),self.combo.hideView(),self.fireEvent(BI.MultiLayerSingleTreeCombo.EVENT_CHANGE)}},{eventName:BI.MultiLayerSingleTreeTrigger.EVENT_FOCUS,action:function(){self.fireEvent(BI.MultiLayerSingleTreeCombo.EVENT_FOCUS)}},{eventName:BI.MultiLayerSingleTreeTrigger.EVENT_BLUR,action:function(){self.fireEvent(BI.MultiLayerSingleTreeCombo.EVENT_BLUR)}},{eventName:BI.MultiLayerSingleTreeTrigger.EVENT_SEARCHING,action:function(){self.fireEvent(BI.MultiLayerSingleTreeCombo.EVENT_SEARCHING)}},{eventName:BI.MultiLayerSingleTreeTrigger.EVENT_ADD_ITEM,action:function(){var value=self.trigger.getSearcher().getKeyword();self.combo.setValue([value]),self.combo.hideView()}}]},hideChecker:function(e){return 0===self.triggerBtn.element.find(e.target).length},listeners:[{eventName:BI.Combo.EVENT_AFTER_HIDEVIEW,action:function(){self.trigger.stopEditing()}}]}},_getSyncConfig:function(){var o=this.options,baseConfig=this._getBaseConfig();return BI.extend(baseConfig,o.allowEdit?this._getSearchConfig():{el:{type:"bi.single_tree_trigger",text:o.text,height:o.height,items:o.items,value:o.value}})},_getAsyncConfig:function(){var config=this._getBaseConfig();return BI.extend(config,this._getSearchConfig())},setValue:function(v){v=BI.isArray(v)?v:[v],this.combo.setValue(v)},getValue:function(){return this.combo.getValue()},populate:function(items){this.combo.populate(items)}}),BI.MultiLayerSingleTreeCombo.EVENT_SEARCHING="EVENT_SEARCHING",BI.MultiLayerSingleTreeCombo.EVENT_BLUR="EVENT_BLUR",BI.MultiLayerSingleTreeCombo.EVENT_FOCUS="EVENT_FOCUS",BI.MultiLayerSingleTreeCombo.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.multilayer_single_tree_combo",BI.MultiLayerSingleTreeCombo),BI.MultiLayerSingleTreeInsertSearchPane=BI.inherit(BI.Widget,{props:function(){return{baseCls:"bi-multilayer-single-tree-popup",tipText:BI.i18nText("BI-No_Selected_Item"),isDefaultInit:!1,itemsCreator:BI.emptyFn,items:[],value:""}},render:function(){var self=this,o=this.options;return this.tree=BI.createWidget({type:"bi.multilayer_select_level_tree",isDefaultInit:o.isDefaultInit,items:o.items,itemsCreator:o.itemsCreator===BI.emptyFn?BI.emptyFn:function(op,callback){o.itemsCreator(op,function(res){callback(res),self.setKeyword(o.keywordGetter())})},keywordGetter:o.keywordGetter,value:o.value,scrollable:null,listeners:[{eventName:BI.Controller.EVENT_CHANGE,action:function(){self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}},{eventName:BI.MultiLayerSelectLevelTree.EVENT_CHANGE,action:function(){self.fireEvent(BI.MultiLayerSingleTreeInsertSearchPane.EVENT_CHANGE)}}]}),{type:"bi.vertical",scrolly:!1,scrollable:!0,vgap:5,items:[{type:"bi.text_button",invisible:!0,text:BI.i18nText("BI-Basic_Click_To_Add_Text",""),height:24,cls:"bi-high-light",hgap:5,ref:function(_ref){self.addNotMatchTip=_ref},handler:function(){self.fireEvent(BI.MultiLayerSingleTreeInsertSearchPane.EVENT_ADD_ITEM,o.keywordGetter())}},this.tree]}},setKeyword:function(keyword){var showTip=BI.isEmptyArray(this.tree.getAllLeaves());this.addNotMatchTip.setVisible(showTip),showTip&&this.addNotMatchTip.setText(BI.i18nText("BI-Basic_Click_To_Add_Text",keyword))},getValue:function(){return this.tree.getValue()},setValue:function(v){v=BI.isArray(v)?v:[v],this.tree.setValue(v)},populate:function(items){this.tree.populate(items)}}),BI.MultiLayerSingleTreeInsertSearchPane.EVENT_ADD_ITEM="EVENT_ADD_ITEM",BI.MultiLayerSingleTreeInsertSearchPane.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.multilayer_single_tree_insert_search_pane",BI.MultiLayerSingleTreeInsertSearchPane),BI.MultiLayerSingleLevelTree=BI.inherit(BI.Pane,{_defaultConfig:function(){return BI.extend(BI.MultiLayerSingleLevelTree.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-multilayer-single-level-tree",isDefaultInit:!1,items:[],itemsCreator:BI.emptyFn,keywordGetter:BI.emptyFn,chooseType:BI.Selection.Single,scrollable:!0})},_init:function(){var o=this.options;BI.MultiLayerSingleLevelTree.superclass._init.apply(this,arguments),this.storeValue=o.value,this.initTree(this.options.items),this.check()},_formatItems:function(nodes,layer,pNode){var self=this,o=this.options,keyword=o.keywordGetter();return BI.each(nodes,function(i,node){var extend={};node.layer=layer,BI.isKey(node.id)||(node.id=BI.UUID()),node.keyword=node.keyword||keyword,extend.pNode=pNode,node.isParent===!0||node.parent===!0||BI.isNotEmptyArray(node.children)?(extend.type="bi.multilayer_single_tree_mid_plus_group_node",i===nodes.length-1&&(extend.type="bi.multilayer_single_tree_last_plus_group_node",extend.isLastNode=!0),0!==i||pNode||(extend.type="bi.multilayer_single_tree_first_plus_group_node"),0!==i||i!==nodes.length-1||pNode||(extend.type="bi.multilayer_single_tree_plus_group_node"),BI.defaults(node,extend),self._formatItems(node.children,layer+1,node)):(extend.type="bi.multilayer_single_tree_mid_tree_leaf_item",0!==i||pNode||(extend.type="bi.multilayer_single_tree_first_tree_leaf_item"),i===nodes.length-1&&(extend.type="bi.multilayer_single_tree_last_tree_leaf_item"),BI.defaults(node,extend))}),nodes},_assertId:function(sNodes){BI.each(sNodes,function(i,node){node.id=node.id||BI.UUID()})},initTree:function(nodes){var self=this,o=this.options,hasNext=!1;this.empty(),this._assertId(nodes),this.tree=BI.createWidget({type:"bi.custom_tree",cls:"tree-view display-table",expander:{isDefaultInit:o.isDefaultInit,el:{},popup:{type:"bi.custom_tree"}},items:this._formatItems(BI.Tree.transformToTreeFormat(nodes),0),value:o.value,itemsCreator:function(op,callback){1===op.times&&!op.node&&BI.nextTick(function(){self.loading()}),o.itemsCreator(op,function(ob){hasNext=ob.hasNext,1===op.times&&!op.node&&self._populate(ob.items),callback(self._formatItems(BI.Tree.transformToTreeFormat(ob.items),op.node?op.node.layer+1:0,op.node)),self.setValue(self.storeValue),1===op.times&&!op.node&&BI.nextTick(function(){self.loaded()})})},el:{type:"bi.loader",isDefaultInit:o.itemsCreator!==BI.emptyFn,el:{type:"bi.button_tree",chooseType:o.chooseType,behaviors:o.behaviors,layouts:[{type:"bi.vertical"}]},hasNext:function(){return hasNext}}}),this.tree.on(BI.Controller.EVENT_CHANGE,function(type,v){self.fireEvent(BI.Controller.EVENT_CHANGE,arguments),type===BI.Events.CLICK&&(self.setValue(v),self.fireEvent(BI.MultiLayerSingleLevelTree.EVENT_CHANGE,v))}),BI.createWidget({type:"bi.adaptive",element:this,scrollable:o.scrollable,items:[this.tree]})},_populate:function(){BI.MultiLayerSelectLevelTree.superclass.populate.apply(this,arguments)},populate:function(nodes){this._populate(nodes),BI.isNull(nodes)?this.tree.populate():this.tree.populate(this._formatItems(BI.Tree.transformToTreeFormat(nodes),0))},setValue:function(v){this.options.chooseType===BI.Selection.None||(this.storeValue=v,this.tree.setValue(v))},getValue:function(){return BI.isArray(this.storeValue)?this.storeValue:BI.isNull(this.storeValue)?[]:[this.storeValue]},getAllLeaves:function(){return this.tree.getAllLeaves()},getNodeById:function(id){return this.tree.getNodeById(id)},getNodeByValue:function(id){return this.tree.getNodeByValue(id)}}),BI.MultiLayerSingleLevelTree.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.multilayer_single_level_tree",BI.MultiLayerSingleLevelTree),BI.MultiLayerSingleTreePopup=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.MultiLayerSingleTreePopup.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-multilayer-singletree-popup",tipText:BI.i18nText("BI-No_Selected_Item"),isDefaultInit:!1,itemsCreator:BI.emptyFn,items:[]})},_init:function(){BI.MultiLayerSingleTreePopup.superclass._init.apply(this,arguments);var self=this,o=this.options;this.tree=BI.createWidget({type:"bi.multilayer_single_level_tree",isDefaultInit:o.isDefaultInit,items:o.items,itemsCreator:o.itemsCreator,keywordGetter:o.keywordGetter,value:o.value,scrollable:null}),BI.createWidget({type:"bi.vertical",scrolly:!1,scrollable:!0,element:this,vgap:5,items:[this.tree]}),this.tree.on(BI.Controller.EVENT_CHANGE,function(){self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.tree.on(BI.MultiLayerSingleLevelTree.EVENT_CHANGE,function(){self.fireEvent(BI.MultiLayerSingleTreePopup.EVENT_CHANGE)})},getValue:function(){return this.tree.getValue()},setValue:function(v){v=BI.isArray(v)?v:[v],this.tree.setValue(v)},populate:function(items){this.tree.populate(items)}}),BI.MultiLayerSingleTreePopup.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.multilayer_single_tree_popup",BI.MultiLayerSingleTreePopup),BI.MultiLayerSingleTreeTrigger=BI.inherit(BI.Trigger,{props:function(){return{extraCls:"bi-multi-layer-single-tree-trigger bi-border bi-focus-shadow",height:24,valueFormatter:function(v){return v},itemsCreator:BI.emptyFn,watermark:BI.i18nText("BI-Basic_Search"),allowSearchValue:!1}},render:function(){var self=this,o=this.options;o.itemsCreator===BI.emptyFn&&this._initData();var content={type:"bi.htape",items:[{el:{type:"bi.searcher",ref:function(){self.searcher=this},isAutoSearch:!1,el:{type:"bi.state_editor",ref:function(){self.editor=this},defaultText:o.text,text:this._digest(o.value),value:o.value,height:o.height,tipText:"",watermark:o.watermark,listeners:[{eventName:BI.StateEditor.EVENT_FOCUS,action:function(){self.fireEvent(BI.MultiLayerSingleTreeTrigger.EVENT_FOCUS)}},{eventName:BI.StateEditor.EVENT_BLUR,action:function(){self.fireEvent(BI.MultiLayerSingleTreeTrigger.EVENT_BLUR)}},{eventName:BI.StateEditor.EVENT_CHANGE,action:function(){self.fireEvent(BI.MultiLayerSingleTreeTrigger.EVENT_SEARCHING)}}]},popup:{type:o.allowInsertValue?"bi.multilayer_single_tree_insert_search_pane":"bi.multilayer_single_tree_popup",itemsCreator:o.itemsCreator===BI.emptyFn?BI.emptyFn:function(op,callback){op.keyword=self.editor.getValue(),o.itemsCreator(op,callback)},keywordGetter:function(){return self.editor.getValue()},cls:"bi-card",listeners:[{eventName:BI.MultiLayerSingleTreeInsertSearchPane.EVENT_ADD_ITEM,action:function(){self.options.text=self.getSearcher().getKeyword(),self.fireEvent(BI.MultiLayerSingleTreeTrigger.EVENT_ADD_ITEM)}}],ref:function(_ref){self.popup=_ref}},onSearch:function(obj,callback){var keyword=obj.keyword;o.itemsCreator===BI.emptyFn?(callback(self._getSearchItems(keyword)),o.allowInsertValue&&self.popup.setKeyword(keyword)):callback()},listeners:[{eventName:BI.Searcher.EVENT_CHANGE,action:function(){self.fireEvent(BI.MultiLayerSingleTreeTrigger.EVENT_CHANGE)}}]}},{el:{type:"bi.layout",width:24},width:24}]};return o.allowEdit?content:{type:"bi.absolute",items:[{el:content,left:0,right:0,top:0,bottom:0},{el:{type:"bi.layout"},left:0,right:24,top:0,bottom:0}]}},_initData:function(){var o=this.options;this.tree=new BI.Tree,this.nodes=BI.Tree.treeFormat(BI.deepClone(o.items)),this.tree.initTree(this.nodes)},_getSearchItems:function(keyword){var self=this,o=this.options,items=[];return this.tree.traverse(function(node){var find=BI.Func.getSearchResult(self.tree.isRoot(node)?[]:BI.concat([node.text],o.allowSearchValue?[node.value]:[]),keyword);if(find.find.length>0||find.match.length>0)return items.push(node),!0}),this._fillTreeStructure4Search(items,"id")},_createJson:function(node,open){return{id:node.id,pId:node.pId,text:node.text,value:node.value,isParent:BI.isNotEmptyArray(node.children),open:open}},_getChildren:function(node){var self=this;node.children=node.children||[];var nodes=[];return BI.each(node.children,function(idx,child){var children=self._getChildren(child);nodes=nodes.concat(children)}),node.children.concat(nodes)},_fillTreeStructure4Search:function(leaves){var self=this,result=[],queue=[];for(BI.each(leaves,function(idx,node){queue.push({pId:node.pId}),result.push(node),result=result.concat(self._getChildren(node))});BI.isNotEmptyArray(queue);){var node=queue.pop(),pNode=this.tree.search(this.tree.getRoot(),node.pId,"id");null!=pNode&&(pNode.open=!0,queue.push({pId:pNode.pId}),result.push(pNode))}return BI.uniqBy(BI.map(result,function(idx,node){return self._createJson(node,node.open)}),"id")},_digest:function(v){var o=this.options;if(o.itemsCreator===BI.emptyFn){var result=BI.find(o.items,function(i,item){return item.value===v});return BI.isNotNull(result)?result.text:o.text}return o.valueFormatter(v)}, +stopEditing:function(){this.searcher.stopSearch()},getSearcher:function(){return this.searcher},populate:function(items){this.options.items=items,this._initData()},setValue:function(v){this.editor.setState(this._digest(v[0]))},getValue:function(){return this.searcher.getValue()}}),BI.MultiLayerSingleTreeTrigger.EVENT_FOCUS="EVENT_FOCUS",BI.MultiLayerSingleTreeTrigger.EVENT_BLUR="EVENT_BLUR",BI.MultiLayerSingleTreeTrigger.EVENT_SEARCHING="EVENT_SEARCHING",BI.MultiLayerSingleTreeTrigger.EVENT_STOP="EVENT_STOP",BI.MultiLayerSingleTreeTrigger.EVENT_START="EVENT_START",BI.MultiLayerSingleTreeTrigger.EVENT_CHANGE="EVENT_CHANGE",BI.MultiLayerSingleTreeTrigger.EVENT_ADD_ITEM="EVENT_ADD_ITEM",BI.shortcut("bi.multilayer_single_tree_trigger",BI.MultiLayerSingleTreeTrigger),BI.MultiLayerSingleTreeFirstPlusGroupNode=BI.inherit(BI.NodeButton,{_defaultConfig:function(){var conf=BI.MultiLayerSingleTreeFirstPlusGroupNode.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{extraCls:"bi-multilayer-single-tree-first-plus-group-node bi-list-item",layer:0,id:"",pId:"",open:!1,height:24})},_init:function(){BI.MultiLayerSingleTreeFirstPlusGroupNode.superclass._init.apply(this,arguments);var self=this,o=this.options;this.node=this._createNode();for(var needBlankLayers=[],pNode=o.pNode;pNode;)pNode.isLastNode&&needBlankLayers.push(pNode.layer),pNode=pNode.pNode;var items=[];BI.count(0,o.layer,function(index){items.push({type:"bi.layout",cls:BI.contains(needBlankLayers,index)?"":"base-line-conn-background",width:12,height:o.height})}),items.push(this.node),BI.createWidget({type:"bi.td",element:this,columnSize:BI.makeArray(o.layer,12),items:[items]})},doRedMark:function(){this.node.doRedMark.apply(this.node,arguments)},unRedMark:function(){this.node.unRedMark.apply(this.node,arguments)},doClick:function(){BI.MultiLayerSingleTreeFirstPlusGroupNode.superclass.doClick.apply(this,arguments),this.node.setSelected(this.isSelected())},setOpened:function(v){BI.MultiLayerSingleTreeFirstPlusGroupNode.superclass.setOpened.apply(this,arguments),BI.isNotNull(this.node)&&this.node.setOpened(v)},_createNode:function(){var self=this,o=this.options;return BI.createWidget({type:"bi.first_plus_group_node",cls:"bi-list-item-none",logic:{dynamic:!0},id:o.id,pId:o.pId,open:o.open,isLastNode:o.isLastNode,height:o.height,hgap:o.hgap,text:o.text,value:o.value,py:o.py,keyword:o.keyword,listeners:[{eventName:BI.Controller.EVENT_CHANGE,action:function(type){type!==BI.Events.CLICK&&self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}}]})}}),BI.shortcut("bi.multilayer_single_tree_first_plus_group_node",BI.MultiLayerSingleTreeFirstPlusGroupNode),BI.MultiLayerSingleTreeLastPlusGroupNode=BI.inherit(BI.NodeButton,{_defaultConfig:function(){var conf=BI.MultiLayerSingleTreeLastPlusGroupNode.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{extraCls:"bi-multilayer-single-tree-last-plus-group-node bi-list-item",layer:0,id:"",pId:"",open:!1,height:24})},_init:function(){BI.MultiLayerSingleTreeLastPlusGroupNode.superclass._init.apply(this,arguments);var self=this,o=this.options;this.node=this._createNode();for(var needBlankLayers=[],pNode=o.pNode;pNode;)pNode.isLastNode&&needBlankLayers.push(pNode.layer),pNode=pNode.pNode;var items=[];BI.count(0,o.layer,function(index){items.push({type:"bi.layout",cls:BI.contains(needBlankLayers,index)?"":"base-line-conn-background",width:12,height:o.height})}),items.push(this.node),BI.createWidget({type:"bi.td",element:this,columnSize:BI.makeArray(o.layer,12),items:[items]})},doRedMark:function(){this.node.doRedMark.apply(this.node,arguments)},unRedMark:function(){this.node.unRedMark.apply(this.node,arguments)},doClick:function(){BI.MultiLayerSingleTreeLastPlusGroupNode.superclass.doClick.apply(this,arguments),this.node.setSelected(this.isSelected())},setOpened:function(v){BI.MultiLayerSingleTreeLastPlusGroupNode.superclass.setOpened.apply(this,arguments),BI.isNotNull(this.node)&&this.node.setOpened(v)},_createNode:function(){var self=this,o=this.options;return BI.createWidget({type:"bi.last_plus_group_node",cls:"bi-list-item-none",logic:{dynamic:!0},id:o.id,pId:o.pId,open:o.open,height:o.height,hgap:o.hgap,text:o.text,value:o.value,py:o.py,keyword:o.keyword,listeners:[{eventName:BI.Controller.EVENT_CHANGE,action:function(type){type!==BI.Events.CLICK&&self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}}]})}}),BI.shortcut("bi.multilayer_single_tree_last_plus_group_node",BI.MultiLayerSingleTreeLastPlusGroupNode),BI.MultiLayerSingleTreeMidPlusGroupNode=BI.inherit(BI.NodeButton,{_defaultConfig:function(){var conf=BI.MultiLayerSingleTreeMidPlusGroupNode.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{extraCls:"bi-multilayer-single-tree-mid-plus-group-node bi-list-item",layer:0,id:"",pId:"",open:!1,height:24})},_init:function(){BI.MultiLayerSingleTreeMidPlusGroupNode.superclass._init.apply(this,arguments);var self=this,o=this.options;this.node=this._createNode();for(var needBlankLayers=[],pNode=o.pNode;pNode;)pNode.isLastNode&&needBlankLayers.push(pNode.layer),pNode=pNode.pNode;var items=[];BI.count(0,o.layer,function(index){items.push({type:"bi.layout",cls:BI.contains(needBlankLayers,index)?"":"base-line-conn-background",width:12,height:o.height})}),items.push(this.node),BI.createWidget({type:"bi.td",element:this,columnSize:BI.makeArray(o.layer,12),items:[items]})},doRedMark:function(){this.node.doRedMark.apply(this.node,arguments)},unRedMark:function(){this.node.unRedMark.apply(this.node,arguments)},doClick:function(){BI.MultiLayerSingleTreeMidPlusGroupNode.superclass.doClick.apply(this,arguments),this.node.setSelected(this.isSelected())},setOpened:function(v){BI.MultiLayerSingleTreeMidPlusGroupNode.superclass.setOpened.apply(this,arguments),BI.isNotNull(this.node)&&this.node.setOpened(v)},_createNode:function(){var self=this,o=this.options;return BI.createWidget({type:"bi.mid_plus_group_node",cls:"bi-list-item-none",logic:{dynamic:!0},id:o.id,pId:o.pId,open:o.open,height:o.height,hgap:o.hgap,text:o.text,value:o.value,py:o.py,keyword:o.keyword,listeners:[{eventName:BI.Controller.EVENT_CHANGE,action:function(type){type!==BI.Events.CLICK&&self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}}]})}}),BI.shortcut("bi.multilayer_single_tree_mid_plus_group_node",BI.MultiLayerSingleTreeMidPlusGroupNode),BI.MultiLayerSingleTreePlusGroupNode=BI.inherit(BI.NodeButton,{_defaultConfig:function(){var conf=BI.MultiLayerSingleTreePlusGroupNode.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{extraCls:"bi-multilayer-single-tree-plus-group-node bi-list-item",layer:0,id:"",pId:"",open:!1,height:24})},_init:function(){BI.MultiLayerSingleTreePlusGroupNode.superclass._init.apply(this,arguments);var self=this,o=this.options;this.node=this._createNode();for(var needBlankLayers=[],pNode=o.pNode;pNode;)pNode.isLastNode&&needBlankLayers.push(pNode.layer),pNode=pNode.pNode;var items=[];BI.count(0,o.layer,function(index){items.push({type:"bi.layout",cls:BI.contains(needBlankLayers,index)?"":"base-line-conn-background",width:12,height:o.height})}),items.push(this.node),BI.createWidget({type:"bi.td",element:this,columnSize:BI.makeArray(o.layer,12),items:[items]})},doRedMark:function(){this.node.doRedMark.apply(this.node,arguments)},unRedMark:function(){this.node.unRedMark.apply(this.node,arguments)},doClick:function(){BI.MultiLayerSingleTreePlusGroupNode.superclass.doClick.apply(this,arguments),this.node.setSelected(this.isSelected())},setOpened:function(v){BI.MultiLayerSingleTreePlusGroupNode.superclass.setOpened.apply(this,arguments),BI.isNotNull(this.node)&&this.node.setOpened(v)},_createNode:function(){var self=this,o=this.options;return BI.createWidget({type:"bi.plus_group_node",cls:"bi-list-item-none",logic:{dynamic:!0},id:o.id,pId:o.pId,open:o.open,isLastNode:o.isLastNode,height:o.height,hgap:o.hgap,text:o.text,value:o.value,py:o.py,keyword:o.keyword,listeners:[{eventName:BI.Controller.EVENT_CHANGE,action:function(type){type!==BI.Events.CLICK&&self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}}]})}}),BI.shortcut("bi.multilayer_single_tree_plus_group_node",BI.MultiLayerSingleTreePlusGroupNode),BI.MultiLayerSingleTreeFirstTreeLeafItem=BI.inherit(BI.BasicButton,{_defaultConfig:function(){return BI.extend(BI.MultiLayerSingleTreeFirstTreeLeafItem.superclass._defaultConfig.apply(this,arguments),{extraCls:"bi-multilayer-single-tree-first-tree-leaf-item bi-list-item-active",logic:{dynamic:!1},layer:0,id:"",pId:"",height:24})},_init:function(){BI.MultiLayerSingleTreeFirstTreeLeafItem.superclass._init.apply(this,arguments);var self=this,o=this.options;this.item=BI.createWidget({type:"bi.first_tree_leaf_item",cls:"bi-list-item-none",logic:{dynamic:!0},id:o.id,pId:o.pId,height:o.height,hgap:o.hgap,text:o.text,value:o.value,py:o.py,keyword:o.keyword}),this.item.on(BI.Controller.EVENT_CHANGE,function(type){type!==BI.Events.CLICK&&self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)});for(var needBlankLayers=[],pNode=o.pNode;pNode;)pNode.isLastNode&&needBlankLayers.push(pNode.layer),pNode=pNode.pNode;var items=[];BI.count(0,o.layer,function(index){items.push({type:"bi.layout",cls:BI.contains(needBlankLayers,index)?"":"base-line-conn-background",width:12,height:o.height})}),items.push(this.item),BI.createWidget({type:"bi.td",element:this,columnSize:BI.makeArray(o.layer,12),items:[items]})},doHighLight:function(){this.item.doHighLight.apply(this.item,arguments)},unHighLight:function(){this.item.unHighLight.apply(this.item,arguments)},getId:function(){return this.options.id},getPId:function(){return this.options.pId},doClick:function(){BI.MultiLayerSingleTreeFirstTreeLeafItem.superclass.doClick.apply(this,arguments),this.item.setSelected(this.isSelected())},setSelected:function(v){BI.MultiLayerSingleTreeFirstTreeLeafItem.superclass.setSelected.apply(this,arguments),this.item.setSelected(v)}}),BI.shortcut("bi.multilayer_single_tree_first_tree_leaf_item",BI.MultiLayerSingleTreeFirstTreeLeafItem),BI.MultiLayerSingleTreeLastTreeLeafItem=BI.inherit(BI.BasicButton,{_defaultConfig:function(){return BI.extend(BI.MultiLayerSingleTreeLastTreeLeafItem.superclass._defaultConfig.apply(this,arguments),{extraCls:"bi-multilayer-single-tree-last-tree-leaf-item bi-list-item-active",logic:{dynamic:!1},layer:0,id:"",pId:"",height:24})},_init:function(){BI.MultiLayerSingleTreeLastTreeLeafItem.superclass._init.apply(this,arguments);var self=this,o=this.options;this.item=BI.createWidget({type:"bi.last_tree_leaf_item",cls:"bi-list-item-none",logic:{dynamic:!0},id:o.id,pId:o.pId,height:o.height,hgap:o.hgap,text:o.text,value:o.value,py:o.py,keyword:o.keyword}),this.item.on(BI.Controller.EVENT_CHANGE,function(type){type!==BI.Events.CLICK&&self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)});for(var needBlankLayers=[],pNode=o.pNode;pNode;)pNode.isLastNode&&needBlankLayers.push(pNode.layer),pNode=pNode.pNode;var items=[];BI.count(0,o.layer,function(index){items.push({type:"bi.layout",cls:BI.contains(needBlankLayers,index)?"":"base-line-conn-background",width:12,height:o.height})}),items.push(this.item),BI.createWidget({type:"bi.td",element:this,columnSize:BI.makeArray(o.layer,12),items:[items]})},doHighLight:function(){this.item.doHighLight.apply(this.item,arguments)},unHighLight:function(){this.item.unHighLight.apply(this.item,arguments)},getId:function(){return this.options.id},getPId:function(){return this.options.pId},doClick:function(){BI.MultiLayerSingleTreeLastTreeLeafItem.superclass.doClick.apply(this,arguments),this.item.setSelected(this.isSelected())},setSelected:function(v){BI.MultiLayerSingleTreeLastTreeLeafItem.superclass.setSelected.apply(this,arguments),this.item.setSelected(v)}}),BI.shortcut("bi.multilayer_single_tree_last_tree_leaf_item",BI.MultiLayerSingleTreeLastTreeLeafItem),BI.MultiLayerSingleTreeMidTreeLeafItem=BI.inherit(BI.BasicButton,{_defaultConfig:function(){return BI.extend(BI.MultiLayerSingleTreeMidTreeLeafItem.superclass._defaultConfig.apply(this,arguments),{extraCls:"bi-multilayer-single-tree-mid-tree-leaf-item bi-list-item-active",logic:{dynamic:!1},layer:0,id:"",pId:"",height:24})},_init:function(){BI.MultiLayerSingleTreeMidTreeLeafItem.superclass._init.apply(this,arguments);var self=this,o=this.options;this.item=BI.createWidget({type:"bi.mid_tree_leaf_item",cls:"bi-list-item-none",logic:{dynamic:!0},id:o.id,pId:o.pId,height:o.height,hgap:o.hgap,text:o.text,value:o.value,py:o.py,keyword:o.keyword}),this.item.on(BI.Controller.EVENT_CHANGE,function(type){type!==BI.Events.CLICK&&self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)});for(var needBlankLayers=[],pNode=o.pNode;pNode;)pNode.isLastNode&&needBlankLayers.push(pNode.layer),pNode=pNode.pNode;var items=[];BI.count(0,o.layer,function(index){items.push({type:"bi.layout",cls:BI.contains(needBlankLayers,index)?"":"base-line-conn-background",width:12,height:o.height})}),items.push(this.item),BI.createWidget({type:"bi.td",element:this,columnSize:BI.makeArray(o.layer,12),items:[items]})},doHighLight:function(){this.item.doHighLight.apply(this.item,arguments)},unHighLight:function(){this.item.unHighLight.apply(this.item,arguments)},getId:function(){return this.options.id},getPId:function(){return this.options.pId},doClick:function(){BI.MultiLayerSingleTreeMidTreeLeafItem.superclass.doClick.apply(this,arguments),this.item.setSelected(this.isSelected())},setSelected:function(v){BI.MultiLayerSingleTreeMidTreeLeafItem.superclass.setSelected.apply(this,arguments),this.item.setSelected(v)}}),BI.shortcut("bi.multilayer_single_tree_mid_tree_leaf_item",BI.MultiLayerSingleTreeMidTreeLeafItem),BI.MultiSelectCheckPane=BI.inherit(BI.Widget,{constants:{height:12,lgap:10,tgap:10,bgap:5},_defaultConfig:function(){return BI.extend(BI.MultiSelectCheckPane.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-multi-select-check-pane bi-background",items:[],itemsCreator:BI.emptyFn,valueFormatter:BI.emptyFn,onClickContinueSelect:BI.emptyFn})},_init:function(){BI.MultiSelectCheckPane.superclass._init.apply(this,arguments);var self=this,opts=this.options;this.storeValue=opts.value||{},this.display=BI.createWidget({type:"bi.display_selected_list",items:opts.items,itemsCreator:function(op,callback){return op=BI.extend(op||{},{selectedValues:self.storeValue.value}),self.storeValue.type===BI.Selection.Multi?void callback({items:BI.map(self.storeValue.value,function(i,v){var txt=opts.valueFormatter(v)||v;return{text:txt,value:v,title:txt}})}):void opts.itemsCreator(op,callback)}}),this.continueSelect=BI.createWidget({type:"bi.text_button",text:BI.i18nText("BI-Continue_Select"),cls:"multi-select-check-selected bi-high-light"}),this.continueSelect.on(BI.TextButton.EVENT_CHANGE,function(){opts.onClickContinueSelect()}),BI.createWidget({type:"bi.vtape",element:this,items:[{height:this.constants.height,el:{type:"bi.vertical_adapt",cls:"multi-select-continue-select",items:[{el:{type:"bi.label",text:BI.i18nText("BI-Selected_Data")},lgap:this.constants.lgap},{el:this.continueSelect,lgap:this.constants.lgap}]},tgap:this.constants.tgap},{height:"fill",el:this.display,tgap:this.constants.bgap}]})},setValue:function(v){this.storeValue=v||{}},empty:function(){this.display.empty()},populate:function(){this.display.populate.apply(this.display,arguments)}}),BI.shortcut("bi.multi_select_check_pane",BI.MultiSelectCheckPane),BI.DisplaySelectedList=BI.inherit(BI.Pane,{constants:{height:24,lgap:10},_defaultConfig:function(){return BI.extend(BI.DisplaySelectedList.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-display-list",itemsCreator:BI.emptyFn,items:[]})},_init:function(){BI.DisplaySelectedList.superclass._init.apply(this,arguments);var self=this,opts=this.options;this.hasNext=!1,this.button_group=BI.createWidget({type:"bi.list_pane",element:this,el:{type:"bi.loader",isDefaultInit:!1,logic:{dynamic:!0,scrolly:!0},items:this._createItems(opts.items),chooseType:BI.ButtonGroup.CHOOSE_TYPE_MULTI,layouts:[{type:"bi.vertical",lgap:10}]},itemsCreator:function(options,callback){opts.itemsCreator(options,function(ob){self.hasNext=!!ob.hasNext,callback(self._createItems(ob.items))})},hasNext:function(){return self.hasNext}})},_createItems:function(items){return BI.createItems(items,{type:"bi.icon_text_item",cls:"cursor-default check-font icon-size-12 display-list-item bi-tips",once:!0,invalid:!0,selected:!0,height:this.constants.height,logic:{dynamic:!0}})},empty:function(){this.button_group.empty()},populate:function(items){0===arguments.length?this.button_group.populate():this.button_group.populate(this._createItems(items))}}),BI.shortcut("bi.display_selected_list",BI.DisplaySelectedList),BI.MultiSelectCombo=BI.inherit(BI.Single,{_defaultConfig:function(){return BI.extend(BI.MultiSelectCombo.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-multi-select-combo",itemsCreator:BI.emptyFn,valueFormatter:BI.emptyFn,height:24,attributes:{tabIndex:0},allowEdit:!0})},_init:function(){BI.MultiSelectCombo.superclass._init.apply(this,arguments);var self=this,o=this.options,assertShowValue=function(){BI.isKey(self._startValue)&&(self.storeValue.type===BI.Selection.All?BI.remove(self.storeValue.value,self._startValue):BI.pushDistinct(self.storeValue.value,self._startValue)),self.trigger.getSearcher().setState(self.storeValue),self.numberCounter.setButtonChecked(self.storeValue)};this.storeValue=o.value||{},this._assertValue(this.storeValue),this.requesting=!1,this.trigger=BI.createWidget({type:"bi.multi_select_trigger",allowEdit:o.allowEdit,height:o.height,text:o.text,masker:{offset:{left:0,top:0,right:0,bottom:25}},valueFormatter:o.valueFormatter,itemsCreator:BI.bind(this._itemsCreator4Trigger,this),value:this.storeValue}),this.trigger.on(BI.MultiSelectTrigger.EVENT_FOCUS,function(){self.fireEvent(BI.MultiSelectCombo.EVENT_FOCUS)}),this.trigger.on(BI.MultiSelectTrigger.EVENT_BLUR,function(){self.fireEvent(BI.MultiSelectCombo.EVENT_BLUR)}),this.trigger.on(BI.MultiSelectTrigger.EVENT_START,function(){self._setStartValue(""),this.getSearcher().setValue(self.storeValue)}),this.trigger.on(BI.MultiSelectTrigger.EVENT_STOP,function(){self._setStartValue(""),self.fireEvent(BI.MultiSelectCombo.EVENT_STOP)}),this.trigger.on(BI.MultiSelectTrigger.EVENT_PAUSE,function(){if(this.getSearcher().hasMatched()){var keyword=this.getSearcher().getKeyword();self._join({type:BI.Selection.Multi,value:[keyword]},function(){self.combo.setValue(self.storeValue),self._setStartValue(keyword),assertShowValue(),self.populate(),self._setStartValue("")})}}),this.trigger.on(BI.MultiSelectTrigger.EVENT_SEARCHING,function(keywords){var last=BI.last(keywords);keywords=BI.initial(keywords||[]),keywords.length>0&&self._joinKeywords(keywords,function(){BI.isEndWithBlank(last)?(self.combo.setValue(self.storeValue),assertShowValue(),self.combo.populate(),self._setStartValue("")):(self.combo.setValue(self.storeValue),assertShowValue())}),self.fireEvent(BI.MultiSelectCombo.EVENT_SEARCHING)}),this.trigger.on(BI.MultiSelectTrigger.EVENT_CHANGE,function(value,obj){obj instanceof BI.MultiSelectBar?self._joinAll(this.getValue(),function(){assertShowValue()}):self._join(this.getValue(),function(){assertShowValue()}),self.fireEvent(BI.MultiSelectCombo.EVENT_CLICK_ITEM)}),this.trigger.on(BI.MultiSelectTrigger.EVENT_BEFORE_COUNTER_POPUPVIEW,function(){self.numberCounter.updateSelectedValue(self.storeValue)}),this.trigger.on(BI.MultiSelectTrigger.EVENT_COUNTER_CLICK,function(){self.combo.isViewVisible()||self.combo.showView()}),this.combo=BI.createWidget({type:"bi.combo",toggle:!1,container:o.container,el:this.trigger,adjustLength:1,popup:{type:"bi.multi_select_popup_view",ref:function(){self.popup=this,self.trigger.setAdapter(this),self.numberCounter.setAdapter(this)},listeners:[{eventName:BI.MultiSelectPopupView.EVENT_CHANGE,action:function(){self.storeValue=this.getValue(),self._adjust(function(){assertShowValue()}),self.fireEvent(BI.MultiSelectCombo.EVENT_CLICK_ITEM)}},{eventName:BI.MultiSelectPopupView.EVENT_CLICK_CONFIRM,action:function(){self._defaultState()}},{eventName:BI.MultiSelectPopupView.EVENT_CLICK_CLEAR,action:function(){self.setValue(),self._defaultState()}}],itemsCreator:o.itemsCreator,valueFormatter:o.valueFormatter,onLoaded:function(){BI.nextTick(function(){self.combo.adjustWidth(),self.combo.adjustHeight(),self.numberCounter.adjustView(),self.trigger.getSearcher().adjustView()})}},value:o.value,hideChecker:function(e){return 0===triggerBtn.element.find(e.target).length&&0===self.numberCounter.element.find(e.target).length}}),this.combo.on(BI.Combo.EVENT_BEFORE_POPUPVIEW,function(){this.setValue(self.storeValue),BI.nextTick(function(){self.populate()})}),this.wants2Quit=!1,this.combo.on(BI.Combo.EVENT_AFTER_HIDEVIEW,function(){self._stopEditing(),self.requesting===!0?self.wants2Quit=!0:self.fireEvent(BI.MultiSelectCombo.EVENT_CONFIRM)});var triggerBtn=BI.createWidget({type:"bi.trigger_icon_button",width:o.height,height:o.height,cls:"multi-select-trigger-icon-button"});triggerBtn.on(BI.TriggerIconButton.EVENT_CHANGE,function(){self.numberCounter.hideView(),self.combo.isViewVisible()?self.combo.hideView():self.combo.showView()}),this.numberCounter=BI.createWidget({type:"bi.multi_select_check_selected_switcher",masker:{offset:{left:0,top:0,right:0,bottom:25}},valueFormatter:o.valueFormatter,itemsCreator:BI.bind(this._itemsCreator4Trigger,this),value:this.storeValue}),this.numberCounter.on(BI.MultiSelectCheckSelectedSwitcher.EVENT_TRIGGER_CHANGE,function(){self.combo.isViewVisible()||self.combo.showView()}),this.numberCounter.on(BI.MultiSelectCheckSelectedSwitcher.EVENT_BEFORE_POPUPVIEW,function(){this.updateSelectedValue(self.storeValue)}),this.numberCounter.on(BI.Events.VIEW,function(b){BI.nextTick(function(){self.trigger.refreshPlaceHolderWidth(b===!0?self.numberCounter.element.outerWidth()+8:0)})}),this.trigger.element.click(function(e){self.trigger.element.find(e.target).length>0&&self.numberCounter.hideView()}),BI.createWidget({type:"bi.absolute",element:this,items:[{el:this.combo,left:0,right:0,top:0,bottom:0},{el:triggerBtn,right:0,top:0,bottom:0},{el:{type:"bi.vertical_adapt",items:[this.numberCounter]},right:o.height,top:0,height:o.height}]})},_itemsCreator4Trigger:function(op,callback){var self=this,o=this.options;o.itemsCreator(op,function(res){1===op.times&&BI.isNotNull(op.keywords)&&self.trigger.setValue(BI.deepClone(self.getValue())),callback.apply(self,arguments)})},_stopEditing:function(){this.trigger.stopEditing(),this.numberCounter.hideView()},_defaultState:function(){this._stopEditing(),this.combo.hideView()},_assertValue:function(val){val||(val={}),val.type||(val.type=BI.Selection.Multi),val.value||(val.value=[])},_makeMap:function(values){return BI.makeObject(values||[])},_joinKeywords:function(keywords,callback){function digest(items){var selectedMap=self._makeMap(items);BI.each(keywords,function(i,val){BI.isNotNull(selectedMap[val])&&(self.storeValue.type===BI.Selection.Multi?BI.pushDistinct(self.storeValue.value,val):BI.remove(self.storeValue.value,val))}),self._adjust(callback)}var self=this,o=this.options;this._assertValue(this.storeValue),this.requesting=!0,o.itemsCreator({type:BI.MultiSelectCombo.REQ_GET_ALL_DATA,keywords:keywords},function(ob){var values=BI.map(ob.items,"value");digest(values)})},_joinAll:function(res,callback){var self=this,o=this.options;this._assertValue(res),this.requesting=!0,o.itemsCreator({type:BI.MultiSelectCombo.REQ_GET_ALL_DATA,keywords:[this.trigger.getKey()]},function(ob){var items=BI.map(ob.items,"value");if(self.storeValue.type===res.type){var change=!1,map=self._makeMap(self.storeValue.value);return BI.each(items,function(i,v){BI.isNotNull(map[v])&&(change=!0,self.storeValue.assist&&self.storeValue.assist.push(map[v]),delete map[v])}),change&&(self.storeValue.value=BI.values(map)),void self._adjust(callback)}var selectedMap=self._makeMap(self.storeValue.value),notSelectedMap=self._makeMap(res.value),newItems=[];BI.each(items,function(i,item){BI.isNotNull(selectedMap[items[i]])&&(self.storeValue.assist&&self.storeValue.assist.push(selectedMap[items[i]]),delete selectedMap[items[i]]),BI.isNull(notSelectedMap[items[i]])&&(BI.remove(self.storeValue.assist,item),newItems.push(item))}),self.storeValue.value=newItems.concat(BI.values(selectedMap)),self._adjust(callback)})},_adjust:function(callback){function adjust(){self.wants2Quit===!0&&(self.fireEvent(BI.MultiSelectCombo.EVENT_CONFIRM),self.wants2Quit=!1),self.requesting=!1}var self=this,o=this.options;adjust(),callback()},_join:function(res,callback){var self=this,o=this.options;if(this._assertValue(res),this._assertValue(this.storeValue),this.storeValue.type===res.type){var map=this._makeMap(this.storeValue.value);BI.each(res.value,function(i,v){map[v]||(self.storeValue.value.push(v),BI.remove(self.storeValue.assist,v),map[v]=v)});var change=!1;return BI.each(res.assist,function(i,v){BI.isNotNull(map[v])&&(change=!0,self.storeValue.assist&&self.storeValue.assist.push(map[v]),delete map[v])}),change&&(this.storeValue.value=BI.values(map)),void self._adjust(callback)}this._joinAll(res,callback)},_setStartValue:function(value){this._startValue=value,this.popup.setStartValue(value)},setValue:function(v){this.storeValue=v||{},this._assertValue(this.storeValue),this.combo.setValue(this.storeValue),this.numberCounter.setValue(this.storeValue)},getValue:function(){return BI.deepClone(this.storeValue)},populate:function(){this.combo.populate.apply(this.combo,arguments)}}),BI.extend(BI.MultiSelectCombo,{REQ_GET_DATA_LENGTH:1,REQ_GET_ALL_DATA:-1}),BI.MultiSelectCombo.EVENT_BLUR="EVENT_BLUR",BI.MultiSelectCombo.EVENT_FOCUS="EVENT_FOCUS",BI.MultiSelectCombo.EVENT_STOP="EVENT_STOP",BI.MultiSelectCombo.EVENT_SEARCHING="EVENT_SEARCHING",BI.MultiSelectCombo.EVENT_CLICK_ITEM="EVENT_CLICK_ITEM",BI.MultiSelectCombo.EVENT_CONFIRM="EVENT_CONFIRM",BI.shortcut("bi.multi_select_combo",BI.MultiSelectCombo),BI.MultiSelectInsertCombo=BI.inherit(BI.Single,{_defaultConfig:function(){return BI.extend(BI.MultiSelectInsertCombo.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-multi-select-insert-combo",itemsCreator:BI.emptyFn,valueFormatter:BI.emptyFn,height:24,attributes:{tabIndex:0},allowEdit:!0})},_init:function(){BI.MultiSelectInsertCombo.superclass._init.apply(this,arguments);var self=this,o=this.options,assertShowValue=function(){BI.isKey(self._startValue)&&(self.storeValue.type===BI.Selection.All?BI.remove(self.storeValue.value,self._startValue):BI.pushDistinct(self.storeValue.value,self._startValue)),self.trigger.getSearcher().setState(self.storeValue),self.numberCounter.setButtonChecked(self.storeValue)};this.storeValue=o.value||{},this.requesting=!1,this.trigger=BI.createWidget({type:"bi.multi_select_insert_trigger",allowEdit:o.allowEdit,height:o.height,text:o.text,watermark:o.watermark,masker:{offset:{left:0,top:0,right:0,bottom:25}},valueFormatter:o.valueFormatter,itemsCreator:BI.bind(this._itemsCreator4Trigger,this),value:o.value}),this.trigger.on(BI.MultiSelectInsertTrigger.EVENT_FOCUS,function(){self.fireEvent(BI.MultiSelectInsertCombo.EVENT_FOCUS)}),this.trigger.on(BI.MultiSelectInsertTrigger.EVENT_BLUR,function(){self.fireEvent(BI.MultiSelectInsertCombo.EVENT_BLUR)}),this.trigger.on(BI.MultiSelectInsertTrigger.EVENT_START,function(){self._setStartValue(""),this.getSearcher().setValue(self.storeValue)}),this.trigger.on(BI.MultiSelectInsertTrigger.EVENT_STOP,function(){self._setStartValue(""),self.fireEvent(BI.MultiSelectInsertCombo.EVENT_STOP)}),this.trigger.on(BI.MultiSelectInsertTrigger.EVENT_PAUSE,function(){this.getSearcher().hasMatched()&&self._addItem(assertShowValue)}),this.trigger.on(BI.MultiSelectInsertTrigger.EVENT_ADD_ITEM,function(){this.getSearcher().hasMatched()||(self._addItem(assertShowValue),self._stopEditing())}),this.trigger.on(BI.MultiSelectInsertTrigger.EVENT_SEARCHING,function(keywords){var last=BI.last(keywords);keywords=BI.initial(keywords||[]),keywords.length>0&&self._joinKeywords(keywords,function(){BI.isEndWithBlank(last)?(self.combo.setValue(self.storeValue),assertShowValue(),self.combo.populate(),self._setStartValue("")):(self.combo.setValue(self.storeValue),assertShowValue())}),self.fireEvent(BI.MultiSelectInsertCombo.EVENT_SEARCHING)}),this.trigger.on(BI.MultiSelectInsertTrigger.EVENT_CHANGE,function(value,obj){obj instanceof BI.MultiSelectBar?self._joinAll(this.getValue(),function(){assertShowValue()}):self._join(this.getValue(),function(){assertShowValue()}),self.fireEvent(BI.MultiSelectInsertCombo.EVENT_CLICK_ITEM)}),this.trigger.on(BI.MultiSelectInsertTrigger.EVENT_BEFORE_COUNTER_POPUPVIEW,function(){self.numberCounter.updateSelectedValue(self.storeValue)}),this.trigger.on(BI.MultiSelectInsertTrigger.EVENT_COUNTER_CLICK,function(){self.combo.isViewVisible()||self.combo.showView()}),this.combo=BI.createWidget({type:"bi.combo",toggle:!1,el:this.trigger,adjustLength:1,container:o.container,popup:{type:"bi.multi_select_popup_view",ref:function(){self.popup=this,self.trigger.setAdapter(this),self.numberCounter.setAdapter(this)},listeners:[{eventName:BI.MultiSelectPopupView.EVENT_CHANGE,action:function(){self.storeValue=this.getValue(),self._adjust(function(){assertShowValue()}),self.fireEvent(BI.MultiSelectInsertCombo.EVENT_CLICK_ITEM)}},{eventName:BI.MultiSelectPopupView.EVENT_CLICK_CONFIRM,action:function(){self._defaultState()}},{eventName:BI.MultiSelectPopupView.EVENT_CLICK_CLEAR,action:function(){self.setValue(),self._defaultState()}}],itemsCreator:o.itemsCreator,valueFormatter:o.valueFormatter,onLoaded:function(){BI.nextTick(function(){self.combo.adjustWidth(),self.combo.adjustHeight(),self.numberCounter.adjustView(),self.trigger.getSearcher().adjustView()})}},value:o.value,hideChecker:function(e){return 0===triggerBtn.element.find(e.target).length&&0===self.numberCounter.element.find(e.target).length}}),this.combo.on(BI.Combo.EVENT_BEFORE_POPUPVIEW,function(){this.setValue(self.storeValue),BI.nextTick(function(){self.populate()})}),this.wants2Quit=!1,this.combo.on(BI.Combo.EVENT_AFTER_HIDEVIEW,function(){self._stopEditing(),self.requesting===!0?self.wants2Quit=!0:self.fireEvent(BI.MultiSelectInsertCombo.EVENT_CONFIRM)});var triggerBtn=BI.createWidget({type:"bi.trigger_icon_button",width:o.height,height:o.height,cls:"multi-select-trigger-icon-button"});triggerBtn.on(BI.TriggerIconButton.EVENT_CHANGE,function(){self.numberCounter.hideView(),self.combo.isViewVisible()?self.combo.hideView():self.combo.showView()}),this.numberCounter=BI.createWidget({type:"bi.multi_select_check_selected_switcher",masker:{offset:{left:0,top:0,right:0,bottom:25}},valueFormatter:o.valueFormatter,itemsCreator:BI.bind(this._itemsCreator4Trigger,this),value:o.value}),this.numberCounter.on(BI.MultiSelectCheckSelectedSwitcher.EVENT_TRIGGER_CHANGE,function(){self.combo.isViewVisible()||self.combo.showView()}),this.numberCounter.on(BI.MultiSelectCheckSelectedSwitcher.EVENT_BEFORE_POPUPVIEW,function(){this.updateSelectedValue(self.storeValue)}),this.numberCounter.on(BI.Events.VIEW,function(b){BI.nextTick(function(){self.trigger.refreshPlaceHolderWidth(b===!0?self.numberCounter.element.outerWidth()+8:0)})}),this.trigger.element.click(function(e){self.trigger.element.find(e.target).length>0&&self.numberCounter.hideView()}),BI.createWidget({type:"bi.absolute",element:this,items:[{el:this.combo,left:0,right:0,top:0,bottom:0},{el:triggerBtn,right:0,top:0,bottom:0},{el:{type:"bi.vertical_adapt",items:[this.numberCounter]},right:o.height,top:0,height:o.height}]})},_itemsCreator4Trigger:function(op,callback){var self=this,o=this.options;o.itemsCreator(op,function(res){1===op.times&&BI.isNotNull(op.keywords)&&self.trigger.setValue(BI.deepClone(self.getValue())),callback.apply(self,arguments)})},_addItem:function(assertShowValue){var self=this,keyword=this.trigger.getSearcher().getKeyword();this._join({type:BI.Selection.Multi,value:[keyword]},function(){self.storeValue.type===BI.Selection.Multi&&BI.pushDistinct(self.storeValue.value,keyword),self.combo.setValue(self.storeValue),self._setStartValue(keyword), +assertShowValue(),self.populate(),self._setStartValue("")})},_stopEditing:function(){this.trigger.stopEditing(),this.numberCounter.hideView()},_defaultState:function(){this._stopEditing(),this.combo.hideView()},_assertValue:function(val){val||(val={}),val.type||(val.type=BI.Selection.Multi),val.value||(val.value=[])},_makeMap:function(values){return BI.makeObject(values||[])},_joinKeywords:function(keywords,callback){function digest(items){var selectedMap=self._makeMap(items);BI.each(keywords,function(i,val){BI.isNotNull(selectedMap[val])&&(self.storeValue.type===BI.Selection.Multi?BI.pushDistinct(self.storeValue.value,val):BI.remove(self.storeValue.value,val))}),self._adjust(callback)}var self=this,o=this.options;this._assertValue(this.storeValue),this.requesting=!0,o.itemsCreator({type:BI.MultiSelectInsertCombo.REQ_GET_ALL_DATA,keywords:keywords},function(ob){var values=BI.map(ob.items,"value");digest(values)})},_joinAll:function(res,callback){var self=this,o=this.options;this._assertValue(res),this.requesting=!0,o.itemsCreator({type:BI.MultiSelectInsertCombo.REQ_GET_ALL_DATA,keywords:[this.trigger.getKey()]},function(ob){var items=BI.map(ob.items,"value");if(self.storeValue.type===res.type){var change=!1,map=self._makeMap(self.storeValue.value);return BI.each(items,function(i,v){BI.isNotNull(map[v])&&(change=!0,self.storeValue.assist&&self.storeValue.assist.push(map[v]),delete map[v])}),change&&(self.storeValue.value=BI.values(map)),void self._adjust(callback)}var selectedMap=self._makeMap(self.storeValue.value),notSelectedMap=self._makeMap(res.value),newItems=[];BI.each(items,function(i,item){BI.isNotNull(selectedMap[items[i]])&&(self.storeValue.assist&&self.storeValue.assist.push(selectedMap[items[i]]),delete selectedMap[items[i]]),BI.isNull(notSelectedMap[items[i]])&&(BI.remove(self.storeValue.assist,item),newItems.push(item))}),self.storeValue.value=newItems.concat(BI.values(selectedMap)),self._adjust(callback)})},_adjust:function(callback){function adjust(){self.wants2Quit===!0&&(self.fireEvent(BI.MultiSelectInsertCombo.EVENT_CONFIRM),self.wants2Quit=!1),self.requesting=!1}var self=this,o=this.options;adjust(),callback()},_join:function(res,callback){var self=this,o=this.options;if(this._assertValue(res),this._assertValue(this.storeValue),this.storeValue.type===res.type){var map=this._makeMap(this.storeValue.value);BI.each(res.value,function(i,v){map[v]||(self.storeValue.value.push(v),BI.remove(self.storeValue.assist,v),map[v]=v)});var change=!1;return BI.each(res.assist,function(i,v){BI.isNotNull(map[v])&&(change=!0,self.storeValue.assist&&self.storeValue.assist.push(map[v]),delete map[v])}),change&&(this.storeValue.value=BI.values(map)),void self._adjust(callback)}this._joinAll(res,callback)},_setStartValue:function(value){this._startValue=value,this.popup.setStartValue(value)},setValue:function(v){this.storeValue=v||{},this._assertValue(this.storeValue),this.combo.setValue(this.storeValue),this.numberCounter.setValue(this.storeValue)},getValue:function(){return BI.deepClone(this.storeValue)},populate:function(){this.combo.populate.apply(this.combo,arguments)}}),BI.extend(BI.MultiSelectInsertCombo,{REQ_GET_DATA_LENGTH:1,REQ_GET_ALL_DATA:-1}),BI.MultiSelectInsertCombo.EVENT_FOCUS="EVENT_FOCUS",BI.MultiSelectInsertCombo.EVENT_BLUR="EVENT_BLUR",BI.MultiSelectInsertCombo.EVENT_STOP="EVENT_STOP",BI.MultiSelectInsertCombo.EVENT_SEARCHING="EVENT_SEARCHING",BI.MultiSelectInsertCombo.EVENT_CLICK_ITEM="EVENT_CLICK_ITEM",BI.MultiSelectInsertCombo.EVENT_CONFIRM="EVENT_CONFIRM",BI.shortcut("bi.multi_select_insert_combo",BI.MultiSelectInsertCombo),BI.MultiSelectInsertNoBarCombo=BI.inherit(BI.Single,{_defaultConfig:function(){return BI.extend(BI.MultiSelectInsertNoBarCombo.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-multi-select-insert-combo",itemsCreator:BI.emptyFn,valueFormatter:BI.emptyFn,height:24,attributes:{tabIndex:0}})},_init:function(){BI.MultiSelectInsertNoBarCombo.superclass._init.apply(this,arguments);var self=this,o=this.options,assertShowValue=function(){BI.isKey(self._startValue)&&(self.storeValue.type===BI.Selection.All?BI.remove(self.storeValue.value,self._startValue):BI.pushDistinct(self.storeValue.value,self._startValue)),self.trigger.getSearcher().setState(self.storeValue),self.numberCounter.setButtonChecked(self.storeValue)};this.storeValue={type:BI.Selection.Multi,value:o.value||[]},this.requesting=!1,this.trigger=BI.createWidget({type:"bi.multi_select_insert_trigger",height:o.height,text:o.text,masker:{offset:{left:0,top:0,right:0,bottom:25}},valueFormatter:o.valueFormatter,itemsCreator:BI.bind(this._itemsCreator4Trigger,this),value:{type:BI.Selection.Multi,value:o.value}}),this.trigger.on(BI.MultiSelectInsertTrigger.EVENT_START,function(){self._setStartValue(""),this.getSearcher().setValue(self.storeValue)}),this.trigger.on(BI.MultiSelectInsertTrigger.EVENT_STOP,function(){self._setStartValue("")}),this.trigger.on(BI.MultiSelectInsertTrigger.EVENT_PAUSE,function(){this.getSearcher().hasMatched()&&self._addItem(assertShowValue)}),this.trigger.on(BI.MultiSelectInsertTrigger.EVENT_ADD_ITEM,function(){this.getSearcher().hasMatched()||(self._addItem(assertShowValue),self._stopEditing())}),this.trigger.on(BI.MultiSelectInsertTrigger.EVENT_SEARCHING,function(keywords){var last=BI.last(keywords);keywords=BI.initial(keywords||[]),keywords.length>0&&self._joinKeywords(keywords,function(){BI.isEndWithBlank(last)?(self.combo.setValue(self.storeValue),assertShowValue(),self.combo.populate(),self._setStartValue("")):(self.combo.setValue(self.storeValue),assertShowValue())})}),this.trigger.on(BI.MultiSelectInsertTrigger.EVENT_CHANGE,function(value,obj){obj instanceof BI.MultiSelectBar?self._joinAll(this.getValue(),function(){assertShowValue()}):self._join(this.getValue(),function(){assertShowValue()})}),this.trigger.on(BI.MultiSelectInsertTrigger.EVENT_BEFORE_COUNTER_POPUPVIEW,function(){self.numberCounter.updateSelectedValue(self.storeValue)}),this.trigger.on(BI.MultiSelectInsertTrigger.EVENT_COUNTER_CLICK,function(){self.combo.isViewVisible()||self.combo.showView()}),this.combo=BI.createWidget({type:"bi.combo",toggle:!1,container:o.container,el:this.trigger,adjustLength:1,popup:{type:"bi.multi_select_no_bar_popup_view",ref:function(){self.popup=this,self.trigger.setAdapter(this),self.numberCounter.setAdapter(this)},listeners:[{eventName:BI.MultiSelectPopupView.EVENT_CHANGE,action:function(){self.storeValue=this.getValue(),self._adjust(function(){assertShowValue()})}},{eventName:BI.MultiSelectPopupView.EVENT_CLICK_CONFIRM,action:function(){self._defaultState()}},{eventName:BI.MultiSelectPopupView.EVENT_CLICK_CLEAR,action:function(){self.setValue(),self._defaultState()}}],itemsCreator:o.itemsCreator,valueFormatter:o.valueFormatter,onLoaded:function(){BI.nextTick(function(){self.combo.adjustWidth(),self.combo.adjustHeight(),self.numberCounter.adjustView(),self.trigger.getSearcher().adjustView()})}},value:{type:BI.Selection.Multi,value:o.value},hideChecker:function(e){return 0===triggerBtn.element.find(e.target).length&&0===self.numberCounter.element.find(e.target).length}}),this.combo.on(BI.Combo.EVENT_BEFORE_POPUPVIEW,function(){this.setValue(self.storeValue),BI.nextTick(function(){self.populate()})}),this.wants2Quit=!1,this.combo.on(BI.Combo.EVENT_AFTER_HIDEVIEW,function(){self._stopEditing(),self.requesting===!0?self.wants2Quit=!0:self.fireEvent(BI.MultiSelectInsertNoBarCombo.EVENT_CONFIRM)});var triggerBtn=BI.createWidget({type:"bi.trigger_icon_button",width:o.height,height:o.height,cls:"multi-select-trigger-icon-button"});triggerBtn.on(BI.TriggerIconButton.EVENT_CHANGE,function(){self.numberCounter.hideView(),self.combo.isViewVisible()?self.combo.hideView():self.combo.showView()}),this.numberCounter=BI.createWidget({type:"bi.multi_select_check_selected_switcher",masker:{offset:{left:0,top:0,right:0,bottom:25}},valueFormatter:o.valueFormatter,itemsCreator:BI.bind(this._itemsCreator4Trigger,this),value:{type:BI.Selection.Multi,value:o.value}}),this.numberCounter.on(BI.MultiSelectCheckSelectedSwitcher.EVENT_TRIGGER_CHANGE,function(){self.combo.isViewVisible()||self.combo.showView()}),this.numberCounter.on(BI.MultiSelectCheckSelectedSwitcher.EVENT_BEFORE_POPUPVIEW,function(){this.updateSelectedValue(self.storeValue)}),this.numberCounter.on(BI.Events.VIEW,function(b){BI.nextTick(function(){self.trigger.refreshPlaceHolderWidth(b===!0?self.numberCounter.element.outerWidth()+8:0)})}),this.trigger.element.click(function(e){self.trigger.element.find(e.target).length>0&&self.numberCounter.hideView()}),BI.createWidget({type:"bi.absolute",element:this,items:[{el:this.combo,left:0,right:0,top:0,bottom:0},{el:triggerBtn,right:0,top:0,bottom:0},{el:{type:"bi.vertical_adapt",items:[this.numberCounter]},right:o.height,top:0,height:o.height}]})},_itemsCreator4Trigger:function(op,callback){var self=this,o=this.options;o.itemsCreator(op,function(res){1===op.times&&BI.isNotNull(op.keywords)&&self.trigger.setValue(BI.deepClone(self.getValue())),callback.apply(self,arguments)})},_addItem:function(assertShowValue){var self=this,keyword=this.trigger.getSearcher().getKeyword();this._join({type:BI.Selection.Multi,value:[keyword]},function(){self.storeValue.type===BI.Selection.Multi&&BI.pushDistinct(self.storeValue.value,keyword),self.combo.setValue(self.storeValue),self._setStartValue(keyword),assertShowValue(),self.populate(),self._setStartValue("")})},_stopEditing:function(){this.trigger.stopEditing(),this.numberCounter.hideView()},_defaultState:function(){this._stopEditing(),this.combo.hideView()},_assertValue:function(val){val||(val={}),val.type||(val.type=BI.Selection.Multi),val.value||(val.value=[])},_makeMap:function(values){return BI.makeObject(values||[])},_joinKeywords:function(keywords,callback){function digest(items){var selectedMap=self._makeMap(items);BI.each(keywords,function(i,val){BI.isNotNull(selectedMap[val])&&(self.storeValue.type===BI.Selection.Multi?BI.pushDistinct(self.storeValue.value,val):BI.remove(self.storeValue.value,val))}),self._adjust(callback)}var self=this,o=this.options;this._assertValue(this.storeValue),this.requesting=!0,o.itemsCreator({type:BI.MultiSelectInsertNoBarCombo.REQ_GET_ALL_DATA,keywords:keywords},function(ob){var values=BI.map(ob.items,"value");digest(values)})},_joinAll:function(res,callback){var self=this,o=this.options;this._assertValue(res),this.requesting=!0,o.itemsCreator({type:BI.MultiSelectInsertNoBarCombo.REQ_GET_ALL_DATA,keywords:[this.trigger.getKey()]},function(ob){var items=BI.map(ob.items,"value");if(self.storeValue.type===res.type){var change=!1,map=self._makeMap(self.storeValue.value);return BI.each(items,function(i,v){BI.isNotNull(map[v])&&(change=!0,self.storeValue.assist&&self.storeValue.assist.push(map[v]),delete map[v])}),change&&(self.storeValue.value=BI.values(map)),void self._adjust(callback)}var selectedMap=self._makeMap(self.storeValue.value),notSelectedMap=self._makeMap(res.value),newItems=[];BI.each(items,function(i,item){BI.isNotNull(selectedMap[items[i]])&&(self.storeValue.assist&&self.storeValue.assist.push(selectedMap[items[i]]),delete selectedMap[items[i]]),BI.isNull(notSelectedMap[items[i]])&&(BI.remove(self.storeValue.assist,item),newItems.push(item))}),self.storeValue.value=newItems.concat(BI.values(selectedMap)),self._adjust(callback)})},_adjust:function(callback){function adjust(){self.wants2Quit===!0&&(self.fireEvent(BI.MultiSelectInsertNoBarCombo.EVENT_CONFIRM),self.wants2Quit=!1),self.requesting=!1}var self=this,o=this.options;adjust(),callback()},_join:function(res,callback){var self=this,o=this.options;if(this._assertValue(res),this._assertValue(this.storeValue),this.storeValue.type===res.type){var map=this._makeMap(this.storeValue.value);BI.each(res.value,function(i,v){map[v]||(self.storeValue.value.push(v),BI.remove(self.storeValue.assist,v),map[v]=v)});var change=!1;return BI.each(res.assist,function(i,v){BI.isNotNull(map[v])&&(change=!0,self.storeValue.assist&&self.storeValue.assist.push(map[v]),delete map[v])}),change&&(this.storeValue.value=BI.values(map)),void self._adjust(callback)}this._joinAll(res,callback)},_setStartValue:function(value){this._startValue=value,this.popup.setStartValue(value)},setValue:function(v){this.storeValue={type:BI.Selection.Multi,value:v||[]},this.combo.setValue(this.storeValue),this.numberCounter.setValue(this.storeValue)},getValue:function(){return BI.deepClone(this.storeValue.value)},populate:function(){this.combo.populate.apply(this.combo,arguments)}}),BI.extend(BI.MultiSelectInsertNoBarCombo,{REQ_GET_DATA_LENGTH:1,REQ_GET_ALL_DATA:-1}),BI.MultiSelectInsertNoBarCombo.EVENT_CONFIRM="EVENT_CONFIRM",BI.shortcut("bi.multi_select_insert_no_bar_combo",BI.MultiSelectInsertNoBarCombo),BI.MultiSelectInsertTrigger=BI.inherit(BI.Trigger,{constants:{height:14,rgap:4,lgap:4},_defaultConfig:function(){return BI.extend(BI.MultiSelectInsertTrigger.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-multi-select-trigger bi-border bi-border-radius",itemsCreator:BI.emptyFn,valueFormatter:BI.emptyFn,searcher:{},switcher:{},adapter:null,masker:{},allowEdit:!0})},_init:function(){BI.MultiSelectInsertTrigger.superclass._init.apply(this,arguments);var self=this,o=this.options;o.height&&this.setHeight(o.height-2),this.searcher=BI.createWidget(o.searcher,{type:"bi.multi_select_insert_searcher",height:o.height,text:o.text,itemsCreator:o.itemsCreator,valueFormatter:o.valueFormatter,watermark:o.watermark,popup:{},adapter:o.adapter,masker:o.masker,value:o.value}),this.searcher.on(BI.MultiSelectInsertSearcher.EVENT_START,function(){self.fireEvent(BI.MultiSelectInsertTrigger.EVENT_START)}),this.searcher.on(BI.MultiSelectInsertSearcher.EVENT_ADD_ITEM,function(){self.fireEvent(BI.MultiSelectInsertTrigger.EVENT_ADD_ITEM)}),this.searcher.on(BI.MultiSelectInsertSearcher.EVENT_PAUSE,function(){self.fireEvent(BI.MultiSelectInsertTrigger.EVENT_PAUSE)}),this.searcher.on(BI.MultiSelectInsertSearcher.EVENT_SEARCHING,function(){self.fireEvent(BI.MultiSelectInsertTrigger.EVENT_SEARCHING,arguments)}),this.searcher.on(BI.MultiSelectInsertSearcher.EVENT_STOP,function(){self.fireEvent(BI.MultiSelectInsertTrigger.EVENT_STOP)}),this.searcher.on(BI.MultiSelectInsertSearcher.EVENT_CHANGE,function(){self.fireEvent(BI.MultiSelectInsertTrigger.EVENT_CHANGE,arguments)}),this.searcher.on(BI.MultiSelectInsertSearcher.EVENT_BLUR,function(){self.fireEvent(BI.MultiSelectInsertTrigger.EVENT_BLUR)}),this.searcher.on(BI.MultiSelectInsertSearcher.EVENT_FOCUS,function(){self.fireEvent(BI.MultiSelectInsertTrigger.EVENT_FOCUS)}),this.wrapNumberCounter=BI.createWidget({type:"bi.layout"}),this.wrapper=BI.createWidget({type:"bi.htape",element:this,items:[{el:this.searcher,width:"fill"},{el:this.wrapNumberCounter,width:0},{el:BI.createWidget(),width:24}]}),!o.allowEdit&&BI.createWidget({type:"bi.absolute",element:this,items:[{el:{type:"bi.layout"},left:0,right:24,top:0,bottom:0}]})},refreshPlaceHolderWidth:function(width){this.wrapper.attr("items")[1].width=width,this.wrapper.resize()},getSearcher:function(){return this.searcher},stopEditing:function(){this.searcher.stopSearch()},setAdapter:function(adapter){this.searcher.setAdapter(adapter)},setValue:function(ob){this.searcher.setValue(ob)},getKey:function(){return this.searcher.getKey()},getValue:function(){return this.searcher.getValue()}}),BI.MultiSelectInsertTrigger.EVENT_TRIGGER_CLICK="EVENT_TRIGGER_CLICK",BI.MultiSelectInsertTrigger.EVENT_COUNTER_CLICK="EVENT_COUNTER_CLICK",BI.MultiSelectInsertTrigger.EVENT_CHANGE="EVENT_CHANGE",BI.MultiSelectInsertTrigger.EVENT_START="EVENT_START",BI.MultiSelectInsertTrigger.EVENT_STOP="EVENT_STOP",BI.MultiSelectInsertTrigger.EVENT_PAUSE="EVENT_PAUSE",BI.MultiSelectInsertTrigger.EVENT_SEARCHING="EVENT_SEARCHING",BI.MultiSelectInsertTrigger.EVENT_BEFORE_COUNTER_POPUPVIEW="EVENT_BEFORE_COUNTER_POPUPVIEW",BI.MultiSelectInsertTrigger.EVENT_ADD_ITEM="EVENT_ADD_ITEM",BI.MultiSelectInsertTrigger.EVENT_FOCUS="EVENT_FOCUS",BI.MultiSelectInsertTrigger.EVENT_BLUR="EVENT_BLUR",BI.shortcut("bi.multi_select_insert_trigger",BI.MultiSelectInsertTrigger),BI.MultiSelectLoader=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.MultiSelectLoader.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-multi-select-loader",logic:{dynamic:!0},el:{height:400},valueFormatter:BI.emptyFn,itemsCreator:BI.emptyFn,onLoaded:BI.emptyFn})},_init:function(){BI.MultiSelectLoader.superclass._init.apply(this,arguments);var self=this,opts=this.options,hasNext=!1;this.storeValue=opts.value||{},this._assertValue(this.storeValue),this.button_group=BI.createWidget({type:"bi.select_list",logic:opts.logic,toolbar:{type:"bi.multi_select_bar",cls:"bi-list-item-active",iconWrapperWidth:36},el:BI.extend({onLoaded:opts.onLoaded,el:{type:"bi.loader",isDefaultInit:!1,logic:{dynamic:!0,scrolly:!0},el:{chooseType:BI.ButtonGroup.CHOOSE_TYPE_MULTI,behaviors:{redmark:function(){return!0}},layouts:[{type:"bi.vertical"}]}}},opts.el),itemsCreator:function(op,callback){var startValue=self._startValue;self.storeValue&&(op=BI.extend(op||{},{selectedValues:BI.isKey(startValue)&&self.storeValue.type===BI.Selection.Multi?self.storeValue.value.concat(startValue):self.storeValue.value})),opts.itemsCreator(op,function(ob){hasNext=ob.hasNext;var firstItems=[];if(1===op.times&&self.storeValue){var json=BI.map(self.storeValue.value,function(i,v){var txt=opts.valueFormatter(v)||v;return{text:txt,value:v,title:txt,selected:self.storeValue.type===BI.Selection.Multi}});if(BI.isKey(self._startValue)&&!BI.contains(self.storeValue.value,self._startValue)){var txt=opts.valueFormatter(startValue)||startValue;json.unshift({text:txt,value:startValue,title:txt,selected:!0})}firstItems=self._createItems(json)}callback(firstItems.concat(self._createItems(ob.items)),ob.keyword||""),1===op.times&&self.storeValue&&(BI.isKey(startValue)&&(self.storeValue.type===BI.Selection.All?BI.remove(self.storeValue.value,startValue):BI.pushDistinct(self.storeValue.value,startValue)),self.setValue(self.storeValue)),1===op.times&&self._scrollToTop()})},hasNext:function(){return hasNext},value:this.storeValue}),BI.createWidget(BI.extend({element:this},BI.LogicFactory.createLogic(BI.LogicFactory.createLogicTypeByDirection(BI.Direction.Top),BI.extend({scrolly:!0,vgap:5},opts.logic,{items:BI.LogicFactory.createLogicItemsByDirection(BI.Direction.Top,this.button_group)})))),this.button_group.on(BI.Controller.EVENT_CHANGE,function(){self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.button_group.on(BI.SelectList.EVENT_CHANGE,function(){self.fireEvent(BI.MultiSelectLoader.EVENT_CHANGE,arguments)})},_createItems:function(items){return BI.createItems(items,{type:"bi.multi_select_item",logic:this.options.logic,cls:"bi-list-item-active",height:24,selected:this.isAllSelected(),iconWrapperWidth:36})},_scrollToTop:function(){var self=this;BI.delay(function(){self.button_group.element.scrollTop(0)},30)},isAllSelected:function(){return this.button_group.isAllSelected()},_assertValue:function(val){val||(val={}),val.type||(val.type=BI.Selection.Multi),val.value||(val.value=[])},setStartValue:function(v){this._startValue=v},setValue:function(v){this.storeValue=v||{},this._assertValue(this.storeValue),this.button_group.setValue(this.storeValue)},getValue:function(){return this.button_group.getValue()},getAllButtons:function(){return this.button_group.getAllButtons()},empty:function(){this.button_group.empty()},populate:function(items){arguments[0]=this._createItems(items),this.button_group.populate.apply(this.button_group,arguments)},resetHeight:function(h){this.button_group.resetHeight(h-10)},resetWidth:function(w){this.button_group.resetWidth(w)}}),BI.MultiSelectLoader.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.multi_select_loader",BI.MultiSelectLoader),BI.MultiSelectNoBarLoader=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.MultiSelectNoBarLoader.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-multi-select-loader",logic:{dynamic:!0},el:{height:400},valueFormatter:BI.emptyFn,itemsCreator:BI.emptyFn,onLoaded:BI.emptyFn})},_init:function(){BI.MultiSelectNoBarLoader.superclass._init.apply(this,arguments);var self=this,opts=this.options,hasNext=!1;this.storeValue=opts.value||{},this._assertValue(this.storeValue),this.button_group=BI.createWidget(BI.extend({type:"bi.list_pane",onLoaded:opts.onLoaded,el:{type:"bi.loader",isDefaultInit:!1,logic:{dynamic:!0,scrolly:!0},el:{chooseType:BI.ButtonGroup.CHOOSE_TYPE_MULTI,behaviors:{redmark:function(){return!0}},layouts:[{type:"bi.vertical"}]}},itemsCreator:function(op,callback){var startValue=self._startValue;self.storeValue&&(op=BI.extend(op||{},{selectedValues:BI.isKey(startValue)&&self.storeValue.type===BI.Selection.Multi?self.storeValue.value.concat(startValue):self.storeValue.value})),opts.itemsCreator(op,function(ob){hasNext=ob.hasNext;var firstItems=[];if(1===op.times&&self.storeValue){var json=BI.map(self.storeValue.value,function(i,v){var txt=opts.valueFormatter(v)||v;return{text:txt,value:v,title:txt,selected:self.storeValue.type===BI.Selection.Multi}});if(BI.isKey(self._startValue)&&!BI.contains(self.storeValue.value,self._startValue)){var txt=opts.valueFormatter(startValue)||startValue;json.unshift({text:txt,value:startValue,title:txt,selected:!0})}firstItems=self._createItems(json)}callback(firstItems.concat(self._createItems(ob.items)),ob.keyword||""),1===op.times&&self.storeValue&&(BI.isKey(startValue)&&(self.storeValue.type===BI.Selection.All?BI.remove(self.storeValue.value,startValue):BI.pushDistinct(self.storeValue.value,startValue)),self.setValue(self.storeValue)),1===op.times&&self._scrollToTop()})},hasNext:function(){return hasNext},value:this.storeValue},opts.el)),BI.createWidget({type:"bi.vertical",element:this,items:[this.button_group],vgap:5}),this.button_group.on(BI.Controller.EVENT_CHANGE,function(){self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.button_group.on(BI.SelectList.EVENT_CHANGE,function(){self.fireEvent(BI.MultiSelectNoBarLoader.EVENT_CHANGE,arguments)})},_createItems:function(items){return BI.createItems(items,{type:"bi.multi_select_item",cls:"bi-list-item-active",logic:this.options.logic,height:24,iconWrapperWidth:36})},_scrollToTop:function(){var self=this;BI.delay(function(){self.button_group.element.scrollTop(0)},30)},_assertValue:function(val){val||(val={}),val.type||(val.type=BI.Selection.Multi),val.value||(val.value=[])},setStartValue:function(v){this._startValue=v},setValue:function(v){this.storeValue=v||{},this._assertValue(this.storeValue),this.button_group.setValue(this.storeValue.value)},getValue:function(){return{type:BI.Selection.Multi,value:this.button_group.getValue()}},getAllButtons:function(){return this.button_group.getAllButtons()},empty:function(){this.button_group.empty()},populate:function(items){arguments[0]=this._createItems(items),this.button_group.populate.apply(this.button_group,arguments)},resetHeight:function(h){this.button_group.element.css({"max-height":h+"px"})},resetWidth:function(){}}),BI.MultiSelectNoBarLoader.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.multi_select_no_bar_loader",BI.MultiSelectNoBarLoader),BI.MultiSelectPopupView=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.MultiSelectPopupView.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-multi-select-popup-view",maxWidth:"auto",minWidth:135,maxHeight:400,valueFormatter:BI.emptyFn,itemsCreator:BI.emptyFn,onLoaded:BI.emptyFn})},_init:function(){BI.MultiSelectPopupView.superclass._init.apply(this,arguments);var self=this,opts=this.options;this.loader=BI.createWidget({type:"bi.multi_select_loader",itemsCreator:opts.itemsCreator,valueFormatter:opts.valueFormatter,onLoaded:opts.onLoaded,value:opts.value}),this.popupView=BI.createWidget({type:"bi.multi_popup_view",stopPropagation:!1,maxWidth:opts.maxWidth,minWidth:opts.minWidth,maxHeight:opts.maxHeight,element:this,buttons:[BI.i18nText("BI-Basic_Clears"),BI.i18nText("BI-Basic_Sure")],el:this.loader,value:opts.value}),this.popupView.on(BI.MultiPopupView.EVENT_CHANGE,function(){self.fireEvent(BI.MultiSelectPopupView.EVENT_CHANGE)}),this.popupView.on(BI.MultiPopupView.EVENT_CLICK_TOOLBAR_BUTTON,function(index){switch(index){case 0:self.fireEvent(BI.MultiSelectPopupView.EVENT_CLICK_CLEAR);break;case 1:self.fireEvent(BI.MultiSelectPopupView.EVENT_CLICK_CONFIRM)}})},isAllSelected:function(){return this.loader.isAllSelected()},setStartValue:function(v){this.loader.setStartValue(v)},setValue:function(v){this.popupView.setValue(v)},getValue:function(){return this.popupView.getValue()},populate:function(items){this.popupView.populate.apply(this.popupView,arguments)},resetHeight:function(h){this.popupView.resetHeight(h)},resetWidth:function(w){this.popupView.resetWidth(w)}}),BI.MultiSelectPopupView.EVENT_CHANGE="EVENT_CHANGE",BI.MultiSelectPopupView.EVENT_CLICK_CONFIRM="EVENT_CLICK_CONFIRM",BI.MultiSelectPopupView.EVENT_CLICK_CLEAR="EVENT_CLICK_CLEAR",BI.shortcut("bi.multi_select_popup_view",BI.MultiSelectPopupView),BI.MultiSelectNoBarPopupView=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.MultiSelectNoBarPopupView.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-multi-select-popup-view",maxWidth:"auto",minWidth:135,maxHeight:400,valueFormatter:BI.emptyFn,itemsCreator:BI.emptyFn,onLoaded:BI.emptyFn})},_init:function(){BI.MultiSelectNoBarPopupView.superclass._init.apply(this,arguments);var self=this,opts=this.options;this.loader=BI.createWidget({type:"bi.multi_select_no_bar_loader",itemsCreator:opts.itemsCreator,valueFormatter:opts.valueFormatter,onLoaded:opts.onLoaded,value:opts.value}),this.popupView=BI.createWidget({type:"bi.multi_popup_view",stopPropagation:!1,maxWidth:opts.maxWidth,minWidth:opts.minWidth,maxHeight:opts.maxHeight,element:this,buttons:[BI.i18nText("BI-Basic_Clears"),BI.i18nText("BI-Basic_Sure")],el:this.loader,value:opts.value}),this.popupView.on(BI.MultiPopupView.EVENT_CHANGE,function(){self.fireEvent(BI.MultiSelectNoBarPopupView.EVENT_CHANGE)}),this.popupView.on(BI.MultiPopupView.EVENT_CLICK_TOOLBAR_BUTTON,function(index){switch(index){case 0:self.fireEvent(BI.MultiSelectNoBarPopupView.EVENT_CLICK_CLEAR);break;case 1:self.fireEvent(BI.MultiSelectNoBarPopupView.EVENT_CLICK_CONFIRM)}})},setStartValue:function(v){this.loader.setStartValue(v)},setValue:function(v){this.popupView.setValue(v)},getValue:function(){return this.popupView.getValue()},populate:function(items){this.popupView.populate.apply(this.popupView,arguments)},resetHeight:function(h){this.popupView.resetHeight(h)},resetWidth:function(w){this.popupView.resetWidth(w)}}),BI.MultiSelectNoBarPopupView.EVENT_CHANGE="EVENT_CHANGE",BI.MultiSelectNoBarPopupView.EVENT_CLICK_CONFIRM="EVENT_CLICK_CONFIRM",BI.MultiSelectNoBarPopupView.EVENT_CLICK_CLEAR="EVENT_CLICK_CLEAR",BI.shortcut("bi.multi_select_no_bar_popup_view",BI.MultiSelectNoBarPopupView),BI.MultiSelectTrigger=BI.inherit(BI.Trigger,{constants:{height:14,rgap:4,lgap:4},_defaultConfig:function(){return BI.extend(BI.MultiSelectTrigger.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-multi-select-trigger bi-border bi-border-radius",itemsCreator:BI.emptyFn,valueFormatter:BI.emptyFn,searcher:{},switcher:{},adapter:null,masker:{},allowEdit:!0})},_init:function(){BI.MultiSelectTrigger.superclass._init.apply(this,arguments);var self=this,o=this.options;o.height&&this.setHeight(o.height-2),this.searcher=BI.createWidget(o.searcher,{type:"bi.multi_select_searcher",height:o.height,text:o.text,itemsCreator:o.itemsCreator,valueFormatter:o.valueFormatter,watermark:o.watermark,popup:{},adapter:o.adapter,masker:o.masker,value:o.value}),this.searcher.on(BI.MultiSelectSearcher.EVENT_START,function(){self.fireEvent(BI.MultiSelectTrigger.EVENT_START)}),this.searcher.on(BI.MultiSelectSearcher.EVENT_PAUSE,function(){self.fireEvent(BI.MultiSelectTrigger.EVENT_PAUSE)}),this.searcher.on(BI.MultiSelectSearcher.EVENT_SEARCHING,function(){self.fireEvent(BI.MultiSelectTrigger.EVENT_SEARCHING,arguments)}),this.searcher.on(BI.MultiSelectSearcher.EVENT_STOP,function(){self.fireEvent(BI.MultiSelectTrigger.EVENT_STOP)}),this.searcher.on(BI.MultiSelectSearcher.EVENT_CHANGE,function(){self.fireEvent(BI.MultiSelectTrigger.EVENT_CHANGE,arguments)}),this.searcher.on(BI.MultiSelectSearcher.EVENT_BLUR,function(){self.fireEvent(BI.MultiSelectTrigger.EVENT_BLUR)}),this.searcher.on(BI.MultiSelectSearcher.EVENT_FOCUS,function(){self.fireEvent(BI.MultiSelectTrigger.EVENT_FOCUS)}),this.wrapNumberCounter=BI.createWidget({type:"bi.layout"}),this.wrapper=BI.createWidget({type:"bi.htape",element:this,items:[{el:this.searcher,width:"fill"},{el:this.wrapNumberCounter,width:0},{el:BI.createWidget(),width:24}]}),!o.allowEdit&&BI.createWidget({type:"bi.absolute",element:this,items:[{el:{type:"bi.layout"},left:0,right:24,top:0,bottom:0}]})},refreshPlaceHolderWidth:function(width){this.wrapper.attr("items")[1].width=width,this.wrapper.resize()},getSearcher:function(){return this.searcher},stopEditing:function(){this.searcher.stopSearch()},setAdapter:function(adapter){this.searcher.setAdapter(adapter)},setValue:function(ob){this.searcher.setValue(ob)},getKey:function(){return this.searcher.getKey()},getValue:function(){return this.searcher.getValue()}}),BI.MultiSelectTrigger.EVENT_TRIGGER_CLICK="EVENT_TRIGGER_CLICK",BI.MultiSelectTrigger.EVENT_COUNTER_CLICK="EVENT_COUNTER_CLICK",BI.MultiSelectTrigger.EVENT_CHANGE="EVENT_CHANGE",BI.MultiSelectTrigger.EVENT_START="EVENT_START",BI.MultiSelectTrigger.EVENT_STOP="EVENT_STOP",BI.MultiSelectTrigger.EVENT_PAUSE="EVENT_PAUSE",BI.MultiSelectTrigger.EVENT_SEARCHING="EVENT_SEARCHING",BI.MultiSelectTrigger.EVENT_BEFORE_COUNTER_POPUPVIEW="EVENT_BEFORE_COUNTER_POPUPVIEW",BI.MultiSelectTrigger.EVENT_BLUR="EVENT_BLUR",BI.MultiSelectTrigger.EVENT_FOCUS="EVENT_FOCUS",BI.shortcut("bi.multi_select_trigger",BI.MultiSelectTrigger),BI.MultiSelectSearchInsertPane=BI.inherit(BI.Widget,{constants:{height:24,lgap:10,tgap:5},_defaultConfig:function(){return BI.extend(BI.MultiSelectSearchInsertPane.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-multi-select-search-pane bi-card",itemsCreator:BI.emptyFn,valueFormatter:BI.emptyFn,keywordGetter:BI.emptyFn})},_init:function(){BI.MultiSelectSearchInsertPane.superclass._init.apply(this,arguments);var self=this,o=this.options;this.tooltipClick=BI.createWidget({type:"bi.label",invisible:!0,text:BI.i18nText("BI-Click_Blank_To_Select"),cls:"multi-select-toolbar",height:this.constants.height}),this.addNotMatchTip=BI.createWidget({type:"bi.text_button",invisible:!0,text:BI.i18nText("BI-Basic_Click_To_Add_Text",""),height:this.constants.height,cls:"bi-high-light",hgap:5,handler:function(){self.fireEvent(BI.MultiSelectSearchInsertPane.EVENT_ADD_ITEM,o.keywordGetter())}}),this.loader=BI.createWidget({type:"bi.multi_select_search_loader",keywordGetter:o.keywordGetter,valueFormatter:o.valueFormatter,itemsCreator:function(op,callback){o.itemsCreator.apply(self,[op,function(res){callback(res),self.setKeyword(o.keywordGetter())}])},value:o.value}),this.loader.on(BI.Controller.EVENT_CHANGE,function(){self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.resizer=BI.createWidget({type:"bi.vtape",element:this,items:[{type:"bi.vertical",items:[this.tooltipClick,this.addNotMatchTip],height:this.constants.height},{el:this.loader}]})},setKeyword:function(keyword){var btn,isMatchTipVisible=this.loader.getAllButtons().length>0&&(btn=this.loader.getAllButtons()[0])&&keyword===btn.getValue();this.tooltipClick.setVisible(isMatchTipVisible),this.addNotMatchTip.setVisible(!isMatchTipVisible),!isMatchTipVisible&&this.addNotMatchTip.setText(BI.i18nText("BI-Basic_Click_To_Add_Text",keyword))},isAllSelected:function(){return this.loader.isAllSelected()},hasMatched:function(){return this.tooltipClick.isVisible()},setValue:function(v){this.loader.setValue(v)},getValue:function(){return this.loader.getValue()},empty:function(){this.loader.empty()},populate:function(items){this.loader.populate.apply(this.loader,arguments); +}}),BI.MultiSelectSearchInsertPane.EVENT_CHANGE="EVENT_CHANGE",BI.MultiSelectSearchInsertPane.EVENT_ADD_ITEM="EVENT_ADD_ITEM",BI.shortcut("bi.multi_select_search_insert_pane",BI.MultiSelectSearchInsertPane),BI.MultiSelectSearchLoader=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.MultiSelectSearchLoader.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-multi-select-search-loader",itemsCreator:BI.emptyFn,keywordGetter:BI.emptyFn,valueFormatter:BI.emptyFn})},_init:function(){BI.MultiSelectSearchLoader.superclass._init.apply(this,arguments);var self=this,opts=this.options,hasNext=!1;this.storeValue=BI.deepClone(opts.value),this.button_group=BI.createWidget({type:"bi.select_list",toolbar:{type:"bi.multi_select_bar",cls:"bi-list-item-active",iconWrapperWidth:36},element:this,logic:{dynamic:!1},value:opts.value,el:{tipText:BI.i18nText("BI-No_Select"),el:{type:"bi.loader",isDefaultInit:!1,logic:{dynamic:!0,scrolly:!0},el:{chooseType:BI.ButtonGroup.CHOOSE_TYPE_MULTI,behaviors:{redmark:function(){return!0}},layouts:[{type:"bi.vertical"}]}}},itemsCreator:function(op,callback){self.storeValue&&(op=BI.extend(op||{},{selectedValues:self.storeValue.value})),opts.itemsCreator(op,function(ob){var keyword=ob.keyword=opts.keywordGetter();hasNext=ob.hasNext;var firstItems=[];if(1===op.times&&self.storeValue){var json=self._filterValues(self.storeValue);firstItems=self._createItems(json)}callback(firstItems.concat(self._createItems(ob.items)),keyword),1===op.times&&self.storeValue&&self.setValue(self.storeValue)})},hasNext:function(){return hasNext}}),this.button_group.on(BI.Controller.EVENT_CHANGE,function(){self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.button_group.on(BI.SelectList.EVENT_CHANGE,function(){self.fireEvent(BI.MultiSelectSearchLoader.EVENT_CHANGE,arguments)})},_createItems:function(items){return BI.createItems(items,{type:"bi.multi_select_item",logic:{dynamic:!1},height:24,selected:this.isAllSelected(),cls:"bi-list-item-active",iconWrapperWidth:36})},isAllSelected:function(){return this.button_group.isAllSelected()},_filterValues:function(src){var o=this.options,keyword=o.keywordGetter(),values=BI.deepClone(src.value)||[],newValues=BI.map(values,function(i,v){return{text:o.valueFormatter(v)||v,value:v}});if(BI.isKey(keyword)){var search=BI.Func.getSearchResult(newValues,keyword);values=search.match.concat(search.find)}return BI.map(values,function(i,v){return{text:v.text,title:v.text,value:v.value,selected:src.type===BI.Selection.All}})},setValue:function(v){this.storeValue=BI.deepClone(v),this.button_group.setValue(v)},getValue:function(){return this.button_group.getValue()},getAllButtons:function(){return this.button_group.getAllButtons()},empty:function(){this.button_group.empty()},populate:function(items){this.button_group.populate.apply(this.button_group,arguments)},resetHeight:function(h){this.button_group.resetHeight(h)},resetWidth:function(w){this.button_group.resetWidth(w)}}),BI.MultiSelectSearchLoader.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.multi_select_search_loader",BI.MultiSelectSearchLoader),BI.MultiSelectSearchPane=BI.inherit(BI.Widget,{constants:{height:24,lgap:10,tgap:5},_defaultConfig:function(){return BI.extend(BI.MultiSelectSearchPane.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-multi-select-search-pane bi-card",itemsCreator:BI.emptyFn,valueFormatter:BI.emptyFn,keywordGetter:BI.emptyFn})},_init:function(){BI.MultiSelectSearchPane.superclass._init.apply(this,arguments);var self=this,o=this.options;this.tooltipClick=BI.createWidget({type:"bi.label",invisible:!0,text:BI.i18nText("BI-Click_Blank_To_Select"),cls:"multi-select-toolbar",height:this.constants.height}),this.loader=BI.createWidget({type:"bi.multi_select_search_loader",keywordGetter:o.keywordGetter,valueFormatter:o.valueFormatter,itemsCreator:function(op,callback){o.itemsCreator.apply(self,[op,function(res){callback(res),self.setKeyword(o.keywordGetter())}])},value:o.value}),this.loader.on(BI.Controller.EVENT_CHANGE,function(){self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.resizer=BI.createWidget({type:"bi.vtape",element:this,items:[{el:this.tooltipClick,height:0},{el:this.loader}]}),this.tooltipClick.setVisible(!1)},setKeyword:function(keyword){var btn,isVisible=this.loader.getAllButtons().length>0&&(btn=this.loader.getAllButtons()[0])&&keyword===btn.getValue();isVisible!==this.tooltipClick.isVisible()&&(this.tooltipClick.setVisible(isVisible),this.resizer.attr("items")[0].height=isVisible?this.constants.height:0,this.resizer.resize())},isAllSelected:function(){return this.loader.isAllSelected()},hasMatched:function(){return this.tooltipClick.isVisible()},setValue:function(v){this.loader.setValue(v)},getValue:function(){return this.loader.getValue()},empty:function(){this.loader.empty()},populate:function(items){this.loader.populate.apply(this.loader,arguments)}}),BI.MultiSelectSearchPane.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.multi_select_search_pane",BI.MultiSelectSearchPane),BI.MultiSelectCheckSelectedButton=BI.inherit(BI.Single,{_defaultConfig:function(){return BI.extend(BI.MultiSelectCheckSelectedButton.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-multi-select-check-selected-button",itemsCreator:BI.emptyFn})},_init:function(){BI.MultiSelectCheckSelectedButton.superclass._init.apply(this,arguments);var self=this,o=this.options;this.numberCounter=BI.createWidget({type:"bi.text_button",element:this,hgap:4,text:"0",textAlign:"center",textHeight:16,cls:"bi-high-light-background count-tip"}),this.numberCounter.on(BI.Controller.EVENT_CHANGE,function(){self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.numberCounter.on(BI.TextButton.EVENT_CHANGE,function(){self.fireEvent(BI.MultiSelectCheckSelectedButton.EVENT_CHANGE,arguments)}),this.numberCounter.element.hover(function(){self.numberCounter.setTag(self.numberCounter.getText()),self.numberCounter.setText(BI.i18nText("BI-Check_Selected"))},function(){self.numberCounter.setText(self.numberCounter.getTag())}),this.setVisible(!1),BI.isNotNull(o.value)&&this.setValue(o.value)},setValue:function(ob){var self=this,o=this.options;return ob||(ob={}),ob.type||(ob.type=BI.Selection.Multi),ob.value||(ob.value=[]),ob.type===BI.Selection.All?void o.itemsCreator({type:BI.MultiSelectCombo.REQ_GET_DATA_LENGTH},function(res){var length=res.count-ob.value.length;BI.nextTick(function(){self.numberCounter.setText(length),self.setVisible(length>0)})}):void BI.nextTick(function(){self.numberCounter.setText(ob.value.length),self.setVisible(ob.value.length>0)})},getValue:function(){}}),BI.MultiSelectCheckSelectedButton.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.multi_select_check_selected_button",BI.MultiSelectCheckSelectedButton),BI.MultiSelectEditor=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.MultiSelectEditor.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-multi-select-editor",el:{},watermark:BI.i18nText("BI-Basic_Search")})},_init:function(){BI.MultiSelectEditor.superclass._init.apply(this,arguments);var self=this,o=this.options;this.editor=BI.createWidget(o.el,{type:"bi.state_editor",element:this,height:o.height,watermark:o.watermark,allowBlank:!0,value:o.value,defaultText:o.text,text:o.text,tipType:o.tipType,warningTitle:o.warningTitle}),this.editor.on(BI.Controller.EVENT_CHANGE,function(){self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.editor.on(BI.StateEditor.EVENT_PAUSE,function(){self.fireEvent(BI.MultiSelectEditor.EVENT_PAUSE)}),this.editor.on(BI.StateEditor.EVENT_FOCUS,function(){self.fireEvent(BI.MultiSelectEditor.EVENT_FOCUS)}),this.editor.on(BI.StateEditor.EVENT_BLUR,function(){self.fireEvent(BI.MultiSelectEditor.EVENT_BLUR)})},focus:function(){this.editor.focus()},blur:function(){this.editor.blur()},setState:function(state){this.editor.setState(state)},setValue:function(v){this.editor.setValue(v)},setTipType:function(v){this.editor.setTipType(v)},getValue:function(){var v=this.editor.getState();return BI.isArray(v)&&v.length>0?v[v.length-1]:""},getKeywords:function(){var val=this.editor.getLastChangedValue(),keywords=val.match(/[\S]+/g);return BI.isEndWithBlank(val)?keywords.concat([" "]):keywords},populate:function(items){}}),BI.MultiSelectEditor.EVENT_FOCUS="EVENT_FOCUS",BI.MultiSelectEditor.EVENT_BLUR="EVENT_BLUR",BI.MultiSelectEditor.EVENT_PAUSE="EVENT_PAUSE",BI.shortcut("bi.multi_select_editor",BI.MultiSelectEditor),BI.MultiSelectInsertSearcher=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.MultiSelectInsertSearcher.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-multi-select-searcher",itemsCreator:BI.emptyFn,el:{},popup:{},valueFormatter:BI.emptyFn,adapter:null,masker:{},text:BI.i18nText("BI-Basic_Please_Select")})},_init:function(){BI.MultiSelectInsertSearcher.superclass._init.apply(this,arguments);var self=this,o=this.options;this.editor=BI.createWidget(o.el,{type:"bi.multi_select_editor",watermark:o.watermark,height:o.height,text:o.text,listeners:[{eventName:BI.MultiSelectEditor.EVENT_FOCUS,action:function(){self.fireEvent(BI.MultiSelectInsertSearcher.EVENT_FOCUS)}},{eventName:BI.MultiSelectEditor.EVENT_BLUR,action:function(){self.fireEvent(BI.MultiSelectInsertSearcher.EVENT_BLUR)}}]}),this.searcher=BI.createWidget({type:"bi.searcher",element:this,height:o.height,isAutoSearch:!1,isAutoSync:!1,onSearch:function(op,callback){callback()},el:this.editor,popup:BI.extend({type:"bi.multi_select_search_insert_pane",valueFormatter:o.valueFormatter,keywordGetter:function(){return self.editor.getValue()},itemsCreator:function(op,callback){var keyword=self.editor.getValue();op.keywords=[keyword],this.setKeyword(keyword),o.itemsCreator(op,callback)},value:o.value,listeners:[{eventName:BI.MultiSelectSearchInsertPane.EVENT_ADD_ITEM,action:function(){self.fireEvent(BI.MultiSelectInsertSearcher.EVENT_ADD_ITEM)}}]},o.popup),adapter:o.adapter,masker:o.masker}),this.searcher.on(BI.Searcher.EVENT_START,function(){self.fireEvent(BI.MultiSelectInsertSearcher.EVENT_START)}),this.searcher.on(BI.Searcher.EVENT_PAUSE,function(){this.hasMatched(),self.fireEvent(BI.MultiSelectInsertSearcher.EVENT_PAUSE)}),this.searcher.on(BI.Searcher.EVENT_STOP,function(){self.fireEvent(BI.MultiSelectInsertSearcher.EVENT_STOP)}),this.searcher.on(BI.Searcher.EVENT_CHANGE,function(){self.fireEvent(BI.MultiSelectInsertSearcher.EVENT_CHANGE,arguments)}),this.searcher.on(BI.Searcher.EVENT_SEARCHING,function(){var keywords=this.getKeywords();self.fireEvent(BI.MultiSelectInsertSearcher.EVENT_SEARCHING,keywords)}),BI.isNotNull(o.value)&&this.setState(o.value)},adjustView:function(){this.searcher.adjustView()},isSearching:function(){return this.searcher.isSearching()},stopSearch:function(){this.searcher.stopSearch()},getKeyword:function(){return this.editor.getValue()},hasMatched:function(){return this.searcher.hasMatched()},hasChecked:function(){return this.searcher.getView()&&this.searcher.getView().hasChecked()},setAdapter:function(adapter){this.searcher.setAdapter(adapter)},setState:function(ob){var o=this.options;if(ob||(ob={}),ob.value||(ob.value=[]),ob.type===BI.Selection.All)if(0===ob.value.length)this.editor.setState(BI.Selection.All);else if(BI.size(ob.assist)<=20){var state="";BI.each(ob.assist,function(i,v){state+=0===i?""+(o.valueFormatter(v+"")||v):","+(o.valueFormatter(v+"")||v)}),this.editor.setState(state)}else this.editor.setState(BI.Selection.Multi);else if(0===ob.value.length)this.editor.setState(BI.Selection.None);else if(BI.size(ob.value)<=20){var state="";BI.each(ob.value,function(i,v){state+=0===i?""+(o.valueFormatter(v+"")||v):","+(o.valueFormatter(v+"")||v)}),this.editor.setState(state)}else this.editor.setState(BI.Selection.Multi)},setValue:function(ob){this.setState(ob),this.searcher.setValue(ob)},getKey:function(){return this.editor.getValue()},getValue:function(){return this.searcher.getValue()},populate:function(items){this.searcher.populate.apply(this.searcher,arguments)}}),BI.MultiSelectInsertSearcher.EVENT_BEFORE_POPUPVIEW="EVENT_BEFORE_POPUPVIEW",BI.MultiSelectInsertSearcher.EVENT_CHANGE="EVENT_CHANGE",BI.MultiSelectInsertSearcher.EVENT_START="EVENT_START",BI.MultiSelectInsertSearcher.EVENT_STOP="EVENT_STOP",BI.MultiSelectInsertSearcher.EVENT_PAUSE="EVENT_PAUSE",BI.MultiSelectInsertSearcher.EVENT_SEARCHING="EVENT_SEARCHING",BI.MultiSelectInsertSearcher.EVENT_ADD_ITEM="EVENT_ADD_ITEM",BI.MultiSelectInsertSearcher.EVENT_FOCUS="EVENT_FOCUS",BI.MultiSelectInsertSearcher.EVENT_BLUR="EVENT_BLUR",BI.shortcut("bi.multi_select_insert_searcher",BI.MultiSelectInsertSearcher),BI.MultiSelectSearcher=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.MultiSelectSearcher.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-multi-select-searcher",itemsCreator:BI.emptyFn,el:{},popup:{},valueFormatter:BI.emptyFn,adapter:null,masker:{},text:BI.i18nText("BI-Basic_Please_Select")})},_init:function(){BI.MultiSelectSearcher.superclass._init.apply(this,arguments);var self=this,o=this.options;this.editor=BI.createWidget(o.el,{type:"bi.multi_select_editor",height:o.height,text:o.text,listeners:[{eventName:BI.MultiSelectEditor.EVENT_FOCUS,action:function(){self.fireEvent(BI.MultiSelectSearcher.EVENT_FOCUS)}},{eventName:BI.MultiSelectEditor.EVENT_BLUR,action:function(){self.fireEvent(BI.MultiSelectSearcher.EVENT_BLUR)}}]}),this.searcher=BI.createWidget({type:"bi.searcher",element:this,height:o.height,isAutoSearch:!1,isAutoSync:!1,onSearch:function(op,callback){callback()},el:this.editor,popup:BI.extend({type:"bi.multi_select_search_pane",valueFormatter:o.valueFormatter,keywordGetter:function(){return self.editor.getValue()},itemsCreator:function(op,callback){var keyword=self.editor.getValue();op.keywords=[keyword],this.setKeyword(keyword),o.itemsCreator(op,callback)},value:o.value},o.popup),adapter:o.adapter,masker:o.masker}),this.searcher.on(BI.Searcher.EVENT_START,function(){self.fireEvent(BI.MultiSelectSearcher.EVENT_START)}),this.searcher.on(BI.Searcher.EVENT_PAUSE,function(){this.hasMatched(),self.fireEvent(BI.MultiSelectSearcher.EVENT_PAUSE)}),this.searcher.on(BI.Searcher.EVENT_STOP,function(){self.fireEvent(BI.MultiSelectSearcher.EVENT_STOP)}),this.searcher.on(BI.Searcher.EVENT_CHANGE,function(){self.fireEvent(BI.MultiSelectSearcher.EVENT_CHANGE,arguments)}),this.searcher.on(BI.Searcher.EVENT_SEARCHING,function(){var keywords=this.getKeywords();self.fireEvent(BI.MultiSelectSearcher.EVENT_SEARCHING,keywords)}),BI.isNotNull(o.value)&&this.setState(o.value)},adjustView:function(){this.searcher.adjustView()},isSearching:function(){return this.searcher.isSearching()},stopSearch:function(){this.searcher.stopSearch()},getKeyword:function(){return this.editor.getValue()},hasMatched:function(){return this.searcher.hasMatched()},hasChecked:function(){return this.searcher.getView()&&this.searcher.getView().hasChecked()},setAdapter:function(adapter){this.searcher.setAdapter(adapter)},setState:function(ob){var o=this.options;if(ob||(ob={}),ob.value||(ob.value=[]),ob.type===BI.Selection.All)if(0===ob.value.length)this.editor.setState(BI.Selection.All);else if(BI.size(ob.assist)<=20){var state="";BI.each(ob.assist,function(i,v){state+=0===i?""+(o.valueFormatter(v+"")||v):","+(o.valueFormatter(v+"")||v)}),this.editor.setState(state)}else this.editor.setState(BI.Selection.Multi);else if(0===ob.value.length)this.editor.setState(BI.Selection.None);else if(BI.size(ob.value)<=20){var state="";BI.each(ob.value,function(i,v){state+=0===i?""+(o.valueFormatter(v+"")||v):","+(o.valueFormatter(v+"")||v)}),this.editor.setState(state)}else this.editor.setState(BI.Selection.Multi)},setValue:function(ob){this.setState(ob),this.searcher.setValue(ob)},getKey:function(){return this.editor.getValue()},getValue:function(){return this.searcher.getValue()},populate:function(items){this.searcher.populate.apply(this.searcher,arguments)}}),BI.MultiSelectSearcher.EVENT_BEFORE_POPUPVIEW="EVENT_BEFORE_POPUPVIEW",BI.MultiSelectSearcher.EVENT_CHANGE="EVENT_CHANGE",BI.MultiSelectSearcher.EVENT_START="EVENT_START",BI.MultiSelectSearcher.EVENT_STOP="EVENT_STOP",BI.MultiSelectSearcher.EVENT_PAUSE="EVENT_PAUSE",BI.MultiSelectSearcher.EVENT_SEARCHING="EVENT_SEARCHING",BI.MultiSelectSearcher.EVENT_FOCUS="EVENT_FOCUS",BI.MultiSelectSearcher.EVENT_BLUR="EVENT_BLUR",BI.shortcut("bi.multi_select_searcher",BI.MultiSelectSearcher),BI.MultiSelectCheckSelectedSwitcher=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.MultiSelectCheckSelectedSwitcher.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-multi-select-check-selected-switcher",itemsCreator:BI.emptyFn,valueFormatter:BI.emptyFn,el:{},popup:{},adapter:null,masker:{}})},_init:function(){BI.MultiSelectCheckSelectedSwitcher.superclass._init.apply(this,arguments);var self=this,o=this.options;this.button=BI.createWidget(o.el,{type:"bi.multi_select_check_selected_button",itemsCreator:o.itemsCreator,value:o.value}),this.button.on(BI.Events.VIEW,function(){self.fireEvent(BI.Events.VIEW,arguments)}),this.switcher=BI.createWidget({type:"bi.switcher",toggle:!1,element:this,el:this.button,popup:BI.extend({type:"bi.multi_select_check_pane",valueFormatter:o.valueFormatter,itemsCreator:o.itemsCreator,onClickContinueSelect:function(){self.switcher.hideView()},ref:function(_ref){self.checkPane=_ref},value:o.value},o.popup),adapter:o.adapter,masker:o.masker}),this.switcher.on(BI.Switcher.EVENT_TRIGGER_CHANGE,function(){self.fireEvent(BI.MultiSelectCheckSelectedSwitcher.EVENT_TRIGGER_CHANGE)}),this.switcher.on(BI.Switcher.EVENT_BEFORE_POPUPVIEW,function(){self.fireEvent(BI.MultiSelectCheckSelectedSwitcher.EVENT_BEFORE_POPUPVIEW)}),this.switcher.on(BI.Switcher.EVENT_AFTER_POPUPVIEW,function(){var me=this;BI.nextTick(function(){me.populate()})})},adjustView:function(){this.switcher.adjustView()},hideView:function(){this.switcher.empty(),this.switcher.hideView()},setAdapter:function(adapter){this.switcher.setAdapter(adapter)},setValue:function(v){this.switcher.setValue(v)},updateSelectedValue:function(v){this.checkPane.setValue(v)},setButtonChecked:function(v){this.button.setValue(v)},getValue:function(){},populate:function(items){this.switcher.populate.apply(this.switcher,arguments)}}),BI.MultiSelectCheckSelectedSwitcher.EVENT_TRIGGER_CHANGE="EVENT_TRIGGER_CHANGE",BI.MultiSelectCheckSelectedSwitcher.EVENT_BEFORE_POPUPVIEW="EVENT_BEFORE_POPUPVIEW",BI.shortcut("bi.multi_select_check_selected_switcher",BI.MultiSelectCheckSelectedSwitcher),BI.MultiSelectInsertList=BI.inherit(BI.Single,{_defaultConfig:function(){return BI.extend(BI.MultiSelectInsertList.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-multi-select-insert-list",itemsCreator:BI.emptyFn,valueFormatter:BI.emptyFn})},_init:function(){BI.MultiSelectInsertList.superclass._init.apply(this,arguments);var self=this,o=this.options;this.storeValue=o.value||{};var assertShowValue=function(){BI.isKey(self._startValue)&&(self.storeValue.type===BI.Selection.All?BI.remove(self.storeValue.value,self._startValue):BI.pushDistinct(self.storeValue.value,self._startValue))};this.adapter=BI.createWidget({type:"bi.multi_select_loader",cls:"popup-multi-select-list bi-border-left bi-border-right bi-border-bottom",itemsCreator:o.itemsCreator,valueFormatter:o.valueFormatter,logic:{dynamic:!0},el:{},value:o.value}),this.adapter.on(BI.MultiSelectLoader.EVENT_CHANGE,function(){self.storeValue=this.getValue(),assertShowValue(),self.fireEvent(BI.MultiSelectInsertList.EVENT_CHANGE)}),this.searcherPane=BI.createWidget({type:"bi.multi_select_search_insert_pane",cls:"bi-border-left bi-border-right bi-border-bottom",valueFormatter:o.valueFormatter,keywordGetter:function(){return self.trigger.getKeyword()},itemsCreator:function(op,callback){op.keywords=[self.trigger.getKeyword()],this.setKeyword(op.keywords[0]),o.itemsCreator(op,callback)},listeners:[{eventName:BI.MultiSelectSearchInsertPane.EVENT_ADD_ITEM,action:function(){var keyword=self.trigger.getKeyword();self.trigger.hasMatched()||(self.storeValue.type===BI.Selection.Multi&&BI.pushDistinct(self.storeValue.value,keyword),self._showAdapter(),self.adapter.setValue(self.storeValue),self.adapter.populate(),self.storeValue.type===BI.Selection.Multi&&self.fireEvent(BI.MultiSelectInsertList.EVENT_CHANGE))}}]}),this.searcherPane.setVisible(!1),this.trigger=BI.createWidget({type:"bi.searcher",isAutoSearch:!1,isAutoSync:!1,onSearch:function(op,callback){callback()},adapter:this.adapter,popup:this.searcherPane,height:200,masker:!1,listeners:[{eventName:BI.Searcher.EVENT_START,action:function(){self._showSearcherPane(),self._setStartValue(""),this.setValue(BI.deepClone(self.storeValue))}},{eventName:BI.Searcher.EVENT_STOP,action:function(){self._showAdapter(),self._setStartValue(""),self.adapter.setValue(self.storeValue),self.adapter.populate()}},{eventName:BI.Searcher.EVENT_PAUSE,action:function(){var keyword=this.getKeyword();this.hasMatched()&&self._join({type:BI.Selection.Multi,value:[keyword]},function(){self.storeValue.type===BI.Selection.Multi&&BI.pushDistinct(self.storeValue.value,keyword),self._showAdapter(),self.adapter.setValue(self.storeValue),self._setStartValue(keyword),assertShowValue(),self.adapter.populate(),self._setStartValue(""),self.fireEvent(BI.MultiSelectInsertList.EVENT_CHANGE)}),self._showAdapter()}},{eventName:BI.Searcher.EVENT_SEARCHING,action:function(){var keywords=this.getKeywords(),last=BI.last(keywords);keywords=BI.initial(keywords||[]),keywords.length>0&&self._joinKeywords(keywords,function(){BI.isEndWithBlank(last)?(self.adapter.setValue(self.storeValue),assertShowValue(),self.adapter.populate(),self._setStartValue("")):(self.adapter.setValue(self.storeValue),assertShowValue()),self.fireEvent(BI.MultiSelectInsertList.EVENT_CHANGE)})}},{eventName:BI.Searcher.EVENT_CHANGE,action:function(value,obj){obj instanceof BI.MultiSelectBar?self._joinAll(this.getValue(),function(){assertShowValue(),self.fireEvent(BI.MultiSelectInsertList.EVENT_CHANGE)}):self._join(this.getValue(),function(){assertShowValue(),self.fireEvent(BI.MultiSelectInsertList.EVENT_CHANGE)})}}],value:o.value}),BI.createWidget({type:"bi.vtape",element:this,items:[{el:this.trigger,height:24},{el:this.adapter,height:"fill"}]}),BI.createWidget({type:"bi.absolute",element:this,items:[{el:this.searcherPane,top:30,bottom:0,left:0,right:0}]})},_showAdapter:function(){this.adapter.setVisible(!0),this.searcherPane.setVisible(!1)},_showSearcherPane:function(){this.searcherPane.setVisible(!0),this.adapter.setVisible(!1)},_defaultState:function(){this.trigger.stopEditing()},_assertValue:function(val){val||(val={}),val.type||(val.type=BI.Selection.Multi),val.value||(val.value=[])},_makeMap:function(values){return BI.makeObject(values||[])},_joinKeywords:function(keywords,callback){function digest(items){var selectedMap=self._makeMap(items);BI.each(keywords,function(i,val){BI.isNotNull(selectedMap[val])&&(self.storeValue.type===BI.Selection.Multi?BI.pushDistinct(self.storeValue.value,val):BI.remove(self.storeValue.value,val))}),callback()}var self=this,o=this.options;this._assertValue(this.storeValue),o.itemsCreator({type:BI.MultiSelectInsertList.REQ_GET_ALL_DATA,keywords:keywords},function(ob){var values=BI.map(ob.items,"value");digest(values)})},_joinAll:function(res,callback){var self=this,o=this.options;this._assertValue(res),o.itemsCreator({type:BI.MultiSelectInsertList.REQ_GET_ALL_DATA,keywords:[self.trigger.getKeyword()]},function(ob){var items=BI.map(ob.items,"value");if(self.storeValue.type===res.type){var change=!1,map=self._makeMap(self.storeValue.value);return BI.each(items,function(i,v){BI.isNotNull(map[v])&&(change=!0,delete map[v])}),change&&(self.storeValue.value=BI.values(map)),void callback()}var selectedMap=self._makeMap(self.storeValue.value),notSelectedMap=self._makeMap(res.value),newItems=[];BI.each(items,function(i,item){BI.isNotNull(selectedMap[items[i]])&&delete selectedMap[items[i]],BI.isNull(notSelectedMap[items[i]])&&newItems.push(item)}),self.storeValue.value=newItems.concat(BI.values(selectedMap)),callback()})},_join:function(res,callback){var self=this,o=this.options;if(this._assertValue(res),this._assertValue(this.storeValue),this.storeValue.type===res.type){var map=this._makeMap(this.storeValue.value);BI.each(res.value,function(i,v){map[v]||(self.storeValue.value.push(v),map[v]=v)});var change=!1;return BI.each(res.assist,function(i,v){BI.isNotNull(map[v])&&(change=!0,delete map[v])}),change&&(this.storeValue.value=BI.values(map)),void callback()}this._joinAll(res,callback)},_setStartValue:function(value){this._startValue=value,this.adapter.setStartValue(value)},isAllSelected:function(){return this.adapter.isAllSelected()},resize:function(){},setValue:function(v){this.storeValue=v||{},this._assertValue(this.storeValue),this.adapter.setValue(this.storeValue),this.trigger.setValue(this.storeValue)},getValue:function(){return BI.deepClone(this.storeValue)},populate:function(){this.adapter.populate.apply(this.adapter,arguments),this.trigger.populate.apply(this.trigger,arguments)}}),BI.extend(BI.MultiSelectInsertList,{REQ_GET_DATA_LENGTH:1,REQ_GET_ALL_DATA:-1}),BI.MultiSelectInsertList.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.multi_select_insert_list",BI.MultiSelectInsertList),BI.MultiSelectInsertNoBarList=BI.inherit(BI.Single,{_defaultConfig:function(){return BI.extend(BI.MultiSelectInsertNoBarList.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-multi-select-insert-list",itemsCreator:BI.emptyFn,valueFormatter:BI.emptyFn})},_init:function(){BI.MultiSelectInsertNoBarList.superclass._init.apply(this,arguments);var self=this,o=this.options;this.storeValue={type:BI.Selection.Multi,value:o.value||[]};var assertShowValue=function(){BI.isKey(self._startValue)&&(self.storeValue.type===BI.Selection.All?BI.remove(self.storeValue.value,self._startValue):BI.pushDistinct(self.storeValue.value,self._startValue))};this.adapter=BI.createWidget({type:"bi.multi_select_no_bar_loader",cls:"popup-multi-select-list bi-border-left bi-border-right bi-border-bottom",itemsCreator:o.itemsCreator,valueFormatter:o.valueFormatter,logic:{dynamic:!1},el:{},value:{type:BI.Selection.Multi,value:o.value||[]}}),this.adapter.on(BI.MultiSelectLoader.EVENT_CHANGE,function(){self.storeValue=this.getValue(),assertShowValue(),self.fireEvent(BI.MultiSelectInsertNoBarList.EVENT_CHANGE)}),this.searcherPane=BI.createWidget({type:"bi.multi_select_search_insert_pane",cls:"bi-border-left bi-border-right bi-border-bottom",valueFormatter:o.valueFormatter,keywordGetter:function(){return self.trigger.getKeyword()},itemsCreator:function(op,callback){op.keywords=[self.trigger.getKeyword()],this.setKeyword(op.keywords[0]),o.itemsCreator(op,callback)},listeners:[{eventName:BI.MultiSelectSearchInsertPane.EVENT_ADD_ITEM,action:function(){var keyword=self.trigger.getKeyword();self.trigger.hasMatched()||(self.storeValue.type===BI.Selection.Multi&&BI.pushDistinct(self.storeValue.value,keyword),self._showAdapter(),self.adapter.setValue(self.storeValue),self.adapter.populate(),self.storeValue.type===BI.Selection.Multi&&self.fireEvent(BI.MultiSelectInsertNoBarList.EVENT_CHANGE))}}]}),this.searcherPane.setVisible(!1),this.trigger=BI.createWidget({type:"bi.searcher",isAutoSearch:!1,isAutoSync:!1,onSearch:function(op,callback){callback()},adapter:this.adapter,popup:this.searcherPane,height:200,masker:!1,listeners:[{eventName:BI.Searcher.EVENT_START,action:function(){self._showSearcherPane(),self._setStartValue(""),this.setValue(BI.deepClone(self.storeValue))}},{eventName:BI.Searcher.EVENT_STOP,action:function(){self._showAdapter(),self._setStartValue(""),self.adapter.setValue(self.storeValue),self.adapter.populate()}},{eventName:BI.Searcher.EVENT_PAUSE,action:function(){var keyword=this.getKeyword();this.hasMatched()&&self._join({type:BI.Selection.Multi,value:[keyword]},function(){self.storeValue.type===BI.Selection.Multi&&BI.pushDistinct(self.storeValue.value,keyword),self._showAdapter(),self.adapter.setValue(self.storeValue),self._setStartValue(keyword),assertShowValue(),self.adapter.populate(),self._setStartValue(""),self.fireEvent(BI.MultiSelectInsertNoBarList.EVENT_CHANGE)})}},{eventName:BI.Searcher.EVENT_SEARCHING,action:function(){var keywords=this.getKeywords(),last=BI.last(keywords);keywords=BI.initial(keywords||[]),keywords.length>0&&self._joinKeywords(keywords,function(){BI.isEndWithBlank(last)?(self.adapter.setValue(self.storeValue),assertShowValue(),self.adapter.populate(),self._setStartValue("")):(self.adapter.setValue(self.storeValue),assertShowValue()),self.fireEvent(BI.MultiSelectInsertNoBarList.EVENT_CHANGE)})}},{eventName:BI.Searcher.EVENT_CHANGE,action:function(value,obj){obj instanceof BI.MultiSelectBar?self._joinAll(this.getValue(),function(){assertShowValue(),self.fireEvent(BI.MultiSelectInsertNoBarList.EVENT_CHANGE)}):self._join(this.getValue(),function(){assertShowValue(),self.fireEvent(BI.MultiSelectInsertNoBarList.EVENT_CHANGE)})}}],value:{type:BI.Selection.Multi,value:o.value||[]}}),BI.createWidget({type:"bi.vtape",element:this,items:[{el:this.trigger,height:24},{el:this.adapter,height:"fill"}]}),BI.createWidget({type:"bi.absolute",element:this,items:[{el:this.searcherPane,top:30,bottom:0,left:0,right:0}]})},_showAdapter:function(){this.adapter.setVisible(!0),this.searcherPane.setVisible(!1)},_showSearcherPane:function(){this.searcherPane.setVisible(!0),this.adapter.setVisible(!1)},_defaultState:function(){this.trigger.stopEditing()},_assertValue:function(val){val||(val={}),val.type||(val.type=BI.Selection.Multi),val.value||(val.value=[])},_makeMap:function(values){return BI.makeObject(values||[])},_joinKeywords:function(keywords,callback){function digest(items){var selectedMap=self._makeMap(items);BI.each(keywords,function(i,val){BI.isNotNull(selectedMap[val])&&(self.storeValue.type===BI.Selection.Multi?BI.pushDistinct(self.storeValue.value,val):BI.remove(self.storeValue.value,val))}),callback()}var self=this,o=this.options;this._assertValue(this.storeValue),o.itemsCreator({type:BI.MultiSelectInsertNoBarList.REQ_GET_ALL_DATA,keywords:keywords},function(ob){var values=BI.map(ob.items,"value");digest(values)})},_joinAll:function(res,callback){var self=this,o=this.options;this._assertValue(res),o.itemsCreator({type:BI.MultiSelectInsertNoBarList.REQ_GET_ALL_DATA,keywords:[self.trigger.getKeyword()]},function(ob){var items=BI.map(ob.items,"value");if(self.storeValue.type===res.type){var change=!1,map=self._makeMap(self.storeValue.value);return BI.each(items,function(i,v){BI.isNotNull(map[v])&&(change=!0,delete map[v])}),change&&(self.storeValue.value=BI.values(map)),void callback()}var selectedMap=self._makeMap(self.storeValue.value),notSelectedMap=self._makeMap(res.value),newItems=[];BI.each(items,function(i,item){BI.isNotNull(selectedMap[items[i]])&&delete selectedMap[items[i]],BI.isNull(notSelectedMap[items[i]])&&newItems.push(item)}),self.storeValue.value=newItems.concat(BI.values(selectedMap)),callback()})},_join:function(res,callback){var self=this,o=this.options;if(this._assertValue(res),this._assertValue(this.storeValue),this.storeValue.type===res.type){var map=this._makeMap(this.storeValue.value);BI.each(res.value,function(i,v){map[v]||(self.storeValue.value.push(v),map[v]=v)});var change=!1;return BI.each(res.assist,function(i,v){BI.isNotNull(map[v])&&(change=!0,delete map[v])}),change&&(this.storeValue.value=BI.values(map)),void callback()}this._joinAll(res,callback)},_setStartValue:function(value){this._startValue=value,this.adapter.setStartValue(value)},isAllSelected:function(){return this.adapter.isAllSelected()},resize:function(){},setValue:function(v){this.storeValue={type:BI.Selection.Multi,value:v||[]},this.adapter.setValue(this.storeValue),this.trigger.setValue(this.storeValue)},getValue:function(){return BI.deepClone(this.storeValue.value)},populate:function(){this.adapter.populate.apply(this.adapter,arguments),this.trigger.populate.apply(this.trigger,arguments)}}),BI.extend(BI.MultiSelectInsertNoBarList,{ +REQ_GET_DATA_LENGTH:1,REQ_GET_ALL_DATA:-1}),BI.MultiSelectInsertNoBarList.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.multi_select_insert_no_bar_list",BI.MultiSelectInsertNoBarList),BI.MultiSelectList=BI.inherit(BI.Widget,{_constant:{EDITOR_HEIGHT:24},_defaultConfig:function(){return BI.extend(BI.MultiSelectList.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-multi-select-list",itemsCreator:BI.emptyFn,valueFormatter:BI.emptyFn})},_init:function(){BI.MultiSelectList.superclass._init.apply(this,arguments);var self=this,o=this.options;this.storeValue={};var assertShowValue=function(){BI.isKey(self._startValue)&&(self.storeValue.type===BI.Selection.All?BI.remove(self.storeValue.value,self._startValue):BI.pushDistinct(self.storeValue.value,self._startValue))};this.adapter=BI.createWidget({type:"bi.multi_select_loader",cls:"popup-multi-select-list bi-border-left bi-border-right bi-border-bottom",itemsCreator:o.itemsCreator,valueFormatter:o.valueFormatter,logic:{dynamic:!1},el:{}}),this.adapter.on(BI.MultiSelectLoader.EVENT_CHANGE,function(){self.storeValue=this.getValue(),self._adjust(function(){assertShowValue(),self.fireEvent(BI.MultiSelectList.EVENT_CHANGE)})}),this.searcherPane=BI.createWidget({type:"bi.multi_select_search_pane",cls:"bi-border-left bi-border-right bi-border-bottom",valueFormatter:o.valueFormatter,keywordGetter:function(){return self.trigger.getKeyword()},itemsCreator:function(op,callback){op.keywords=[self.trigger.getKeyword()],this.setKeyword(op.keywords[0]),o.itemsCreator(op,callback)}}),this.searcherPane.setVisible(!1),this.trigger=BI.createWidget({type:"bi.searcher",isAutoSearch:!1,isAutoSync:!1,onSearch:function(op,callback){callback()},adapter:this.adapter,popup:this.searcherPane,height:200,masker:!1,listeners:[{eventName:BI.Searcher.EVENT_START,action:function(){self._showSearcherPane(),self._setStartValue(""),this.setValue(BI.deepClone(self.storeValue))}},{eventName:BI.Searcher.EVENT_STOP,action:function(){self._showAdapter(),self._setStartValue(""),self.adapter.setValue(self.storeValue),self.adapter.populate()}},{eventName:BI.Searcher.EVENT_PAUSE,action:function(){var keyword=this.getKeyword();this.hasMatched()&&self._join({type:BI.Selection.Multi,value:[keyword]},function(){self._showAdapter(),self.adapter.setValue(self.storeValue),self._setStartValue(keyword),assertShowValue(),self.adapter.populate(),self._setStartValue(""),self.fireEvent(BI.MultiSelectList.EVENT_CHANGE)})}},{eventName:BI.Searcher.EVENT_SEARCHING,action:function(){var keywords=this.getKeyword(),last=BI.last(keywords);keywords=BI.initial(keywords||[]),keywords.length>0&&self._joinKeywords(keywords,function(){BI.isEndWithBlank(last)?(self.adapter.setValue(self.storeValue),assertShowValue(),self.adapter.populate(),self._setStartValue("")):(self.adapter.setValue(self.storeValue),assertShowValue()),self.fireEvent(BI.MultiSelectList.EVENT_CHANGE)})}},{eventName:BI.Searcher.EVENT_CHANGE,action:function(value,obj){obj instanceof BI.MultiSelectBar?self._joinAll(this.getValue(),function(){assertShowValue(),self.fireEvent(BI.MultiSelectList.EVENT_CHANGE)}):self._join(this.getValue(),function(){assertShowValue(),self.fireEvent(BI.MultiSelectList.EVENT_CHANGE)})}}]}),BI.createWidget({type:"bi.vtape",element:this,items:[{el:this.trigger,height:this._constant.EDITOR_HEIGHT},{el:this.adapter,height:"fill"}]}),BI.createWidget({type:"bi.absolute",element:this,items:[{el:this.searcherPane,top:this._constant.EDITOR_HEIGHT,bottom:0,left:0,right:0}]})},_showAdapter:function(){this.adapter.setVisible(!0),this.searcherPane.setVisible(!1)},_showSearcherPane:function(){this.searcherPane.setVisible(!0),this.adapter.setVisible(!1)},_defaultState:function(){this.trigger.stopEditing()},_assertValue:function(val){val||(val={}),val.type||(val.type=BI.Selection.Multi),val.value||(val.value=[])},_makeMap:function(values){return BI.makeObject(values||[])},_joinKeywords:function(keywords,callback){function digest(items){var selectedMap=self._makeMap(items);BI.each(keywords,function(i,val){BI.isNotNull(selectedMap[val])&&(self.storeValue.type===BI.Selection.Multi?BI.pushDistinct(self.storeValue.value,val):BI.remove(self.storeValue.value,val))}),self._adjust(callback)}var self=this,o=this.options;this._assertValue(this.storeValue),o.itemsCreator({type:BI.MultiSelectList.REQ_GET_ALL_DATA,keywords:keywords},function(ob){var values=BI.map(ob.items,"value");digest(values)})},_joinAll:function(res,callback){var self=this,o=this.options;this._assertValue(res),o.itemsCreator({type:BI.MultiSelectList.REQ_GET_ALL_DATA,keywords:[this.trigger.getKey()]},function(ob){var items=BI.map(ob.items,"value");if(self.storeValue.type===res.type){var change=!1,map=self._makeMap(self.storeValue.value);return BI.each(items,function(i,v){BI.isNotNull(map[v])&&(change=!0,delete map[v])}),change&&(self.storeValue.value=BI.values(map)),void self._adjust(callback)}var selectedMap=self._makeMap(self.storeValue.value),notSelectedMap=self._makeMap(res.value),newItems=[];BI.each(items,function(i,item){BI.isNotNull(selectedMap[items[i]])&&delete selectedMap[items[i]],BI.isNull(notSelectedMap[items[i]])&&newItems.push(item)}),self.storeValue.value=newItems.concat(BI.values(selectedMap)),self._adjust(callback)})},_adjust:function(callback){function adjust(){self.storeValue.type===BI.Selection.All&&self.storeValue.value.length>=self._count?self.storeValue={type:BI.Selection.Multi,value:[]}:self.storeValue.type===BI.Selection.Multi&&self.storeValue.value.length>=self._count&&(self.storeValue={type:BI.Selection.All,value:[]})}var self=this,o=this.options;this._count?(adjust(),callback()):o.itemsCreator({type:BI.MultiSelectList.REQ_GET_DATA_LENGTH},function(res){self._count=res.count,adjust(),callback()})},_join:function(res,callback){var self=this,o=this.options;if(this._assertValue(res),this._assertValue(this.storeValue),this.storeValue.type===res.type){var map=this._makeMap(this.storeValue.value);BI.each(res.value,function(i,v){map[v]||(self.storeValue.value.push(v),map[v]=v)});var change=!1;return BI.each(res.assist,function(i,v){BI.isNotNull(map[v])&&(change=!0,delete map[v])}),change&&(this.storeValue.value=BI.values(map)),void self._adjust(callback)}this._joinAll(res,callback)},_setStartValue:function(value){this._startValue=value,this.adapter.setStartValue(value)},isAllSelected:function(){return this.adapter.isAllSelected()},resize:function(){},setValue:function(v){this.storeValue=v||{},this._assertValue(this.storeValue),this.adapter.setValue(this.storeValue),this.trigger.setValue(this.storeValue)},getValue:function(){return BI.deepClone(this.storeValue)},populate:function(){this.adapter.populate.apply(this.adapter,arguments),this.trigger.populate.apply(this.trigger,arguments)}}),BI.extend(BI.MultiSelectList,{REQ_GET_DATA_LENGTH:1,REQ_GET_ALL_DATA:-1}),BI.MultiSelectList.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.multi_select_list",BI.MultiSelectList),BI.MultiSelectTree=BI.inherit(BI.Single,{_constant:{EDITOR_HEIGHT:24},_defaultConfig:function(){return BI.extend(BI.MultiSelectTree.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-multi-select-tree",itemsCreator:BI.emptyFn})},_init:function(){BI.MultiSelectTree.superclass._init.apply(this,arguments);var self=this,o=this.options;this.storeValue={value:{}},this.adapter=BI.createWidget({type:"bi.multi_select_tree_popup",itemsCreator:o.itemsCreator}),this.adapter.on(BI.MultiSelectTreePopup.EVENT_CHANGE,function(){self.searcher.isSearching()?self.storeValue={value:self.searcherPane.getValue()}:self.storeValue={value:self.adapter.getValue()},self.setSelectedValue(self.storeValue.value),self.fireEvent(BI.MultiSelectTree.EVENT_CHANGE)}),this.searcherPane=BI.createWidget({type:"bi.multi_tree_search_pane",cls:"bi-border-left bi-border-right bi-border-bottom",keywordGetter:function(){return self.searcher.getKeyword()},itemsCreator:function(op,callback){op.keyword=self.searcher.getKeyword(),o.itemsCreator(op,callback)}}),this.searcherPane.setVisible(!1),this.searcher=BI.createWidget({type:"bi.searcher",isAutoSearch:!1,isAutoSync:!1,onSearch:function(op,callback){callback({keyword:self.searcher.getKeyword()})},adapter:this.adapter,popup:this.searcherPane,masker:!1,listeners:[{eventName:BI.Searcher.EVENT_START,action:function(){self._showSearcherPane()}},{eventName:BI.Searcher.EVENT_STOP,action:function(){self._showAdapter(),BI.nextTick(function(){self.adapter.populate()})}},{eventName:BI.Searcher.EVENT_CHANGE,action:function(){self.searcher.isSearching()?self.storeValue={value:self.searcherPane.getValue()}:self.storeValue={value:self.adapter.getValue()},self.setSelectedValue(self.storeValue.value),self.fireEvent(BI.MultiSelectTree.EVENT_CHANGE)}},{eventName:BI.Searcher.EVENT_PAUSE,action:function(){self._showAdapter()}}]}),BI.createWidget({type:"bi.vtape",element:this,items:[{el:this.searcher,height:this._constant.EDITOR_HEIGHT},{el:this.adapter,height:"fill"}]}),BI.createWidget({type:"bi.absolute",element:this,items:[{el:this.searcherPane,top:this._constant.EDITOR_HEIGHT,bottom:0,left:0,right:0}]})},_showAdapter:function(){this.adapter.setVisible(!0),this.searcherPane.setVisible(!1)},_showSearcherPane:function(){this.searcherPane.setVisible(!0),this.adapter.setVisible(!1)},resize:function(){},setSelectedValue:function(v){this.storeValue.value=v||{},this.adapter.setSelectedValue(v),this.searcherPane.setSelectedValue(v),this.searcher.setValue({value:v||{}})},setValue:function(v){this.adapter.setValue(v)},stopSearch:function(){this.searcher.stopSearch()},updateValue:function(v){this.adapter.updateValue(v)},getValue:function(){return this.storeValue.value},populate:function(){this.searcher.populate.apply(this.searcher,arguments),this.adapter.populate.apply(this.adapter,arguments)}}),BI.MultiSelectTree.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.multi_select_tree",BI.MultiSelectTree),BI.MultiSelectTreePopup=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.MultiSelectTreePopup.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-multi-select-tree-popup bi-border-left bi-border-right bi-border-bottom",itemsCreator:BI.emptyFn})},_init:function(){BI.MultiSelectTreePopup.superclass._init.apply(this,arguments);var self=this,o=this.options;this.popup=BI.createWidget({type:"bi.async_tree",element:this,itemsCreator:o.itemsCreator}),this.popup.on(BI.TreeView.EVENT_AFTERINIT,function(){self.fireEvent(BI.MultiSelectTreePopup.EVENT_AFTER_INIT)}),this.popup.on(BI.TreeView.EVENT_CHANGE,function(){self.fireEvent(BI.MultiSelectTreePopup.EVENT_CHANGE)})},hasChecked:function(){return this.popup.hasChecked()},getValue:function(){return this.popup.getValue()},setValue:function(v){v||(v={}),this.popup.setValue(v)},setSelectedValue:function(v){v||(v={}),this.popup.setSelectedValue(v)},updateValue:function(v){this.popup.updateValue(v),this.popup.refresh()},populate:function(config){this.popup.stroke(config)}}),BI.MultiSelectTreePopup.EVENT_AFTER_INIT="EVENT_AFTER_INIT",BI.MultiSelectTreePopup.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.multi_select_tree_popup",BI.MultiSelectTreePopup),BI.MultiTreeCheckPane=BI.inherit(BI.Pane,{constants:{height:25,lgap:10,tgap:5},_defaultConfig:function(){return BI.extend(BI.MultiTreeCheckPane.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-multi-tree-check-pane bi-background",onClickContinueSelect:BI.emptyFn,el:{type:"bi.display_tree"}})},_init:function(){BI.MultiTreeCheckPane.superclass._init.apply(this,arguments);var self=this,opts=this.options;this.selectedValues={};var continueSelect=BI.createWidget({type:"bi.text_button",text:BI.i18nText("BI-Continue_Select"),cls:"multi-tree-check-selected"});continueSelect.on(BI.TextButton.EVENT_CHANGE,function(){opts.onClickContinueSelect(),BI.nextTick(function(){self.empty()})});var backToPopup=BI.createWidget({type:"bi.left",cls:"multi-tree-continue-select",items:[{el:{type:"bi.label",text:BI.i18nText("BI-Selected_Data")},lgap:this.constants.lgap,tgap:this.constants.tgap},{el:continueSelect,lgap:this.constants.lgap,tgap:this.constants.tgap}]});this.display=BI.createWidget(opts.el,{type:"bi.display_tree",cls:"bi-multi-tree-display",itemsCreator:function(op,callback){op.type=BI.TreeView.REQ_TYPE_GET_SELECTED_DATA,opts.itemsCreator(op,callback)},value:(opts.value||{}).value}),this.display.on(BI.Events.AFTERINIT,function(){self.fireEvent(BI.Events.AFTERINIT)}),this.display.on(BI.TreeView.EVENT_INIT,function(){backToPopup.setVisible(!1)}),this.display.on(BI.TreeView.EVENT_AFTERINIT,function(){backToPopup.setVisible(!0)}),BI.createWidget({type:"bi.vtape",element:this,items:[{height:this.constants.height,el:backToPopup},{height:"fill",el:this.display}]})},empty:function(){this.display.empty()},populate:function(configs){this.display.stroke(configs)},setValue:function(v){v||(v={}),this.display.setSelectedValue(v.value)},getValue:function(){}}),BI.MultiTreeCheckPane.EVENT_CONTINUE_CLICK="EVENT_CONTINUE_CLICK",BI.shortcut("bi.multi_tree_check_pane",BI.MultiTreeCheckPane),BI.MultiTreeCombo=BI.inherit(BI.Single,{constants:{offset:{top:0,left:0,right:0,bottom:25}},_defaultConfig:function(){return BI.extend(BI.MultiTreeCombo.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-multi-tree-combo",itemsCreator:BI.emptyFn,valueFormatter:BI.emptyFn,height:24})},_init:function(){function showCounter(){isSearching()?self.storeValue={value:self.trigger.getValue()}:isPopupView()&&(self.storeValue={value:self.combo.getValue()}),self.trigger.setValue(self.storeValue),self.numberCounter.setValue(self.storeValue)}BI.MultiTreeCombo.superclass._init.apply(this,arguments);var self=this,o=this.options,isInit=!1,want2showCounter=!1;this.storeValue={value:o.value||{}},this.trigger=BI.createWidget({type:"bi.multi_select_trigger",height:o.height,valueFormatter:o.valueFormatter,text:o.text,watermark:o.watermark,masker:{offset:this.constants.offset},searcher:{type:"bi.multi_tree_searcher",itemsCreator:o.itemsCreator},value:{value:o.value||{}}}),this.combo=BI.createWidget({type:"bi.combo",toggle:!1,container:o.container,el:this.trigger,adjustLength:1,popup:{type:"bi.multi_tree_popup_view",ref:function(){self.popup=this,self.trigger.setAdapter(this),self.numberCounter.setAdapter(this)},listeners:[{eventName:BI.MultiTreePopup.EVENT_AFTERINIT,action:function(){self.numberCounter.adjustView(),isInit=!0,want2showCounter===!0&&showCounter()}},{eventName:BI.MultiTreePopup.EVENT_CHANGE,action:function(){change=!0;var val={type:BI.Selection.Multi,value:this.hasChecked()?this.getValue():{}};self.trigger.getSearcher().setState(val),self.numberCounter.setButtonChecked(val),self.fireEvent(BI.MultiTreeCombo.EVENT_CLICK_ITEM)}},{eventName:BI.MultiTreePopup.EVENT_CLICK_CONFIRM,action:function(){self.combo.hideView()}},{eventName:BI.MultiTreePopup.EVENT_CLICK_CLEAR,action:function(){clear=!0,self.setValue(),self._defaultState()}}],itemsCreator:o.itemsCreator,onLoaded:function(){BI.nextTick(function(){self.numberCounter.adjustView(),self.trigger.getSearcher().adjustView()})}},value:{value:o.value||{}},hideChecker:function(e){return 0===triggerBtn.element.find(e.target).length&&0===self.numberCounter.element.find(e.target).length}});var change=!1,clear=!1,isSearching=function(){return self.trigger.getSearcher().isSearching()},isPopupView=function(){return self.combo.isViewVisible()};this.trigger.on(BI.MultiSelectTrigger.EVENT_FOCUS,function(){self.fireEvent(BI.MultiTreeCombo.EVENT_FOCUS)}),this.trigger.on(BI.MultiSelectTrigger.EVENT_BLUR,function(){self.fireEvent(BI.MultiTreeCombo.EVENT_BLUR)}),this.trigger.on(BI.MultiSelectTrigger.EVENT_START,function(){self.storeValue={value:self.combo.getValue()},this.setValue(self.storeValue),self.numberCounter.setValue(self.storeValue)}),this.trigger.on(BI.MultiSelectTrigger.EVENT_STOP,function(){self.storeValue={value:this.getValue()},self.combo.setValue(self.storeValue),self.numberCounter.setValue(self.storeValue),BI.nextTick(function(){isPopupView()&&self.combo.populate()}),self.fireEvent(BI.MultiTreeCombo.EVENT_STOP)}),this.trigger.on(BI.MultiSelectTrigger.EVENT_SEARCHING,function(){self.fireEvent(BI.MultiTreeCombo.EVENT_SEARCHING)}),this.trigger.on(BI.MultiSelectTrigger.EVENT_TRIGGER_CLICK,function(){self.combo.toggle()}),this.trigger.on(BI.MultiSelectTrigger.EVENT_COUNTER_CLICK,function(){self.combo.isViewVisible()||self.combo.showView()}),this.trigger.on(BI.MultiSelectTrigger.EVENT_CHANGE,function(){var checked=this.getSearcher().hasChecked(),val={type:BI.Selection.Multi,value:checked?{1:1}:{}};this.getSearcher().setState(checked?BI.Selection.Multi:BI.Selection.None),self.numberCounter.setButtonChecked(val),self.fireEvent(BI.MultiTreeCombo.EVENT_CLICK_ITEM)}),this.combo.on(BI.Combo.EVENT_BEFORE_POPUPVIEW,function(){isSearching()||(change===!0&&(self.storeValue={value:self.combo.getValue()},change=!1),self.combo.setValue(self.storeValue),self.numberCounter.setValue(self.storeValue),self.populate())}),this.combo.on(BI.Combo.EVENT_BEFORE_HIDEVIEW,function(){isSearching()?(self._stopEditing(),self.fireEvent(BI.MultiTreeCombo.EVENT_CONFIRM)):isPopupView()&&(self._stopEditing(),self.storeValue={value:self.combo.getValue()},clear===!0&&(self.storeValue={value:{}}),self.fireEvent(BI.MultiTreeCombo.EVENT_CONFIRM)),clear=!1,change=!1});var triggerBtn=BI.createWidget({type:"bi.trigger_icon_button",width:o.height,height:o.height,cls:"multi-select-trigger-icon-button"});triggerBtn.on(BI.TriggerIconButton.EVENT_CHANGE,function(){self.numberCounter.hideView(),self.combo.isViewVisible()?self.combo.hideView():self.combo.showView()}),this.numberCounter=BI.createWidget({type:"bi.multi_select_check_selected_switcher",el:{type:"bi.multi_tree_check_selected_button"},popup:{type:"bi.multi_tree_check_pane"},masker:{offset:this.constants.offset},itemsCreator:o.itemsCreator,valueFormatter:o.valueFormatter,value:{value:o.value||{}}}),this.numberCounter.on(BI.MultiSelectCheckSelectedSwitcher.EVENT_TRIGGER_CHANGE,function(){self.combo.isViewVisible()||self.combo.showView()}),this.numberCounter.on(BI.MultiSelectCheckSelectedSwitcher.EVENT_BEFORE_POPUPVIEW,function(){want2showCounter===!1&&(want2showCounter=!0),isInit===!0&&(want2showCounter=null,showCounter())}),this.numberCounter.on(BI.Events.VIEW,function(b){BI.nextTick(function(){self.trigger.refreshPlaceHolderWidth(b===!0?self.numberCounter.element.outerWidth()+8:0)})}),this.trigger.element.click(function(e){self.trigger.element.find(e.target).length>0&&self.numberCounter.hideView()}),BI.createWidget({type:"bi.absolute",element:this,items:[{el:this.combo,left:0,right:0,top:0,bottom:0},{el:triggerBtn,right:0,top:0,bottom:0},{el:{type:"bi.vertical_adapt",items:[this.numberCounter]},right:o.height,top:0,height:o.height}]})},_stopEditing:function(){this.trigger.stopEditing(),this.numberCounter.hideView()},_defaultState:function(){this._stopEditing(),this.combo.hideView()},setValue:function(v){this.storeValue.value=v||{},this.combo.setValue({value:v||{}}),this.numberCounter.setValue({value:v||{}})},getValue:function(){return BI.deepClone(this.storeValue.value)},populate:function(){this.combo.populate.apply(this.combo,arguments)}}),BI.MultiTreeCombo.EVENT_FOCUS="EVENT_FOCUS",BI.MultiTreeCombo.EVENT_BLUR="EVENT_BLUR",BI.MultiTreeCombo.EVENT_STOP="EVENT_STOP",BI.MultiTreeCombo.EVENT_SEARCHING="EVENT_SEARCHING",BI.MultiTreeCombo.EVENT_CLICK_ITEM="EVENT_CLICK_ITEM",BI.MultiTreeCombo.EVENT_CONFIRM="EVENT_CONFIRM",BI.shortcut("bi.multi_tree_combo",BI.MultiTreeCombo),BI.MultiTreeInsertCombo=BI.inherit(BI.Single,{constants:{offset:{top:0,left:0,right:0,bottom:25}},_defaultConfig:function(){return BI.extend(BI.MultiTreeInsertCombo.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-multi-tree-insert-combo",itemsCreator:BI.emptyFn,valueFormatter:BI.emptyFn,height:24,allowEdit:!0})},_init:function(){function showCounter(){isSearching()?self.storeValue={value:self.trigger.getValue()}:isPopupView()&&(self.storeValue={value:self.combo.getValue()}),self.trigger.setValue(self.storeValue),self.numberCounter.setValue(self.storeValue)}BI.MultiTreeInsertCombo.superclass._init.apply(this,arguments);var self=this,o=this.options,isInit=!1,want2showCounter=!1;this.storeValue={value:o.value||{}},this.trigger=BI.createWidget({type:"bi.multi_select_trigger",allowEdit:o.allowEdit,height:o.height,valueFormatter:o.valueFormatter,masker:{offset:this.constants.offset},searcher:{type:"bi.multi_tree_searcher",text:o.text,watermark:o.watermark,itemsCreator:o.itemsCreator,popup:{type:"bi.multi_tree_search_insert_pane",listeners:[{eventName:BI.MultiTreeSearchInsertPane.EVENT_ADD_ITEM,action:function(){self.storeValue.value[self.trigger.getSearcher().getKeyword()]={},self._assertShowValue(),self.combo.setValue(self.storeValue),self.numberCounter.setValue(self.storeValue),self._stopEditing()}}]}},value:{value:o.value||{}}}),this.combo=BI.createWidget({type:"bi.combo",toggle:!1,container:o.container,el:this.trigger,adjustLength:1,popup:{type:"bi.multi_tree_popup_view",ref:function(){self.popup=this,self.trigger.setAdapter(this),self.numberCounter.setAdapter(this)},listeners:[{eventName:BI.MultiTreePopup.EVENT_AFTERINIT,action:function(){self.numberCounter.adjustView(),isInit=!0,want2showCounter===!0&&showCounter()}},{eventName:BI.MultiTreePopup.EVENT_CHANGE,action:function(){change=!0;var val={type:BI.Selection.Multi,value:this.hasChecked()?this.getValue():{}};self.trigger.getSearcher().setState(val),self.numberCounter.setButtonChecked(val),self.fireEvent(BI.MultiTreeInsertCombo.EVENT_CLICK_ITEM,self.combo.getValue())}},{eventName:BI.MultiTreePopup.EVENT_CLICK_CONFIRM,action:function(){self.combo.hideView()}},{eventName:BI.MultiTreePopup.EVENT_CLICK_CLEAR,action:function(){clear=!0,self.setValue(),self._defaultState()}}],itemsCreator:o.itemsCreator,onLoaded:function(){BI.nextTick(function(){self.numberCounter.adjustView(),self.trigger.getSearcher().adjustView()})}},value:{value:o.value||{}},hideChecker:function(e){return 0===triggerBtn.element.find(e.target).length&&0===self.numberCounter.element.find(e.target).length}});var change=!1,clear=!1,isSearching=function(){return self.trigger.getSearcher().isSearching()},isPopupView=function(){return self.combo.isViewVisible()};this.trigger.on(BI.MultiSelectTrigger.EVENT_FOCUS,function(){self.fireEvent(BI.MultiTreeInsertCombo.EVENT_FOCUS)}),this.trigger.on(BI.MultiSelectTrigger.EVENT_BLUR,function(){self.fireEvent(BI.MultiTreeInsertCombo.EVENT_BLUR)}),this.trigger.on(BI.MultiSelectTrigger.EVENT_START,function(){self.storeValue={value:self.combo.getValue()},this.setValue(self.storeValue),self.numberCounter.setValue(self.storeValue)}),this.trigger.on(BI.MultiSelectTrigger.EVENT_STOP,function(){self.storeValue={value:this.getValue()},self.combo.setValue(self.storeValue),self.numberCounter.setValue(self.storeValue),BI.nextTick(function(){isPopupView()&&self.combo.populate()}),self.fireEvent(BI.MultiTreeInsertCombo.EVENT_STOP)}),this.trigger.on(BI.MultiSelectTrigger.EVENT_SEARCHING,function(){self.fireEvent(BI.MultiTreeInsertCombo.EVENT_SEARCHING)}),this.trigger.on(BI.MultiSelectTrigger.EVENT_TRIGGER_CLICK,function(){self.combo.toggle()}),this.trigger.on(BI.MultiSelectTrigger.EVENT_CHANGE,function(){var checked=this.getSearcher().hasChecked(),val={type:BI.Selection.Multi,value:checked?{1:1}:{}};this.getSearcher().setState(checked?BI.Selection.Multi:BI.Selection.None),self.numberCounter.setButtonChecked(val),self.fireEvent(BI.MultiTreeInsertCombo.EVENT_CLICK_ITEM,self.combo.getValue())}),this.combo.on(BI.Combo.EVENT_BEFORE_POPUPVIEW,function(){isSearching()||(change===!0&&(self.storeValue={value:self.combo.getValue()},change=!1),self.combo.setValue(self.storeValue),self.numberCounter.setValue(self.storeValue),self.populate())}),this.combo.on(BI.Combo.EVENT_BEFORE_HIDEVIEW,function(){isSearching()?(self._stopEditing(),self.fireEvent(BI.MultiTreeInsertCombo.EVENT_CONFIRM)):isPopupView()&&(self._stopEditing(),self.storeValue={value:self.combo.getValue()},clear===!0&&(self.storeValue={value:{}}),self.fireEvent(BI.MultiTreeInsertCombo.EVENT_CONFIRM)),clear=!1,change=!1});var triggerBtn=BI.createWidget({type:"bi.trigger_icon_button",width:o.height,height:o.height,cls:"multi-select-trigger-icon-button"});triggerBtn.on(BI.TriggerIconButton.EVENT_CHANGE,function(){self.numberCounter.hideView(),self.combo.isViewVisible()?self.combo.hideView():self.combo.showView()}),this.numberCounter=BI.createWidget({type:"bi.multi_select_check_selected_switcher",el:{type:"bi.multi_tree_check_selected_button"},popup:{type:"bi.multi_tree_check_pane"},itemsCreator:o.itemsCreator,masker:{offset:this.constants.offset},valueFormatter:o.valueFormatter,value:o.value}),this.numberCounter.on(BI.MultiSelectCheckSelectedSwitcher.EVENT_TRIGGER_CHANGE,function(){self.combo.isViewVisible()||self.combo.showView()}),this.numberCounter.on(BI.MultiSelectCheckSelectedSwitcher.EVENT_BEFORE_POPUPVIEW,function(){want2showCounter===!1&&(want2showCounter=!0),isInit===!0&&(want2showCounter=null,showCounter())}),this.numberCounter.on(BI.Events.VIEW,function(b){BI.nextTick(function(){self.trigger.refreshPlaceHolderWidth(b===!0?self.numberCounter.element.outerWidth()+8:0)})}),this.trigger.element.click(function(e){self.trigger.element.find(e.target).length>0&&self.numberCounter.hideView()}),BI.createWidget({type:"bi.absolute",element:this,items:[{el:this.combo,left:0,right:0,top:0,bottom:0},{el:triggerBtn,right:0,top:0,bottom:0},{el:{type:"bi.vertical_adapt",items:[this.numberCounter]},right:o.height,top:0,height:o.height}]})},_assertShowValue:function(){this.trigger.getSearcher().setState(this.storeValue),this.numberCounter.setButtonChecked(this.storeValue)},_stopEditing:function(){this.trigger.stopEditing(),this.numberCounter.hideView()},_defaultState:function(){this._stopEditing(),this.combo.hideView()},setValue:function(v){this.storeValue.value=v||{},this.combo.setValue({value:v||{}}),this.numberCounter.setValue({value:v||{}})},getValue:function(){return BI.deepClone(this.storeValue.value)},populate:function(){this.combo.populate.apply(this.combo,arguments)}}),BI.MultiTreeInsertCombo.EVENT_FOCUS="EVENT_FOCUS",BI.MultiTreeInsertCombo.EVENT_BLUR="EVENT_BLUR",BI.MultiTreeInsertCombo.EVENT_STOP="EVENT_STOP",BI.MultiTreeInsertCombo.EVENT_CLICK_ITEM="EVENT_CLICK_ITEM",BI.MultiTreeInsertCombo.EVENT_SEARCHING="EVENT_SEARCHING",BI.MultiTreeInsertCombo.EVENT_CONFIRM="EVENT_CONFIRM",BI.shortcut("bi.multi_tree_insert_combo",BI.MultiTreeInsertCombo),BI.MultiTreeListCombo=BI.inherit(BI.Single,{constants:{offset:{top:0,left:0,right:0,bottom:25}},_defaultConfig:function(){return BI.extend(BI.MultiTreeListCombo.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-multi-tree-list-combo",itemsCreator:BI.emptyFn,valueFormatter:BI.emptyFn,height:24,allowEdit:!0,allowInsertValue:!0})},_init:function(){function showCounter(){isSearching()?self.storeValue={value:self.trigger.getValue()}:isPopupView()&&(self.storeValue={value:self.combo.getValue()}),self.trigger.setValue(self.storeValue),self.numberCounter.setValue(self.storeValue)}BI.MultiTreeListCombo.superclass._init.apply(this,arguments);var self=this,o=this.options,isInit=!1,want2showCounter=!1;this.storeValue={value:o.value||[]},this.trigger=BI.createWidget({type:"bi.multi_select_trigger",allowEdit:o.allowEdit,text:o.text,watermark:o.watermark,height:o.height,valueFormatter:o.valueFormatter,masker:{offset:this.constants.offset},searcher:{type:"bi.multi_list_tree_searcher",itemsCreator:o.itemsCreator,popup:{type:o.allowInsertValue?"bi.multi_tree_search_insert_pane":"bi.multi_tree_search_pane",el:{type:"bi.list_part_tree"},listeners:[{eventName:BI.MultiTreeSearchInsertPane.EVENT_ADD_ITEM,action:function(){self.storeValue.value.unshift([self.trigger.getSearcher().getKeyword()]),self._assertShowValue(),self.combo.setValue(self.storeValue),self.numberCounter.setValue(self.storeValue),self._stopEditing()}}]}},switcher:{el:{type:"bi.multi_tree_check_selected_button"},popup:{type:"bi.multi_tree_check_pane",el:{type:"bi.list_display_tree"},itemsCreator:o.itemsCreator}},value:{value:o.value||{}}}),this.combo=BI.createWidget({type:"bi.combo",toggle:!1,container:o.container,el:this.trigger,adjustLength:1,popup:{type:"bi.multi_tree_popup_view",ref:function(){self.popup=this,self.trigger.setAdapter(this),self.numberCounter.setAdapter(this)},el:{type:"bi.list_async_tree"},listeners:[{eventName:BI.MultiTreePopup.EVENT_AFTERINIT,action:function(){self.numberCounter.adjustView(),isInit=!0,want2showCounter===!0&&showCounter()}},{eventName:BI.MultiTreePopup.EVENT_CHANGE,action:function(){change=!0;var val={type:BI.Selection.Multi,value:this.hasChecked()?this.getValue():[]};self.trigger.getSearcher().setState(val),self.numberCounter.setButtonChecked(val),self.fireEvent(BI.MultiTreeListCombo.EVENT_CLICK_ITEM,self.combo.getValue())}},{eventName:BI.MultiTreePopup.EVENT_CLICK_CONFIRM,action:function(){self.combo.hideView()}},{eventName:BI.MultiTreePopup.EVENT_CLICK_CLEAR,action:function(){clear=!0,self.setValue(),self._defaultState()}}],itemsCreator:o.itemsCreator,onLoaded:function(){BI.nextTick(function(){self.numberCounter.adjustView(),self.trigger.getSearcher().adjustView()})}},value:{value:o.value||{}},hideChecker:function(e){return 0===triggerBtn.element.find(e.target).length&&0===self.numberCounter.element.find(e.target).length}});var change=!1,clear=!1,isSearching=function(){return self.trigger.getSearcher().isSearching()},isPopupView=function(){return self.combo.isViewVisible()};this.trigger.on(BI.MultiSelectTrigger.EVENT_FOCUS,function(){self.fireEvent(BI.MultiTreeListCombo.EVENT_FOCUS)}),this.trigger.on(BI.MultiSelectTrigger.EVENT_BLUR,function(){self.fireEvent(BI.MultiTreeListCombo.EVENT_BLUR)}),this.trigger.on(BI.MultiSelectTrigger.EVENT_START,function(){self.storeValue={value:self.combo.getValue()},this.setValue(self.storeValue),self.numberCounter.setValue(self.storeValue)}),this.trigger.on(BI.MultiSelectTrigger.EVENT_STOP,function(){self.storeValue={value:this.getValue()},self.combo.setValue(self.storeValue),self.numberCounter.setValue(self.storeValue),BI.nextTick(function(){isPopupView()&&self.combo.populate()}),self.fireEvent(BI.MultiTreeListCombo.EVENT_STOP)}),this.trigger.on(BI.MultiSelectTrigger.EVENT_SEARCHING,function(){self.fireEvent(BI.MultiTreeListCombo.EVENT_SEARCHING)}),this.trigger.on(BI.MultiSelectTrigger.EVENT_TRIGGER_CLICK,function(){self.combo.toggle()}),this.trigger.on(BI.MultiSelectTrigger.EVENT_CHANGE,function(){var checked=this.getSearcher().hasChecked(),val={type:BI.Selection.Multi,value:checked?{1:1}:{}};this.getSearcher().setState(checked?BI.Selection.Multi:BI.Selection.None),self.numberCounter.setButtonChecked(val),self.fireEvent(BI.MultiTreeListCombo.EVENT_CLICK_ITEM,self.combo.getValue())}),this.combo.on(BI.Combo.EVENT_BEFORE_POPUPVIEW,function(){isSearching()||(change===!0&&(self.storeValue={value:self.combo.getValue()},change=!1),self.combo.setValue(self.storeValue),self.numberCounter.setValue(self.storeValue),self.populate())}),this.combo.on(BI.Combo.EVENT_BEFORE_HIDEVIEW,function(){isSearching()?(self.trigger.stopEditing(),self.fireEvent(BI.MultiTreeListCombo.EVENT_CONFIRM)):isPopupView()&&(self._stopEditing(),self.storeValue={value:self.combo.getValue()},clear===!0&&(self.storeValue={value:[]}),self.fireEvent(BI.MultiTreeListCombo.EVENT_CONFIRM)),clear=!1,change=!1});var triggerBtn=BI.createWidget({type:"bi.trigger_icon_button",width:o.height,height:o.height,cls:"multi-select-trigger-icon-button"});triggerBtn.on(BI.TriggerIconButton.EVENT_CHANGE,function(){self.numberCounter.hideView(),self.combo.isViewVisible()?self.combo.hideView():self.combo.showView()}),this.numberCounter=BI.createWidget({type:"bi.multi_select_check_selected_switcher",el:{type:"bi.multi_tree_check_selected_button"},popup:{type:"bi.multi_tree_check_pane"},itemsCreator:o.itemsCreator,masker:{offset:{left:0,top:0,right:0,bottom:25}},valueFormatter:o.valueFormatter,value:o.value}),this.numberCounter.on(BI.MultiSelectCheckSelectedSwitcher.EVENT_TRIGGER_CHANGE,function(){self.combo.isViewVisible()||self.combo.showView(); +}),this.numberCounter.on(BI.MultiSelectCheckSelectedSwitcher.EVENT_BEFORE_POPUPVIEW,function(){want2showCounter===!1&&(want2showCounter=!0),isInit===!0&&(want2showCounter=null,showCounter())}),this.numberCounter.on(BI.Events.VIEW,function(b){BI.nextTick(function(){self.trigger.refreshPlaceHolderWidth(b===!0?self.numberCounter.element.outerWidth()+8:0)})}),this.trigger.element.click(function(e){self.trigger.element.find(e.target).length>0&&self.numberCounter.hideView()}),BI.createWidget({type:"bi.absolute",element:this,items:[{el:this.combo,left:0,right:0,top:0,bottom:0},{el:triggerBtn,right:0,top:0,bottom:0},{el:{type:"bi.vertical_adapt",items:[this.numberCounter]},right:o.height,top:0,height:o.height}]})},_assertShowValue:function(){this.trigger.getSearcher().setState(this.storeValue),this.numberCounter.setButtonChecked(this.storeValue)},_stopEditing:function(){this.trigger.stopEditing(),this.numberCounter.hideView()},_defaultState:function(){this._stopEditing(),this.combo.hideView()},setValue:function(v){this.storeValue.value=v||[],this.combo.setValue({value:v||[]}),this.numberCounter.setValue({value:v||[]})},getValue:function(){return BI.deepClone(this.storeValue.value)},populate:function(){this.combo.populate.apply(this.combo,arguments)}}),BI.MultiTreeListCombo.EVENT_FOCUS="EVENT_FOCUS",BI.MultiTreeListCombo.EVENT_BLUR="EVENT_BLUR",BI.MultiTreeListCombo.EVENT_STOP="EVENT_STOP",BI.MultiTreeListCombo.EVENT_CLICK_ITEM="EVENT_CLICK_ITEM",BI.MultiTreeListCombo.EVENT_SEARCHING="EVENT_SEARCHING",BI.MultiTreeListCombo.EVENT_CONFIRM="EVENT_CONFIRM",BI.shortcut("bi.multi_tree_list_combo",BI.MultiTreeListCombo),BI.MultiTreePopup=BI.inherit(BI.Pane,{_defaultConfig:function(){return BI.extend(BI.MultiTreePopup.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-multi-tree-popup",maxWidth:"auto",minWidth:140,maxHeight:400,onLoaded:BI.emptyFn,el:{type:"bi.async_tree"}})},_init:function(){BI.MultiTreePopup.superclass._init.apply(this,arguments);var self=this,opts=this.options,v=opts.value;this.selectedValues={},this.tree=BI.createWidget(opts.el,{type:"bi.async_tree",height:400,cls:"popup-view-tree",itemsCreator:opts.itemsCreator,onLoaded:opts.onLoaded,value:v.value||{}}),this.popupView=BI.createWidget({type:"bi.multi_popup_view",element:this,stopPropagation:!1,maxWidth:opts.maxWidth,minWidth:opts.minWidth,maxHeight:opts.maxHeight,buttons:[BI.i18nText("BI-Basic_Clears"),BI.i18nText("BI-Basic_Sure")],el:this.tree}),this.popupView.on(BI.MultiPopupView.EVENT_CLICK_TOOLBAR_BUTTON,function(index){switch(index){case 0:self.fireEvent(BI.MultiTreePopup.EVENT_CLICK_CLEAR);break;case 1:self.fireEvent(BI.MultiTreePopup.EVENT_CLICK_CONFIRM)}}),this.tree.on(BI.TreeView.EVENT_CHANGE,function(){self.fireEvent(BI.MultiTreePopup.EVENT_CHANGE)}),this.tree.on(BI.TreeView.EVENT_AFTERINIT,function(){self.fireEvent(BI.MultiTreePopup.EVENT_AFTERINIT)})},getValue:function(){return this.tree.getValue()},setValue:function(v){v||(v={}),this.tree.setSelectedValue(v.value)},populate:function(config){this.tree.stroke(config)},hasChecked:function(){return this.tree.hasChecked()},resetHeight:function(h){this.popupView.resetHeight(h)},resetWidth:function(w){this.popupView.resetWidth(w)}}),BI.MultiTreePopup.EVENT_CHANGE="EVENT_CHANGE",BI.MultiTreePopup.EVENT_CLICK_CONFIRM="EVENT_CLICK_CONFIRM",BI.MultiTreePopup.EVENT_CLICK_CLEAR="EVENT_CLICK_CLEAR",BI.MultiTreePopup.EVENT_AFTERINIT="EVENT_AFTERINIT",BI.shortcut("bi.multi_tree_popup_view",BI.MultiTreePopup),BI.MultiTreeCheckSelectedButton=BI.inherit(BI.Single,{_defaultConfig:function(){return BI.extend(BI.MultiTreeCheckSelectedButton.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-multi-tree-check-selected-button",itemsCreator:BI.emptyFn})},_init:function(){BI.MultiTreeCheckSelectedButton.superclass._init.apply(this,arguments);var self=this;this.indicator=BI.createWidget({type:"bi.icon_button",cls:"check-font trigger-check-selected icon-size-12",width:15,height:15,stopPropagation:!0}),this.checkSelected=BI.createWidget({type:"bi.text_button",cls:"trigger-check-selected",invisible:!0,hgap:4,text:BI.i18nText("BI-Check_Selected"),textAlign:"center",textHeight:15}),this.checkSelected.on(BI.Controller.EVENT_CHANGE,function(){self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.checkSelected.on(BI.TextButton.EVENT_CHANGE,function(){self.fireEvent(BI.MultiSelectCheckSelectedButton.EVENT_CHANGE,arguments)}),BI.createWidget({type:"bi.horizontal",element:this,items:[this.indicator,this.checkSelected]}),this.element.hover(function(){self.indicator.setVisible(!1),self.checkSelected.setVisible(!0)},function(){self.indicator.setVisible(!0),self.checkSelected.setVisible(!1)}),this.setVisible(!1)},setValue:function(v){v||(v={});var show=BI.size(v.value)>0;this.setVisible(show),show&&(this.indicator.setVisible(!0),this.checkSelected.setVisible(!1))}}),BI.MultiTreeCheckSelectedButton.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.multi_tree_check_selected_button",BI.MultiTreeCheckSelectedButton),BI.MultiTreeSearchInsertPane=BI.inherit(BI.Widget,{constants:{height:24},props:{baseCls:"bi-multi-tree-search-insert-pane bi-card",itemsCreator:BI.emptyFn,keywordGetter:BI.emptyFn,el:{type:"bi.part_tree"}},render:function(){var self=this,opts=this.options;return{type:"bi.absolute",items:[{el:{type:"bi.text_button",invisible:!0,ref:function(_ref){self.addTip=_ref},text:BI.i18nText("BI-Basic_Click_To_Add_Text",""),height:this.constants.height,cls:"bi-high-light",handler:function(){self.fireEvent(BI.MultiTreeSearchInsertPane.EVENT_ADD_ITEM,opts.keywordGetter())}},top:5,left:0,right:0},{el:BI.extend({type:"bi.part_tree",tipText:BI.i18nText("BI-No_Select"),itemsCreator:function(op,callback){op.keyword=opts.keywordGetter(),opts.itemsCreator(op,function(res){callback(res),self.setKeyword(opts.keywordGetter(),res.items)})},ref:function(_ref){self.partTree=_ref},value:opts.value,listeners:[{eventName:BI.Controller.EVENT_CHANGE,action:function(){self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}},{eventName:BI.TreeView.EVENT_CHANGE,action:function(){self.fireEvent(BI.MultiTreeSearchInsertPane.EVENT_CHANGE)}}]},opts.el),left:0,top:0,bottom:0,right:0}]}},setKeyword:function(keyword,nodes){var isAddTipVisible=BI.isEmptyArray(nodes);this.addTip.setVisible(isAddTipVisible),this.partTree.setVisible(!isAddTipVisible),isAddTipVisible&&this.addTip.setText(BI.i18nText("BI-Basic_Click_To_Add_Text",keyword))},hasChecked:function(){return this.partTree.hasChecked()},setValue:function(v){this.setSelectedValue(v.value)},setSelectedValue:function(v){v||(v={}),this.partTree.setSelectedValue(v)},getValue:function(){return this.partTree.getValue()},empty:function(){this.partTree.empty()},populate:function(op){this.partTree.stroke.apply(this.partTree,arguments)}}),BI.MultiTreeSearchInsertPane.EVENT_CHANGE="EVENT_CHANGE",BI.MultiTreeSearchInsertPane.EVENT_CLICK_CONFIRM="EVENT_CLICK_CONFIRM",BI.MultiTreeSearchInsertPane.EVENT_CLICK_CLEAR="EVENT_CLICK_CLEAR",BI.MultiTreeSearchInsertPane.EVENT_ADD_ITEM="EVENT_ADD_ITEM",BI.shortcut("bi.multi_tree_search_insert_pane",BI.MultiTreeSearchInsertPane),BI.MultiTreeSearchPane=BI.inherit(BI.Pane,{_defaultConfig:function(){return BI.extend(BI.MultiTreeSearchPane.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-multi-tree-search-pane bi-card",itemsCreator:BI.emptyFn,keywordGetter:BI.emptyFn})},_init:function(){BI.MultiTreeSearchPane.superclass._init.apply(this,arguments);var self=this,opts=this.options;this.partTree=BI.createWidget({type:"bi.part_tree",element:this,tipText:BI.i18nText("BI-No_Select"),itemsCreator:function(op,callback){op.keyword=opts.keywordGetter(),opts.itemsCreator(op,callback)},value:opts.value}),this.partTree.on(BI.Controller.EVENT_CHANGE,function(){self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.partTree.on(BI.TreeView.EVENT_CHANGE,function(){self.fireEvent(BI.MultiTreeSearchPane.EVENT_CHANGE)})},hasChecked:function(){return this.partTree.hasChecked()},setValue:function(v){this.setSelectedValue(v.value)},setSelectedValue:function(v){v||(v={}),this.partTree.setSelectedValue(v)},getValue:function(){return this.partTree.getValue()},empty:function(){this.partTree.empty()},populate:function(op){this.partTree.stroke.apply(this.partTree,arguments)}}),BI.MultiTreeSearchPane.EVENT_CHANGE="EVENT_CHANGE",BI.MultiTreeSearchPane.EVENT_CLICK_CONFIRM="EVENT_CLICK_CONFIRM",BI.MultiTreeSearchPane.EVENT_CLICK_CLEAR="EVENT_CLICK_CLEAR",BI.shortcut("bi.multi_tree_search_pane",BI.MultiTreeSearchPane),BI.MultiListTreeSearcher=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.MultiListTreeSearcher.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-multi-tree-searcher",itemsCreator:BI.emptyFn,valueFormatter:function(v){return v},popup:{},adapter:null,masker:{}})},_init:function(){BI.MultiListTreeSearcher.superclass._init.apply(this,arguments);var self=this,o=this.options;this.editor=BI.createWidget({type:"bi.multi_select_editor",height:o.height,el:{type:"bi.simple_state_editor",height:o.height}}),this.searcher=BI.createWidget({type:"bi.searcher",element:this,isAutoSearch:!1,isAutoSync:!1,onSearch:function(op,callback){callback({keyword:self.editor.getValue()})},el:this.editor,popup:BI.extend({type:"bi.multi_tree_search_pane",keywordGetter:function(){return self.editor.getValue()},itemsCreator:function(op,callback){op.keyword=self.editor.getValue(),o.itemsCreator(op,callback)},value:o.value},o.popup),adapter:o.adapter,masker:o.masker}),this.searcher.on(BI.Searcher.EVENT_START,function(){self.fireEvent(BI.MultiListTreeSearcher.EVENT_START)}),this.searcher.on(BI.Searcher.EVENT_PAUSE,function(){this.hasMatched(),self.fireEvent(BI.MultiListTreeSearcher.EVENT_PAUSE)}),this.searcher.on(BI.Searcher.EVENT_STOP,function(){self.fireEvent(BI.MultiListTreeSearcher.EVENT_STOP)}),this.searcher.on(BI.Searcher.EVENT_CHANGE,function(){self.fireEvent(BI.MultiListTreeSearcher.EVENT_CHANGE,arguments)}),BI.isNotNull(o.value)&&this.setState(o.value)},adjustView:function(){this.searcher.adjustView()},setAdapter:function(adapter){this.searcher.setAdapter(adapter)},isSearching:function(){return this.searcher.isSearching()},stopSearch:function(){this.searcher.stopSearch()},getKeyword:function(){return this.editor.getValue()},hasMatched:function(){return this.searcher.hasMatched()},hasChecked:function(){return this.searcher.getView()&&this.searcher.getView().hasChecked()},setState:function(ob){var o=this.options;ob||(ob={}),ob.value||(ob.value=[]);var count=0;if(BI.isNumber(ob))this.editor.setState(ob);else if(0===BI.size(ob.value))this.editor.setState(BI.Selection.None);else{var text="";BI.each(ob.value,function(idx,path){var childValue=BI.last(path);text+=(o.valueFormatter(childValue+"")||childValue)+"; ",count++}),count>20?this.editor.setState(BI.Selection.Multi):this.editor.setState(text)}},setValue:function(ob){this.setState(ob),this.searcher.setValue(ob)},getKey:function(){return this.editor.getValue()},getValue:function(){return this.searcher.getValue()},populate:function(items){this.searcher.populate.apply(this.searcher,arguments)}}),BI.MultiListTreeSearcher.EVENT_BEFORE_POPUPVIEW="EVENT_BEFORE_POPUPVIEW",BI.MultiListTreeSearcher.EVENT_CHANGE="EVENT_CHANGE",BI.MultiListTreeSearcher.EVENT_START="EVENT_START",BI.MultiListTreeSearcher.EVENT_STOP="EVENT_STOP",BI.MultiListTreeSearcher.EVENT_PAUSE="EVENT_PAUSE",BI.shortcut("bi.multi_list_tree_searcher",BI.MultiListTreeSearcher),BI.MultiTreeSearcher=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.MultiTreeSearcher.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-multi-tree-searcher",itemsCreator:BI.emptyFn,valueFormatter:function(v){return v},popup:{},adapter:null,masker:{}})},_init:function(){BI.MultiTreeSearcher.superclass._init.apply(this,arguments);var self=this,o=this.options;this.editor=BI.createWidget({type:"bi.multi_select_editor",watermark:o.watermark,height:o.height,el:{type:"bi.simple_state_editor",text:o.text,height:o.height},listeners:[{eventName:BI.MultiSelectEditor.EVENT_FOCUS,action:function(){self.fireEvent(BI.MultiSelectSearcher.EVENT_FOCUS)}},{eventName:BI.MultiSelectEditor.EVENT_BLUR,action:function(){self.fireEvent(BI.MultiSelectSearcher.EVENT_BLUR)}}]}),this.searcher=BI.createWidget({type:"bi.searcher",element:this,isAutoSearch:!1,isAutoSync:!1,onSearch:function(op,callback){callback({keyword:self.editor.getValue()})},el:this.editor,popup:BI.extend({type:"bi.multi_tree_search_pane",keywordGetter:function(){return self.editor.getValue()},itemsCreator:function(op,callback){op.keyword=self.editor.getValue(),o.itemsCreator(op,callback)},value:o.value},o.popup),adapter:o.adapter,masker:o.masker}),this.searcher.on(BI.Searcher.EVENT_START,function(){self.fireEvent(BI.MultiTreeSearcher.EVENT_START)}),this.searcher.on(BI.Searcher.EVENT_PAUSE,function(){this.hasMatched(),self.fireEvent(BI.MultiTreeSearcher.EVENT_PAUSE)}),this.searcher.on(BI.Searcher.EVENT_STOP,function(){self.fireEvent(BI.MultiTreeSearcher.EVENT_STOP)}),this.searcher.on(BI.Searcher.EVENT_CHANGE,function(){self.fireEvent(BI.MultiTreeSearcher.EVENT_CHANGE,arguments)}),this.searcher.on(BI.Searcher.EVENT_SEARCHING,function(){var keywords=this.getKeywords();self.fireEvent(BI.MultiTreeSearcher.EVENT_SEARCHING,keywords)}),BI.isNotNull(o.value)&&this.setState(o.value)},adjustView:function(){this.searcher.adjustView()},setAdapter:function(adapter){this.searcher.setAdapter(adapter)},isSearching:function(){return this.searcher.isSearching()},stopSearch:function(){this.searcher.stopSearch()},getKeyword:function(){return this.editor.getValue()},hasMatched:function(){return this.searcher.hasMatched()},hasChecked:function(){return this.searcher.getView()&&this.searcher.getView().hasChecked()},setState:function(ob){function getChildrenNode(ob){var text="",index=0,size=BI.size(ob);return BI.each(ob,function(name,children){index++;var childNodes=getChildrenNode(children);text+=(o.valueFormatter(name+"")||name)+(""===childNodes?"":":"+childNodes)+(index===size?"":","),""===childNodes&&count++}),text}var o=this.options;ob||(ob={}),ob.value||(ob.value={});var count=0;if(BI.isNumber(ob))this.editor.setState(ob);else if(0===BI.size(ob.value))this.editor.setState(BI.Selection.None);else{var text="";BI.each(ob.value,function(name,children){var childNodes=getChildrenNode(children);text+=(o.valueFormatter(name+"")||name)+(""===childNodes?"":":"+childNodes)+"; ",""===childNodes&&count++}),count>20?this.editor.setState(BI.Selection.Multi):this.editor.setState(text)}},setValue:function(ob){this.setState(ob),this.searcher.setValue(ob)},getKey:function(){return this.editor.getValue()},getValue:function(){return this.searcher.getValue()},populate:function(items){this.searcher.populate.apply(this.searcher,arguments)}}),BI.MultiTreeSearcher.EVENT_SEARCHING="EVENT_SEARCHING",BI.MultiTreeSearcher.EVENT_BEFORE_POPUPVIEW="EVENT_BEFORE_POPUPVIEW",BI.MultiTreeSearcher.EVENT_CHANGE="EVENT_CHANGE",BI.MultiTreeSearcher.EVENT_START="EVENT_START",BI.MultiTreeSearcher.EVENT_STOP="EVENT_STOP",BI.MultiTreeSearcher.EVENT_PAUSE="EVENT_PAUSE",BI.shortcut("bi.multi_tree_searcher",BI.MultiTreeSearcher),BI.NumberEditor=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.NumberEditor.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-number-editor bi-border bi-focus-shadow",validationChecker:function(){return!0},valueFormatter:function(v){return v},value:0,allowBlank:!1,errorText:"",step:1})},_init:function(){BI.NumberEditor.superclass._init.apply(this,arguments);var self=this,o=this.options;this.editor=BI.createWidget({type:"bi.sign_editor",height:o.height-2,allowBlank:o.allowBlank,value:o.valueFormatter(o.value),validationChecker:o.validationChecker,errorText:o.errorText}),this.editor.on(BI.TextEditor.EVENT_CHANGE,function(){self.fireEvent(BI.NumberEditor.EVENT_CHANGE)}),this.editor.on(BI.TextEditor.EVENT_ERROR,function(){o.value=BI.parseFloat(this.getLastValidValue())}),this.editor.on(BI.TextEditor.EVENT_VALID,function(){o.value=BI.parseFloat(this.getValue())}),this.editor.on(BI.TextEditor.EVENT_CONFIRM,function(){self.fireEvent(BI.NumberEditor.EVENT_CONFIRM)}),this.topBtn=BI.createWidget({type:"bi.icon_button",forceNotSelected:!0,trigger:"lclick,",cls:"add-up-font top-button bi-border-left bi-list-item-active2 icon-size-12"}),this.topBtn.on(BI.IconButton.EVENT_CHANGE,function(){self._finetuning(o.step),self.fireEvent(BI.NumberEditor.EVENT_CHANGE),self.fireEvent(BI.NumberEditor.EVENT_CONFIRM)}),this.bottomBtn=BI.createWidget({type:"bi.icon_button",trigger:"lclick,",forceNotSelected:!0,cls:"minus-down-font bottom-button bi-border-left bi-list-item-active2 icon-size-12"}),this.bottomBtn.on(BI.IconButton.EVENT_CHANGE,function(){self._finetuning(-o.step),self.fireEvent(BI.NumberEditor.EVENT_CHANGE),self.fireEvent(BI.NumberEditor.EVENT_CONFIRM)}),BI.createWidget({type:"bi.htape",height:o.height-2,element:this,items:[this.editor,{el:{type:"bi.grid",columns:1,rows:2,items:[{column:0,row:0,el:this.topBtn},{column:0,row:1,el:this.bottomBtn}]},width:23}]})},focus:function(){this.editor.focus()},isEditing:function(){return this.editor.isEditing()},_finetuning:function(add){var v=BI.parseFloat(this.getValue());this.setValue(BI.add(v,add))},setUpEnable:function(v){this.topBtn.setEnable(!!v)},setDownEnable:function(v){this.bottomBtn.setEnable(!!v)},getLastValidValue:function(){return this.editor.getLastValidValue()},getLastChangedValue:function(){return this.editor.getLastChangedValue()},getValue:function(){return this.options.value},setValue:function(v){var o=this.options;o.value=v,this.editor.setValue(o.valueFormatter(v))}}),BI.NumberEditor.EVENT_CONFIRM="EVENT_CONFIRM",BI.NumberEditor.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.number_editor",BI.NumberEditor),BI.NumberInterval=BI.inherit(BI.Single,{constants:{typeError:"typeBubble",numberError:"numberBubble",signalError:"signalBubble",editorWidth:114,columns:5,width:24,rows:1,numberErrorCls:"number-error",border:1,less:0,less_equal:1,numTip:"",adjustYOffset:2},_defaultConfig:function(){var conf=BI.NumberInterval.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{extraCls:"bi-number-interval"+(BI.isIE()&&BI.getIEVersion()<10?" hack":""),height:24,validation:"valid",closeMin:!0,allowBlank:!0,watermark:BI.i18nText("BI-Basic_Unrestricted")})},_init:function(){var self=this,c=this.constants,o=this.options;BI.NumberInterval.superclass._init.apply(this,arguments),this.smallEditor=BI.createWidget({type:"bi.number_interval_single_editor",height:o.height-2,watermark:o.watermark,allowBlank:o.allowBlank,value:o.min,level:"warning",tipType:"success",title:function(){return self.smallEditor&&self.smallEditor.getValue()},quitChecker:function(){return!1},validationChecker:function(v){return!!BI.isNumeric(v)||(self.smallEditorBubbleType=c.typeError,!1)},cls:"number-interval-small-editor bi-border"}),this.smallTip=BI.createWidget({type:"bi.label",text:o.numTip,height:o.height-2,invisible:!0}),BI.createWidget({type:"bi.absolute",element:this.smallEditor.element,items:[{el:this.smallTip,top:0,right:5}]}),this.bigEditor=BI.createWidget({type:"bi.number_interval_single_editor",height:o.height-2,watermark:o.watermark,allowBlank:o.allowBlank,value:o.max,level:"warning",tipType:"success",title:function(){return self.bigEditor&&self.bigEditor.getValue()},quitChecker:function(){return!1},validationChecker:function(v){return!!BI.isNumeric(v)||(self.bigEditorBubbleType=c.typeError,!1)},cls:"number-interval-big-editor bi-border"}),this.bigTip=BI.createWidget({type:"bi.label",text:o.numTip,height:o.height-2,invisible:!0}),BI.createWidget({type:"bi.absolute",element:this.bigEditor.element,items:[{el:this.bigTip,top:0,right:5}]}),this.smallCombo=BI.createWidget({type:"bi.icon_combo",cls:"number-interval-small-combo bi-border-top bi-border-bottom bi-border-right",height:o.height-2,items:[{text:"("+BI.i18nText("BI-Less_Than")+")",iconCls:"less-font",value:0},{text:"("+BI.i18nText("BI-Less_And_Equal")+")",value:1,iconCls:"less-equal-font"}]}),o.closeMin===!0?this.smallCombo.setValue(1):this.smallCombo.setValue(0),this.bigCombo=BI.createWidget({type:"bi.icon_combo",cls:"number-interval-big-combo bi-border-top bi-border-bottom bi-border-left",height:o.height-2,items:[{text:"("+BI.i18nText("BI-Less_Than")+")",iconCls:"less-font",value:0},{text:"("+BI.i18nText("BI-Less_And_Equal")+")",value:1,iconCls:"less-equal-font"}]}),o.closeMax===!0?this.bigCombo.setValue(1):this.bigCombo.setValue(0),this.label=BI.createWidget({type:"bi.label",text:BI.i18nText("BI-Basic_Value"),textHeight:o.height-2*c.border,width:c.width-2*c.border,height:o.height-2*c.border,level:"warning",tipType:"warning"}),this.left=BI.createWidget({type:"bi.htape",items:[{el:self.smallEditor},{el:self.smallCombo,width:c.width-c.border}]}),this.right=BI.createWidget({type:"bi.htape",items:[{el:self.bigCombo,width:c.width-c.border},{el:self.bigEditor,lgap:1}]}),BI.createWidget({element:self,type:"bi.center",hgap:15,height:o.height,items:[{type:"bi.absolute",items:[{el:self.left,left:-15,right:0,top:0,bottom:0}]},{type:"bi.absolute",items:[{el:self.right,left:0,right:-15,top:0,bottom:0}]}]}),BI.createWidget({element:self,type:"bi.horizontal_auto",items:[self.label]}),self._setValidEvent(self.bigEditor,c.bigEditor),self._setValidEvent(self.smallEditor,c.smallEditor),self._setErrorEvent(self.bigEditor,c.bigEditor),self._setErrorEvent(self.smallEditor,c.smallEditor),self._setBlurEvent(self.bigEditor),self._setBlurEvent(self.smallEditor),self._setFocusEvent(self.bigEditor),self._setFocusEvent(self.smallEditor),self._setComboValueChangedEvent(self.bigCombo),self._setComboValueChangedEvent(self.smallCombo),self._setEditorValueChangedEvent(self.bigEditor),self._setEditorValueChangedEvent(self.smallEditor),self._checkValidation()},_checkValidation:function(){var self=this,c=this.constants,o=this.options;if(self._setTitle(""),BI.Bubbles.hide(c.typeError),BI.Bubbles.hide(c.numberError),BI.Bubbles.hide(c.signalError),!self.smallEditor.isValid()||!self.bigEditor.isValid())return self.element.removeClass("number-error"),o.validation="invalid",c.typeError;if(BI.isEmptyString(self.smallEditor.getValue())||BI.isEmptyString(self.bigEditor.getValue()))return self.element.removeClass("number-error"),o.validation="valid","";var smallValue=parseFloat(self.smallEditor.getValue()),bigValue=parseFloat(self.bigEditor.getValue()),bigComboValue=self.bigCombo.getValue(),smallComboValue=self.smallCombo.getValue();return bigComboValue[0]===c.less_equal&&smallComboValue[0]===c.less_equal?smallValue>bigValue?(self.element.addClass("number-error"),o.validation="invalid",c.numberError):(self.element.removeClass("number-error"),o.validation="valid",""):smallValue>bigValue?(self.element.addClass("number-error"),o.validation="invalid",c.numberError):smallValue===bigValue?(self.element.addClass("number-error"),o.validation="invalid",c.signalError):(self.element.removeClass("number-error"),o.validation="valid","")},_setTitle:function(v){var self=this;self.bigEditor.setTitle(v),self.smallEditor.setTitle(v),self.label.setTitle(v)},_setFocusEvent:function(w){var self=this,c=this.constants;w.on(BI.NumberIntervalSingleEidtor.EVENT_FOCUS,function(){switch(self._setTitle(""),self._checkValidation()){case c.typeError:BI.Bubbles.show(c.typeError,BI.i18nText("BI-Numerical_Interval_Input_Data"),self,{offsetStyle:"left",adjustYOffset:c.adjustYOffset});break;case c.numberError:BI.Bubbles.show(c.numberError,BI.i18nText("BI-Numerical_Interval_Number_Value"),self,{offsetStyle:"left",adjustYOffset:c.adjustYOffset});break;case c.signalError:BI.Bubbles.show(c.signalError,BI.i18nText("BI-Numerical_Interval_Signal_Value"),self,{offsetStyle:"left",adjustYOffset:c.adjustYOffset});break;default:return}})},_setBlurEvent:function(w){var c=this.constants,self=this;w.on(BI.NumberIntervalSingleEidtor.EVENT_BLUR,function(){switch(BI.Bubbles.hide(c.typeError),BI.Bubbles.hide(c.numberError),BI.Bubbles.hide(c.signalError),self._checkValidation()){case c.typeError:self._setTitle(BI.i18nText("BI-Numerical_Interval_Input_Data"));break;case c.numberError:self._setTitle(BI.i18nText("BI-Numerical_Interval_Number_Value"));break;case c.signalError:self._setTitle(BI.i18nText("BI-Numerical_Interval_Signal_Value"));break;default:self._setTitle("")}})},_setErrorEvent:function(w){var c=this.constants,self=this;w.on(BI.NumberIntervalSingleEidtor.EVENT_ERROR,function(){self._checkValidation(),BI.Bubbles.show(c.typeError,BI.i18nText("BI-Numerical_Interval_Input_Data"),self,{offsetStyle:"left",adjustYOffset:c.adjustYOffset}),self.fireEvent(BI.NumberInterval.EVENT_ERROR)})},_setValidEvent:function(w){var self=this,c=this.constants;w.on(BI.NumberIntervalSingleEidtor.EVENT_VALID,function(){switch(self._checkValidation()){case c.numberError:BI.Bubbles.show(c.numberError,BI.i18nText("BI-Numerical_Interval_Number_Value"),self,{offsetStyle:"left",adjustYOffset:c.adjustYOffset}),self.fireEvent(BI.NumberInterval.EVENT_ERROR);break;case c.signalError:BI.Bubbles.show(c.signalError,BI.i18nText("BI-Numerical_Interval_Signal_Value"),self,{offsetStyle:"left",adjustYOffset:c.adjustYOffset}),self.fireEvent(BI.NumberInterval.EVENT_ERROR);break;default:self.fireEvent(BI.NumberInterval.EVENT_VALID)}})},_setEditorValueChangedEvent:function(w){var self=this,c=this.constants;w.on(BI.NumberIntervalSingleEidtor.EVENT_CHANGE,function(){switch(self._checkValidation()){case c.typeError:BI.Bubbles.show(c.typeError,BI.i18nText("BI-Numerical_Interval_Input_Data"),self,{offsetStyle:"left",adjustYOffset:c.adjustYOffset});break;case c.numberError:BI.Bubbles.show(c.numberError,BI.i18nText("BI-Numerical_Interval_Number_Value"),self,{offsetStyle:"left",adjustYOffset:c.adjustYOffset});break;case c.signalError:BI.Bubbles.show(c.signalError,BI.i18nText("BI-Numerical_Interval_Signal_Value"),self,{offsetStyle:"left",adjustYOffset:c.adjustYOffset})}self.fireEvent(BI.NumberInterval.EVENT_CHANGE)}),w.on(BI.NumberIntervalSingleEidtor.EVENT_CONFIRM,function(){self.fireEvent(BI.NumberInterval.EVENT_CONFIRM)})},_setComboValueChangedEvent:function(w){var self=this,c=this.constants;w.on(BI.IconCombo.EVENT_CHANGE,function(){switch(self._checkValidation()){case c.typeError:self._setTitle(BI.i18nText("BI-Numerical_Interval_Input_Data")),self.fireEvent(BI.NumberInterval.EVENT_ERROR);break;case c.numberError:self._setTitle(BI.i18nText("BI-Numerical_Interval_Number_Value")),self.fireEvent(BI.NumberInterval.EVENT_ERROR);break;case c.signalError:self._setTitle(BI.i18nText("BI-Numerical_Interval_Signal_Value")),self.fireEvent(BI.NumberInterval.EVENT_ERROR);break;default:self.fireEvent(BI.NumberInterval.EVENT_CHANGE),self.fireEvent(BI.NumberInterval.EVENT_CONFIRM),self.fireEvent(BI.NumberInterval.EVENT_VALID)}})},isStateValid:function(){return"valid"===this.options.validation},setMinEnable:function(b){this.smallEditor.setEnable(b)},setCloseMinEnable:function(b){this.smallCombo.setEnable(b)},setMaxEnable:function(b){this.bigEditor.setEnable(b)},setCloseMaxEnable:function(b){this.bigCombo.setEnable(b)},showNumTip:function(){this.smallTip.setVisible(!0),this.bigTip.setVisible(!0)},hideNumTip:function(){this.smallTip.setVisible(!1),this.bigTip.setVisible(!1)},setNumTip:function(numTip){this.smallTip.setText(numTip),this.bigTip.setText(numTip)},getNumTip:function(){return this.smallTip.getText()},setValue:function(data){data=data||{};var self=this,combo_value;(BI.isNumeric(data.min)||BI.isEmptyString(data.min))&&self.smallEditor.setValue(data.min),BI.isNotNull(data.min)||self.smallEditor.setValue(""),(BI.isNumeric(data.max)||BI.isEmptyString(data.max))&&self.bigEditor.setValue(data.max),BI.isNotNull(data.max)||self.bigEditor.setValue(""),BI.isNull(data.closeMin)||(combo_value=data.closeMin===!0?1:0,self.smallCombo.setValue(combo_value)),BI.isNull(data.closeMax)||(combo_value=data.closeMax===!0?1:0,self.bigCombo.setValue(combo_value)),this._checkValidation()},getValue:function(){var self=this,value={},minComboValue=self.smallCombo.getValue(),maxComboValue=self.bigCombo.getValue();return value.min=self.smallEditor.getValue(),value.max=self.bigEditor.getValue(),0===minComboValue[0]?value.closeMin=!1:value.closeMin=!0,0===maxComboValue[0]?value.closeMax=!1:value.closeMax=!0,value},destroyed:function(){var c=this.constants;BI.Bubbles.remove(c.typeError),BI.Bubbles.remove(c.numberError),BI.Bubbles.remove(c.signalError)}}),BI.NumberInterval.EVENT_CHANGE="EVENT_CHANGE",BI.NumberInterval.EVENT_CONFIRM="EVENT_CONFIRM",BI.NumberInterval.EVENT_VALID="EVENT_VALID",BI.NumberInterval.EVENT_ERROR="EVENT_ERROR",BI.shortcut("bi.number_interval",BI.NumberInterval),BI.NumberIntervalSingleEidtor=BI.inherit(BI.Single,{props:{baseCls:"bi-number-interval-single-editor",tipType:"success",title:""},render:function(){var self=this,o=this.options;return{type:"bi.vertical",items:[{type:"bi.editor",ref:function(_ref){self.editor=_ref},height:o.height-2,watermark:o.watermark,allowBlank:o.allowBlank,value:o.value,level:o.level,quitChecker:o.quitChecker,validationChecker:o.validationChecker,listeners:[{eventName:BI.Editor.EVENT_ERROR,action:function(){self.fireEvent(BI.NumberIntervalSingleEidtor.EVENT_ERROR,arguments)}},{eventName:BI.Editor.EVENT_FOCUS,action:function(){self.fireEvent(BI.NumberIntervalSingleEidtor.EVENT_FOCUS,arguments)}},{eventName:BI.Editor.EVENT_BLUR,action:function(){self.fireEvent(BI.NumberIntervalSingleEidtor.EVENT_BLUR,arguments)}},{eventName:BI.Editor.EVENT_VALID,action:function(){self.fireEvent(BI.NumberIntervalSingleEidtor.EVENT_VALID,arguments)}},{eventName:BI.Editor.EVENT_CHANGE,action:function(){self.fireEvent(BI.NumberIntervalSingleEidtor.EVENT_CHANGE,arguments)}},{eventName:BI.Editor.EVENT_CONFIRM,action:function(){self.fireEvent(BI.NumberIntervalSingleEidtor.EVENT_CONFIRM,arguments)}},{eventName:BI.Editor.EVENT_CHANGE_CONFIRM,action:function(){self.fireEvent(BI.NumberIntervalSingleEidtor.EVENT_CHANGE_CONFIRM,arguments)}}]}]}},isValid:function(){return this.editor.isValid()},getValue:function(){return this.editor.getValue()},setTitle:function(v){return this.editor.setTitle(v)},setValue:function(v){return this.editor.setValue(v)}}),BI.NumberIntervalSingleEidtor.EVENT_FOCUS="EVENT_FOCUS",BI.NumberIntervalSingleEidtor.EVENT_BLUR="EVENT_BLUR",BI.NumberIntervalSingleEidtor.EVENT_ERROR="EVENT_ERROR",BI.NumberIntervalSingleEidtor.EVENT_VALID="EVENT_VALID",BI.NumberIntervalSingleEidtor.EVENT_CHANGE="EVENT_CHANGE",BI.NumberIntervalSingleEidtor.EVENT_CHANGE_CONFIRM="EVENT_CHANGE_CONFIRM",BI.NumberIntervalSingleEidtor.EVENT_CONFIRM="EVENT_CONFIRM",BI.shortcut("bi.number_interval_single_editor",BI.NumberIntervalSingleEidtor),BI.SearchMultiTextValueCombo=BI.inherit(BI.Single,{_defaultConfig:function(){return BI.extend(BI.SearchMultiTextValueCombo.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-multi-select-combo bi-search-multi-text-value-combo",height:24,items:[]})},_init:function(){BI.SearchMultiTextValueCombo.superclass._init.apply(this,arguments);var self=this,o=this.options,assertShowValue=function(){BI.isKey(self._startValue)&&(self.storeValue.type===BI.Selection.All?BI.remove(self.storeValue.value,self._startValue):BI.pushDistinct(self.storeValue.value,self._startValue)),self._updateAllValue(),self._checkError(),self.trigger.getSearcher().setState(self.storeValue),self.trigger.getCounter().setButtonChecked(self.storeValue)};this.storeValue=BI.deepClone(o.value||{}),this._updateAllValue(),this._assertValue(this.storeValue),this._checkError(),this.requesting=!1,this.trigger=BI.createWidget({type:"bi.search_multi_select_trigger",text:o.text,height:o.height,masker:{offset:{left:0,top:0,right:0,bottom:25}},allValueGetter:function(){return self.allValue},valueFormatter:o.valueFormatter,itemsCreator:function(op,callback){self._itemsCreator(op,function(res){1===op.times&&BI.isNotNull(op.keywords)&&self.trigger.setValue(BI.deepClone(self.getValue())),callback.apply(self,arguments)})},value:this.storeValue,warningTitle:o.warningTitle}),this.trigger.on(BI.MultiSelectTrigger.EVENT_START,function(){ +self._setStartValue(""),this.getSearcher().setValue(self.storeValue)}),this.trigger.on(BI.MultiSelectTrigger.EVENT_STOP,function(){self._setStartValue("")}),this.trigger.on(BI.MultiSelectTrigger.EVENT_PAUSE,function(){if(this.getSearcher().hasMatched()){var keyword=this.getSearcher().getKeyword();self._join({type:BI.Selection.Multi,value:[keyword]},function(){self.combo.setValue(self.storeValue),self._setStartValue(keyword),assertShowValue(),self._populate(),self._setStartValue("")})}}),this.trigger.on(BI.MultiSelectTrigger.EVENT_SEARCHING,function(keywords){var last=BI.last(keywords);keywords=BI.initial(keywords||[]),keywords.length>0&&self._joinKeywords(keywords,function(){BI.isEndWithBlank(last)?(self.combo.setValue(self.storeValue),assertShowValue(),self.combo.populate(),self._setStartValue("")):(self.combo.setValue(self.storeValue),assertShowValue())})}),this.trigger.on(BI.MultiSelectTrigger.EVENT_CHANGE,function(value,obj){obj instanceof BI.MultiSelectBar?self._joinAll(this.getValue(),function(){assertShowValue()}):self._join(this.getValue(),function(){assertShowValue()})}),this.trigger.on(BI.MultiSelectTrigger.EVENT_BEFORE_COUNTER_POPUPVIEW,function(){this.getCounter().setValue(self.storeValue)}),this.trigger.on(BI.MultiSelectTrigger.EVENT_COUNTER_CLICK,function(){self.combo.isViewVisible()||self.combo.showView()}),this.combo=BI.createWidget({type:"bi.combo",toggle:!1,container:o.container,el:this.trigger,adjustLength:1,popup:{type:"bi.search_multi_select_popup_view",ref:function(){self.popup=this,self.trigger.setAdapter(this)},listeners:[{eventName:BI.MultiSelectPopupView.EVENT_CHANGE,action:function(){self.storeValue=this.getValue(),self._adjust(function(){assertShowValue()})}},{eventName:BI.MultiSelectPopupView.EVENT_CLICK_CONFIRM,action:function(){self._defaultState()}},{eventName:BI.MultiSelectPopupView.EVENT_CLICK_CLEAR,action:function(){self.setValue(),self._defaultState()}}],itemsCreator:BI.bind(self._itemsCreator,this),valueFormatter:o.valueFormatter,onLoaded:function(){BI.nextTick(function(){self.combo.adjustWidth(),self.combo.adjustHeight(),self.trigger.getCounter().adjustView(),self.trigger.getSearcher().adjustView()})}},value:o.value,hideChecker:function(e){return 0===triggerBtn.element.find(e.target).length}}),this.combo.on(BI.Combo.EVENT_BEFORE_POPUPVIEW,function(){this.setValue(self.storeValue),BI.nextTick(function(){self._populate()})}),this.wants2Quit=!1,this.combo.on(BI.Combo.EVENT_AFTER_HIDEVIEW,function(){self.trigger.stopEditing(),self.requesting===!0?self.wants2Quit=!0:(assertShowValue(),self.fireEvent(BI.SearchMultiTextValueCombo.EVENT_CONFIRM))});var triggerBtn=BI.createWidget({type:"bi.trigger_icon_button",width:o.height,height:o.height,cls:"multi-select-trigger-icon-button"});triggerBtn.on(BI.TriggerIconButton.EVENT_CHANGE,function(){self.trigger.getCounter().hideView(),self.combo.isViewVisible()?self.combo.hideView():self.combo.showView()}),BI.createWidget({type:"bi.absolute",element:this,items:[{el:this.combo,left:0,right:0,top:0,bottom:0},{el:triggerBtn,right:0,top:0,bottom:0}]}),this._checkError()},_defaultState:function(){this.trigger.stopEditing(),this.combo.hideView()},_assertValue:function(val){var o=this.options;val||(val={}),val.type||(val.type=BI.Selection.Multi),val.value||(val.value=[]),BI.remove(val.value,function(idx,value){return!BI.contains(BI.map(o.items,"value"),value)})},_makeMap:function(values){return BI.makeObject(values||[])},_joinKeywords:function(keywords,callback){function digest(items){var selectedMap=self._makeMap(items);BI.each(keywords,function(i,val){BI.isNotNull(selectedMap[val])&&(self.storeValue.type===BI.Selection.Multi?BI.pushDistinct(self.storeValue.value,val):BI.remove(self.storeValue.value,val))}),self._adjust(callback)}var self=this,o=this.options;this._assertValue(this.storeValue),this.requesting=!0,this._itemsCreator({type:BI.SearchMultiTextValueCombo.REQ_GET_ALL_DATA,keywords:keywords},function(ob){var values=BI.map(ob.items,"value");digest(values)})},_joinAll:function(res,callback){var self=this,o=this.options;this._assertValue(res),this.requesting=!0,this._itemsCreator({type:BI.SearchMultiTextValueCombo.REQ_GET_ALL_DATA,keywords:[this.trigger.getKey()]},function(ob){var items=BI.map(ob.items,"value");if(self.storeValue.type===res.type){var change=!1,map=self._makeMap(self.storeValue.value);return BI.each(items,function(i,v){BI.isNotNull(map[v])&&(change=!0,self.storeValue.assist&&self.storeValue.assist.push(map[v]),delete map[v])}),change&&(self.storeValue.value=BI.values(map)),void self._adjust(callback)}var selectedMap=self._makeMap(self.storeValue.value),notSelectedMap=self._makeMap(res.value),newItems=[];BI.each(items,function(i,item){BI.isNotNull(selectedMap[items[i]])&&(self.storeValue.assist&&self.storeValue.assist.push(selectedMap[items[i]]),delete selectedMap[items[i]]),BI.isNull(notSelectedMap[items[i]])&&(BI.remove(self.storeValue.assist,item),newItems.push(item))}),self.storeValue.value=newItems.concat(BI.values(selectedMap)),self._adjust(callback)})},_adjust:function(callback){function adjust(){self.storeValue.type===BI.Selection.All&&self.storeValue.value.length>=self._count?self.storeValue={type:BI.Selection.Multi,value:[]}:self.storeValue.type===BI.Selection.Multi&&self.storeValue.value.length>=self._count&&(self.storeValue={type:BI.Selection.All,value:[]}),self._updateAllValue(),self._checkError(),self.wants2Quit===!0&&(self.fireEvent(BI.SearchMultiTextValueCombo.EVENT_CONFIRM),self.wants2Quit=!1),self.requesting=!1}var self=this,o=this.options;this._count?(adjust(),callback()):this._itemsCreator({type:BI.SearchMultiTextValueCombo.REQ_GET_DATA_LENGTH},function(res){self._count=res.count,adjust(),callback()})},_join:function(res,callback){var self=this,o=this.options;if(this._assertValue(res),this._assertValue(this.storeValue),this.storeValue.type===res.type){var map=this._makeMap(this.storeValue.value);BI.each(res.value,function(i,v){map[v]||(self.storeValue.value.push(v),BI.remove(self.storeValue.assist,v),map[v]=v)});var change=!1;return BI.each(res.assist,function(i,v){BI.isNotNull(map[v])&&(change=!0,self.storeValue.assist&&self.storeValue.assist.push(map[v]),delete map[v])}),change&&(this.storeValue.value=BI.values(map)),void self._adjust(callback)}this._joinAll(res,callback)},_setStartValue:function(value){this._startValue=value,this.popup.setStartValue(value)},_getItemsByTimes:function(items,times){for(var res=[],i=100*(times-1);items[i]&&i<100*times;i++)res.push(items[i]);return res},_hasNextByTimes:function(items,times){return 100*times0&&self.numberCounter.hideView()})},getCounter:function(){return this.numberCounter},getSearcher:function(){return this.searcher},stopEditing:function(){this.searcher.stopSearch(),this.numberCounter.hideView()},setAdapter:function(adapter){this.searcher.setAdapter(adapter),this.numberCounter.setAdapter(adapter)},setValue:function(ob){this.searcher.setValue(ob),this.numberCounter.setValue(ob)},setTipType:function(v){this.searcher.setTipType(v)},getKey:function(){return this.searcher.getKey()},getValue:function(){return this.searcher.getValue()}}),BI.SearchMultiSelectTrigger.EVENT_TRIGGER_CLICK="EVENT_TRIGGER_CLICK",BI.SearchMultiSelectTrigger.EVENT_COUNTER_CLICK="EVENT_COUNTER_CLICK",BI.SearchMultiSelectTrigger.EVENT_CHANGE="EVENT_CHANGE",BI.SearchMultiSelectTrigger.EVENT_START="EVENT_START",BI.SearchMultiSelectTrigger.EVENT_STOP="EVENT_STOP",BI.SearchMultiSelectTrigger.EVENT_PAUSE="EVENT_PAUSE",BI.SearchMultiSelectTrigger.EVENT_SEARCHING="EVENT_SEARCHING",BI.SearchMultiSelectTrigger.EVENT_BEFORE_COUNTER_POPUPVIEW="EVENT_BEFORE_COUNTER_POPUPVIEW",BI.shortcut("bi.search_multi_select_trigger",BI.SearchMultiSelectTrigger),BI.SearchMultiSelectLoader=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.SearchMultiSelectLoader.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-multi-select-loader",logic:{dynamic:!0},el:{height:400},valueFormatter:BI.emptyFn,itemsCreator:BI.emptyFn,onLoaded:BI.emptyFn})},_init:function(){BI.SearchMultiSelectLoader.superclass._init.apply(this,arguments);var self=this,opts=this.options,hasNext=!1;this.storeValue=opts.value||{},this._assertValue(this.storeValue),this.button_group=BI.createWidget({type:"bi.select_list",element:this,logic:opts.logic,el:BI.extend({onLoaded:opts.onLoaded,el:{type:"bi.loader",isDefaultInit:!1,logic:{dynamic:!0,scrolly:!0},el:{chooseType:BI.ButtonGroup.CHOOSE_TYPE_MULTI,behaviors:{redmark:function(){return!0}},layouts:[{type:"bi.vertical"}]}}},opts.el),itemsCreator:function(op,callback){var startValue=self._startValue;self.storeValue&&(op=BI.extend(op||{},{selectedValues:BI.isKey(startValue)&&self.storeValue.type===BI.Selection.Multi?self.storeValue.value.concat(startValue):self.storeValue.value})),opts.itemsCreator(op,function(ob){hasNext=ob.hasNext;var firstItems=[];if(1===op.times&&self.storeValue){var json=BI.map(self.storeValue.value,function(i,v){var txt=opts.valueFormatter(v)||v;return{text:txt,value:v,title:txt,selected:self.storeValue.type===BI.Selection.Multi}});if(BI.isKey(self._startValue)&&!BI.contains(self.storeValue.value,self._startValue)){var txt=opts.valueFormatter(startValue)||startValue;json.unshift({text:txt,value:startValue,title:txt,selected:!0})}firstItems=self._createItems(json)}callback(firstItems.concat(self._createItems(ob.items)),ob.keyword||""),1===op.times&&self.storeValue&&(BI.isKey(startValue)&&(self.storeValue.type===BI.Selection.All?BI.remove(self.storeValue.value,startValue):BI.pushDistinct(self.storeValue.value,startValue)),self.setValue(self.storeValue)),1===op.times&&self._scrollToTop()})},hasNext:function(){return hasNext},value:this.storeValue}),this.button_group.on(BI.Controller.EVENT_CHANGE,function(){self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.button_group.on(BI.SelectList.EVENT_CHANGE,function(){self.fireEvent(BI.SearchMultiSelectLoader.EVENT_CHANGE,arguments)})},_createItems:function(items){return BI.createItems(items,{type:"bi.multi_select_item",logic:this.options.logic,cls:"bi-list-item-active",height:24,selected:this.isAllSelected(),iconWrapperWidth:36})},_scrollToTop:function(){var self=this;BI.delay(function(){self.button_group.element.scrollTop(0)},30)},isAllSelected:function(){return this.button_group.isAllSelected()},_assertValue:function(val){val||(val={}),val.type||(val.type=BI.Selection.Multi),val.value||(val.value=[])},setStartValue:function(v){this._startValue=v},setValue:function(v){this.storeValue=v||{},this._assertValue(this.storeValue),this.button_group.setValue(this.storeValue)},getValue:function(){return this.button_group.getValue()},getAllButtons:function(){return this.button_group.getAllButtons()},empty:function(){this.button_group.empty()},populate:function(items){arguments[0]=this._createItems(items),this.button_group.populate.apply(this.button_group,arguments)},resetHeight:function(h){this.button_group.resetHeight(h)},resetWidth:function(w){this.button_group.resetWidth(w)}}),BI.SearchMultiSelectLoader.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.search_multi_select_loader",BI.SearchMultiSelectLoader),BI.SearchMultiSelectPopupView=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.SearchMultiSelectPopupView.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-multi-select-popup-view",maxWidth:"auto",minWidth:135,maxHeight:400,valueFormatter:BI.emptyFn,itemsCreator:BI.emptyFn,onLoaded:BI.emptyFn})},_init:function(){BI.SearchMultiSelectPopupView.superclass._init.apply(this,arguments);var self=this,opts=this.options;this.loader=BI.createWidget({type:"bi.search_multi_select_loader",itemsCreator:opts.itemsCreator,valueFormatter:opts.valueFormatter,onLoaded:opts.onLoaded,value:opts.value}),this.popupView=BI.createWidget({type:"bi.multi_popup_view",stopPropagation:!1,maxWidth:opts.maxWidth,minWidth:opts.minWidth,maxHeight:opts.maxHeight,element:this,buttons:[BI.i18nText("BI-Basic_Clears"),BI.i18nText("BI-Basic_Sure")],el:this.loader,value:opts.value}),this.popupView.on(BI.MultiPopupView.EVENT_CHANGE,function(){self.fireEvent(BI.SearchMultiSelectPopupView.EVENT_CHANGE)}),this.popupView.on(BI.MultiPopupView.EVENT_CLICK_TOOLBAR_BUTTON,function(index){switch(index){case 0:self.fireEvent(BI.SearchMultiSelectPopupView.EVENT_CLICK_CLEAR);break;case 1:self.fireEvent(BI.SearchMultiSelectPopupView.EVENT_CLICK_CONFIRM)}})},isAllSelected:function(){return this.loader.isAllSelected()},setStartValue:function(v){this.loader.setStartValue(v)},setValue:function(v){this.popupView.setValue(v)},getValue:function(){return this.popupView.getValue()},populate:function(items){this.popupView.populate.apply(this.popupView,arguments)},resetHeight:function(h){this.popupView.resetHeight(h)},resetWidth:function(w){this.popupView.resetWidth(w)}}),BI.SearchMultiSelectPopupView.EVENT_CHANGE="EVENT_CHANGE",BI.SearchMultiSelectPopupView.EVENT_CLICK_CONFIRM="EVENT_CLICK_CONFIRM",BI.SearchMultiSelectPopupView.EVENT_CLICK_CLEAR="EVENT_CLICK_CLEAR",BI.shortcut("bi.search_multi_select_popup_view",BI.SearchMultiSelectPopupView),BI.SearchMultiSelectSearcher=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.SearchMultiSelectSearcher.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-multi-select-searcher",itemsCreator:BI.emptyFn,el:{},popup:{},valueFormatter:BI.emptyFn,adapter:null,masker:{}})},_init:function(){BI.SearchMultiSelectSearcher.superclass._init.apply(this,arguments);var self=this,o=this.options;this.editor=BI.createWidget(o.el,{type:"bi.multi_select_editor",height:o.height,text:o.text,tipType:o.tipType,warningTitle:o.warningTitle}),this.searcher=BI.createWidget({type:"bi.searcher",element:this,height:o.height,isAutoSearch:!1,isAutoSync:!1,onSearch:function(op,callback){callback()},el:this.editor,popup:BI.extend({type:"bi.multi_select_search_pane",valueFormatter:o.valueFormatter,keywordGetter:function(){return self.editor.getValue()},itemsCreator:function(op,callback){var keyword=self.editor.getValue();op.keywords=[keyword],this.setKeyword(keyword),o.itemsCreator(op,callback)},value:o.value},o.popup),adapter:o.adapter,masker:o.masker}),this.searcher.on(BI.Searcher.EVENT_START,function(){self.fireEvent(BI.SearchMultiSelectSearcher.EVENT_START)}),this.searcher.on(BI.Searcher.EVENT_PAUSE,function(){this.hasMatched(),self.fireEvent(BI.SearchMultiSelectSearcher.EVENT_PAUSE)}),this.searcher.on(BI.Searcher.EVENT_STOP,function(){self.fireEvent(BI.SearchMultiSelectSearcher.EVENT_STOP)}),this.searcher.on(BI.Searcher.EVENT_CHANGE,function(){self.fireEvent(BI.SearchMultiSelectSearcher.EVENT_CHANGE,arguments)}),this.searcher.on(BI.Searcher.EVENT_SEARCHING,function(){var keywords=this.getKeywords();self.fireEvent(BI.SearchMultiSelectSearcher.EVENT_SEARCHING,keywords)}),BI.isNotNull(o.value)&&this.setState(o.value)},adjustView:function(){this.searcher.adjustView()},isSearching:function(){return this.searcher.isSearching()},stopSearch:function(){this.searcher.stopSearch()},getKeyword:function(){return this.editor.getValue()},hasMatched:function(){return this.searcher.hasMatched()},hasChecked:function(){return this.searcher.getView()&&this.searcher.getView().hasChecked()},setAdapter:function(adapter){this.searcher.setAdapter(adapter)},setState:function(obj){var o=this.options,ob={};if(ob.type=obj.type,ob.value=o.allValueGetter()||[],ob.assist=obj.assist,ob.type===BI.Selection.All)if(0===ob.value.length)this.editor.setState(BI.Selection.All);else if(BI.size(ob.assist)<=20){var state="";BI.each(ob.assist,function(i,v){state+=0===i?""+(o.valueFormatter(v+"")||v):","+(o.valueFormatter(v+"")||v)}),this.editor.setState(state)}else this.editor.setState(BI.Selection.Multi);else if(0===ob.value.length)this.editor.setState(BI.Selection.None);else if(BI.size(ob.value)<=20){var state="";BI.each(ob.value,function(i,v){state+=0===i?""+(o.valueFormatter(v+"")||v):","+(o.valueFormatter(v+"")||v)}),this.editor.setState(state)}else this.editor.setState(BI.Selection.Multi)},setTipType:function(v){this.editor.setTipType(v)},setValue:function(ob){this.setState(ob),this.searcher.setValue(ob)},getKey:function(){return this.editor.getValue()},getValue:function(){return this.searcher.getValue()},populate:function(items){this.searcher.populate.apply(this.searcher,arguments)}}),BI.SearchMultiSelectSearcher.EVENT_BEFORE_POPUPVIEW="EVENT_BEFORE_POPUPVIEW",BI.SearchMultiSelectSearcher.EVENT_CHANGE="EVENT_CHANGE",BI.SearchMultiSelectSearcher.EVENT_START="EVENT_START",BI.SearchMultiSelectSearcher.EVENT_STOP="EVENT_STOP",BI.SearchMultiSelectSearcher.EVENT_PAUSE="EVENT_PAUSE",BI.SearchMultiSelectSearcher.EVENT_SEARCHING="EVENT_SEARCHING",BI.shortcut("bi.search_multi_select_searcher",BI.SearchMultiSelectSearcher),BI.SelectTreeFirstPlusGroupNode=BI.inherit(BI.NodeButton,{_defaultConfig:function(){var conf=BI.SelectTreeFirstPlusGroupNode.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{baseCls:(conf.baseCls||"")+" bi-select-tree-first-plus-group-node bi-list-item-active",logic:{dynamic:!1},id:"",pId:"",readonly:!0,open:!1,height:24})},_init:function(){BI.SelectTreeFirstPlusGroupNode.superclass._init.apply(this,arguments);var self=this,o=this.options;this.checkbox=BI.createWidget({type:"bi.first_tree_node_checkbox",stopPropagation:!0}),this.text=BI.createWidget({type:"bi.label",textAlign:"left",whiteSpace:"nowrap",textHeight:o.height,height:o.height,hgap:o.hgap,text:o.text,value:o.value,keyword:o.keyword,py:o.py}),this.checkbox.on(BI.Controller.EVENT_CHANGE,function(type){type===BI.Events.CLICK&&(this.isSelected()?self.triggerExpand():self.triggerCollapse())});var type=BI.LogicFactory.createLogicTypeByDirection(BI.Direction.Left),items=BI.LogicFactory.createLogicItemsByDirection(BI.Direction.Left,{width:24,el:this.checkbox},this.text);BI.createWidget(BI.extend({element:this},BI.LogicFactory.createLogic(type,BI.extend(o.logic,{items:items}))))},isOnce:function(){return!0},doRedMark:function(){this.text.doRedMark.apply(this.text,arguments)},unRedMark:function(){this.text.unRedMark.apply(this.text,arguments)},doClick:function(){BI.NodeButton.superclass.doClick.apply(this,arguments)},setOpened:function(v){BI.SelectTreeFirstPlusGroupNode.superclass.setOpened.apply(this,arguments),BI.isNotNull(this.checkbox)&&this.checkbox.setSelected(v)}}),BI.shortcut("bi.select_tree_first_plus_group_node",BI.SelectTreeFirstPlusGroupNode),BI.SelectTreeLastPlusGroupNode=BI.inherit(BI.NodeButton,{_defaultConfig:function(){var conf=BI.SelectTreeLastPlusGroupNode.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{baseCls:(conf.baseCls||"")+" bi-select-tree-last-plus-group-node bi-list-item-active",logic:{dynamic:!1},id:"",pId:"",readonly:!0,open:!1,height:24})},_init:function(){BI.SelectTreeLastPlusGroupNode.superclass._init.apply(this,arguments);var self=this,o=this.options;this.checkbox=BI.createWidget({type:"bi.last_tree_node_checkbox",stopPropagation:!0}),this.text=BI.createWidget({type:"bi.label",textAlign:"left",whiteSpace:"nowrap",textHeight:o.height,height:o.height,hgap:o.hgap,text:o.text,value:o.value,keyword:o.keyword,py:o.py}),this.checkbox.on(BI.Controller.EVENT_CHANGE,function(type){type===BI.Events.CLICK&&(this.isSelected()?self.triggerExpand():self.triggerCollapse())});var type=BI.LogicFactory.createLogicTypeByDirection(BI.Direction.Left),items=BI.LogicFactory.createLogicItemsByDirection(BI.Direction.Left,{width:24,el:this.checkbox},this.text);BI.createWidget(BI.extend({element:this},BI.LogicFactory.createLogic(type,BI.extend(o.logic,{items:items}))))},isOnce:function(){return!0},doRedMark:function(){this.text.doRedMark.apply(this.text,arguments)},unRedMark:function(){this.text.unRedMark.apply(this.text,arguments)},doClick:function(){BI.NodeButton.superclass.doClick.apply(this,arguments)},setOpened:function(v){BI.SelectTreeLastPlusGroupNode.superclass.setOpened.apply(this,arguments),BI.isNotNull(this.checkbox)&&this.checkbox.setSelected(v)}}),BI.shortcut("bi.select_tree_last_plus_group_node",BI.SelectTreeLastPlusGroupNode),BI.SelectTreeMidPlusGroupNode=BI.inherit(BI.NodeButton,{_defaultConfig:function(){var conf=BI.SelectTreeMidPlusGroupNode.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{baseCls:(conf.baseCls||"")+" bi-select-tree-mid-plus-group-node bi-list-item-active",logic:{dynamic:!1},id:"",pId:"",readonly:!0,open:!1,height:24})},_init:function(){BI.SelectTreeMidPlusGroupNode.superclass._init.apply(this,arguments);var self=this,o=this.options;this.checkbox=BI.createWidget({type:"bi.mid_tree_node_checkbox",stopPropagation:!0}),this.text=BI.createWidget({type:"bi.label",textAlign:"left",whiteSpace:"nowrap",textHeight:o.height,height:o.height,hgap:o.hgap,text:o.text,value:o.value,keyword:o.keyword,py:o.py}),this.checkbox.on(BI.Controller.EVENT_CHANGE,function(type){type===BI.Events.CLICK&&(this.isSelected()?self.triggerExpand():self.triggerCollapse())});var type=BI.LogicFactory.createLogicTypeByDirection(BI.Direction.Left),items=BI.LogicFactory.createLogicItemsByDirection(BI.Direction.Left,{width:24,el:this.checkbox},this.text);BI.createWidget(BI.extend({element:this},BI.LogicFactory.createLogic(type,BI.extend(o.logic,{items:items}))))},isOnce:function(){return!0},doRedMark:function(){this.text.doRedMark.apply(this.text,arguments)},unRedMark:function(){this.text.unRedMark.apply(this.text,arguments)},doClick:function(){BI.NodeButton.superclass.doClick.apply(this,arguments)},setOpened:function(v){BI.SelectTreeMidPlusGroupNode.superclass.setOpened.apply(this,arguments),BI.isNotNull(this.checkbox)&&this.checkbox.setSelected(v)}}),BI.shortcut("bi.select_tree_mid_plus_group_node",BI.SelectTreeMidPlusGroupNode),BI.SelectTreePlusGroupNode=BI.inherit(BI.NodeButton,{_defaultConfig:function(){var conf=BI.SelectTreePlusGroupNode.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{baseCls:(conf.baseCls||"")+" bi-select-tree-plus-group-node bi-list-item-active",logic:{dynamic:!1},id:"",pId:"",readonly:!0,open:!1,height:24})},_init:function(){BI.SelectTreePlusGroupNode.superclass._init.apply(this,arguments);var self=this,o=this.options;this.checkbox=BI.createWidget({type:"bi.tree_node_checkbox",stopPropagation:!0}),this.text=BI.createWidget({type:"bi.label",textAlign:"left",whiteSpace:"nowrap",textHeight:o.height,height:o.height,hgap:o.hgap,text:o.text,value:o.value,keyword:o.keyword,py:o.py}),this.checkbox.on(BI.Controller.EVENT_CHANGE,function(type){type===BI.Events.CLICK&&(this.isSelected()?self.triggerExpand():self.triggerCollapse())});var type=BI.LogicFactory.createLogicTypeByDirection(BI.Direction.Left),items=BI.LogicFactory.createLogicItemsByDirection(BI.Direction.Left,{width:24,el:this.checkbox},this.text);BI.createWidget(BI.extend({element:this},BI.LogicFactory.createLogic(type,BI.extend(o.logic,{items:items}))))},isOnce:function(){return!0},doRedMark:function(){this.text.doRedMark.apply(this.text,arguments)},unRedMark:function(){this.text.unRedMark.apply(this.text,arguments)},doClick:function(){BI.NodeButton.superclass.doClick.apply(this,arguments)},setOpened:function(v){BI.SelectTreePlusGroupNode.superclass.setOpened.apply(this,arguments),BI.isNotNull(this.checkbox)&&this.checkbox.setSelected(v)}}),BI.shortcut("bi.select_tree_plus_group_node",BI.SelectTreePlusGroupNode),BI.SelectTreeCombo=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.SelectTreeCombo.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-select-tree-combo",height:24,text:"",items:[],value:"",attributes:{tabIndex:0}})},_init:function(){BI.SelectTreeCombo.superclass._init.apply(this,arguments);var self=this,o=this.options;this.trigger=BI.createWidget({type:"bi.single_tree_trigger",text:o.text,height:o.height,items:o.items,value:o.value}),this.popup=BI.createWidget({type:"bi.select_level_tree",items:o.items,value:o.value}),this.combo=BI.createWidget({type:"bi.combo",container:o.container,element:this,adjustLength:2,el:this.trigger,popup:{el:this.popup}}),this.combo.on(BI.Controller.EVENT_CHANGE,function(){self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.popup.on(BI.SingleTreePopup.EVENT_CHANGE,function(){self.setValue(self.popup.getValue()),self.combo.hideView()})},setValue:function(v){v=BI.isArray(v)?v:[v],this.trigger.setValue(v),this.popup.setValue(v)},getValue:function(){return this.popup.getValue()},populate:function(items){this.combo.populate(items)}}),BI.shortcut("bi.select_tree_combo",BI.SelectTreeCombo),BI.SelectTreeExpander=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.SelectTreeExpander.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-select-tree-expander",trigger:"",toggle:!0,direction:"bottom",isDefaultInit:!0,el:{},popup:{}})},_init:function(){BI.SelectTreeExpander.superclass._init.apply(this,arguments);var self=this,o=this.options;this.trigger=BI.createWidget(o.el),this.trigger.on(BI.Controller.EVENT_CHANGE,function(type){type===BI.Events.CLICK&&this.isSelected()&&self.expander.setValue([]),self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.expander=BI.createWidget({type:"bi.expander",element:this,trigger:o.trigger,toggle:o.toggle,direction:o.direction,isDefaultInit:o.isDefaultInit,el:this.trigger,popup:o.popup}),this.expander.on(BI.Controller.EVENT_CHANGE,function(type){type===BI.Events.CLICK&&self.trigger.setSelected(!1),self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)})},getAllLeaves:function(){return this.expander.getAllLeaves()},setValue:function(v){BI.contains(v,this.trigger.getValue())?(this.trigger.setSelected(!0),this.expander.setValue([])):(this.trigger.setSelected(!1),this.expander.setValue(v))},getValue:function(){return this.trigger.isSelected()?[this.trigger.getValue()]:this.expander.getValue()},populate:function(items){this.expander.populate(items)}}),BI.shortcut("bi.select_tree_expander",BI.SelectTreeExpander),BI.SelectTreePopup=BI.inherit(BI.Pane,{_defaultConfig:function(){return BI.extend(BI.SelectTreePopup.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-select-level-tree",tipText:BI.i18nText("BI-No_Selected_Item"),items:[],value:""})},_formatItems:function(nodes,layer,pNode){var self=this;return BI.each(nodes,function(i,node){var extend={layer:layer};node.id=node.id||BI.UUID(),extend.pNode=pNode,node.isParent===!0||node.parent===!0||BI.isNotEmptyArray(node.children)?(extend.type="bi.select_tree_mid_plus_group_node",i===nodes.length-1&&(extend.type="bi.select_tree_last_plus_group_node",extend.isLastNode=!0),0!==i||pNode||(extend.type="bi.select_tree_first_plus_group_node"),0===i&&i===nodes.length-1&&(extend.type="bi.select_tree_plus_group_node"),BI.defaults(node,extend),self._formatItems(node.children,layer+1,node)):(extend.type="bi.mid_tree_leaf_item",0!==i||pNode||(extend.type="bi.first_tree_leaf_item"),i===nodes.length-1&&(extend.type="bi.last_tree_leaf_item"),BI.defaults(node,extend))}),nodes},_init:function(){BI.SelectTreePopup.superclass._init.apply(this,arguments);var self=this,o=this.options;this.tree=BI.createWidget({type:"bi.level_tree",expander:{type:"bi.select_tree_expander",isDefaultInit:!0},items:this._formatItems(BI.Tree.transformToTreeFormat(o.items),0),value:o.value,chooseType:BI.Selection.Single}),BI.createWidget({type:"bi.vertical",element:this,vgap:5,items:[this.tree]}),this.tree.on(BI.Controller.EVENT_CHANGE,function(){self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.tree.on(BI.LevelTree.EVENT_CHANGE,function(){self.fireEvent(BI.SelectTreePopup.EVENT_CHANGE); +}),this.check()},getValue:function(){return this.tree.getValue()},setValue:function(v){v=BI.isArray(v)?v:[v],this.tree.setValue(v)},populate:function(items){BI.SelectTreePopup.superclass.populate.apply(this,arguments),this.tree.populate(this._formatItems(BI.Tree.transformToTreeFormat(items)))}}),BI.SelectTreePopup.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.select_level_tree",BI.SelectTreePopup),BI.SingleSelectSearchLoader=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.SingleSelectSearchLoader.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-single-select-search-loader",allowNoSelect:!1,itemsCreator:BI.emptyFn,keywordGetter:BI.emptyFn,valueFormatter:BI.emptyFn})},_init:function(){BI.SingleSelectSearchLoader.superclass._init.apply(this,arguments);var self=this,opts=this.options,hasNext=!1;this.button_group=BI.createWidget({type:"bi.single_select_list",allowNoSelect:opts.allowNoSelect,element:this,logic:{dynamic:!1},value:opts.value,el:{tipText:BI.i18nText("BI-No_Select"),el:{type:"bi.loader",isDefaultInit:!1,logic:{dynamic:!0,scrolly:!0},el:{chooseType:BI.ButtonGroup.CHOOSE_TYPE_SINGLE,behaviors:{redmark:function(){return!0}},layouts:[{type:"bi.vertical"}]}}},itemsCreator:function(op,callback){self.storeValue&&(op=BI.extend(op||{},{selectedValues:[self.storeValue]})),opts.itemsCreator(op,function(ob){var keyword=ob.keyword=opts.keywordGetter();hasNext=ob.hasNext;var firstItems=[];if(1===op.times&&BI.isNotNull(self.storeValue)){var json=self._filterValues(self.storeValue);firstItems=self._createItems(json)}callback(firstItems.concat(self._createItems(ob.items)),keyword||""),1===op.times&&self.storeValue&&self.setValue(self.storeValue)})},hasNext:function(){return hasNext}}),this.button_group.on(BI.Controller.EVENT_CHANGE,function(){self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.button_group.on(BI.SingleSelectList.EVENT_CHANGE,function(){self.fireEvent(BI.SingleSelectSearchLoader.EVENT_CHANGE,arguments)})},_createItems:function(items){return BI.createItems(items,{type:this.options.allowNoSelect?"bi.single_select_item":"bi.single_select_combo_item",cls:"bi-list-item-active",logic:{dynamic:!1},height:25,selected:!1})},_filterValues:function(src){var o=this.options,keyword=o.keywordGetter(),values=src||[],newValues=BI.map(BI.isArray(values)?values:[values],function(i,v){return{text:o.valueFormatter(v)||v,value:v}});if(BI.isKey(keyword)){var search=BI.Func.getSearchResult(newValues,keyword);values=search.match.concat(search.find)}return BI.map(values,function(i,v){return{text:v.text,title:v.text,value:v.value,selected:!1}})},setValue:function(v){this.storeValue=v,this.button_group.setValue(v)},getValue:function(){return this.button_group.getValue()},getAllButtons:function(){return this.button_group.getAllButtons()},empty:function(){this.button_group.empty()},populate:function(items){this.button_group.populate.apply(this.button_group,arguments)},resetHeight:function(h){this.button_group.resetHeight(h)},resetWidth:function(w){this.button_group.resetWidth(w)}}),BI.SingleSelectSearchLoader.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.single_select_search_loader",BI.SingleSelectSearchLoader),BI.SingleSelectSearchInsertPane=BI.inherit(BI.Widget,{constants:{height:25,lgap:10,tgap:5},_defaultConfig:function(){return BI.extend(BI.SingleSelectSearchInsertPane.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-single-select-search-pane bi-card",allowNoSelect:!1,itemsCreator:BI.emptyFn,valueFormatter:BI.emptyFn,keywordGetter:BI.emptyFn})},_init:function(){BI.SingleSelectSearchInsertPane.superclass._init.apply(this,arguments);var self=this,o=this.options;this.tooltipClick=BI.createWidget({type:"bi.label",invisible:!0,text:BI.i18nText("BI-Click_Blank_To_Select"),cls:"multi-select-toolbar",height:this.constants.height}),this.addNotMatchTip=BI.createWidget({type:"bi.text_button",invisible:!0,text:BI.i18nText("BI-Basic_Click_To_Add_Text",""),height:this.constants.height,cls:"bi-high-light",hgap:5,handler:function(){self.fireEvent(BI.SingleSelectSearchInsertPane.EVENT_ADD_ITEM,o.keywordGetter())}}),this.loader=BI.createWidget({type:"bi.single_select_search_loader",allowNoSelect:o.allowNoSelect,keywordGetter:o.keywordGetter,valueFormatter:o.valueFormatter,itemsCreator:function(op,callback){o.itemsCreator.apply(self,[op,function(res){callback(res),self.setKeyword(o.keywordGetter())}])},value:o.value}),this.loader.on(BI.Controller.EVENT_CHANGE,function(){self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.resizer=BI.createWidget({type:"bi.vtape",element:this,items:[{type:"bi.vertical",items:[this.tooltipClick,this.addNotMatchTip],height:this.constants.height},{el:this.loader}]})},setKeyword:function(keyword){var btn,isMatchTipVisible=this.loader.getAllButtons().length>0&&(btn=this.loader.getAllButtons()[0])&&keyword===btn.getValue();this.tooltipClick.setVisible(isMatchTipVisible),this.addNotMatchTip.setVisible(!isMatchTipVisible),!isMatchTipVisible&&this.addNotMatchTip.setText(BI.i18nText("BI-Basic_Click_To_Add_Text",keyword))},hasMatched:function(){return this.tooltipClick.isVisible()},setValue:function(v){this.loader.setValue(v)},getValue:function(){return this.loader.getValue()},empty:function(){this.loader.empty()},populate:function(items){this.loader.populate.apply(this.loader,arguments)}}),BI.SingleSelectSearchInsertPane.EVENT_CHANGE="EVENT_CHANGE",BI.SingleSelectSearchInsertPane.EVENT_ADD_ITEM="EVENT_ADD_ITEM",BI.shortcut("bi.single_select_search_insert_pane",BI.SingleSelectSearchInsertPane),BI.SingleSelectSearchPane=BI.inherit(BI.Widget,{constants:{height:25,lgap:10,tgap:5},_defaultConfig:function(){return BI.extend(BI.SingleSelectSearchPane.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-single-select-search-pane bi-card",allowNoSelect:!1,itemsCreator:BI.emptyFn,valueFormatter:BI.emptyFn,keywordGetter:BI.emptyFn})},_init:function(){BI.SingleSelectSearchPane.superclass._init.apply(this,arguments);var self=this,o=this.options;this.tooltipClick=BI.createWidget({type:"bi.label",invisible:!0,text:BI.i18nText("BI-Click_Blank_To_Select"),cls:"multi-select-toolbar",height:this.constants.height}),this.loader=BI.createWidget({type:"bi.single_select_search_loader",allowNoSelect:o.allowNoSelect,keywordGetter:o.keywordGetter,valueFormatter:o.valueFormatter,itemsCreator:function(op,callback){o.itemsCreator.apply(self,[op,function(res){callback(res),self.setKeyword(o.keywordGetter())}])},value:o.value}),this.loader.on(BI.Controller.EVENT_CHANGE,function(){self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.resizer=BI.createWidget({type:"bi.vtape",element:this,items:[{el:this.tooltipClick,height:0},{el:this.loader}]}),this.tooltipClick.setVisible(!1)},setKeyword:function(keyword){var btn,isVisible=this.loader.getAllButtons().length>0&&(btn=this.loader.getAllButtons()[0])&&keyword===btn.getValue();isVisible!==this.tooltipClick.isVisible()&&(this.tooltipClick.setVisible(isVisible),this.resizer.attr("items")[0].height=isVisible?this.constants.height:0,this.resizer.resize())},hasMatched:function(){return this.tooltipClick.isVisible()},setValue:function(v){this.loader.setValue(v)},getValue:function(){return this.loader.getValue()},empty:function(){this.loader.empty()},populate:function(items){this.loader.populate.apply(this.loader,arguments)}}),BI.SingleSelectSearchPane.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.single_select_search_pane",BI.SingleSelectSearchPane),BI.SingleSelectCombo=BI.inherit(BI.Single,{_defaultConfig:function(){return BI.extend(BI.SingleSelectCombo.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-single-select-combo",allowNoSelect:!1,itemsCreator:BI.emptyFn,valueFormatter:BI.emptyFn,height:24,attributes:{tabIndex:0},allowEdit:!0})},_init:function(){BI.SingleSelectCombo.superclass._init.apply(this,arguments);var self=this,o=this.options,assertShowValue=function(){BI.isKey(self._startValue)&&(self.storeValue=self._startValue),self.trigger.getSearcher().setState(self.storeValue)};this.storeValue=o.value,this.requesting=!1,this.trigger=BI.createWidget({type:"bi.single_select_trigger",height:o.height,allowNoSelect:o.allowNoSelect,allowEdit:o.allowEdit,valueFormatter:o.valueFormatter,itemsCreator:function(op,callback){o.itemsCreator(op,function(res){1===op.times&&BI.isNotNull(op.keywords)&&self.trigger.setValue(self.getValue()),callback.apply(self,arguments)})},text:o.text,value:this.storeValue}),this.trigger.on(BI.SingleSelectTrigger.EVENT_FOCUS,function(){self.fireEvent(BI.SingleSelectCombo.EVENT_FOCUS)}),this.trigger.on(BI.SingleSelectTrigger.EVENT_BLUR,function(){self.fireEvent(BI.SingleSelectCombo.EVENT_BLUR)}),this.trigger.on(BI.SingleSelectTrigger.EVENT_START,function(){self._setStartValue(),this.getSearcher().setValue(self.storeValue)}),this.trigger.on(BI.SingleSelectTrigger.EVENT_STOP,function(){self._setStartValue(),self.fireEvent(BI.SingleSelectCombo.EVENT_STOP)}),this.trigger.on(BI.SingleSelectTrigger.EVENT_PAUSE,function(){if(this.getSearcher().hasMatched()){var keyword=this.getSearcher().getKeyword();self.combo.setValue(self.storeValue),self._setStartValue(keyword),assertShowValue(),self.populate(),self._setStartValue()}}),this.trigger.on(BI.SingleSelectTrigger.EVENT_SEARCHING,function(keywords){var last=BI.last(keywords);keywords=BI.initial(keywords||[]),keywords.length>0&&self._joinKeywords(keywords,function(){BI.isEndWithBlank(last)?(self.combo.setValue(self.storeValue),assertShowValue(),self.combo.populate(),self._setStartValue()):(self.combo.setValue(self.storeValue),assertShowValue())}),self.fireEvent(BI.SingleSelectCombo.EVENT_SEARCHING)}),this.trigger.on(BI.SingleSelectTrigger.EVENT_CHANGE,function(value,obj){self.storeValue=this.getValue(),assertShowValue(),self._defaultState()}),this.trigger.on(BI.SingleSelectTrigger.EVENT_COUNTER_CLICK,function(){self.combo.isViewVisible()||self.combo.showView()}),this.combo=BI.createWidget({type:"bi.combo",container:o.container,toggle:!1,el:this.trigger,adjustLength:1,popup:{type:"bi.single_select_popup_view",allowNoSelect:o.allowNoSelect,ref:function(){self.popup=this,self.trigger.setAdapter(this)},listeners:[{eventName:BI.SingleSelectPopupView.EVENT_CHANGE,action:function(){self.storeValue=this.getValue(),self._adjust(function(){assertShowValue(),self._defaultState()}),self.fireEvent(BI.SingleSelectCombo.EVENT_CLICK_ITEM)}}],itemsCreator:o.itemsCreator,valueFormatter:o.valueFormatter,onLoaded:function(){BI.nextTick(function(){self.combo.adjustWidth(),self.combo.adjustHeight(),self.trigger.getSearcher().adjustView()})}},hideChecker:function(e){return 0===triggerBtn.element.find(e.target).length},value:o.value}),this.combo.on(BI.Combo.EVENT_BEFORE_POPUPVIEW,function(){this.setValue(self.storeValue),BI.nextTick(function(){self.populate()})}),this.wants2Quit=!1,this.combo.on(BI.Combo.EVENT_AFTER_HIDEVIEW,function(){self.trigger.stopEditing(),self.requesting===!0?self.wants2Quit=!0:self.fireEvent(BI.SingleSelectCombo.EVENT_CONFIRM)});var triggerBtn=BI.createWidget({type:"bi.trigger_icon_button",width:o.height,height:o.height,cls:"single-select-trigger-icon-button"});triggerBtn.on(BI.TriggerIconButton.EVENT_CHANGE,function(){self.combo.isViewVisible()?self.combo.hideView():self.combo.showView()}),BI.createWidget({type:"bi.absolute",element:this,items:[{el:this.combo,left:0,right:0,top:0,bottom:0},{el:triggerBtn,right:0,top:0,bottom:0}]})},_defaultState:function(){this.trigger.stopEditing(),this.combo.hideView()},_assertValue:function(val){},_makeMap:function(values){return BI.makeObject(values||[])},_joinKeywords:function(keywords,callback){function digest(items){var selectedMap=self._makeMap(items);BI.each(keywords,function(i,val){BI.isNotNull(selectedMap[val])&&BI.remove(self.storeValue.value,val)}),self._adjust(callback)}var self=this,o=this.options;this._assertValue(this.storeValue),this.requesting=!0,o.itemsCreator({type:BI.SingleSelectCombo.REQ_GET_ALL_DATA,keywords:keywords},function(ob){var values=BI.map(ob.items,"value");digest(values)})},_adjust:function(callback){function adjust(){self.wants2Quit===!0&&(self.fireEvent(BI.SingleSelectCombo.EVENT_CONFIRM),self.wants2Quit=!1),self.requesting=!1}var self=this,o=this.options;this._count?(adjust(),callback()):o.itemsCreator({type:BI.SingleSelectCombo.REQ_GET_DATA_LENGTH},function(res){self._count=res.count,adjust(),callback()})},_setStartValue:function(value){this._startValue=value,this.popup.setStartValue(value)},setValue:function(v){this.storeValue=v,this._assertValue(this.storeValue),this.combo.setValue(this.storeValue)},getValue:function(){return this.storeValue},populate:function(){this._count=null,this.combo.populate.apply(this.combo,arguments)}}),BI.extend(BI.SingleSelectCombo,{REQ_GET_DATA_LENGTH:0,REQ_GET_ALL_DATA:-1}),BI.SingleSelectCombo.EVENT_BLUR="EVENT_BLUR",BI.SingleSelectCombo.EVENT_FOCUS="EVENT_FOCUS",BI.SingleSelectCombo.EVENT_STOP="EVENT_STOP",BI.SingleSelectCombo.EVENT_SEARCHING="EVENT_SEARCHING",BI.SingleSelectCombo.EVENT_CLICK_ITEM="EVENT_CLICK_ITEM",BI.SingleSelectCombo.EVENT_CONFIRM="EVENT_CONFIRM",BI.shortcut("bi.single_select_combo",BI.SingleSelectCombo),BI.SingleSelectInsertCombo=BI.inherit(BI.Single,{_defaultConfig:function(){return BI.extend(BI.SingleSelectInsertCombo.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-single-select-combo",allowNoSelect:!1,itemsCreator:BI.emptyFn,valueFormatter:BI.emptyFn,height:24,attributes:{tabIndex:0},allowEdit:!0})},_init:function(){BI.SingleSelectInsertCombo.superclass._init.apply(this,arguments);var self=this,o=this.options,assertShowValue=function(){BI.isKey(self._startValue)&&(self.storeValue=self._startValue),self.trigger.getSearcher().setState(self.storeValue)};this.storeValue=o.value,this.requesting=!1,this.trigger=BI.createWidget({type:"bi.single_select_trigger",height:o.height,allowNoSelect:o.allowNoSelect,allowEdit:o.allowEdit,valueFormatter:o.valueFormatter,itemsCreator:function(op,callback){o.itemsCreator(op,function(res){1===op.times&&BI.isNotNull(op.keywords)&&self.trigger.setValue(self.getValue()),callback.apply(self,arguments)})},text:o.text,value:this.storeValue,searcher:{popup:{type:"bi.single_select_search_insert_pane",listeners:[{eventName:BI.SingleSelectSearchInsertPane.EVENT_ADD_ITEM,action:function(){self.trigger.getSearcher().hasMatched()||(self.storeValue=self.trigger.getSearcher().getKeyword(),assertShowValue(),self._defaultState())}}]}}}),this.trigger.on(BI.SingleSelectTrigger.EVENT_FOCUS,function(){self.fireEvent(BI.SingleSelectInsertCombo.EVENT_FOCUS)}),this.trigger.on(BI.SingleSelectTrigger.EVENT_BLUR,function(){self.fireEvent(BI.SingleSelectInsertCombo.EVENT_BLUR)}),this.trigger.on(BI.SingleSelectTrigger.EVENT_START,function(){self._setStartValue(),this.getSearcher().setValue(self.storeValue)}),this.trigger.on(BI.SingleSelectTrigger.EVENT_STOP,function(){self._setStartValue(),self.fireEvent(BI.SingleSelectInsertCombo.EVENT_STOP)}),this.trigger.on(BI.SingleSelectTrigger.EVENT_PAUSE,function(){if(this.getSearcher().hasMatched()){var keyword=this.getSearcher().getKeyword();self.storeValue=keyword,self.combo.setValue(self.storeValue),self._setStartValue(keyword),assertShowValue(),self.populate(),self._setStartValue()}}),this.trigger.on(BI.SingleSelectTrigger.EVENT_SEARCHING,function(keywords){var last=BI.last(keywords);keywords=BI.initial(keywords||[]),keywords.length>0&&self._joinKeywords(keywords,function(){BI.isEndWithBlank(last)?(self.combo.setValue(self.storeValue),assertShowValue(),self.combo.populate(),self._setStartValue()):(self.combo.setValue(self.storeValue),assertShowValue())}),self.fireEvent(BI.SingleSelectInsertCombo.EVENT_SEARCHING)}),this.trigger.on(BI.SingleSelectTrigger.EVENT_CHANGE,function(value,obj){self.storeValue=this.getValue(),assertShowValue(),self._defaultState()}),this.trigger.on(BI.SingleSelectTrigger.EVENT_COUNTER_CLICK,function(){self.combo.isViewVisible()||self.combo.showView()}),this.combo=BI.createWidget({type:"bi.combo",container:o.container,toggle:!1,el:this.trigger,adjustLength:1,popup:{type:"bi.single_select_popup_view",allowNoSelect:o.allowNoSelect,ref:function(){self.popup=this,self.trigger.setAdapter(this)},listeners:[{eventName:BI.SingleSelectPopupView.EVENT_CHANGE,action:function(){self.storeValue=this.getValue(),self._adjust(function(){assertShowValue(),self._defaultState()}),self.fireEvent(BI.SingleSelectInsertCombo.EVENT_CLICK_ITEM)}}],itemsCreator:o.itemsCreator,valueFormatter:o.valueFormatter,onLoaded:function(){BI.nextTick(function(){self.combo.adjustWidth(),self.combo.adjustHeight(),self.trigger.getSearcher().adjustView()})}},hideChecker:function(e){return 0===triggerBtn.element.find(e.target).length},value:o.value}),this.combo.on(BI.Combo.EVENT_BEFORE_POPUPVIEW,function(){this.setValue(self.storeValue),BI.nextTick(function(){self.populate()})}),this.wants2Quit=!1,this.combo.on(BI.Combo.EVENT_AFTER_HIDEVIEW,function(){self.trigger.stopEditing(),self.requesting===!0?self.wants2Quit=!0:self.fireEvent(BI.SingleSelectInsertCombo.EVENT_CONFIRM)});var triggerBtn=BI.createWidget({type:"bi.trigger_icon_button",width:o.height,height:o.height,cls:"single-select-trigger-icon-button"});triggerBtn.on(BI.TriggerIconButton.EVENT_CHANGE,function(){self.combo.isViewVisible()?self.combo.hideView():self.combo.showView()}),BI.createWidget({type:"bi.absolute",element:this,items:[{el:this.combo,left:0,right:0,top:0,bottom:0},{el:triggerBtn,right:0,top:0,bottom:0}]})},_defaultState:function(){this.trigger.stopEditing(),this.combo.hideView()},_assertValue:function(val){},_makeMap:function(values){return BI.makeObject(values||[])},_joinKeywords:function(keywords,callback){function digest(items){var selectedMap=self._makeMap(items);BI.each(keywords,function(i,val){BI.isNotNull(selectedMap[val])&&BI.remove(self.storeValue.value,val)}),self._adjust(callback)}var self=this,o=this.options;this._assertValue(this.storeValue),this.requesting=!0,o.itemsCreator({type:BI.SingleSelectInsertCombo.REQ_GET_ALL_DATA,keywords:keywords},function(ob){var values=BI.map(ob.items,"value");digest(values)})},_adjust:function(callback){function adjust(){self.wants2Quit===!0&&(self.fireEvent(BI.SingleSelectInsertCombo.EVENT_CONFIRM),self.wants2Quit=!1),self.requesting=!1}var self=this,o=this.options;adjust(),callback()},_setStartValue:function(value){this._startValue=value,this.popup.setStartValue(value)},setValue:function(v){this.storeValue=v,this._assertValue(this.storeValue),this.combo.setValue(this.storeValue)},getValue:function(){return this.storeValue},populate:function(){this.combo.populate.apply(this.combo,arguments)}}),BI.extend(BI.SingleSelectInsertCombo,{REQ_GET_DATA_LENGTH:0,REQ_GET_ALL_DATA:-1}),BI.SingleSelectInsertCombo.EVENT_FOCUS="EVENT_FOCUS",BI.SingleSelectInsertCombo.EVENT_BLUR="EVENT_BLUR",BI.SingleSelectInsertCombo.EVENT_STOP="EVENT_STOP",BI.SingleSelectInsertCombo.EVENT_SEARCHING="EVENT_SEARCHING",BI.SingleSelectInsertCombo.EVENT_CLICK_ITEM="EVENT_CLICK_ITEM",BI.SingleSelectInsertCombo.EVENT_CONFIRM="EVENT_CONFIRM",BI.shortcut("bi.single_select_insert_combo",BI.SingleSelectInsertCombo),BI.SingleSelectComboItem=BI.inherit(BI.BasicButton,{_defaultConfig:function(){return BI.extend(BI.SingleSelectComboItem.superclass._defaultConfig.apply(this,arguments),{extraCls:"bi-single-select-radio-item",logic:{dynamic:!1},height:24})},_init:function(){BI.SingleSelectComboItem.superclass._init.apply(this,arguments);var self=this,o=this.options;this.radio=BI.createWidget({type:"bi.radio"}),this.text=BI.createWidget({type:"bi.label",cls:"list-item-text",textAlign:"left",whiteSpace:"nowrap",textHeight:o.height,height:o.height,hgap:o.hgap,text:o.text,keyword:o.keyword,value:o.value,py:o.py}),BI.createWidget(BI.extend({element:this},BI.LogicFactory.createLogic("horizontal",BI.extend(o.logic,{items:BI.LogicFactory.createLogicItemsByDirection("left",{type:"bi.center_adapt",items:[this.radio],width:26},this.text)}))))},doRedMark:function(){this.text.doRedMark.apply(this.text,arguments)},unRedMark:function(){this.text.unRedMark.apply(this.text,arguments)},doClick:function(){BI.SingleSelectComboItem.superclass.doClick.apply(this,arguments),this.radio.setSelected(this.isSelected()),this.isValid()&&this.fireEvent(BI.SingleSelectComboItem.EVENT_CHANGE,this.isSelected(),this)},setSelected:function(v){BI.SingleSelectComboItem.superclass.setSelected.apply(this,arguments),this.radio.setSelected(v)}}),BI.SingleSelectComboItem.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.single_select_combo_item",BI.SingleSelectComboItem),BI.SingleSelectList=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.SingleSelectList.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-select-list",direction:BI.Direction.Top,logic:{dynamic:!0},items:[],itemsCreator:BI.emptyFn,hasNext:BI.emptyFn,onLoaded:BI.emptyFn,el:{type:"bi.list_pane"},allowNoSelect:!1})},_init:function(){BI.SingleSelectList.superclass._init.apply(this,arguments);var self=this,o=this.options;this.list=BI.createWidget(o.el,{type:"bi.list_pane",items:o.items,itemsCreator:function(op,callback){1===op.times&&self.toolbar&&self.toolbar.setVisible(!1),o.itemsCreator(op,function(items){callback.apply(self,arguments),1===op.times&&(self.toolbar&&self.toolbar.setVisible(items&&items.length>0),self.toolbar&&self.toolbar.setEnable(items&&items.length>0))})},onLoaded:o.onLoaded,hasNext:o.hasNext,value:o.value}),this.list.on(BI.Controller.EVENT_CHANGE,function(type,value,obj){type===BI.Events.CLICK&&self.fireEvent(BI.SingleSelectList.EVENT_CHANGE,value,obj),self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),BI.createWidget(BI.extend({element:this},BI.LogicFactory.createLogic(BI.LogicFactory.createLogicTypeByDirection(o.direction),BI.extend({scrolly:!0},o.logic,{items:o.allowNoSelect?BI.LogicFactory.createLogicItemsByDirection(o.direction,{type:"bi.single_select_item",cls:"bi-list-item-active",height:24,forceNotSelected:!0,text:BI.i18nText("BI-Basic_No_Select"),ref:function(_ref){self.toolbar=_ref},listeners:[{eventName:BI.Controller.EVENT_CHANGE,action:function(type){type===BI.Events.CLICK&&(self.list.setValue(),self.fireEvent(BI.SingleSelectList.EVENT_CHANGE)),self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}}]},this.list):BI.LogicFactory.createLogicItemsByDirection(o.direction,this.list)}))))},hasPrev:function(){return this.list.hasPrev()},hasNext:function(){return this.list.hasNext()},prependItems:function(items){this.list.prependItems.apply(this.list,arguments)},addItems:function(items){this.list.addItems.apply(this.list,arguments)},setValue:function(v){this.list.setValue([v])},getValue:function(){return this.list.getValue()[0]},empty:function(){this.list.empty()},populate:function(items){this.list.populate.apply(this.list,arguments)},resetHeight:function(h){this.list.resetHeight?this.list.resetHeight(h):this.list.element.css({"max-height":h+"px"})},setNotSelectedValue:function(){this.list.setNotSelectedValue.apply(this.list,arguments)},getNotSelectedValue:function(){return this.list.getNotSelectedValue()},getAllButtons:function(){return this.list.getAllButtons()},getAllLeaves:function(){return this.list.getAllLeaves()},getSelectedButtons:function(){return this.list.getSelectedButtons()},getNotSelectedButtons:function(){return this.list.getNotSelectedButtons()},getIndexByValue:function(value){return this.list.getIndexByValue(value)},getNodeById:function(id){return this.list.getNodeById(id)},getNodeByValue:function(value){return this.list.getNodeByValue(value)}}),BI.SingleSelectList.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.single_select_list",BI.SingleSelectList),BI.SingleSelectLoader=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.SingleSelectLoader.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-single-select-loader",logic:{dynamic:!0},el:{height:400},allowNoSelect:!1,valueFormatter:BI.emptyFn,itemsCreator:BI.emptyFn,onLoaded:BI.emptyFn})},_init:function(){BI.SingleSelectLoader.superclass._init.apply(this,arguments);var self=this,opts=this.options,hasNext=!1;this.storeValue=opts.value,this.button_group=BI.createWidget({type:"bi.single_select_list",allowNoSelect:opts.allowNoSelect,logic:opts.logic,el:BI.extend({onLoaded:opts.onLoaded,el:{type:"bi.loader",isDefaultInit:!1,logic:{dynamic:!0,scrolly:!0},el:{chooseType:BI.ButtonGroup.CHOOSE_TYPE_SINGLE,behaviors:{redmark:function(){return!0}},layouts:[{type:"bi.vertical"}]}}},opts.el),itemsCreator:function(op,callback){var startValue=self._startValue;BI.isNotNull(self.storeValue)&&(op=BI.extend(op||{},{selectedValues:[self.storeValue]})),opts.itemsCreator(op,function(ob){hasNext=ob.hasNext;var firstItems=[];if(1===op.times&&BI.isNotNull(self.storeValue)){var json=BI.map([self.storeValue],function(i,v){var txt=opts.valueFormatter(v)||v;return{text:txt,value:v,title:txt,selected:!0}});firstItems=self._createItems(json)}callback(firstItems.concat(self._createItems(ob.items)),ob.keyword||""),1===op.times&&self.storeValue&&(BI.isKey(startValue)&&(self.storeValue=startValue),self.setValue(self.storeValue)),1===op.times&&self._scrollToTop()})},hasNext:function(){return hasNext},value:this.storeValue}),BI.createWidget({type:"bi.vertical",element:this,items:[this.button_group],vgap:5}),this.button_group.on(BI.Controller.EVENT_CHANGE,function(){self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.button_group.on(BI.SingleSelectList.EVENT_CHANGE,function(){self.fireEvent(BI.SingleSelectLoader.EVENT_CHANGE,arguments)})},_createItems:function(items){return BI.createItems(items,{type:this.options.allowNoSelect?"bi.single_select_item":"bi.single_select_combo_item",logic:this.options.logic,cls:"bi-list-item-active",height:24,selected:!1})},_scrollToTop:function(){var self=this;BI.delay(function(){self.button_group.element.scrollTop(0)},30)},_assertValue:function(val){},setStartValue:function(v){this._startValue=v},setValue:function(v){this.storeValue=v,this._assertValue(this.storeValue),this.button_group.setValue(this.storeValue)},getValue:function(){return this.button_group.getValue()},getAllButtons:function(){return this.button_group.getAllButtons()},empty:function(){this.button_group.empty()},populate:function(items){this.button_group.populate.apply(this.button_group,arguments)},resetHeight:function(h){this.button_group.resetHeight(h)},resetWidth:function(w){this.button_group.resetWidth(w)}}),BI.SingleSelectLoader.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.single_select_loader",BI.SingleSelectLoader),BI.SingleSelectPopupView=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.SingleSelectPopupView.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-single-select-popup-view",allowNoSelect:!1,maxWidth:"auto",minWidth:135,maxHeight:400,valueFormatter:BI.emptyFn,itemsCreator:BI.emptyFn,onLoaded:BI.emptyFn})},_init:function(){BI.SingleSelectPopupView.superclass._init.apply(this,arguments);var self=this,opts=this.options;this.loader=BI.createWidget({type:"bi.single_select_loader",allowNoSelect:opts.allowNoSelect,itemsCreator:opts.itemsCreator,valueFormatter:opts.valueFormatter,onLoaded:opts.onLoaded,value:opts.value}),this.popupView=BI.createWidget({type:"bi.popup_view",stopPropagation:!1,maxWidth:opts.maxWidth,minWidth:opts.minWidth,maxHeight:opts.maxHeight,element:this,el:this.loader,value:opts.value}),this.popupView.on(BI.MultiPopupView.EVENT_CHANGE,function(){self.fireEvent(BI.SingleSelectPopupView.EVENT_CHANGE)})},setStartValue:function(v){this.loader.setStartValue(v)},setValue:function(v){this.popupView.setValue(v)},getValue:function(){return this.popupView.getValue()},populate:function(items){this.popupView.populate.apply(this.popupView,arguments)},resetHeight:function(h){this.popupView.resetHeight(h)},resetWidth:function(w){this.popupView.resetWidth(w)}}),BI.SingleSelectPopupView.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.single_select_popup_view",BI.SingleSelectPopupView),BI.SingleSelectTrigger=BI.inherit(BI.Trigger,{constants:{height:14,rgap:4,lgap:4},_defaultConfig:function(){return BI.extend(BI.SingleSelectTrigger.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-single-select-trigger bi-border bi-border-radius",allowNoSelect:!1,itemsCreator:BI.emptyFn,valueFormatter:BI.emptyFn,searcher:{},switcher:{},adapter:null,masker:{},allowEdit:!0})},_init:function(){BI.SingleSelectTrigger.superclass._init.apply(this,arguments);var self=this,o=this.options;o.height&&this.setHeight(o.height-2),this.searcher=BI.createWidget(o.searcher,{type:"bi.single_select_searcher",allowNoSelect:o.allowNoSelect,text:o.text,height:o.height,itemsCreator:o.itemsCreator,valueFormatter:o.valueFormatter,popup:{},adapter:o.adapter,masker:o.masker,value:o.value}),this.searcher.on(BI.SingleSelectSearcher.EVENT_START,function(){self.fireEvent(BI.SingleSelectTrigger.EVENT_START)}),this.searcher.on(BI.SingleSelectSearcher.EVENT_PAUSE,function(){self.fireEvent(BI.SingleSelectTrigger.EVENT_PAUSE)}),this.searcher.on(BI.SingleSelectSearcher.EVENT_SEARCHING,function(){self.fireEvent(BI.SingleSelectTrigger.EVENT_SEARCHING,arguments)}),this.searcher.on(BI.SingleSelectSearcher.EVENT_STOP,function(){self.fireEvent(BI.SingleSelectTrigger.EVENT_STOP)}),this.searcher.on(BI.SingleSelectSearcher.EVENT_CHANGE,function(){self.fireEvent(BI.SingleSelectTrigger.EVENT_CHANGE,arguments)}),this.searcher.on(BI.SingleSelectSearcher.EVENT_FOCUS,function(){self.fireEvent(BI.SingleSelectTrigger.EVENT_FOCUS)}),this.searcher.on(BI.SingleSelectSearcher.EVENT_BLUR,function(){self.fireEvent(BI.SingleSelectTrigger.EVENT_BLUR,arguments)});var wrapper=BI.createWidget({type:"bi.htape",element:this,items:[{el:this.searcher,width:"fill"},{el:BI.createWidget(),width:24}]});!o.allowEdit&&BI.createWidget({type:"bi.absolute",element:this,items:[{el:{type:"bi.layout"},left:0,right:24,top:0,bottom:0}]})},getSearcher:function(){return this.searcher},stopEditing:function(){this.searcher.stopSearch()},setAdapter:function(adapter){this.searcher.setAdapter(adapter)},setValue:function(v){this.searcher.setValue(v)},getKey:function(){return this.searcher.getKey()},getValue:function(){return this.searcher.getValue()}}),BI.SingleSelectTrigger.EVENT_TRIGGER_CLICK="EVENT_TRIGGER_CLICK",BI.SingleSelectTrigger.EVENT_COUNTER_CLICK="EVENT_COUNTER_CLICK",BI.SingleSelectTrigger.EVENT_CHANGE="EVENT_CHANGE",BI.SingleSelectTrigger.EVENT_START="EVENT_START",BI.SingleSelectTrigger.EVENT_STOP="EVENT_STOP",BI.SingleSelectTrigger.EVENT_PAUSE="EVENT_PAUSE",BI.SingleSelectTrigger.EVENT_SEARCHING="EVENT_SEARCHING",BI.SingleSelectTrigger.EVENT_BEFORE_COUNTER_POPUPVIEW="EVENT_BEFORE_COUNTER_POPUPVIEW",BI.SingleSelectTrigger.EVENT_FOCUS="EVENT_FOCUS",BI.SingleSelectTrigger.EVENT_BLUR="EVENT_BLUR",BI.shortcut("bi.single_select_trigger",BI.SingleSelectTrigger),BI.SingleSelectInsertList=BI.inherit(BI.Single,{_defaultConfig:function(){return BI.extend(BI.SingleSelectInsertList.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-multi-select-insert-list",allowNoSelect:!1,itemsCreator:BI.emptyFn,valueFormatter:BI.emptyFn})},_init:function(){BI.SingleSelectInsertList.superclass._init.apply(this,arguments);var self=this,o=this.options;this.storeValue=o.value;var assertShowValue=function(){BI.isKey(self._startValue)&&(self.storeValue=self._startValue)};this.adapter=BI.createWidget({type:"bi.single_select_loader",allowNoSelect:o.allowNoSelect,cls:"popup-single-select-list bi-border-left bi-border-right bi-border-bottom",itemsCreator:o.itemsCreator,valueFormatter:o.valueFormatter,logic:{dynamic:!0},el:{},value:o.value}),this.adapter.on(BI.SingleSelectLoader.EVENT_CHANGE,function(){self.storeValue=this.getValue(),assertShowValue(),self.fireEvent(BI.SingleSelectInsertList.EVENT_CHANGE)}),this.searcherPane=BI.createWidget({type:"bi.single_select_search_pane",allowNoSelect:o.allowNoSelect,cls:"bi-border-left bi-border-right bi-border-bottom",valueFormatter:o.valueFormatter,keywordGetter:function(){return self.trigger.getKeyword()},itemsCreator:function(op,callback){op.keywords=[self.trigger.getKeyword()],this.setKeyword(op.keywords[0]),o.itemsCreator(op,callback); +}}),this.searcherPane.setVisible(!1),this.trigger=BI.createWidget({type:"bi.searcher",isAutoSearch:!1,isAutoSync:!1,onSearch:function(op,callback){callback()},adapter:this.adapter,popup:this.searcherPane,height:200,masker:!1,value:o.value,listeners:[{eventName:BI.Searcher.EVENT_START,action:function(){self._showSearcherPane(),self._setStartValue(),this.setValue(BI.deepClone(self.storeValue))}},{eventName:BI.Searcher.EVENT_STOP,action:function(){self._showAdapter(),self._setStartValue(),self.adapter.setValue(self.storeValue),self.adapter.populate()}},{eventName:BI.Searcher.EVENT_PAUSE,action:function(){var keyword=this.getKeyword();self.storeValue=keyword,self._showAdapter(),self.adapter.setValue(self.storeValue),self._setStartValue(keyword),assertShowValue(),self.adapter.populate(),self._setStartValue(),self.fireEvent(BI.SingleSelectInsertList.EVENT_CHANGE)}},{eventName:BI.Searcher.EVENT_SEARCHING,action:function(){var keywords=this.getKeyword(),last=BI.last(keywords);keywords=BI.initial(keywords||[]),keywords.length>0&&self._joinKeywords(keywords,function(){BI.isEndWithBlank(last)?(self.adapter.setValue(self.storeValue),assertShowValue(),self.adapter.populate(),self._setStartValue()):(self.adapter.setValue(self.storeValue),assertShowValue())})}},{eventName:BI.Searcher.EVENT_CHANGE,action:function(){self.storeValue=this.getValue(),self.fireEvent(BI.SingleSelectInsertList.EVENT_CHANGE)}}]}),BI.createWidget({type:"bi.vtape",element:this,items:[{el:this.trigger,height:24},{el:this.adapter,height:"fill"}]}),BI.createWidget({type:"bi.absolute",element:this,items:[{el:this.searcherPane,top:24,bottom:0,left:0,right:0}]})},_showAdapter:function(){this.adapter.setVisible(!0),this.searcherPane.setVisible(!1)},_showSearcherPane:function(){this.searcherPane.setVisible(!0),this.adapter.setVisible(!1)},_defaultState:function(){this.trigger.stopEditing()},_assertValue:function(){},_makeMap:function(values){return BI.makeObject(values||[])},_joinKeywords:function(keywords,callback){function digest(items){var selectedMap=self._makeMap(items);BI.each(keywords,function(i,val){BI.isNotNull(selectedMap[val])&&(self.storeValue.type===BI.Selection.Single?BI.pushDistinct(self.storeValue.value,val):BI.remove(self.storeValue.value,val))}),callback()}var self=this,o=this.options;this._assertValue(this.storeValue),this._allData?digest(this._allData):o.itemsCreator({type:BI.SingleSelectInsertList.REQ_GET_ALL_DATA},function(ob){self._allData=BI.map(ob.items,"value"),digest(self._allData)})},_setStartValue:function(value){this._startValue=value,this.adapter.setStartValue(value)},isAllSelected:function(){return this.adapter.isAllSelected()},resize:function(){},setValue:function(v){this.storeValue=v,this.adapter.setValue(this.storeValue),this.trigger.setValue(this.storeValue)},getValue:function(){return BI.deepClone(this.storeValue)},populate:function(){this._count=null,this._allData=null,this.adapter.populate.apply(this.adapter,arguments),this.trigger.populate.apply(this.trigger,arguments)}}),BI.extend(BI.SingleSelectInsertList,{REQ_GET_DATA_LENGTH:0,REQ_GET_ALL_DATA:-1}),BI.SingleSelectInsertList.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.single_select_insert_list",BI.SingleSelectInsertList),BI.SingleSelectEditor=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.SingleSelectEditor.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-single-select-editor",el:{},text:BI.i18nText("BI-Basic_Please_Select")})},_init:function(){BI.SingleSelectEditor.superclass._init.apply(this,arguments);var self=this,o=this.options;this.editor=BI.createWidget(o.el,{type:"bi.state_editor",element:this,height:o.height,watermark:BI.i18nText("BI-Basic_Search"),allowBlank:!0,value:o.value,defaultText:o.text,text:o.text}),this.editor.on(BI.Controller.EVENT_CHANGE,function(){self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.editor.on(BI.StateEditor.EVENT_PAUSE,function(){self.fireEvent(BI.SingleSelectEditor.EVENT_PAUSE)}),this.editor.on(BI.StateEditor.EVENT_FOCUS,function(){self.fireEvent(BI.SingleSelectEditor.EVENT_FOCUS)}),this.editor.on(BI.StateEditor.EVENT_BLUR,function(){self.fireEvent(BI.SingleSelectEditor.EVENT_BLUR)})},focus:function(){this.editor.focus()},blur:function(){this.editor.blur()},setState:function(state){this.editor.setState(state)},setValue:function(v){this.editor.setValue(v)},getValue:function(){var v=this.editor.getState();return BI.isArray(v)&&v.length>0?v[v.length-1]:""},getKeywords:function(){var val=this.editor.getLastChangedValue(),keywords=val.match(/[\S]+/g);return BI.isEndWithBlank(val)?keywords.concat([" "]):keywords},populate:function(items){}}),BI.SingleSelectEditor.EVENT_FOCUS="EVENT_FOCUS",BI.SingleSelectEditor.EVENT_BLUR="EVENT_BLUR",BI.SingleSelectEditor.EVENT_PAUSE="EVENT_PAUSE",BI.shortcut("bi.single_select_editor",BI.SingleSelectEditor),BI.SingleSelectSearcher=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.SingleSelectSearcher.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-single-select-searcher",itemsCreator:BI.emptyFn,el:{},popup:{},valueFormatter:BI.emptyFn,adapter:null,masker:{},allowNoSelect:!1})},_init:function(){BI.SingleSelectSearcher.superclass._init.apply(this,arguments);var self=this,o=this.options;this.editor=BI.createWidget(o.el,{type:"bi.single_select_editor",height:o.height,text:o.text,listeners:[{eventName:BI.SingleSelectEditor.EVENT_FOCUS,action:function(){self.fireEvent(BI.SingleSelectSearcher.EVENT_FOCUS)}},{eventName:BI.SingleSelectEditor.EVENT_BLUR,action:function(){self.fireEvent(BI.SingleSelectSearcher.EVENT_BLUR)}}]}),this.searcher=BI.createWidget({type:"bi.searcher",element:this,height:o.height,isAutoSearch:!1,isAutoSync:!1,onSearch:function(op,callback){callback()},el:this.editor,popup:BI.extend({type:"bi.single_select_search_pane",allowNoSelect:o.allowNoSelect,valueFormatter:o.valueFormatter,keywordGetter:function(){return self.editor.getValue()},itemsCreator:function(op,callback){var keyword=self.editor.getValue();op.keywords=[keyword],this.setKeyword(keyword),o.itemsCreator(op,callback)},value:o.value},o.popup),adapter:o.adapter,masker:o.masker}),this.searcher.on(BI.Searcher.EVENT_START,function(){self.fireEvent(BI.SingleSelectSearcher.EVENT_START)}),this.searcher.on(BI.Searcher.EVENT_PAUSE,function(){this.hasMatched(),self.fireEvent(BI.SingleSelectSearcher.EVENT_PAUSE)}),this.searcher.on(BI.Searcher.EVENT_STOP,function(){self.fireEvent(BI.SingleSelectSearcher.EVENT_STOP)}),this.searcher.on(BI.Searcher.EVENT_CHANGE,function(){self.fireEvent(BI.SingleSelectSearcher.EVENT_CHANGE,arguments)}),this.searcher.on(BI.Searcher.EVENT_SEARCHING,function(){var keywords=this.getKeywords();self.fireEvent(BI.SingleSelectSearcher.EVENT_SEARCHING,keywords)}),BI.isNotNull(o.value)&&this.setState(o.value)},adjustView:function(){this.searcher.adjustView()},isSearching:function(){return this.searcher.isSearching()},stopSearch:function(){this.searcher.stopSearch()},getKeyword:function(){return this.editor.getValue()},hasMatched:function(){return this.searcher.hasMatched()},hasChecked:function(){return this.searcher.getView()&&this.searcher.getView().hasChecked()},setAdapter:function(adapter){this.searcher.setAdapter(adapter)},setState:function(v){var o=this.options;BI.isNull(v)?this.editor.setState(BI.Selection.None):this.editor.setState(o.valueFormatter(v+"")||v+"")},setValue:function(ob){this.setState(ob),this.searcher.setValue(ob)},getKey:function(){return this.editor.getValue()},getValue:function(){return this.searcher.getValue()},populate:function(items){this.searcher.populate.apply(this.searcher,arguments)}}),BI.SingleSelectSearcher.EVENT_FOCUS="EVENT_FOCUS",BI.SingleSelectSearcher.EVENT_BLUR="EVENT_BLUR",BI.SingleSelectSearcher.EVENT_BEFORE_POPUPVIEW="EVENT_BEFORE_POPUPVIEW",BI.SingleSelectSearcher.EVENT_CHANGE="EVENT_CHANGE",BI.SingleSelectSearcher.EVENT_START="EVENT_START",BI.SingleSelectSearcher.EVENT_STOP="EVENT_STOP",BI.SingleSelectSearcher.EVENT_PAUSE="EVENT_PAUSE",BI.SingleSelectSearcher.EVENT_SEARCHING="EVENT_SEARCHING",BI.shortcut("bi.single_select_searcher",BI.SingleSelectSearcher),BI.SignTextEditor=BI.inherit(BI.Widget,{_defaultConfig:function(){var conf=BI.SignTextEditor.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{baseCls:(conf.baseCls||"")+" bi-sign-initial-editor",validationChecker:BI.emptyFn,text:"",height:24})},_init:function(){BI.SignTextEditor.superclass._init.apply(this,arguments);var self=this,o=this.options;this.editor=BI.createWidget({type:"bi.editor",height:o.height,hgap:4,vgap:2,value:o.value,validationChecker:o.validationChecker,allowBlank:!1}),this.text=BI.createWidget({type:"bi.text_button",cls:"sign-editor-text",title:function(){return self.getValue()},textAlign:o.textAlign,height:o.height,hgap:4,handler:function(){self._showInput(),self.editor.focus(),self.editor.selectAll()}}),this.text.on(BI.TextButton.EVENT_CHANGE,function(){BI.nextTick(function(){self.fireEvent(BI.SignTextEditor.EVENT_CLICK_LABEL)})}),BI.createWidget({type:"bi.absolute",element:this,items:[{el:this.text,left:0,right:0,top:0,bottom:0}]}),this.editor.on(BI.Controller.EVENT_CHANGE,function(){self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.editor.on(BI.Editor.EVENT_CONFIRM,function(){self._showHint(),self._checkText(),self.fireEvent(BI.SignTextEditor.EVENT_CONFIRM,arguments)}),this.editor.on(BI.Editor.EVENT_CHANGE_CONFIRM,function(){self._showHint(),self._checkText(),self.fireEvent(BI.SignTextEditor.EVENT_CHANGE_CONFIRM,arguments)}),this.editor.on(BI.Editor.EVENT_ERROR,function(){self._checkText()}),BI.createWidget({type:"bi.vertical",scrolly:!1,element:this,items:[this.editor]}),this._showHint(),self._checkText()},_checkText:function(){var o=this.options;BI.nextTick(BI.bind(function(){if(""===this.editor.getValue())this.text.setValue(o.watermark||""),this.text.element.addClass("bi-water-mark");else{var v=this.editor.getValue();v=BI.isEmpty(v)||v==o.text?o.text:v+o.text,this.text.setValue(v),this.text.element.removeClass("bi-water-mark")}},this))},_showInput:function(){this.editor.visible(),this.text.invisible()},_showHint:function(){this.editor.invisible(),this.text.visible()},setTitle:function(title){this.text.setTitle(title)},setWarningTitle:function(title){this.text.setWarningTitle(title)},focus:function(){this._showInput(),this.editor.focus()},blur:function(){this.editor.blur(),this._showHint(),this._checkText()},doRedMark:function(){""===this.editor.getValue()&&BI.isKey(this.options.watermark)||this.text.doRedMark.apply(this.text,arguments)},unRedMark:function(){this.text.unRedMark.apply(this.text,arguments)},doHighLight:function(){""===this.editor.getValue()&&BI.isKey(this.options.watermark)||this.text.doHighLight.apply(this.text,arguments)},unHighLight:function(){this.text.unHighLight.apply(this.text,arguments)},isValid:function(){return this.editor.isValid()},setErrorText:function(text){this.editor.setErrorText(text)},getErrorText:function(){return this.editor.getErrorText()},isEditing:function(){return this.editor.isEditing()},getLastValidValue:function(){return this.editor.getLastValidValue()},getLastChangedValue:function(){return this.editor.getLastChangedValue()},setValue:function(v){this.editor.setValue(v),this._checkText()},getValue:function(){return this.editor.getValue()},getState:function(){return this.text.getValue()},setState:function(v){var o=this.options;this._showHint(),v=BI.isEmpty(v)||v==o.text?o.text:v+o.text,this.text.setValue(v)}}),BI.SignTextEditor.EVENT_CONFIRM="EVENT_CONFIRM",BI.SignTextEditor.EVENT_CHANGE_CONFIRM="EVENT_CHANGE_CONFIRM",BI.SignTextEditor.EVENT_CLICK_LABEL="EVENT_CLICK_LABEL",BI.shortcut("bi.sign_text_editor",BI.SignTextEditor),BI.SliderIconButton=BI.inherit(BI.Widget,{props:{baseCls:"bi-single-slider-button"},constants:{LARGE_SIZE:16,NORMAL_SIZE:12,LARGE_OFFSET:4,NORMAL_OFFSET:6},render:function(){var self=this;return{type:"bi.absolute",ref:function(){self.wrapper=this},items:[{el:{type:"bi.text_button",cls:"slider-button bi-high-light-border",ref:function(){self.slider=this}}}]}}}),BI.shortcut("bi.single_slider_button",BI.SliderIconButton),BI.SingleSlider=BI.inherit(BI.Single,{_constant:{EDITOR_WIDTH:90,EDITOR_HEIGHT:30,SLIDER_WIDTH_HALF:15,SLIDER_WIDTH:30,SLIDER_HEIGHT:30,TRACK_HEIGHT:24},props:{baseCls:"bi-single-slider bi-slider-track",digit:!1,unit:""},render:function(){var self=this,o=this.options,c=this._constant;this.enable=!1,this.value="",this.grayTrack=BI.createWidget({type:"bi.layout",cls:"gray-track",height:6}),this.blueTrack=BI.createWidget({type:"bi.layout",cls:"blue-track bi-high-light-background",height:6}),this.track=this._createTrackWrapper(),this.slider=BI.createWidget({type:"bi.single_slider_button"}),this._draggable(this.slider);var sliderVertical=BI.createWidget({type:"bi.vertical",items:[{type:"bi.absolute",items:[this.slider]}],hgap:c.SLIDER_WIDTH_HALF,height:c.SLIDER_HEIGHT});return sliderVertical.element.click(function(e){if(self.enable&&self.isEnabled()){var offset=e.clientX-self.element.offset().left-c.SLIDER_WIDTH_HALF,trackLength=self.track.element[0].scrollWidth,percent=0;offset<0&&(percent=0),offset>0&&offsettrackLength-c.SLIDER_WIDTH&&(percent=100);var significantPercent=BI.parseFloat(percent.toFixed(1));self._setAllPosition(significantPercent);var v=self._getValueByPercent(significantPercent);v=o.digit===!1?v:v.toFixed(o.digit),self.label.setValue(v),self.value=v,self.fireEvent(BI.SingleSlider.EVENT_CHANGE)}}),this.label=BI.createWidget({type:"bi.sign_text_editor",cls:"slider-editor-button",text:o.unit,width:c.EDITOR_WIDTH-2,allowBlank:!1,textAlign:"center",validationChecker:function(v){return self._checkValidation(v)}}),this.label.element.hover(function(){self.label.element.removeClass("bi-border").addClass("bi-border")},function(){self.label.element.removeClass("bi-border")}),this.label.on(BI.SignEditor.EVENT_CONFIRM,function(){var v=BI.parseFloat(this.getValue()),percent=self._getPercentByValue(v),significantPercent=BI.parseFloat(percent.toFixed(1));self._setAllPosition(significantPercent),this.setValue(v),self.value=v,self.fireEvent(BI.SingleSlider.EVENT_CHANGE)}),this._setVisible(!1),{type:"bi.absolute",items:[{el:{type:"bi.vertical",items:[{type:"bi.absolute",items:[{el:this.track,width:"100%",height:c.TRACK_HEIGHT}]}],hgap:7,height:c.TRACK_HEIGHT},top:23,left:0,width:"100%"},{el:sliderVertical,top:20,left:0,width:"100%"},{el:{type:"bi.vertical",items:[{type:"bi.horizontal_auto",items:[this.label]}],height:c.EDITOR_HEIGHT},top:0,left:0,width:"100%"}]}},_draggable:function(widget){function optimizeSize(s){return BI.clamp(s,0,self._getGrayTrackLength())}var self=this,o=this.options,startDrag=!1,size=0,offset=0,defaultSize=0,mouseMoveTracker=new BI.MouseMoveTracker(function(deltaX){if(mouseMoveTracker.isDragging()){startDrag=!0,offset+=deltaX,size=optimizeSize(defaultSize+offset),widget.element.addClass("dragging");var percent=100*size/self._getGrayTrackLength(),significantPercent=BI.parseFloat(percent.toFixed(1));self._setBlueTrack(significantPercent),self._setLabelPosition(significantPercent),self._setSliderPosition(significantPercent);var v=self._getValueByPercent(significantPercent);v=o.digit===!1?v:v.toFixed(o.digit),self.label.setValue(v),self.value=v}},function(){if(startDrag===!0){size=optimizeSize(size);var percent=100*size/self._getGrayTrackLength(),significantPercent=BI.parseFloat(percent.toFixed(1));self._setSliderPosition(significantPercent),size=0,offset=0,defaultSize=size,startDrag=!1}widget.element.removeClass("dragging"),mouseMoveTracker.releaseMouseMoves(),self.fireEvent(BI.SingleSlider.EVENT_CHANGE)},window);widget.element.on("mousedown",function(event){widget.isEnabled()&&(defaultSize=this.offsetLeft,optimizeSize(defaultSize),mouseMoveTracker.captureMouseMoves(event))})},_createTrackWrapper:function(){return BI.createWidget({type:"bi.absolute",items:[{el:{type:"bi.vertical",items:[{type:"bi.absolute",items:[{el:this.grayTrack,top:0,left:0,width:"100%"},{el:this.blueTrack,top:0,left:0,width:"0%"}]}],hgap:8,height:8},top:8,left:0,width:"100%"}]})},_checkValidation:function(v){var o=this.options,valid=!1;if(BI.isNumeric(v)&&!(BI.isNull(v)||vthis.max))if(o.digit===!1)valid=!0;else{var dotText=(v+"").split(".")[1]||"";valid=dotText.length===o.digit}return valid},_setBlueTrack:function(percent){this.blueTrack.element.css({width:percent+"%"})},_setLabelPosition:function(percent){},_setSliderPosition:function(percent){this.slider.element.css({left:percent+"%"})},_setAllPosition:function(percent){this._setSliderPosition(percent),this._setLabelPosition(percent),this._setBlueTrack(percent)},_setVisible:function(visible){this.slider.setVisible(visible),this.label.setVisible(visible)},_getGrayTrackLength:function(){return this.grayTrack.element[0].scrollWidth},_getValueByPercent:function(percent){var thousandth=BI.parseInt(10*percent);return(this.max-this.min)*thousandth/1e3+this.min},_getPercentByValue:function(v){return 100*(v-this.min)/(this.max-this.min)},getValue:function(){return this.value},setValue:function(v){var o=this.options;v=BI.parseFloat(v),v=o.digit===!1?v:v.toFixed(o.digit),isNaN(v)||(this._checkValidation(v)&&(this.value=v),v>this.max&&(this.value=this.max),vminNumber&&(this.min=minNumber,this.max=maxNumber)},reset:function(){this._setVisible(!1),this.enable=!1,this.value="",this.min=0,this.max=0,this._setBlueTrack(0)},populate:function(){isNaN(this.min)||isNaN(this.max)||(this._setVisible(!0),this.enable=!0,this.label.setErrorText(BI.i18nText("BI-Basic_Please_Enter_Number_Between",this.min,this.max)),BI.isNumeric(this.value)||BI.isNotEmptyString(this.value)?(this.label.setValue(this.value),this._setAllPosition(this._getPercentByValue(this.value))):(this.label.setValue(this.max),this._setAllPosition(100)))}}),BI.SingleSlider.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.single_slider",BI.SingleSlider),BI.SingleSliderLabel=BI.inherit(BI.Single,{_constant:{EDITOR_WIDTH:90,EDITOR_HEIGHT:20,HEIGHT:20,SLIDER_WIDTH_HALF:15,SLIDER_WIDTH:30,SLIDER_HEIGHT:30,TRACK_HEIGHT:24},_defaultConfig:function(){return BI.extend(BI.SingleSliderLabel.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-single-slider-label bi-slider-track",digit:!1,unit:""})},_init:function(){BI.SingleSliderLabel.superclass._init.apply(this,arguments);var self=this,o=this.options,c=this._constant;this.enable=!1,this.value="",this.grayTrack=BI.createWidget({type:"bi.layout",cls:"gray-track",height:6}),this.blueTrack=BI.createWidget({type:"bi.layout",cls:"blue-track bi-high-light-background",height:6}),this.track=this._createTrackWrapper(),this.slider=BI.createWidget({type:"bi.single_slider_button"}),this._draggable(this.slider);var sliderVertical=BI.createWidget({type:"bi.vertical",items:[{type:"bi.absolute",items:[this.slider]}],hgap:c.SLIDER_WIDTH_HALF,height:c.SLIDER_HEIGHT});sliderVertical.element.click(function(e){if(self.enable&&self.isEnabled()){var offset=e.clientX-self.element.offset().left-c.SLIDER_WIDTH_HALF,trackLength=self.track.element[0].scrollWidth,percent=0;offset<0&&(percent=0),offset>0&&offsettrackLength-c.SLIDER_WIDTH&&(percent=100);var significantPercent=BI.parseFloat(percent.toFixed(1));self._setAllPosition(significantPercent);var v=self._getValueByPercent(significantPercent);v=o.digit===!1?v:v.toFixed(o.digit),self.label.setText(v+o.unit),self.value=v,self.fireEvent(BI.SingleSliderLabel.EVENT_CHANGE)}}),this.label=BI.createWidget({type:"bi.label",height:c.HEIGHT,width:c.EDITOR_WIDTH-2}),this._setVisible(!1),BI.createWidget({type:"bi.absolute",element:this,items:[{el:{type:"bi.vertical",items:[{type:"bi.absolute",items:[{el:this.track,width:"100%",height:c.TRACK_HEIGHT}]}],hgap:7,height:c.TRACK_HEIGHT},top:13,left:0,width:"100%"},{el:sliderVertical,top:10,left:0,width:"100%"},{el:{type:"bi.vertical",items:[{type:"bi.horizontal_auto",items:[this.label]}],height:c.EDITOR_HEIGHT},top:0,left:0,width:"100%"}]})},_draggable:function(widget){function optimizeSize(s){return BI.clamp(s,0,self._getGrayTrackLength())}var self=this,o=this.options,startDrag=!1,size=0,offset=0,defaultSize=0,mouseMoveTracker=new BI.MouseMoveTracker(function(deltaX){if(mouseMoveTracker.isDragging()){startDrag=!0,offset+=deltaX,size=optimizeSize(defaultSize+offset),widget.element.addClass("dragging");var percent=100*size/self._getGrayTrackLength(),significantPercent=BI.parseFloat(percent.toFixed(1));self._setBlueTrack(significantPercent),self._setLabelPosition(significantPercent),self._setSliderPosition(significantPercent);var v=self._getValueByPercent(significantPercent);v=o.digit===!1?v:v.toFixed(o.digit),self.label.setValue(v+o.unit),self.value=v,self.fireEvent(BI.SingleSliderLabel.EVENT_CHANGE)}},function(){if(startDrag===!0){size=optimizeSize(size);var percent=100*size/self._getGrayTrackLength(),significantPercent=BI.parseFloat(percent.toFixed(1));self._setSliderPosition(significantPercent),size=0,offset=0,defaultSize=size,startDrag=!1}widget.element.removeClass("dragging"),mouseMoveTracker.releaseMouseMoves(),self.fireEvent(BI.SingleSliderLabel.EVENT_CHANGE)},window);widget.element.on("mousedown",function(event){widget.isEnabled()&&(defaultSize=this.offsetLeft,optimizeSize(defaultSize),mouseMoveTracker.captureMouseMoves(event))})},_createTrackWrapper:function(){return BI.createWidget({type:"bi.absolute",items:[{el:{type:"bi.vertical",items:[{type:"bi.absolute",items:[{el:this.grayTrack,top:0,left:0,width:"100%"},{el:this.blueTrack,top:0,left:0,width:"0%"}]}],hgap:8,height:8},top:8,left:0,width:"100%"}]})},_checkValidation:function(v){return BI.isNumeric(v)&&!(BI.isNull(v)||vthis.max)},_setBlueTrack:function(percent){this.blueTrack.element.css({width:percent+"%"})},_setLabelPosition:function(percent){},_setSliderPosition:function(percent){this.slider.element.css({left:percent+"%"})},_setAllPosition:function(percent){this._setSliderPosition(percent),this._setLabelPosition(percent),this._setBlueTrack(percent)},_setVisible:function(visible){this.slider.setVisible(visible),this.label.setVisible(visible)},_getGrayTrackLength:function(){return this.grayTrack.element[0].scrollWidth},_getValueByPercent:function(percent){var thousandth=BI.parseInt(10*percent);return(this.max-this.min)*thousandth/1e3+this.min},_getPercentByValue:function(v){return 100*(v-this.min)/(this.max-this.min)},_setEnable:function(b){BI.SingleSliderLabel.superclass._setEnable.apply(this,[b]),b?this.blueTrack.element.removeClass("disabled-blue-track").addClass("blue-track"):this.blueTrack.element.removeClass("blue-track").addClass("disabled-blue-track")},getValue:function(){return this.value},setValue:function(v){var o=this.options;v=BI.parseFloat(v),v=o.digit===!1?v:v.toFixed(o.digit),isNaN(v)||(this._checkValidation(v)&&(this.value=v),v>this.max&&(this.value=this.max),vminNumber&&(this.min=minNumber,this.max=maxNumber)},reset:function(){this._setVisible(!1),this.enable=!1,this.value="",this.min=0,this.max=0,this._setBlueTrack(0)},populate:function(){var o=this.options;isNaN(this.min)||isNaN(this.max)||(this._setVisible(!0),this.enable=!0,BI.isNumeric(this.value)||BI.isNotEmptyString(this.value)?(this.label.setValue(this.value+o.unit),this._setAllPosition(this._getPercentByValue(this.value))):(this.label.setValue(this.max+o.unit),this._setAllPosition(100)))}}),BI.SingleSliderLabel.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.single_slider_label",BI.SingleSliderLabel),BI.SingleSliderNormal=BI.inherit(BI.Single,{_constant:{HEIGHT:28,SLIDER_WIDTH_HALF:15,SLIDER_WIDTH:30,SLIDER_HEIGHT:30,TRACK_HEIGHT:24},props:{baseCls:"bi-single-slider-normal bi-slider-track",minMax:{min:0,max:100}},render:function(){var self=this,c=this._constant,track=this._createTrack();this.slider=BI.createWidget({type:"bi.single_slider_button"}),this._draggable(this.slider);var sliderVertical=BI.createWidget({type:"bi.vertical",items:[{type:"bi.absolute",items:[this.slider]}],hgap:c.SLIDER_WIDTH_HALF,height:c.SLIDER_HEIGHT});return sliderVertical.element.click(function(e){if(self.enable&&self.isEnabled()){var offset=e.clientX-self.element.offset().left-c.SLIDER_WIDTH_HALF,trackLength=self.track.element[0].scrollWidth,percent=0;offset<0&&(percent=0),offset>0&&offsettrackLength-c.SLIDER_WIDTH&&(percent=100);var significantPercent=BI.parseFloat(percent.toFixed(1));self._setAllPosition(significantPercent);var v=self._getValueByPercent(significantPercent);self.value=v,self.fireEvent(BI.SingleSlider.EVENT_CHANGE)}}),{type:"bi.absolute",element:this,items:[{el:{type:"bi.vertical",items:[{type:"bi.absolute",items:[{el:track,width:"100%",height:c.TRACK_HEIGHT}]}],hgap:7,height:c.TRACK_HEIGHT},top:3,left:0,width:"100%"},{el:sliderVertical,top:0,left:0,width:"100%"}]}},_draggable:function(widget){function optimizeSize(s){return BI.clamp(s,0,self._getGrayTrackLength())}var self=this,o=this.options,startDrag=!1,size=0,offset=0,defaultSize=0,mouseMoveTracker=new BI.MouseMoveTracker(function(deltaX){if(mouseMoveTracker.isDragging()){startDrag=!0,offset+=deltaX,size=optimizeSize(defaultSize+offset),widget.element.addClass("dragging");var percent=100*size/self._getGrayTrackLength(),significantPercent=BI.parseFloat(percent.toFixed(1));self._setBlueTrack(significantPercent),self._setSliderPosition(significantPercent);var v=self._getValueByPercent(significantPercent);v=o.digit===!1?v:v.toFixed(o.digit),self.value=v,self.fireEvent(BI.SingleSliderNormal.EVENT_DRAG,v)}},function(){if(startDrag===!0){size=optimizeSize(size);var percent=100*size/self._getGrayTrackLength(),significantPercent=BI.parseFloat(percent.toFixed(1));self._setSliderPosition(significantPercent),size=0,offset=0,defaultSize=size,startDrag=!1}widget.element.removeClass("dragging"),mouseMoveTracker.releaseMouseMoves(),self.fireEvent(BI.SingleSlider.EVENT_CHANGE)},window);widget.element.on("mousedown",function(event){widget.isEnabled()&&(defaultSize=this.offsetLeft,optimizeSize(defaultSize),mouseMoveTracker.captureMouseMoves(event))})},_createTrack:function(){var self=this,c=this._constant;return this.grayTrack=BI.createWidget({type:"bi.layout",cls:"gray-track",height:6}),this.blueTrack=BI.createWidget({type:"bi.layout",cls:"blue-track bi-high-light-background",height:6}),this.options.color&&this.blueTrack.element.css({"background-color":this.options.color}),{type:"bi.absolute",items:[{el:{type:"bi.vertical",items:[{type:"bi.absolute",items:[{el:this.grayTrack,top:0,left:0,width:"100%"},{el:this.blueTrack,top:0,left:0,width:"0%"}]}],hgap:8,height:8},top:8,left:0,width:"100%"}],ref:function(ref){self.track=ref}}},_checkValidation:function(v){return!(BI.isNull(v)||vthis.max)},_setBlueTrack:function(percent){this.blueTrack.element.css({width:percent+"%"})},_setSliderPosition:function(percent){this.slider.element.css({left:percent+"%"})},_setAllPosition:function(percent){this._setSliderPosition(percent),this._setBlueTrack(percent)},_setVisible:function(visible){this.slider.setVisible(visible)},_getGrayTrackLength:function(){return this.grayTrack.element[0].scrollWidth},_getValueByPercent:function(percent){var thousandth=BI.parseInt(10*percent);return(this.max-this.min)*thousandth/1e3+this.min},_getPercentByValue:function(v){return 100*(v-this.min)/(this.max-this.min)},_setEnable:function(b){BI.SingleSliderNormal.superclass._setEnable.apply(this,[b]),b?this.blueTrack.element.removeClass("disabled-blue-track").addClass("blue-track"):this.blueTrack.element.removeClass("blue-track").addClass("disabled-blue-track")},getValue:function(){return this.value},setValue:function(v){var value=BI.parseFloat(v);isNaN(value)||(this._checkValidation(value)&&(this.value=value),value>this.max&&(this.value=this.max),valueminNumber&&(this.min=minNumber,this.max=maxNumber)},reset:function(){this._setVisible(!1),this.enable=!1,this.value="",this.min=0,this.max=0,this._setBlueTrack(0)},populate:function(){isNaN(this.min)||isNaN(this.max)||(this._setVisible(!0),this.enable=!0,BI.isNumeric(this.value)||BI.isNotEmptyString(this.value)?this._setAllPosition(this._getPercentByValue(this.value)):this._setAllPosition(100))}}),BI.SingleSliderNormal.EVENT_DRAG="EVENT_DRAG",BI.shortcut("bi.single_slider_normal",BI.SingleSliderNormal),BI.SingleTreeCombo=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.SingleTreeCombo.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-single-tree-combo",trigger:{},height:24,text:"",items:[],value:"",attributes:{tabIndex:0}})},_init:function(){BI.SingleTreeCombo.superclass._init.apply(this,arguments);var self=this,o=this.options;this.trigger=BI.createWidget(BI.extend({type:"bi.single_tree_trigger",text:o.text,height:o.height,items:o.items,value:o.value},o.trigger)),this.popup=BI.createWidget({type:"bi.single_level_tree",items:o.items,value:o.value}),this.combo=BI.createWidget({type:"bi.combo",container:o.container,element:this,adjustLength:2,el:this.trigger,popup:{el:this.popup}}),this.combo.on(BI.Controller.EVENT_CHANGE,function(){self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.combo.on(BI.Combo.EVENT_BEFORE_POPUPVIEW,function(){self.fireEvent(BI.SingleTreeCombo.EVENT_BEFORE_POPUPVIEW,arguments)}),this.popup.on(BI.SingleTreePopup.EVENT_CHANGE,function(){self.setValue(self.popup.getValue()),self.combo.hideView(),self.fireEvent(BI.SingleTreeCombo.EVENT_CHANGE)})},populate:function(items){this.combo.populate(items)},setValue:function(v){v=BI.isArray(v)?v:[v],this.trigger.setValue(v),this.popup.setValue(v)},getValue:function(){return this.popup.getValue()}}),BI.SingleTreeCombo.EVENT_CHANGE="EVENT_CHANGE",BI.SingleTreeCombo.EVENT_BEFORE_POPUPVIEW="EVENT_BEFORE_POPUPVIEW",BI.shortcut("bi.single_tree_combo",BI.SingleTreeCombo),BI.SingleTreePopup=BI.inherit(BI.Pane,{_defaultConfig:function(){return BI.extend(BI.SingleTreePopup.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-single-level-tree",tipText:BI.i18nText("BI-No_Selected_Item"),items:[],value:""})},_init:function(){BI.SingleTreePopup.superclass._init.apply(this,arguments);var self=this,o=this.options;this.tree=BI.createWidget({type:"bi.level_tree",expander:{isDefaultInit:!0},items:o.items,value:o.value,chooseType:BI.Selection.Single}),BI.createWidget({type:"bi.vertical",element:this,vgap:5,items:[this.tree]}),this.tree.on(BI.Controller.EVENT_CHANGE,function(){self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.tree.on(BI.LevelTree.EVENT_CHANGE,function(){self.fireEvent(BI.SingleTreePopup.EVENT_CHANGE)}),this.check()},getValue:function(){return this.tree.getValue()},setValue:function(v){v=BI.isArray(v)?v:[v],this.tree.setValue(v)},populate:function(items){BI.SingleTreePopup.superclass.populate.apply(this,arguments),this.tree.populate(items)}}),BI.SingleTreePopup.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.single_level_tree",BI.SingleTreePopup),BI.SingleTreeTrigger=BI.inherit(BI.Trigger,{_defaultConfig:function(){return BI.extend(BI.SingleTreeTrigger.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-single-tree-trigger",height:24,text:"",items:[],value:""})},_init:function(){BI.SingleTreeTrigger.superclass._init.apply(this,arguments); +var self=this,o=this.options;this.trigger=BI.createWidget({type:"bi.select_text_trigger",element:this,text:o.text,items:o.items,height:o.height,value:o.value})},_checkTitle:function(){var self=this,val=this.getValue();BI.any(this.options.items,function(i,item){if(BI.contains(val,item.value))return self.trigger.setTitle(item.text||item.value),!0})},setValue:function(v){v=BI.isArray(v)?v:[v],this.options.value=v,this.trigger.setValue(v),this._checkTitle()},getValue:function(){return this.options.value||[]},populate:function(items){BI.SingleTreeTrigger.superclass.populate.apply(this,arguments),this.trigger.populate(items)}}),BI.shortcut("bi.single_tree_trigger",BI.SingleTreeTrigger),BI.TextValueDownListCombo=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.TextValueDownListCombo.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-text-value-down-list-combo",height:24,attributes:{tabIndex:0}})},_init:function(){BI.TextValueDownListCombo.superclass._init.apply(this,arguments);var self=this,o=this.options;this._createValueMap();var value;BI.isNotNull(o.value)&&(value=this._digest(o.value)),this.trigger=BI.createWidget({type:"bi.down_list_select_text_trigger",cls:"text-value-down-list-trigger",height:o.height,items:o.items,text:o.text,value:value}),this.combo=BI.createWidget({type:"bi.down_list_combo",element:this,chooseType:BI.Selection.Single,adjustLength:2,height:o.height,el:this.trigger,value:BI.isNull(value)?[]:[value],items:BI.deepClone(o.items)}),this.combo.on(BI.DownListCombo.EVENT_CHANGE,function(){var currentVal=self.combo.getValue()[0].value;currentVal!==self.value&&(self.setValue(currentVal),self.fireEvent(BI.TextValueDownListCombo.EVENT_CHANGE))}),this.combo.on(BI.DownListCombo.EVENT_SON_VALUE_CHANGE,function(){var currentVal=self.combo.getValue()[0].childValue;currentVal!==self.value&&(self.setValue(currentVal),self.fireEvent(BI.TextValueDownListCombo.EVENT_CHANGE))})},_createValueMap:function(){var self=this;this.valueMap={},BI.each(BI.flatten(this.options.items),function(idx,item){BI.has(item,"el")?BI.each(item.children,function(id,it){self.valueMap[it.value]={value:item.el.value,childValue:it.value}}):self.valueMap[item.value]={value:item.value}})},_digest:function(v){return this.value=v,this.valueMap[v]},setValue:function(v){v=this._digest(v),this.combo.setValue([v]),this.trigger.setValue(v)},getValue:function(){var v=this.combo.getValue()[0];return[v.childValue||v.value]},populate:function(items){this.options.items=BI.flatten(items),this.combo.populate(items),this._createValueMap()}}),BI.TextValueDownListCombo.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.text_value_down_list_combo",BI.TextValueDownListCombo),BI.DownListSelectTextTrigger=BI.inherit(BI.Trigger,{_defaultConfig:function(){return BI.extend(BI.DownListSelectTextTrigger.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-down-list-select-text-trigger",height:24,text:""})},_init:function(){BI.DownListSelectTextTrigger.superclass._init.apply(this,arguments);var o=this.options;this.trigger=BI.createWidget({type:"bi.select_text_trigger",element:this,height:o.height,items:this._formatItemArray(o.items),text:o.text,value:BI.isNull(o.value)?"":o.value.childValue||o.value.value})},_formatItemArray:function(){var sourceArray=BI.flatten(BI.deepClone(this.options.items)),targetArray=[];return BI.each(sourceArray,function(idx,item){BI.has(item,"el")?(BI.each(item.children,function(id,it){it.text=item.el.text+"("+it.text+")"}),targetArray=BI.concat(targetArray,item.children)):targetArray.push(item)}),targetArray},setValue:function(vals){this.trigger.setValue(vals.childValue||vals.value)},populate:function(items){this.trigger.populate(this._formatItemArray(items))}}),BI.shortcut("bi.down_list_select_text_trigger",BI.DownListSelectTextTrigger),!function(){BI.TimePopup=BI.inherit(BI.Widget,{props:{baseCls:"bi-date-time-popup",height:68},render:function(){var self=this,o=this.options;return{type:"bi.vtape",items:[{el:{type:"bi.center_adapt",cls:"bi-split-top",items:[{type:"bi.dynamic_date_time_select",value:o.value,ref:function(_ref){self.timeSelect=_ref}}]},hgap:10,height:44},{el:{type:"bi.grid",items:[[{type:"bi.text_button",cls:"bi-high-light bi-split-top",shadow:!0,text:BI.i18nText("BI-Basic_Clears"),listeners:[{eventName:BI.TextButton.EVENT_CHANGE,action:function(){self.fireEvent(BI.TimePopup.BUTTON_CLEAR_EVENT_CHANGE)}}]},{type:"bi.text_button",cls:"bi-split-left bi-split-right bi-high-light bi-split-top",shadow:!0,text:BI.i18nText("BI-Basic_Now"),listeners:[{eventName:BI.TextButton.EVENT_CHANGE,action:function(){self.fireEvent(BI.TimePopup.BUTTON_NOW_EVENT_CHANGE)}}]},{type:"bi.text_button",cls:"bi-high-light bi-split-top",shadow:!0,text:BI.i18nText("BI-Basic_OK"),listeners:[{eventName:BI.TextButton.EVENT_CHANGE,action:function(){self.fireEvent(BI.TimePopup.BUTTON_OK_EVENT_CHANGE)}}]}]]},height:24}]}},setValue:function(value){this._checkValueValid(value)?this.timeSelect.setValue():this.timeSelect.setValue({hour:value.hour,minute:value.minute,second:value.second})},getValue:function(){return this.timeSelect.getValue()},_checkValueValid:function(value){return BI.isNull(value)||BI.isEmptyObject(value)||BI.isEmptyString(value)}}),BI.TimePopup.BUTTON_OK_EVENT_CHANGE="BUTTON_OK_EVENT_CHANGE",BI.TimePopup.BUTTON_CLEAR_EVENT_CHANGE="BUTTON_CLEAR_EVENT_CHANGE",BI.TimePopup.BUTTON_NOW_EVENT_CHANGE="BUTTON_NOW_EVENT_CHANGE",BI.TimePopup.CALENDAR_EVENT_CHANGE="CALENDAR_EVENT_CHANGE",BI.shortcut("bi.time_popup",BI.TimePopup)}(),!function(){BI.TimeCombo=BI.inherit(BI.Single,{constants:{popupHeight:80,popupWidth:240,comboAdjustHeight:1,border:1},props:{baseCls:"bi-time-combo bi-border bi-border-radius bi-focus-shadow",width:78,height:22,format:"",allowEdit:!1},render:function(){var self=this,opts=this.options;this.storeTriggerValue="",this.storeValue=opts.value;var popup={type:"bi.time_popup",value:opts.value,listeners:[{eventName:BI.TimePopup.BUTTON_CLEAR_EVENT_CHANGE,action:function(){self.setValue(),self.hidePopupView(),self.fireEvent(BI.TimeCombo.EVENT_CONFIRM)}},{eventName:BI.TimePopup.BUTTON_OK_EVENT_CHANGE,action:function(){self.setValue(self.popup.getValue()),self.hidePopupView(),self.fireEvent(BI.TimeCombo.EVENT_CONFIRM)}},{eventName:BI.TimePopup.BUTTON_NOW_EVENT_CHANGE,action:function(){self._setNowTime()}}],ref:function(_ref){self.popup=_ref}};return{type:"bi.htape",items:[{type:"bi.absolute",items:[{el:{type:"bi.combo",container:opts.container,toggle:!1,isNeedAdjustHeight:!1,isNeedAdjustWidth:!1,el:{type:"bi.time_trigger",height:opts.height,allowEdit:opts.allowEdit,watermark:opts.watermark,format:opts.format,value:opts.value,ref:function(_ref){self.trigger=_ref},listeners:[{eventName:"EVENT_KEY_DOWN",action:function(){self.combo.isViewVisible()&&self.combo.hideView(),self.fireEvent(BI.TimeCombo.EVENT_KEY_DOWN,arguments)}},{eventName:"EVENT_STOP",action:function(){self.combo.isViewVisible()||self.combo.showView()}},{eventName:"EVENT_FOCUS",action:function(){self.storeTriggerValue=self.trigger.getKey(),self.combo.isViewVisible()||self.combo.showView(),self.fireEvent("EVENT_FOCUS")}},{eventName:"EVENT_BLUR",action:function(){self.fireEvent("EVENT_BLUR")}},{eventName:"EVENT_ERROR",action:function(){var date=BI.getDate();self.storeValue={hour:date.getHours(),minute:date.getMinutes(),second:date.getSeconds()},self.fireEvent("EVENT_ERROR")}},{eventName:"EVENT_VALID",action:function(){self.fireEvent("EVENT_VALID")}},{eventName:"EVENT_CHANGE",action:function(){self.fireEvent("EVENT_CHANGE")}},{eventName:"EVENT_CONFIRM",action:function(){if(!self.combo.isViewVisible()){var dateStore=self.storeTriggerValue,dateObj=self.trigger.getKey();BI.isNotEmptyString(dateObj)&&!BI.isEqual(dateObj,dateStore)?(self.storeValue=self.trigger.getValue(),self.setValue(self.trigger.getValue())):BI.isEmptyString(dateObj)&&(self.storeValue=null,self.trigger.setValue()),self.fireEvent("EVENT_CONFIRM")}}}]},adjustLength:this.constants.comboAdjustHeight,popup:{el:popup,width:this.constants.popupWidth,stopPropagation:!1},hideChecker:function(e){return 0===self.triggerBtn.element.find(e.target).length},listeners:[{eventName:BI.Combo.EVENT_BEFORE_POPUPVIEW,action:function(){self.popup.setValue(self.storeValue),self.fireEvent(BI.TimeCombo.EVENT_BEFORE_POPUPVIEW)}}],ref:function(_ref){self.combo=_ref}},top:0,left:0,right:22,bottom:0},{el:{type:"bi.icon_button",cls:"bi-trigger-icon-button time-font icon-size-16",width:22,height:22,listeners:[{eventName:BI.IconButton.EVENT_CHANGE,action:function(){self.combo.isViewVisible()||self.combo.showView()}}],ref:function(_ref){self.triggerBtn=_ref}},top:0,right:0}]}]}},setValue:function(v){this.storeValue=v,this.trigger.setValue(v)},getValue:function(){return this.storeValue},hidePopupView:function(){this.combo.hideView()},_setNowTime:function(){var date=BI.getDate(),nowTome={hour:date.getHours(),minute:date.getMinutes(),second:date.getSeconds()};this.setValue(nowTome),this.hidePopupView(),this.fireEvent(BI.TimeCombo.EVENT_CONFIRM)}}),BI.TimeCombo.EVENT_KEY_DOWN="EVENT_KEY_DOWN",BI.TimeCombo.EVENT_CONFIRM="EVENT_CONFIRM",BI.TimeCombo.EVENT_CHANGE="EVENT_CHANGE",BI.TimeCombo.EVENT_VALID="EVENT_VALID",BI.TimeCombo.EVENT_ERROR="EVENT_ERROR",BI.TimeCombo.EVENT_BEFORE_POPUPVIEW="EVENT_BEFORE_POPUPVIEW",BI.shortcut("bi.time_combo",BI.TimeCombo)}(),!function(){BI.TimeTrigger=BI.inherit(BI.Trigger,{_const:{COMPARE_FORMAT:"%H:%M:%S",COMPLETE_COMPARE_FORMAT:"%Y-%M-%d %H:%M:%S %P",FORMAT_ARRAY:["%H:%M:%S","%I:%M:%S","%l:%M:%S","%k:%M:%S","%l:%M:%S %p","%l:%M:%S %P","%H:%M:%S %p","%H:%M:%S %P","%l:%M","%k:%M","%I:%M","%H:%M","%M:%S"],DEFAULT_DATE_STRING:"2000-01-01"},props:{extraCls:"bi-time-trigger",value:{},format:"",allowEdit:!1},render:function(){var self=this,o=this.options;return this.storeTriggerValue="",this.storeValue=o.value,{type:"bi.absolute",items:[{el:{type:"bi.sign_editor",height:o.height,validationChecker:function(v){return self._dateCheck(v)},quitChecker:function(){return!1},ref:function(_ref){self.editor=_ref},value:this._formatValue(o.value),hgap:4,allowBlank:!0,watermark:BI.isKey(o.watermark)?o.watermark:BI.i18nText("BI-Basic_Unrestricted"),title:BI.bind(this._getTitle,this),listeners:[{eventName:"EVENT_KEY_DOWN",action:function(){self.fireEvent("EVENT_KEY_DOWN",arguments)}},{eventName:"EVENT_FOCUS",action:function(){self.storeTriggerValue=self.getKey(),self.fireEvent("EVENT_FOCUS")}},{eventName:"EVENT_BLUR",action:function(){self.fireEvent("EVENT_BLUR")}},{eventName:"EVENT_STOP",action:function(){self.fireEvent("EVENT_STOP")}},{eventName:"EVENT_VALID",action:function(){self.fireEvent("EVENT_VALID")}},{eventName:"EVENT_ERROR",action:function(){self.fireEvent("EVENT_ERROR")}},{eventName:"EVENT_CONFIRM",action:function(){var value=self.editor.getValue();if(BI.isNotNull(value)&&self.editor.setState(value),BI.isNotEmptyString(value)&&!BI.isEqual(self.storeTriggerValue,self.getKey())){var date=value.match(/\d+/g);self.storeValue={hour:0|date[0],minute:0|date[1],second:0|date[2]}}self.fireEvent("EVENT_CONFIRM")}},{eventName:"EVENT_START",action:function(){self.fireEvent("EVENT_START")}},{eventName:"EVENT_CHANGE",action:function(){self.fireEvent("EVENT_CHANGE")}}]},left:0,right:0,top:0,bottom:0},{el:{type:"bi.text",invisible:o.allowEdit,cls:"show-text",title:BI.bind(this._getTitle,this),hgap:4},left:0,right:0,top:0,bottom:0}]}},_dateCheck:function(date){var c=this._const;return BI.any(c.FORMAT_ARRAY,function(idx,format){return BI.print(BI.parseDateTime(c.DEFAULT_DATE_STRING+" "+date,c.COMPLETE_COMPARE_FORMAT),format)===date})},_getTitle:function(){var storeValue=this.storeValue||{},date=BI.getDate();return BI.print(BI.getDate(date.getFullYear(),0,1,storeValue.hour,storeValue.minute,storeValue.second),this._getFormatString())},_getFormatString:function(){return this.options.format||this._const.COMPARE_FORMAT},_formatValue:function(v){var now=BI.getDate();return BI.isNotEmptyObject(v)?BI.print(BI.getDate(now.getFullYear(),now.getMonth(),now.getDay(),v.hour,v.minute,v.second),this._getFormatString()):""},getKey:function(){return this.editor.getValue()},setValue:function(v){this.storeValue=v,this.editor.setValue(this._formatValue(v))},getValue:function(){return this.storeValue}}),BI.shortcut("bi.time_trigger",BI.TimeTrigger)}(),BI.DateInterval=BI.inherit(BI.Single,{constants:{height:24,width:24,lgap:15,offset:0,timeErrorCls:"time-error"},_defaultConfig:function(){var conf=BI.DateInterval.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{extraCls:"bi-date-interval",minDate:"1900-01-01",maxDate:"2099-12-31"})},_init:function(){var self=this,o=this.options;BI.DateInterval.superclass._init.apply(this,arguments),o.value=o.value||{},this.left=this._createCombo(o.value.start),this.right=this._createCombo(o.value.end),this.label=BI.createWidget({type:"bi.label",height:this.constants.height,width:this.constants.width,text:"-"}),BI.createWidget({element:self,type:"bi.center",height:this.constants.height,items:[{type:"bi.absolute",items:[{el:self.left,left:this.constants.offset,right:this.constants.width/2,top:0,bottom:0}]},{type:"bi.absolute",items:[{el:self.right,left:this.constants.width/2,right:this.constants.offset,top:0,bottom:0}]}]}),BI.createWidget({type:"bi.horizontal_auto",element:this,items:[self.label]})},_createCombo:function(v){var self=this,o=this.options,combo=BI.createWidget({type:"bi.dynamic_date_combo",behaviors:o.behaviors,value:v});return combo.on(BI.DynamicDateCombo.EVENT_ERROR,function(){self._clearTitle(),BI.Bubbles.hide("error"),self.element.removeClass(self.constants.timeErrorCls),self.fireEvent(BI.DateInterval.EVENT_ERROR)}),combo.on(BI.DynamicDateCombo.EVENT_VALID,function(){BI.Bubbles.hide("error");var smallDate=self.left.getKey(),bigDate=self.right.getKey();self._check(smallDate,bigDate)&&self._compare(smallDate,bigDate)?(self._setTitle(BI.i18nText("BI-Time_Interval_Error_Text")),self.element.addClass(self.constants.timeErrorCls),BI.Bubbles.show("error",BI.i18nText("BI-Time_Interval_Error_Text"),self,{offsetStyle:"center"}),self.fireEvent(BI.DateInterval.EVENT_ERROR)):(self._clearTitle(),self.element.removeClass(self.constants.timeErrorCls))}),combo.on(BI.DynamicDateCombo.EVENT_FOCUS,function(){BI.Bubbles.hide("error");var smallDate=self.left.getKey(),bigDate=self.right.getKey();self._check(smallDate,bigDate)&&self._compare(smallDate,bigDate)?(self._setTitle(BI.i18nText("BI-Time_Interval_Error_Text")),self.element.addClass(self.constants.timeErrorCls),BI.Bubbles.show("error",BI.i18nText("BI-Time_Interval_Error_Text"),self,{offsetStyle:"center"}),self.fireEvent(BI.DateInterval.EVENT_ERROR)):(self._clearTitle(),self.element.removeClass(self.constants.timeErrorCls))}),combo.on(BI.DynamicDateCombo.EVENT_BEFORE_POPUPVIEW,function(){self.left.hidePopupView(),self.right.hidePopupView()}),combo.on(BI.DynamicDateCombo.EVENT_CONFIRM,function(){BI.Bubbles.hide("error");var smallDate=self.left.getKey(),bigDate=self.right.getKey();self._check(smallDate,bigDate)&&self._compare(smallDate,bigDate)?(self._setTitle(BI.i18nText("BI-Time_Interval_Error_Text")),self.element.addClass(self.constants.timeErrorCls),self.fireEvent(BI.DateInterval.EVENT_ERROR)):(self._clearTitle(),self.element.removeClass(self.constants.timeErrorCls),self.fireEvent(BI.DateInterval.EVENT_CHANGE))}),combo},_dateCheck:function(date){return BI.print(BI.parseDateTime(date,"%Y-%x-%d"),"%Y-%x-%d")===date||BI.print(BI.parseDateTime(date,"%Y-%X-%d"),"%Y-%X-%d")===date||BI.print(BI.parseDateTime(date,"%Y-%x-%e"),"%Y-%x-%e")===date||BI.print(BI.parseDateTime(date,"%Y-%X-%e"),"%Y-%X-%e")===date},_checkVoid:function(obj){var o=this.options;return!BI.checkDateVoid(obj.year,obj.month,obj.day,o.minDate,o.maxDate)[0]},_check:function(smallDate,bigDate){var smallObj=smallDate.match(/\d+/g),bigObj=bigDate.match(/\d+/g);return this._dateCheck(smallDate)&&BI.checkDateLegal(smallDate)&&this._checkVoid({year:smallObj[0],month:smallObj[1],day:smallObj[2]})&&this._dateCheck(bigDate)&&BI.checkDateLegal(bigDate)&&this._checkVoid({year:bigObj[0],month:bigObj[1],day:bigObj[2]})},_compare:function(smallDate,bigDate){return smallDate=BI.print(BI.parseDateTime(smallDate,"%Y-%X-%d"),"%Y-%X-%d"),bigDate=BI.print(BI.parseDateTime(bigDate,"%Y-%X-%d"),"%Y-%X-%d"),BI.isNotNull(smallDate)&&BI.isNotNull(bigDate)&&smallDate>bigDate},_setTitle:function(v){this.left.setTitle(v),this.right.setTitle(v),this.label.setTitle(v)},_clearTitle:function(){this.left.setTitle(""),this.right.setTitle(""),this.label.setTitle("")},setValue:function(date){date=date||{},this.left.setValue(date.start),this.right.setValue(date.end)},getValue:function(){return{start:this.left.getValue(),end:this.right.getValue()}}}),BI.DateInterval.EVENT_VALID="EVENT_VALID",BI.DateInterval.EVENT_ERROR="EVENT_ERROR",BI.DateInterval.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.date_interval",BI.DateInterval),BI.TimeInterval=BI.inherit(BI.Single,{constants:{height:24,width:24,lgap:15,offset:0,timeErrorCls:"time-error"},_defaultConfig:function(){var conf=BI.TimeInterval.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{extraCls:"bi-time-interval",minDate:"1900-01-01",maxDate:"2099-12-31"})},_init:function(){var self=this,o=this.options;BI.TimeInterval.superclass._init.apply(this,arguments),o.value=o.value||{},this.left=this._createCombo(o.value.start),this.right=this._createCombo(o.value.end),this.label=BI.createWidget({type:"bi.label",height:this.constants.height,width:this.constants.width,text:"-"}),BI.createWidget({element:self,type:"bi.center",height:this.constants.height,items:[{type:"bi.absolute",items:[{el:self.left,left:this.constants.offset,right:this.constants.width/2,top:0,bottom:0}]},{type:"bi.absolute",items:[{el:self.right,left:this.constants.width/2,right:this.constants.offset,top:0,bottom:0}]}]}),BI.createWidget({type:"bi.horizontal_auto",element:this,items:[self.label]})},_createCombo:function(v){var self=this,o=this.options,combo=BI.createWidget({type:"bi.dynamic_date_time_combo",behaviors:o.behaviors,value:v});return combo.on(BI.DynamicDateTimeCombo.EVENT_ERROR,function(){self._clearTitle(),BI.Bubbles.hide("error"),self.element.removeClass(self.constants.timeErrorCls),self.fireEvent(BI.TimeInterval.EVENT_ERROR)}),combo.on(BI.DynamicDateTimeCombo.EVENT_VALID,function(){BI.Bubbles.hide("error");var smallDate=self.left.getKey(),bigDate=self.right.getKey();self.left.isValid()&&self.right.isValid()&&self._check(smallDate,bigDate)&&self._compare(smallDate,bigDate)?(self._setTitle(BI.i18nText("BI-Time_Interval_Error_Text")),self.element.addClass(self.constants.timeErrorCls),BI.Bubbles.show("error",BI.i18nText("BI-Time_Interval_Error_Text"),self,{offsetStyle:"center"}),self.fireEvent(BI.TimeInterval.EVENT_ERROR)):(self._clearTitle(),self.element.removeClass(self.constants.timeErrorCls))}),combo.on(BI.DynamicDateTimeCombo.EVENT_FOCUS,function(){BI.Bubbles.hide("error");var smallDate=self.left.getKey(),bigDate=self.right.getKey();self.left.isValid()&&self.right.isValid()&&self._check(smallDate,bigDate)&&self._compare(smallDate,bigDate)?(self._setTitle(BI.i18nText("BI-Time_Interval_Error_Text")),self.element.addClass(self.constants.timeErrorCls),BI.Bubbles.show("error",BI.i18nText("BI-Time_Interval_Error_Text"),self,{offsetStyle:"center"}),self.fireEvent(BI.TimeInterval.EVENT_ERROR)):(self._clearTitle(),self.element.removeClass(self.constants.timeErrorCls))}),combo.on(BI.DynamicDateTimeCombo.EVENT_BEFORE_POPUPVIEW,function(){self.left.hidePopupView(),self.right.hidePopupView()}),combo.on(BI.DynamicDateTimeCombo.EVENT_CONFIRM,function(){BI.Bubbles.hide("error");var smallDate=self.left.getKey(),bigDate=self.right.getKey();self.left.isValid()&&self.right.isValid()&&self._check(smallDate,bigDate)&&self._compare(smallDate,bigDate)?(self._setTitle(BI.i18nText("BI-Time_Interval_Error_Text")),self.element.addClass(self.constants.timeErrorCls),self.fireEvent(BI.TimeInterval.EVENT_ERROR)):(self._clearTitle(),self.element.removeClass(self.constants.timeErrorCls),self.fireEvent(BI.TimeInterval.EVENT_CHANGE))}),combo},_dateCheck:function(date){return BI.print(BI.parseDateTime(date,"%Y-%x-%d %H:%M:%S"),"%Y-%x-%d %H:%M:%S")===date||BI.print(BI.parseDateTime(date,"%Y-%X-%d %H:%M:%S"),"%Y-%X-%d %H:%M:%S")===date||BI.print(BI.parseDateTime(date,"%Y-%x-%e %H:%M:%S"),"%Y-%x-%e %H:%M:%S")===date||BI.print(BI.parseDateTime(date,"%Y-%X-%e %H:%M:%S"),"%Y-%X-%e %H:%M:%S")===date},_checkVoid:function(obj){var o=this.options;return!BI.checkDateVoid(obj.year,obj.month,obj.day,o.minDate,o.maxDate)[0]},_check:function(smallDate,bigDate){var smallObj=smallDate.match(/\d+/g),bigObj=bigDate.match(/\d+/g);return this._dateCheck(smallDate)&&BI.checkDateLegal(smallDate)&&this._checkVoid({year:smallObj[0],month:smallObj[1],day:smallObj[2]})&&this._dateCheck(bigDate)&&BI.checkDateLegal(bigDate)&&this._checkVoid({year:bigObj[0],month:bigObj[1],day:bigObj[2]})},_compare:function(smallDate,bigDate){return smallDate=BI.print(BI.parseDateTime(smallDate,"%Y-%X-%d %H:%M:%S"),"%Y-%X-%d %H:%M:%S"),bigDate=BI.print(BI.parseDateTime(bigDate,"%Y-%X-%d %H:%M:%S"),"%Y-%X-%d %H:%M:%S"),BI.isNotNull(smallDate)&&BI.isNotNull(bigDate)&&smallDate>bigDate},_setTitle:function(v){this.left.setTitle(v),this.right.setTitle(v),this.label.setTitle(v)},_clearTitle:function(){this.left.setTitle(""),this.right.setTitle(""),this.label.setTitle("")},setValue:function(date){date=date||{},this.left.setValue(date.start),this.right.setValue(date.end)},getValue:function(){return{start:this.left.getValue(),end:this.right.getValue()}}}),BI.TimeInterval.EVENT_VALID="EVENT_VALID",BI.TimeInterval.EVENT_ERROR="EVENT_ERROR",BI.TimeInterval.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.time_interval",BI.TimeInterval),!function(){BI.TimePeriods=BI.inherit(BI.Single,{constants:{height:24,width:24,lgap:15,offset:0},props:{extraCls:"bi-time-interval",value:{}},render:function(){var self=this,o=this.options;return{type:"bi.absolute",height:this.constants.height,items:[{el:{type:"bi.horizontal_auto",items:[{type:"bi.label",height:this.constants.height,width:this.constants.width,text:"-",ref:function(_ref){self.label=_ref}}]},top:0,left:0,right:0,bottom:0},{el:{type:"bi.center",height:this.constants.height,items:[{type:"bi.absolute",items:[{el:BI.extend({ref:function(_ref){self.left=_ref}},this._createCombo(o.value.start)),left:this.constants.offset,right:this.constants.width/2,top:0,bottom:0}]},{type:"bi.absolute",items:[{el:BI.extend({ref:function(_ref){self.right=_ref}},this._createCombo(o.value.end)),left:this.constants.width/2,right:this.constants.offset,top:0,bottom:0}]}]},top:0,left:0,right:0,bottom:0}]}},_createCombo:function(v){var self=this;return{type:"bi.time_combo",value:v,listeners:[{eventName:BI.TimeCombo.EVENT_BEFORE_POPUPVIEW,action:function(){self.left.hidePopupView(),self.right.hidePopupView()}},{eventName:BI.TimeCombo.EVENT_CHANGE,action:function(){self.fireEvent(BI.TimePeriods.EVENT_CHANGE)}},{eventName:BI.TimeCombo.EVENT_CONFIRM,action:function(){self.fireEvent(BI.TimePeriods.EVENT_CONFIRM)}}]}},setValue:function(date){date=date||{},this.left.setValue(date.start),this.right.setValue(date.end)},getValue:function(){return{start:this.left.getValue(),end:this.right.getValue()}}}),BI.TimePeriods.EVENT_CONFIRM="EVENT_CONFIRM",BI.TimePeriods.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.time_periods",BI.TimePeriods)}(),BI.DynamicYearCard=BI.inherit(BI.Widget,{props:{baseCls:"bi-year-card"},render:function(){var self=this;return{type:"bi.vertical",items:[{type:"bi.label",text:BI.i18nText("BI-Multi_Date_Relative_Current_Time"),textAlign:"left",height:24},{type:"bi.dynamic_date_param_item",ref:function(){self.item=this},listeners:[{eventName:"EVENT_CHANGE",action:function(){self.fireEvent("EVENT_CHANGE")}}]}],vgap:10,hgap:10}},_createValue:function(type,v){return{dateType:type,value:Math.abs(v),offset:v>0?1:0}},setValue:function(v){v=v||{year:0},this.item.setValue(this._createValue(BI.DynamicDateCard.TYPE.YEAR,v.year))},getValue:function(){var value=this.item.getValue();return{year:0===value.offset?-value.value:value.value}}}),BI.DynamicYearCard.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.dynamic_year_card",BI.DynamicYearCard),BI.StaticYearCard=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.StaticYearCard.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-year-card",behaviors:{},min:"1900-01-01",max:"2099-12-31"})},_createYearCalendar:function(v){var o=this.options,y=this._year,calendar=BI.createWidget({type:"bi.year_calendar",behaviors:o.behaviors,min:o.min,max:o.max,logic:{dynamic:!0},year:y+12*v});return calendar.setValue(this._year),calendar},_init:function(){BI.StaticYearCard.superclass._init.apply(this,arguments);var self=this,o=this.options;this.selectedYear=this._year=BI.getDate().getFullYear(),this.backBtn=BI.createWidget({type:"bi.icon_button",cls:"pre-page-h-font",width:25,height:25,value:-1,listeners:[{eventName:BI.IconButton.EVENT_CHANGE,action:function(){self.navigation.setSelect(self.navigation.getSelect()-1),self._checkLeftValid(),self._checkRightValid()}}]}),this.preBtn=BI.createWidget({type:"bi.icon_button",cls:"next-page-h-font",width:25,height:25,value:1,listeners:[{eventName:BI.IconButton.EVENT_CHANGE,action:function(){self.navigation.setSelect(self.navigation.getSelect()+1),self._checkLeftValid(),self._checkRightValid()}}]}),this.navigation=BI.createWidget({type:"bi.navigation",direction:"top",element:this,single:!0,logic:{dynamic:!0},tab:{type:"bi.htape",cls:"bi-split-top bi-split-bottom",height:30,items:[{el:{type:"bi.center_adapt",items:[self.backBtn]},width:25},{type:"bi.layout"},{el:{type:"bi.center_adapt",items:[self.preBtn]},width:25}]},cardCreator:BI.bind(this._createYearCalendar,this),afterCardShow:function(){this.setValue(self.selectedYear);var calendar=this.getSelectedCard();self.backBtn.setEnable(!calendar.isFrontYear()),self.preBtn.setEnable(!calendar.isFinalYear())}}),this.navigation.on(BI.Navigation.EVENT_CHANGE,function(){self.selectedYear=this.getValue(),self.fireEvent(BI.Controller.EVENT_CHANGE,arguments),self.fireEvent(BI.StaticYearCard.EVENT_CHANGE,self.selectedYear)}),BI.isKey(o.value)&&this.setValue(o.value)},_checkLeftValid:function(){var o=this.options,valid=!0;return this.backBtn.setEnable(valid),valid},_checkRightValid:function(){var o=this.options,valid=!0;return this.preBtn.setEnable(valid),valid},getValue:function(){return{year:this.selectedYear}},setValue:function(obj){var o=this.options;obj=obj||{};var v=obj.year;BI.checkDateVoid(v,1,1,o.min,o.max)[0]?(v=BI.getDate().getFullYear(),this.selectedYear="",this.navigation.setSelect(BI.YearCalendar.getPageByYear(v)),this.navigation.setValue("")):(this.selectedYear=BI.parseInt(v),this.navigation.setSelect(BI.YearCalendar.getPageByYear(v)),this.navigation.setValue(this.selectedYear)),this._checkLeftValid(),this._checkRightValid()}}),BI.StaticYearCard.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.static_year_card",BI.StaticYearCard),BI.DynamicYearCombo=BI.inherit(BI.Widget,{props:{baseCls:"bi-year-combo bi-border bi-focus-shadow",behaviors:{},min:"1900-01-01",max:"2099-12-31",height:22},_init:function(){BI.DynamicYearCombo.superclass._init.apply(this,arguments);var self=this,o=this.options;this.storeValue=o.value,this.trigger=BI.createWidget({type:"bi.dynamic_year_trigger",min:o.min,max:o.max,height:o.height,value:o.value||""}),this.trigger.on(BI.DynamicYearTrigger.EVENT_FOCUS,function(){self.storeTriggerValue=this.getKey()}),this.trigger.on(BI.DynamicYearTrigger.EVENT_START,function(){self.combo.isViewVisible()&&self.combo.hideView()}),this.trigger.on(BI.DynamicYearTrigger.EVENT_STOP,function(){self.combo.showView()}),this.trigger.on(BI.DynamicYearTrigger.EVENT_ERROR,function(){self.combo.isViewVisible()&&self.combo.hideView()}),this.trigger.on(BI.DynamicYearTrigger.EVENT_CONFIRM,function(){self.combo.isViewVisible()||(this.getKey()&&this.getKey()!==self.storeTriggerValue?(self.storeValue=self.trigger.getValue(),self.setValue(self.storeValue)):this.getKey()||(self.storeValue=null,self.setValue()),self._checkDynamicValue(self.storeValue),self.fireEvent(BI.DynamicYearCombo.EVENT_CONFIRM))}),this.combo=BI.createWidget({type:"bi.combo",container:o.container,isNeedAdjustHeight:!1,isNeedAdjustWidth:!1,el:this.trigger,popup:{minWidth:85,stopPropagation:!1,el:{type:"bi.dynamic_year_popup",ref:function(){self.popup=this},listeners:[{eventName:BI.DynamicYearPopup.EVENT_CHANGE,action:function(){self.setValue(self.popup.getValue()),self.combo.hideView(),self.fireEvent(BI.DynamicYearCombo.EVENT_CONFIRM)}},{eventName:BI.DynamicYearPopup.BUTTON_CLEAR_EVENT_CHANGE,action:function(){self.setValue(),self.combo.hideView(),self.fireEvent(BI.DynamicYearCombo.EVENT_CONFIRM)}},{eventName:BI.DynamicYearPopup.BUTTON_lABEL_EVENT_CHANGE,action:function(){var date=BI.getDate();self.setValue({type:BI.DynamicYearCombo.Static,value:{year:date.getFullYear()}}),self.combo.hideView(),self.fireEvent(BI.DynamicDateCombo.EVENT_CONFIRM)}},{eventName:BI.DynamicYearPopup.BUTTON_OK_EVENT_CHANGE,action:function(){self.setValue(self.popup.getValue()),self.combo.hideView(),self.fireEvent(BI.DynamicDateCombo.EVENT_CONFIRM)}}],behaviors:o.behaviors,min:o.min,max:o.max},value:o.value||""}}),this.combo.on(BI.Combo.EVENT_BEFORE_POPUPVIEW,function(){self.popup.setValue(self.storeValue),self.fireEvent(BI.DynamicYearCombo.EVENT_BEFORE_POPUPVIEW)}),BI.createWidget({type:"bi.htape",element:this,ref:function(){self.comboWrapper=this},items:[{el:{type:"bi.icon_button",cls:"bi-trigger-icon-button date-change-h-font",width:24,height:24,ref:function(){self.changeIcon=this}},width:24},this.combo]}),this._checkDynamicValue(o.value)},_checkDynamicValue:function(v){var type=null;switch(BI.isNotNull(v)&&(type=v.type),type){case BI.DynamicYearCombo.Dynamic:this.changeIcon.setVisible(!0),this.comboWrapper.attr("items")[0].width=24,this.comboWrapper.resize();break;default:this.comboWrapper.attr("items")[0].width=0,this.comboWrapper.resize(),this.changeIcon.setVisible(!1)}},setValue:function(v){this.storeValue=v,this.trigger.setValue(v),this._checkDynamicValue(v)},getValue:function(){return this.storeValue}}),BI.DynamicYearCombo.EVENT_CONFIRM="EVENT_CONFIRM",BI.DynamicYearCombo.EVENT_BEFORE_POPUPVIEW="EVENT_BEFORE_POPUPVIEW",BI.shortcut("bi.dynamic_year_combo",BI.DynamicYearCombo),BI.extend(BI.DynamicYearCombo,{Static:1,Dynamic:2}),BI.DynamicYearPopup=BI.inherit(BI.Widget,{constants:{tabHeight:30,buttonHeight:24},props:{baseCls:"bi-year-popup",behaviors:{},min:"1900-01-01",max:"2099-12-31",width:180,height:240},render:function(){var self=this,opts=this.options,c=this.constants;return this.storeValue={type:BI.DynamicYearCombo.Static},{type:"bi.vtape",items:[{el:this._getTabJson()},{el:{type:"bi.grid",items:[[{type:"bi.text_button",cls:"bi-split-top bi-high-light",textHeight:c.buttonHeight-1,shadow:!0,text:BI.i18nText("BI-Basic_Clear"),listeners:[{eventName:BI.TextButton.EVENT_CHANGE,action:function(){self.fireEvent(BI.DynamicYearPopup.BUTTON_CLEAR_EVENT_CHANGE)}}]},{type:"bi.text_button",textHeight:c.buttonHeight-1,cls:"bi-split-left bi-split-right bi-high-light bi-split-top",shadow:!0,text:BI.i18nText("BI-Basic_Current_Year"),ref:function(){self.textButton=this},listeners:[{eventName:BI.TextButton.EVENT_CHANGE,action:function(){self.fireEvent(BI.DynamicYearPopup.BUTTON_lABEL_EVENT_CHANGE)}}]},{type:"bi.text_button",cls:"bi-split-top bi-high-light",textHeight:c.buttonHeight-1,shadow:!0,text:BI.i18nText("BI-Basic_OK"),listeners:[{eventName:BI.TextButton.EVENT_CHANGE,action:function(){self.fireEvent(BI.DynamicYearPopup.BUTTON_OK_EVENT_CHANGE)}}]}]]},height:24}]}},_setInnerValue:function(){if(this.dateTab.getSelect()===BI.DynamicDateCombo.Static)this.textButton.setValue(BI.i18nText("BI-Basic_Current_Year")),this.textButton.setEnable(!0);else{var date=BI.DynamicDateHelper.getCalculation(this.dynamicPane.getValue());date=BI.print(date,"%Y"),this.textButton.setValue(date),this.textButton.setEnable(!1)}},_getTabJson:function(){var self=this,o=this.options;return{type:"bi.tab",ref:function(){ +self.dateTab=this},tab:{type:"bi.linear_segment",cls:"bi-split-bottom",height:this.constants.tabHeight,items:BI.createItems([{text:BI.i18nText("BI-Basic_Year_Fen"),value:BI.DynamicYearCombo.Static},{text:BI.i18nText("BI-Basic_Dynamic_Title"),value:BI.DynamicYearCombo.Dynamic}],{textAlign:"center"})},cardCreator:function(v){switch(v){case BI.DynamicYearCombo.Dynamic:return{type:"bi.dynamic_year_card",listeners:[{eventName:"EVENT_CHANGE",action:function(){self._setInnerValue(self.year,v)}}],ref:function(){self.dynamicPane=this}};case BI.DynamicYearCombo.Static:default:return{type:"bi.static_year_card",behaviors:o.behaviors,min:self.options.min,max:self.options.max,listeners:[{eventName:BI.StaticYearCard.EVENT_CHANGE,action:function(){self.fireEvent(BI.DynamicYearPopup.EVENT_CHANGE)}}],ref:function(){self.year=this}}}},listeners:[{eventName:BI.Tab.EVENT_CHANGE,action:function(){var v=self.dateTab.getSelect();switch(v){case BI.DynamicYearCombo.Static:var date=BI.DynamicDateHelper.getCalculation(self.dynamicPane.getValue());self.year.setValue({year:date.getFullYear()}),self._setInnerValue();break;case BI.DynamicYearCombo.Dynamic:default:self.storeValue&&self.storeValue.type===BI.DynamicYearCombo.Dynamic?self.dynamicPane.setValue(self.storeValue.value):self.dynamicPane.setValue({year:0}),self._setInnerValue()}}}]}},setValue:function(v){this.storeValue=v;var self=this,type,value;switch(v=v||{},type=v.type||BI.DynamicDateCombo.Static,value=v.value||v,this.dateTab.setSelect(type),type){case BI.DynamicDateCombo.Dynamic:this.dynamicPane.setValue(value),self._setInnerValue();break;case BI.DynamicDateCombo.Static:default:this.year.setValue(value),this.textButton.setValue(BI.i18nText("BI-Basic_Current_Year")),this.textButton.setEnable(!0)}},getValue:function(){return{type:this.dateTab.getSelect(),value:this.dateTab.getValue()}}}),BI.DynamicYearPopup.BUTTON_CLEAR_EVENT_CHANGE="BUTTON_CLEAR_EVENT_CHANGE",BI.DynamicYearPopup.BUTTON_lABEL_EVENT_CHANGE="BUTTON_lABEL_EVENT_CHANGE",BI.DynamicYearPopup.BUTTON_OK_EVENT_CHANGE="BUTTON_OK_EVENT_CHANGE",BI.DynamicYearPopup.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.dynamic_year_popup",BI.DynamicYearPopup),BI.DynamicYearTrigger=BI.inherit(BI.Trigger,{_const:{hgap:4,vgap:2},_defaultConfig:function(){return BI.extend(BI.DynamicYearTrigger.superclass._defaultConfig.apply(this,arguments),{extraCls:"bi-year-trigger",min:"1900-01-01",max:"2099-12-31",height:24})},beforeInit:function(callback){var o=this.options;o.title=BI.bind(this._titleCreator,this),callback()},_init:function(){BI.DynamicYearTrigger.superclass._init.apply(this,arguments);var self=this,o=this.options,c=this._const;this.editor=BI.createWidget({type:"bi.sign_editor",height:o.height,validationChecker:function(v){return""===v||BI.isPositiveInteger(v)&&!BI.checkDateVoid(v,1,1,o.min,o.max)[0]},quitChecker:function(v){return!1},hgap:c.hgap,vgap:c.vgap,watermark:BI.i18nText("BI-Basic_Unrestricted"),allowBlank:!0,errorText:function(){return BI.i18nText("BI-Year_Trigger_Invalid_Text")}}),this.editor.on(BI.SignEditor.EVENT_FOCUS,function(){self.fireEvent(BI.DynamicYearTrigger.EVENT_FOCUS)}),this.editor.on(BI.SignEditor.EVENT_STOP,function(){self.fireEvent(BI.DynamicYearTrigger.EVENT_STOP)}),this.editor.on(BI.SignEditor.EVENT_CONFIRM,function(){var value=self.editor.getValue();BI.isNotNull(value)&&self.editor.setValue(value),BI.isNotEmptyString(value)&&(self.storeValue={type:BI.DynamicDateCombo.Static,value:{year:value}}),self.fireEvent(BI.DynamicYearTrigger.EVENT_CONFIRM)}),this.editor.on(BI.SignEditor.EVENT_SPACE,function(){self.editor.isValid()&&self.editor.blur()}),this.editor.on(BI.SignEditor.EVENT_START,function(){self.fireEvent(BI.DynamicYearTrigger.EVENT_START)}),this.editor.on(BI.SignEditor.EVENT_ERROR,function(){self.fireEvent(BI.DynamicYearTrigger.EVENT_ERROR)}),BI.createWidget({element:this,type:"bi.htape",items:[{el:this.editor},{el:{type:"bi.text_button",baseCls:"bi-trigger-year-text",text:BI.i18nText("BI-Multi_Date_Year"),width:o.height},width:o.height},{el:{type:"bi.trigger_icon_button",width:o.height},width:o.height}]}),this.setValue(o.value)},_getText:function(obj){var value="";return BI.isNotNull(obj.year)&&0!==BI.parseInt(obj.year)&&(value+=Math.abs(obj.year)+BI.i18nText("BI-Basic_Year")+(obj.year<0?BI.i18nText("BI-Basic_Front"):BI.i18nText("BI-Basic_Behind"))),value},_setInnerValue:function(date,text){var dateStr=BI.print(date,"%Y");this.editor.setState(dateStr),this.editor.setValue(dateStr)},_titleCreator:function(){var storeValue=this.storeValue||{},type=storeValue.type||BI.DynamicDateCombo.Static,value=storeValue.value;if(!this.editor.isValid())return"";switch(type){case BI.DynamicDateCombo.Dynamic:var text=this._getText(value),date=BI.getDate();date=BI.DynamicDateHelper.getCalculation(value);var dateStr=BI.print(date,"%Y");return BI.isEmptyString(text)?dateStr:text+":"+dateStr;case BI.DynamicDateCombo.Static:default:return value=value||{},value.year}},setValue:function(v){var type,value,date=BI.getDate();switch(this.storeValue=v,BI.isNotNull(v)&&(type=v.type||BI.DynamicDateCombo.Static,value=v.value||v),type){case BI.DynamicDateCombo.Dynamic:var text=this._getText(value);date=BI.DynamicDateHelper.getCalculation(value),this._setInnerValue(date,text);break;case BI.DynamicDateCombo.Static:default:value=value||{},this.editor.setState(value.year),this.editor.setValue(value.year)}},getValue:function(){return this.storeValue},getKey:function(){return 0|this.editor.getValue()}}),BI.DynamicYearTrigger.EVENT_FOCUS="EVENT_FOCUS",BI.DynamicYearTrigger.EVENT_ERROR="EVENT_ERROR",BI.DynamicYearTrigger.EVENT_START="EVENT_START",BI.DynamicYearTrigger.EVENT_CONFIRM="EVENT_CONFIRM",BI.DynamicYearTrigger.EVENT_STOP="EVENT_STOP",BI.shortcut("bi.dynamic_year_trigger",BI.DynamicYearTrigger),BI.DynamicYearMonthCard=BI.inherit(BI.Widget,{props:{baseCls:"bi-year-month-card"},render:function(){var self=this;return{type:"bi.vertical",items:[{type:"bi.label",text:BI.i18nText("BI-Multi_Date_Relative_Current_Time"),textAlign:"left",height:24},{type:"bi.dynamic_date_param_item",ref:function(){self.year=this},listeners:[{eventName:"EVENT_CHANGE",action:function(){self.fireEvent("EVENT_CHANGE")}}]},{type:"bi.dynamic_date_param_item",dateType:BI.DynamicDateCard.TYPE.MONTH,ref:function(){self.month=this},listeners:[{eventName:"EVENT_CHANGE",action:function(){self.fireEvent("EVENT_CHANGE")}}]}],vgap:10,hgap:10}},_createValue:function(type,v){return{dateType:type,value:Math.abs(v),offset:v>0?1:0}},setValue:function(v){v=v||{year:0,month:0},this.year.setValue(this._createValue(BI.DynamicDateCard.TYPE.YEAR,v.year)),this.month.setValue(this._createValue(BI.DynamicDateCard.TYPE.MONTH,v.month))},getValue:function(){var year=this.year.getValue(),month=this.month.getValue();return{year:0===year.offset?-year.value:year.value,month:0===month.offset?-month.value:month.value}}}),BI.DynamicYearMonthCard.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.dynamic_year_month_card",BI.DynamicYearMonthCard),BI.StaticYearMonthCard=BI.inherit(BI.Widget,{props:{baseCls:"bi-static-year-month-card",behaviors:{}},_createMonths:function(){var self=this,month=[1,7,2,8,3,9,4,10,5,11,6,12],items=[];return items.push(month.slice(0,2)),items.push(month.slice(2,4)),items.push(month.slice(4,6)),items.push(month.slice(6,8)),items.push(month.slice(8,10)),items.push(month.slice(10,12)),BI.map(items,function(i,item){return BI.map(item,function(j,td){return{type:"bi.text_item",cls:"bi-list-item-select",textAlign:"center",whiteSpace:"nowrap",once:!1,forceSelected:!0,height:23,width:38,value:td,text:td,ref:function(_ref){self.monthMap[0===j?i:i+6]=_ref}}})})},render:function(){var self=this,o=this.options;return this.monthMap={},{type:"bi.vertical",items:[{type:"bi.year_picker",min:o.min,max:o.max,ref:function(){self.yearPicker=this},behaviors:o.behaviors,height:30,listeners:[{eventName:BI.YearPicker.EVENT_CHANGE,action:function(){var value=this.getValue();self._checkMonthStatus(value),self.setValue({year:value,month:self.selectedMonth})}}]},{type:"bi.button_group",cls:"bi-split-top",behaviors:o.behaviors,ref:function(){self.month=this},items:this._createMonths(),layouts:[BI.LogicFactory.createLogic("table",BI.extend({dynamic:!0},{columns:2,rows:6,columnSize:[.5,.5],rowSize:25})),{type:"bi.center_adapt",vgap:1,hgap:2}],value:o.value,listeners:[{eventName:BI.ButtonGroup.EVENT_CHANGE,action:function(){self.selectedYear=self.yearPicker.getValue(),self.selectedMonth=this.getValue()[0],self.fireEvent(BI.StaticYearMonthCard.EVENT_CHANGE)}}]}]}},mounted:function(){this._checkMonthStatus(this.selectedYear)},_checkMonthStatus:function(year){var o=this.options,minDate=BI.parseDateTime(o.min,"%Y-%X-%d"),maxDate=BI.parseDateTime(o.max,"%Y-%X-%d"),minYear=minDate.getFullYear(),maxYear=maxDate.getFullYear(),minMonth=0,maxMonth=11;minYear===year&&(minMonth=minDate.getMonth()),maxYear===year&&(maxMonth=maxDate.getMonth());var yearInvalid=yearmaxYear;BI.each(this.monthMap,function(month,obj){var monthInvalid=monthmaxMonth;obj.setEnable(!yearInvalid&&!monthInvalid)})},getValue:function(){return{year:this.selectedYear,month:this.selectedMonth}},setValue:function(obj){var o=this.options,newObj={};if(newObj.year=obj.year||0,newObj.month=obj.month||0,0===newObj.year||0===newObj.month||BI.checkDateVoid(newObj.year,newObj.month,1,o.min,o.max)[0]){var year=newObj.year||BI.getDate().getFullYear();this.selectedYear=year,this.selectedMonth="",this.yearPicker.setValue(year),this.month.setValue()}else this.selectedYear=BI.parseInt(newObj.year),this.selectedMonth=BI.parseInt(newObj.month),this.yearPicker.setValue(this.selectedYear),this.month.setValue(this.selectedMonth)}}),BI.StaticYearMonthCard.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.static_year_month_card",BI.StaticYearMonthCard),BI.DynamicYearMonthCombo=BI.inherit(BI.Single,{props:{baseCls:"bi-year-month-combo bi-border bi-focus-shadow",behaviors:{},minDate:"1900-01-01",maxDate:"2099-12-31",height:22},_init:function(){BI.DynamicYearMonthCombo.superclass._init.apply(this,arguments);var self=this,o=this.options;this.storeValue=o.value,this.storeTriggerValue="",this.trigger=BI.createWidget({type:"bi.dynamic_year_month_trigger",min:o.minDate,max:o.maxDate,height:o.height,value:o.value||""}),this.trigger.on(BI.DynamicYearMonthTrigger.EVENT_KEY_DOWN,function(){self.combo.isViewVisible()&&self.combo.hideView()}),this.trigger.on(BI.DynamicYearMonthTrigger.EVENT_START,function(){self.combo.isViewVisible()&&self.combo.hideView()}),this.trigger.on(BI.DynamicYearMonthTrigger.EVENT_STOP,function(){self.combo.showView()}),this.trigger.on(BI.DynamicYearMonthTrigger.EVENT_ERROR,function(){self.combo.isViewVisible()&&self.combo.hideView(),self.fireEvent(BI.DynamicYearMonthCombo.EVENT_ERROR)}),this.trigger.on(BI.DynamicYearMonthTrigger.EVENT_VALID,function(){self.fireEvent(BI.DynamicYearMonthCombo.EVENT_VALID)}),this.trigger.on(BI.DynamicYearMonthTrigger.EVENT_CONFIRM,function(){var dateStore=self.storeTriggerValue,dateObj=self.trigger.getKey();BI.isNotEmptyString(dateObj)&&!BI.isEqual(dateObj,dateStore)&&(self.storeValue=self.trigger.getValue(),self.setValue(self.trigger.getValue())),self._checkDynamicValue(self.storeValue),self.fireEvent(BI.DynamicYearMonthCombo.EVENT_CONFIRM)}),this.trigger.on(BI.DynamicYearMonthTrigger.EVENT_FOCUS,function(){self.storeTriggerValue=self.trigger.getKey(),self.fireEvent(BI.DynamicYearMonthCombo.EVENT_FOCUS)}),this.combo=BI.createWidget({type:"bi.combo",container:o.container,isNeedAdjustHeight:!1,isNeedAdjustWidth:!1,el:this.trigger,popup:{minWidth:100,stopPropagation:!1,el:{type:"bi.dynamic_year_month_popup",ref:function(){self.popup=this},listeners:[{eventName:BI.DynamicYearMonthPopup.EVENT_CHANGE,action:function(){self.setValue(self.popup.getValue()),self.combo.hideView(),self.fireEvent(BI.DynamicYearMonthCombo.EVENT_CONFIRM)}},{eventName:BI.DynamicYearMonthPopup.BUTTON_CLEAR_EVENT_CHANGE,action:function(){self.setValue(),self.combo.hideView(),self.fireEvent(BI.DynamicYearMonthCombo.EVENT_CONFIRM)}},{eventName:BI.DynamicYearMonthPopup.BUTTON_lABEL_EVENT_CHANGE,action:function(){var date=BI.getDate();self.setValue({type:BI.DynamicYearMonthCombo.Static,value:{year:date.getFullYear(),month:date.getMonth()+1}}),self.combo.hideView(),self.fireEvent(BI.DynamicDateCombo.EVENT_CONFIRM)}},{eventName:BI.DynamicYearMonthPopup.BUTTON_OK_EVENT_CHANGE,action:function(){self.setValue(self.popup.getValue()),self.combo.hideView(),self.fireEvent(BI.DynamicDateCombo.EVENT_CONFIRM)}}],behaviors:o.behaviors,min:o.minDate,max:o.maxDate},value:o.value||""}}),this.combo.on(BI.Combo.EVENT_BEFORE_POPUPVIEW,function(){self.popup.setValue(self.storeValue),self.fireEvent(BI.DynamicYearMonthCombo.EVENT_BEFORE_POPUPVIEW)}),BI.createWidget({type:"bi.htape",element:this,ref:function(){self.comboWrapper=this},items:[{el:{type:"bi.icon_button",cls:"bi-trigger-icon-button date-change-h-font",width:24,height:24,ref:function(){self.changeIcon=this}},width:24},this.combo]}),this._checkDynamicValue(o.value)},_checkDynamicValue:function(v){var type=null;switch(BI.isNotNull(v)&&(type=v.type),type){case BI.DynamicYearMonthCombo.Dynamic:this.changeIcon.setVisible(!0),this.comboWrapper.attr("items")[0].width=24,this.comboWrapper.resize();break;default:this.comboWrapper.attr("items")[0].width=0,this.comboWrapper.resize(),this.changeIcon.setVisible(!1)}},hideView:function(){this.combo.hideView()},setValue:function(v){this.storeValue=v,this.trigger.setValue(v),this._checkDynamicValue(v)},getValue:function(){return this.storeValue},getKey:function(){return this.trigger.getKey()},isValid:function(){return this.trigger.isValid()}}),BI.DynamicYearMonthCombo.EVENT_ERROR="EVENT_ERROR",BI.DynamicYearMonthCombo.EVENT_VALID="EVENT_VALID",BI.DynamicYearMonthCombo.EVENT_FOCUS="EVENT_FOCUS",BI.DynamicYearMonthCombo.EVENT_CONFIRM="EVENT_CONFIRM",BI.DynamicYearMonthCombo.EVENT_BEFORE_POPUPVIEW="EVENT_BEFORE_POPUPVIEW",BI.shortcut("bi.dynamic_year_month_combo",BI.DynamicYearMonthCombo),BI.extend(BI.DynamicYearMonthCombo,{Static:1,Dynamic:2}),BI.DynamicYearMonthPopup=BI.inherit(BI.Widget,{constants:{tabHeight:30,buttonHeight:24},props:{baseCls:"bi-year-month-popup",behaviors:{},min:"1900-01-01",max:"2099-12-31",width:180,height:240},render:function(){var self=this,opts=this.options,c=this.constants;return this.storeValue={type:BI.DynamicYearMonthCombo.Static},{type:"bi.vtape",items:[{el:this._getTabJson()},{el:{type:"bi.grid",items:[[{type:"bi.text_button",cls:"bi-split-top bi-high-light",textHeight:c.buttonHeight-1,shadow:!0,text:BI.i18nText("BI-Basic_Clear"),listeners:[{eventName:BI.TextButton.EVENT_CHANGE,action:function(){self.fireEvent(BI.DynamicYearMonthPopup.BUTTON_CLEAR_EVENT_CHANGE)}}]},{type:"bi.text_button",cls:"bi-split-left bi-split-right bi-high-light bi-split-top",textHeight:c.buttonHeight-1,shadow:!0,text:BI.i18nText("BI-Basic_Current_Month"),ref:function(){self.textButton=this},listeners:[{eventName:BI.TextButton.EVENT_CHANGE,action:function(){self.fireEvent(BI.DynamicYearMonthPopup.BUTTON_lABEL_EVENT_CHANGE)}}]},{type:"bi.text_button",cls:"bi-split-top bi-high-light",textHeight:c.buttonHeight-1,shadow:!0,text:BI.i18nText("BI-Basic_OK"),listeners:[{eventName:BI.TextButton.EVENT_CHANGE,action:function(){self.fireEvent(BI.DynamicYearMonthPopup.BUTTON_OK_EVENT_CHANGE)}}]}]]},height:24}]}},_setInnerValue:function(){if(this.dateTab.getSelect()===BI.DynamicDateCombo.Static)this.textButton.setValue(BI.i18nText("BI-Basic_Current_Month")),this.textButton.setEnable(!0);else{var date=BI.DynamicDateHelper.getCalculation(this.dynamicPane.getValue());date=BI.print(date,"%Y-%x"),this.textButton.setValue(date),this.textButton.setEnable(!1)}},_getTabJson:function(){var self=this,o=this.options;return{type:"bi.tab",ref:function(){self.dateTab=this},tab:{type:"bi.linear_segment",cls:"bi-split-bottom",height:this.constants.tabHeight,items:BI.createItems([{text:BI.i18nText("BI-Basic_Year_Month"),value:BI.DynamicYearCombo.Static},{text:BI.i18nText("BI-Basic_Dynamic_Title"),value:BI.DynamicYearCombo.Dynamic}],{textAlign:"center"})},cardCreator:function(v){switch(v){case BI.DynamicYearCombo.Dynamic:return{type:"bi.dynamic_year_month_card",listeners:[{eventName:"EVENT_CHANGE",action:function(){self._setInnerValue(self.year,v)}}],ref:function(){self.dynamicPane=this}};case BI.DynamicYearCombo.Static:default:return{type:"bi.static_year_month_card",behaviors:o.behaviors,min:self.options.min,max:self.options.max,listeners:[{eventName:BI.StaticYearMonthCard.EVENT_CHANGE,action:function(){self.fireEvent(BI.DynamicYearMonthPopup.EVENT_CHANGE)}}],ref:function(){self.year=this}}}},listeners:[{eventName:BI.Tab.EVENT_CHANGE,action:function(){var v=self.dateTab.getSelect();switch(v){case BI.DynamicYearCombo.Static:var date=BI.DynamicDateHelper.getCalculation(self.dynamicPane.getValue());self.year.setValue({year:date.getFullYear(),month:date.getMonth()+1}),self._setInnerValue();break;case BI.DynamicYearCombo.Dynamic:default:self.storeValue&&self.storeValue.type===BI.DynamicYearCombo.Dynamic?self.dynamicPane.setValue(self.storeValue.value):self.dynamicPane.setValue({year:0}),self._setInnerValue()}}}]}},setValue:function(v){this.storeValue=v;var self=this,type,value;switch(v=v||{},type=v.type||BI.DynamicDateCombo.Static,value=v.value||v,this.dateTab.setSelect(type),type){case BI.DynamicDateCombo.Dynamic:this.dynamicPane.setValue(value),self._setInnerValue();break;case BI.DynamicDateCombo.Static:default:this.year.setValue(value),this.textButton.setValue(BI.i18nText("BI-Basic_Current_Month")),this.textButton.setEnable(!0)}},getValue:function(){return{type:this.dateTab.getSelect(),value:this.dateTab.getValue()}}}),BI.DynamicYearMonthPopup.BUTTON_CLEAR_EVENT_CHANGE="BUTTON_CLEAR_EVENT_CHANGE",BI.DynamicYearMonthPopup.BUTTON_lABEL_EVENT_CHANGE="BUTTON_lABEL_EVENT_CHANGE",BI.DynamicYearMonthPopup.BUTTON_OK_EVENT_CHANGE="BUTTON_OK_EVENT_CHANGE",BI.DynamicYearMonthPopup.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.dynamic_year_month_popup",BI.DynamicYearMonthPopup),BI.DynamicYearMonthTrigger=BI.inherit(BI.Trigger,{_const:{hgap:4,vgap:2},props:{extraCls:"bi-year-month-trigger",min:"1900-01-01",max:"2099-12-31",height:22},beforeInit:function(callback){var o=this.options;o.title=BI.bind(this._titleCreator,this),callback()},_init:function(){BI.DynamicYearMonthTrigger.superclass._init.apply(this,arguments);var o=this.options;this.yearEditor=this._createEditor(!0),this.monthEditor=this._createEditor(!1),BI.createWidget({element:this,type:"bi.htape",items:[{type:"bi.center",items:[{type:"bi.htape",items:[this.yearEditor,{el:{type:"bi.text_button",text:BI.i18nText("BI-Multi_Date_Year"),width:o.height},width:o.height}]},{type:"bi.htape",items:[this.monthEditor,{el:{type:"bi.text_button",text:BI.i18nText("BI-Multi_Date_Month"),width:o.height},width:o.height}]}]},{el:{type:"bi.trigger_icon_button",width:o.height},width:o.height}]}),this.setValue(o.value)},_createEditor:function(isYear){var self=this,o=this.options,c=this._const,minDate=BI.parseDateTime(o.min,"%Y-%X-%d"),editor=BI.createWidget({type:"bi.sign_editor",height:o.height,validationChecker:function(v){return isYear?""===v||BI.isPositiveInteger(v)&&!BI.checkDateVoid(v,v===minDate.getFullYear()?minDate.getMonth()+1:1,1,o.min,o.max)[0]:""===v||BI.isPositiveInteger(v)&&v>=1&&v<=12&&!BI.checkDateVoid(BI.getDate().getFullYear(),v,1,o.min,o.max)[0]},quitChecker:function(){return!1},watermark:BI.i18nText("BI-Basic_Unrestricted"),errorText:function(v){return BI.i18nText("BI-Year_Trigger_Invalid_Text")},hgap:c.hgap,vgap:c.vgap,allowBlank:!0});return editor.on(BI.SignEditor.EVENT_KEY_DOWN,function(){self.fireEvent(BI.DynamicYearMonthTrigger.EVENT_KEY_DOWN)}),editor.on(BI.SignEditor.EVENT_FOCUS,function(){self.fireEvent(BI.DynamicYearMonthTrigger.EVENT_FOCUS)}),editor.on(BI.SignEditor.EVENT_STOP,function(){self.fireEvent(BI.DynamicYearMonthTrigger.EVENT_STOP)}),editor.on(BI.SignEditor.EVENT_CONFIRM,function(){self._doEditorConfirm(editor),self.fireEvent(BI.DynamicYearMonthTrigger.EVENT_CONFIRM)}),editor.on(BI.SignEditor.EVENT_SPACE,function(){editor.isValid()&&editor.blur()}),editor.on(BI.SignEditor.EVENT_START,function(){self.fireEvent(BI.DynamicYearMonthTrigger.EVENT_START)}),editor.on(BI.SignEditor.EVENT_ERROR,function(){self.fireEvent(BI.DynamicYearMonthTrigger.EVENT_ERROR)}),editor.on(BI.SignEditor.EVENT_VALID,function(){var year=self.yearEditor.getValue(),month=self.monthEditor.getValue();BI.isNotEmptyString(year)&&BI.isNotEmptyString(month)&&BI.isPositiveInteger(year)&&month>=1&&month<=12&&!BI.checkDateVoid(year,month,1,o.min,o.max)[0]&&self.fireEvent(BI.DynamicYearMonthTrigger.EVENT_VALID)}),editor.on(BI.SignEditor.EVENT_CHANGE,function(){isYear&&self._autoSwitch(editor)}),editor},_titleCreator:function(){var storeValue=this.storeValue||{},type=storeValue.type||BI.DynamicDateCombo.Static,value=storeValue.value;if(!this.monthEditor.isValid()||!this.yearEditor.isValid())return"";switch(type){case BI.DynamicDateCombo.Dynamic:var text=this._getText(value),date=BI.getDate();date=BI.DynamicDateHelper.getCalculation(value);var dateStr=BI.print(date,"%Y-%x");return BI.isEmptyString(text)?dateStr:text+":"+dateStr;case BI.DynamicDateCombo.Static:default:return value=value||{},this._getStaticTitle(value)}},_doEditorConfirm:function(editor){var value=editor.getValue();BI.isNotNull(value)&&editor.setValue(value);var monthValue=this.monthEditor.getValue();this.storeValue={type:BI.DynamicDateCombo.Static,value:{year:this.yearEditor.getValue(),month:BI.isEmptyString(this.monthEditor.getValue())?"":monthValue}}},_yearCheck:function(v){var date=BI.print(BI.parseDateTime(v,"%Y-%X-%d"),"%Y-%X-%d");return BI.print(BI.parseDateTime(v,"%Y"),"%Y")===v&&date>=this.options.min&&date<=this.options.max},_autoSwitch:function(editor){var v=editor.getValue();BI.isNotEmptyString(v)&&BI.checkDateLegal(v)&&4===v.length&&this._yearCheck(v)&&(this._doEditorConfirm(editor),this.fireEvent(BI.DynamicYearMonthTrigger.EVENT_CONFIRM),this.monthEditor.focus())},_getText:function(obj){var value="";return BI.isNotNull(obj.year)&&0!==BI.parseInt(obj.year)&&(value+=Math.abs(obj.year)+BI.i18nText("BI-Basic_Year")+(obj.year<0?BI.i18nText("BI-Basic_Front"):BI.i18nText("BI-Basic_Behind"))),BI.isNotNull(obj.month)&&0!==BI.parseInt(obj.month)&&(value+=Math.abs(obj.month)+BI.i18nText("BI-Basic_Month")+(obj.month<0?BI.i18nText("BI-Basic_Front"):BI.i18nText("BI-Basic_Behind"))),value},_setInnerValue:function(date,text){this.yearEditor.setValue(date.getFullYear()),this.monthEditor.setValue(date.getMonth()+1)},_getStaticTitle:function(value){value=value||{};var hasYear=!(BI.isNull(value.year)||BI.isEmptyString(value.year)),hasMonth=!(BI.isNull(value.month)||BI.isEmptyString(value.month));switch(hasYear<<1|hasMonth){case 0:return"";case 1:return value.month;case 2:return value.year;case 3:default:return value.year+"-"+value.month}},setValue:function(v){var type,value,date=BI.getDate();switch(this.storeValue=v,BI.isNotNull(v)&&(type=v.type||BI.DynamicDateCombo.Static,value=v.value||v),type){case BI.DynamicDateCombo.Dynamic:var text=this._getText(value);date=BI.DynamicDateHelper.getCalculation(value),this._setInnerValue(date,text);break;case BI.DynamicDateCombo.Static:default:value=value||{};var month=BI.isNull(value.month)?null:value.month;this.yearEditor.setValue(value.year),this.monthEditor.setValue(month)}},getValue:function(){return this.storeValue},getKey:function(){return this.yearEditor.getValue()+"-"+this.monthEditor.getValue()},isValid:function(){return this.yearEditor.isValid()&&this.monthEditor.isValid()}}),BI.DynamicYearMonthTrigger.EVENT_VALID="EVENT_VALID",BI.DynamicYearMonthTrigger.EVENT_FOCUS="EVENT_FOCUS",BI.DynamicYearMonthTrigger.EVENT_ERROR="EVENT_ERROR",BI.DynamicYearMonthTrigger.EVENT_START="EVENT_START",BI.DynamicYearMonthTrigger.EVENT_CONFIRM="EVENT_CONFIRM",BI.DynamicYearMonthTrigger.EVENT_STOP="EVENT_STOP",BI.DynamicYearMonthTrigger.EVENT_KEY_DOWN="EVENT_KEY_DOWN",BI.shortcut("bi.dynamic_year_month_trigger",BI.DynamicYearMonthTrigger),BI.YearMonthInterval=BI.inherit(BI.Single,{constants:{height:24,width:25,lgap:15,offset:-15,timeErrorCls:"time-error"},props:{extraCls:"bi-year-month-interval",minDate:"1900-01-01",maxDate:"2099-12-31"},_init:function(){var self=this,o=this.options;BI.YearMonthInterval.superclass._init.apply(this,arguments),o.value=o.value||{},this.left=this._createCombo(o.value.start),this.right=this._createCombo(o.value.end),this.label=BI.createWidget({type:"bi.label",height:this.constants.height,width:this.constants.width,text:"-"}),BI.createWidget({element:self,type:"bi.center",hgap:15,height:this.constants.height,items:[{type:"bi.absolute",items:[{el:self.left,left:this.constants.offset,right:0,top:0,bottom:0}]},{type:"bi.absolute",items:[{el:self.right,left:0,right:this.constants.offset,top:0,bottom:0}]}]}),BI.createWidget({type:"bi.horizontal_auto",element:this,items:[self.label]})},_createCombo:function(v){var self=this,o=this.options,combo=BI.createWidget({type:"bi.dynamic_year_month_combo",behaviors:o.behaviors,value:v,listeners:[{eventName:BI.DynamicYearMonthCombo.EVENT_BEFORE_POPUPVIEW,action:function(){self.fireEvent(BI.YearMonthInterval.EVENT_BEFORE_POPUPVIEW)}}]});return combo.on(BI.DynamicYearMonthCombo.EVENT_ERROR,function(){self._clearTitle(),BI.Bubbles.hide("error"),self.element.removeClass(self.constants.timeErrorCls),self.fireEvent(BI.YearMonthInterval.EVENT_ERROR)}),combo.on(BI.DynamicYearMonthCombo.EVENT_VALID,function(){self._checkValid()}),combo.on(BI.DynamicYearMonthCombo.EVENT_FOCUS,function(){self._checkValid()}),combo.on(BI.DynamicYearMonthCombo.EVENT_BEFORE_POPUPVIEW,function(){self.left.hideView(),self.right.hideView()}),combo.on(BI.DynamicYearMonthCombo.EVENT_CONFIRM,function(){BI.Bubbles.hide("error");var smallDate=self.left.getKey(),bigDate=self.right.getKey();self.left.isValid()&&self.right.isValid()&&self._check(smallDate,bigDate)&&self._compare(smallDate,bigDate)?(self._setTitle(BI.i18nText("BI-Time_Interval_Error_Text")),self.element.addClass(self.constants.timeErrorCls),self.fireEvent(BI.YearMonthInterval.EVENT_ERROR)):(self._clearTitle(),self.element.removeClass(self.constants.timeErrorCls),self.fireEvent(BI.YearMonthInterval.EVENT_CHANGE))}),combo},_dateCheck:function(date){return BI.print(BI.parseDateTime(date,"%Y-%x"),"%Y-%x")===date||BI.print(BI.parseDateTime(date,"%Y-%X"),"%Y-%X")===date},_checkVoid:function(obj){var o=this.options;return!BI.checkDateVoid(obj.year,obj.month,1,o.minDate,o.maxDate)[0]},_check:function(smallDate,bigDate){var smallObj=smallDate.match(/\d+/g),bigObj=bigDate.match(/\d+/g),smallDate4Check="";BI.isNotNull(smallObj)&&(smallDate4Check=(smallObj[0]||"")+"-"+(smallObj[1]||1));var bigDate4Check="";return BI.isNotNull(bigObj)&&(bigDate4Check=(bigObj[0]||"")+"-"+(bigObj[1]||1)),this._dateCheck(smallDate4Check)&&BI.checkDateLegal(smallDate)&&this._checkVoid({year:smallObj[0],month:smallObj[1],day:1})&&this._dateCheck(bigDate4Check)&&BI.checkDateLegal(bigDate)&&this._checkVoid({year:bigObj[0],month:bigObj[1],day:1})},_compare:function(smallDate,bigDate){return smallDate=BI.print(BI.parseDateTime(smallDate,"%Y-%X"),"%Y-%X"),bigDate=BI.print(BI.parseDateTime(bigDate,"%Y-%X"),"%Y-%X"),BI.isNotNull(smallDate)&&BI.isNotNull(bigDate)&&smallDate>bigDate},_setTitle:function(v){this.setTitle(v)},_clearTitle:function(){this.setTitle("")},_checkValid:function(){var self=this;BI.Bubbles.hide("error");var smallDate=self.left.getKey(),bigDate=self.right.getKey();self.left.isValid()&&self.right.isValid()&&self._check(smallDate,bigDate)&&self._compare(smallDate,bigDate)?(self._setTitle(BI.i18nText("BI-Time_Interval_Error_Text")),self.element.addClass(self.constants.timeErrorCls),BI.Bubbles.show("error",BI.i18nText("BI-Time_Interval_Error_Text"),self,{offsetStyle:"center"}),self.fireEvent(BI.YearMonthInterval.EVENT_ERROR)):(self._clearTitle(),self.element.removeClass(self.constants.timeErrorCls))},setValue:function(date){date=date||{},this.left.setValue(date.start),this.right.setValue(date.end),this._checkValid()},getValue:function(){return{start:this.left.getValue(),end:this.right.getValue()}}}),BI.YearMonthInterval.EVENT_VALID="EVENT_VALID",BI.YearMonthInterval.EVENT_ERROR="EVENT_ERROR",BI.YearMonthInterval.EVENT_CHANGE="EVENT_CHANGE",BI.YearMonthInterval.EVENT_BEFORE_POPUPVIEW="EVENT_BEFORE_POPUPVIEW",BI.shortcut("bi.year_month_interval",BI.YearMonthInterval),BI.DynamicYearQuarterCard=BI.inherit(BI.Widget,{props:{baseCls:"bi-year-month-card"},render:function(){var self=this;return{type:"bi.vertical",items:[{type:"bi.label",text:BI.i18nText("BI-Multi_Date_Relative_Current_Time"),textAlign:"left",height:24},{type:"bi.dynamic_date_param_item",ref:function(){self.year=this},listeners:[{eventName:"EVENT_CHANGE",action:function(){self.fireEvent("EVENT_CHANGE")}}]},{type:"bi.dynamic_date_param_item",dateType:BI.DynamicDateCard.TYPE.QUARTER,ref:function(){self.quarter=this},listeners:[{eventName:"EVENT_CHANGE",action:function(){self.fireEvent("EVENT_CHANGE")}}]}],vgap:10,hgap:10}},_createValue:function(type,v){return{dateType:type,value:Math.abs(v),offset:v>0?1:0}},setValue:function(v){v=v||{year:0,month:0},this.year.setValue(this._createValue(BI.DynamicDateCard.TYPE.YEAR,v.year)),this.quarter.setValue(this._createValue(BI.DynamicDateCard.TYPE.QUARTER,v.quarter))},getValue:function(){var year=this.year.getValue(),quarter=this.quarter.getValue();return{year:0===year.offset?-year.value:year.value,quarter:0===quarter.offset?-quarter.value:quarter.value}}}),BI.DynamicYearQuarterCard.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.dynamic_year_quarter_card",BI.DynamicYearQuarterCard),BI.StaticYearQuarterCard=BI.inherit(BI.Widget,{props:{baseCls:"bi-static-year-quarter-card",behaviors:{}},_createQuarter:function(){var items=[{text:BI.Date._QN[1],value:1},{text:BI.Date._QN[2],value:2},{text:BI.Date._QN[3],value:3},{text:BI.Date._QN[4],value:4}];return BI.map(items,function(j,item){return BI.extend(item,{type:"bi.text_item",cls:"bi-list-item-select",textAlign:"center",whiteSpace:"nowrap",once:!1,forceSelected:!0,height:24})})},render:function(){var self=this,o=this.options;return{type:"bi.vertical",items:[{type:"bi.year_picker",ref:function(){self.yearPicker=this},behaviors:o.behaviors,height:30,listeners:[{eventName:BI.YearPicker.EVENT_CHANGE,action:function(){var value=this.getValue();self.setValue({year:value,quarter:self.selectedQuarter})}}]},{type:"bi.button_group",behaviors:o.behaviors,ref:function(){self.quarter=this},items:this._createQuarter(),layouts:[{type:"bi.vertical",vgap:10}],value:o.value,listeners:[{eventName:BI.ButtonGroup.EVENT_CHANGE,action:function(){self.selectedYear=self.yearPicker.getValue(),self.selectedQuarter=this.getValue()[0],self.fireEvent(BI.StaticYearQuarterCard.EVENT_CHANGE)}}]}]}},getValue:function(){return{year:this.selectedYear,quarter:this.selectedQuarter}},setValue:function(obj){var o=this.options,newObj={};if(newObj.year=obj.year||0,newObj.quarter=obj.quarter||0,0===newObj.quarter||0===newObj.year||BI.checkDateVoid(newObj.year,newObj.quarter,1,o.min,o.max)[0]){var year=newObj.year||BI.getDate().getFullYear();this.selectedYear=year,this.selectedQuarter="",this.yearPicker.setValue(year),this.quarter.setValue()}else this.selectedYear=BI.parseInt(newObj.year),this.selectedQuarter=BI.parseInt(newObj.quarter),this.yearPicker.setValue(this.selectedYear),this.quarter.setValue(this.selectedQuarter)}}),BI.StaticYearQuarterCard.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.static_year_quarter_card",BI.StaticYearQuarterCard),BI.DynamicYearQuarterCombo=BI.inherit(BI.Widget,{props:{baseCls:"bi-year-quarter-combo bi-border bi-focus-shadow",behaviors:{},min:"1900-01-01",max:"2099-12-31",height:22},_init:function(){BI.DynamicYearQuarterCombo.superclass._init.apply(this,arguments);var self=this,o=this.options;this.storeValue=o.value,self.storeTriggerValue="",this.trigger=BI.createWidget({type:"bi.dynamic_year_quarter_trigger",min:o.min,max:o.max,height:o.height,value:o.value||""}),this.trigger.on(BI.DynamicYearQuarterTrigger.EVENT_KEY_DOWN,function(){ +self.combo.isViewVisible()&&self.combo.hideView()}),this.trigger.on(BI.DynamicYearQuarterTrigger.EVENT_START,function(){self.combo.isViewVisible()&&self.combo.hideView()}),this.trigger.on(BI.DynamicYearQuarterTrigger.EVENT_STOP,function(){self.combo.showView()}),this.trigger.on(BI.DynamicYearQuarterTrigger.EVENT_ERROR,function(){self.combo.isViewVisible()&&self.combo.hideView()}),this.trigger.on(BI.DynamicYearQuarterTrigger.EVENT_CONFIRM,function(){var dateStore=self.storeTriggerValue,dateObj=self.trigger.getKey();BI.isNotEmptyString(dateObj)&&!BI.isEqual(dateObj,dateStore)&&(self.storeValue=self.trigger.getValue(),self.setValue(self.trigger.getValue())),self._checkDynamicValue(self.storeValue),self.fireEvent(BI.DynamicYearQuarterCombo.EVENT_CONFIRM)}),this.trigger.on(BI.DynamicYearQuarterTrigger.EVENT_FOCUS,function(){self.storeTriggerValue=self.trigger.getKey()}),this.combo=BI.createWidget({type:"bi.combo",container:o.container,isNeedAdjustHeight:!1,isNeedAdjustWidth:!1,el:this.trigger,popup:{minWidth:85,stopPropagation:!1,el:{type:"bi.dynamic_year_quarter_popup",ref:function(){self.popup=this},listeners:[{eventName:BI.DynamicYearQuarterPopup.EVENT_CHANGE,action:function(){self.setValue(self.popup.getValue()),self.combo.hideView(),self.fireEvent(BI.DynamicYearQuarterCombo.EVENT_CONFIRM)}},{eventName:BI.DynamicYearQuarterPopup.BUTTON_CLEAR_EVENT_CHANGE,action:function(){self.setValue(),self.combo.hideView(),self.fireEvent(BI.DynamicYearQuarterCombo.EVENT_CONFIRM)}},{eventName:BI.DynamicYearQuarterPopup.BUTTON_lABEL_EVENT_CHANGE,action:function(){var date=BI.getDate();self.setValue({type:BI.DynamicYearMonthCombo.Static,value:{year:date.getFullYear(),quarter:BI.getQuarter(date)}}),self.combo.hideView(),self.fireEvent(BI.DynamicDateCombo.EVENT_CONFIRM)}},{eventName:BI.DynamicYearQuarterPopup.BUTTON_OK_EVENT_CHANGE,action:function(){self.setValue(self.popup.getValue()),self.combo.hideView(),self.fireEvent(BI.DynamicDateCombo.EVENT_CONFIRM)}}],behaviors:o.behaviors,min:o.min,max:o.max},value:o.value||""}}),this.combo.on(BI.Combo.EVENT_BEFORE_POPUPVIEW,function(){self.popup.setValue(self.storeValue),self.fireEvent(BI.DynamicYearQuarterCombo.EVENT_BEFORE_POPUPVIEW)}),BI.createWidget({type:"bi.htape",element:this,ref:function(){self.comboWrapper=this},items:[{el:{type:"bi.icon_button",cls:"bi-trigger-icon-button date-change-h-font",width:24,height:24,ref:function(){self.changeIcon=this}},width:24},this.combo]}),this._checkDynamicValue(o.value)},_checkDynamicValue:function(v){var type=null;switch(BI.isNotNull(v)&&(type=v.type),type){case BI.DynamicYearQuarterCombo.Dynamic:this.changeIcon.setVisible(!0),this.comboWrapper.attr("items")[0].width=24,this.comboWrapper.resize();break;default:this.comboWrapper.attr("items")[0].width=0,this.comboWrapper.resize(),this.changeIcon.setVisible(!1)}},setValue:function(v){this.storeValue=v,this.trigger.setValue(v),this._checkDynamicValue(v)},getValue:function(){return this.storeValue}}),BI.DynamicYearQuarterCombo.EVENT_CONFIRM="EVENT_CONFIRM",BI.DynamicYearQuarterCombo.EVENT_BEFORE_POPUPVIEW="EVENT_BEFORE_POPUPVIEW",BI.shortcut("bi.dynamic_year_quarter_combo",BI.DynamicYearQuarterCombo),BI.extend(BI.DynamicYearQuarterCombo,{Static:1,Dynamic:2}),BI.DynamicYearQuarterPopup=BI.inherit(BI.Widget,{constants:{tabHeight:30,buttonHeight:24},props:{baseCls:"bi-year-quarter-popup",behaviors:{},min:"1900-01-01",max:"2099-12-31",width:180,height:240},render:function(){var self=this,opts=this.options,c=this.constants;return this.storeValue={type:BI.DynamicYearQuarterCombo.Static},{type:"bi.vtape",items:[{el:this._getTabJson()},{el:{type:"bi.grid",items:[[{type:"bi.text_button",cls:"bi-split-top bi-high-light",shadow:!0,textHeight:c.buttonHeight-1,text:BI.i18nText("BI-Basic_Clear"),listeners:[{eventName:BI.TextButton.EVENT_CHANGE,action:function(){self.fireEvent(BI.DynamicYearQuarterPopup.BUTTON_CLEAR_EVENT_CHANGE)}}]},{type:"bi.text_button",cls:"bi-split-left bi-split-right bi-high-light bi-split-top",textHeight:c.buttonHeight-1,shadow:!0,text:BI.i18nText("BI-Basic_Current_Quarter"),ref:function(){self.textButton=this},listeners:[{eventName:BI.TextButton.EVENT_CHANGE,action:function(){self.fireEvent(BI.DynamicYearQuarterPopup.BUTTON_lABEL_EVENT_CHANGE)}}]},{type:"bi.text_button",cls:"bi-split-top bi-high-light",shadow:!0,textHeight:c.buttonHeight-1,text:BI.i18nText("BI-Basic_OK"),listeners:[{eventName:BI.TextButton.EVENT_CHANGE,action:function(){self.fireEvent(BI.DynamicYearQuarterPopup.BUTTON_OK_EVENT_CHANGE)}}]}]]},height:24}]}},_setInnerValue:function(){if(this.dateTab.getSelect()===BI.DynamicYearQuarterCombo.Static)this.textButton.setValue(BI.i18nText("BI-Basic_Current_Quarter")),this.textButton.setEnable(!0);else{var date=BI.DynamicDateHelper.getCalculation(this.dynamicPane.getValue());date=BI.print(date,"%Y-%Q"),this.textButton.setValue(date),this.textButton.setEnable(!1)}},_getTabJson:function(){var self=this,o=this.options;return{type:"bi.tab",ref:function(){self.dateTab=this},tab:{type:"bi.linear_segment",cls:"bi-split-bottom",height:this.constants.tabHeight,items:BI.createItems([{text:BI.i18nText("BI-Basic_Year_Quarter"),value:BI.DynamicYearQuarterCombo.Static},{text:BI.i18nText("BI-Basic_Dynamic_Title"),value:BI.DynamicYearQuarterCombo.Dynamic}],{textAlign:"center"})},cardCreator:function(v){switch(v){case BI.DynamicYearQuarterCombo.Dynamic:return{type:"bi.dynamic_year_quarter_card",listeners:[{eventName:"EVENT_CHANGE",action:function(){self._setInnerValue(self.year,v)}}],ref:function(){self.dynamicPane=this}};case BI.DynamicYearQuarterCombo.Static:default:return{type:"bi.static_year_quarter_card",behaviors:o.behaviors,min:self.options.min,max:self.options.max,listeners:[{eventName:BI.DynamicYearCard.EVENT_CHANGE,action:function(){self.fireEvent(BI.DynamicYearQuarterPopup.EVENT_CHANGE)}}],ref:function(){self.year=this}}}},listeners:[{eventName:BI.Tab.EVENT_CHANGE,action:function(){var v=self.dateTab.getSelect();switch(v){case BI.DynamicYearQuarterCombo.Static:var date=BI.DynamicDateHelper.getCalculation(self.dynamicPane.getValue());self.year.setValue({year:date.getFullYear(),quarter:BI.getQuarter(date)}),self._setInnerValue();break;case BI.DynamicYearQuarterCombo.Dynamic:default:self.storeValue&&self.storeValue.type===BI.DynamicYearQuarterCombo.Dynamic?self.dynamicPane.setValue(self.storeValue.value):self.dynamicPane.setValue({year:0}),self._setInnerValue()}}}]}},setValue:function(v){this.storeValue=v;var self=this,type,value;switch(v=v||{},type=v.type||BI.DynamicDateCombo.Static,value=v.value||v,this.dateTab.setSelect(type),type){case BI.DynamicDateCombo.Dynamic:this.dynamicPane.setValue(value),self._setInnerValue();break;case BI.DynamicDateCombo.Static:default:this.year.setValue(value),this.textButton.setValue(BI.i18nText("BI-Basic_Current_Quarter")),this.textButton.setEnable(!0)}},getValue:function(){return{type:this.dateTab.getSelect(),value:this.dateTab.getValue()}}}),BI.DynamicYearQuarterPopup.BUTTON_CLEAR_EVENT_CHANGE="BUTTON_CLEAR_EVENT_CHANGE",BI.DynamicYearQuarterPopup.BUTTON_lABEL_EVENT_CHANGE="BUTTON_lABEL_EVENT_CHANGE",BI.DynamicYearQuarterPopup.BUTTON_OK_EVENT_CHANGE="BUTTON_OK_EVENT_CHANGE",BI.DynamicYearQuarterPopup.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.dynamic_year_quarter_popup",BI.DynamicYearQuarterPopup),BI.DynamicYearQuarterTrigger=BI.inherit(BI.Trigger,{_const:{hgap:4,vgap:2},props:{extraCls:"bi-year-quarter-trigger",min:"1900-01-01",max:"2099-12-31",height:22},_init:function(){BI.DynamicYearQuarterTrigger.superclass._init.apply(this,arguments);var o=this.options;this.yearEditor=this._createEditor(!0),this.quarterEditor=this._createEditor(!1),BI.createWidget({element:this,type:"bi.htape",items:[{type:"bi.center",items:[{type:"bi.htape",items:[this.yearEditor,{el:{type:"bi.text_button",text:BI.i18nText("BI-Multi_Date_Year"),width:o.height},width:o.height}]},{type:"bi.htape",items:[this.quarterEditor,{el:{type:"bi.text_button",text:BI.i18nText("BI-Multi_Date_Quarter"),width:24},width:24}]}]},{el:{type:"bi.trigger_icon_button",width:o.height},width:o.height}]}),this.setValue(o.value)},_createEditor:function(isYear){var self=this,o=this.options,c=this._const,editor=BI.createWidget({type:"bi.sign_editor",height:o.height,validationChecker:function(v){return isYear?""===v||BI.isPositiveInteger(v)&&!BI.checkDateVoid(v,1,1,o.min,o.max)[0]:""===v||BI.isPositiveInteger(v)&&v>=1&&v<=4&&!BI.checkDateVoid(BI.getDate().getFullYear(),v,1,o.min,o.max)[0]},quitChecker:function(){return!1},errorText:function(v){return BI.i18nText("BI-Year_Trigger_Invalid_Text")},watermark:BI.i18nText("BI-Basic_Unrestricted"),hgap:c.hgap,vgap:c.vgap,title:"",allowBlank:!0});return editor.on(BI.SignEditor.EVENT_KEY_DOWN,function(){self.fireEvent(BI.DynamicYearQuarterTrigger.EVENT_KEY_DOWN)}),editor.on(BI.SignEditor.EVENT_FOCUS,function(){self.fireEvent(BI.DynamicYearQuarterTrigger.EVENT_FOCUS)}),editor.on(BI.SignEditor.EVENT_STOP,function(){self.fireEvent(BI.DynamicYearQuarterTrigger.EVENT_STOP)}),editor.on(BI.SignEditor.EVENT_CONFIRM,function(){self._doEditorConfirm(editor),self.fireEvent(BI.DynamicYearQuarterTrigger.EVENT_CONFIRM)}),editor.on(BI.SignEditor.EVENT_SPACE,function(){editor.isValid()&&editor.blur()}),editor.on(BI.SignEditor.EVENT_START,function(){self.fireEvent(BI.DynamicYearQuarterTrigger.EVENT_START)}),editor.on(BI.SignEditor.EVENT_ERROR,function(){self.fireEvent(BI.DynamicYearQuarterTrigger.EVENT_ERROR)}),editor.on(BI.SignEditor.EVENT_CHANGE,function(){isYear&&self._autoSwitch(editor)}),editor},_doEditorConfirm:function(editor){var value=editor.getValue();BI.isNotNull(value)&&editor.setValue(value);var quarterValue=this.quarterEditor.getValue();this.storeValue={type:BI.DynamicYearQuarterCombo.Static,value:{year:this.yearEditor.getValue(),quarter:BI.isEmptyString(this.quarterEditor.getValue())?"":quarterValue}},this.setTitle(this._getStaticTitle(this.storeValue.value))},_yearCheck:function(v){var date=BI.print(BI.parseDateTime(v,"%Y-%X-%d"),"%Y-%X-%d");return BI.print(BI.parseDateTime(v,"%Y"),"%Y")===v&&date>=this.options.min&&date<=this.options.max},_autoSwitch:function(editor){var v=editor.getValue();BI.isNotEmptyString(v)&&BI.checkDateLegal(v)&&4===v.length&&this._yearCheck(v)&&(this._doEditorConfirm(editor),this.fireEvent(BI.DynamicYearQuarterTrigger.EVENT_CONFIRM),this.quarterEditor.focus())},_getStaticTitle:function(value){value=value||{};var hasYear=!(BI.isNull(value.year)||BI.isEmptyString(value.year)),hasMonth=!(BI.isNull(value.quarter)||BI.isEmptyString(value.quarter));switch(hasYear<<1|hasMonth){case 0:return"";case 1:return value.quarter;case 2:return value.year;case 3:default:return value.year+"-"+value.quarter}},_getText:function(obj){var value="";return BI.isNotNull(obj.year)&&0!==BI.parseInt(obj.year)&&(value+=Math.abs(obj.year)+BI.i18nText("BI-Basic_Year")+(obj.year<0?BI.i18nText("BI-Basic_Front"):BI.i18nText("BI-Basic_Behind"))),BI.isNotNull(obj.quarter)&&0!==BI.parseInt(obj.quarter)&&(value+=Math.abs(obj.quarter)+BI.i18nText("BI-Basic_Single_Quarter")+(obj.quarter<0?BI.i18nText("BI-Basic_Front"):BI.i18nText("BI-Basic_Behind"))),value},_setInnerValue:function(date,text){var dateStr=BI.print(date,"%Y-%Q");this.yearEditor.setValue(date.getFullYear()),this.quarterEditor.setValue(BI.getQuarter(date)),this.setTitle(BI.isEmptyString(text)?dateStr:text+":"+dateStr)},setValue:function(v){var type,value,date=BI.getDate();switch(this.storeValue=v,BI.isNotNull(v)&&(type=v.type||BI.DynamicYearQuarterCombo.Static,value=v.value||v),type){case BI.DynamicYearQuarterCombo.Dynamic:var text=this._getText(value);date=BI.DynamicDateHelper.getCalculation(value),this._setInnerValue(date,text);break;case BI.DynamicYearQuarterCombo.Static:default:value=value||{};var quarter=BI.isNull(value.quarter)?null:value.quarter;this.yearEditor.setValue(value.year),this.yearEditor.setTitle(value.year),this.quarterEditor.setValue(quarter),this.quarterEditor.setTitle(quarter),this.setTitle(this._getStaticTitle(value))}},getValue:function(){return this.storeValue},getKey:function(){return this.yearEditor.getValue()+"-"+this.quarterEditor.getValue()}}),BI.DynamicYearQuarterTrigger.EVENT_FOCUS="EVENT_FOCUS",BI.DynamicYearQuarterTrigger.EVENT_ERROR="EVENT_ERROR",BI.DynamicYearQuarterTrigger.EVENT_START="EVENT_START",BI.DynamicYearQuarterTrigger.EVENT_CONFIRM="EVENT_CONFIRM",BI.DynamicYearQuarterTrigger.EVENT_STOP="EVENT_STOP",BI.DynamicYearQuarterTrigger.EVENT_KEY_DOWN="EVENT_KEY_DOWN",BI.shortcut("bi.dynamic_year_quarter_trigger",BI.DynamicYearQuarterTrigger),BI.AbstractAllValueChooser=BI.inherit(BI.Widget,{_const:{perPage:100},_defaultConfig:function(){return BI.extend(BI.AbstractAllValueChooser.superclass._defaultConfig.apply(this,arguments),{width:200,height:30,items:null,itemsCreator:BI.emptyFn,cache:!0})},_valueFormatter:function(v){var text=v;return BI.isNotNull(this.items)&&BI.some(this.items,function(i,item){if(item.value===v||item.value+""===v)return text=item.text,!0}),text},_itemsCreator:function(options,callback){function call(items){var keywords=(options.keywords||[]).slice();options.keyword&&keywords.push(options.keyword);var resultItems=items;if(BI.isNotEmptyArray(keywords)&&(resultItems=[],BI.each(keywords,function(i,kw){var search=BI.Func.getSearchResult(items,kw);resultItems=resultItems.concat(search.match).concat(search.find)}),resultItems=BI.uniq(resultItems)),options.selectedValues){var filter=BI.makeObject(options.selectedValues,!0);resultItems=BI.filter(resultItems,function(i,ob){return!filter[ob.value]})}return options.type===BI.MultiSelectCombo.REQ_GET_ALL_DATA?void callback({items:resultItems}):options.type===BI.MultiSelectCombo.REQ_GET_DATA_LENGTH?void callback({count:resultItems.length}):void callback({items:resultItems,hasNext:!1})}var self=this,o=this.options;o.cache&&this.items?call(this.items):o.itemsCreator({},function(items){self.items=items,call(items)})}}),BI.AllValueChooserCombo=BI.inherit(BI.AbstractAllValueChooser,{_defaultConfig:function(){return BI.extend(BI.AllValueChooserCombo.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-all-value-chooser-combo",width:200,height:24,items:null,itemsCreator:BI.emptyFn,cache:!0})},_init:function(){BI.AllValueChooserCombo.superclass._init.apply(this,arguments);var self=this,o=this.options;BI.isNotNull(o.items)&&(this.items=o.items),this.combo=BI.createWidget({type:"bi.multi_select_combo",text:o.text,element:this,itemsCreator:BI.bind(this._itemsCreator,this),valueFormatter:BI.bind(this._valueFormatter,this),width:o.width,height:o.height,value:{type:BI.Selection.Multi,value:o.value||[]}}),this.combo.on(BI.MultiSelectCombo.EVENT_CONFIRM,function(){self.fireEvent(BI.AllValueChooserCombo.EVENT_CONFIRM)})},setValue:function(v){this.combo.setValue({type:BI.Selection.Multi,value:v||[]})},getValue:function(){var val=this.combo.getValue()||{};return val.type===BI.Selection.All?val.assist:val.value||[]},populate:function(items){this.items=items,this.combo.populate.apply(this,arguments)}}),BI.AllValueChooserCombo.EVENT_CONFIRM="EVENT_CONFIRM",BI.shortcut("bi.all_value_chooser_combo",BI.AllValueChooserCombo),BI.AllValueChooserPane=BI.inherit(BI.AbstractAllValueChooser,{_defaultConfig:function(){return BI.extend(BI.AllValueChooserPane.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-all-value-chooser-pane",width:200,height:30,items:null,itemsCreator:BI.emptyFn,cache:!0})},_init:function(){BI.AllValueChooserPane.superclass._init.apply(this,arguments);var self=this,o=this.options;BI.isNotNull(o.items)&&(this.items=o.items),this.list=BI.createWidget({type:"bi.multi_select_list",element:this,itemsCreator:BI.bind(this._itemsCreator,this),valueFormatter:BI.bind(this._valueFormatter,this),width:o.width,height:o.height}),this.list.on(BI.MultiSelectList.EVENT_CHANGE,function(){self.fireEvent(BI.AllValueChooserPane.EVENT_CHANGE)})},setValue:function(v){this.list.setValue({type:BI.Selection.Multi,value:v||[]})},getValue:function(){var val=this.list.getValue()||{};return val.type===BI.Selection.All?val.assist:val.value||[]},populate:function(items){this.items=items,this.list.populate.apply(this.list,arguments)}}),BI.AllValueChooserPane.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.all_value_chooser_pane",BI.AllValueChooserPane),BI.AllValueMultiTextValueCombo=BI.inherit(BI.Widget,{props:{baseCls:"bi-all-value-multi-text-value-combo",width:200,height:24,items:[]},render:function(){var self=this,o=this.options,value=this._digestValue(o.value);return{type:"bi.search_multi_text_value_combo",text:o.text,height:o.height,items:o.items,value:value,numOfPage:100,valueFormatter:o.valueFormatter,warningTitle:o.warningTitle,listeners:[{eventName:BI.SearchMultiTextValueCombo.EVENT_CONFIRM,action:function(){self.fireEvent(BI.AllValueMultiTextValueCombo.EVENT_CONFIRM)}}],ref:function(){self.combo=this}}},setValue:function(v){var value=this._digestValue(v);this.combo.setValue(value)},getValue:function(){var obj=this.combo.getValue()||{};if(obj.value=obj.value||[],obj.type===BI.Selection.All){var values=[];return BI.each(this.options.items,function(idx,item){!BI.contains(obj.value,item.value)&&values.push(item.value)}),values}return obj.value||[]},populate:function(items){this.options.items=items,this.combo.populate.apply(this,arguments)},_digestValue:function(v){return{type:BI.Selection.Multi,value:v||[]}}}),BI.AllValueMultiTextValueCombo.EVENT_CONFIRM="EVENT_CONFIRM",BI.shortcut("bi.all_value_multi_text_value_combo",BI.AllValueMultiTextValueCombo),BI.AbstractTreeValueChooser=BI.inherit(BI.Widget,{_const:{perPage:100},_defaultConfig:function(){return BI.extend(BI.AbstractTreeValueChooser.superclass._defaultConfig.apply(this,arguments),{items:null,itemsCreator:BI.emptyFn,open:!1})},_valueFormatter:function(v){var text=v;return BI.isNotNull(this.items)&&BI.some(this.items,function(i,item){if(item.value===v||item.value+""===v)return text=item.text,!0}),text},_initData:function(items){this.items=items;var nodes=BI.Tree.treeFormat(items);this.tree=new BI.Tree,this.tree.initTree(nodes)},_itemsCreator:function(options,callback){function call(){switch(options.type){case BI.TreeView.REQ_TYPE_INIT_DATA:self._reqInitTreeNode(options,callback);break;case BI.TreeView.REQ_TYPE_ADJUST_DATA:self._reqAdjustTreeNode(options,callback);break;case BI.TreeView.REQ_TYPE_SELECT_DATA:self._reqSelectedTreeNode(options,callback);break;case BI.TreeView.REQ_TYPE_GET_SELECTED_DATA:self._reqDisplayTreeNode(options,callback);break;default:self._reqTreeNode(options,callback)}}var self=this,o=this.options;this.items?call():o.itemsCreator({},function(items){self._initData(items),call()})},_reqDisplayTreeNode:function(op,callback){function doCheck(parentValues,node,selected){return null==selected||BI.isEmpty(selected)?void BI.each(node.getChildren(),function(i,child){var newParents=BI.clone(parentValues);newParents.push(child.value);var llen=self._getChildCount(newParents);createOneJson(child,node.id,llen),doCheck(newParents,child,{})}):void BI.each(selected,function(k){var node=self._getTreeNode(parentValues,k);if(BI.isNull(node))createOneJson({id:BI.UUID(),text:k,value:k},BI.UUID(),0);else{var newParents=BI.clone(parentValues);newParents.push(node.value),createOneJson(node,node.parent&&node.parent.id,getCount(selected[k],newParents)),doCheck(newParents,node,selected[k])}})}function getCount(jo,parentValues){return null==jo?0:BI.isEmpty(jo)?self._getChildCount(parentValues):BI.size(jo)}function createOneJson(node,pId,llen){result.push({id:node.id,pId:pId,text:node.text+(llen>0?"("+BI.i18nText("BI-Basic_Altogether")+llen+BI.i18nText("BI-Basic_Count")+")":""),value:node.value,open:!0})}var self=this,result=[],selectedValues=op.selectedValues;return null==selectedValues||BI.isEmpty(selectedValues)?void callback({}):(doCheck([],this.tree.getRoot(),selectedValues),void callback({items:result}))},_reqSelectedTreeNode:function(op,callback){function dealWithSelectedValues(selectedValues){var p=parentValues.concat(notSelectedValue);if(canFindKey(selectedValues,p))if(isSearchValueInParent(p))self._deleteNode(selectedValues,p);else{var searched=[],find=search(parentValues,notSelectedValue,[],searched);find&&BI.isNotEmptyArray(searched)&&BI.each(searched,function(i,arr){var node=self._getNode(selectedValues,arr);node?self._deleteNode(selectedValues,arr):expandSelectedValue(selectedValues,arr,BI.last(arr))})}if(isChild(selectedValues,p)){var result=[],find=!1;isSearchValueInParent(p)?find=!0:(find=search(parentValues,notSelectedValue,result),p=parentValues),find===!0&&(expandSelectedValue(selectedValues,p,notSelectedValue),result.length>0&&BI.each(result,function(i,strs){self._buildTree(selectedValues,strs)}))}}function expandSelectedValue(selectedValues,parents,notSelectedValue){var next=selectedValues,childrenCount=[],path=[];BI.some(parents,function(i,v){var t=next[v];if(null==t){if(0===i)return!0;if(!BI.isEmpty(next))return!0;var split=parents.slice(0,i),expanded=self._getChildren(split);if(path.push(split),childrenCount.push(expanded.length),i===parents.length-1&&1===expanded.length&&expanded[0].value===notSelectedValue)for(var j=childrenCount.length-1;j>=0&&1===childrenCount[j];j--)self._deleteNode(selectedValues,path[j]);else BI.each(expanded,function(m,child){return i===parents.length-1&&child.value===notSelectedValue||void(next[child.value]={})});next=next[v]}else next=t})}function search(parents,current,result,searched){var newParents=BI.clone(parents);if(newParents.push(current),self._isMatch(parents,current,keyword))return searched&&searched.push(newParents),!0;var children=self._getChildren(newParents),notSearch=[],can=!1;return BI.each(children,function(i,child){search(newParents,child.value,result,searched)?can=!0:notSearch.push(child.value)}),can===!0&&BI.each(notSearch,function(i,v){var next=BI.clone(newParents);next.push(v),result.push(next)}),can}function isSearchValueInParent(parentValues){for(var i=0,len=parentValues.length;iself._const.perPage)break}if(1===op.times){var nodes=self._getAddedValueNode([],selectedValues);result=BI.concat(BI.filter(nodes,function(idx,node){var find=BI.Func.getSearchResult([node.text||node.value],keyword);return find.find.length>0||find.match.length>0}),result)}return output}function nodeSearch(deep,parentValues,current,isAllSelect,result){if(self._isMatch(parentValues,current,keyword)){var checked=isAllSelect||isSelected(parentValues,current);return createOneJson(parentValues,current,!1,checked,!isAllSelect&&isHalf(parentValues,current),!0,result),[!0,checked]}var newParents=BI.clone(parentValues);newParents.push(current);var children=self._getChildren(newParents),can=!1,checked=!1,isCurAllSelected=isAllSelect||isAllSelected(parentValues,current);return BI.each(children,function(i,child){var state=nodeSearch(deep+1,newParents,child.value,isCurAllSelected,result);state[1]===!0&&(checked=!0),state[0]===!0&&(can=!0)}),can===!0&&(checked=isCurAllSelected||isSelected(parentValues,current)&&checked,createOneJson(parentValues,current,!0,checked,!1,!1,result)),[can,checked]}function createOneJson(parentValues,value,isOpen,checked,half,flag,result){var node=self._getTreeNode(parentValues,value);result.push({id:node.id,pId:node.pId,text:node.text,value:node.value,title:node.title,isParent:node.getChildrenLength()>0,open:isOpen,checked:checked,halfCheck:half,flag:flag})}function isHalf(parentValues,value){var find=findSelectedObj(parentValues);return null==find?null:BI.any(find,function(v,ob){if(v===value&&null!=ob&&!BI.isEmpty(ob))return!0})}function isAllSelected(parentValues,value){var find=findSelectedObj(parentValues);return null==find?null:BI.any(find,function(v,ob){if(v===value&&null!=ob&&BI.isEmpty(ob))return!0})}function isSelected(parentValues,value){var find=findSelectedObj(parentValues);return null!=find&&BI.any(find,function(v){if(v===value)return!0})}function findSelectedObj(parentValues){var find=selectedValues;return null==find?null:(BI.every(parentValues,function(i,v){return find=find[v],null!=find}),find)}var self=this,result=[],keyword=op.keyword||"",selectedValues=op.selectedValues,lastSearchValue=op.lastSearchValue||"",output=search();BI.nextTick(function(){callback({hasNext:output.length>self._const.perPage,items:result,lastSearchValue:BI.last(output)})})},_reqTreeNode:function(op,callback){function judgeState(parentValues,selected_value,checkState){var checked=checkState.checked,half=checkState.half;return!(parentValues.length>0&&!checked)&&(0===parentValues.length||checked&&half&&!BI.isEmpty(selected_value))}function dealWithSelectedValue(parentValues,selectedValues){var valueMap={};return BI.each(parentValues,function(i,v){selectedValues=selectedValues[v]||{}}),BI.each(selectedValues,function(value,obj){if(BI.isNull(obj))return void(valueMap[value]=[0,0]);if(BI.isEmpty(obj))return void(valueMap[value]=[2,0]);var nextNames={};BI.each(obj,function(t,o){(BI.isNull(o)||BI.isEmpty(o))&&(nextNames[t]=!0)}),valueMap[value]=[1,BI.size(nextNames)]}),valueMap}function getCheckState(current,parentValues,valueMap,checkState){var checked=checkState.checked,half=checkState.half,tempCheck=!1,halfCheck=!1;if(BI.has(valueMap,current))if(1===valueMap[current][0]){var values=BI.clone(parentValues);values.push(current);var childCount=self._getChildCount(values);childCount>0&&childCount!==valueMap[current][1]&&(halfCheck=!0)}else 2===valueMap[current][0]&&(tempCheck=!0);var check;return check=checked||halfCheck||tempCheck?(tempCheck||checked)&&!half||BI.has(valueMap,current):BI.has(valueMap,current),[check,halfCheck]}var self=this,o=this.options,result=[],times=op.times,checkState=op.checkState||{},parentValues=op.parentValues||[],selectedValues=op.selectedValues||{},valueMap={};valueMap=dealWithSelectedValue(parentValues,selectedValues);for(var nodes=this._getChildren(parentValues),i=(times-1)*this._const.perPage;nodes[i]&&i0,checked:state[0],halfCheck:state[1],open:o.open})}if(o.open){var allNodes=[];BI.each(nodes,function(idx,node){allNodes=BI.concat(allNodes,self._getAllChildren(parentValues.concat([node.value])))}),BI.each(allNodes,function(idx,node){var valueMap=dealWithSelectedValue(node.parentValues,selectedValues),state=getCheckState(node.value,node.parentValues,valueMap,checkState);result.push({id:node.id,pId:node.pId,value:node.value,text:node.text,times:1,isParent:node.getChildrenLength()>0,checked:state[0],halfCheck:state[1],open:self.options.open})})}0===parentValues.length&&1===times&&(result=BI.concat(self._getAddedValueNode(parentValues,selectedValues),result)),BI.nextTick(function(){callback({items:result,hasNext:nodes.length>times*self._const.perPage})})},_getAddedValueNode:function(parentValues,selectedValues){var nodes=this._getChildren(parentValues);return BI.map(BI.difference(BI.keys(selectedValues),BI.map(nodes,"value")),function(idx,v){return{id:BI.UUID(),pId:nodes.length>0?nodes[0].pId:BI.UUID(),value:v,text:v,times:1,isParent:!1,checked:!0,halfCheck:!1}})},_getNode:function(selectedValues,parentValues){for(var pNode=selectedValues,i=0,len=parentValues.length;i0&&BI.isEmpty(pNode);)name=p[p.length-1],p=p.slice(0,p.length-1),pNode=this._getNode(selectedValues,p),null!=pNode&&delete pNode[name]},_buildTree:function(jo,values){var t=jo;BI.each(values,function(i,v){BI.has(t,v)||(t[v]={}),t=t[v]})},_isMatch:function(parentValues,value,keyword){var o=this.options,node=this._getTreeNode(parentValues,value);if(!node)return!1;var find=BI.Func.getSearchResult([node.text||node.value],keyword);if(o.allowSearchValue&&node.value){var valueFind=BI.Func.getSearchResult([node.value],keyword);return valueFind.find.length>0||valueFind.match.length>0||find.find.length>0||find.match.length>0}return find.find.length>0||find.match.length>0},_getTreeNode:function(parentValues,v){var self=this,findParentNode,index=0;return this.tree.traverse(function(node){if(!self.tree.isRoot(node))return!(index>parentValues.length)&&(index===parentValues.length&&node.value===v?(findParentNode=node,!1):node.value!==parentValues[index]||void index++)}),findParentNode},_getChildren:function(parentValues){if(parentValues.length>0)var value=BI.last(parentValues),parent=this._getTreeNode(parentValues.slice(0,parentValues.length-1),value);else var parent=this.tree.getRoot();return parent.getChildren()},_getAllChildren:function(parentValues){var children=this._getChildren(parentValues),nodes=[].concat(children);BI.each(nodes,function(idx,node){node.parentValues=parentValues});for(var queue=BI.map(children,function(idx,node){return{parentValues:parentValues,value:node.value}});BI.isNotEmptyArray(queue);){var node=queue.shift(),pValues=node.parentValues.concat(node.value),childNodes=this._getChildren(pValues);BI.each(childNodes,function(idx,node){node.parentValues=pValues}),queue=queue.concat(childNodes),nodes=nodes.concat(childNodes)}return nodes},_getChildCount:function(parentValues){return this._getChildren(parentValues).length}}),BI.AbstractListTreeValueChooser=BI.inherit(BI.AbstractTreeValueChooser,{_reqDisplayTreeNode:function(op,callback){function doCheck(parentValues,node,selected){BI.each(selected,function(idx,path){BI.each(path,function(id,value){var nodeValue=value,node=self._getTreeNode(path.slice(0,id),nodeValue);BI.isNull(node)?createOneJson({id:BI.UUID(),text:nodeValue,value:nodeValue,isLeaf:!0},BI.UUID()):(BI.has(result,node.id)||createOneJson(node,node.parent&&node.parent.id),result[node.id].isLeaf!==!0&&(result[node.id].isLeaf=id===path.length-1))})})}function createOneJson(node,pId){ +result[node.id]={id:node.id,pId:pId,text:node.text,value:node.value,open:!0,isLeaf:node.isLeaf}}var self=this,result={},selectedValues=op.selectedValues;return null==selectedValues||BI.isEmpty(selectedValues)?void callback({}):(doCheck([],this.tree.getRoot(),selectedValues),void callback({items:BI.values(result)}))},_reqInitTreeNode:function(op,callback){function search(){var children=self._getChildren([]),start=children.length;if(""!==lastSearchValue){for(var j=0,len=start;jself._const.perPage)break}if(1===op.times){var nodes=self._getAddedValueNode([],selectedValues);result=BI.concat(BI.filter(nodes,function(idx,node){var find=BI.Func.getSearchResult([node.text||node.value],keyword);return find.find.length>0||find.match.length>0}),result)}return output}function nodeSearch(deep,parentValues,current,result){if(self._isMatch(parentValues,current,keyword)){var checked=isSelected(current);return createOneJson(parentValues,current,!1,checked,!0,result),[!0,checked]}var newParents=BI.clone(parentValues);newParents.push(current);var children=self._getChildren(newParents),can=!1,checked=!1;return BI.each(children,function(i,child){var state=nodeSearch(deep+1,newParents,child.value,result);state[1]===!0&&(checked=!0),state[0]===!0&&(can=!0)}),can===!0&&(checked=isSelected(current),createOneJson(parentValues,current,!0,checked,!1,result)),[can,checked]}function createOneJson(parentValues,value,isOpen,checked,flag,result){var node=self._getTreeNode(parentValues,value);result.push({id:node.id,pId:node.pId,text:node.text,value:node.value,title:node.title,isParent:node.getChildrenLength()>0,open:isOpen,checked:checked,halfCheck:!1,flag:flag})}function isHalf(parentValues,value){var find=findSelectedObj(parentValues);return null==find?null:BI.any(find,function(v,ob){if(v===value&&null!=ob&&!BI.isEmpty(ob))return!0})}function isAllSelected(parentValues,value){var find=findSelectedObj(parentValues);return null==find?null:BI.any(find,function(v,ob){if(v===value&&null!=ob&&BI.isEmpty(ob))return!0})}function isSelected(value){return BI.any(selectedValues,function(idx,array){return BI.last(array)===value})}function findSelectedObj(parentValues){var find=selectedValues;return null==find?null:(BI.every(parentValues,function(i,v){return find=find[v],null!=find}),find)}var self=this,result=[],keyword=op.keyword||"",selectedValues=op.selectedValues,lastSearchValue=op.lastSearchValue||"",output=search();BI.nextTick(function(){callback({hasNext:output.length>self._const.perPage,items:result,lastSearchValue:BI.last(output)})})},_reqTreeNode:function(op,callback){function dealWithSelectedValue(selectedValues){var valueMap={};return BI.each(selectedValues,function(idx,v){valueMap[BI.last(v)]=[2,0]}),valueMap}for(var self=this,o=this.options,result=[],times=op.times,parentValues=op.parentValues||[],selectedValues=op.selectedValues||[],valueMap=dealWithSelectedValue(selectedValues),nodes=this._getChildren(parentValues),i=(times-1)*this._const.perPage;nodes[i]&&i0,checked:checked,halfCheck:!1,open:o.open})}if(o.open){var allNodes=[];BI.each(nodes,function(idx,node){allNodes=BI.concat(allNodes,self._getAllChildren(parentValues.concat([node.value])))}),BI.each(allNodes,function(idx,node){var checked=BI.has(valueMap,node.value);result.push({id:node.id,pId:node.pId,value:node.value,text:node.text,times:1,isParent:node.getChildrenLength()>0,checked:checked,halfCheck:!1,open:o.open})})}0===parentValues.length&&1===times&&(result=BI.concat(self._getAddedValueNode(parentValues,selectedValues),result)),BI.nextTick(function(){callback({items:result,hasNext:nodes.length>times*self._const.perPage})})},_getAddedValueNode:function(parentValues,selectedValues){var nodes=this._getChildren(parentValues),values=BI.flatten(BI.filter(selectedValues,function(idx,array){return 1===array.length}));return BI.map(BI.difference(values,BI.map(nodes,"value")),function(idx,v){return{id:BI.UUID(),pId:nodes.length>0?nodes[0].pId:BI.UUID(),value:v,text:v,times:1,isParent:!1,checked:!0,halfCheck:!1}})}}),BI.ListTreeValueChooserInsertCombo=BI.inherit(BI.AbstractListTreeValueChooser,{_defaultConfig:function(){return BI.extend(BI.ListTreeValueChooserInsertCombo.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-list-tree-value-chooser-insert-combo",width:200,height:24,items:null,itemsCreator:BI.emptyFn})},_init:function(){BI.ListTreeValueChooserInsertCombo.superclass._init.apply(this,arguments);var self=this,o=this.options;BI.isNotNull(o.items)&&this._initData(o.items),this.combo=BI.createWidget({type:"bi.multi_tree_list_combo",element:this,text:o.text,value:o.value,watermark:o.watermark,allowInsertValue:o.allowInsertValue,allowEdit:o.allowEdit,itemsCreator:BI.bind(this._itemsCreator,this),valueFormatter:BI.bind(this._valueFormatter,this),width:o.width,height:o.height,listeners:[{eventName:BI.MultiTreeListCombo.EVENT_FOCUS,action:function(){self.fireEvent(BI.ListTreeValueChooserInsertCombo.EVENT_FOCUS)}},{eventName:BI.MultiTreeListCombo.EVENT_BLUR,action:function(){self.fireEvent(BI.ListTreeValueChooserInsertCombo.EVENT_BLUR)}},{eventName:BI.MultiTreeListCombo.EVENT_STOP,action:function(){self.fireEvent(BI.ListTreeValueChooserInsertCombo.EVENT_STOP)}},{eventName:BI.MultiTreeListCombo.EVENT_CLICK_ITEM,action:function(){self.fireEvent(BI.ListTreeValueChooserInsertCombo.EVENT_CLICK_ITEM)}},{eventName:BI.MultiTreeListCombo.EVENT_SEARCHING,action:function(){self.fireEvent(BI.ListTreeValueChooserInsertCombo.EVENT_SEARCHING)}},{eventName:BI.MultiTreeListCombo.EVENT_CONFIRM,action:function(){self.fireEvent(BI.ListTreeValueChooserInsertCombo.EVENT_CONFIRM)}}]})},setValue:function(v){this.combo.setValue(v)},getValue:function(){return this.combo.getValue()},populate:function(items){this._initData(items),this.combo.populate.apply(this.combo,arguments)}}),BI.ListTreeValueChooserInsertCombo.EVENT_FOCUS="EVENT_FOCUS",BI.ListTreeValueChooserInsertCombo.EVENT_BLUR="EVENT_BLUR",BI.ListTreeValueChooserInsertCombo.EVENT_STOP="EVENT_STOP",BI.ListTreeValueChooserInsertCombo.EVENT_CLICK_ITEM="EVENT_CLICK_ITEM",BI.ListTreeValueChooserInsertCombo.EVENT_SEARCHING="EVENT_SEARCHING",BI.ListTreeValueChooserInsertCombo.EVENT_CONFIRM="EVENT_CONFIRM",BI.shortcut("bi.list_tree_value_chooser_insert_combo",BI.ListTreeValueChooserInsertCombo),BI.TreeValueChooserInsertCombo=BI.inherit(BI.AbstractTreeValueChooser,{_defaultConfig:function(){return BI.extend(BI.TreeValueChooserInsertCombo.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-tree-value-chooser-insert-combo",width:200,height:24,items:null,itemsCreator:BI.emptyFn})},_init:function(){BI.TreeValueChooserInsertCombo.superclass._init.apply(this,arguments);var self=this,o=this.options;BI.isNotNull(o.items)&&this._initData(o.items),this.combo=BI.createWidget({type:"bi.multi_tree_insert_combo",text:o.text,value:o.value,watermark:o.watermark,element:this,itemsCreator:BI.bind(this._itemsCreator,this),valueFormatter:BI.bind(this._valueFormatter,this),width:o.width,height:o.height,listeners:[{eventName:BI.MultiTreeInsertCombo.EVENT_FOCUS,action:function(){self.fireEvent(BI.TreeValueChooserCombo.EVENT_FOCUS)}},{eventName:BI.MultiTreeInsertCombo.EVENT_BLUR,action:function(){self.fireEvent(BI.TreeValueChooserCombo.EVENT_BLUR)}},{eventName:BI.MultiTreeInsertCombo.EVENT_STOP,action:function(){self.fireEvent(BI.TreeValueChooserInsertCombo.EVENT_STOP)}},{eventName:BI.MultiTreeInsertCombo.EVENT_CLICK_ITEM,action:function(){self.fireEvent(BI.TreeValueChooserInsertCombo.EVENT_CLICK_ITEM)}},{eventName:BI.MultiTreeInsertCombo.EVENT_SEARCHING,action:function(){self.fireEvent(BI.TreeValueChooserInsertCombo.EVENT_SEARCHING)}},{eventName:BI.MultiTreeInsertCombo.EVENT_CONFIRM,action:function(){self.fireEvent(BI.TreeValueChooserInsertCombo.EVENT_CONFIRM)}}]})},setValue:function(v){this.combo.setValue(v)},getValue:function(){return this.combo.getValue()},populate:function(items){this._initData(items),this.combo.populate.apply(this.combo,arguments)}}),BI.TreeValueChooserInsertCombo.EVENT_FOCUS="EVENT_FOCUS",BI.TreeValueChooserInsertCombo.EVENT_BLUR="EVENT_BLUR",BI.TreeValueChooserInsertCombo.EVENT_STOP="EVENT_STOP",BI.TreeValueChooserInsertCombo.EVENT_CLICK_ITEM="EVENT_CLICK_ITEM",BI.TreeValueChooserInsertCombo.EVENT_SEARCHING="EVENT_SEARCHING",BI.TreeValueChooserInsertCombo.EVENT_CONFIRM="EVENT_CONFIRM",BI.shortcut("bi.tree_value_chooser_insert_combo",BI.TreeValueChooserInsertCombo),BI.TreeValueChooserCombo=BI.inherit(BI.AbstractTreeValueChooser,{_defaultConfig:function(){return BI.extend(BI.TreeValueChooserCombo.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-tree-value-chooser-combo",width:200,height:24,items:null,itemsCreator:BI.emptyFn})},_init:function(){BI.TreeValueChooserCombo.superclass._init.apply(this,arguments);var self=this,o=this.options;BI.isNotNull(o.items)&&this._initData(o.items),this.combo=BI.createWidget({type:"bi.multi_tree_combo",text:o.text,value:o.value,watermark:o.watermark,element:this,itemsCreator:BI.bind(this._itemsCreator,this),valueFormatter:BI.bind(this._valueFormatter,this),width:o.width,height:o.height,listeners:[{eventName:BI.MultiTreeCombo.EVENT_FOCUS,action:function(){self.fireEvent(BI.TreeValueChooserCombo.EVENT_FOCUS)}},{eventName:BI.MultiTreeCombo.EVENT_BLUR,action:function(){self.fireEvent(BI.TreeValueChooserCombo.EVENT_BLUR)}},{eventName:BI.MultiTreeCombo.EVENT_STOP,action:function(){self.fireEvent(BI.TreeValueChooserCombo.EVENT_STOP)}},{eventName:BI.MultiTreeCombo.EVENT_CLICK_ITEM,action:function(){self.fireEvent(BI.TreeValueChooserCombo.EVENT_CLICK_ITEM)}},{eventName:BI.MultiTreeCombo.EVENT_SEARCHING,action:function(){self.fireEvent(BI.TreeValueChooserCombo.EVENT_SEARCHING)}},{eventName:BI.MultiTreeCombo.EVENT_CONFIRM,action:function(){self.fireEvent(BI.TreeValueChooserCombo.EVENT_CONFIRM)}}]})},setValue:function(v){this.combo.setValue(v)},getValue:function(){return this.combo.getValue()},populate:function(items){this._initData(items),this.combo.populate.apply(this.combo,arguments)}}),BI.TreeValueChooserCombo.EVENT_CONFIRM="EVENT_CONFIRM",BI.TreeValueChooserCombo.EVENT_FOCUS="EVENT_FOCUS",BI.TreeValueChooserCombo.EVENT_BLUR="EVENT_BLUR",BI.TreeValueChooserCombo.EVENT_STOP="EVENT_STOP",BI.TreeValueChooserCombo.EVENT_CLICK_ITEM="EVENT_CLICK_ITEM",BI.TreeValueChooserCombo.EVENT_SEARCHING="EVENT_SEARCHING",BI.shortcut("bi.tree_value_chooser_combo",BI.TreeValueChooserCombo),BI.TreeValueChooserPane=BI.inherit(BI.AbstractTreeValueChooser,{_defaultConfig:function(){return BI.extend(BI.TreeValueChooserPane.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-tree-value-chooser-pane",items:null,itemsCreator:BI.emptyFn})},_init:function(){BI.TreeValueChooserPane.superclass._init.apply(this,arguments);var self=this,o=this.options;this.pane=BI.createWidget({type:"bi.multi_select_tree",element:this,itemsCreator:BI.bind(this._itemsCreator,this)}),this.pane.on(BI.MultiSelectTree.EVENT_CHANGE,function(){self.fireEvent(BI.TreeValueChooserPane.EVENT_CHANGE)}),BI.isNotNull(o.items)&&(this._initData(o.items),this.populate())},setSelectedValue:function(v){this.pane.setSelectedValue(v)},setValue:function(v){this.pane.setValue(v)},getValue:function(){return this.pane.getValue()},populate:function(){this.pane.populate.apply(this.pane,arguments)}}),BI.TreeValueChooserPane.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.tree_value_chooser_pane",BI.TreeValueChooserPane),BI.AbstractValueChooser=BI.inherit(BI.Widget,{_const:{perPage:100},_defaultConfig:function(){return BI.extend(BI.AbstractValueChooser.superclass._defaultConfig.apply(this,arguments),{items:null,itemsCreator:BI.emptyFn,cache:!0})},_valueFormatter:function(v){var text=v;return BI.isNotNull(this.items)&&BI.some(this.items,function(i,item){if(item.value===v||item.value+""===v)return text=item.text,!0}),text},_getItemsByTimes:function(items,times){for(var res=[],i=(times-1)*this._const.perPage;items[i]&&i"+i+""};t.exports=function(n,t){var r={};r[n]=t(f),e(e.P+e.F*i(function(){var t=""[n]('"');return t!==t.toLowerCase()||3document.F=Object<\/script>"),t.close(),s=t.F;r--;)delete s[a][u[r]];return s()};t.exports=Object.create||function(t,n){var r;return null!==t?(f[a]=i(t),r=new f,f[a]=null,r[c]=t):r=s(),n===undefined?r:o(r,n)}},function(t,n,r){var e=r(90),i=r(63).concat("length","prototype");n.f=Object.getOwnPropertyNames||function(t){return e(t,i)}},function(t,n,r){var e=r(13),i=r(10),o=r(62)("IE_PROTO"),u=Object.prototype;t.exports=Object.getPrototypeOf||function(t){return t=i(t),e(t,o)?t[o]:"function"==typeof t.constructor&&t instanceof t.constructor?t.constructor.prototype:t instanceof Object?u:null}},function(t,n,r){var e=r(5)("unscopables"),i=Array.prototype;i[e]==undefined&&r(14)(i,e,{}),t.exports=function(t){i[e][t]=!0}},function(t,n,r){var e=r(4);t.exports=function(t,n){if(!e(t)||t._t!==n)throw TypeError("Incompatible receiver, "+n+" required!");return t}},function(t,n,r){var e=r(9).f,i=r(13),o=r(5)("toStringTag");t.exports=function(t,n,r){t&&!i(t=r?t:t.prototype,o)&&e(t,o,{configurable:!0,value:n})}},function(t,n,r){var u=r(0),e=r(24),c=r(2),f=r(66),i="["+f+"]",o=RegExp("^"+i+i+"*"),a=RegExp(i+i+"*$"),s=function s(t,n,r){var e={},i=c(function(){return!!f[t]()||"​…"!="​…"[t]()}),o=e[t]=i?n(l):f[t];r&&(e[r]=o),u(u.P+u.F*i,"String",e)},l=s.trim=function(t,n){return t=String(e(t)),1&n&&(t=t.replace(o,"")),2&n&&(t=t.replace(a,"")),t};t.exports=s},function(t,n){t.exports={}},function(t,n,r){"use strict";var e=r(1),i=r(9),o=r(8),u=r(5)("species");t.exports=function(t){var n=e[t];o&&n&&!n[u]&&i.f(n,u,{configurable:!0,get:function(){return this}})}},function(t,n){t.exports=function(t,n,r,e){if(!(t instanceof n)||e!==undefined&&e in t)throw TypeError(r+": incorrect invocation!");return t}},function(t,n,r){var i=r(11);t.exports=function(t,n,r){for(var e in n)i(t,e,n[e],r);return t}},function(t,n,r){var e=r(23);t.exports=Object("z").propertyIsEnumerable(0)?Object:function(t){return"String"==e(t)?t.split(""):Object(t)}},function(t,n){n.f={}.propertyIsEnumerable},function(t,n,r){var i=r(23),o=r(5)("toStringTag"),u="Arguments"==i(function(){return arguments}()),c=function c(t,n){try{return t[n]}catch(r){}};t.exports=function(t){var n,r,e;return t===undefined?"Undefined":null===t?"Null":"string"==typeof(r=c(n=Object(t),o))?r:u?i(n):"Object"==(e=i(n))&&"function"==typeof n.callee?"Arguments":e}},function(t,n,r){var i=r(3),o=r(18),u=r(5)("species");t.exports=function(t,n){var r,e=i(t).constructor;return e===undefined||(r=i(e)[u])==undefined?n:o(r)}},function(t,n,r){var e=r(7),i=r(1),o="__core-js_shared__",u=i[o]||(i[o]={});(t.exports=function(t,n){return u[t]||(u[t]=n!==undefined?n:{})})("versions",[]).push({version:e.version,mode:r(30)?"pure":"global",copyright:"© 2019 Denis Pushkarev (zloirock.ru)"})},function(t,n,r){var f=r(15),a=r(6),s=r(32);t.exports=function(c){return function(t,n,r){var e,i=f(t),o=a(i.length),u=s(r,o);if(c&&n!=n){for(;u")}),b=function(){var t=/(?:)/,n=t.exec;t.exec=function(){return n.apply(this,arguments)};var r="ab".split(t);return 2===r.length&&"a"===r[0]&&"b"===r[1]}();t.exports=function(r,t,n){var e=d(r),o=!h(function(){var t={};return t[e]=function(){return 7},7!=""[r](t)}),i=o?!h(function(){var t=!1,n=/a/;return n.exec=function(){return t=!0,null},"split"===r&&(n.constructor={},n.constructor[y]=function(){return n}),n[e](""),!t}):undefined;if(!o||!i||"replace"===r&&!g||"split"===r&&!b){var u=/./[e],c=n(p,e,""[r],function(t,n,r,e,i){return n.exec===v?o&&!i?{done:!0,value:u.call(n,r,e)}:{done:!0,value:t.call(r,n,e)}:{done:!1}}),f=c[0],a=c[1];s(String.prototype,r,f),l(RegExp.prototype,e,2==t?function(t,n){return a.call(t,this,n)}:function(t){return a.call(t,this)})}}},function(t,n,r){var h=r(17),p=r(103),d=r(76),v=r(3),y=r(6),g=r(78),b={},m={};(n=t.exports=function(t,n,r,e,i){var o,u,c,f,a=i?function(){return t}:g(t),s=h(r,e,n?2:1),l=0;if("function"!=typeof a)throw TypeError(t+" is not iterable!");if(d(a)){for(o=y(t.length);l>>=1)&&(n+=n))1&e&&(r+=n);return r}},function(t,n){t.exports=Math.sign||function(t){return 0==(t=+t)||t!=t?t:t<0?-1:1}},function(t,n){var r=Math.expm1;t.exports=!r||22025.465794806718=t.length?(this._t=undefined,i(1)):i(0,"keys"==n?r:"values"==n?t[r]:[r,t[r]])},"values"),o.Arguments=o.Array,e("keys"),e("values"),e("entries")},function(t,n,r){"use strict";var e,i,u=r(53),c=RegExp.prototype.exec,f=String.prototype.replace,o=c,a="lastIndex",s=(e=/a/,i=/b*/g,c.call(e,"a"),c.call(i,"a"),0!==e[a]||0!==i[a]),l=/()??/.exec("")[1]!==undefined;(s||l)&&(o=function(t){var n,r,e,i,o=this;return l&&(r=new RegExp("^"+o.source+"$(?!\\s)",u.call(o))),s&&(n=o[a]),e=c.call(o,t),s&&e&&(o[a]=o.global?e.index+e[0].length:n),l&&e&&1>1,s=23===n?j(2,-24)-j(2,-77):0,l=0,h=t<0||0===t&&1/t<0?1:0;for((t=M(t))!=t||t===P?(i=t!=t?1:0,e=f):(e=A(I(t)/T),t*(o=j(2,-e))<1&&(e--,o*=2),2<=(t+=1<=e+a?s/o:s*j(2,1-a))*o&&(e++,o/=2),f<=e+a?(i=0,e=f):1<=e+a?(i=(t*o-1)*j(2,n),e+=a):(i=t*j(2,a-1)*j(2,n),e=0));8<=n;u[l++]=255&i,i/=256,n-=8);for(e=e<>1,c=i-7,f=r-1,a=t[f--],s=127&a;for(a>>=7;0>=-c,c+=n;0>8&255]}function V(t){return[255&t,t>>8&255,t>>16&255,t>>24&255]}function Y(t){return D(t,52,8)}function z(t){return D(t,23,4)}function q(t,n,r){v(t[w],n,{get:function(){return this[r]}})}function K(t,n,r,e){var i=p(+r);if(i+n>t[k])throw O(S);var o=t[R]._b,u=i+t[C],c=o.slice(u,u+n);return e?c:c.reverse()}function $(t,n,r,e,i,o){var u=p(+r);if(u+n>t[k])throw O(S);for(var c=t[R]._b,f=u+t[C],a=e(+i),s=0;sZ;)(J=H[Z++])in x||c(x,J,F[J]);o||(X.constructor=x)}var Q=new _(new x(2)),tt=_[w].setInt8;Q.setInt8(0,2147483648),Q.setInt8(1,2147483649),!Q.getInt8(0)&&Q.getInt8(1)||f(_[w],{setInt8:function(t,n){tt.call(this,t,n<<24>>24)},setUint8:function(t,n){tt.call(this,t,n<<24>>24)}},!0)}else x=function(t){s(this,x,b);var n=p(t);this._b=y.call(new Array(n),0),this[k]=n},_=function(t,n,r){s(this,_,m),s(t,x,m);var e=t[k],i=l(n);if(i<0||e>24},getUint8:function(t){return K(this,1,t)[0]},getInt16:function(t){var n=K(this,2,t,arguments[1]);return(n[1]<<8|n[0])<<16>>16},getUint16:function(t){var n=K(this,2,t,arguments[1]);return n[1]<<8|n[0]},getInt32:function(t){return G(K(this,4,t,arguments[1]))},getUint32:function(t){return G(K(this,4,t,arguments[1]))>>>0},getFloat32:function(t){return U(K(this,4,t,arguments[1]),23,4)},getFloat64:function(t){return U(K(this,8,t,arguments[1]),52,8)},setInt8:function(t,n){$(this,1,t,W,n)},setUint8:function(t,n){$(this,1,t,W,n)},setInt16:function(t,n){$(this,2,t,B,n,arguments[2])},setUint16:function(t,n){$(this,2,t,B,n,arguments[2])},setInt32:function(t,n){$(this,4,t,V,n,arguments[2])},setUint32:function(t,n){$(this,4,t,V,n,arguments[2])},setFloat32:function(t,n){$(this,4,t,z,n,arguments[2])},setFloat64:function(t,n){$(this,8,t,Y,n,arguments[2])}});g(x,b),g(_,m),c(_[w],u.VIEW,!0),n[b]=x,n[m]=_},function(t,n){var r=t.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=r)},function(t,n){function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}t.exports=function(t){return"object"===r(t)?null!==t:"function"==typeof t}},function(t,n,r){t.exports=!r(120)(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},function(t,n,r){t.exports=!r(8)&&!r(2)(function(){return 7!=Object.defineProperty(r(60)("div"),"a",{get:function(){return 7}}).a})},function(t,n,r){var e=r(1),i=r(7),o=r(30),u=r(61),c=r(9).f;t.exports=function(t){var n=i.Symbol||(i.Symbol=o?{}:e.Symbol||{});"_"==t.charAt(0)||t in n||c(n,t,{value:u.f(t)})}},function(t,n,r){var u=r(13),c=r(15),f=r(49)(!1),a=r(62)("IE_PROTO");t.exports=function(t,n){var r,e=c(t),i=0,o=[];for(r in e)r!=a&&u(e,r)&&o.push(r);for(;n.length>i;)u(e,r=n[i++])&&(~f(o,r)||o.push(r));return o}},function(t,n,r){var u=r(9),c=r(3),f=r(31);t.exports=r(8)?Object.defineProperties:function(t,n){c(t);for(var r,e=f(n),i=e.length,o=0;o>>0||(u.test(r)?16:10))}:e},function(t,n,r){var e=r(1).parseFloat,i=r(39).trim;t.exports=1/e(r(66)+"-0")!=-Infinity?function(t){var n=i(String(t),3),r=e(n);return 0===r&&"-"==n.charAt(0)?-0:r}:e},function(t,n,r){var e=r(23);t.exports=function(t,n){if("number"!=typeof t&&"Number"!=e(t))throw TypeError(n);return+t}},function(t,n,r){var e=r(4),i=Math.floor;t.exports=function(t){return!e(t)&&isFinite(t)&&i(t)===t}},function(t,n){t.exports=Math.log1p||function(t){return-1e-8<(t=+t)&&t<1e-8?t-t*t/2:Math.log(1+t)}},function(t,n,r){"use strict";var e=r(33),i=r(28),o=r(38),u={};r(14)(u,r(5)("iterator"),function(){return this}),t.exports=function(t,n,r){t.prototype=e(u,{next:i(1,r)}),o(t,n+" Iterator")}},function(t,n,r){var u=r(3);t.exports=function(t,n,r,e){try{return e?n(u(r)[0],r[1]):n(r)}catch(o){var i=t["return"];throw i!==undefined&&u(i.call(t)),o}}},function(t,n,r){var e=r(216);t.exports=function(t,n){return new(e(t))(n)}},function(t,n,r){var s=r(18),l=r(10),h=r(44),p=r(6);t.exports=function(t,n,r,e,i){s(n);var o=l(t),u=h(o),c=p(o.length),f=i?c-1:0,a=i?-1:1;if(r<2)for(;;){if(f in u){e=u[f],f+=a;break}if(f+=a,i?f<0:c<=f)throw TypeError("Reduce of empty array with no initial value")}for(;i?0<=f:ft;)l(r[t++]);h._c=[],h._n=!1,n&&!h._h&&R(h)})}},R=function R(o){g.call(f,function(){var t,n,r,e=o._v,i=k(o);if(i&&(t=w(function(){j?O.emit("unhandledRejection",e,o):(n=f.onunhandledrejection)?n({promise:o,reason:e}):(r=f.console)&&r.error&&r.error("Unhandled promise rejection",e)}),o._h=j||k(o)?2:1),o._a=undefined,i&&t.e)throw t.v})},k=function k(t){return 1!==t._h&&0===(t._a||t._c).length},C=function C(n){g.call(f,function(){var t;j?O.emit("rejectionHandled",n):(t=f.onrejectionhandled)&&t({promise:n,reason:n._v})})},D=function D(t){var n=this;n._d||(n._d=!0,(n=n._w||n)._v=t,n._s=2,n._a||(n._a=n._c.slice()),L(n,!0))},U=function U(r){var e,i=this;if(!i._d){i._d=!0,i=i._w||i;try{if(i===r)throw E("Promise can't be resolved itself");(e=N(r))?b(function(){var t={_w:i,_d:!1};try{e.call(r,a(U,t,1),a(D,t,1))}catch(n){D.call(t,n)}}):(i._v=r,i._s=1,L(i,!1))}catch(t){D.call({_w:i,_d:!1},t)}}};T||(M=function(t){d(this,M,_,"_h"),p(t),r.call(this);try{t(a(U,this,1),a(D,this,1))}catch(n){D.call(this,n)}},(r=function(t){this._c=[],this._a=undefined,this._s=0,this._d=!1,this._v=undefined,this._h=0,this._n=!1}).prototype=e(43)(M.prototype,{then:function(t,n){var r=I(y(this,M));return r.ok="function"!=typeof t||t,r.fail="function"==typeof n&&n,r.domain=j?O.domain:undefined,this._c.push(r),this._a&&this._a.push(r),this._s&&L(this,!1),r.promise},"catch":function(t){return this.then(undefined,t)}}),o=function o(){var t=new r;this.promise=t,this.resolve=a(U,t,1),this.reject=a(D,t,1)},m.f=I=function I(t){return t===M||t===u?new o(t):i(t)}),l(l.G+l.W+l.F*!T,{Promise:M}),e(38)(M,_),e(41)(_),u=e(7)[_],l(l.S+l.F*!T,_,{reject:function(t){var n=I(this);return(0,n.reject)(t),n.promise}}),l(l.S+l.F*(c||!T),_,{resolve:function(t){return x(c&&this===u?M:this,t)}}),l(l.S+l.F*!(T&&e(52)(function(t){M.all(t)["catch"](A)})),_,{all:function(t){var u=this,n=I(u),c=n.resolve,f=n.reject,r=w(function(){var e=[],i=0,o=1;v(t,!1,function(t){var n=i++,r=!1;e.push(undefined),o++,u.resolve(t).then(function(t){r||(r=!0,e[n]=t,--o||c(e))},f)}),--o||c(e)});return r.e&&f(r.v),n.promise},race:function(t){var n=this,r=I(n),e=r.reject,i=w(function(){v(t,!1,function(t){n.resolve(t).then(r.resolve,e)})});return i.e&&e(i.v),r.promise}})},function(t,n,r){"use strict";var i=r(18);function e(t){var r,e;this.promise=new t(function(t,n){if(r!==undefined||e!==undefined)throw TypeError("Bad Promise constructor");r=t,e=n}),this.resolve=i(r),this.reject=i(e)}t.exports.f=function(t){return new e(t)}},function(t,n,r){var e=r(3),i=r(4),o=r(111);t.exports=function(t,n){if(e(t),i(n)&&n.constructor===t)return n;var r=o.f(t);return(0,r.resolve)(n),r.promise}},function(t,n,r){"use strict";var u=r(9).f,c=r(33),f=r(43),a=r(17),s=r(42),l=r(56),e=r(72),i=r(107),o=r(41),h=r(8),p=r(27).fastKey,d=r(37),v=h?"_s":"size",y=function y(t,n){var r,e=p(n);if("F"!==e)return t._i[e];for(r=t._f;r;r=r.n)if(r.k==n)return r};t.exports={getConstructor:function(t,o,r,e){var i=t(function(t,n){s(t,i,o,"_i"),t._t=o,t._i=c(null),t._f=undefined,t._l=undefined,t[v]=0,n!=undefined&&l(n,r,t[e],t)});return f(i.prototype,{clear:function(){for(var t=d(this,o),n=t._i,r=t._f;r;r=r.n)r.r=!0,r.p&&(r.p=r.p.n=undefined),delete n[r.i];t._f=t._l=undefined,t[v]=0},"delete":function(t){var n=d(this,o),r=y(n,t);if(r){var e=r.n,i=r.p;delete n._i[r.i],r.r=!0,i&&(i.n=e),e&&(e.p=i),n._f==r&&(n._f=e),n._l==r&&(n._l=i),n[v]--}return!!r},forEach:function(t){d(this,o);for(var n,r=a(t,1f&&(a=a.slice(0,f)),e?a+i:i+a}},function(t,n,r){var f=r(8),a=r(31),s=r(15),l=r(45).f;t.exports=function(c){return function(t){for(var n,r=s(t),e=a(r),i=e.length,o=0,u=[];oi;)s(K,n=r[i++])||n==V||n==d||e.push(n);return e}function f(t){for(var n,r=t===J,e=D(r?$:F(t)),i=[],o=0;e.length>o;)!s(K,n=e[o++])||r&&!s(J,n)||i.push(K[n]);return i}var a=r(1),s=r(13),l=r(8),h=r(0),p=r(11),d=r(27).KEY,v=r(2),y=r(48),g=r(38),b=r(29),m=r(5),w=r(61),S=r(89),x=r(127),_=r(51),E=r(3),O=r(4),P=r(10),F=r(15),M=r(26),j=r(28),A=r(33),I=r(92),T=r(20),N=r(50),L=r(9),R=r(31),k=T.f,C=L.f,D=I.f,U=a.Symbol,G=a.JSON,W=G&&G.stringify,B="prototype",V=m("_hidden"),Y=m("toPrimitive"),z={}.propertyIsEnumerable,q=y("symbol-registry"),K=y("symbols"),$=y("op-symbols"),J=Object[B],X="function"==typeof U&&!!N.f,H=a.QObject,Z=!H||!H[B]||!H[B].findChild,Q=l&&v(function(){return 7!=A(C({},"a",{get:function(){return C(this,"a",{value:7}).a}})).a})?function(t,n,r){var e=k(J,n);e&&delete J[n],C(t,n,r),e&&t!==J&&C(J,n,e)}:C,tt=function tt(t){var n=K[t]=A(U[B]);return n._k=t,n},nt=X&&"symbol"==e(U.iterator)?function(t){return"symbol"==e(t)}:function(t){return t instanceof U},rt=function(t,n,r){return t===J&&rt($,n,r),E(t),n=M(n,!0),E(r),s(K,n)?(r.enumerable?(s(t,V)&&t[V][n]&&(t[V][n]=!1),r=A(r,{enumerable:j(0,!1)})):(s(t,V)||C(t,V,j(1,{})),t[V][n]=!0),Q(t,n,r)):C(t,n,r)};X||(p((U=function(){if(this instanceof U)throw TypeError("Symbol is not a constructor!");var n=b(0it;)m(et[it++]);for(var ot=R(m.store),ut=0;ot.length>ut;)S(ot[ut++]);h(h.S+h.F*!X,"Symbol",{"for":function(t){return s(q,t+="")?q[t]:q[t]=U(t)},keyFor:function(t){if(!nt(t))throw TypeError(t+" is not a symbol!");for(var n in q)if(q[n]===t)return n},useSetter:function(){Z=!0},useSimple:function(){Z=!1}}),h(h.S+h.F*!X,"Object",{create:function(t,n){return n===undefined?A(t):i(A(t),n)},defineProperty:rt,defineProperties:i,getOwnPropertyDescriptor:u,getOwnPropertyNames:c,getOwnPropertySymbols:f});var ct=v(function(){N.f(1)});h(h.S+h.F*ct,"Object",{getOwnPropertySymbols:function(t){return N.f(P(t))}}),G&&h(h.S+h.F*(!X||v(function(){var t=U();return"[null]"!=W([t])||"{}"!=W({a:t})||"{}"!=W(Object(t))})),"JSON",{stringify:function(t){for(var r,e,n=[t],i=1;iu;)o.call(t,e=i[u++])&&n.push(e);return n}},function(t,n,r){var e=r(0);e(e.S,"Object",{create:r(33)})},function(t,n,r){var e=r(0);e(e.S+e.F*!r(8),"Object",{defineProperty:r(9).f})},function(t,n,r){var e=r(0);e(e.S+e.F*!r(8),"Object",{defineProperties:r(91)})},function(t,n,r){var e=r(15),i=r(20).f;r(21)("getOwnPropertyDescriptor",function(){return function(t,n){return i(e(t),n)}})},function(t,n,r){var e=r(10),i=r(35);r(21)("getPrototypeOf",function(){return function(t){return i(e(t))}})},function(t,n,r){var e=r(10),i=r(31);r(21)("keys",function(){return function(t){return i(e(t))}})},function(t,n,r){r(21)("getOwnPropertyNames",function(){return r(92).f})},function(t,n,r){var e=r(4),i=r(27).onFreeze;r(21)("freeze",function(n){return function(t){return n&&e(t)?n(i(t)):t}})},function(t,n,r){var e=r(4),i=r(27).onFreeze;r(21)("seal",function(n){return function(t){return n&&e(t)?n(i(t)):t}})},function(t,n,r){var e=r(4),i=r(27).onFreeze;r(21)("preventExtensions",function(n){return function(t){return n&&e(t)?n(i(t)):t}})},function(t,n,r){var e=r(4);r(21)("isFrozen",function(n){return function(t){return!e(t)||!!n&&n(t)}})},function(t,n,r){var e=r(4);r(21)("isSealed",function(n){return function(t){return!e(t)||!!n&&n(t)}})},function(t,n,r){var e=r(4);r(21)("isExtensible",function(n){return function(t){return!!e(t)&&(!n||n(t))}})},function(t,n,r){var e=r(0);e(e.S+e.F,"Object",{assign:r(93)})},function(t,n,r){var e=r(0);e(e.S,"Object",{is:r(94)})},function(t,n,r){var e=r(0);e(e.S,"Object",{setPrototypeOf:r(65).set})},function(t,n,r){"use strict";var e=r(46),i={};i[r(5)("toStringTag")]="z",i+""!="[object z]"&&r(11)(Object.prototype,"toString",function(){return"[object "+e(this)+"]"},!0)},function(t,n,r){var e=r(0);e(e.P,"Function",{bind:r(95)})},function(t,n,r){var e=r(9).f,i=Function.prototype,o=/^\s*function ([^ (]*)/;"name"in i||r(8)&&e(i,"name",{configurable:!0,get:function(){try{return(""+this).match(o)[1]}catch(t){return""}}})},function(t,n,r){"use strict";var e=r(4),i=r(35),o=r(5)("hasInstance"),u=Function.prototype;o in u||r(9).f(u,o,{value:function(t){if("function"!=typeof this||!e(t))return!1;if(!e(this.prototype))return t instanceof this;for(;t=i(t);)if(this.prototype===t)return!0;return!1}})},function(t,n,r){var e=r(0),i=r(97);e(e.G+e.F*(parseInt!=i),{parseInt:i})},function(t,n,r){var e=r(0),i=r(98);e(e.G+e.F*(parseFloat!=i),{parseFloat:i})},function(t,n,r){"use strict";var e=r(1),i=r(13),o=r(23),u=r(67),s=r(26),c=r(2),f=r(34).f,a=r(20).f,l=r(9).f,h=r(39).trim,p="Number",d=e[p],v=d,y=d.prototype,g=o(r(33)(y))==p,b="trim"in String.prototype,m=function m(t){var n=s(t,!1);if("string"==typeof n&&2x;x++)i(v,w=S[x])&&!i(d,w)&&l(d,w,a(v,w));(d.prototype=y).constructor=d,r(11)(e,p,d)}},function(t,n,r){"use strict";var e=r(0),a=r(19),s=r(99),l=r(68),i=1..toFixed,o=Math.floor,u=[0,0,0,0,0,0],h="Number.toFixed: incorrect invocation!",p=function p(t,n){for(var r=-1,e=n;++r<6;)e+=t*u[r],u[r]=e%1e7,e=o(e/1e7)},d=function d(t){for(var n=6,r=0;0<=--n;)r+=u[n],u[n]=o(r/t),r=r%t*1e7},v=function v(){for(var t=6,n="";0<=--t;)if(""!==n||0===t||0!==u[t]){var r=String(u[t]);n=""===n?r:n+l.call("0",7-r.length)+r}return n},y=function y(t,n,r){return 0===n?r:n%2==1?y(t,n-1,r*t):y(t*t,n/2,r)},g=function g(t){for(var n=0,r=t;4096<=r;)n+=12,r/=4096;for(;2<=r;)n+=1,r/=2;return n};e(e.P+e.F*(!!i&&("0.000"!==8e-5.toFixed(3)||"1"!==.9.toFixed(0)||"1.25"!==1.255.toFixed(2)||"1000000000000000128"!==(0xde0b6b3a7640080).toFixed(0))||!r(2)(function(){i.call({})})),"Number",{toFixed:function(t){var n,r,e,i,o=s(this,h),u=a(t),c="",f="0";if(u<0||20>>=0)?31-Math.floor(Math.log(t+.5)*Math.LOG2E):32}})},function(t,n,r){var e=r(0),i=Math.exp;e(e.S,"Math",{cosh:function(t){return(i(t=+t)+i(-t))/2}})},function(t,n,r){var e=r(0),i=r(70);e(e.S+e.F*(i!=Math.expm1),"Math",{expm1:i})},function(t,n,r){var e=r(0);e(e.S,"Math",{fround:r(170)})},function(t,n,r){var o=r(69),e=Math.pow,u=e(2,-52),c=e(2,-23),f=e(2,127)*(2-c),a=e(2,-126),s=function s(t){return t+1/u-1/u};t.exports=Math.fround||function(t){var n,r,e=Math.abs(t),i=o(t);return e>>16)*u+o*(r&i>>>16)<<16>>>0)}})},function(t,n,r){var e=r(0);e(e.S,"Math",{log10:function(t){return Math.log(t)*Math.LOG10E}})},function(t,n,r){var e=r(0);e(e.S,"Math",{log1p:r(101)})},function(t,n,r){var e=r(0);e(e.S,"Math",{log2:function(t){return Math.log(t)/Math.LN2}})},function(t,n,r){var e=r(0);e(e.S,"Math",{sign:r(69)})},function(t,n,r){var e=r(0),i=r(70),o=Math.exp;e(e.S+e.F*r(2)(function(){return-2e-17!=!Math.sinh(-2e-17)}),"Math",{sinh:function(t){return Math.abs(t=+t)<1?(i(t)-i(-t))/2:(o(t-1)-o(-t-1))*(Math.E/2)}})},function(t,n,r){var e=r(0),i=r(70),o=Math.exp;e(e.S,"Math",{tanh:function(t){var n=i(t=+t),r=i(-t);return n==Infinity?1:r==Infinity?-1:(n-r)/(o(t)+o(-t))}})},function(t,n,r){var e=r(0);e(e.S,"Math",{trunc:function(t){return(0>10),n%1024+56320))}return r.join("")}})},function(t,n,r){var e=r(0),u=r(15),c=r(6);e(e.S,"String",{raw:function(t){for(var n=u(t.raw),r=c(n.length),e=arguments.length,i=[],o=0;o=n.length?{value:undefined,done:!0}:(t=e(n,r),this._i+=t.length,{value:t,done:!1})})},function(t,n,r){"use strict";var e=r(0),i=r(71)(!1);e(e.P,"String",{codePointAt:function(t){return i(this,t)}})},function(t,n,r){"use strict";var e=r(0),u=r(6),c=r(73),f="endsWith",a=""[f];e(e.P+e.F*r(75)(f),"String",{endsWith:function(t){var n=c(this,t,f),r=1g;)v(y[g++]);(l.constructor=a).prototype=l,r(11)(e,"RegExp",a)}r(41)("RegExp")},function(t,n,r){"use strict";r(109);var e=r(3),i=r(53),o=r(8),u="toString",c=/./[u],f=function f(t){r(11)(RegExp.prototype,u,t,!0)};r(2)(function(){return"/a/b"!=c.call({source:"a",flags:"b"})})?f(function(){var t=e(this);return"/".concat(t.source,"/","flags"in t?t.flags:!o&&t instanceof RegExp?i.call(t):undefined)}):c.name!=u&&f(function(){return c.call(this)})},function(t,n,r){"use strict";var l=r(3),h=r(6),p=r(82),d=r(54);r(55)("match",1,function(e,i,a,s){return[function(t){var n=e(this),r=t==undefined?undefined:t[i];return r!==undefined?r.call(t,n):new RegExp(t)[i](String(n))},function(t){var n=s(a,t,this);if(n.done)return n.value;var r=l(t),e=String(this);if(!r.global)return d(r,e);for(var i,o=r.unicode,u=[],c=r.lastIndex=0;null!==(i=d(r,e));){var f=String(i[0]);""===(u[c]=f)&&(r.lastIndex=p(e,h(r.lastIndex),o)),c++}return 0===c?null:u}]})},function(t,n,r){"use strict";var _=r(3),e=r(10),E=r(6),O=r(19),P=r(82),F=r(54),M=Math.max,j=Math.min,h=Math.floor,p=/\$([$&`']|\d\d?|<[^>]*>)/g,d=/\$([$&`']|\d\d?)/g,A=function A(t){return t===undefined?t:String(t)};r(55)("replace",2,function(i,o,w,S){return[function(t,n){var r=i(this),e=t==undefined?undefined:t[o];return e!==undefined?e.call(t,r,n):w.call(String(r),t,n)},function(t,n){var r=S(w,t,this,n);if(r.done)return r.value;var e=_(t),i=String(this),o="function"==typeof n;o||(n=String(n));var u=e.global;if(u){var c=e.unicode;e.lastIndex=0}for(var f=[];;){var a=F(e,i);if(null===a)break;if(f.push(a),!u)break;""===String(a[0])&&(e.lastIndex=P(i,E(e.lastIndex),c))}for(var s="",l=0,h=0;h>>0,s=new RegExp(t.source,c+"g");(e=h.call(s,r))&&!(f<(i=s[v])&&(u.push(r.slice(f,e.index)),1=a));)s[v]===e.index&&s[v]++;return f===r[d]?!o&&s.test("")||u.push(""):u.push(r.slice(f)),u[d]>a?u.slice(0,a):u}:"0"[u](undefined,0)[d]?function b(t,n){return t===undefined&&0===n?[]:y.call(this,t,n)}:y,[function(t,n){var r=i(this),e=t==undefined?undefined:t[o];return e!==undefined?e.call(t,r,n):b.call(String(r),t,n)},function(t,n){var r=g(b,t,this,n,b!==y);if(r.done)return r.value;var e=m(t),i=String(this),o=w(e,RegExp),u=e.unicode,c=(e.ignoreCase?"i":"")+(e.multiline?"m":"")+(e.unicode?"u":"")+(P?"y":"g"),f=new o(P?e:"^(?:"+e.source+")",c),a=n===undefined?O:n>>>0;if(0==a)return[];if(0===i.length)return null===_(f,i)?[i]:[];for(var s=0,l=0,h=[];l=n.length)return{value:undefined,done:!0}}while(!((t=n[this._i++])in this._t));return{value:t,done:!1}}),e(e.S,"Reflect",{enumerate:function(t){return new o(t)}})},function(t,n,r){var o=r(20),u=r(35),c=r(13),e=r(0),f=r(4),a=r(3);e(e.S,"Reflect",{get:function s(t,n){var r,e,i=arguments.length<3?t:arguments[2];return a(t)===i?t[n]:(r=o.f(t,n))?c(r,"value")?r.value:r.get!==undefined?r.get.call(i):undefined:f(e=u(t))?s(e,n,i):void 0}})},function(t,n,r){var e=r(20),i=r(0),o=r(3);i(i.S,"Reflect",{getOwnPropertyDescriptor:function(t,n){return e.f(o(t),n)}})},function(t,n,r){var e=r(0),i=r(35),o=r(3);e(e.S,"Reflect",{getPrototypeOf:function(t){return i(o(t))}})},function(t,n,r){var e=r(0);e(e.S,"Reflect",{has:function(t,n){return n in t}})},function(t,n,r){var e=r(0),i=r(3),o=Object.isExtensible;e(e.S,"Reflect",{isExtensible:function(t){return i(t),!o||o(t)}})},function(t,n,r){var e=r(0);e(e.S,"Reflect",{ownKeys:r(116)})},function(t,n,r){var e=r(0),i=r(3),o=Object.preventExtensions;e(e.S,"Reflect",{preventExtensions:function(t){i(t);try{return o&&o(t),!0}catch(n){return!1}}})},function(t,n,r){var c=r(9),f=r(20),a=r(35),s=r(13),e=r(0),l=r(28),h=r(3),p=r(4);e(e.S,"Reflect",{set:function d(t,n,r){var e,i,o=arguments.length<4?t:arguments[3],u=f.f(h(t),n);if(!u){if(p(i=a(t)))return d(i,n,r,o);u=l(0)}if(s(u,"value")){if(!1===u.writable||!p(o))return!1;if(e=f.f(o,n)){if(e.get||e.set||!1===e.writable)return!1;e.value=r,c.f(o,n,e)}else c.f(o,n,l(0,r));return!0}return u.set!==undefined&&(u.set.call(o,r),!0)}})},function(t,n,r){var e=r(0),i=r(65);i&&e(e.S,"Reflect",{setPrototypeOf:function(t,n){i.check(t,n);try{return i.set(t,n),!0}catch(r){return!1}}})},function(t,n,r){r(268),t.exports=r(7).Array.includes},function(t,n,r){"use strict";var e=r(0),i=r(49)(!0);e(e.P,"Array",{includes:function(t){return i(this,t,1c;)(r=i(e,n=o[c++]))!==undefined&&l(u,n,r);return u}})},function(t,n,r){r(285),t.exports=r(7).Object.values},function(t,n,r){var e=r(0),i=r(118)(!1);e(e.S,"Object",{values:function(t){return i(t)}})},function(t,n,r){r(287),t.exports=r(7).Object.entries},function(t,n,r){var e=r(0),i=r(118)(!0);e(e.S,"Object",{entries:function(t){return i(t)}})},function(t,n,r){"use strict";r(110),r(289),t.exports=r(7).Promise["finally"]},function(t,n,r){"use strict";var e=r(0),i=r(7),o=r(1),u=r(47),c=r(112);e(e.P+e.R,"Promise",{"finally":function(n){var r=u(this,i.Promise||o.Promise),t="function"==typeof n;return this.then(t?function(t){return c(r,n()).then(function(){return t})}:n,t?function(t){return c(r,n()).then(function(){throw t})}:n)}})},function(t,n,r){r(291),r(292),r(293),t.exports=r(7)},function(t,n,r){var e=r(1),i=r(0),o=r(57),u=[].slice,c=/MSIE .\./.test(o),f=function f(i){return function(t,n){var r=2 + + + + +Created by iconfont + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/designer-base/src/main/resources/com/fr/design/login/lib/font/iconfont.ttf b/designer-base/src/main/resources/com/fr/design/login/lib/font/iconfont.ttf new file mode 100644 index 000000000..d1a7b4f8b Binary files /dev/null and b/designer-base/src/main/resources/com/fr/design/login/lib/font/iconfont.ttf differ diff --git a/designer-base/src/main/resources/com/fr/design/login/lib/font/iconfont.woff b/designer-base/src/main/resources/com/fr/design/login/lib/font/iconfont.woff new file mode 100644 index 000000000..e4088c07b Binary files /dev/null and b/designer-base/src/main/resources/com/fr/design/login/lib/font/iconfont.woff differ diff --git a/designer-base/src/main/resources/com/fr/design/login/lib/font/iconfont.woff2 b/designer-base/src/main/resources/com/fr/design/login/lib/font/iconfont.woff2 new file mode 100644 index 000000000..28f293070 Binary files /dev/null and b/designer-base/src/main/resources/com/fr/design/login/lib/font/iconfont.woff2 differ diff --git a/designer-base/src/main/resources/com/fr/design/login/lib/locale/login_en_US.js b/designer-base/src/main/resources/com/fr/design/login/lib/locale/login_en_US.js new file mode 100644 index 000000000..37cecf414 --- /dev/null +++ b/designer-base/src/main/resources/com/fr/design/login/lib/locale/login_en_US.js @@ -0,0 +1,5 @@ +var Store = { + i18n : { + + }} +window.Store = Store; \ No newline at end of file diff --git a/designer-base/src/main/resources/com/fr/design/login/lib/locale/login_ja_JP.js b/designer-base/src/main/resources/com/fr/design/login/lib/locale/login_ja_JP.js new file mode 100644 index 000000000..37cecf414 --- /dev/null +++ b/designer-base/src/main/resources/com/fr/design/login/lib/locale/login_ja_JP.js @@ -0,0 +1,5 @@ +var Store = { + i18n : { + + }} +window.Store = Store; \ No newline at end of file diff --git a/designer-base/src/main/resources/com/fr/design/login/lib/locale/login_ko_KR.js b/designer-base/src/main/resources/com/fr/design/login/lib/locale/login_ko_KR.js new file mode 100644 index 000000000..37cecf414 --- /dev/null +++ b/designer-base/src/main/resources/com/fr/design/login/lib/locale/login_ko_KR.js @@ -0,0 +1,5 @@ +var Store = { + i18n : { + + }} +window.Store = Store; \ No newline at end of file diff --git a/designer-base/src/main/resources/com/fr/design/login/lib/locale/login_zh_CN.js b/designer-base/src/main/resources/com/fr/design/login/lib/locale/login_zh_CN.js new file mode 100644 index 000000000..5181aa435 --- /dev/null +++ b/designer-base/src/main/resources/com/fr/design/login/lib/locale/login_zh_CN.js @@ -0,0 +1,59 @@ +var Store = { + i18n : { + 'Designer-Login_User_Name': '用户名/邮箱/手机号', + 'Designer-Login_User_Name_Hint': '请输入用户名/邮箱/手机号', + 'Designer-Login_Password': '密码', + 'Designer-Login_Password_Hint': '请输入密码', + 'Designer-Login': '登录', + 'Designer-Login_Title': '帆软通行证登录', + 'Designer-Login_I_Have_Read': '我已阅读', + 'Designer-Login_Service_Terms': '服务条款', + 'Designer-Login_Forget_Password': '忘记密码?', + 'Designer-Login_Sms': '验证码登录', + 'Designer-Login_Normal': '密码登录', + 'Designer-Login_Phone': '手机号码', + 'Designer-Login_Phone_Hint': '请输入手机号码', + 'Designer-Login_Code': '验证码', + 'Designer-Login_Code_Hint': '请输入验证码', + 'Designer-Login_Code_Request': '获取验证码', + 'Designer-Login_Code_Request_Again': '重新获取', + 'Designer-Login_Register_Or_Login': '注册/登录', + 'Designer-Basic_Chinese_Mainland': '中国大陆', + 'Designer-Basic_Chinese_Hong_Kong': '中国香港', + 'Designer-Basic_Chinese_Macao': '中国澳门', + 'Designer-Basic_Chinese_Taiwan': '中国台湾', + 'Designer-Basic_Turkey': '土耳其', + 'Designer-Basic_South_Korea': '韩国', + 'Designer-Basic_Japan': '日本', + 'Designer-Basic_Singapore': '新加坡', + 'Designer-Basic_Malaysia': '马来西亚', + 'Designer-Login_Username_Not_Null': '用户名不能为空', + 'Designer-Login_Password_Not_Null': '密码不能为空', + 'Designer-Login_Username_Or_Password_Incorrect': '用户名或者密码错误,请检查', + 'Designer-Login_Phone_Not_Null': '手机号码格式非法', + 'Designer-Login_Code_Not_Null': '验证码不能为空', + 'Designer-Login_Code_Incorrect': '验证码已过期,请重新获取', + 'Designer-Login_Password_Setting_Hint': '输入登录密码(可输入6-16位密码)', + 'Designer-Login_Store_User_Not_Exist': '用户名不存在', + 'Designer-Login_Store_User_Password_Error': '用户名或密码错误', + 'Designer-Login_Token_Request_Failed': '注册令牌获取失败', + 'Designer-Login_Unexpected_Error': '未知错误', + 'Designer-Login_Internal_Error': '服务器内部错误', + 'Designer-Guide_Do_Not_Remind': '一个月内不再提醒', + 'Designer-Guide_Login': '立即登录', + 'Designer-BBS_Register_Timeout': '注册超时,请重新发送验证码', + 'Designer-BBS_Phone_Is_Register': '该手机号码已注册', + 'Designer-BBS_Captcha_Send_Exceed_Limit': '验证码每60s只能发送一次', + 'Designer-BBS_Phone_Format_Error': '发送失败,手机号格式错误', + 'Designer-BBS_Captcha_Out_Of_Date': '验证码已过期,请重新获取', + 'Designer-BBS_Captcha_Try_Exceed_Limit': '验证码尝试次数已达上限,请重新获取', + 'Designer-BBS_Captcha_Error': '验证码错误', + 'Designer-BBS_Username_Format_Error': '昵称只支持中英文和数字', + 'Designer-BBS_Username_Too_Short': '昵称长度太短', + 'Designer-BBS_Username_Too_Long': '这个昵称长度已经达到了上限', + 'Designer-BBS_Username_Is_Register': '该用户已被注册', + 'Designer-BBS_Please_Enter_Correct_Phone': '请输入正确的手机号', + 'Designer-Login_Network_Connected_Failed': '网络连接失败', + + }} +window.Store = Store; \ No newline at end of file diff --git a/designer-base/src/main/resources/com/fr/design/login/lib/locale/login_zh_TW.js b/designer-base/src/main/resources/com/fr/design/login/lib/locale/login_zh_TW.js new file mode 100644 index 000000000..37cecf414 --- /dev/null +++ b/designer-base/src/main/resources/com/fr/design/login/lib/locale/login_zh_TW.js @@ -0,0 +1,5 @@ +var Store = { + i18n : { + + }} +window.Store = Store; \ No newline at end of file diff --git a/designer-base/src/main/resources/com/fr/design/login/lib/locale/transform-i18n.js b/designer-base/src/main/resources/com/fr/design/login/lib/locale/transform-i18n.js new file mode 100644 index 000000000..3c06bd56d --- /dev/null +++ b/designer-base/src/main/resources/com/fr/design/login/lib/locale/transform-i18n.js @@ -0,0 +1,40 @@ +/* eslint-disable @typescript-eslint/no-var-requires */ +const fs = require('fs'); +const { resolve } = require('path'); +const propertiesReader = require('properties-reader'); + +function compileSinglePropertiesFile2JS(filename) { + if (!/\.properties/g.test(filename)) { + return; + } + + const filePrefix = filename.split('.')[0].replace('show_', ''); + + let content = ''; + + const properties = propertiesReader(resolve(__dirname, `../../../i18n/${filename}`)); + + properties.each((key, value) => { + content += ` '${key}': '${value}',\n`; + }); + + content = `var Store = { + i18n : { +${content} + }} +window.Store = Store;` + + fs.writeFileSync( + resolve( + __dirname, + `${filePrefix}.js` + ), + content + ); +} +function compilePropertiesFiles2JS() { + fs.readdirSync(resolve(__dirname, '../../../i18n')) + .forEach(file => compileSinglePropertiesFile2JS(file)); +} + +compilePropertiesFiles2JS(); diff --git a/designer-base/src/main/resources/com/fr/design/login/lib/polyfill.min.js b/designer-base/src/main/resources/com/fr/design/login/lib/polyfill.min.js new file mode 100644 index 000000000..d3201b860 --- /dev/null +++ b/designer-base/src/main/resources/com/fr/design/login/lib/polyfill.min.js @@ -0,0 +1,3 @@ +/* Disable minification (remove `.min` from URL path) for more info */ + +(function(undefined) {var _DOMTokenList=function(){var n=!0,t=function(t,e,r,o){Object.defineProperty?Object.defineProperty(t,e,{configurable:!1===n||!!o,get:r}):t.__defineGetter__(e,r)};try{t({},"support")}catch(e){n=!1}return function(n,e){var r=this,o=[],i={},a=0,c=0,f=function(n){t(r,n,function(){return u(),o[n]},!1)},l=function(){if(a>=c)for(;c>>0,"object"==typeof n[e]?n[e].baseVal=o.join(" "):n[e]=o.join(" "),l())},r.remove=function(){u.apply(r,t=arguments);for(var t,c={},f=0,g=[];f>>0,"object"==typeof n[e]?n[e].baseVal=o.join(" "):n[e]=o.join(" "),l()},r.toggle=function(n,t){return u.apply(r,[n]),undefined!==t?t?(r.add(n),!0):(r.remove(n),!1):i[n]?(r.remove(n),!1):(r.add(n),!0)},r}}();function ArrayCreate(r){if(1/r==-Infinity&&(r=0),r>Math.pow(2,32)-1)throw new RangeError("Invalid array length");var n=[];return n.length=r,n}function Call(t,l){var n=arguments.length>2?arguments[2]:[];if(!1===IsCallable(t))throw new TypeError(Object.prototype.toString.call(t)+"is not a function.");return t.apply(l,n)}function CreateDataProperty(e,r,t){var a={value:t,writable:!0,enumerable:!0,configurable:!0};try{return Object.defineProperty(e,r,a),!0}catch(n){return!1}}function CreateDataPropertyOrThrow(t,r,o){var e=CreateDataProperty(t,r,o);if(!e)throw new TypeError("Cannot assign value `"+Object.prototype.toString.call(o)+"` to property `"+Object.prototype.toString.call(r)+"` on object `"+Object.prototype.toString.call(t)+"`");return e}function CreateMethodProperty(e,r,t){var a={value:t,writable:!0,enumerable:!1,configurable:!0};Object.defineProperty(e,r,a)}function Get(n,t){return n[t]}function HasProperty(n,r){return r in n}function IsArray(r){return"[object Array]"===Object.prototype.toString.call(r)}function IsCallable(n){return"function"==typeof n}function RequireObjectCoercible(e){if(null===e||e===undefined)throw TypeError();return e}function SameValueNonNumber(e,n){return e===n}function ToBoolean(o){return Boolean(o)}function ToInteger(n){var i=Number(n);return isNaN(i)?0:1/i===Infinity||1/i==-Infinity||i===Infinity||i===-Infinity?i:(i<0?-1:1)*Math.floor(Math.abs(i))}function ToLength(n){var t=ToInteger(n);return t<=0?0:Math.min(t,Math.pow(2,53)-1)}function ToNumber(r){return Number(r)}function ToObject(e){if(null===e||e===undefined)throw TypeError();return Object(e)}function GetV(t,e){return ToObject(t)[e]}function GetMethod(e,n){var r=GetV(e,n);if(null===r||r===undefined)return undefined;if(!1===IsCallable(r))throw new TypeError("Method not callable: "+n);return r}function ToUint32(n){var i=Number(n);return isNaN(i)||1/i===Infinity||1/i==-Infinity||i===Infinity||i===-Infinity?0:(i<0?-1:1)*Math.floor(Math.abs(i))>>>0}function Type(e){switch(typeof e){case"undefined":return"undefined";case"boolean":return"boolean";case"number":return"number";case"string":return"string";case"symbol":return"symbol";default:return null===e?"null":"Symbol"in this&&e instanceof this.Symbol?"symbol":"object"}}function CreateIterResultObject(e,r){if("boolean"!==Type(r))throw new Error;var t={};return CreateDataProperty(t,"value",e),CreateDataProperty(t,"done",r),t}function EnumerableOwnProperties(e,r){for(var t=Object.keys(e),n=[],s=t.length,a=0;a2?arguments[2]:r,o=arguments.length>1?arguments[1]:[];if(!IsConstructor(r))throw new TypeError("F must be a constructor.");if(!IsConstructor(t))throw new TypeError("newTarget must be a constructor.");if(t===r)return new(Function.prototype.bind.apply(r,[null].concat(o)));var n=OrdinaryCreateFromConstructor(t,Object.prototype);return Call(r,n,o)}function ArraySpeciesCreate(r,e){if(1/e==-Infinity&&(e=0),!1===IsArray(r))return ArrayCreate(e);var t=Get(r,"constructor");if("object"===Type(t)&&null===(t="Symbol"in this&&"species"in this.Symbol?Get(t,this.Symbol.species):undefined)&&(t=undefined),t===undefined)return ArrayCreate(e);if(!IsConstructor(t))throw new TypeError("C must be a constructor");return Construct(t,[e])}function IsRegExp(e){if("object"!==Type(e))return!1;var t="Symbol"in this&&"match"in this.Symbol?Get(e,this.Symbol.match):undefined;if(t!==undefined)return ToBoolean(t);try{var n=e.lastIndex;return e.lastIndex=0,RegExp.prototype.exec.call(e),!0}catch(r){}finally{e.lastIndex=n}return!1}function IteratorClose(r,t){if("object"!==Type(r["[[Iterator]]"]))throw new Error(Object.prototype.toString.call(r["[[Iterator]]"])+"is not an Object.");var e=r["[[Iterator]]"],o=GetMethod(e,"return");if(o===undefined)return t;try{var n=Call(o,e)}catch(c){var a=c}if(t)return t;if(a)throw a;if("object"!==Type(n))throw new TypeError("Iterator's return method returned a non-object.");return t}function IteratorComplete(t){if("object"!==Type(t))throw new Error(Object.prototype.toString.call(t)+"is not an Object.");return ToBoolean(Get(t,"done"))}function IteratorNext(t){if(arguments.length<2)var e=Call(t["[[NextMethod]]"],t["[[Iterator]]"]);else e=Call(t["[[NextMethod]]"],t["[[Iterator]]"],[arguments[1]]);if("object"!==Type(e))throw new TypeError("bad iterator");return e}function IteratorStep(t){var r=IteratorNext(t);return!0!==IteratorComplete(r)&&r}function IteratorValue(t){if("object"!==Type(t))throw new Error(Object.prototype.toString.call(t)+"is not an Object.");return Get(t,"value")}function OrdinaryToPrimitive(r,t){if("string"===t)var e=["toString","valueOf"];else e=["valueOf","toString"];for(var i=0;i1?arguments[1]:undefined;if("object"===Type(e)){if(arguments.length<2)var i="default";else t===String?i="string":t===Number&&(i="number");var r="function"==typeof this.Symbol&&"symbol"==typeof this.Symbol.toPrimitive?GetMethod(e,this.Symbol.toPrimitive):undefined;if(r!==undefined){var n=Call(r,e,[i]);if("object"!==Type(n))return n;throw new TypeError("Cannot convert exotic object to primitive.")}return"default"===i&&(i="number"),OrdinaryToPrimitive(e,i)}return e}function ToString(t){switch(Type(t)){case"symbol":throw new TypeError("Cannot convert a Symbol value to a string");case"object":return ToString(ToPrimitive(t,"string"));default:return String(t)}}function ToPropertyKey(r){var i=ToPrimitive(r,String);return"symbol"===Type(i)?i:ToString(i)}function UTF16Decode(e,n){return 1024*(e-55296)+(n-56320)+65536}function UTF16Encoding(n){return n<=65535?n:[Math.floor((n-65536)/1024)+55296,(n-65536)%1024+56320]}var _mutation=function(){function e(e){return"function"==typeof Node?e instanceof Node:e&&"object"==typeof e&&e.nodeName&&e.nodeType>=1&&e.nodeType<=12}return function n(t){if(1===t.length)return e(t[0])?t[0]:document.createTextNode(t[0]+"");for(var o=document.createDocumentFragment(),r=0;r>0}function f(t){return t>>>0}function u(e){if(!("TYPED_ARRAY_POLYFILL_NO_ARRAY_ACCESSORS"in t)){if(e.length>N)throw RangeError("Array too large for polyfill");var r;for(r=0;r>r}function h(t,e){var r=32-e;return t<>>r}function y(t){return[255&t]}function s(t){return a(t[0],8)}function l(t){return[255&t]}function p(t){return h(t[0],8)}function c(t){return t=x(Number(t)),[t<0?0:t>255?255:255&t]}function b(t){return[255&t,t>>8&255]}function g(t){return a(t[1]<<8|t[0],16)}function E(t){return[255&t,t>>8&255]}function v(t){return h(t[1]<<8|t[0],16)}function _(t){return[255&t,t>>8&255,t>>16&255,t>>24&255]}function O(t){return a(t[3]<<24|t[2]<<16|t[1]<<8|t[0],32)}function d(t){return[255&t,t>>8&255,t>>16&255,t>>24&255]}function j(t){return h(t[3]<<24|t[2]<<16|t[1]<<8|t[0],32)}function P(t,e,r){function n(t){var e=m(t),r=t-e;return r<.5?e:r>.5?e+1:e%2?e+1:e}var o,i,f,u=(1<=F(2,1-u)){i=Y(m(I(t)/S),1023);var a=t/F(2,i);a<1&&(i-=1,a*=2),a>=2&&(i+=1,a/=2);var h=F(2,r);f=n(a*h)-h,i+=u,f/h>=1&&(i+=1,f=0),i>2*u&&(i=(1<>=1;return s.reverse(),f=s.join(""),u=(1<0?a*F(2,h-u)*(1+y/F(2,r)):0!==y?a*F(2,-(u-1))*(y/F(2,r)):a<0?-0:0}function w(t){return T(t,11,52)}function A(t){return P(t,11,52)}function L(t){return T(t,8,23)}function R(t){return P(t,8,23)}var B=void 0,N=1e5,S=Math.LN2,M=Math.abs,m=Math.floor,I=Math.log,U=Math.max,Y=Math.min,F=Math.pow,x=Math.round;!function(){var t=Object.defineProperty,e=!function(){try{return Object.defineProperty({},"x",{})}catch(t){return!1}}();t&&!e||(Object.defineProperty=function(e,r,n){if(t)try{return t(e,r,n)}catch(o){}if(e!==Object(e))throw TypeError("Object.defineProperty called on non-object");return Object.prototype.__defineGetter__&&"get"in n&&Object.prototype.__defineGetter__.call(e,r,n.get),Object.prototype.__defineSetter__&&"set"in n&&Object.prototype.__defineSetter__.call(e,r,n.set),"value"in n&&(e[r]=n.value),e})}(),function(){function a(t){if((t=i(t))<0)throw RangeError("ArrayBuffer size is not a small enough positive integer.");Object.defineProperty(this,"byteLength",{value:t}),Object.defineProperty(this,"_bytes",{value:Array(t)});for(var e=0;e=1&&"object"===e(arguments[0])&&arguments[0]instanceof h)return function(t){if(this.constructor!==t.constructor)throw TypeError();var e=t.length*this.BYTES_PER_ELEMENT;Object.defineProperty(this,"buffer",{value:new a(e)}),Object.defineProperty(this,"byteLength",{value:e}),Object.defineProperty(this,"byteOffset",{value:0}),Object.defineProperty(this,"length",{value:t.length});for(var r=0;r=1&&"object"===e(arguments[0])&&!(arguments[0]instanceof h)&&!(arguments[0]instanceof a||"ArrayBuffer"===r(arguments[0])))return function(t){var e=t.length*this.BYTES_PER_ELEMENT;Object.defineProperty(this,"buffer",{value:new a(e)}),Object.defineProperty(this,"byteLength",{value:e}),Object.defineProperty(this,"byteOffset",{value:0}),Object.defineProperty(this,"length",{value:t.length});for(var r=0;r=1&&"object"===e(arguments[0])&&(arguments[0]instanceof a||"ArrayBuffer"===r(arguments[0])))return function(t,e,r){if((e=f(e))>t.byteLength)throw RangeError("byteOffset out of range");if(e%this.BYTES_PER_ELEMENT)throw RangeError("buffer length minus the byteOffset is not a multiple of the element size.");if(r===B){var n=t.byteLength-e;if(n%this.BYTES_PER_ELEMENT)throw RangeError("length of buffer minus byteOffset not a multiple of the element size");r=n/this.BYTES_PER_ELEMENT}else r=f(r),n=r*this.BYTES_PER_ELEMENT;if(e+n>t.byteLength)throw RangeError("byteOffset and length reference an area beyond the end of the buffer");Object.defineProperty(this,"buffer",{value:t}),Object.defineProperty(this,"byteLength",{value:n}),Object.defineProperty(this,"byteOffset",{value:e}),Object.defineProperty(this,"length",{value:r})}.apply(this,arguments);throw TypeError()}function P(t,e,r){var n=function(){Object.defineProperty(this,"constructor",{value:n}),h.apply(this,arguments),u(this)};"__proto__"in n?n.__proto__=h:(n.from=h.from,n.of=h.of),n.BYTES_PER_ELEMENT=t;var o=function(){};return o.prototype=T,n.prototype=new o,Object.defineProperty(n.prototype,"BYTES_PER_ELEMENT",{value:t}),Object.defineProperty(n.prototype,"_pack",{value:e}),Object.defineProperty(n.prototype,"_unpack",{value:r}),n}t.ArrayBuffer=t.ArrayBuffer||a,Object.defineProperty(h,"from",{value:function(t){return new this(t)}}),Object.defineProperty(h,"of",{value:function(){return new this(arguments)}});var T={};h.prototype=T,Object.defineProperty(h.prototype,"_getter",{value:function(t){if(arguments.length<1)throw SyntaxError("Not enough arguments");if((t=f(t))>=this.length)return B;var e,r,n=[];for(e=0,r=this.byteOffset+t*this.BYTES_PER_ELEMENT;e=this.length)){var r,n,o=this._pack(e);for(r=0,n=this.byteOffset+t*this.BYTES_PER_ELEMENT;r0;)n._setter(h,n._getter(s)),s+=b,h+=b,g-=1;return n}}),Object.defineProperty(h.prototype,"every",{value:function(t){if(this===B||null===this)throw TypeError();var e=Object(this),r=f(e.length);if(!n(t))throw TypeError();for(var o=arguments[1],i=0;i1?arguments[1]:B,a=0;a1?arguments[1]:B,a=0;a0&&(n=Number(arguments[1]),n!==n?n=0:0!==n&&n!==1/0&&n!==-1/0&&(n=(n>0||-1)*m(M(n)))),n>=r)return-1;for(var o=n>=0?n:U(r-M(n),0);o1&&(n=Number(arguments[1]),n!==n?n=0:0!==n&&n!==1/0&&n!==-1/0&&(n=(n>0||-1)*m(M(n))));for(var o=n>=0?Y(n,r-1):r-M(n);o>=0;o--)if(e._getter(o)===t)return o;return-1}}),Object.defineProperty(h.prototype,"map",{value:function(t){if(this===B||null===this)throw TypeError();var e=Object(this),r=f(e.length);if(!n(t))throw TypeError();var o=[];o.length=r;for(var i=arguments[1],u=0;u=2?arguments[1]:e._getter(i++);i=2?arguments[1]:e._getter(i--);i>=0;)o=t.call(B,o,e._getter(i),i,e),i--;return o}}),Object.defineProperty(h.prototype,"reverse",{value:function(){if(this===B||null===this)throw TypeError();for(var t=Object(this),e=f(t.length),r=m(e/2),n=0,o=e-1;nthis.length)throw RangeError("Offset plus length of array is out of range");if(y=this.byteOffset+o*this.BYTES_PER_ELEMENT,s=r.length*this.BYTES_PER_ELEMENT,r.buffer===this.buffer){for(l=[],u=0,a=r.byteOffset;uthis.length)throw RangeError("Offset plus length of array is out of range");for(u=0;ur?1:0}if(this===B||null===this)throw TypeError();for(var r=Object(this),n=f(r.length),o=Array(n),i=0;ir?r:t}t=i(t),e=i(e),arguments.length<1&&(t=0),arguments.length<2&&(e=this.length),t<0&&(t=this.length+t),e<0&&(e=this.length+e),t=r(t,0,this.length),e=r(e,0,this.length);var n=e-t;return n<0&&(n=0),new this.constructor(this.buffer,this.byteOffset+t*this.BYTES_PER_ELEMENT,n)}});var N=P(1,y,s),S=P(1,l,p),I=P(1,c,p),F=P(2,b,g),x=P(2,E,v),k=P(4,_,O),C=P(4,d,j),z=P(4,R,L),D=P(8,A,w);t.Int8Array=t.Int8Array||N,t.Uint8Array=t.Uint8Array||S,t.Uint8ClampedArray=t.Uint8ClampedArray||I,t.Int16Array=t.Int16Array||F,t.Uint16Array=t.Uint16Array||x,t.Int32Array=t.Int32Array||k,t.Uint32Array=t.Uint32Array||C,t.Float32Array=t.Float32Array||z,t.Float64Array=t.Float64Array||D}(),function(){function e(t,e){return n(t.get)?t.get(e):t[e]}function o(t,e,n){if(!(t instanceof ArrayBuffer||"ArrayBuffer"===r(t)))throw TypeError();if((e=f(e))>t.byteLength)throw RangeError("byteOffset out of range");if(n=n===B?t.byteLength-e:f(n),e+n>t.byteLength)throw RangeError("byteOffset and length reference an area beyond the end of the buffer");Object.defineProperty(this,"buffer",{value:t}),Object.defineProperty(this,"byteLength",{value:n}),Object.defineProperty(this,"byteOffset",{value:e})}function i(t){return function r(n,o){if((n=f(n))+t.BYTES_PER_ELEMENT>this.byteLength)throw RangeError("Array index out of range");n+=this.byteOffset;for(var i=new Uint8Array(this.buffer,n,t.BYTES_PER_ELEMENT),u=[],h=0;hthis.byteLength)throw RangeError("Array index out of range");var u,h,y=new t([o]),s=new Uint8Array(y.buffer),l=[];for(u=0;u0;){var f=String(M),g=String(h);if(HasProperty(n,f)){var l=n[f];n[g]=l}else delete n[g];M+=s,h+=s,d-=1}return n});CreateMethodProperty(Array.prototype,"fill",function t(e){for(var r=arguments[1],n=arguments[2],o=ToObject(this),a=ToLength(Get(o,"length")),h=ToInteger(r),i=h<0?Math.max(a+h,0):Math.min(h,a),g=n===undefined?a:ToInteger(n),M=g<0?Math.max(a+g,0):Math.min(g,a);i1?arguments[1]:undefined,a=0;a1?arguments[1]:undefined,a=0;a=0)var a=n;else(a=o+n)<0&&(a=0);for(;a1?NaN:-1===t?-Infinity:1===t?Infinity:0===t&&1/t===Infinity?0:0===t&&1/t==-Infinity?-0:Math.log((1+t)/(1-t))/2});CreateMethodProperty(Math,"cbrt",function n(t){if(isNaN(t))return NaN;if(0===t&&1/t===Infinity)return 0;if(0===t&&1/t==-Infinity)return-0;if(t===Infinity)return Infinity;if(t===-Infinity)return-Infinity;var i=Math.pow(Math.abs(t),1/3);return t<0?-i:i});CreateMethodProperty(Math,"clz32",function t(r){var e=ToUint32(r);return e?32-e.toString(2).length:32});CreateMethodProperty(Math,"cosh",function n(t){if(isNaN(t))return NaN;if(0===t&&1/t===Infinity)return 1;if(0===t&&1/t==-Infinity)return 1;if(t===Infinity)return Infinity;if(t===-Infinity)return Infinity;if((t=Math.abs(t))>709){var i=Math.exp(.5*t);return i/2*i}var i=Math.exp(t);return(i+1/i)/2});CreateMethodProperty(Math,"expm1",function n(i){return isNaN(i)?NaN:0===i&&1/i===Infinity?0:0===i&&1/i==-Infinity?-0:i===Infinity?Infinity:i===-Infinity?-1:i>-1e-6&&i<1e-6?i+i*i/2:Math.exp(i)-1});CreateMethodProperty(Math,"fround",function(n){return isNaN(n)?NaN:1/n==+Infinity||1/n==-Infinity||n===+Infinity||n===-Infinity?n:new Float32Array([n])[0]});CreateMethodProperty(Math,"hypot",function t(n,r){if(0===arguments.length)return 0;for(var i=0,e=0,a=0;ae&&(i*=Math.pow(e/f,2),e=f),0===f&&0===e||(i+=Math.pow(f/e,2))}return e*Math.sqrt(i)});CreateMethodProperty(Math,"imul",function t(r,e){var n=ToUint32(r),o=ToUint32(e),i=n>>>16&65535,a=65535&n,u=o>>>16&65535,h=65535&o;return a*h+(i*h+a*u<<16>>>0)|0});CreateMethodProperty(Math,"log10",function t(e){return Math.log(e)/Math.LN10});CreateMethodProperty(Math,"log1p",function r(t){if(-1<(t=Number(t))&&t<1){for(var o=t,e=2;e<=300;e++)o+=Math.pow(-1,e-1)*Math.pow(t,e)/e;return o}return Math.log(1+t)});CreateMethodProperty(Math,"log2",function t(e){return Math.log(e)/Math.LN2});CreateMethodProperty(Math,"sign",function i(n){var n=Number(n);return isNaN(n)?NaN:1/n==-Infinity?-0:1/n===Infinity?0:n<0?-1:n>0?1:void 0});CreateMethodProperty(Math,"sinh",function r(t){var a=t<0?-1:1,e=Math.abs(t);if(e<22){if(en&&(r.length=n)}var r=A(n),o=0;return function(n,t){r[o++]=n,r[o++]=t,2===o&&rn.nextTick(e)}}function l(n,t){var e,r,u,c,f=0;if(!n)throw h(Q);var a=n[rn[q][z]];if(o(a))r=a.call(n);else{if(!o(n.next)){if(i(n,A)){for(e=n.length;f1114111)throw new RangeError("Invalid code point "+Object.prototype.toString.call(p));var c=UTF16Encoding(p);IsArray(c)?a=a.concat(c):a.push(c),i+=1,t.push(String.fromCharCode.apply(null,a))}return 0===n?"":t.join("")});CreateMethodProperty(String.prototype,"codePointAt",function e(t){var r=RequireObjectCoercible(this),o=ToString(r),n=ToInteger(t),i=o.length;if(n<0||n>=i)return undefined;var c=String.prototype.charCodeAt.call(o,n);if(c<55296||c>56319||n+1===i)return c;var a=String.prototype.charCodeAt.call(o,n+1);return a<56320||a>57343?c:UTF16Decode(c,a)});CreateMethodProperty(String.prototype,"endsWith",function e(t){"use strict";var r=arguments.length>1?arguments[1]:undefined,n=RequireObjectCoercible(this),i=ToString(n);if(IsRegExp(t))throw new TypeError("First argument to String.prototype.endsWith must not be a regular expression");var o=ToString(t),s=i.length,g=r===undefined?s:ToInteger(r),h=Math.min(Math.max(g,0),s),u=o.length,a=h-u;return!(a<0)&&i.substr(a,u)===o});CreateMethodProperty(String.prototype,"includes",function e(t){"use strict";var r=arguments.length>1?arguments[1]:undefined,n=RequireObjectCoercible(this),i=ToString(n);if(IsRegExp(t))throw new TypeError("First argument to String.prototype.includes must not be a regular expression");var o=ToString(t),g=ToInteger(r),a=i.length,p=Math.min(Math.max(g,0),a);return-1!==String.prototype.indexOf.call(i,o,p)});CreateMethodProperty(String.prototype,"padEnd",function e(r){"use strict";var t=arguments.length>1?arguments[1]:undefined,n=RequireObjectCoercible(this),i=ToString(n),o=ToLength(r),u=i.length;if(o<=u)return i;if(t===undefined)var d=" ";else var d=ToString(t);if(""===d)return i;for(var f=o-u,a="",g=0;g1?arguments[1]:undefined,n=RequireObjectCoercible(this),i=ToString(n),o=ToLength(r),u=i.length;if(o<=u)return i;if(t===undefined)var a=" ";else var a=ToString(t);if(""===a)return i;for(var f=o-u,d="",g=0;g1?arguments[1]:undefined,n=RequireObjectCoercible(this),i=ToString(n);if(IsRegExp(e))throw new TypeError("First argument to String.prototype.startsWith must not be a regular expression");var o=ToString(e),s=ToInteger(r),a=i.length,g=Math.min(Math.max(s,0),a);return!(o.length+g>a)&&0===i.substr(g).indexOf(e)});!function(t,r,n){"use strict";var e,o=0,u=""+Math.random(),l="__symbol:",c=l.length,a="__symbol@@"+u,i="defineProperty",f="defineProperties",s="getOwnPropertyNames",v="getOwnPropertyDescriptor",b="propertyIsEnumerable",h=t.prototype,y=h.hasOwnProperty,m=h[b],p=h.toString,g=Array.prototype.concat,w=t.getOwnPropertyNames?t.getOwnPropertyNames(window):[],d=t[s],S=function L(t){if("[object Window]"===p.call(t))try{return d(t)}catch(r){return g.call([],w)}return d(t)},P=t[v],j=t.create,O=t.keys,E=t.freeze||t,N=t[i],_=t[f],k=P(t,s),T=function(t,r,n){if(!y.call(t,a))try{N(t,a,{enumerable:!1,configurable:!1,writable:!1,value:{}})}catch(e){t[a]={}}t[a]["@@"+r]=n},z=function(t,r){var n=j(t);return S(r).forEach(function(t){M.call(r,t)&&G(n,t,r[t])}),n},A=function(t){var r=j(t);return r.enumerable=!1,r},D=function Q(){},F=function(t){return t!=a&&!y.call(x,t)},I=function(t){return t!=a&&y.call(x,t)},M=function R(t){var r=""+t;return I(r)?y.call(this,r)&&this[a]["@@"+r]:m.call(this,t)},W=function(r){var n={enumerable:!1,configurable:!0,get:D,set:function(t){e(this,r,{enumerable:!1,configurable:!0,writable:!0,value:t}),T(this,r,!0)}};try{N(h,r,n)}catch(o){h[r]=n.value}return E(x[r]=N(t(r),"constructor",B))},q=function U(){var t=arguments[0];if(this instanceof U)throw new TypeError("Symbol is not a constructor");return W(l.concat(t||"",u,++o))},x=j(null),B={value:q},C=function(t){return x[t]},G=function V(t,r,n){var o=""+r;return I(o)?(e(t,o,n.enumerable?A(n):n),T(t,o,!!n.enumerable)):N(t,r,n),t},H=function(t){return function(r){return y.call(t,a)&&y.call(t[a],"@@"+r)}},J=function X(t){return S(t).filter(t===h?H(t):I).map(C)};k.value=G,N(t,i,k),k.value=J,N(t,"getOwnPropertySymbols",k),k.value=function Y(t){return S(t).filter(F)},N(t,s,k),k.value=function Z(t,r){var n=J(r);return n.length?O(r).concat(n).forEach(function(n){M.call(r,n)&&G(t,n,r[n])}):_(t,r),t},N(t,f,k),k.value=M,N(h,b,k),k.value=q,N(n,"Symbol",k),k.value=function(t){var r=l.concat(l,t,u);return r in h?x[r]:W(r)},N(q,"for",k),k.value=function(t){if(F(t))throw new TypeError(t+" is not a symbol");return y.call(x,t)?t.slice(2*c,-u.length):void 0},N(q,"keyFor",k),k.value=function $(t,r){var n=P(t,r);return n&&I(r)&&(n.enumerable=M.call(t,r)),n},N(t,v,k),k.value=function(t,r){return 1===arguments.length||void 0===r?j(t):z(t,r)},N(t,"create",k);var K=null===function(){return this}.call(null);k.value=K?function(){var t=p.call(this);return"[object String]"===t&&I(this)?"[object Symbol]":t}:function(){if(this===window)return"[object Null]";var t=p.call(this);return"[object String]"===t&&I(this)?"[object Symbol]":t},N(h,"toString",k),e=function(t,r,n){var e=P(h,r);delete h[r],N(t,r,n),t!==h&&N(h,r,e)}}(Object,0,this);CreateMethodProperty(Reflect,"ownKeys",function e(t){if("object"!==Type(t))throw new TypeError(Object.prototype.toString.call(t)+" is not an Object");return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))});CreateMethodProperty(Object,"getOwnPropertyDescriptors",function e(r){for(var t=ToObject(r),o=Reflect.ownKeys(t),n={},c=o.length,a=0;a1?arguments[1]:GetMethod(t,Symbol.iterator),r=Call(e,t);if("object"!==Type(r))throw new TypeError("bad iterator");var o=GetV(r,"next"),a=Object.create(null);return a["[[Iterator]]"]=r,a["[[NextMethod]]"]=o,a["[[Done]]"]=!1,a}Object.defineProperty(Symbol,"match",{value:Symbol("match")});Object.defineProperty(Symbol,"replace",{value:Symbol("replace")});Object.defineProperty(Symbol,"search",{value:Symbol("search")});Object.defineProperty(Symbol,"species",{value:Symbol("species")});!function(e){function t(e,t){if("object"!==Type(e))throw new TypeError("createMapIterator called on incompatible receiver "+Object.prototype.toString.call(e));if(!0!==e._es6Map)throw new TypeError("createMapIterator called on incompatible receiver "+Object.prototype.toString.call(e));var r=Object.create(n);return Object.defineProperty(r,"[[Map]]",{configurable:!0,enumerable:!1,writable:!0,value:e}),Object.defineProperty(r,"[[MapNextIndex]]",{configurable:!0,enumerable:!1,writable:!0,value:0}),Object.defineProperty(r,"[[MapIterationKind]]",{configurable:!0,enumerable:!1,writable:!0,value:t}),r}var r=function(){try{var e={};return Object.defineProperty(e,"t",{configurable:!0,enumerable:!1,get:function(){return!0},set:undefined}),!!e.t}catch(t){return!1}}(),o=Symbol("undef"),a=function p(){if(!(this instanceof p))throw new TypeError('Constructor Map requires "new"');var e=OrdinaryCreateFromConstructor(this,p.prototype,{_keys:[],_values:[],_size:0,_es6Map:!0});r||Object.defineProperty(e,"size",{configurable:!0,enumerable:!1,writable:!0,value:0});var t=arguments.length>0?arguments[0]:undefined;if(null===t||t===undefined)return e;var o=e.set;if(!IsCallable(o))throw new TypeError("Map.prototype.set is not a function");try{for(var a=GetIterator(t);;){var n=IteratorStep(a);if(!1===n)return e;var i=IteratorValue(n);if("object"!==Type(i))try{throw new TypeError("Iterator value "+i+" is not an entry object")}catch(u){return IteratorClose(a,u)}try{var l=i[0],c=i[1];o.call(e,l,c)}catch(f){return IteratorClose(a,f)}}}catch(f){if(Array.isArray(t)||"[object Arguments]"===Object.prototype.toString.call(t)||t.callee){var y,s=t.length;for(y=0;y0?arguments[0]:undefined;if(null===t||t===undefined)return e;var o=e.add;if(!IsCallable(o))throw new TypeError("Set.prototype.add is not a function");try{for(var n=GetIterator(t);;){var a=IteratorStep(n);if(!1===a)return e;var i=IteratorValue(a);try{o.call(e,i)}catch(y){return IteratorClose(n,y)}}}catch(y){if(!Array.isArray(t)&&"[object Arguments]"!==Object.prototype.toString.call(t)&&!t.callee)throw y;var l,p=t.length;for(l=0;l1?arguments[1]:undefined;if(a===undefined)var n=!1;else{if(!1===IsCallable(a))throw new TypeError(Object.prototype.toString.call(a)+" is not a function.");var i=arguments.length>2?arguments[2]:undefined;if(i!==undefined)var l=i;else l=undefined;n=!0}var u=GetMethod(t,Symbol.iterator);if(u!==undefined){if(IsConstructor(o))var f=Construct(o);else f=ArrayCreate(0);for(var c=GetIterator(t,u),s=0;;){if(s>=Math.pow(2,53)-1){var h=new TypeError("Iteration count can not be greater than or equal 9007199254740991.");return IteratorClose(c,h)}var y=ToString(s),C=IteratorStep(c);if(!1===C)return f.length=s,f;var g=IteratorValue(C);if(n)try{var p=Call(a,l,[g,s])}catch(b){return IteratorClose(c,b)}else p=g;try{CreateDataPropertyOrThrow(f,y,p)}catch(b){return IteratorClose(c,b)}s+=1}}if(r(t))var v=e.call(t,/[\uD800-\uDBFF][\uDC00-\uDFFF]?|[^\uD800-\uDFFF]|./g)||[];else v=ToObject(t);var d=ToLength(Get(v,"length"));for(f=IsConstructor(o)?Construct(o,[d]):ArrayCreate(d),s=0;s=this.__nextIndex__)){if(++this.__nextIndex__,!this.__redo__)return void Object.defineProperty(this,"__redo__",{value:[e],configurable:!0,enumerable:!1,writable:!1});this.__redo__.forEach(function(t,_){t>=e&&(this.__redo__[_]=++t)},this),this.__redo__.push(e)}},configurable:!0,enumerable:!1,writable:!0},_onDelete:{value:function(e){var t;e>=this.__nextIndex__||(--this.__nextIndex__,this.__redo__&&(t=this.__redo__.indexOf(e),-1!==t&&this.__redo__.splice(t,1),this.__redo__.forEach(function(t,_){t>e&&(this.__redo__[_]=--t)},this)))},configurable:!0,enumerable:!1,writable:!0},_onClear:{value:function(){this.__redo__&&e.call(this.__redo__),this.__nextIndex__=0},configurable:!0,enumerable:!1,writable:!0}})),Object.defineProperty(_.prototype,Symbol.iterator,{value:function(){return this},configurable:!0,enumerable:!1,writable:!0}),Object.defineProperty(_.prototype,Symbol.toStringTag,{value:"Iterator",configurable:!1,enumerable:!1,writable:!0}),_}();var ArrayIterator=function(){var e=function(t,r){if(!(this instanceof e))return new e(t,r);Iterator.call(this,t),r=r?String.prototype.includes.call(r,"key+value")?"key+value":String.prototype.includes.call(r,"key")?"key":"value":"value",Object.defineProperty(this,"__kind__",{value:r,configurable:!1,enumerable:!1,writable:!1})};return Object.setPrototypeOf&&Object.setPrototypeOf(e,Iterator.prototype),e.prototype=Object.create(Iterator.prototype,{constructor:{value:e,configurable:!0,enumerable:!1,writable:!0},_resolve:{value:function(e){return"value"===this.__kind__?this.__list__[e]:"key+value"===this.__kind__?[e,this.__list__[e]]:e},configurable:!0,enumerable:!1,writable:!0},toString:{value:function(){return"[object Array Iterator]"},configurable:!0,enumerable:!1,writable:!0}}),e}();CreateMethodProperty(Array.prototype,"entries",function r(){var r=ToObject(this);return new ArrayIterator(r,"key+value")});CreateMethodProperty(Array.prototype,"keys",function r(){var r=ToObject(this);return new ArrayIterator(r,"key")});"Symbol"in this&&"iterator"in Symbol&&"function"==typeof Array.prototype[Symbol.iterator]?CreateMethodProperty(Array.prototype,"values",Array.prototype[Symbol.iterator]):CreateMethodProperty(Array.prototype,"values",function r(){var r=ToObject(this);return new ArrayIterator(r,"value")});CreateMethodProperty(Array.prototype,Symbol.iterator,Array.prototype.values);var StringIterator=function(){var t=function(e){if(!(this instanceof t))return new t(e);e=String(e),Iterator.call(this,e),Object.defineProperty(this,"__length__",{value:e.length,configurable:!1,enumerable:!1,writable:!1})};return Object.setPrototypeOf&&Object.setPrototypeOf(t,Iterator),t.prototype=Object.create(Iterator.prototype,{constructor:{value:t,configurable:!0,enumerable:!1,writable:!0},_next:{value:function(){if(this.__list__)return this.__nextIndex__=55296&&e<=56319?r+this.__list__[this.__nextIndex__++]:r)},configurable:!0,enumerable:!1,writable:!0},toString:{value:function(){return"[object String Iterator]"},configurable:!0,enumerable:!1,writable:!0}}),t}();CreateMethodProperty(String.prototype,Symbol.iterator,function(){var r=RequireObjectCoercible(this),t=ToString(r);return new StringIterator(t)});Object.defineProperty(Symbol,"unscopables",{value:Symbol("unscopables")});!function(e){"use strict";function t(t){return!!t&&("Symbol"in e&&"iterator"in e.Symbol&&"function"==typeof t[Symbol.iterator]||!!Array.isArray(t))}function n(e){return"from"in Array?Array.from(e):Array.prototype.slice.call(e)}!function(){function r(e){var t="",n=!0;return e.forEach(function(e){var r=encodeURIComponent(e.name),a=encodeURIComponent(e.value);n||(t+="&"),t+=r+"="+a,n=!1}),t.replace(/%20/g,"+")}function a(e,t){var n=e.split("&");t&&-1===n[0].indexOf("=")&&(n[0]="="+n[0]);var r=[];n.forEach(function(e){if(0!==e.length){var t=e.indexOf("=");if(-1!==t)var n=e.substring(0,t),a=e.substring(t+1);else n=e,a="";n=n.replace(/\+/g," "),a=a.replace(/\+/g," "),r.push({name:n,value:a})}});var a=[];return r.forEach(function(e){a.push({name:decodeURIComponent(e.name),value:decodeURIComponent(e.value)})}),a}function i(e){if(c)return new s(e);var t=document.createElement("a");return t.href=e,t}function o(e){var i=this;this._list=[],e===undefined||null===e||(e instanceof o?this._list=a(String(e)):"object"==typeof e&&t(e)?n(e).forEach(function(e){if(!t(e))throw TypeError();var r=n(e);if(2!==r.length)throw TypeError();i._list.push({name:String(r[0]),value:String(r[1])})}):"object"==typeof e&&e?Object.keys(e).forEach(function(t){i._list.push({name:String(t),value:String(e[t])})}):(e=String(e),"?"===e.substring(0,1)&&(e=e.substring(1)),this._list=a(e))),this._url_object=null,this._setList=function(e){u||(i._list=e)};var u=!1;this._update_steps=function(){u||(u=!0,i._url_object&&("about:"===i._url_object.protocol&&-1!==i._url_object.pathname.indexOf("?")&&(i._url_object.pathname=i._url_object.pathname.split("?")[0]),i._url_object.search=r(i._list),u=!1))}}function u(e,t){var n=0;this.next=function(){if(n>=e.length)return{done:!0,value:undefined};var r=e[n++];return{done:!1,value:"key"===t?r.name:"value"===t?r.value:[r.name,r.value]}}}function l(t,n){function r(){var e=l.href.replace(/#$|\?$|\?(?=#)/g,"");l.href!==e&&(l.href=e)}function u(){m._setList(l.search?a(l.search.substring(1)):[]),m._update_steps()}if(!(this instanceof e.URL))throw new TypeError("Failed to construct 'URL': Please use the 'new' operator.");n&&(t=function(){if(c)return new s(t,n).href;var e;try{var r;if("[object OperaMini]"===Object.prototype.toString.call(window.operamini)?(e=document.createElement("iframe"),e.style.display="none",document.documentElement.appendChild(e),r=e.contentWindow.document):document.implementation&&document.implementation.createHTMLDocument?r=document.implementation.createHTMLDocument(""):document.implementation&&document.implementation.createDocument?(r=document.implementation.createDocument("http://www.w3.org/1999/xhtml","html",null),r.documentElement.appendChild(r.createElement("head")),r.documentElement.appendChild(r.createElement("body"))):window.ActiveXObject&&(r=new window.ActiveXObject("htmlfile"),r.write(""),r.close()),!r)throw Error("base not supported");var a=r.createElement("base");a.href=n,r.getElementsByTagName("head")[0].appendChild(a);var i=r.createElement("a");return i.href=t,i.href}finally{e&&e.parentNode.removeChild(e)}}());var l=i(t||""),f=function(){if(!("defineProperties"in Object))return!1;try{var e={};return Object.defineProperties(e,{prop:{get:function(){return!0}}}),e.prop}catch(t){return!1}}(),h=f?this:document.createElement("a"),m=new o(l.search?l.search.substring(1):null);return m._url_object=h,Object.defineProperties(h,{href:{get:function(){return l.href},set:function(e){l.href=e,r(),u()},enumerable:!0,configurable:!0},origin:{get:function(){return"origin"in l?l.origin:this.protocol+"//"+this.host},enumerable:!0,configurable:!0},protocol:{get:function(){return l.protocol},set:function(e){l.protocol=e},enumerable:!0,configurable:!0},username:{get:function(){return l.username},set:function(e){l.username=e},enumerable:!0,configurable:!0},password:{get:function(){return l.password},set:function(e){l.password=e},enumerable:!0,configurable:!0},host:{get:function(){var e={"http:":/:80$/,"https:":/:443$/,"ftp:":/:21$/}[l.protocol];return e?l.host.replace(e,""):l.host},set:function(e){l.host=e},enumerable:!0,configurable:!0},hostname:{get:function(){return l.hostname},set:function(e){l.hostname=e},enumerable:!0,configurable:!0},port:{get:function(){return l.port},set:function(e){l.port=e},enumerable:!0,configurable:!0},pathname:{get:function(){return"/"!==l.pathname.charAt(0)?"/"+l.pathname:l.pathname},set:function(e){l.pathname=e},enumerable:!0,configurable:!0},search:{get:function(){return l.search},set:function(e){l.search!==e&&(l.search=e,r(),u())},enumerable:!0,configurable:!0},searchParams:{get:function(){return m},enumerable:!0,configurable:!0},hash:{get:function(){return l.hash},set:function(e){l.hash=e,r()},enumerable:!0,configurable:!0},toString:{value:function(){return l.toString()},enumerable:!1,configurable:!0},valueOf:{value:function(){return l.valueOf()},enumerable:!1,configurable:!0}}),h}var c,s=e.URL;try{if(s){if("searchParams"in(c=new e.URL("http://example.com"))){var f=new l("http://example.com");if(f.search="a=1&b=2","http://example.com/?a=1&b=2"===f.href&&(f.search="","http://example.com/"===f.href))return}"href"in c||(c=undefined),c=undefined}}catch(m){}if(Object.defineProperties(o.prototype,{append:{value:function(e,t){this._list.push({name:e,value:t}),this._update_steps()},writable:!0,enumerable:!0,configurable:!0},"delete":{value:function(e){for(var t=0;t1?arguments[1]:undefined;this._list.forEach(function(n){e.call(t,n.value,n.name)})},writable:!0,enumerable:!0,configurable:!0},toString:{value:function(){return r(this._list)},writable:!0,enumerable:!1,configurable:!0}}),"Symbol"in e&&"iterator"in e.Symbol&&(Object.defineProperty(o.prototype,e.Symbol.iterator,{value:o.prototype.entries,writable:!0,enumerable:!0,configurable:!0}),Object.defineProperty(u.prototype,e.Symbol.iterator,{value:function(){return this},writable:!0,enumerable:!0,configurable:!0})),s)for(var h in s)s.hasOwnProperty(h)&&"function"==typeof s[h]&&(l[h]=s[h]);e.URL=l,e.URLSearchParams=o}(),function(){if("1"!==new e.URLSearchParams([["a",1]]).get("a")||"1"!==new e.URLSearchParams({a:1}).get("a")){var r=e.URLSearchParams;e.URLSearchParams=function(e){if(e&&"object"==typeof e&&t(e)){var a=new r;return n(e).forEach(function(e){if(!t(e))throw TypeError();var r=n(e);if(2!==r.length)throw TypeError();a.append(r[0],r[1])}),a}return e&&"object"==typeof e?(a=new r,Object.keys(e).forEach(function(t){a.set(t,e[t])}),a):new r(e)}}}()}(self);!function(e){var t=Symbol("undef"),r=function a(){if(!(this instanceof a))throw new TypeError('Constructor WeakMap requires "new"');var e=OrdinaryCreateFromConstructor(this,a.prototype,{_keys:[],_values:[],_es6WeakMap:!0}),t=arguments.length>0?arguments[0]:undefined;if(null===t||t===undefined)return e;var r=Get(e,"set");if(!IsCallable(r))throw new TypeError("WeakMap.prototype.set is not a function");try{for(var o=GetIterator(t);;){var p=IteratorStep(o);if(!1===p)return e;var n=IteratorValue(p);if("object"!==Type(n))try{throw new TypeError("Iterator value "+n+" is not an entry object")}catch(s){return IteratorClose(o,s)}try{var i=Get(n,"0"),l=Get(n,"1");Call(r,e,[i,l])}catch(u){return IteratorClose(o,u)}}}catch(u){if(Array.isArray(t)||"[object Arguments]"===Object.prototype.toString.call(t)||t.callee){var y,c=t.length;for(y=0;y0?arguments[0]:undefined;if(null===t||t===undefined)return e;var r=Get(e,"add");if(!IsCallable(r))throw new TypeError("WeakSet.prototype.add is not a function");try{for(var o=GetIterator(t);;){var n=IteratorStep(o);if(!1===n)return e;var l=IteratorValue(n);try{Call(r,e,[l])}catch(c){return IteratorClose(o,c)}}}catch(c){if(IsArray(t)||"[object Arguments]"===Object.prototype.toString.call(t)||t.callee){var i,p=t.length;for(i=0;i + + + + + title + + + + + + + + + \ No newline at end of file diff --git a/designer-base/src/main/resources/com/fr/design/login/login.js b/designer-base/src/main/resources/com/fr/design/login/login.js new file mode 100644 index 000000000..71e2daa06 --- /dev/null +++ b/designer-base/src/main/resources/com/fr/design/login/login.js @@ -0,0 +1 @@ +!function(e){var t={};function i(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,i),o.l=!0,o.exports}i.m=e,i.c=t,i.d=function(e,t,n){i.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},i.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.t=function(e,t){if(1&t&&(e=i(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(i.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)i.d(n,o,function(t){return e[t]}.bind(null,o));return n},i.n=function(e){var t=e&&e.__esModule?function(){return e["default"]}:function(){return e};return i.d(t,"a",t),t},i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},i.p="",i(i.s=4)}([function(e,t,i){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,i,n){n===undefined&&(n=i),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[i]}})}:function(e,t,i,n){n===undefined&&(n=i),e[n]=t[i]}),o=this&&this.__exportStar||function(e,t){for(var i in e)"default"===i||t.hasOwnProperty(i)||n(t,e,i)};Object.defineProperty(t,"__esModule",{value:!0}),o(i(5),t)},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=window.DesignerLoginHelper,o=function(){function e(){}return e.prototype.getParams=function(){return{designerLoginSource:window.designerLoginSource||"0",lastLoginType:window.lastLoginType||"-1",lastLoginAccount:window.lastLoginAccount||""}},e.prototype.closeWindow=function(e){n&&n.closeWindow(e)},e.prototype.serviceHref=function(){n?n.serviceHref():window.open("https://bbs.fanruan.com/thread-102821-1-1.html")},e.prototype.forgetHref=function(){n?n.forgetHref():window.open("https://id.fanruan.com/forget/forget.php?clue=activityf")},e.prototype.normalLogin=function(e,t,i){n?n.normalLogin(e,t,i):i(-1)},e.prototype.sendCaptcha=function(e,t,i){n?n.sendCaptcha(e,t,i):i(-1)},e.prototype.smsLogin=function(e,t,i,o){n?n.smsLogin(e,t,i,o):o(null)},e.prototype.smsRegister=function(e,t,i,o,s){n?n.smsRegister(e,t,i,o,s):s(-1)},e.prototype.resize=function(e,t){n&&n.resize(e,t)},e}();t["default"]=new o},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BBS_ERROR_CODE=t.NORMAL_LOGIN_RESULT=t.REGION=t.LOGIN=void 0,t.LOGIN={NORMAL_METHOD:"normal",SMS_METHOD:"sms",TABS:{LOGIN:"login",FORGET_PASSWORD:"forget",RESET_PASSWORD:"reset",REGISTER:"register"}},t.REGION=[{value:"+86",text:"Designer-Basic_Chinese_Mainland"},{value:"+886",text:"Designer-Basic_Chinese_Taiwan"},{value:"+852",text:"Designer-Basic_Chinese_Hong_Kong"},{value:"+853",text:"Designer-Basic_Chinese_Macao"},{value:"+90",text:"Designer-Basic_Turkey"},{value:"+82",text:"Designer-Basic_South_Korea"},{value:"+81",text:"Designer-Basic_Japan"},{value:"+65",text:"Designer-Basic_Singapore"},{value:"+60",text:"Designer-Basic_Malaysia"}],t.NORMAL_LOGIN_RESULT=[{status:0,message:"Designer-Login_Internal_Error"},{status:-1,message:"Designer-Login_Store_User_Not_Exist"},{status:-2,message:"Designer-Login_Store_User_Password_Error"},{status:-3,message:"Designer-Login_Unexpected_Error"},{status:-4,message:"Designer-Login_Network_Connected_Failed"}],t.BBS_ERROR_CODE=[{status:0,message:"Designer-Login_Internal_Error"},{status:-1,message:"Designer-BBS_Register_Timeout"},{status:-2,message:"Designer-BBS_Phone_Is_Register"},{status:-3,message:"Designer-BBS_Captcha_Send_Exceed_Limit"},{status:-4,message:"Designer-BBS_Phone_Format_Error"},{status:-100,message:"Designer-BBS_Captcha_Out_Of_Date"},{status:-101,message:"Designer-BBS_Captcha_Try_Exceed_Limit"},{status:-102,message:"Designer-BBS_Captcha_Error"},{status:-104,message:"Designer-BBS_Username_Format_Error"},{status:-103,message:"Designer-BBS_Please_Enter_Correct_Phone"},{status:-105,message:"Designer-BBS_Username_Too_Short"},{status:-106,message:"Designer-BBS_Username_Too_Long"},{status:-107,message:"Designer-BBS_Phone_Is_Register"},{status:-108,message:"Designer-BBS_Username_Is_Register"}]},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getError=void 0,t.getError=function(e,t){var i=BI.find(e,(function(e,i){return i.status===t}));return i&&i.message?i.message:""}},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=i(0),o=i(6);BI.addI18n(Store.i18n),BI.createWidget({type:n.Vertical,element:"body",items:[{type:o["default"]}]})},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ListView=t.VirtualGroup=t.LeftRightVerticalAdapt=t.Left=t.Horizontal=t.Vertical=t.Absolute=t.Layout=t.Htape=t.CenterAdapt=t.Vtape=t.HorizontalAdapt=t.VerticalAdapt=t.BubbleCombo=t.Img=t.Tab=t.SingleSelectInsertCombo=t.SingleSelectRadioItem=t.MultiTreePopupView=t.Editor=t.NicEditor=t.RichEditor=t.MultiTreeCombo=t.DynamicDateTimeCombo=t.DynamicDateCombo=t.BarPopOver=t.MultiSelectItem=t.TextAreaEditor=t.AllValueChooserCombo=t.ButtonGroup=t.MultiSelectInsertCombo=t.TextEditor=t.Button=t.SignEditor=t.MultiFileEditor=t.SmallTextEditor=t.HtmlLabel=t.Label=t.DownListCombo=t.TextButton=t.IconChangeButton=t.IconButton=t.IconTextIconItem=t.IconTextItem=void 0,t.IconTextItem="bi.icon_text_item",t.IconTextIconItem="bi.icon_text_icon_item",t.IconButton="bi.icon_button",t.IconChangeButton="bi.icon_change_button",t.TextButton="bi.text_button",t.DownListCombo="bi.down_list_combo",t.Label="bi.label",t.HtmlLabel="bi.html_label",t.SmallTextEditor="bi.small_text_editor",t.MultiFileEditor="bi.multifile_editor",t.SignEditor="bi.sign_editor",t.Button="bi.button",t.TextEditor="bi.text_editor",t.MultiSelectInsertCombo="bi.multi_select_insert_combo",t.ButtonGroup="bi.button_group",t.AllValueChooserCombo="bi.all_value_chooser_combo",t.TextAreaEditor="bi.textarea_editor",t.MultiSelectItem="bi.multi_select_item",t.BarPopOver="bi.bar_popover",t.DynamicDateCombo="bi.dynamic_date_combo",t.DynamicDateTimeCombo="bi.dynamic_date_time_combo",t.MultiTreeCombo="bi.multi_tree_combo",t.RichEditor="bi.rich_editor",t.NicEditor="bi.nic_editor",t.Editor="bi.editor",t.MultiTreePopupView="bi.multi_tree_popup_view",t.SingleSelectRadioItem="bi.single_select_radio_item",t.SingleSelectInsertCombo="bi.single_select_insert_combo",t.Tab="bi.tab",t.Img="bi.img",t.BubbleCombo="bi.bubble_combo",t.VerticalAdapt="bi.vertical_adapt",t.HorizontalAdapt="bi.horizontal_adapt",t.Vtape="bi.vtape",t.CenterAdapt="bi.center_adapt",t.Htape="bi.htape",t.Layout="bi.layout",t.Absolute="bi.absolute",t.Vertical="bi.vertical",t.Horizontal="bi.horizontal",t.Left="bi.left",t.LeftRightVerticalAdapt="bi.left_right_vertical_adapt",t.VirtualGroup="bi.virtual_group",t.ListView="bi.list_view"},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Widget=t.className=void 0;var n=i(0),o=i(7),s=i(8),r=i(9),a=i(11);i(24),t.className="designer.login.login",t.Widget=BI.inherit(BI.Widget,{props:{baseCls:"designer-login-login",width:420},_store:function(){return BI.Models.getModel(o["default"])},watch:{loading:function(e){this.loading.setVisible(e)}},render:function(){return{type:n.Vertical,cls:"designer-login",items:[{el:{type:n.HorizontalAdapt,items:[{type:s["default"],rgap:14,tgap:14}]}},{el:{type:n.Vertical,items:[{type:r["default"]},{type:a["default"]}]},lgap:15,rgap:15,bgap:15}]}}}),BI.shortcut(t.className,t.Widget),t["default"]=t.className},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});BI.model("designer.login.login.model",BI.inherit(Fix.Model,{childContext:["loading"],state:function(){return{loading:!1}}})),t["default"]="designer.login.login.model"},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Widget=t.className=void 0;var n=i(0),o=i(1);t.className="designer.login.login.close.button",t.Widget=BI.inherit(BI.Widget,{render:function(){return{type:n.TextButton,text:String.fromCharCode(10005),cls:"background-login-close",width:18.38,height:18.38,handler:function(){o["default"].closeWindow(!1)}}}}),BI.shortcut(t.className,t.Widget),t["default"]=t.className},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Widget=t.className=void 0;var n=i(0);i(10),t.className="designer.login.login.title",t.Widget=BI.inherit(BI.Widget,{props:{baseCls:"designer-login-login-title"},render:function(){return{type:n.Label,text:BI.i18nText("Designer-Login_Title"),cls:"bi-font-bold",bgap:10}}}),BI.shortcut(t.className,t.Widget),t["default"]=t.className},function(e,t,i){},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Widget=t.className=void 0;var n=i(0),o=i(12);i(13);var s=i(14),r=i(16),a=i(18),l=i(2),u=i(1),g=249.64,c=331.64,d=422,f=478,p=560;t.className="designer.login.login.body",t.Widget=BI.inherit(BI.Widget,{props:{baseCls:"designer-login-login-body"},_store:function(){return BI.Stores.getStore(o["default"])},watch:{loginMethod:function(e){this.tabOption.setValue(e),this.tab.setSelect(e),this.foot.setLoginMethod(e),this.refreshLoginButton(),e===l.LOGIN.NORMAL_METHOD?(this.tab.setHeight(g),u["default"].resize(d,f)):this.model.expand&&(u["default"].resize(d,p),this.tab.setHeight(c))},approve:function(e){this.refreshLoginButton()},expand:function(e){e&&(u["default"].resize(d,p),this.tab.setHeight(c))}},render:function(){var e=this;return{type:n.Vertical,cls:"designer-login-body",items:[{type:n.ButtonGroup,value:this.model.loginMethod,ref:function(t){e.tabOption=t},layouts:[{type:n.HorizontalAdapt}],items:[{cls:"designer-login-change-mode bi-list-item-effect bi-border-bottom bi-font-bold",width:70,height:28,value:l.LOGIN.SMS_METHOD,text:BI.i18nText("Designer-Login_Sms")},{cls:"designer-login-change-mode bi-list-item-effect bi-border-bottom bi-font-bold",width:70,height:28,value:l.LOGIN.NORMAL_METHOD,text:BI.i18nText("Designer-Login_Normal")}],listeners:[{eventName:BI.ButtonGroup.EVENT_CHANGE,action:function(t){e.store.setLoginMethod(t)}}],tgap:24,lgap:75,rgap:75},{type:n.CenterAdapt,tgap:35,items:[{type:n.Tab,cardCreator:BI.bind(this.createCard,this),showIndex:this.model.loginMethod,ref:function(t){e.tab=t},height:g,width:280}]},{type:s["default"],lgap:50,rgap:50,bgap:30,ref:function(t){e.foot=t},refreshStatus:function(t){e.store.setApprove(t)}}]}},mounted:function(){var e=u["default"].getParams(),t=e.designerLoginSource,i=e.lastLoginType;if("2"===t){var n="0"===i?l.LOGIN.NORMAL_METHOD:l.LOGIN.SMS_METHOD;this.store.setLoginMethod(n)}},createCard:function(e){var t=this;switch(e){case l.LOGIN.NORMAL_METHOD:return{type:r["default"],ref:function(e){t.normalMethod=e}};case l.LOGIN.SMS_METHOD:default:return{type:a["default"],ref:function(e){t.smsMethod=e},expand:function(){t.store.setExpand(!0)}}}},refreshLoginButton:function(){this.model.loginMethod===l.LOGIN.NORMAL_METHOD?this.normalMethod.setApprove(this.model.approve):this.smsMethod.setApprove(this.model.approve)}}),BI.shortcut(t.className,t.Widget),t["default"]=t.className},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Model=t.className=void 0;var n=i(2);t.className="designer.login.model.login.body",t.Model=BI.inherit(Fix.Model,{context:["loading"],state:function(){return{loginMethod:n.LOGIN.SMS_METHOD,approve:!0,expand:!1}},actions:{setLoginMethod:function(e){this.model.loginMethod=e},setApprove:function(e){this.model.approve=e},setExpand:function(e){this.model.expand=e}}}),BI.store(t.className,t.Model),t["default"]=t.className},function(e,t,i){},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Widget=t.className=void 0;var n=i(1),o=i(0);i(15);var s=i(2);t.className="designer.login.login.foot",t.Widget=BI.inherit(BI.Widget,{props:{baseCls:"designer-login-login-foot"},render:function(){var e=this,t=this.options;return{type:o.LeftRightVerticalAdapt,items:{left:[{type:o.MultiSelectItem,width:30,selected:!0,handler:function(){t.refreshStatus(this.isSelected())}},{type:o.Label,cls:"login-foot-text",textAlign:"left",text:BI.i18nText("Designer-Login_I_Have_Read")},{type:o.Label,cls:"login-foot-text",textAlign:"left",text:"《"},{type:o.TextButton,cls:"login-link",textAlign:"left",text:BI.i18nText("Designer-Login_Service_Terms"),handler:function(){n["default"].serviceHref()}},{type:o.Label,cls:"login-foot-text",textAlign:"left",text:"》"}],right:[{type:o.TextButton,cls:"login-link",textAlign:"right",text:BI.i18nText("Designer-Login_Forget_Password"),invisible:!0,ref:function(t){e.forgetPassword=t},handler:function(){n["default"].forgetHref()}}]}}},setLoginMethod:function(e){e===s.LOGIN.NORMAL_METHOD?this.forgetPassword.setVisible(!0):this.forgetPassword.setVisible(!1)}}),BI.shortcut(t.className,t.Widget),t["default"]=t.className},function(e,t,i){},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Widget=t.className=void 0;var n=i(0),o=i(3),s=i(1),r=i(17),a=i(2);t.className="designer.login.login.normal",t.Widget=BI.inherit(BI.Widget,{props:{baseCls:"designer-login-login-body"},_store:function(){return BI.Stores.getStore(r["default"])},watch:{errMessage:function(e){this.errMessage.setText(e)}},render:function(){var e=this;return{type:n.Vertical,items:[{type:n.Label,textAlign:"left",cls:"designer-login-text",text:BI.i18nText("Designer-Login_User_Name"),bgap:3},{type:n.Editor,cls:"bi-border-bottom designer-login-editor-username",watermark:BI.i18nText("Designer-Login_User_Name_Hint"),inputType:"text",allowBlank:!0,height:40,ref:function(t){e.userName=t},listeners:[{eventName:"EVENT_CHANGE",action:function(){e.store.setErrMessage("")}}]},{type:n.Label,textAlign:"left",cls:"designer-login-text",text:BI.i18nText("Designer-Login_Password"),bgap:3},{type:n.Editor,cls:"bi-border-bottom designer-login-editor-password",watermark:BI.i18nText("Designer-Login_Password_Hint"),inputType:"password",allowBlank:!0,height:40,ref:function(t){e.password=t},listeners:[{eventName:"EVENT_CHANGE",action:function(){e.store.setErrMessage("")}}]},{type:n.Label,cls:"designer-login-error-message",textAlign:"center",text:"",height:20,bgap:10,ref:function(t){e.errMessage=t}},{type:n.Button,cls:"login-login-button bi-font-bold",text:BI.i18nText("Designer-Login"),level:"common",height:40,ref:function(t){e.loginButton=t},handler:function(){e.login()},listeners:[{eventName:"EVENT_CHANGE",action:function(){e.store.setErrMessage("")}}]}]}},mounted:function(){var e=this;this.element.keyup((function(t){13===t.keyCode&&e.login()}));var t=s["default"].getParams(),i=t.designerLoginSource,n=t.lastLoginType,o=t.lastLoginAccount;"2"===i&&"0"===n&&e.userName.setValue(o)},checkUsername:function(){var e=this.userName.getValue();e&&this.userName.setValue(e.replace(/\s+/g,""))},login:function(){var e=this;e.checkUsername();var t=this.userName.getValue(),i=this.password.getValue();t?i?s["default"].normalLogin(t,i,(function(t){var i=parseInt(t,10);if(i>0)s["default"].closeWindow(!0);else{var n=o.getError(a.NORMAL_LOGIN_RESULT,i);n&&e.store.setErrMessage(BI.i18nText(n))}})):this.store.setErrMessage(BI.i18nText("Designer-Login_Password_Not_Null")):this.store.setErrMessage(BI.i18nText("Designer-Login_Username_Not_Null"))},setApprove:function(e){this.loginButton.setEnable(e)}}),BI.shortcut(t.className,t.Widget),t["default"]=t.className},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Model=t.className=void 0,t.className="designer.login.model.normal_method",t.Model=BI.inherit(Fix.Model,{context:[""],state:function(){return{errMessage:""}},actions:{setErrMessage:function(e){this.model.errMessage=e}}}),BI.store(t.className,t.Model),t["default"]=t.className},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Widget=t.className=void 0;var n=i(0),o=i(19),s=i(21),r=i(22),a=i(2),l=i(23),u=i(1),g=i(3);t.className="designer.login.login.sms",t.Widget=BI.inherit(BI.Widget,{props:{baseCls:"designer-login-login-body"},_store:function(){return BI.Stores.getStore(l["default"])},watch:{errMessage:function(e){this.errMessage.setText(e)},isRegister:function(e){var t=this.options;e&&(t.expand(),this.password.setVisible(!0),this.passwordLabel.setVisible(!0))}},render:function(){var e=this,t=this;return{type:n.Vertical,items:[{type:n.Label,textAlign:"left",cls:"designer-login-text",text:BI.i18nText("Designer-Login_Phone"),bgap:3},{type:n.HorizontalAdapt,bgap:7,items:[{type:o["default"],height:42,textFormatter:function(e){var i=t.getNumberTypeItem(e);return{value:i.value,text:BI.i18nText(i.text)}},value:a.REGION[0].value,items:BI.map(a.REGION,(function(e,t){return{type:s["default"],value:t.value,label:BI.i18nText(t.text),text:t.value}})),ref:function(t){e.regionCode=t}},{type:n.Editor,cls:"bi-border-bottom designer-login-editor-username",watermark:BI.i18nText("Designer-Login_Phone_Hint"),inputType:"text",allowBlank:!0,height:40,ref:function(t){e.phone=t},listeners:[{eventName:"EVENT_CHANGE",action:function(){e.store.setErrMessage("")}}]}]},{type:n.Label,textAlign:"left",cls:"designer-login-text",text:BI.i18nText("Designer-Login_Code"),bgap:3},{type:n.Horizontal,bgap:7,items:[{type:n.Editor,cls:"bi-border-bottom designer-login-editor-password",watermark:BI.i18nText("Designer-Login_Code_Hint"),inputType:"text",allowBlank:!0,height:40,width:200,ref:function(t){e.code=t},listeners:[{eventName:"EVENT_CHANGE",action:function(){e.store.setErrMessage("")}}]},{type:r["default"],height:40,width:80,ref:function(t){e.accountCaptcha=t},listeners:[{eventName:"EVENT_SEND",action:function(){t.sendCaptcha()}}]}]},{type:n.Label,textAlign:"left",cls:"designer-login-text",text:BI.i18nText("Designer-Login_Password"),bgap:3,invisible:!0,ref:function(t){e.passwordLabel=t}},{type:n.Editor,cls:"bi-border-bottom designer-login-editor-password",watermark:BI.i18nText("Designer-Login_Password_Setting_Hint"),inputType:"password",allowBlank:!0,height:40,invisible:!0,ref:function(t){e.password=t},listeners:[{eventName:"EVENT_CHANGE",action:function(){e.store.setErrMessage("")}}]},{type:n.Label,cls:"designer-login-error-message",textAlign:"center",text:"",height:20,bgap:11,ref:function(t){e.errMessage=t}},{type:n.Button,cls:"login-login-button bi-font-bold",text:BI.i18nText("Designer-Login_Register_Or_Login"),level:"common",height:40,ref:function(t){e.loginButton=t},handler:function(){e.login()}}]}},mounted:function(){var e=this;this.element.keyup((function(t){13===t.keyCode&&e.login()}));var t=u["default"].getParams(),i=t.designerLoginSource,n=t.lastLoginType,o=t.lastLoginAccount;if("2"===i&&"1"===n){var s=o.split("-")[0],r=o.split("-")[1];e.regionCode.setValue(s),e.phone.setValue(r)}},getNumberTypeItem:function(e){return BI.find(a.REGION,(function(t,i){return e===i.value}))||{}},checkPhone:function(){var e=this.phone.getValue();e&&this.phone.setValue(e.replace(/\s+/g,""))},login:function(){var e=this,t=this;t.checkPhone();var i=this.phone.getValue(),n=this.code.getValue();if(i)if(n){var o=this.regionCode.getValue();if(this.model.isRegister){var s=this.password.getValue();if(!s)return void this.store.setErrMessage(BI.i18nText("Designer-Login_Password_Not_Null"));var r=this.model.regToken;if(!r)return void this.store.setErrMessage(BI.i18nText("Designer-Login_Token_Request_Failed"));u["default"].smsRegister(o,i,s,r,(function(e){var i=parseInt(e,10);if(i>0)u["default"].closeWindow(!0);else{var n=g.getError(a.BBS_ERROR_CODE,i);n&&t.store.setErrMessage(BI.i18nText(n))}}))}else u["default"].smsLogin(o,i,n,(function(i){var n=JSON.parse(i);if(n.status>0)if(!0===n.register){var o=n.regtoken;o?(t.store.setRegister(!0),t.store.setRegToken(o)):e.store.setErrMessage(BI.i18nText("Designer-Login_Token_Request_Failed"))}else u["default"].closeWindow(!0);else{var s=g.getError(a.BBS_ERROR_CODE,n.status);s&&t.store.setErrMessage(BI.i18nText(s))}}))}else this.store.setErrMessage(BI.i18nText("Designer-Login_Code_Not_Null"));else this.store.setErrMessage(BI.i18nText("Designer-Login_Phone_Not_Null"))},sendCaptcha:function(){var e=this;e.checkPhone();var t=this.phone.getValue();if(!t)return e.accountCaptcha.setButtonEnable(!0),void this.store.setErrMessage(BI.i18nText("Designer-Login_Phone_Not_Null"));var i=this.regionCode.getValue();u["default"].sendCaptcha(i,t,(function(t){var i=parseInt(t,10);if(1===i)e.accountCaptcha.regainCaptcha();else{e.accountCaptcha.setButtonEnable(!0);var n=g.getError(a.BBS_ERROR_CODE,i);n&&e.store.setErrMessage(BI.i18nText(n))}}))},setApprove:function(e){this.loginButton.setEnable(e)}}),BI.shortcut(t.className,t.Widget),t["default"]=t.className},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Widget=t.className=void 0;var n=i(20);t.className="designer.left_right_text_value_combo",t.Widget=BI.inherit(BI.Widget,{props:{baseCls:"",height:24,chooseType:BI.ButtonGroup.CHOOSE_TYPE_SINGLE,textFormatter:function(e){return e},value:""},render:function(){var e=this,t=this.options;return{type:"bi.combo",container:t.container,adjustLength:2,ref:function(t){e.combo=t},el:{type:n["default"],cls:"text-value-trigger",items:t.items,height:t.height-2,value:t.textFormatter(t.value),ref:function(t){e.trigger=t}},popup:{el:{type:"bi.text_value_combo_popup",chooseType:t.chooseType,value:t.value,items:t.items,ref:function(t){e.popup=t},listeners:[{eventName:BI.TextValueComboPopup.EVENT_CHANGE,action:function(){e.setValue(e.getValue()),e.combo.hideView(),e.fireEvent("EVENT_CHANGE",arguments)}},{eventName:BI.Controller.EVENT_CHANGE,action:function(){e.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}}]},value:t.value,maxHeight:240,minHeight:25}}},setValue:function(e){this.combo.setValue(e),this.trigger.setValue(this.options.textFormatter(e))},getValue:function(){var e=this.combo.getValue();return BI.isNull(e)?"":BI.isArray(e)?e[0]:e},populate:function(e){this.options.items=e,this.combo.populate(e)}}),BI.shortcut(t.className,t.Widget),t["default"]=t.className},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Widget=t.className=void 0,t.className="designer.left_right_text_value_combo_trigger",t.Widget=BI.inherit(BI.Trigger,{props:{baseCls:"",value:{}},render:function(){var e=this,t=this.options,i=t.value;return{type:"bi.htape",cls:"bi-border-bottom bi-border-radius",items:[{type:"bi.label",text:i.text,title:function(){return e.textRow.getText()},height:t.height,hgap:3,textAlign:"left",ref:function(t){e.textRow=t}},{type:"bi.label",text:i.value,height:t.height,width:32,textAlign:"right",ref:function(t){e.valueRow=t}},{type:"bi.trigger_icon_button",width:t.triggerWidth||t.height}]}},setValue:function(e){this.textRow.setText(e.text),this.valueRow.setText(e.value)},setText:function(e){this.textRow.setText(e)}}),BI.shortcut(t.className,t.Widget),t["default"]=t.className},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Widget=t.className=void 0,t.className="designer.components.phone.editor.item",t.Widget=BI.inherit(BI.BasicButton,{props:{baseCls:"designer-login-login-body",label:"",text:""},render:function(){var e=this.options;return{type:"bi.htape",items:[{el:{type:"bi.label",text:e.label,title:e.label,textAlign:"left"},lgap:10,rgap:5},{el:{type:"bi.label",text:e.text,textAlign:"right"},width:32,rgap:10}]}},doClick:function(){BI.SingleSelectItem.superclass.doClick.apply(this,arguments),this.isValid()&&this.fireEvent("EVENT_CHANGE",this.isSelected(),this)},setSelected:function(e){BI.SingleSelectItem.superclass.setSelected.apply(this,arguments)},getValue:function(){return this.options.value}}),BI.shortcut(t.className,t.Widget),t["default"]=t.className},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Widget=t.className=void 0;var n=i(0);t.className="designer.user.account.setting.captcha",t.Widget=BI.inherit(BI.Widget,{props:{baseCls:"designer-login-login-body"},render:function(){var e=this;this.options;return{type:n.TextButton,text:BI.i18nText("Designer-Login_Code_Request"),cls:"designer-login-border-bottom designer-login-code-text",handler:function(){e.setButtonEnable(!1),e.fireEvent("EVENT_SEND")},ref:function(t){e.getButton=t}}},setButtonEnable:function(e){this.captchaTime&&(e=!1),this.getButton.setEnable(e)},regainCaptcha:function(){var e=this,t=0;window.clearInterval(e.captchaTime),this.captchaTime=window.setInterval((function(){if(60===t)return window.clearInterval(e.captchaTime),e.captchaTime=null,e.getButton.setText(BI.i18nText("Designer-Login_Code_Request")),void e.setButtonEnable(!0);e.getButton.setText(BI.i18nText("Designer-Login_Code_Request_Again")+"("+(60-t)+")"),t++}),1e3),this.setButtonEnable(!1)}}),BI.shortcut(t.className,t.Widget),t["default"]=t.className},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Model=t.className=void 0,t.className="designer.login.model.sms_method",t.Model=BI.inherit(Fix.Model,{context:[""],state:function(){return{errMessage:"",isRegister:!1,regToken:""}},actions:{setErrMessage:function(e){this.model.errMessage=e},setRegister:function(e){this.model.isRegister=e},setRegToken:function(e){this.model.regToken=e}}}),BI.store(t.className,t.Model),t["default"]=t.className},function(e,t,i){}]); \ No newline at end of file diff --git a/designer-form/src/main/java/com/fr/design/mainframe/share/ui/block/OnlineWidgetBlock.java b/designer-form/src/main/java/com/fr/design/mainframe/share/ui/block/OnlineWidgetBlock.java index 4b5c9c0cb..b8cb0e678 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/share/ui/block/OnlineWidgetBlock.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/share/ui/block/OnlineWidgetBlock.java @@ -1,14 +1,15 @@ package com.fr.design.mainframe.share.ui.block; import com.fr.base.iofile.attr.SharableAttrMark; -import com.fr.config.MarketConfig; +import com.fr.design.DesignerEnvManager; import com.fr.design.base.mode.DesignModeContext; import com.fr.design.designer.creator.XCreator; -import com.fr.design.extra.WebViewDlgHelper; import com.fr.design.form.util.XCreatorConstants; import com.fr.design.gui.ilable.UILabel; import com.fr.design.i18n.Toolkit; import com.fr.design.layout.FRGUIPaneFactory; +import com.fr.design.login.DesignerLoginHelper; +import com.fr.design.login.DesignerLoginSource; import com.fr.design.mainframe.WidgetToolBarPane; import com.fr.design.mainframe.share.collect.ComponentCollector; import com.fr.form.share.group.DefaultShareGroup; @@ -156,9 +157,9 @@ public class OnlineWidgetBlock extends AbstractOnlineWidgetBlock { final WidgetDownloadProcess process = new WidgetDownloadProcess(); downloading = true; process.process(0.0D); - String userName = MarketConfig.getInstance().getBbsUsername(); + String userName = DesignerEnvManager.getEnvManager().getDesignerLoginUsername(); if (StringUtils.isEmpty(userName)) { - WebViewDlgHelper.createLoginDialog(); + DesignerLoginHelper.showLoginDialog(DesignerLoginSource.NORMAL); downloading = false; return; } diff --git a/designer-form/src/main/java/com/fr/design/mainframe/share/util/SharableXMLUtils.java b/designer-form/src/main/java/com/fr/design/mainframe/share/util/SharableXMLUtils.java deleted file mode 100644 index baacf4272..000000000 --- a/designer-form/src/main/java/com/fr/design/mainframe/share/util/SharableXMLUtils.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.fr.design.mainframe.share.util; - -import com.fr.form.share.encrypt.engine.SharableReadHelper; -import com.fr.stable.xml.XMLConf; -import com.fr.stable.xml.helper.XMLReadHelper; - -public class SharableXMLUtils { - public static synchronized void registerSharableReadHelper() { - XMLReadHelper readHelper = XMLConf.getReadHelper(); - XMLReadHelper helper = new SharableReadHelper(readHelper); - XMLConf.registerXMLHelper(helper); - } -} diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/ActiveKeyGenerator.java b/designer-realize/src/main/java/com/fr/design/mainframe/ActiveKeyGenerator.java index 8b6c3ce4c..68496a76b 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/ActiveKeyGenerator.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/ActiveKeyGenerator.java @@ -1,5 +1,4 @@ package com.fr.design.mainframe; -import com.fr.config.MarketConfig; import com.fr.design.DesignerEnvManager; import com.fr.general.CloudCenter; import com.fr.general.http.HttpClient; @@ -101,7 +100,7 @@ public class ActiveKeyGenerator { HashMap para = new HashMap(); para.put("uuid", envManager.getUUID()); para.put("key", key); - para.put("username", MarketConfig.getInstance().getBbsUsername()); + para.put("username", DesignerEnvManager.getEnvManager().getDesignerLoginUsername()); HttpClient hc = new HttpClient(CloudCenter.getInstance().acquireUrlByKind("verify.code"), para); if (timeout != -1) { hc.setTimeout(timeout); diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/component/AlphaFineDialog.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/component/AlphaFineDialog.java index acfcdb4d3..c708960d7 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/component/AlphaFineDialog.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/component/AlphaFineDialog.java @@ -1,7 +1,6 @@ package com.fr.design.mainframe.alphafine.component; import com.bulenkov.iconloader.IconLoader; -import com.fr.config.MarketConfig; import com.fr.design.DesignerEnvManager; import com.fr.design.actions.help.alphafine.AlphaFineConfigManager; import com.fr.design.dialog.UIDialog; @@ -952,7 +951,7 @@ public class AlphaFineDialog extends UIDialog { */ private void sendDataToServer(String searchKey, AlphaCellModel cellModel) { if (cellModel.isNeedToSendToServer()) { - String username = MarketConfig.getInstance().getBbsUsername(); + String username = DesignerEnvManager.getEnvManager().getDesignerLoginUsername(); String uuid = DesignerEnvManager.getEnvManager().getUUID(); String activityKey = DesignerEnvManager.getEnvManager().getActivationKey(); String createTime = new SimpleDateFormat("yyyy-MM-dd HH:mm").format(Calendar.getInstance().getTime()); diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/bbs/UserInfoLabel.java b/designer-realize/src/main/java/com/fr/design/mainframe/bbs/UserInfoLabel.java index 92a288254..4e25381e1 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/bbs/UserInfoLabel.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/bbs/UserInfoLabel.java @@ -3,19 +3,17 @@ */ package com.fr.design.mainframe.bbs; -import com.fr.base.FRContext; -import com.fr.config.MarketConfig; import com.fr.design.DesignerEnvManager; import com.fr.design.bbs.BBSLoginUtils; +import com.fr.design.constants.UIConstants; import com.fr.design.extra.LoginContextListener; -import com.fr.design.extra.LoginWebBridge; -import com.fr.design.extra.PluginWebBridge; import com.fr.design.extra.UserLoginContext; -import com.fr.design.extra.WebViewDlgHelper; import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.imenu.UIMenuItem; import com.fr.design.gui.imenu.UIPopupMenu; import com.fr.design.locale.impl.BbsSpaceMark; +import com.fr.design.login.DesignerLoginHelper; +import com.fr.design.login.DesignerLoginSource; import com.fr.design.mainframe.DesignerContext; import com.fr.design.os.impl.SupportOSImpl; import com.fr.design.upm.event.CertificateEvent; @@ -32,8 +30,8 @@ import com.fr.general.locale.LocaleCenter; import com.fr.general.locale.LocaleMark; import com.fr.log.FineLoggerFactory; import com.fr.stable.EncodeConstants; -import com.fr.stable.StableUtils; import com.fr.stable.StringUtils; +import java.awt.Color; import javax.swing.SwingConstants; import java.awt.Cursor; import java.awt.Desktop; @@ -82,11 +80,17 @@ public class UserInfoLabel extends UILabel { @Override public void mouseEntered(MouseEvent e) { UserInfoLabel.this.setCursor(new Cursor(Cursor.HAND_CURSOR)); + UserInfoLabel.this.setBackground(UIConstants.DESIGNER_LOGIN_BACKGROUND_ONCLICK); + } + + @Override + public void mouseExited(MouseEvent e) { + UserInfoLabel.this.setBackground(UIConstants.DESIGNER_LOGIN_BACKGROUND); } @Override public void mouseClicked(MouseEvent e) { - userName = MarketConfig.getInstance().getBbsUsername(); + userName = DesignerEnvManager.getEnvManager().getDesignerLoginUsername(); if (StringUtils.isNotEmpty(userName)) { UIPopupMenu menu = new UIPopupMenu(); menu.setOnlyText(true); @@ -113,15 +117,14 @@ public class UserInfoLabel extends UILabel { closeOther.addMouseListener(new MouseAdapter() { @Override public void mousePressed(MouseEvent e) { - BBSLoginUtils.bbsLogout(); - UserLoginContext.fireLoginContextListener(); + UserLoginContext.fireLoginContextListener(DesignerLoginSource.SWITCH_ACCOUNT); } }); menu.add(priviteMessage); menu.add(closeOther); GUICoreUtils.showPopupMenu(menu, UserInfoLabel.this, 0, MENU_HEIGHT); } else { - UserLoginContext.fireLoginContextListener(); + UserLoginContext.fireLoginContextListener(DesignerLoginSource.NORMAL); } } }; @@ -202,17 +205,10 @@ public class UserInfoLabel extends UILabel { this.addMouseListener(userInfoAdapter); this.setHorizontalAlignment(SwingConstants.CENTER); - if (StableUtils.getMajorJavaVersion() >= VERSION_8) { - LoginWebBridge.getHelper().setUILabel(UserInfoLabel.this); - PluginWebBridge.getHelper().setUILabel(UserInfoLabel.this); - } - UserLoginContext.addLoginContextListener(new LoginContextListener() { @Override - public void showLoginContext() { - WebViewDlgHelper.createLoginDialog(); - clearLoginInformation(); - updateInfoPane(); + public void showLoginContext(DesignerLoginSource source) { + DesignerLoginHelper.showLoginDialog(source); } }); EventDispatcher.listen(CertificateEvent.LOGIN, new Listener() { @@ -221,22 +217,12 @@ public class UserInfoLabel extends UILabel { setText(text); } }); - EventDispatcher.listen(CertificateEvent.LOGOUT, new Listener() { - @Override - public void on(Event event, String text) { - setText(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Base_UnSignIn")); - } - }); } private void clearLoginInformation() { BBSLoginUtils.bbsLogout(); } - private void updateInfoPane() { - userInfoPane.markUnSignIn(); - } - private void sleep(long millis) { try { Thread.sleep(millis); diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/bbs/UserInfoPane.java b/designer-realize/src/main/java/com/fr/design/mainframe/bbs/UserInfoPane.java index 24ae13eda..1e3df83df 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/bbs/UserInfoPane.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/bbs/UserInfoPane.java @@ -5,7 +5,6 @@ package com.fr.design.mainframe.bbs; import com.fr.base.FRContext; import com.fr.concurrent.NamedThreadFactory; -import com.fr.config.MarketConfig; import com.fr.design.DesignerEnvManager; import com.fr.design.constants.UIConstants; import com.fr.design.dialog.BasicPane; @@ -34,7 +33,7 @@ public class UserInfoPane extends BasicPane { /** * 默认未登录颜色 */ - private static final Color UN_LOGIN_BACKGROUND = UIConstants.TEMPLATE_TAB_PANE_BACKGROUND; + private static final Color UN_LOGIN_BACKGROUND = UIConstants.DESIGNER_LOGIN_BACKGROUND; private static final Color LOGIN_BACKGROUND = new Color(184, 220, 242); private static final int WIDTH = 104; private static final int HEIGHT = 24; @@ -91,7 +90,8 @@ public class UserInfoPane extends BasicPane { * 标志未登录状态, 面板设置为灰色 */ public void markUnSignIn() { - this.userInfoLabel.setText(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Base_UnSignIn")); + this.userInfoLabel.setText(com.fr.design.i18n.Toolkit.i18nText("Fine-Designer_Login_Onclick")); + this.userInfoLabel.setForeground(Color.WHITE); this.userInfoLabel.setOpaque(true); this.userInfoLabel.setBackground(UN_LOGIN_BACKGROUND); this.userInfoLabel.resetUserName(); @@ -104,6 +104,7 @@ public class UserInfoPane extends BasicPane { */ public void markSignIn(String userName) { this.userInfoLabel.setText(userName); + this.userInfoLabel.setForeground(Color.BLACK); this.userInfoLabel.setUserName(userName); this.userInfoLabel.setOpaque(true); this.userInfoLabel.setBackground(LOGIN_BACKGROUND); @@ -115,7 +116,7 @@ public class UserInfoPane extends BasicPane { } public void updateBBSUserInfo() { - String username = MarketConfig.getInstance().getBbsUsername(); + String username = DesignerEnvManager.getEnvManager().getDesignerLoginUsername(); if (StringUtils.isEmpty(username)) { markUnSignIn(); } else { @@ -173,7 +174,7 @@ public class UserInfoPane extends BasicPane { FineLoggerFactory.getLogger().error(e.getMessage(), e); } - String userName = MarketConfig.getInstance().getBbsUsername(); + String userName = DesignerEnvManager.getEnvManager().getDesignerLoginUsername(); if (StringUtils.isNotEmpty(userName)) { return; } diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/errorinfo/ErrorInfoLogAppender.java b/designer-realize/src/main/java/com/fr/design/mainframe/errorinfo/ErrorInfoLogAppender.java index dd9c50c9e..2626193a4 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/errorinfo/ErrorInfoLogAppender.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/errorinfo/ErrorInfoLogAppender.java @@ -2,7 +2,6 @@ package com.fr.design.mainframe.errorinfo; import com.fr.base.io.IOFile; import com.fr.base.io.XMLReadHelper; -import com.fr.config.MarketConfig; import com.fr.design.DesignerEnvManager; import com.fr.design.i18n.Toolkit; import com.fr.web.session.SessionLocalManager; @@ -43,7 +42,7 @@ public class ErrorInfoLogAppender extends AppenderSkeleton { this.layout = new com.fr.third.apache.log4j.PatternLayout("%d{HH:mm:ss} %t %p [%c] %m%n"); DesignerEnvManager envManager = DesignerEnvManager.getEnvManager(); - this.username = MarketConfig.getInstance().getBbsUsername(); + this.username = envManager.getDesignerLoginUsername(); this.uuid = envManager.getUUID(); this.activekey = envManager.getActivationKey(); } diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/messagecollect/entity/FileEntityBuilder.java b/designer-realize/src/main/java/com/fr/design/mainframe/messagecollect/entity/FileEntityBuilder.java index 358672d23..09bf17d95 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/messagecollect/entity/FileEntityBuilder.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/messagecollect/entity/FileEntityBuilder.java @@ -1,6 +1,5 @@ package com.fr.design.mainframe.messagecollect.entity; -import com.fr.config.MarketConfig; import com.fr.design.DesignerEnvManager; import com.fr.general.CloudClient; import com.fr.general.IOUtils; @@ -103,7 +102,7 @@ public class FileEntityBuilder { CloudClient client = CloudClient.getInstance(); String today = new JDateTime().toString("YYYY-MM-DD"); String filePath = FOCUS_POINT_FILE_ROOT_PATH + CoreConstants.SEPARATOR + today + CoreConstants.SEPARATOR + keyFileName; - String bbsUserName = MarketConfig.getInstance().getBbsUsername(); + String bbsUserName = DesignerEnvManager.getEnvManager().getDesignerLoginUsername(); String uuid = DesignerEnvManager.getEnvManager().getUUID(); String name = StringUtils.isEmpty(bbsUserName) ? uuid : bbsUserName; diff --git a/designer-realize/src/main/java/com/fr/design/share/SharableManager.java b/designer-realize/src/main/java/com/fr/design/share/SharableManager.java index ba3b83064..05f893fad 100644 --- a/designer-realize/src/main/java/com/fr/design/share/SharableManager.java +++ b/designer-realize/src/main/java/com/fr/design/share/SharableManager.java @@ -9,7 +9,6 @@ import com.fr.design.mainframe.share.collect.ComponentCollector; import com.fr.design.mainframe.share.collect.SharableCollectorManager; import com.fr.design.mainframe.share.encrypt.clipboard.impl.EncryptSelectionClipboardHandler; import com.fr.design.mainframe.share.encrypt.clipboard.impl.EncryptTransferableClipboardHandler; -import com.fr.design.mainframe.share.util.SharableXMLUtils; import com.fr.design.mainframe.share.util.ShareComponentUtils; import com.fr.design.share.utils.EffectItemUtils; import com.fr.json.JSONArray; @@ -18,7 +17,6 @@ import java.util.List; public class SharableManager { public static void start() { - SharableXMLUtils.registerSharableReadHelper(); SharableCollectorManager.getInstance().execute(); ClipboardFilter.registerClipboardHandler(EncryptSelectionClipboardHandler.getInstance()); ClipboardFilter.registerClipboardHandler(EncryptTransferableClipboardHandler.getInstance()); diff --git a/designer-realize/src/main/java/com/fr/design/share/ui/generate/ShareLoginLabel.java b/designer-realize/src/main/java/com/fr/design/share/ui/generate/ShareLoginLabel.java index 14ad32415..47612c850 100644 --- a/designer-realize/src/main/java/com/fr/design/share/ui/generate/ShareLoginLabel.java +++ b/designer-realize/src/main/java/com/fr/design/share/ui/generate/ShareLoginLabel.java @@ -1,6 +1,6 @@ package com.fr.design.share.ui.generate; -import com.fr.config.MarketConfig; +import com.fr.design.DesignerEnvManager; import com.fr.design.gui.ilable.UILabel; import com.fr.design.mainframe.bbs.UserInfoPane; import com.fr.stable.StringUtils; @@ -35,7 +35,7 @@ public class ShareLoginLabel extends UILabel { private void tryGetLogin() { - String bbsUsername = MarketConfig.getInstance().getBbsUsername(); + String bbsUsername = DesignerEnvManager.getEnvManager().getDesignerLoginUsername(); if (StringUtils.isNotEmpty(bbsUsername)) { vendorPane.remove(unLoginLabel); loginLabel.setText(bbsUsername); diff --git a/designer-realize/src/main/java/com/fr/design/share/ui/generate/ShareMainPane.java b/designer-realize/src/main/java/com/fr/design/share/ui/generate/ShareMainPane.java index 504d95be9..df1d2c04b 100644 --- a/designer-realize/src/main/java/com/fr/design/share/ui/generate/ShareMainPane.java +++ b/designer-realize/src/main/java/com/fr/design/share/ui/generate/ShareMainPane.java @@ -1,12 +1,11 @@ package com.fr.design.share.ui.generate; -import com.fr.config.MarketConfig; +import com.fr.design.DesignerEnvManager; import com.fr.design.constants.LayoutConstants; import com.fr.design.dialog.BasicDialog; import com.fr.design.dialog.DialogActionAdapter; import com.fr.design.dialog.FineJOptionPane; import com.fr.design.extra.LoginWebBridge; -import com.fr.design.extra.WebViewDlgHelper; import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.icheckbox.UICheckBox; import com.fr.design.gui.icombobox.UIComboBox; @@ -18,6 +17,8 @@ import com.fr.design.i18n.Toolkit; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayoutHelper; +import com.fr.design.login.DesignerLoginHelper; +import com.fr.design.login.DesignerLoginSource; import com.fr.design.mainframe.DesignerContext; import com.fr.design.mainframe.share.constants.ComponentType; import com.fr.design.mainframe.share.constants.ComponentTypes; @@ -43,6 +44,7 @@ import com.fr.stable.ProductConstants; import com.fr.stable.StringUtils; import com.fr.stable.collections.combination.Pair; import com.fr.stable.pinyin.PinyinHelper; +import java.util.HashMap; import org.jetbrains.annotations.NotNull; import javax.swing.BorderFactory; @@ -419,7 +421,7 @@ public class ShareMainPane extends JPanel { final JPanel vendorPane = FRGUIPaneFactory.createBoxFlowInnerContainer_S_Pane(); - String bbsUsername = MarketConfig.getInstance().getBbsUsername(); + String bbsUsername = DesignerEnvManager.getEnvManager().getDesignerLoginUsername(); if (StringUtils.isEmpty(bbsUsername)) { UILabel unLoginLabel = ShareUIUtils.createHyperlinkLabel(Toolkit.i18nText("Fine-Design_Share_Click_Login")); @@ -431,7 +433,7 @@ public class ShareMainPane extends JPanel { LoginWebBridge.getHelper().setUILabel(hidden); Dialog shareDialog = ShareDialogUtils.getInstance().getShareDialog(); //必须这样创建,不然窗口优先级不对 - WebViewDlgHelper.createLoginDialog(shareDialog); + DesignerLoginHelper.showLoginDialog(DesignerLoginSource.NORMAL, new HashMap<>(), shareDialog); } }); vendorPane.add(unLoginLabel); diff --git a/designer-realize/src/main/java/com/fr/start/CollectUserInformationDialog.java b/designer-realize/src/main/java/com/fr/start/CollectUserInformationDialog.java index ba89eeb99..692245eb4 100644 --- a/designer-realize/src/main/java/com/fr/start/CollectUserInformationDialog.java +++ b/designer-realize/src/main/java/com/fr/start/CollectUserInformationDialog.java @@ -52,6 +52,7 @@ public class CollectUserInformationDialog extends UIDialog { FineJOptionPane.showMessageDialog(CollectUserInformationDialog.this, message); DesignerEnvManager.getEnvManager().setActivationKey(keyValue); DesignerEnvManager.getEnvManager().saveXMLFile(); + DesignerEnvManager.getEnvManager().setDesignerActivatedTime(System.currentTimeMillis()); doOK(); } else { message = com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Activate_Activation_Code_Invalid"); diff --git a/designer-realize/src/main/java/com/fr/start/module/DesignerActivator.java b/designer-realize/src/main/java/com/fr/start/module/DesignerActivator.java index ef3baffd4..1232cd400 100644 --- a/designer-realize/src/main/java/com/fr/start/module/DesignerActivator.java +++ b/designer-realize/src/main/java/com/fr/start/module/DesignerActivator.java @@ -39,6 +39,9 @@ import com.fr.design.javascript.EmailPane; import com.fr.design.javascript.JavaScriptImplPane; import com.fr.design.javascript.ParameterJavaScriptPane; import com.fr.design.javascript.ProcessTransitionAdapter; +import com.fr.design.login.DesignerLoginType; +import com.fr.design.login.guide.DesignerGuideHelper; +import com.fr.design.login.socketio.LoginAuthServer; import com.fr.design.mainframe.BaseJForm; import com.fr.design.mainframe.FormHierarchyTreePane; import com.fr.design.mainframe.InformationCollector; @@ -80,6 +83,7 @@ import com.fr.locale.LocaleScope; import com.fr.log.FineLoggerFactory; import com.fr.log.LogHandler; import com.fr.module.Activator; +import com.fr.module.extension.Prepare; import com.fr.plugin.context.PluginContext; import com.fr.plugin.injectable.PluginModule; import com.fr.plugin.manage.PluginFilter; @@ -127,7 +131,7 @@ import java.awt.image.BufferedImage; * 触发原来的DesignerModule的启动 * 之后慢慢将DesignerModule拆成Activator */ -public class DesignerActivator extends Activator { +public class DesignerActivator extends Activator implements Prepare { private LogHandler logHandler = null; @@ -135,11 +139,13 @@ public class DesignerActivator extends Activator { @Override public void run() { DesignerPushUpdateManager.getInstance().preparePushUpdate(); + DesignerGuideHelper.prepareShowGuideDialog(); } }); @Override public void start() { + migrateBBSInfoFromFineDB(); List markers = findMutable(InterMutableKey.Path); for (LocaleMarker marker : markers) { if (marker.match(LocaleScope.DESIGN)) { @@ -409,18 +415,44 @@ public class DesignerActivator extends Activator { } private static void storePassport() { - FinePassportManager.getInstance().storePassport(MarketConfig.getInstance().getBbsUsername(), DesignerEnvManager.getEnvManager().getActivationKey()); + FinePassportManager.getInstance().storePassport(DesignerEnvManager.getEnvManager().getDesignerLoginUsername(), DesignerEnvManager.getEnvManager().getActivationKey()); FinePassportManager.getInstance().addPassportListener(new FinePassportListenerAdapter() { @Override public void onLoginSuccess() { - FinePassportManager.getInstance().storePassport(MarketConfig.getInstance().getBbsUsername(), DesignerEnvManager.getEnvManager().getActivationKey()); + FinePassportManager.getInstance().storePassport(DesignerEnvManager.getEnvManager().getDesignerLoginUsername(), DesignerEnvManager.getEnvManager().getActivationKey()); } }); } + private void migrateBBSInfoFromFineDB() { + DesignerEnvManager manager = DesignerEnvManager.getEnvManager(); + if (manager.isCurrentVersionFirstLaunch()) { + int newUid = manager.getDesignerLoginUid(); + if (newUid > 0) { + return; + } + int oldUid = MarketConfig.getInstance().getBbsUid(); + if (oldUid > 0) { + manager.setDesignerLoginUid(oldUid); + manager.setDesignerLoginUsername(MarketConfig.getInstance().getBbsUsername()); + manager.setDesignerLoginAppId(MarketConfig.getInstance().getBbsAppId()); + manager.setDesignerLoginRefreshToken(MarketConfig.getInstance().getBbsRefreshToken()); + manager.setCurrentVersionFirstLaunch(false); + manager.setLastLoginType(DesignerLoginType.NORMAL_LOGIN); + manager.setLastLoginAccount(MarketConfig.getInstance().getBbsUsername()); + DesignerEnvManager.getEnvManager().saveXMLFile(); + } + } + } + @Override public void stop() { unloadLogAppender(); DesignerSocketIO.close(); } + + @Override + public void prepare() { + LoginAuthServer.getInstance().start(); + } }