ko.dirtyFlag=function(n,t){var i=function(){},u=ko.observable(ko.toJS(n)),r=ko.observable(!1),f=ko.observable(t);return i.isDirty=ko.computed(function(){var t=!u().equals(ko.toJS(n));return(t&&r(!0),f()||t)?!0:!t&&r()==!0?!0:!1}),i.reset=function(t){u(ko.toJS(n)),f(t),r(!1)},i},ko.bindingHandlers.stopBinding={init:function(){return{controlsDescendantBindings:!0}}},ko.bindingHandlers.lengthBinding={_oldValue:"0",init:function(n){$(n).focus(function(){_oldValue=$(n).val()}),$(n).focusout(function(){newStr=$(n).val(),currentId=$(n).attr("id"),newStr!=_oldValue&&(old_value_for_ruby=FixCharsForRuby(_oldValue),new_value_for_ruby=FixCharsForRuby(newStr),len=new_value_for_ruby.substring(0,new_value_for_ruby.length-2),parseFloat(len)<.0625&&(new_value_for_ruby='0.0625"',$(n).val(new_value_for_ruby)),RunCallback("skp:OnRequestLength@"+currentId+"|"+new_value_for_ruby+"|"+old_value_for_ruby))})},update:function(n,t){internalVal=ko.utils.unwrapObservable(t()),id=$(n).attr("id"),oldDisplayValue=$(n).val(),oldDisplayValue==""&&(oldDisplayValue='0"'),oldInternalVal=$('[id="'+id+'"] + input').val(),firstPass=!1,oldInternalVal==""&&(oldInternalVal=0,firstPass=!0),(internalVal-oldInternalVal!=0||firstPass)&&(old_value_for_ruby=FixCharsForRuby(oldDisplayValue),new_value_for_ruby=internalVal+'"',RunCallback("skp:OnRequestLength@"+id+"|"+new_value_for_ruby+"|"+old_value_for_ruby))}},ko.bindingHandlers.slopeBinding={self:this,oldValue:"",vm:null,init:function(n,t,i,r){vm=r,$(n).focus(function(){self.oldValue=$(n).val()}),$(n).focusout(function(){currentId=$(n).attr("id"),newStr=$(n).val(),newStr!=self.oldValue&&(vm.guiObservables.firstSlopeString(newStr),old_value_for_ruby=FixCharsForRuby(self.oldValue),new_value_for_ruby=newStr,new_value_for_ruby=FixCharsForRuby(new_value_for_ruby),RunCallback("skp:OnRequestSlope@"+new_value_for_ruby+"|"+old_value_for_ruby))})},update:function(n,t){internalVal=ko.utils.unwrapObservable(t()),$(n).val(internalVal)}},ko.extenders.minimumInteger=function(n,t){var i=ko.computed({read:n,write:function(i){var u=n(),r=isNaN(i)?u:parseInt(+i);r<t&&(r=u),r!=u?n(r):n.notifySubscribers(r)}});return i(n()),i},ko.extenders.maximumInteger=function(n,t){var i=ko.computed({read:n,write:function(i){var u=n(),r=isNaN(i)?u:parseInt(+i);r>t&&(r=u),r!=u?n(r):n.notifySubscribers(r)}});return i(n()),i}