1 !function(){"use strict";var e='<div ng-click="clicked()"> <span><i class="{{icon}}"></i><span>{{label}}</span></span></div>';angular.module("SubmitButton",[]).directive("submitButton",function(){function t(e,t,n){e.icon=n.icon||"fi-foot",e.label=n.label||"Next",t.addClass(e.label.toLowerCase())}return{restrict:"E",template:e,link:t,scope:{clicked:"="}}})}(),function(){"use strict";function e(e){var t=[],n=[];this.getId=function(){return e.sliderid},this.getCbHandle=function(){return e.cbhandle},this.getView=function(a){return a||(a=0),e.value[a]===t[a]?n[a]:(t[a]=e.value[a],e.formatter?n[a]=e.formatter(e.value[a],e.ctrlhandle):n[a]=e.value[a],n[a])},this.updateClass=function(t,n){e.updateClass(t,n)},this.forceRefresh=function(t){e.forceRefresh(t)},this.getValue=function(t){return t||(t=0),e.value[t]},this.getRelative=function(t){return t||(t=0),e.relative[t]},this.setValue=function(t,n){n||(n=0),e.setValue(t,n)},this.setDisable=function(t){e.setDisable(t)}}var t=angular.module("RangeSlider",[]);t.directive("rangeSlider",["$log","$document","$timeout",function(t,n,a){function i(t,i,s,o){t.initWidget=function(e){e.byStep&&(t.byStep=parseInt(e.byStep)),e.notMore&&(t.notMore=parseInt(e.notMore)),e.notLess&&(t.notLess=parseInt(e.notLess)),e.id&&(t.sliderid=e.id),void 0!==e.value&&(t.value=e.value,t.forceRefresh(50))},t.forceRefresh=function(e){var n=t.value;t.value=[void 0,void 0],a(function(){t.setValue(n[0],0),t.dual&&t.setValue(n[1],1)},e)},t.updateClass=function(e,t){t?i.addClass(e):i.removeClass(e)},t.setDisable=function(e){e?(i.addClass("disable"),t.handles[0].css("visibility","hidden"),t.dual&&t.handles[1].css("visibility","hidden")):(i.removeClass("disable"),t.handles[0].css("visibility","visible"),t.dual&&t.handles[1].css("visibility","visible"))},t.normalize=function(e){var n,a=t.notMore-t.notLess,i=e*a;if(t.byStep>0){var s=(i-i%t.byStep)/t.byStep,o=i%t.byStep,l=o>=.5*t.byStep?t.byStep:0;return n=s*t.byStep+l+t.notLess}if(t.byStep<0){var r=Math.pow(10,-1*t.byStep);return n=t.notLess+parseInt(i*r)/r}return i},t.getValue=function(e,n){t.vertical?t.relative[n]=(e-t.bounds.handles[n].getBoundingClientRect().height)/(t.bounds.bar.getBoundingClientRect().height-t.bounds.handles[n].getBoundingClientRect().height):t.relative[n]=e/(t.bounds.bar.getBoundingClientRect().width-t.bounds.handles[n].getBoundingClientRect().width);var a=t.normalize(t.relative[n]);a!==t.value[n]&&(a<t.startValue&&(a=t.startValue),a>t.stopValue&&(a=t.stopValue),t.formatter?t.viewValue=t.formatter(a,t.ctrlhandle):t.viewValue=a,t.displays[n]&&t.displays[n].html(t.viewValue),t.value[n]=a,o&&o.$setViewValue(t.viewValue),t.$apply(),a>t.startValue&&a<t.stopValue&&t.translate(e,n))},t.setStart=function(e){var n;e>t.value[0]&&(t.dual?t.setValue(e,1):t.setValue(e,0)),t.vertical?(n=t.bounds.bar.getBoundingClientRect().height*(e-t.notLess)/(t.notMore-t.notLess),t.start.css("height",n+"px")):(n=t.bounds.bar.getBoundingClientRect().width*(e-t.notLess)/(t.notMore-t.notLess),t.start.css("width",n+"px")),t.startValue=e},t.setStop=function(e){var n;e<t.value[0]&&(t.dual?t.setValue(e,1):t.setValue(e,0)),t.vertical?(n=t.bounds.bar.getBoundingClientRect().height*(e-t.notLess)/(t.notMore-t.notLess),t.start.css("height",n+"px")):(n=t.bounds.bar.getBoundingClientRect().width*(e-t.notLess)/(t.notMore-t.notLess),t.stop.css({right:0,width:t.bounds.bar.getBoundingClientRect().width-n+"px"})),t.stopValue=e},t.translate=function(e,n){var a;if(t.vertical){var i=t.bounds.bar.getBoundingClientRect().height-e;if(t.handles[n].css({"-webkit-transform":"translateY("+i+"px)","-moz-transform":"translateY("+i+"px)","-ms-transform":"translateY("+i+"px)","-o-transform":"translateY("+i+"px)",transform:"translateY("+i+"px)"}),t.dual){if(t.relative[1]&&t.relative[0]){var s=(t.relative[1]-t.relative[0])*t.bounds.bar.getBoundingClientRect().height;a=t.relative[0]*t.bounds.bar.getBoundingClientRect().height,t.slider.css({bottom:a+"px",height:s+"px"})}}else t.slider.css("height",e+"px")}else if(t.handles[n].css({"-webkit-transform":"translateX("+e+"px)","-moz-transform":"translateX("+e+"px)","-ms-transform":"translateX("+e+"px)","-o-transform":"translateX("+e+"px)",transform:"translateX("+e+"px)"}),t.dual){if(t.relative[1]&&t.relative[0]){var o=(t.relative[1]-t.relative[0])*t.bounds.bar.getBoundingClientRect().width;a=t.relative[0]*t.bounds.bar.getBoundingClientRect().width,t.slider.css({left:a+"px",width:o+"px"})}}else t.slider.css("width",e+"px")},t.setValue=function(e,n){var a;e!==t.value[n]&&(void 0===e&&(e=0),e>t.notMore&&(e=t.notMore),e<t.notLess&&(e=t.notLess),t.vertical?(t.relative[n]=(e-t.notLess)/(t.notMore-t.notLess),0===n&&(a=t.relative[n]*t.bounds.bar.getBoundingClientRect().height+t.bounds.handles[n].getBoundingClientRect().height/2),1===n&&(a=t.relative[n]*t.bounds.bar.getBoundingClientRect().height)):(t.relative[n]=(e-t.notLess)/(t.notMore-t.notLess),a=t.relative[n]*(t.bounds.bar.getBoundingClientRect().width-t.bounds.handles[n].getBoundingClientRect().width)),t.translate(a,n),t.value[n]=e,t.formatter?t.viewValue=t.formatter(e,void 0):t.viewValue=e,o&&o.$setViewValue(t.viewValue),t.displays[n]&&t.displays[n].html(t.viewValue))},t.keydown=function(e){switch(e.keyCode){case 39:case 38:t.byStep>0&&t.$apply(t.setValue(t.value[t.actif]+t.byStep,t.actif)),t.byStep<0&&t.$apply(t.setValue(t.value[t.actif]+1/Math.pow(10,-1*t.byStep),t.actif)),t.callback&&t.callback(t.value[t.actif],t.ctrlhandle);break;case 37:case 40:t.byStep>0&&t.$apply(t.setValue(t.value[t.actif]-t.byStep,t.actif)),t.byStep<0&&t.$apply(t.setValue(t.value[t.actif]-1/Math.pow(10,-1*t.byStep),t.actif)),t.callback&&t.callback(t.value[t.actif],t.ctrlhandle);break;case 27:t.handles[t.actif][0].blur()}},t.moveHandle=function(e,n,a){var i;t.vertical?(i=t.bounds.bar.getBoundingClientRect().bottom-a,i>t.bounds.bar.getBoundingClientRect().height&&(i=t.bounds.bar.getBoundingClientRect().height),i<t.bounds.handles[e].getBoundingClientRect().height&&(i=t.bounds.handles[e].getBoundingClientRect().height)):(i=n-t.bounds.bar.getBoundingClientRect().left,0>i&&(i=0),n+t.bounds.handles[e].getBoundingClientRect().width>t.bounds.bar.getBoundingClientRect().right&&(i=t.bounds.bar.getBoundingClientRect().width-t.bounds.handles[e].getBoundingClientRect().width)),t.getValue(i,e),t.dual&&t.value[0]>t.value[1]&&(0===e?t.setValue(t.value[0],1):t.setValue(t.value[1],0))},t.focusCB=function(e){e?n.on("keydown",t.keydown):n.unbind("keydown",t.keydown)},t.touchBarCB=function(e){var n,a=0,i=e.changedTouches,s=t.value[a];if(e.preventDefault(),t.dual){n=t.vertical?(i[0].pageY-t.bounds.bar.getBoundingClientRect().bottom)/t.bounds.bar.getBoundingClientRect().height:(i[0].pageX-t.bounds.bar.getBoundingClientRect().left)/t.bounds.bar.getBoundingClientRect().width;var o=Math.abs(n-t.relative[0]),l=Math.abs(n-t.relative[1]);o>l&&(a=1)}t.moveHandle(a,i[0].pageX,i[0].pageY),t.callback&&s!==t.value[a]&&t.callback(t.value[a],t.ctrlhandle)},t.touchHandleCB=function(e,a){function s(e){e.preventDefault();for(var n=e.changedTouches,i=0;i<n.length;i++)t.moveHandle(a,n[i].pageX,n[i].pageY)}function o(e){n.unbind("touchmove",s),n.unbind("touchend",o),i.on("touchstart",t.touchBarCB),t.callback&&l!==t.value[a]&&t.callback(t.value[a],t.ctrlhandle)}var l=t.value[a];e.preventDefault(),n.on("touchmove",s),n.on("touchend",o),i.unbind("touchstart",t.touchBarCB)},t.handleCB=function(e,a){function i(e){t.moveHandle(a,e.clientX,e.clientY)}function o(){n.unbind("mousemove",i),n.unbind("mouseup",o),t.callback&&l!==t.value[a]&&t.callback(t.value[a],t.ctrlhandle)}if(!s.automatic){var l=t.value[a];e.preventDefault(),n.on("mousemove",i),n.on("mouseup",o),t.handles[a][0].focus(),t.actif=a}},t.find=function(e,t){var n;n=t?t[0].querySelector(e):i[0].querySelector(e);var a=angular.element(n);return a},t.initialSettings=function(e){var n;t.value=[],t.relative=[],null===t.precision&&(n=(""+t.byStep).match(/\.([\d]*)/),t.precision=n&&n[1]?n[1].length:0),i.on("touchstart",t.touchBarCB),t.handles[0].on("touchstart",function(e){t.touchHandleCB(e,0)}),t.dual&&(t.handles[1].addClass("range-slider-handle"),t.handles[1].on("touchstart",function(e){t.touchHandleCB(e,1)}),t.initvalues||t.setValue(e[1],1)),t.initvalues?t.initWidget(t.initvalues):t.setValue(e[0],0)},t.init=function(){if(t.sliderid=s.id||"slider-"+parseInt(1e3*Math.random()),t.startValue=-(1/0),t.stopValue=1/0,t.byStep=parseInt(s.byStep)||1,t.vertical=s.vertical||!1,t.dual=s.dualHandles||!1,t.trigger_input_change=!1,t.notMore=parseInt(s.notMore)||100,t.notLess=parseInt(s.notLess)||0,t.vertical&&i.addClass("vertical-range"),t.handles=[t.find(".handle-min"),t.find(".handle-max")],t.bar=i,t.slider=t.find(".range-slider-active-segment"),t.start=t.find(".ibz-range-slider-start"),t.stop=t.find(".ibz-range-slider-stop"),t.disable=s.disable||!1,t.ctrlhandle=new e(t),t.bounds={bar:i[0],handles:[t.handles[0][0],t.handles[1][0]]},"true"===s.disable&&t.setDisable(!0),s.displayTarget)switch(s.displayTarget){case!0:case"handle":t.displays=t.handles,t.handles[0].addClass("ibz-range-slider-display"),t.dual&&t.handles[1].addClass("ibz-range-slider-display");break;default:t.displays=[n.getElementById(s.displayTarget)]}else t.displays=[];if(s.initial){var a=s.initial.split(",");t.initial=[void 0!==a[0]?parseInt(a[0]):t.notLess,void 0!==a[1]?parseInt(a[1]):t.notMore]}else t.initial=[t.ngModel,t.ngModel];t.$watch("startAt",function(){t.value<t.startAt,t.startAt&&t.setStart(t.startAt)}),t.$watch("stopAt",function(){t.value>t.stopAt,t.stopAt&&t.setStop(t.stopAt)}),t.initialSettings(t.initial)},t.init(),t.$watch("inithook",function(){t.inithook&&t.inithook(t.ctrlhandle)}),t.$watch("initvalues",function(){t.initvalues&&t.initWidget(t.initvalues)}),t.$watch("ngModel",function(e){t.setValue(e,0)})}var s='<div class="ibz-range-slider range-slider" title="{{title}}"data-slider><span class="range-slider-handle handle-min" ng-mousedown="handleCB($event,0)" ng-focus="focusCB(true)" ng-blur="focusCB(false)" role="slider" tabindex="0"></span><span class="handle-max" ng-mousedown="handleCB($event,1)" ng-focus="focusCB(true)" ng-blur="focusCB(false)" role="slider" tabindex="0"></span><span class="range-slider-active-segment"></span><span class="ibz-range-slider-start" ></span> <span class="ibz-range-slider-stop"></span> <input id={{sliderid}} type="hidden"></div>';return{restrict:"E",scope:{startAt:"=",stopAt:"=",callback:"=",formatter:"=",inithook:"=",cbhandle:"=",initvalues:"=",ngModel:"="},require:"?ngModel",template:s,replace:!0,link:i}}])}(),function(){"use strict";var e='<div class="afb-monitor" ng-click="getping()"><span class="afb-refresh-token" >afb://{{hostname}}:{{httpdport}}</span><i class="{{icon}}"></i></div>';angular.module("TokenRefresh",["ConfigApp","ModalNotification"]).directive("tokenRefresh",["$timeout","$http","$location","Notification","ConfigApp",function(t,n,a,i,s){function o(e,o,l){e.status=void 0,e.online=function(){o.addClass("online"),o.removeClass("offline")},e.offline=function(){o.addClass("offline"),o.removeClass("online")},e.onerror=function(t,n,a){e.status!==!1&&(i.warning({message:"AppFramework Binder Lost",delay:5e3}),e.offline()),e.status=0},e.onsuccess=function(t,n,a,o){e.status!==!0&&(t.request.token&&(s.session.token=t.request.token),t.request.uuid&&(s.session.uuid=t.request.uuid),t.request.timeout&&(s.session.timeout=t.request.timeout),i.success({message:"AppFramework Binder Back to Live",delay:3e3}),e.online()),e.status=1},e.getping=function(){var a=n.get(s.session.ping+"?token="+s.session.token);a.success(e.onsuccess),a.error(e.onerror),t(e.getping,1e3*s.session.pingrate)},e.refresh=function(){var a=n.get(s.session.refresh+"?token="+s.session.token);a.success(e.onsuccess),a.error(e.onerror),t(e.refresh,250*s.session.timeout)},e.tkcreate=function(){var t=n.get(s.session.create+"?token="+s.session.initial);t.success(e.onsuccess),t.error(e.onerror)},e.icon=l.icon||"fi-lightbulb",e.hostname=a.host(),e.httpdport=a.port(),e.autolog=JSON.parse(l.autolog||!1),e.autolog&&e.tkcreate(),t(e.getping,1e3*s.session.pingrate),t(e.refresh,250*s.session.timeout)}return{template:e,scope:{callback:"="},restrict:"E",link:o}}])}(),function(){"use strict";var e='<div class="tip-modal-popup"><i class="{{icon}}"></i><span>{{tip}}</span></span></div>';angular.module("ModalNotification",[]).directive("tipModal",["$timeout",function(t){function n(e,n,a){function i(){function n(){e.show&&e.modal.css({opacity:1,visibility:"visible"})}e.show=!0,e.timeout=t(n,e.delay)}function s(){e.show=!1,e.modal.css({opacity:0,visibility:"hidden"})}e.parent=n.parent(),e.modal=n.find("div"),e.icon=a.icon||"fi-lightbulb",e.parent.addClass("as-modal-tip"),e.parent.bind("click",s),e.parent.bind("focus",i),e.parent.bind("mouseover",i),e.parent.bind("mouseleave",s),e.parent.bind("blur",s),e.delay=a.delay||1e3}return{restrict:"E",template:e,link:n,scope:{tip:"="}}}])}(),function(){"use strict";var e='<span title="Goto: {{href}}" ng-click="clicked()"><i class="{{icon}}"></i><span>{{label}}</span></span>';angular.module("LinkButton",[]).directive("linkButton",["$location",function(t){function n(e,n,a){e.clicked=function(){a.query?t.path(a.href).search(a.query):t.path(a.href)},e.icon=a.icon||"fi-link",e.label=a.label||"Jump",e.href=a.href||"/home",n.addClass(e.label.toLowerCase())}return{restrict:"E",template:e,link:n,scope:{}}}])}(),function(){"use strict";function e(e,t,n,a,i){var s=new XMLHttpRequest,o=new FormData,l=function(e){i(e)};s.upload.onprogress=function(t){var n=Math.round(t.lengthComputable?100*t.loaded/t.total:0);e.slider&&e.slider.setValue(n)},s.onload=function(){t.addClass("success"),t.removeClass("error");var n={status:s.status,headers:s.getAllResponseHeaders()};e.callback(n)},s.onerror=function(){t.addClass("error"),t.removeClass("success");var n={status:s.status,headers:s.getAllResponseHeaders()};e.callback(n)},s.onabort=function(){t.addClass("error"),t.removeClass("success");var n={status:s.status,headers:s.getAllResponseHeaders()};e.callback(n)};for(var r=0;r<a.length;r++){var u=a[r];if(u.type.match(e.mimetype)){if(u.size>1024*e.maxsize)return e.thumbnail=e.istoobig,void e.$apply("thumbnail");if(isNaN(u.size))return e.thumbnail=e.isnotvalid,void e.$apply("thumbnail");if(e.Basename=u.name.split("/").reverse()[0],e.imgElem[0].file=u,i){var c=new FileReader;c.readAsArrayBuffer(u),c.onload=l}o.append(e.name,u,u.name)}}s.open("POST",n,!0),s.send(o)}var t='<input type="file" name="{{name}}-input" onchange="angular.element(this).scope().UpLoadFile(this.files)" accept="{{mimetype}}" style="display:none"><div class="upload-file" ng-click="imgClicked()"><img id="{{name}}-img" src="{{thumbnail}}"><range-slider ng-show="!noslider" id="{{name}}-slider" automatic=true inithook="SliderInitCB"></range-slider></div>';angular.module("UploadFiles",["ConfigApp","ModalNotification","RangeSlider"]).directive("uploadImage",["ConfigApp","JQemu","Notification",function(n,a,i){function s(t,a,i){if(t.imgElem=a.find("img"),t.inputElem=a.find("input"),t.imgClicked=function(){t.inputElem[0].click()},t.SliderInitCB=function(e){t.slider=e},t.UpLoadFile=function(s){var o=function(e){return t.imgElem[0].src=window.URL.createObjectURL(new Blob([e.target.result],{type:"image"})),!0},l=i.posturl+"?token="+n.session.token;new e(t,a,l,s,o)},t.name=i.name||"avatar",t.category=i.category||"image",t.mimetype=(i.accept||"image")+"/*",t.maxsize=i.maxsize||100,t.regexp=new RegExp(i.accept+".*","i"),i.thumbnail?t.thumbnail=n.paths[t.category]+i.thumbnail:t.thumbnail=n.paths[t.category]+"tux-bzh.png",i.thumbnail?t.isnotvalid=n.paths[t.category]+i.isnotvalid:t.isnotvalid=n.paths[t.category]+"isnotvalid.png",i.istoobig?t.istoobig=n.paths[t.category]+i.istoobig:t.istoobig=n.paths[t.category]+"istoobig.png",t.noslider=i.noslider||!1,!i.posturl)throw new TypeError("file-upload %s posturl=/api/xxxx/xxxx required",t.attrs)}return{restrict:"E",template:t,link:s,scope:{callback:"="}}}]).directive("uploadAudio",["ConfigApp","JQemu","Notification",function(n,a,i){function s(t,a,i){if(t.imgElem=a.find("img"),t.inputElem=a.find("input"),t.imgClicked=function(){t.inputElem[0].click()},t.SliderInitCB=function(e){t.slider=e},t.UpLoadFile=function(s){var o=i.posturl+"?token="+n.session.token;new e(t,a,o,s,!1)},t.name=i.name||"audio",t.category=i.category||"audio",t.mimetype=(i.accept||"audio")+"/*",t.maxsize=i.maxsize||1e4,t.regexp=new RegExp(i.accept+".*","i"),i.thumbnail?t.thumbnail=n.paths[t.category]+i.thumbnail:t.thumbnail=n.paths[t.category]+"upload-music.png",i.thumbnail?t.isnotvalid=n.paths[t.category]+i.isnotvalid:t.isnotvalid=n.paths[t.category]+"isnotvalid.png",i.istoobig?t.istoobig=n.paths[t.category]+i.istoobig:t.istoobig=n.paths[t.category]+"istoobig.png",t.noslider=i.noslider||!1,!i.posturl)throw new TypeError("file-upload %s posturl=/api/xxxx/xxxx required",t.attrs)}return{restrict:"E",template:t,link:s,scope:{callback:"="}}}]).directive("uploadAppli",["ConfigApp","JQemu","Notification",function(n,a,i){function s(t,a,i){if(t.imgElem=a.find("img"),t.inputElem=a.find("input"),t.imgClicked=function(){t.inputElem[0].click()},t.SliderInitCB=function(e){t.slider=e},t.UpLoadFile=function(s){var o=function(e){var a=new JSZip(e.target.result),i=a.file("afa-pkg/thumbnail.jpg");return i?(t.imgElem[0].src=window.URL.createObjectURL(new Blob([i.asArrayBuffer()],{type:"image"})),!0):(t.thumbnail=n.paths[t.category]+"isnotvalid.png",t.$apply("thumbnail"),!1)},l=i.posturl+"?token="+n.session.token;new e(t,a,l,s,o)},t.name=i.name||"appli",t.category=i.category||"appli",t.mimetype=i.accept||".zip",t.maxsize=i.maxsize||1e5,t.regexp=new RegExp(i.accept+".*","i"),i.thumbnail?t.thumbnail=n.paths[t.category]+i.thumbnail:t.thumbnail=n.paths[t.category]+"upload-appli.png",i.thumbnail?t.isnotvalid=n.paths[t.category]+i.isnotvalid:t.isnotvalid=n.paths[t.category]+"isnotvalid.png",i.istoobig?t.istoobig=n.paths[t.category]+i.istoobig:t.istoobig=n.paths[t.category]+"istoobig.png",t.noslider=i.noslider||!1,!i.posturl)throw new TypeError("file-upload %s posturl=/api/xxxx/xxxx required",t.attrs)}return{restrict:"E",template:t,link:s,scope:{callback:"="}}}])}(),function(){"use strict";var e='<tip-modal tip="tip"></tip-modal><label for="{{name}}-intext">{{label}} <i ng-show="required" ng-click="ToBeDefined" class="required {{status}} fi-checkbox" title="Free Value But Mandatory Argument" alt="?"> </i></label><input type="{{type}}" id="{{name}}-intext" placeholder="{{placeholder}}" class="status-{{status}}" ng-model="value" ng-blur="validate()" ng-focus="selected()" ng-model-options="{ updateOn: \'default blur\', debounce: {default: 500, blur: 0} }"><alert data-ng-show="!valid&&errmsg">{{errmsg}}</alert>',t=/^(([^<>()[\]\.,;:\s@\"]+(\.[^<>()[\]\.,;:\s@\"]+)*)|(\".+\"))@(([^<>()[\]\.,;:\s@\"]+\.)+[^<>()[\]\.,;:\s@\"]{2,})$/i;angular.module("InputText",["JQueryEmu"]).directive("inputText",["JQemu",function(n){function a(e,a,i){e.error=!1,e.valid=!1,e.status="untouch",e.input=a.find("input"),e.required=0,"required"in i&&(e.required=1,a.addClass("required")),e.selected=function(){e.error=!1,e.errmsg=!1,e.status="touch"},e.validate=function(){e.parent.removeClass("ng-pristine"),e.value?(e.error=!1,e.value=e.value.trim(),"nospace"in i&&(e.value=e.value.replace(/\s/g,"")),"lowercase"in i&&(e.value=e.value.toLowerCase()),"minlen"in i&&e.value.length<i.minlen&&(e.status="invalid",e.errmsg=e.name+": Mininum Lengh= "+i.minlen+" Characters",e.error=!0),"email"in i&&(t.test(e.value)||(e.status="invalid",e.errmsg="invalid email address",e.error=!0))):e.required&&(e.status="invalid",e.errmsg=e.name+": Required Attribute",e.error=!0),e.error?(e.required&&e.valid&&(e.valid=!1,e.l4acounter.validated>0&&e.l4acounter.validated--),e.callback(i.name,null,e.done)):(e.required&&!e.valid&&e.l4acounter.validated++,e.status="valid",e.valid=!0,e.callback(i.name,e.value,e.done))},e.done=function(t){for(var n in t)e[n]=t[n]},e.label=i.label,e.name=i.name,e.placeholder=i.placeholder,e.type=i.type||"text",e.tip=i.tip,e.parent=n.parent(a,"FORM"),"email"in i&&(i.lowercase=!0,i.nospace=!0,i.minlen=6),e.required&&(e.l4acounter=e.parent.data("l4acounter"),e.l4acounter?e.l4acounter.required++:(e.l4acounter={required:1,validated:0},e.parent.data("l4acounter",e.l4acounter))),e.$watch("value",function(){e.value&&e.validate()})}return{restrict:"E",template:e,link:a,scope:{callback:"=",value:"="}}}])}(),function(){"use strict";var e='<input-text class="password" tip="{{tip1}}" placeholder="{{place1}}"label="{{label1}}" callback="valid1" name="{{name}}-1" value="pass1" required minlen="{{minlen}}" type="password" ></input-text><input-text class="password" tip="tip2" placeholder="{{place2}}"label="{{label2}}" callback="valid2" name="{{name}}-2" value="pass2" required minlen="{{minlen}}" type="password" > </input-text>';angular.module("InputPassword",[]).directive("inputPassword",function(){function t(e,t,n){e.valid1=function(t,n){e.firstpwd=n},e.valid2=function(t,a,i){e.firstpwd!==a?i({valid:!1,status:"invalid",errmsg:"both password should match"}):e.callback(n.name,a)},e.done=function(t){for(var n in t)e[n]=t[n]},e.name=n.name,e.label1=n.label||"Password",e.label2=n.label||"Password Verification",e.place1=n.placeholder1||"User Password",e.tip1=n.tip||"Choose a Password",e.place2=n.placeholder1||"Password Verification",e.tip2=n.tip||"Confirme your Password",e.minlen=n.minlen||10,"required"in n&&(e.required="required")}return{restrict:"E",template:e,link:t,scope:{callback:"="}}})}(),function(){"use strict";angular.module("SampleModule",["SubmitButton","UploadFiles"]).controller("SampleController",["$http",function(e){var t=this;t.FileUploaded=function(e){}}])}(),function(){"use strict";angular.module("HomeModule",["SubmitButton","TokenRefresh"]).controller("HomeController",["$http","ConfigApp",function(e,t){var n=this;n.uuid="none",n.token="none",n.session="none",n.status="err-no",n.ProcessResponse=function(e,a,i,s){var o="API"+e.request.api.replace("-","_");n.status="err-ok",n.errcode=a,n.request=e.request,n.response=e.response,e.request.token&&(t.session.token=e.request.token),e.request.uuid&&(t.session.uuid=e.request.uuid),e.request.timeout&&(t.session.timeout=e.request.timeout),("APIcreate"===o||"APIreset"===o)&&(n.APIreset="",n.APIcreate="",n.APIrefresh="",n.APIcheck=""),n[o]="success",e.request.token&&(n.token=e.request.token)},n.ProcessError=function(e,t,a,i){var s="API"+e.request.api.replace("-","_");n.status="err-fx",n.errcode=t,n.request=e.request,n.response="",n[s]="fail"},n.OpenSession=function(){var a={},i=e.post(t.session.create+"?token="+t.session.initial,a);i.success(n.ProcessResponse),i.error(n.ProcessError)},n.CheckSession=function(){var a={},i=e.post(t.session.check+"?token="+t.session.token,a);i.success(n.ProcessResponse),i.error(n.ProcessError)},n.RefreshSession=function(){var a={},i=e.post(t.session.refresh+"?token="+t.session.token,a);i.success(n.ProcessResponse),i.error(n.ProcessError)},n.ResetSession=function(){var a={},i=e.post(t.session.reset+"?token="+t.session.token,a);i.success(n.ProcessResponse),i.error(n.ProcessError)}}])}(),function(){"use strict";angular.module("JQueryEmu",[]).factory("JQemu",function(){var e=function(e,t){for(var n=e,a=t.toUpperCase();n[0];){if(a===n[0].tagName)return n;n=n.parent()}},t=function(e,t,n){for(var a=n.toLowerCase(),i=t.toLowerCase()+"Name",s=e.children();s[0];){if(a===s[0][i])return s;s=s.next()}},n=function(e,t){for(var n=t.toLowerCase(),a=e.children();a[0];){if(a.hasClass(n))return a;a=a.next()}},a={FindInParent:e,FindByTag:t,FindByClass:n};return a})}();var foundationRoutes=[{name:"mysample",url:"/sample",controller:"SampleController as ctrl",animationIn:"slideInRight",path:"pages/Sample/Sample.html"},{name:"myhome",url:"/home",controller:"HomeController as ctrl",animationIn:"slideInRight",path:"pages/Home/Home.html"}];!function(){"use strict";angular.module("ConfigApp",[]).factory("ConfigApp",["$location","$window",function(e,t){var n={paths:{image:"images/",avatar:"images/avatars/",audio:"images/audio/",appli:"images/appli/"},myapi:{token:"/api/myplugin/xxxx"},session:{create:"/api/token/create",refresh:"/api/token/refresh",check:"/api/token/check",reset:"/api/token/reset",ping:"/api/token/check",initial:"123456789",timeout:3600,pingrate:60,uuid:"",token:""}};return n}])}(),function(){"use strict";function e(e,t,n){e.otherwise("/home"),t.html5Mode(!0).hashPrefix("!")}function t(){FastClick.attach(document.body)}angular.module("AFBclient",["ui.router","ngAnimate","foundation","foundation.dynamicRouting","foundation.dynamicRouting.animations","ui-notification","ConfigApp","JQueryEmu","HomeModule","SampleModule","UploadFiles","LinkButton","TokenRefresh","RangeSlider","ModalNotification"]).config(e).run(t),e.$inject=["$urlRouterProvider","$locationProvider"]}(),function(){angular.module("AFBclient").run(["$templateCache",function(e){e.put("pages/Sample/Sample.html",'<h1><img class="logo" src="images/logo/triskel_iot_bzhx250.png" alt="IoT.bzh Logo" style="height:150px"> Post File Upload</h1><div class="sample-box box-content"><upload-image name="avatar" category="avatar" thumbnail="tux-visitor.png" maxsize="100" posturl="/api/post/upload-image" callback="ctrl.FileUploaded" accept="image" title="Change your Avatar"></upload-image><upload-audio name="music" posturl="/api/post/upload-music" callback="ctrl.FileUploaded" title="Upload your Music"></upload-audio><upload-appli name="appli" posturl="/api/post/upload-appli" callback="ctrl.FileUploaded" title="Upload AGL App"></upload-appli></div><link-button href="home" icon="fi-home" label="home"></link-button>')}])}(),function(){angular.module("AFBclient").run(["$templateCache",function(e){e.put("pages/Home/Home.html",'<h3><img class="logo" src="images/logo/triskel_iot_bzhx250.png" alt="IoT.bzh Logo" style="height:150px"> App Framework Binder Simple Client</h3><token-refresh autolog="true"></token-refresh><div class="button-box box-content"><submit-button class="session-button {{ctrl.APIcreate}}" icon="fi-unlock" label="Open" clicked="ctrl.OpenSession"></submit-button><submit-button class="session-button {{ctrl.APIcheck}}" icon="fi-checkbox" label="Check" clicked="ctrl.CheckSession"></submit-button><submit-button class="session-button {{ctrl.APIrefresh}}" icon="fi-arrows-compress" label="Refresh" clicked="ctrl.RefreshSession"></submit-button><submit-button class="session-button {{ctrl.APIreset}}" icon="fi-lock" label="Close" clicked="ctrl.ResetSession"></submit-button></div><div class="message-box box-content vertical grid-frame"><div class="response"><span class="grid-content noscroll req {{ctrl.status}}">req= {{ctrl.request}}</span> <span class="grid-content noscroll res {{ctrl.status}}">res= {{ctrl.response}}</span> <span class="grid-content noscroll status {{ctrl.status}}">status= {{ctrl.errcode}}</span></div></div><link-button href="sample" icon="fi-home" label="sample"></link-button>')}])}();